/* 全局样式重置和基础设置 */
:root {
    /* 浅色主题变量 */
    --bg: #f5f5f5;
    --panel: #ffffff;
    --panel-hover: #f0f0f0;
    --text: #333333;
    --line-main: #3b82f6;
    --line-soft: #cbd5e1;
    --accent: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
}

/* 暗色主题变量 */
body.dark-theme {
    --bg: #1a1a1a;
    --panel: #2d3748;
    --panel-hover: #4a5568;
    --text: #f5f5f5;
    --line-main: #60a5fa;
    --line-soft: #4a5568;
    --accent: #34d399;
    --warning: #fbbf24;
    --error: #f87171;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    transition: all 0.3s ease;
    overflow-x: hidden;
    overflow-y: auto;
}



/* 科幻风格动画定义 */
@keyframes hologram-pulse {
    0%, 100% {
        opacity: 0.3;
        filter: blur(0.5px);
    }
    50% {
        opacity: 0.8;
        filter: blur(1px);
    }
}

@keyframes energy-pulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

/* 导航栏样式 - 科幻框体风格 */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    height: 80px;
    z-index: 1000;
    transition: all 0.3s ease;
    /* 科幻风格投影 - 立体凸出效果 */
    filter: 
        drop-shadow(0 0 3px var(--line-main)) 
        drop-shadow(0 0 1px var(--line-main));
}

.navbar-frame {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--panel);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    
    /* 立体效果 - 右下方向白色高光 */
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset -2px -2px 4px rgba(255, 255, 255, 0.3),
        inset 2px 2px 4px rgba(0, 0, 0, 0.1);

    /* 主形状 - 机械切角 */
    clip-path: polygon(
        18px 0,
        calc(100% - 32px) 0,
        100% 24px,
        100% calc(100% - 18px),
        calc(100% - 18px) 100%,
        24px 100%,
        0 calc(100% - 24px),
        0 18px
    );
}

/* 外描边 - 轻微发光效果 */
.navbar-frame::before {
    content: "";
    position: absolute;
    inset: -2px;
    border: 2px solid var(--line-main);
    clip-path: inherit;
    box-shadow: 
        0 0 1px var(--line-main);
}

/* 内描边 - 轻微发光效果 */
.navbar-frame::after {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid var(--line-soft);
    clip-path: inherit;
    box-shadow: 
        0 0 0.5px var(--line-soft);
}

/* 导航栏悬浮效果 */
.navbar:hover {
    filter: 
        drop-shadow(0 0 5px var(--line-main)) 
        drop-shadow(0 0 12px var(--line-main));
}

