/* 主样式文件 - 全局样式和通用组件 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 配色方案 */
    --primary-color: #1A3B5D;    /* 深海蓝 */
    --secondary-color: #F5F7FA;  /* 银灰 */
    --accent-color: #D4AF37;     /* 金色 */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --bg-light: #FFFFFF;
    --bg-dark: #0A1929;
    --card-bg: rgba(255, 255, 255, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow-light: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 12px 48px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 20px 60px rgba(0, 0, 0, 0.2);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    /* 过渡效果 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ── 5 套主题 ── */

/* 深海蓝（默认） */
:root, [data-theme="blue"] {
    --primary-color: #1A3B5D;
    --secondary-color: #F5F7FA;
    --accent-color: #D4AF37;
    --accent-color2: #FFD700;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --bg-light: #FFFFFF;
    --bg-dark: #0A1929;
    --card-bg: rgba(255, 255, 255, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.3);
    --navbar-bg: rgba(13, 34, 56, 0.88);
}

/* 暗夜 */
[data-theme="dark"] {
    --primary-color: #4A8FD4;
    --secondary-color: #1A2B3C;
    --accent-color: #D4AF37;
    --accent-color2: #FFD700;
    --text-primary: #FFFFFF;
    --text-secondary: #CCCCCC;
    --text-light: #888888;
    --bg-light: #0A1929;
    --bg-dark: #05111D;
    --card-bg: rgba(26, 43, 60, 0.9);
    --glass-bg: rgba(30, 50, 70, 0.85);
    --glass-border: rgba(255, 255, 255, 0.12);
    --navbar-bg: rgba(5, 14, 26, 0.92);
}

body {
    font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
    font-weight: 300;
    color: var(--text-primary);
    background-color: var(--bg-light);
    line-height: 1.6;
    transition: background-color var(--transition-normal);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Source Han Sans', '思源黑体', sans-serif;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 通用按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background: var(--primary-color);
}

.btn:active {
    transform: translateY(0);
}

/* 毛玻璃效果 */
.glass-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-light);
}

/* 发光文字 */
.glow-text {
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    color: var(--accent-color);
}

.neon-text {
    color: var(--accent-color);
    text-shadow: 0 0 5px var(--accent-color),
                 0 0 10px var(--accent-color),
                 0 0 15px var(--accent-color);
    animation: neon-pulse 2s infinite alternate;
}

@keyframes neon-pulse {
    from {
        text-shadow: 0 0 5px var(--accent-color),
                     0 0 10px var(--accent-color),
                     0 0 15px var(--accent-color);
    }
    to {
        text-shadow: 0 0 10px var(--accent-color),
                     0 0 20px var(--accent-color),
                     0 0 30px var(--accent-color);
    }
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(13, 34, 56, 0.92);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
    padding: 14px 0;
    transition: all var(--transition-normal);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
}

.logo-text {
    color: var(--accent-color) !important;
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.45);
    letter-spacing: 0.02em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 17px;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
    transition: color var(--transition-fast);
    letter-spacing: 0.04em;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color);
}

.nav-icons {
    display: flex;
    gap: 15px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.90);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-normal);
}

/* ── 主题菜单项 ── */
.nav-theme-item {
    position: relative;
}
.nav-theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.88);
    font-size: 15px;
    font-weight: 500;
    padding: 5px 0;
    margin: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.04em;
    transition: color var(--transition-fast);
    white-space: nowrap;
    line-height: normal;
}
.nav-theme-btn:hover { color: var(--accent-color); }
.nav-theme-btn i { font-size: 12px; opacity: 0.7; }

.theme-panel {
    display: none;
    position: absolute;
    top: calc(100% + 18px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    border: 1px solid rgba(212,175,55,0.18);
    border-radius: 16px;
    padding: 18px 20px 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.22);
    backdrop-filter: blur(20px);
    z-index: 2000;
    min-width: 230px;
}
.theme-panel.open { display: block; }
.theme-panel::before {
    content: '';
    position: absolute;
    top: -7px; left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 13px; height: 13px;
    background: var(--card-bg);
    border-left: 1px solid rgba(212,175,55,0.18);
    border-top: 1px solid rgba(212,175,55,0.18);
}
.theme-panel-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-light);
    margin-bottom: 12px;
    text-transform: uppercase;
}
.theme-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    cursor: pointer;
    background: transparent;
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.18s;
    text-align: left;
}
.theme-option:hover { background: rgba(212,175,55,0.08); border-color: rgba(212,175,55,0.2); }
.theme-option.active { border-color: var(--accent-color); background: rgba(212,175,55,0.10); }
.theme-swatch {
    width: 20px; height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    /* 主题菜单在移动端收纳进汉堡菜单，面板改为向下展开（非绝对定位） */
    .nav-theme-item { display: list-item; }
    .theme-panel {
        position: static;
        transform: none;
        border: none;
        border-radius: 8px;
        box-shadow: none;
        padding: 8px 0 4px 16px;
        backdrop-filter: none;
        min-width: unset;
    }
    .theme-panel::before { display: none; }
    .nav-theme-btn { padding: 10px 0; width: 100%; justify-content: flex-start; }
    /* 桌面端的 nav-icons 里的用户信息，移动端隐藏，改用 nav-mobile-user */
    .nav-icons { display: none; }
    /* 桌面端注入的账户管理项，移动端由 nav-admin-mobile 负责显示，隐藏避免重复 */
    .nav-admin-item { display: none; }
    /* 移动端账户管理项 */
    .nav-admin-mobile { display: list-item !important; }
    /* 移动端用户菜单项 */
    .nav-mobile-user { display: list-item !important; }
    .nav-mobile-user .nav-link,
    .nav-mobile-user a { display: flex; align-items: center; gap: 8px; }
    .nav-mobile-user .role-badge {
        font-size: 11px; padding: 1px 7px;
        background: rgba(212,175,55,0.15);
        border-radius: 100px; color: var(--accent-color);
        font-weight: 600;
    }
}

