/* ========== CSS变量定义 ========== */
:root {
    /* 主色调 */
    --primary-color: #00d4ff;
    --primary-glow: rgba(0, 212, 255, 0.6);
    --secondary-color: #7b68ee;
    --accent-color: #00ff88;
    
    /* 背景色 */
    --bg-dark: #0a1632;
    --bg-medium: #101a2e;
    --bg-light: #162340;
    
    /* 面板色 */
    --panel-bg: rgba(20, 38, 79, 0.88);
    --panel-border: rgba(0, 212, 255, 0.35);
    --panel-glow: rgba(0, 212, 255, 0.18);
    
    /* 特殊面板色 */
    --special-panel-bg: rgba(24, 35, 70, 0.9);
    --special-border: rgba(123, 104, 238, 0.45);
    --special-glow: rgba(123, 104, 238, 0.22);
    
    /* 文字色 */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-accent: #00d4ff;
}

/* ========== 数据加载遮罩层 ========== */
.load-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 22, 50, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.load-dialog {
    background: linear-gradient(135deg, rgba(20, 40, 80, 0.95), rgba(30, 50, 100, 0.9));
    border: 1px solid var(--primary-color);
    border-radius: 16px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 
        0 0 40px rgba(0, 212, 255, 0.3),
        inset 0 0 60px rgba(0, 212, 255, 0.05);
    animation: dialogPulse 2s ease-in-out infinite;
}

@keyframes dialogPulse {
    0%, 100% { box-shadow: 0 0 40px rgba(0, 212, 255, 0.3), inset 0 0 60px rgba(0, 212, 255, 0.05); }
    50% { box-shadow: 0 0 60px rgba(0, 212, 255, 0.5), inset 0 0 80px rgba(0, 212, 255, 0.1); }
}

.load-icon {
    font-size: 48px;
    margin-bottom: 15px;
    animation: iconBounce 1s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.load-dialog h3 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 10px;
    letter-spacing: 3px;
}

.load-dialog p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.load-btn {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--bg-dark);
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.load-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
}

.load-btn span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.load-tip {
    margin-top: 20px;
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
}

/* ========== 动态背景 ========== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(123, 104, 238, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 255, 136, 0.05) 0%, transparent 70%),
        linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-medium) 50%, var(--bg-dark) 100%);
}

/* 网格线条 */
.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* 漂浮粒子 */
.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.floating-particles span {
    position: absolute;
    width: 5px;
    height: 5px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--primary-glow), 0 0 30px var(--primary-glow), 0 0 45px var(--primary-glow);
    animation: float 15s infinite ease-in-out;
    opacity: 0.8;
}

