/* ============================================================
   前台样式表 style.css
   ------------------------------------------------------------
   1:1 复刻参考站（https://cs.iwzhe.com/diy/）全部样式
   纯原生 CSS，无任何第三方框架，全站响应式
   结构：
     1. 全局重置与基础
     2. 金色粒子背景动画
     3. 页面骨架（wrapper / container）
     4. 头像 / 标题 / 简介
     5. 链接模块（实心/空心/居中/居左）
     6. 底部文字模块
     7. 密码弹窗
     8. 图片查看器
     9. 视频模块
    10. 公告弹窗
    11. 音乐按钮
    12. 联系方式栏 + 弹窗
    13. 轮播模块
============================================================ */

/* ============ 1. 全局重置与基础 ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, sans-serif;
}

/* 移动端优化：去点击高亮、禁止长按选择（复刻参考站行为） */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* 页面主体：水平居中 + 浅灰背景 */
body {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px 16px;
    background: #f0f0f0;
}

/* ============ 2. 背景特效层 ============ */
#goldParticles, #snowContainer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
#ribbonCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.gold-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: rgba(212, 175, 55, 0.4);
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.3);
}

/* ============ 3. 页面骨架 ============ */
.wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
/* 主容器：手机全宽 / 桌面最大 720px 居中 */
.container {
    width: 100%;
    max-width: 720px;
    min-width: 257px;
    margin: 0 auto;
    text-align: center;
}

/* ============ 4. 头像 / 标题 / 简介 ============ */
.avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    margin: 20px auto;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: block;
}
/* 站点头像 */
.site-avatar {
    text-align: center;
    margin: 0 auto 12px;
}
.site-avatar img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0,0,0,0.06);
    display: block;
    margin: 0 auto;
}

.title {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    color: #222;
}
.desc {
    font-size: 14px;
    color: #333;
    text-align: center;
    margin-bottom: 40px;
}

/* ============ 5. 链接模块 ============ */
/* 基础卡片：白色圆角长条 + 浅阴影 */
.link-item {
    min-width: 257px;
    width: 100%;
    max-width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    margin: 0 auto 16px;
    text-decoration: none;
    color: #222;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    background: #fff;
    position: relative;
    cursor: pointer;
}
/* 标题居中变体 */
.link-item.text-center .link-title {
    text-align: center;
    flex: 1;
}
/* 标题居左变体 */
.link-item.text-left .link-title {
    text-align: left;
    flex: 1;
}
/* 空心变体：透明底 + 黑色描边 */
.link-item.outline {
    background: transparent !important;
    box-shadow: none;
    border: 1px solid #222;
    color: #222 !important;
}
/* 悬停微放大动画 */
.link-item:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}
/* 链接左侧圆形图标 */
.link-icon {
    width: 42px;
    height: 42px;
    margin-left: 0;
    margin-right: 14px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
/* 链接标题：占满剩余空间 */
.link-title {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}
/* 右侧箭头图标 */
.link-arrow {
    width: 24px;
    height: 24px;
    fill: #888;
    transition: transform 0.2s;
    flex-shrink: 0;
}

/* ============ 6. 底部文字模块 ============ */
.footer-bottom-text {
    margin: 12px auto;
    font-size: 14px;
    line-height: 1.6;
    color: #222;
    word-break: break-word;
}

/* ============ 7. 加密链接密码弹窗 ============ */
#passcodeModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.passcode-box {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 320px;
    text-align: center;
}
/* 4 位密码输入框 */
.passcode-input {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 24px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
}
.passcode-input:focus { border-color: #7c3aed; }
/* 提示文字区（错误红 / 成功绿） */
#tipText {
    height: 20px;
    line-height: 20px;
    font-size: 13px;
    margin-bottom: 15px;
}
.tip-error { color: #ff4d4f; }
.tip-success { color: #00b42a; }

/* ============ 8. 图片查看器 ============ */
#imageViewer {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#imageViewer img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    object-fit: contain;
}
#imageViewer .close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    color: #000;
    z-index: 10;
}

