/* ======================================================
   common.css — XX传奇官方网站公共样式
   所有页面共享，页面专有样式写在各自的 <style> 块中
   ====================================================== */

/* ================= 全局基础设置 ================= */
* { margin: 0; padding: 0; box-sizing: border-box; outline: none; }
body {
    font-family: 'Microsoft YaHei', 'SimHei', sans-serif;
    background: url('https://images.unsplash.com/photo-1542751371-adc38448a05e?q=80&w=2070&auto=format&fit=crop') center/cover no-repeat fixed;
    color: #dcdcdc;
    display: flex; height: 100vh; overflow: hidden; position: relative;
}
body::before {
    content: none;
}

/* ================= 烟花画布 ================= */
#fireworks-canvas {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 0;
}

/* ================= 滚动条 ================= */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb { background: rgba(107, 21, 21, 0.8); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #ffd700; }

/* ================= 左侧菜单栏 ================= */
.sidebar {
    width: 280px; flex-shrink: 0;
    background: rgba(20, 5, 5, 0.25);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border-right: none;
    display: flex; flex-direction: column;
    box-shadow: 5px 0 25px rgba(0,0,0,0.7); z-index: 10;
}
.logo {
    width: 280px; height: 125px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    position: relative; overflow: hidden;
}
.logo::before {
    content: none;
}
.logo-img {
    width: 280px; height: 125px;
    object-fit: contain; display: block;
    position: relative; z-index: 2;
}
.logo h1 {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
.menu { flex: 1; list-style: none; padding: 25px 0; overflow-y: auto; }
.menu li { margin-bottom: 15px; padding: 0 25px; }
.menu li a {
    display: flex; align-items: center; justify-content: flex-start;
    padding: 16px 20px 16px 45px; color: #ddd; text-decoration: none; font-size: 16px;
    background: rgba(255, 255, 255, 0.03); border: none; border-radius: 8px;
    transition: all 0.3s ease; cursor: pointer;
}
.menu li a i { width: 26px; text-align: center; margin-right: 15px; color: #b83b3b; font-size: 18px; }
.menu li a:hover, .menu li.active a {
    background: rgba(200, 30, 30, 0.3); color: #ffd700;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); transform: translateY(-2px);
}
.menu li a:hover i, .menu li.active a i { color: #ffd700; }
.copyright {
    padding: 15px; text-align: center; font-size: 12px; line-height: 1.6;
    color: rgba(255,255,255,0.4); background: rgba(0,0,0,0.2);
}

/* ================= 右侧内容区通用 ================= */
.main-content {
    flex: 1; display: flex; flex-direction: column; padding: 25px 30px;
    background: transparent; overflow: hidden; position: relative; z-index: 5;
    padding-bottom: 25px;
}

/* 公共内容面板 */
.content-panel {
    background: rgba(12, 2, 2, 0.65); border: none; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* ================= 底部健康版权固定通栏 ================= */
.bottom-health-copyright {
    position: fixed; bottom: 0; right: 0; width: calc(100% - 280px);
    /* 默认半透明深色，动态主题可覆盖 */
    background: rgba(12, 2, 2, 0.6);
    border-top: 1px solid rgba(255, 215, 0, 0.15);
    box-shadow: none;
    text-align: center; z-index: 100;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 14px 0 15px;
    height: auto; min-height: 0;
}
.bottom-health-copyright h3 { display: none; }
.bottom-health-copyright p { font-size: 12px; color: rgba(255,255,255,0.5); margin: 0; line-height: 1.6; }

/* ================= 右侧悬浮客服菜单 ================= */
.float-bar {
    position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 999;
    display: flex; flex-direction: column; box-shadow: -2px 0 10px rgba(0,0,0,0.5);
}
.float-item {
    width: 70px; height: 70px;
    background: linear-gradient(135deg, #a02020, #6b1515);
    border-bottom: 1px solid rgba(255,215,0,0.2);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; color: #ccc; transition: all 0.3s; position: relative;
}
.float-item:first-child { border-top-left-radius: 4px; }
.float-item:nth-last-child(2) { border-bottom-left-radius: 4px; border-bottom: none; }
.float-item:hover { background: #ffd700; color: #200404; width: 80px; }
.float-item i { font-size: 24px; margin-bottom: 5px; }
.float-item span { font-size: 12px; }

/* 弹出卡片 */
.pop-card {
    position: absolute; right: 85px; top: 0;
    background: #fff; color: #333; width: 220px;
    padding: 15px; border-radius: 4px; box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    opacity: 0; visibility: hidden; transform: translateX(20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    text-align: center; z-index: 1000; cursor: default;
}
.pop-card::after {
    content: ''; position: absolute; right: -8px; top: 25px; width: 0; height: 0;
    border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 8px solid #fff;
}
.float-item:hover .pop-card { opacity: 1; visibility: visible; transform: translateX(0); }
.pop-title { font-size: 16px; font-weight: bold; color: #333; margin-bottom: 8px; border-bottom: 1px dashed #eee; padding-bottom: 5px; }
.pop-info { font-size: 14px; color: #666; margin-bottom: 12px; line-height: 1.5; }
.pop-btn { display: inline-block; background: #007bff; color: #fff; padding: 6px 20px; font-size: 14px; border-radius: 4px; text-decoration: none; transition: 0.2s; }
.pop-btn:hover { background: #0056b3; }
.pop-qr { width: 120px; height: 120px; margin: 0 auto; display: block; border: 1px solid #eee; }

/* ================= 图片灯箱 ================= */
.lightbox-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9); z-index: 2000;
    display: none; justify-content: center; align-items: center;
    opacity: 0; transition: opacity 0.3s ease; cursor: zoom-out;
}
.lightbox-overlay.active { opacity: 1; }
.lightbox-img {
    max-width: 90%; max-height: 90%;
    border: 2px solid #ffd700; border-radius: 8px;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
    transform: scale(0.8); transition: transform 0.3s;
}
.lightbox-overlay.active .lightbox-img { transform: scale(1); }

/* ================= 研发中弹窗 ================= */
.dev-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); z-index: 1500;
    display: none; justify-content: center; align-items: center; backdrop-filter: blur(5px);
}
.dev-modal-box {
    width: 400px; background: rgba(20, 5, 5, 0.95);
    border: 1px solid #ffd700; border-radius: 12px;
    padding: 30px 20px; text-align: center;
    box-shadow: 0 0 30px rgba(255, 69, 0, 0.5);
    transform: translateY(20px); opacity: 0; transition: all 0.4s ease;
}
.dev-modal-overlay.active .dev-modal-box { transform: translateY(0); opacity: 1; }
.dev-icon { font-size: 40px; color: #ffd700; margin-bottom: 15px; }
.dev-title { color: #fff; font-size: 20px; margin-bottom: 10px; font-weight: bold; }
.dev-desc { color: #aaa; font-size: 14px; margin-bottom: 20px; line-height: 1.6; }
.dev-close-btn {
    background: linear-gradient(to bottom, #a02020, #6b1515);
    color: #fff; border: 1px solid #ffd700;
    padding: 8px 30px; border-radius: 4px; cursor: pointer; font-size: 14px; transition: 0.2s;
}
.dev-close-btn:hover { background: #ffd700; color: #200404; font-weight: bold; }

/* ===== 桌面端默认：移动专属元素隐藏，桌面LOGO显示 ===== */
.mobile-nav-top   { display: none; }
.mobile-menu-toggle { display: none; }
.float-bar-toggle { display: none; }
.desktop-logo     { display: flex !important; }

/* ================= 响应式（手机端 ≤ 992px） ================= */
@media (max-width: 992px) {

    /* --- 整体布局 --- */
    body {
        flex-direction: column;
        height: auto; min-height: 100vh;
        overflow-x: hidden; overflow-y: auto;
    }

    /* --- 侧边栏 → 顶部导航条 --- */
    .sidebar {
        width: 100%; flex-shrink: 0;
        flex-direction: column;
        height: auto;
        position: sticky; top: 0; z-index: 500;
        box-shadow: 0 2px 12px rgba(0,0,0,0.6);
    }

    /* 桌面LOGO在移动端隐藏 */
    .desktop-logo { display: none !important; }

    /* 移动端顶部条（LOGO + 汉堡按钮） */
    .mobile-nav-top {
        display: flex !important;
        align-items: center; justify-content: space-between;
        padding: 0 15px; height: 60px;
        background: rgba(20,5,5,0.95);
    }

    /* 移动端顶部条里的LOGO缩小 */
    .mobile-nav-top .logo {
        width: 110px; height: 46px;
        flex-shrink: 0;
    }
    .mobile-nav-top .logo-img {
        width: 110px; height: 46px;
    }

    /* 汉堡菜单按钮 */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column; justify-content: center; align-items: center;
        width: 44px; height: 44px;
        cursor: pointer; gap: 6px;
        background: rgba(255,255,255,0.07);
        border-radius: 8px;
        border: 1px solid rgba(255,215,0,0.25);
        transition: background 0.2s;
        flex-shrink: 0;
    }
    .mobile-menu-toggle:hover  { background: rgba(255,215,0,0.18); }
    .mobile-menu-toggle span {
        display: block; width: 22px; height: 2px;
        background: #ffd700; border-radius: 2px;
        transition: transform 0.3s, opacity 0.3s;
    }
    /* 展开时变 X */
    .mobile-menu-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .mobile-menu-toggle.open span:nth-child(2) { opacity: 0; }
    .mobile-menu-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* 下拉菜单：默认隐藏，点击后显示 */
    .menu {
        display: none;
        flex-direction: column;
        padding: 8px 12px 14px;
        gap: 4px;
        border-top: 1px solid rgba(255,215,0,0.12);
        background: rgba(10,2,2,0.97);
        list-style: none;
    }
    .menu.mobile-open { display: flex; }
    .menu li { margin-bottom: 0; padding: 0; }
    .menu li a {
        display: flex; align-items: center;
        padding: 13px 16px; font-size: 14px;
        border-radius: 7px;
    }
    .menu li a i { margin-right: 10px; width: auto; font-size: 15px; }

    /* 侧边栏底部版权隐藏 */
    .sidebar .copyright { display: none; }

    /* --- 内容区 --- */
    .main-content {
        flex: 1; overflow-y: visible;
        padding: 12px 12px 100px;
    }

    /* 底部版权通栏 */
    .bottom-health-copyright { width: 100%; }

    .dev-modal-box { width: 92%; }

    /* --- 右侧悬浮栏：移动端保持右侧竖排，带收起功能 --- */
    .float-bar {
        position: fixed;
        right: 0; top: 50%;
        transform: translateY(-50%);
        flex-direction: column;
        z-index: 999;
        box-shadow: -2px 0 10px rgba(0,0,0,0.6);
        border-radius: 8px 0 0 8px;
        overflow: visible;
        transition: none;
        display: flex;
    }
    /* 收起状态：隐藏所有 float-item，只留 toggle 按钮 */
    .float-bar.mobile-collapsed .float-item {
        display: none;
    }

    /* 收起/展开控制按钮 —— 竖排第一项 */
    .float-bar-toggle {
        display: flex !important;
        align-items: center; justify-content: center;
        width: 62px; height: 44px;
        background: rgba(100,10,10,0.95);
        cursor: pointer; color: #ffd700; font-size: 14px;
        border-radius: 8px 0 0 8px;
        border-bottom: 1px solid rgba(255,215,0,0.2);
        transition: background 0.2s;
        order: -1; flex-shrink: 0;
        position: relative; z-index: 10;
    }
    /* 展开状态下，toggle 按钮只有顶部圆角（底下接 float-item） */
    .float-bar:not(.mobile-collapsed) .float-bar-toggle {
        border-radius: 8px 0 0 0;
    }
    .float-bar-toggle:hover { background: #c8a000; color: #200404; }
    .float-bar-toggle i { pointer-events: none; }

    /* float-item 在移动端保持竖排，稍微缩小 */
    .float-item {
        width: 62px; height: 62px;
        border-bottom: 1px solid rgba(255,215,0,0.15);
        border-right: none;
    }
    .float-item:first-child  { border-top-left-radius: 8px; border-top-right-radius: 0; }
    .float-item:nth-last-child(2)   { border-bottom-left-radius: 8px; border-bottom: none; }
    .float-item i   { font-size: 20px; margin-bottom: 4px; }
    .float-item span { font-size: 11px; }

    /* 弹出卡片改为向左弹出（保持原有方向即可） */
    .pop-card {
        right: 70px; left: auto;
        top: 0; bottom: auto;
        width: 200px;
    }
    .pop-card::after {
        right: -8px; left: auto;
        top: 22px; bottom: auto;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        border-left: 8px solid #fff;
        border-right: none;
    }
}