.navbar:hover .navbar-frame {
    transform: translateY(-3px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset -3px -3px 6px rgba(255, 255, 255, 0.4),
        inset 3px 3px 6px rgba(0, 0, 0, 0.15);
}

.navbar:hover .navbar-frame::before {
    box-shadow: 
        0 0 12px var(--line-main),
        0 0 20px var(--line-main),
        0 0 35px var(--line-main),
        inset 0 0 8px var(--line-main);
    animation: hologram-pulse 1.5s ease-in-out infinite;
}

.navbar:hover .navbar-frame::after {
    box-shadow: 
        0 0 10px var(--line-soft),
        0 0 18px var(--line-soft),
        0 0 30px var(--line-soft),
        inset 0 0 5px var(--line-soft);
    animation: energy-pulse 1s ease-in-out infinite;
}

/* 菜单图标 - 科幻风格 */
.menu-icon-container {
    background: var(--panel);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 18px;
    cursor: pointer !important;
    pointer-events: auto !important;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.menu-icon-container .menu-icon {
    pointer-events: none;
}

.menu-icon-container:hover {
    /* 只保留上浮动画 */
    transform: translateY(-1px);
}

.menu-icon-container:hover .menu-icon {
    /* 只在图标上添加发光效果 */
    filter: drop-shadow(0 0 3px var(--line-main));
}

.menu-icon-container:hover::before {
    /* 移除伪元素效果 */
    content: none;
}

.menu-icon {
    font-size: 18px;
    color: var(--text);
    font-weight: bold;
}

/* 图标导航 - 分散布局 */
.nav-links {
    display: flex;
    align-items: center;
}

.icon-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin: 0;
}

.nav-item {
    list-style: none;
}

.nav-link {
    position: relative;
    color: var(--text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    padding: 12px 18px;
    z-index: 1000;
    transition: all 0.4s ease;
    gap: 15px;
    border-radius: 8px;
    background: var(--panel);
    overflow: hidden;
}

.nav-link:hover {
    /* 只保留上浮动画 */
    transform: translateY(-2px);
}

.nav-link:hover::before {
    /* 移除伪元素效果 */
    content: none;
}

.nav-link ion-icon {
    font-size: 1.8em;
    pointer-events: none;
    opacity: 0.7;
    transition: all 0.4s ease;
    color: var(--text);
}

.nav-text {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    opacity: 0;
    transition: all 0.4s ease;
    white-space: nowrap;
    transform: translateX(-20px);
    position: relative;
    z-index: 10;
}

.nav-item:hover .nav-link {
    position: relative;
    transform: translateY(-3px);
}

.nav-item:hover .nav-link::after {
    /* 移除下划线效果 */
    content: none;
}

.nav-item:hover .nav-text {
    opacity: 1;
    transform: translateX(0);
    /* 添加字体发光效果 */
    filter: drop-shadow(0 0 3px var(--line-main));
    /* 保持原来的字体颜色（黑色/深灰色） */
    color: var(--text);
}

.nav-item:hover .nav-link ion-icon {
    opacity: 1;
    transform: scale(1.1);
    /* 添加图标发光效果 */
    filter: drop-shadow(0 0 3px var(--line-main));
    /* 保持原来的图标颜色（黑色/深灰色） */
    color: var(--text);
}

.nav-item.active .nav-link ion-icon {
    opacity: 1;
    transform: scale(1.1);
    filter: drop-shadow(0 0 3px var(--line-main));
}

/* 每个导航项不同的hover发光效果 - 使用科幻风格颜色 */
.nav-item:nth-child(1):hover .nav-link ion-icon,
.nav-item:nth-child(1):hover .nav-text {
    filter: drop-shadow(0 0 3px var(--line-main));
}

.nav-item:nth-child(1):hover .nav-link::after {
    background: linear-gradient(90deg, transparent, var(--line-main), transparent);
    box-shadow: 0 0 5px var(--line-main);
}

.nav-item:nth-child(2):hover .nav-link ion-icon,
.nav-item:nth-child(2):hover .nav-text {
    filter: drop-shadow(0 0 3px var(--accent));
}

.nav-item:nth-child(2):hover .nav-link::after {
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    box-shadow: 0 0 5px var(--accent);
}

.nav-item:nth-child(3):hover .nav-link ion-icon,
.nav-item:nth-child(3):hover .nav-text {
    filter: drop-shadow(0 0 3px var(--warning));
}

.nav-item:nth-child(3):hover .nav-link::after {
    background: linear-gradient(90deg, transparent, var(--warning), transparent);
    box-shadow: 0 0 5px var(--warning);
}

.nav-item:nth-child(4):hover .nav-link ion-icon,
.nav-item:nth-child(4):hover .nav-text {
    filter: drop-shadow(0 0 3px var(--error));
}

.nav-item:nth-child(4):hover .nav-link::after {
    background: linear-gradient(90deg, transparent, var(--error), transparent);
    box-shadow: 0 0 5px var(--error);
}

.nav-item:nth-child(5):hover .nav-link ion-icon,
.nav-item:nth-child(5):hover .nav-text {
    filter: drop-shadow(0 0 3px #df2fff);
}

.nav-item:nth-child(5):hover .nav-link::after {
    background: linear-gradient(90deg, transparent, #df2fff, transparent);
    box-shadow: 0 0 5px #df2fff;
}

/* 导航项hover效果 - 下划线 */
/* 保留发光效果，将突出显示改为下划线 */

/* 激活状态的导航项 - 下划线效果 */
.nav-item.active .nav-link {
    position: relative;
}

.nav-item.active .nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    border-radius: 0 0 2px 2px;
    transition: all 0.3s ease;
}

/* 每个导航项不同的激活下划线颜色 */
.nav-item:nth-child(1).active .nav-link::after {
    background: linear-gradient(90deg, transparent, var(--line-main), transparent);
    box-shadow: 0 0 5px var(--line-main);
}

.nav-item:nth-child(2).active .nav-link::after {
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    box-shadow: 0 0 5px var(--accent);
}

.nav-item:nth-child(3).active .nav-link::after {
    background: linear-gradient(90deg, transparent, var(--warning), transparent);
    box-shadow: 0 0 5px var(--warning);
}

.nav-item:nth-child(4).active .nav-link::after {
    background: linear-gradient(90deg, transparent, var(--error), transparent);
    box-shadow: 0 0 5px var(--error);
}

.nav-item:nth-child(5).active .nav-link::after {
    background: linear-gradient(90deg, transparent, #df2fff, transparent);
    box-shadow: 0 0 5px #df2fff;
}

/* 移除导航指示器，使用图标和文字发光效果替代 */
#nav-marker {
    display: none;
}

/* 用户区域 - 图标风格 */
.user-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 用户图标容器 */
.user-icon-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    transition: all 0.3s ease;
    min-width: 40px;
    background: var(--panel);
    border-radius: 6px;
    overflow: hidden;
}

/* 主题切换按钮特殊样式 */
.user-icon-container.theme-toggle {
    cursor: pointer !important;
    pointer-events: auto !important;
}

.user-icon-container.theme-toggle ion-icon {
    pointer-events: none;
}

.user-icon-container:hover {
    /* 只保留上浮动画 */
    transform: translateY(-1px);
}

.user-icon-container:hover::before {
    /* 移除伪元素效果 */
    content: none;
}

.user-icon-container ion-icon {
    font-size: 1.2em;
    color: var(--text);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.user-icon-container:hover ion-icon {
    opacity: 1;
    transform: scale(1.1);
    filter: drop-shadow(0 0 3px var(--line-main));
    /* 保持原来的图标颜色 */
    color: var(--text);
}

/* 图标文字提示 */
.icon-text {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: #e0f7ff;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    background: rgba(15, 23, 42, 0.8);
    padding: 3px 6px;
    border-radius: 3px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(96, 165, 250, 0.3);
    pointer-events: none;
}

.user-icon-container:hover .icon-text {
    opacity: 1;
    transform: translateX(-50%) translateY(-3px);
}

/* 金币显示 - 图标风格 */
.user-icon-container.coin-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--panel);
    border-radius: 6px;
    color: var(--text);
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.user-icon-container.coin-display:hover {
    /* 只保留上浮动画 */
    transform: translateY(-1px);
}

.user-icon-container.coin-display:hover ion-icon,
.user-icon-container.coin-display:hover .coin-count {
    /* 只在图标和文字上添加发光效果 */
    filter: drop-shadow(0 0 3px var(--line-main));
}

.user-icon-container.coin-display:hover::before {
    /* 移除伪元素效果 */
    content: none;
}

.user-icon-container.coin-display ion-icon {
    font-size: 18px;
    color: #fbbf24;
}

.coin-count {
    font-size: 12px;
    color: #fbbf24;
    font-weight: bold;
    margin-top: 2px;
    transition: all 0.3s ease;
}

/* 用户头像 - 图标风格 */
.user-icon-container.user-avatar {
    width: 80px;
    height: 40px;
    border-radius: 6px;
    background: var(--panel);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    padding: 4px 8px;
    gap: 4px;
}

.user-icon-container.user-avatar:hover {
    /* 只保留上浮动画 */
    transform: translateY(-1px);
}

.user-icon-container.user-avatar:hover ion-icon {
    /* 只在图标上添加发光效果 */
    filter: drop-shadow(0 0 3px var(--line-main));
}

.user-icon-container.user-avatar:hover::before {
    /* 移除伪元素效果 */
    content: none;
}

.user-icon-container.user-avatar ion-icon {
    font-size: 20px;
    color: var(--text);
}

.user-avatar .icon-text {
    display: none;
}

.user-avatar .username {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    text-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
    margin-top: 2px;
    transition: all 0.3s ease;
}

.user-avatar:hover .username {
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.8);
}

.user-avatar .user-role {
    font-size: 9px;
    color: #a0d2ff;
    background: rgba(96, 165, 250, 0.2);
    padding: 1px 4px;
    border-radius: 6px;
    border: 1px solid rgba(96, 165, 250, 0.3);
    margin-top: 1px;
    transition: all 0.3s ease;
}

.user-avatar:hover .user-role {
    background: rgba(96, 165, 250, 0.3);
    border-color: rgba(96, 165, 250, 0.5);
    text-shadow: 0 0 5px rgba(96, 165, 250, 0.8);
}

/* 认证按钮 - 图标风格 */
.auth-buttons {
    display: flex;
    gap: 8px;
}

.auth-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    backdrop-filter: blur(5px);
    min-width: 60px;
    justify-content: center;
}