/* ============ 9. 视频模块 ============ */
.video-module { margin: 0 auto 16px; }
.video-player-wrap {
    margin: 12px auto 0;
    border-radius: 12px;
    overflow: hidden;
}
.video-player-wrap video {
    width: 100%;
    display: block;
    border-radius: 12px;
}
.video-close-btn {
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    font-size: 20px;
    color: #888;
    background: #f0f2f5;
    border-radius: 50%;
    cursor: pointer;
    margin: 10px auto 0;
    user-select: none;
    transition: background 0.15s;
}
.video-close-btn:hover { background: #e0e2e6; }

/* ============ 10. 公告弹窗 ============ */
#announcementModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.announcement-box {
    background: #fff;
    border-radius: 16px;
    padding: 24px 24px 0;
    width: 100%;
    max-width: 320px;
    max-height: 70vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    animation: announceIn 0.3s ease-out; /* 弹入动画 */
}
@keyframes announceIn {
    from { transform: scale(0.6); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.announcement-content {
    font-size: 14px;
    line-height: 1.7;
    color: #696969;
    white-space: pre-wrap;   /* 保留数据库中的换行 */
    word-wrap: break-word;
}
.announcement-content h1,
.announcement-content h2,
.announcement-content h3 { margin: 16px 0 8px; }
.announcement-content p { margin: 8px 0; }
.announcement-content img { max-width: 100%; border-radius: 8px; }
.announcement-btns {
    display: flex;
    border-top: 1px solid #f0f0f0;
    margin: 16px -24px 0;
    overflow: hidden;
    border-radius: 0 0 16px 16px;
}
.announcement-btns > div {
    flex: 1;
    padding: 14px 0;
    font-size: 15px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}
.announcement-btns > div:hover { background: #fafafa; }
.announcement-btn-primary {
    color: #7c3aed;
    font-weight: 500;
    border-left: 1px solid #f0f0f0;
}
.announcement-btn-secondary {
    color: #888;
}

/* ============ 11. 音乐按钮 ============ */
#musicBtn {
    position: fixed;
    top: 16px;
    right: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9997;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
    border: none;
    width: 44px;
    height: 44px;
}
/* 黑白两种底色的音乐按钮（深色页面可用黑色版本） */
#musicBtn.music-btn-black { background: rgba(0, 0, 0, 0.55); }
#musicBtn.music-btn-white { background: rgba(255, 255, 255, 0.8); }
#musicBtn:hover { transform: scale(1.08); }
#musicBtn img { width: 24px; height: 24px; display: block; }
/* 播放时按钮图标旋转 */
#musicBtn.spin img { animation: musicSpin 3s linear infinite; }
@keyframes musicSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ============ 12. 联系方式栏 + 弹窗 ============ */
.contact-bar {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin: 12px auto 30px;
}
.contact-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.15s;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.contact-icon:hover { transform: scale(1.15); }
#contactModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.contact-modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 0;
    width: 100%;
    max-width: 300px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    animation: announceIn 0.3s ease-out;
}
.contact-modal-box .contact-val {
    font-size: 16px;
    font-weight: 600;
    color: #1a1d29;
    margin: 8px 0 18px;
    word-break: break-all;
}
.contact-modal-box .contact-btns {
    display: flex;
    border-top: 1px solid #f0f0f0;
    margin: 0 -24px;
    margin-top: 18px;
    overflow: hidden;
    border-radius: 0 0 16px 16px;
}
.contact-modal-box .contact-btns div {
    flex: 1;
    padding: 14px 0;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}
.contact-modal-box .contact-btns div:hover { background: #fafafa; }
.contact-modal-box .contact-btns .btn-copy { color: #ef4444; font-weight: 500; }
.contact-modal-box .contact-btns .btn-cancel {
    color: #888;
    border-right: 1px solid #f0f0f0;
}

/* ============ 13. 底部版权栏 ============ */
.copyright-bar {
    text-align: center;
    font-size: 13px;
    color: #888;
    padding: 20px 0 10px;
    margin: 0 auto;
    user-select: text;
    -webkit-user-select: text;
    width: 100%;
}

/* ============ 14. 轮播模块 ============ */
.slider-module {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 16px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.slider-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    touch-action: pan-y;   /* 保留纵向滚动，横向滑动切页 */
}
/* 轨道为绝对定位层，幻灯片在轨道内横移 */
.slider-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.slider-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.4s ease;
    will-change: transform;
}
/* 通过 data-pos 控制幻灯片位置：0 当前 / 1 右侧 / -1 左侧 */
.slider-slide[data-pos="0"]  { transform: translateX(0); }
.slider-slide[data-pos="1"]  { transform: translateX(100%); }
.slider-slide[data-pos="-1"] { transform: translateX(-100%); }
.slider-slide a,
.slider-slide a img { display: block; width: 100%; height: 100%; }
.slider-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* 轮播图底部渐变标题 */
.slider-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 16px 14px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}
/* 指示圆点 */
.slider-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    z-index: 3;
    padding: 4px 0;
}
.slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    padding: 0;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}
/* 当前页圆点变成长条高亮 */
.slider-dot.active {
    background: #fff;
    width: 20px;
    border-radius: 3px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}
/* 左右切换箭头（悬停显示，移动端隐藏） */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s;
}
.slider-module:hover .slider-arrow { opacity: 1; }
.slider-arrow-left  { left: 8px; }
.slider-arrow-right { right: 8px; }
/* 移动端（<=768px）：隐藏箭头，改用手指滑动 */
@media (max-width: 768px) {
    .slider-arrow { display: none !important; }
}

/* ============ 15. 宫格模块 ============ */
.grid-module {
    display: grid;
    gap: 12px;
    margin: 0 auto 16px;
    width: 100%;
}
.grid-item {
    text-align: center;
}
.grid-link-wrap {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 12px;
    padding: 12px 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s;
}
.grid-link-wrap:hover { transform: scale(1.03); }
.grid-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    margin: 0 auto 8px;
    display: block;
}
.grid-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.grid-btn {
    display: inline-block;
    padding: 4px 16px;
    background: #f59e0b;
    color: #fff;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
/* 宫格响应式：手机端适当缩小间距 */
@media (max-width: 768px) {
    .grid-module { gap: 8px; }
    .grid-icon { width: 48px; height: 48px; }
    .grid-title { font-size: 12px; }
}