.floating-particles span:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 18s; width: 6px; height: 6px; }
.floating-particles span:nth-child(2) { left: 20%; top: 80%; animation-delay: 2s; animation-duration: 15s; }
.floating-particles span:nth-child(3) { left: 30%; top: 40%; animation-delay: 4s; animation-duration: 20s; width: 7px; height: 7px; }
.floating-particles span:nth-child(4) { left: 40%; top: 60%; animation-delay: 1s; animation-duration: 17s; }
.floating-particles span:nth-child(5) { left: 50%; top: 30%; animation-delay: 3s; animation-duration: 19s; width: 6px; height: 6px; }
.floating-particles span:nth-child(6) { left: 60%; top: 70%; animation-delay: 5s; animation-duration: 16s; }
.floating-particles span:nth-child(7) { left: 70%; top: 50%; animation-delay: 2s; animation-duration: 21s; width: 8px; height: 8px; }
.floating-particles span:nth-child(8) { left: 80%; top: 25%; animation-delay: 4s; animation-duration: 14s; }
.floating-particles span:nth-child(9) { left: 90%; top: 85%; animation-delay: 1s; animation-duration: 18s; }
.floating-particles span:nth-child(10) { left: 15%; top: 55%; animation-delay: 3s; animation-duration: 22s; width: 6px; height: 6px; }
.floating-particles span:nth-child(11) { left: 25%; top: 15%; animation-delay: 0s; animation-duration: 16s; background: var(--secondary-color); box-shadow: 0 0 15px rgba(123, 104, 238, 0.8), 0 0 30px rgba(123, 104, 238, 0.6); }
.floating-particles span:nth-child(12) { left: 35%; top: 90%; animation-delay: 2s; animation-duration: 19s; background: var(--accent-color); box-shadow: 0 0 15px rgba(0, 255, 136, 0.8), 0 0 30px rgba(0, 255, 136, 0.6); width: 7px; height: 7px; }
.floating-particles span:nth-child(13) { left: 55%; top: 45%; animation-delay: 4s; animation-duration: 15s; background: var(--secondary-color); box-shadow: 0 0 15px rgba(123, 104, 238, 0.8), 0 0 30px rgba(123, 104, 238, 0.6); }
.floating-particles span:nth-child(14) { left: 75%; top: 35%; animation-delay: 1s; animation-duration: 20s; background: var(--accent-color); box-shadow: 0 0 15px rgba(0, 255, 136, 0.8), 0 0 30px rgba(0, 255, 136, 0.6); }
.floating-particles span:nth-child(15) { left: 85%; top: 65%; animation-delay: 3s; animation-duration: 17s; width: 6px; height: 6px; }
/* 新增粒子 16-30 */
.floating-particles span:nth-child(16) { left: 5%; top: 45%; animation-delay: 0.5s; animation-duration: 19s; background: var(--secondary-color); box-shadow: 0 0 15px rgba(123, 104, 238, 0.8), 0 0 30px rgba(123, 104, 238, 0.6); }
.floating-particles span:nth-child(17) { left: 12%; top: 75%; animation-delay: 2.5s; animation-duration: 16s; width: 6px; height: 6px; }
.floating-particles span:nth-child(18) { left: 22%; top: 35%; animation-delay: 1.5s; animation-duration: 21s; background: var(--accent-color); box-shadow: 0 0 15px rgba(0, 255, 136, 0.8), 0 0 30px rgba(0, 255, 136, 0.6); }
.floating-particles span:nth-child(19) { left: 38%; top: 18%; animation-delay: 3.5s; animation-duration: 18s; }
.floating-particles span:nth-child(20) { left: 45%; top: 88%; animation-delay: 0.8s; animation-duration: 20s; width: 7px; height: 7px; }
.floating-particles span:nth-child(21) { left: 52%; top: 12%; animation-delay: 4.5s; animation-duration: 15s; background: var(--secondary-color); box-shadow: 0 0 15px rgba(123, 104, 238, 0.8), 0 0 30px rgba(123, 104, 238, 0.6); }
.floating-particles span:nth-child(22) { left: 65%; top: 92%; animation-delay: 1.8s; animation-duration: 17s; }
.floating-particles span:nth-child(23) { left: 72%; top: 22%; animation-delay: 2.8s; animation-duration: 22s; background: var(--accent-color); box-shadow: 0 0 15px rgba(0, 255, 136, 0.8), 0 0 30px rgba(0, 255, 136, 0.6); width: 6px; height: 6px; }
.floating-particles span:nth-child(24) { left: 82%; top: 78%; animation-delay: 3.8s; animation-duration: 16s; }
.floating-particles span:nth-child(25) { left: 92%; top: 42%; animation-delay: 0.3s; animation-duration: 19s; width: 8px; height: 8px; }
.floating-particles span:nth-child(26) { left: 8%; top: 92%; animation-delay: 4.2s; animation-duration: 18s; background: var(--secondary-color); box-shadow: 0 0 15px rgba(123, 104, 238, 0.8), 0 0 30px rgba(123, 104, 238, 0.6); }
.floating-particles span:nth-child(27) { left: 48%; top: 52%; animation-delay: 1.2s; animation-duration: 21s; }
.floating-particles span:nth-child(28) { left: 58%; top: 8%; animation-delay: 2.2s; animation-duration: 15s; background: var(--accent-color); box-shadow: 0 0 15px rgba(0, 255, 136, 0.8), 0 0 30px rgba(0, 255, 136, 0.6); }
.floating-particles span:nth-child(29) { left: 95%; top: 15%; animation-delay: 3.2s; animation-duration: 20s; width: 6px; height: 6px; }
.floating-particles span:nth-child(30) { left: 3%; top: 8%; animation-delay: 4.8s; animation-duration: 17s; background: var(--secondary-color); box-shadow: 0 0 15px rgba(123, 104, 238, 0.8), 0 0 30px rgba(123, 104, 238, 0.6); }