.auth-btn ion-icon {
    font-size: 1.2em;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.auth-btn:hover ion-icon {
    opacity: 1;
}

.login-btn {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
}

.login-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4);
}

.logout-btn {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(239, 68, 68, 0.4);
}

/* 侧边栏样式 - 科幻风格 */
.sidebar {
    position: fixed;
    top: 0;
    left: -350px;
    width: 320px;
    height: 100vh;
    background: linear-gradient(135deg, 
        #0a192f 0%, 
        #112240 25%, 
        #1e3a8a 50%, 
        #3b82f6 75%, 
        #60a5fa 100%);
    z-index: 999;
    transition: all 0.4s ease;
    box-shadow: 
        5px 0 30px rgba(59, 130, 246, 0.4),
        inset 1px 0 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border-right: 1px solid rgba(96, 165, 250, 0.3);
    /* 调试样式 - 确保侧边栏可见 */
    visibility: visible !important;
    display: block !important;
}

body.dark-theme .sidebar {
    background: linear-gradient(135deg, 
        #0f172a 0%, 
        #1e293b 25%, 
        #334155 50%, 
        #475569 75%, 
        #64748b 100%);
    box-shadow: 
        5px 0 30px rgba(15, 23, 42, 0.6),
        inset 1px 0 0 rgba(255, 255, 255, 0.05);
}

/* 深色模式下侧边栏头部样式 */
body.dark-theme .sidebar-header {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(96, 165, 250, 0.2);
}

/* 深色模式下侧边栏标题样式 */
body.dark-theme .sidebar-title {
    color: #e0f7ff;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.6);
}

/* 深色模式下侧边栏关闭按钮样式 */
body.dark-theme .sidebar-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.3);
    color: #e0f7ff;
}

