/* 定义全局颜色变量（支持主题切换） */
:root {
    /* 亮色主题 */
    --primary-color: #4f6df5;
    --secondary-color: #324ed4;
    --accent-color: #7248e6;
    --text-color: #2c3e50;
    --text-light: #ffffff;
    --background: linear-gradient(135deg, #d4e0ff 0%, #e6e9ff 100%);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.25);
    --row-even: rgba(245, 248, 255, 0.6);
    --row-odd: rgba(255, 255, 255, 0.6);
    --glow-color: rgba(114, 72, 230, 0.6);
    --gradient-light: linear-gradient(135deg, rgba(79, 109, 245, 0.8), rgba(114, 72, 230, 0.8));
    --gradient-dark: linear-gradient(135deg, rgba(79, 109, 245, 1), rgba(114, 72, 230, 1));
    --bubble-color-1: rgba(79, 109, 245, 0.15);
    --bubble-color-2: rgba(114, 72, 230, 0.1);
    --date-color: #4f6df5;
    --number-color: #7248e6;
}

/* 暗色主题变量 */
[data-theme="dark"] {
    --primary-color: #7289fd;
    --secondary-color: #5468de;
    --accent-color: #9370fd;
    --text-color: #e0e0e0;
    --text-light: #ffffff;
    --background: linear-gradient(135deg, #1a1f40 0%, #2a2f60 100%);
    --glass-bg: rgba(30, 35, 65, 0.3);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 8px 32px 0 rgba(10, 10, 25, 0.5);
    --row-even: rgba(35, 40, 70, 0.6);
    --row-odd: rgba(40, 45, 75, 0.6);
    --glow-color: rgba(147, 112, 253, 0.6);
    --gradient-light: linear-gradient(135deg, rgba(114, 137, 253, 0.8), rgba(147, 112, 253, 0.8));
    --gradient-dark: linear-gradient(135deg, rgba(114, 137, 253, 1), rgba(147, 112, 253, 1));
    --bubble-color-1: rgba(114, 137, 253, 0.15);
    --bubble-color-2: rgba(147, 112, 253, 0.1);
    --date-color: #7289fd;
    --number-color: #9370fd;
}

/* 全局样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text-color);
    font-size: 16px;
    transition: background 0.8s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* 主容器 */
.dashboard-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
}

/* 页面标题 */
h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2.8em;
    position: relative;
    overflow: hidden;
    padding: 15px 0;
    text-shadow: 0 2px 10px rgba(79, 109, 245, 0.3);
    transition: color 0.3s ease;
}

/* 科技感标题元素 */
h1::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 60%;
    height: 2px;
    background: linear-gradient(to right, 
        transparent 0%, 
        var(--primary-color) 20%, 
        var(--accent-color) 50%,
        var(--primary-color) 80%, 
        transparent 100%);
    transition: background 0.3s ease;
}

h1::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--primary-color) 0%, transparent 80%);
    opacity: 0.05;
    z-index: -1;
    transition: background 0.3s ease;
}

/* 科技感装饰元素 */
.tech-decoration {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(79, 109, 245, 0.2);
    border-radius: 8px;
    transform: rotate(45deg);
    z-index: -1;
    transition: all 0.5s ease;
}

.tech-decoration.left {
    top: 15px;
    left: calc(50% - 120px);
    border-right: 2px solid var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    animation: pulse-left 3s infinite ease-in-out;
}

.tech-decoration.right {
    top: 15px;
    right: calc(50% - 120px);
    border-left: 2px solid var(--primary-color);
    border-top: 2px solid var(--primary-color);
    animation: pulse-right 3s infinite ease-in-out;
}

@keyframes pulse-left {
    0%, 100% { transform: rotate(45deg) scale(1); opacity: 0.8; }
    50% { transform: rotate(45deg) scale(1.1); opacity: 1; }
}

@keyframes pulse-right {
    0%, 100% { transform: rotate(45deg) scale(1); opacity: 0.8; }
    50% { transform: rotate(45deg) scale(1.1); opacity: 1; }
}

/* 梦幻气泡背景 */
.bubbles {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    top: 0;
    left: 0;
    pointer-events: none;
}

.bubble {
    position: absolute;
    bottom: -100px;
    border-radius: 50%;
    opacity: 0.5;
    animation: rise 15s infinite ease-in;
    background: linear-gradient(to bottom right, var(--bubble-color-1), var(--bubble-color-2));
    filter: blur(5px);
}

.bubble:nth-child(1) {
    width: 40px;
    height: 40px;
    left: 10%;
    animation-duration: 12s;
}

.bubble:nth-child(2) {
    width: 20px;
    height: 20px;
    left: 20%;
    animation-duration: 15s;
    animation-delay: 1s;
}

.bubble:nth-child(3) {
    width: 50px;
    height: 50px;
    left: 35%;
    animation-duration: 18s;
    animation-delay: 2s;
}

.bubble:nth-child(4) {
    width: 80px;
    height: 80px;
    left: 50%;
    animation-duration: 17s;
    animation-delay: 0s;
}

.bubble:nth-child(5) {
    width: 35px;
    height: 35px;
    left: 55%;
    animation-duration: 16s;
    animation-delay: 1s;
}

.bubble:nth-child(6) {
    width: 45px;
    height: 45px;
    left: 65%;
    animation-duration: 14s;
    animation-delay: 3s;
}

.bubble:nth-child(7) {
    width: 60px;
    height: 60px;
    left: 70%;
    animation-duration: 20s;
    animation-delay: 2s;
}

.bubble:nth-child(8) {
    width: 25px;
    height: 25px;
    left: 80%;
    animation-duration: 13s;
    animation-delay: 2s;
}