@keyframes float {
    0%, 100% { 
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    25% { 
        transform: translate(30px, -40px) scale(1.3);
        opacity: 1;
    }
    50% { 
        transform: translate(-15px, 30px) scale(0.9);
        opacity: 0.7;
    }
    75% { 
        transform: translate(40px, 15px) scale(1.2);
        opacity: 0.9;
    }
}

/* 光晕球体 */
.glow-orbs {
    position: absolute;
    width: 100%;
    height: 100%;
    filter: blur(60px);
}

.orb {
    position: absolute;
    border-radius: 50%;
    animation: orbFloat 25s infinite ease-in-out;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.18) 0%, transparent 70%);
    left: -5%;
    top: 20%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(123, 104, 238, 0.15) 0%, transparent 70%);
    right: -10%;
    top: 50%;
    animation-delay: 8s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.12) 0%, transparent 70%);
    left: 40%;
    bottom: -5%;
    animation-delay: 15s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -40px); }
    66% { transform: translate(-20px, 30px); }
}

/* ========== 头部样式 ========== */
header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    padding: 0 20px;
    position: relative;
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.header-decoration {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.5;
}

.left-dec {
    background: linear-gradient(90deg, transparent 0%, var(--primary-color) 100%);
}

.right-dec {
    background: linear-gradient(90deg, var(--primary-color) 0%, transparent 100%);
}

.header-content {
    text-align: center;
    padding: 0 40px;
}

.header-content h1 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 8px;
    color: var(--text-primary);
    text-shadow: 
        0 0 20px var(--primary-glow),
        0 0 40px rgba(0, 212, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 15px;
}

.title-icon {
    color: var(--primary-color);
    font-size: 18px;
    animation: iconPulse 2s infinite;
}

@keyframes iconPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.header-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    margin-top: 8px;
    animation: lineGlow 3s infinite;
}

@keyframes lineGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ========== 主体布局 ========== */
.mainbox {
    display: flex;
    gap: 15px;
    padding: 15px;
    height: calc(100vh - 80px);
    max-width: 1920px;
    margin: 0 auto;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.column.left {
    flex: 3;
}

.column.middle {
    flex: 4;
}

.column.right {
    flex: 3;
}

/* ========== 面板通用样式 ========== */
.panel {
    flex: 1;
    position: relative;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

/* 面板边框发光效果 */
.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--primary-color), 
        transparent);
    opacity: 0.8;
}

.panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, 
        var(--primary-color), 
        transparent 80%);
    opacity: 0.5;
}

/* 面板悬停效果 */
.panel:hover {
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 
        0 0 20px var(--panel-glow),
        inset 0 0 30px rgba(0, 212, 255, 0.05);
}

/* 面板角落装饰 */
.panel .panel-header::before,
.panel .panel-header::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    opacity: 0.6;
}

.panel .panel-header::before {
    top: 8px;
    left: 8px;
    border-right: none;
    border-bottom: none;
}

.panel .panel-header::after {
    top: 8px;
    right: 8px;
    border-left: none;
    border-bottom: none;
}

/* 面板头部 */
.panel-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: linear-gradient(90deg, 
        rgba(0, 212, 255, 0.1) 0%, 
        transparent 50%,
        rgba(0, 212, 255, 0.05) 100%);
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
    position: relative;
}

.panel-icon {
    color: var(--primary-color);
    margin-right: 10px;
    font-size: 14px;
    animation: iconBlink 3s infinite;
}

@keyframes iconBlink {
    0%, 90%, 100% { opacity: 1; }
    95% { opacity: 0.3; }
}

.panel-header h2 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 2px;
}