body.dark-theme .sidebar-close:hover {
    background: rgba(96, 165, 250, 0.3);
    border-color: rgba(96, 165, 250, 0.6);
}

/* 深色模式下侧边栏链接样式 */
body.dark-theme .sidebar-link {
    background: rgba(255, 255, 255, 0.05);
    color: #e0f7ff;
}

body.dark-theme .sidebar-link:hover {
    background: rgba(96, 165, 250, 0.25);
    border-left-color: rgba(96, 165, 250, 0.8);
}

/* 深色模式下侧边栏分隔线样式 */
body.dark-theme .sidebar-divider {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(96, 165, 250, 0.2) 50%, 
        transparent 100%);
}

.sidebar.active {
    left: 0;
    transform: translateX(0);
}

/* 侧边栏头部 */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 20px;
    border-bottom: 1px solid rgba(96, 165, 250, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-title {
    font-size: 22px;
    font-weight: 700;
    color: #e0f7ff;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.8);
    letter-spacing: 1px;
}

.sidebar-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.3);
    color: #e0f7ff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.sidebar-close ion-icon {
    font-size: 1.5em;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.sidebar-close:hover {
    background: rgba(96, 165, 250, 0.3);
    border-color: rgba(96, 165, 250, 0.6);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.4);
}

.sidebar-close:hover ion-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* 侧边栏菜单 - 图标风格 */
.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-item {
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 25px;
    text-decoration: none;
    color: #e0f7ff;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-link:hover {
    background: rgba(96, 165, 250, 0.2);
    border-left-color: rgba(96, 165, 250, 0.8);
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(96, 165, 250, 0.3);
}

.sidebar-link ion-icon {
    font-size: 1.5em;
    opacity: 0.6;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 5px rgba(96, 165, 250, 0.6));
}

.sidebar-link:hover ion-icon {
    opacity: 1;
    transform: scale(1.1);
}

.sidebar-text {
    font-weight: 600;
    font-size: 16px;
    text-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
}

.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(96, 165, 250, 0.3) 50%, 
        transparent 100%);
    margin: 10px 0;
}

/* 侧边栏遮罩层 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.user-avatar:hover {
    background: rgba(96, 165, 250, 0.2);
    border-color: rgba(96, 165, 250, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 3px 15px rgba(96, 165, 250, 0.4);
}

.avatar-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 5px rgba(96, 165, 250, 0.6));
}

.username {
    font-size: 14px;
    font-weight: 600;
    color: #e0f7ff;
    text-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
}

.user-role {
    font-size: 12px;
    color: rgba(224, 247, 255, 0.7);
    background: rgba(96, 165, 250, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(96, 165, 250, 0.3);
}

/* 认证按钮 - 科幻风格 */
.auth-buttons {
    display: flex;
    gap: 8px;
}

.login-btn,
.logout-btn {
    padding: 6px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 4px;
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    position: relative;
    overflow: hidden;
}

.login-btn:hover,
.logout-btn:hover {
    background: var(--panel-hover);
    border-color: var(--line-main);
    transform: translateY(-1px);
    box-shadow: 
        0 0 2px var(--line-main),
        0 1px 4px rgba(0, 0, 0, 0.2);
}

.login-btn:hover::before,
.logout-btn:hover::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid var(--line-main);
    border-radius: 4px;
    box-shadow: 
        0 0 1px var(--line-main),
        inset 0 0 2px var(--line-main);
    animation: energy-pulse 0.5s ease-in-out infinite;
}

/* 登录弹窗样式 */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: var(--panel);
    border-radius: 20px;
    padding: 30px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px var(--line-soft),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid var(--line-soft);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: 15px;
}

.modal-title {
    color: var(--text);
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 0 10px var(--line-soft);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    transform: scale(1.1);
}

/* 标签切换 */
.tab-container {
    display: flex;
    background: var(--panel);
    border-radius: 0;
    padding: 4px;
    margin-bottom: 25px;
    border: 2px solid var(--line-main);
    box-shadow: 
        0 0 10px var(--line-main),
        inset 0 0 5px var(--line-main);
    
    /* 机械切角 */
    clip-path: polygon(
        8px 0,
        calc(100% - 12px) 0,
        100% 8px,
        100% calc(100% - 8px),
        calc(100% - 8px) 100%,
        12px 100%,
        0 calc(100% - 12px),
        0 8px
    );
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    border-radius: 0;
    transition: all 0.3s ease;
    
    /* 机械切角 */
    clip-path: polygon(
        4px 0,
        calc(100% - 6px) 0,
        100% 4px,
        100% calc(100% - 4px),
        calc(100% - 4px) 100%,
        6px 100%,
        0 calc(100% - 6px),
        0 4px
    );
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--line-main), var(--line-secondary));
    color: var(--white);
    box-shadow: 
        0 0 10px var(--line-main),
        inset 0 0 5px var(--line-main);
}

.tab-btn:hover:not(.active) {
    background: rgba(0, 123, 255, 0.1);
    color: var(--text);
    box-shadow: inset 0 0 3px var(--line-main);
}