.bubble:nth-child(9) {
    width: 15px;
    height: 15px;
    left: 70%;
    animation-duration: 11s;
    animation-delay: 1s;
}

.bubble:nth-child(10) {
    width: 70px;
    height: 70px;
    left: 25%;
    animation-duration: 19s;
    animation-delay: 4s;
}

@keyframes rise {
    0% {
        bottom: -100px;
        transform: translateX(0) rotate(0deg);
    }
    30% {
        transform: translateX(50px) rotate(45deg);
    }
    50% {
        transform: translate(100px, -300px) rotate(90deg);
    }
    75% {
        transform: translate(50px, -500px) rotate(135deg);
    }
    100% {
        bottom: 1080px;
        transform: translateX(-100px) rotate(180deg);
    }
}

/* 数据容器样式 */
.data-container {
    margin: 2rem 0;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.data-container:hover {
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.4);
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    position: relative;
}

.data-table tr:nth-child(even) td {
    background-color: var(--row-even);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.data-table tr:nth-child(odd) td {
    background-color: var(--row-odd);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.data-table td {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    transition: all 0.2s ease;
}

.data-table tr:hover td {
    background-color: rgba(79, 109, 245, 0.1);
}

.data-table tr:first-child td {
    background: var(--gradient-dark);
    color: var(--text-light);
    font-weight: 600;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 右侧悬浮导航 */
.nav-float {
    position: fixed;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s ease;
}

/* 梦幻导航按钮 */
.nav-button {
    width: 55px;
    height: 55px;
    border: none;
    border-radius: 12px;
    background: var(--glass-bg);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 5px 15px rgba(31, 38, 135, 0.2);
}

.nav-button .btn-content {
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.nav-button .btn-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--glow-color) 0%, transparent 70%);
    opacity: 0;
    z-index: 1;
    transition: opacity 0.5s ease;
}

.nav-button:hover {
    transform: translateX(-5px) scale(1.05);
    color: var(--text-light);
    background: var(--gradient-light);
}

.nav-button:hover .btn-glow {
    opacity: 0.6;
    animation: pulse-glow 2s infinite;
}

.nav-button.active {
    background: var(--gradient-dark);
    color: var(--text-light);
    transform: translateX(-8px);
    box-shadow: 0 8px 25px rgba(31, 38, 135, 0.3);
}

.nav-button.active .btn-glow {
    opacity: 0.8;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* 页面导航按钮 */
.page-navigator {
    position: fixed;
    right: 30px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--glass-bg);
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 5px 15px rgba(31, 38, 135, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.page-navigator .nav-icon {
    position: relative;
    z-index: 2;
}

.page-navigator .nav-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--glow-color) 0%, transparent 70%);
    opacity: 0;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.page-navigator:hover {
    transform: scale(1.1);
    color: var(--text-light);
    background: var(--gradient-light);
}

.page-navigator:hover .nav-glow {
    opacity: 0.6;
    animation: pulse-glow 2s infinite;
}

.page-navigator.top {
    top: 30px;
    transform: translateY(-70px);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.page-navigator.top.visible {
    transform: translateY(0);
    opacity: 1;
}

.page-navigator.bottom {
    bottom: 30px;
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.theme-toggle::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--primary-color) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle:hover::before {
    opacity: 0.2;
}

.theme-toggle i {
    font-size: 24px;
    color: var(--primary-color);
    position: relative;
    z-index: 2;
}

/* 内容区域动画 */
#content-area {
    transition: opacity 0.8s ease;
    opacity: 1;
}

#content-area.fading {
    opacity: 0;
}

#content-area.showing {
    opacity: 1;
}

/* 淡入淡出容器 */
.fade-container {
    transition: opacity 0.8s ease;
}

.fade-container.fading {
    opacity: 0;
}

.fade-container.showing {
    opacity: 1;
}

/* 数据行动画 */
.data-row {
    transition: opacity 0.5s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 3px solid rgba(79, 109, 245, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 欢迎和错误容器 */
.welcome-container, .error-container {
    text-align: center;
    padding: 3rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    margin: 2rem 0;
    transition: all 0.3s ease;
}

.welcome-container:hover, .error-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(31, 38, 135, 0.3);
}

.welcome-icon, .error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 6s ease-in-out infinite;
}

.welcome-title, .error-title {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.welcome-subtitle {
    color: var(--text-color);
    margin-bottom: 1rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* 恢复编号高亮样式 */
.number-highlight {
    color: var(--number-color);
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 2.2em;
    }
    
    .data-table td {
        padding: 14px 18px;
    }
    
    .nav-float {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        top: auto;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px;
        background: var(--glass-bg);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 20px 20px 0 0;
        border-top: 1px solid var(--glass-border);
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
        transform: none;
        gap: 10px;
    }
    
    .nav-button {
        width: 45px;
        height: 45px;
        font-size: 0.8rem;
    }
    
    .page-navigator {
        width: 45px;
        height: 45px;
    }
    
    .page-navigator.bottom {
        bottom: 80px;
    }
    
    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

/* 特效：闪光效果 */
.data-container::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shine 10s infinite linear;
    z-index: 1;
    pointer-events: none;
}

@keyframes shine {
    from {
        transform: rotate(30deg) translateX(-100%);
    }
    to {
        transform: rotate(30deg) translateX(100%);
    }
}

/* 暗黑模式过渡 */
.dark-mode {
    transition: all 0.5s ease;
}

/* 改进的表格效果（轻量化） */
.data-table {
    contain: content; /* 性能优化 */
}

.data-table tr {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    will-change: transform; /* 性能优化 */
}

.data-table tr:hover {
    transform: scale(1.005) translateX(2px);
    position: relative;
    z-index: 2;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}