/* 基础样式和重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    transition: all 0.5s ease;
    overflow-x: hidden;
}

/* 主题控制 */
.theme-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.theme-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.theme-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* 星渝色主题 - 官方配色方案 */
body[data-theme="star-blue"] {
    background: linear-gradient(135deg, #18B7F6 0%, #666BCE 50%, #D7EEF6 100%);
}

/* 栩光金星色主题 - 官方配色方案 */
body[data-theme="gold-glitter"] {
    background: linear-gradient(135deg, #FFD64F 0%, #FFE46B 50%, #FFF5C7 100%);
}

/* 粉白渐变主题 */
body[data-theme="pink-white"] {
    background: linear-gradient(135deg, #ff69b4 0%, #ffb6c1 50%, #fff0f5 100%);
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 40px;
}

/* 标题区域 */
.header {
    text-align: center;
    margin-bottom: 50px;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(45deg, #fff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

/* 闪烁效果 */
.sparkle {
    position: relative;
}

.sparkle::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: sparkle 2s linear infinite;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes sparkle {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

/* 卡片网格 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* 卡片样式 */
.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.card:hover::before {
    left: 100%;
}

/* 卡片头部 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
}

.card-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* 卡片内容 */
.card-content {
    margin-bottom: 20px;
}

/* 图表容器 */
.card-content canvas {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

/* 卡片底部 */
.card-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.stats {
    display: flex;
    justify-content: space-between;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.stat-value.up {
    color: #4ade80;
}

.stat-value.down {
    color: #f87171;
}

/* 数据详情面板 */
.data-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.data-panel.active {
    opacity: 1;
    transform: translateY(0);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.panel-header h3 {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

.close-panel {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-panel:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 数据详情内容 */
#data-details {
    color: white;
}

#data-details p {
    margin-bottom: 10px;
    line-height: 1.6;
}

#data-details .highlight {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* 悬浮装饰元素 */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-element {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

.element-1 {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.element-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.element-3 {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

.element-4 {
    width: 120px;
    height: 120px;
    top: 30%;
    right: 30%;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 60px 15px 30px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .theme-controls {
        top: 10px;
        right: 10px;
        flex-direction: column;
    }
    
    .theme-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .stats {
        flex-direction: column;
        gap: 15px;
    }
}

/* 主题特定的微调 - 使用官方配色 */
body[data-theme="star-blue"] .card {
    background: rgba(24, 183, 246, 0.2);
    border: 1px solid rgba(24, 183, 246, 0.3);
}

body[data-theme="gold-glitter"] .card {
    background: rgba(255, 214, 79, 0.2);
    border: 1px solid rgba(255, 214, 79, 0.3);
}

body[data-theme="pink-white"] .card {
    background: rgba(255, 105, 180, 0.2);
    border: 1px solid rgba(255, 105, 180, 0.3);
}

/* 滚动条样式 */
.data-panel::-webkit-scrollbar {
    width: 6px;
}

.data-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.data-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.data-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}