/* 认证表单 */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--line-main);
    border-radius: 0;
    background: var(--panel);
    color: var(--text);
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 
        0 0 10px var(--line-main),
        inset 0 0 5px var(--line-main);
    
    /* 机械切角 */
    clip-path: polygon(
        4px 0,
        calc(100% - 8px) 0,
        100% 4px,
        100% calc(100% - 4px),
        calc(100% - 4px) 100%,
        8px 100%,
        0 calc(100% - 8px),
        0 4px
    );
}

.form-group input:focus {
    outline: none;
    border-color: var(--line-secondary);
    box-shadow: 
        0 0 15px var(--line-main),
        0 0 30px var(--line-main),
        inset 0 0 8px var(--line-main);
    background: var(--panel);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--line-main), var(--line-secondary));
    border: none;
    border-radius: 0;
    color: var(--white);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 
        0 4px 15px var(--line-main),
        0 4px 25px var(--line-main);
    
    /* 机械切角 */
    clip-path: polygon(
        6px 0,
        calc(100% - 10px) 0,
        100% 6px,
        100% calc(100% - 6px),
        calc(100% - 6px) 100%,
        10px 100%,
        0 calc(100% - 10px),
        0 6px
    );
}

.submit-btn:hover {
    background: linear-gradient(135deg, var(--line-secondary), var(--line-main));
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px var(--line-main),
        0 6px 35px var(--line-main),
        inset 0 0 5px var(--line-main);
}

.submit-btn:active {
    transform: translateY(0);
}

/* 消息提示 */
.message-container {
    margin-top: 15px;
    padding: 12px;
    border-radius: 0;
    font-size: 14px;
    text-align: center;
    background: var(--panel);
    border: 2px solid var(--line-main);
    box-shadow: 
        0 0 10px var(--line-main),
        inset 0 0 5px var(--line-main);
    
    /* 机械切角 */
    clip-path: polygon(
        6px 0,
        calc(100% - 8px) 0,
        100% 6px,
        100% calc(100% - 6px),
        calc(100% - 6px) 100%,
        8px 100%,
        0 calc(100% - 8px),
        0 6px
    );
}

/* =====================
   主题变量 - 全站通用
===================== */
:root {
  --bg: #f5f7fa;
  --bg-panel: #ffffff;
  --bg-surface: #f8fafc;
  --line-main: #007bff;
  --line-soft: rgba(0,123,255,0.6);
  --text-primary: #0b1b2b;
  --text-secondary: #4a5568;
  --text: #0b1b2b;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-panel: #1a1a1a;
  --bg-surface: #2a2a2a;
  --panel: #1a1a1a;
  --line-main: #00d4ff;
  --line-soft: rgba(0,212,255,0.6);
  --text-primary: #e6f2ff;
  --text-secondary: #cbd5e0;
  --text: #e6f2ff;
}

/* =====================
   科幻背景系统 - 全站通用
===================== */
body {
  background: var(--bg);
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

/* 六边形网格背景 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.6;
  background-image: url("images/hex.svg");
  background-size: 120px 104px;
  animation: grid-drift 80s linear infinite;
  filter: brightness(1.1) contrast(1.2) hue-rotate(200deg) saturate(1.5);
}

/* 浅色模式下的网格颜色调整为蓝色 */
[data-theme="light"] body::before {
  filter: brightness(1.1) contrast(1.2) hue-rotate(60deg) saturate(1.5);
}

/* 深色模式下的网格调整 */
[data-theme="dark"] body::before {
  opacity: 0.25;
  filter: brightness(0.8) contrast(1.2);
}

@keyframes grid-drift {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 120px 104px;
  }
}

/* =====================
   科幻按钮系统 - 全站通用
===================== */
.cta-button {
    position: relative;
    padding: 18px 35px;
    background: 
        linear-gradient(45deg, 
            transparent 25%, 
            rgba(255, 255, 255, 0.05) 25%, 
            rgba(255, 255, 255, 0.05) 50%, 
            transparent 50%, 
            transparent 75%, 
            rgba(255, 255, 255, 0.05) 75%
        ),
        var(--panel);
    background-size: 8px 8px;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    
    /* 立体效果 - 不对称高光 */
    box-shadow: 
        inset 1px 1px 0 rgba(255, 255, 255, 0.15),
        inset -3px -2px 4px rgba(255, 255, 255, 0.3),
        inset 2px 3px 4px rgba(0, 0, 0, 0.1);
    
    /* 不对称机械切角 */
    clip-path: polygon(
        12px 0,
        calc(100% - 8px) 0,
        100% 12px,
        100% calc(100% - 8px),
        calc(100% - 12px) 100%,
        8px 100%,
        0 calc(100% - 12px),
        0 8px
    );
}