/* 图表区域 */
.chart {
    flex: 1;
    margin: 12px;
    margin-top: 8px;
    margin-bottom: 15px;
    min-height: 0;
    background: rgba(0, 20, 40, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(0, 212, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== 特殊面板样式 (P4, P5) ========== */
.special-panel {
    background: var(--special-panel-bg);
    border-color: var(--special-border);
}

.special-panel::before {
    background: linear-gradient(90deg, 
        transparent, 
        var(--secondary-color), 
        transparent);
}

.special-panel::after {
    background: linear-gradient(180deg, 
        var(--secondary-color), 
        transparent 80%);
}

.special-panel:hover {
    border-color: rgba(123, 104, 238, 0.6);
    box-shadow: 
        0 0 25px var(--special-glow),
        inset 0 0 40px rgba(123, 104, 238, 0.08);
}

.special-panel .panel-header {
    background: linear-gradient(90deg, 
        rgba(123, 104, 238, 0.15) 0%, 
        transparent 50%,
        rgba(123, 104, 238, 0.08) 100%);
    border-bottom-color: rgba(123, 104, 238, 0.2);
}

.special-panel .panel-header::before,
.special-panel .panel-header::after {
    border-color: var(--secondary-color);
}

.special-panel .panel-icon {
    color: var(--secondary-color);
}

.special-panel .chart {
    border-color: rgba(123, 104, 238, 0.15);
    background: rgba(20, 15, 40, 0.4);
}

/* P4 滚动容器特殊样式 */
.panel.p4 {
    flex: 3;
}

.panel.p4 .scroll-container {
    height: 100%;
    overflow: hidden;
    padding: 15px;
}

.panel.p4 .scroll-content {
    animation: scrollUp 200s linear infinite;
}

@keyframes scrollUp {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.panel.p4 .placeholder-text {
    color: var(--text-secondary);
    text-align: center;
    padding: 40px;
    font-size: 14px;
    letter-spacing: 2px;
}

/* P4 新闻列表样式 */
.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(123, 104, 238, 0.15);
    transition: all 0.3s ease;
}

.news-item:hover {
    background: rgba(123, 104, 238, 0.1);
}

.news-index {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    margin-right: 12px;
}

.news-item:nth-child(-n+3) .news-index {
    background: linear-gradient(135deg, #ff6b6b, #ffaa00);
}

/* 无序图标样式 */
.news-bullet {
    flex-shrink: 0;
    color: var(--primary-color);
    font-size: 10px;
    margin-right: 10px;
    margin-top: 2px;
    text-shadow: 0 0 8px var(--primary-glow);
}

.news-title {
    flex: 1;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.news-item:hover .news-title {
    color: var(--text-primary);
}

/* P5 词云面板特殊样式 */
.panel.p5 {
    flex: 5;
    display: flex;
    flex-direction: column;
}

.panel.p5 .stage-buttons {
    flex-shrink: 0;
    padding: 6px 15px;
}

.panel.p5 .chart {
    flex: 1;
    margin: 0 5px 5px 5px;
    min-height: 0;
    overflow: hidden;
}

/* ========== 阶段按钮样式 ========== */
.stage-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stage-btn {
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.stage-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
}

.stage-btn.active {
    color: var(--bg-dark);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-color: transparent;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

/* 特殊面板的按钮样式 */
.special-panel .stage-btn.active {
    background: linear-gradient(135deg, var(--secondary-color), #9f8cff);
    box-shadow: 0 0 15px rgba(123, 104, 238, 0.5);
}

/* ========== 左右面板调整 ========== */
.column.left .panel,
.column.right .panel {
    display: flex;
    flex-direction: column;
}

/* 右侧面板高度分配 */
.column.right .panel.p6 {
    flex: 1.2;
}

.column.right .panel.p7 {
    flex: 1;
}

/* ========== 响应式设计 ========== */
@media screen and (max-width: 1600px) {
    .header-content h1 {
        font-size: 24px;
        letter-spacing: 6px;
    }
    
    .panel-header h2 {
        font-size: 13px;
    }
}

@media screen and (max-width: 1200px) {
    .mainbox {
        flex-direction: column;
    }
    
    .column {
        flex-direction: row !important;
    }
    
    .column.middle {
        order: -1;
    }
}

/* ========== 数据加载动画 ========== */
@keyframes dataLoading {
    0% { opacity: 0.3; }
    50% { opacity: 0.8; }
    100% { opacity: 0.3; }
}

.chart:empty::after {
    content: '等待数据...';
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--text-secondary);
    font-size: 13px;
    letter-spacing: 3px;
    animation: dataLoading 2s infinite;
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