/* 页面标题区 */
.page-header {
    position: relative;
    padding: 160px 0 80px;
    margin-top: 0;
    overflow: hidden;
    background: linear-gradient(160deg, #0d2238 0%, #1a3b5d 55%, #0e2847 100%);
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 65% 100% at 10% 50%, rgba(212, 175, 55, 0.10) 0%, transparent 70%),
        radial-gradient(ellipse 50% 80% at 90% 60%, rgba(255, 255, 255, 0.04) 0%, transparent 70%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 1;
}

.page-header .container {
    position: relative;
    z-index: 2;
}

.page-title {
    font-size: 52px;
    text-align: center;
    margin-bottom: 20px;
    background: var(--accent-color);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.02em;
}

.page-subtitle {
    font-size: 18px;
    text-align: center;
    color: rgba(255, 255, 255, 0.72);
    max-width: 600px;
    margin: 0 auto;
    letter-spacing: 0.03em;
}

/* 章节标题 */
.section-title {
    font-size: 36px;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    color: var(--primary-color);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

.sub-title {
    font-size: 24px;
    margin-bottom: 30px;
    color: var(--text-primary);
}

/* 卡片样式 */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow-light);
    transition: all var(--transition-normal);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 18px rgba(212, 175, 55, 0.45);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

.footer-content {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 0;
    gap: 48px;
}

.footer-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

.footer-phone {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 18px;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-phone:hover {
    color: var(--accent-color);
}

.footer-qrcode {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-qrcode img {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    border: 2px solid rgba(212, 175, 55, 0.4);
}

.footer-qrcode span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 28px;
    }

    .footer-info {
        align-items: center;
    }
}

/* 页脚样式 */
.footer {
    background: linear-gradient(160deg, #0d1f30 0%, #1a3b5d 100%);
    color: white;
    padding: 14px 0;
    margin-top: 40px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), #FFD700, var(--accent-color));
}

.footer-logo {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.footer-social {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 10px;
}

.footer-social a {
    color: white;
    font-size: 20px;
    transition: color var(--transition-fast);
}

.footer-social a:hover {
    color: var(--accent-color);
}

.copyright {
    text-align: center;
    padding-top: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* 导航下拉菜单 */
.nav-dropdown {
    position: relative;
    padding-bottom: 14px;
    margin-bottom: -14px;
}

.nav-chevron {
    font-size: 11px;
    margin-left: 3px;
    transition: transform var(--transition-fast);
}

.nav-dropdown:hover .nav-chevron {
    transform: rotate(180deg);
}

.nav-link-dropdown::after {
    display: none;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 34, 56, 0.97);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 10px;
    list-style: none;
    padding: 10px 0 8px;
    min-width: 140px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    z-index: 1100;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.dropdown-item:hover,
.dropdown-item.active {
    color: var(--accent-color);
    background: rgba(212, 175, 55, 0.10);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(13, 34, 56, 0.96);
        backdrop-filter: blur(24px);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        border-top: 1px solid rgba(212, 175, 55, 0.15);
        z-index: 999;
    }

    .nav-menu.active {
        display: flex;
    }

    .dropdown-menu {
        position: static;
        transform: none;
        background: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        display: none;
    }

    .nav-dropdown.open .dropdown-menu {
        display: block;
    }

    .nav-dropdown:hover .dropdown-menu {
        display: none;
    }

    .nav-dropdown.open:hover .dropdown-menu {
        display: block;
    }

    .dropdown-item {
        padding: 10px 20px;
        font-size: 15px;
        text-align: center;
        color: rgba(255,255,255,0.7);
    }

    .dropdown-item:hover,
    .dropdown-item.active {
        background: none;
        color: var(--accent-color);
    }

    .hamburger {
        display: flex;
    }

    .hamburger span {
        background: rgba(255, 255, 255, 0.88);
    }

    .page-title {
        font-size: 36px;
    }

    .section-title {
        font-size: 28px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotating {
    animation: rotate 2s linear infinite;
}

/* 进度条样式 */
.progress-container {
    width: 100%;
    height: 8px;
    background: var(--secondary-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-bar-animated {
    height: 100%;
    background: var(--accent-color);
    border-radius: 4px;
    width: 0;
    transition: width 1.5s ease;
    position: relative;
}

.progress-text {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: white;
    font-weight: 500;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    border-radius: var(--radius-sm);
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    font-size: 14px;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--secondary-color);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: fadeIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--accent-color);
}

.fas, .far, .fab, .fa {
    font-family: "Font Awesome 6 Free" !important;
}
.fab { font-family: "Font Awesome 6 Brands" !important; }