/* 外描边 - 不对称全息边框 */
.cta-button::before {
    content: "";
    position: absolute;
    inset: -2px;
    border: 2px solid var(--line-main);
    clip-path: inherit;
    box-shadow: 
        0 0 6px var(--line-main),
        0 0 12px var(--line-main),
        0 0 20px var(--line-main),
        inset 0 0 4px var(--line-main);
    animation: hologram-pulse 3s ease-in-out infinite;
}

/* 内描边 - 不对称能量脉冲 */
.cta-button::after {
    content: "";
    position: absolute;
    inset: 3px;
    border: 1px solid var(--line-soft);
    clip-path: inherit;
    box-shadow: 
        0 0 3px var(--line-soft),
        0 0 8px var(--line-soft);
}

@keyframes hologram-pulse {
    0%, 100% {
        opacity: 0.8;
        filter: brightness(1);
    }
    50% {
        opacity: 1;
        filter: brightness(1.2);
    }
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        inset 1px 1px 0 rgba(255, 255, 255, 0.2),
        inset -3px -2px 4px rgba(255, 255, 255, 0.4),
        inset 2px 3px 4px rgba(0, 0, 0, 0.15),
        0 8px 25px rgba(0, 123, 255, 0.4);
}

.cta-button:active {
    transform: translateY(0);
    box-shadow: 
        inset 1px 1px 0 rgba(255, 255, 255, 0.1),
        inset -3px -2px 4px rgba(255, 255, 255, 0.2),
        inset 2px 3px 4px rgba(0, 0, 0, 0.2);
}

/* 页面内容区域 - 避免导航栏遮挡 */
.page-content {
    margin-top: 80px; /* 导航栏高度70px + 10px间距 */
    padding: 20px;
    min-height: calc(100vh - 80px);
    width: 100%;
    box-sizing: border-box;
}

.message-container.success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: block;
}

.message-container.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: block;
}

/* 加载状态 */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.avatar-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 5px rgba(96, 165, 250, 0.6));
}

.username {
    font-weight: 600;
    font-size: 14px;
    color: #e0f7ff;
    text-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
}

.user-role {
    font-size: 12px;
    color: #a0d2ff;
    background: rgba(96, 165, 250, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(96, 165, 250, 0.3);
}



/* 认证按钮样式 */
.auth-buttons {
    display: flex;
    gap: 10px;
}

.auth-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.login-btn {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.login-btn:hover {
    background: rgba(34, 197, 94, 0.3);
    border-color: rgba(34, 197, 94, 0.6);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.logout-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

/* 登录模态框样式 - 重复定义，已删除 */

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.btn-primary {
    background: rgba(96, 165, 250, 0.3);
    color: #e0f7ff;
    border: 1px solid rgba(96, 165, 250, 0.5);
}

.btn-primary:hover {
    background: rgba(96, 165, 250, 0.5);
    border-color: rgba(96, 165, 250, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(96, 165, 250, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #a0d2ff;
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(96, 165, 250, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(96, 165, 250, 0.2);
}

.message {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    display: none;
}

.message.success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.message.error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* 暗色主题适配 */
body.dark-theme .modal-content {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

body.dark-theme .form-group input {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(96, 165, 250, 0.2);
}

.user-avatar:hover {
    background: rgba(96, 165, 250, 0.2);
    border-color: rgba(96, 165, 250, 0.6);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.4);
}

/* 页面内容样式 */
.page-content {
    margin-top: 80px; /* 为导航栏留出空间 */
    padding: 40px 20px;
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

body.dark-theme .page-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.page-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body.dark-theme .page-title {
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

/* 页面容器通用样式 */
.chess-container,
.learn-container,
.news-container,
.forum-container,
.shop-container,
.friend-container,
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
}

body.dark-theme .chess-container,
body.dark-theme .learn-container,
body.dark-theme .news-container,
body.dark-theme .forum-container,
body.dark-theme .shop-container,
body.dark-theme .friend-container,
body.dark-theme .profile-container {
    background: #2d3748;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.chess-container p,
.learn-container p,
.news-container p,
.forum-container p,
.shop-container p,
.friend-container p,
.profile-container p {
    font-size: 1.2rem;
    color: #666;
    line-height: 1.6;
}

body.dark-theme .chess-container p,
body.dark-theme .learn-container p,
body.dark-theme .news-container p,
body.dark-theme .forum-container p,
body.dark-theme .shop-container p,
body.dark-theme .friend-container p,
body.dark-theme .profile-container p {
    color: #cbd5e0;
}

.avatar-icon {
    font-size: 20px;
    filter: drop-shadow(0 0 5px rgba(96, 165, 250, 0.6));
}

.username {
    font-size: 15px;
    font-weight: 600;
    color: #e0f7ff;
    text-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
}

/* 主内容区域 */
.main-content {
    margin-top: 60px;
    padding: 20px;
    min-height: calc(100vh - 60px);
}

/* 页面容器 */
.page-container {
    margin-top: 60px;
    padding: 20px;
    min-height: calc(100vh - 60px);
    display: none;
}

/* 侧边栏样式 - 白色科幻未来风格 */
.sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: transparent;
    z-index: 2000;
    transition: left 0.3s ease;
    overflow: hidden;
    
    /* 科幻风格投影 - 立体凸出效果 */
    filter: 
        drop-shadow(0 0 1px var(--line-main)) 
        drop-shadow(0 0 3px var(--line-main));
    
    /* 主形状 - 机械切角（应用于整个侧边栏） */
    clip-path: polygon(
        18px 0,
        calc(100% - 32px) 0,
        100% 24px,
        100% calc(100% - 18px),
        calc(100% - 18px) 100%,
        24px 100%,
        0 calc(100% - 24px),
        0 18px
    );
}

.sidebar-frame {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--panel);
    pointer-events: all;
    
    /* 立体效果 - 右下方向白色高光 */
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset -2px -2px 4px rgba(255, 255, 255, 0.3),
        inset 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 外描边 - 轻微发光效果 */
.sidebar-frame::before {
    content: "";
    position: absolute;
    inset: -2px;
    border: 2px solid var(--line-main);
    box-shadow: 
        0 0 1px var(--line-main);
}

/* 内描边 - 轻微发光效果 */
.sidebar-frame::after {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid var(--line-soft);
    box-shadow: 
        0 0 0.5px var(--line-soft);
}

body.dark-theme .sidebar {
    background: transparent;
    filter: 
        drop-shadow(0 0 1px var(--line-main)) 
        drop-shadow(0 0 3px var(--line-main));
}

body.dark-theme .sidebar-frame {
    background: var(--panel);
}

/* 深色模式下侧边栏头部样式 */
body.dark-theme .sidebar-header {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--line-main);
}

body.dark-theme .sidebar-title {
    color: var(--text);
    text-shadow: 0 0 10px var(--line-main);
}

/* 深色模式下侧边栏关闭按钮样式 */
body.dark-theme .sidebar-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--line-main);
    color: var(--text);
}

body.dark-theme .sidebar-close:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: var(--line-main);
    box-shadow: 0 0 15px var(--line-main);
}

/* 深色模式下侧边栏链接样式 */
body.dark-theme .sidebar-link {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text);
    border-left: 3px solid transparent;
}

body.dark-theme .sidebar-link:hover {
    background: rgba(59, 130, 246, 0.2);
    border-left-color: var(--line-main);
    transform: translateX(5px);
}

body.dark-theme .sidebar-link.active {
    background: rgba(59, 130, 246, 0.3);
    border-left-color: var(--line-main);
    box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.2);
}

/* 深色模式下侧边栏分隔线样式 */
body.dark-theme .sidebar-divider {
    background: var(--line-soft);
    opacity: 0.3;
}

.sidebar.open,
.sidebar.active {
    left: 0;
    animation: sidebarSlideIn 0.4s ease-out;
}

@keyframes sidebarSlideIn {
    0% {
        left: -320px;
        opacity: 0;
        transform: perspective(1000px) rotateY(-10deg);
    }
    100% {
        left: 0;
        opacity: 1;
        transform: perspective(1000px) rotateY(0deg);
    }
}

/* 悬浮效果 - 科幻增强投影 */
.sidebar:hover {
    filter: 
        drop-shadow(0 0 5px var(--line-main)) 
        drop-shadow(0 0 12px var(--line-main));
}

.sidebar:hover .sidebar-frame {
    transform: translateY(-3px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset -3px -3px 6px rgba(255, 255, 255, 0.4),
        inset 3px 3px 6px rgba(0, 0, 0, 0.15);
}

.sidebar:hover .sidebar-frame::before {
    box-shadow: 
        0 0 12px var(--line-main),
        0 0 20px var(--line-main),
        0 0 35px var(--line-main),
        inset 0 0 8px var(--line-main);
}

.sidebar:hover .sidebar-frame::after {
    box-shadow: 
        0 0 10px var(--line-soft),
        0 0 18px var(--line-soft),
        0 0 30px var(--line-soft),
        inset 0 0 5px var(--line-soft);
}

/* 确保伪元素有正确的z-index */
.sidebar-frame::before,
.sidebar-frame::after {
    z-index: -1;
    pointer-events: none;
}

.sidebar {
    transition: all 0.3s ease;
}

.sidebar-frame {
    transition: all 0.3s ease;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 25px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-title {
    color: var(--text);
    font-size: 22px;
    font-weight: 700;
    text-shadow: 
        0 0 8px var(--line-main),
        0 0 15px var(--line-main);
    letter-spacing: 1.5px;
    font-family: 'Courier New', monospace;
    position: relative;
}

.sidebar-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--line-main) 50%, 
        transparent 100%);
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.sidebar-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--line-main);
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    
    /* 机械切角 */
    clip-path: polygon(
        8px 0,
        calc(100% - 8px) 0,
        100% 8px,
        100% calc(100% - 8px),
        calc(100% - 8px) 100%,
        8px 100%,
        0 calc(100% - 8px),
        0 8px
    );
}

.sidebar-close:hover {
    background: rgba(0, 123, 255, 0.2);
    border-color: var(--line-main);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 
        0 0 20px var(--line-main),
        0 0 40px var(--line-soft);
}

.sidebar-menu {
    list-style: none;
    padding: 30px 0;
}

.sidebar-item {
    margin: 0;
    position: relative;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 30px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.4s ease;
    border-left: 4px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    margin: 0 15px 8px 15px;
    border-radius: 0 12px 12px 0;
    backdrop-filter: blur(5px);
    cursor: pointer;
    
    /* 机械切角 */
    clip-path: polygon(
        0 0,
        calc(100% - 8px) 0,
        100% 8px,
        100% calc(100% - 8px),
        calc(100% - 8px) 100%,
        8px 100%,
        0 calc(100% - 8px)
    );
}

.sidebar-link:hover {
    background: rgba(0, 123, 255, 0.1);
    border-left-color: var(--line-main);
    transform: translateX(8px) scale(1.02);
    box-shadow: 
        0 8px 25px var(--line-soft),
        0 0 0 1px var(--line-soft);
    animation: linkHover 0.6s ease;
}

@keyframes linkHover {
    0% { transform: translateX(0) scale(1); }
    50% { transform: translateX(8px) scale(1.05); }
    100% { transform: translateX(8px) scale(1.02); }
}

.sidebar-link.active {
    background: rgba(0, 123, 255, 0.15);
    border-left-color: var(--line-main);
    box-shadow: 
        0 0 0 3px var(--line-soft),
        0 8px 30px var(--line-soft),
        inset 0 0 15px var(--line-soft);
    animation: activePulse 2s ease-in-out infinite;
}

@keyframes activePulse {
    0%, 100% { 
        box-shadow: 
            0 0 0 3px var(--line-soft),
            0 8px 30px var(--line-soft),
            inset 0 0 15px var(--line-soft);
    }
    50% { 
        box-shadow: 
            0 0 0 3px var(--line-main),
            0 8px 40px var(--line-main),
            inset 0 0 20px var(--line-main);
    }
}

.sidebar-link ion-icon {
    font-size: 22px;
    width: 26px;
    text-align: center;
    filter: drop-shadow(0 0 8px var(--line-soft));
    transition: all 0.3s ease;
}

.sidebar-link:hover ion-icon {
    transform: scale(1.2) rotate(5deg);
    filter: drop-shadow(0 0 12px var(--line-main));
}

.sidebar-text {
    font-size: 17px;
    font-weight: 600;
    text-shadow: 
        0 0 8px var(--line-soft),
        0 0 15px var(--line-soft);
    letter-spacing: 0.5px;
    font-family: 'Segoe UI', sans-serif;
    transition: all 0.3s ease;
}

.sidebar-link:hover .sidebar-text {
    text-shadow: 
        0 0 12px var(--line-main),
        0 0 20px var(--line-main);
    letter-spacing: 1px;
}

.sidebar-divider {
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--line-soft) 30%, 
        var(--line-main) 50%, 
        var(--line-soft) 70%, 
        transparent 100%);
    margin: 20px 25px;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.sidebar-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.8) 50%, 
        transparent 100%);
    animation: dividerScan 3s ease-in-out infinite;
}

@keyframes dividerScan {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* 遮罩层 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none; /* 默认不阻止点击事件 */
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* 激活时允许点击事件 */
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        left: -280px;
    }
    
    .nav-text {
        display: none;
    }
    
    .nav-links {
        gap: 15px;
    }
    
    .nav-link {
        padding: 8px;
    }
    
    .username {
        display: none;
    }
    
    .navbar {
        padding: 0 10px;
    }
}

/* 消息提示样式 - 科幻风格 */
.message {
    position: fixed;
    top: 90px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: 600;
    z-index: 1001;
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: slideIn 0.4s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.message.info {
    background: linear-gradient(135deg, 
        rgba(33, 150, 243, 0.9) 0%, 
        rgba(66, 165, 245, 0.9) 100%);
    color: #e0f7ff;
    border-color: rgba(66, 165, 245, 0.4);
}

.message.success {
    background: linear-gradient(135deg, 
        rgba(76, 175, 80, 0.9) 0%, 
        rgba(102, 187, 106, 0.9) 100%);
    color: #e8f5e8;
    border-color: rgba(102, 187, 106, 0.4);
}

.message.error {
    background: linear-gradient(135deg, 
        rgba(244, 67, 54, 0.9) 0%, 
        rgba(239, 83, 80, 0.9) 100%);
    color: #ffebee;
    border-color: rgba(239, 83, 80, 0.4);
}

@keyframes slideIn {
    from {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* 正在思考中动画样式 - 全局可用 */
.thinking-indicator {
    display: inline-block;
    max-width: 80%;
    padding: 10px 15px;
    background: #f8f9fa;
    color: #666;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    font-style: italic;
    position: relative;
}

.thinking-dots {
    display: inline-block;
    animation: thinking 1.5s infinite;
}

@keyframes thinking {
    0%, 20% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.thinking-dots::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}