/* ===== 基础样式重置 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 深色主题色彩 */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #16161f;
    --bg-card-hover: #1e1e2a;
    
    /* 文字颜色 */
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    
    /* 强调色 */
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    
    /* 渐变 */
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    --gradient-green: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-orange: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
    
    /* 边框 */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-light: rgba(255, 255, 255, 0.12);
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow-purple: 0 0 30px rgba(139, 92, 246, 0.3);
    --shadow-glow-blue: 0 0 30px rgba(59, 130, 246, 0.3);
    
    /* 尺寸 */
    --sidebar-width: 260px;
    --header-height: 80px;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    
    /* 字体 */
    --font-primary: 'Outfit', 'Noto Sans SC', sans-serif;
    
    /* 动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== 应用布局 ===== */
.app {
    display: flex;
    min-height: 100vh;
}

/* ===== 侧边栏 ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-purple);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow-purple);
}

.logo-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #a0a0b0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--gradient-purple);
    color: white;
    box-shadow: var(--shadow-glow-purple);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.update-time {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    background: var(--bg-primary);
}

/* ===== 头部 ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 20px;
    width: 320px;
    transition: all var(--transition-normal);
}

.search-box:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.search-box svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* ===== 页面切换 ===== */
.page {
    display: none;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    opacity: 0.9;
    z-index: 0;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gradient-purple {
    background: var(--gradient-purple);
}

.gradient-blue {
    background: var(--gradient-blue);
}

.gradient-green {
    background: var(--gradient-green);
}

.gradient-orange {
    background: var(--gradient-orange);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.stat-content {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-change {
    font-size: 0.75rem;
    opacity: 0.85;
}

.stat-change.positive {
    color: #a7f3d0;
}

/* ===== 图表区域 ===== */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    transition: all var(--transition-normal);
}

.chart-card:hover {
    border-color: var(--border-color-light);
}

.chart-card.large {
    grid-column: span 1;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.chart-legend {
    display: flex;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.purple { background: var(--accent-purple); }
.dot.blue { background: var(--accent-blue); }
.dot.green { background: var(--accent-green); }

.chart-body {
    height: 280px;
    position: relative;
}

.chart-body canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ===== 排行榜 ===== */
.ranking-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.ranking-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
}

.ranking-header {
    margin-bottom: 20px;
}

.ranking-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.ranking-list {
    list-style: none;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item:hover {
    background: var(--bg-tertiary);
    margin: 0 -12px;
    padding: 12px;
    border-radius: var(--border-radius-sm);
}

.ranking-position {
    width: 28px;
    height: 28px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.ranking-item:nth-child(1) .ranking-position {
    background: var(--gradient-orange);
    color: white;
}

.ranking-item:nth-child(2) .ranking-position {
    background: var(--bg-tertiary);
    border: 2px solid var(--accent-purple);
    color: var(--accent-purple);
}

.ranking-item:nth-child(3) .ranking-position {
    background: var(--bg-tertiary);
    border: 2px solid var(--accent-blue);
    color: var(--accent-blue);
}

.ranking-name {
    flex: 1;
    font-size: 0.9rem;
}

.ranking-value {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ranking-value.positive {
    color: var(--accent-green);
}

/* ===== 品类分析页面 ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 28px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-glow-purple);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.category-card h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.category-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.category-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.category-growth {
    font-weight: 600;
}

.category-growth.positive {
    color: var(--accent-green);
}

.category-growth.negative {
    color: #f87171;
}

.category-volume {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.category-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--gradient-purple);
    border-radius: 3px;
    transition: width 1s ease;
}

.subcategory-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 28px;
}

.subcategory-section h3 {
    margin-bottom: 20px;
}

.subcategory-grid {
    display: grid;
    gap: 16px;
}

.subcategory-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
}

.subcategory-name {
    width: 120px;
    font-size: 0.9rem;
}

.subcategory-trend {
    width: 60px;
    font-size: 0.85rem;
    font-weight: 600;
}

.subcategory-trend.positive {
    color: var(--accent-green);
}

.subcategory-trend.negative {
    color: #f87171;
}

.mini-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.mini-fill {
    height: 100%;
    background: var(--gradient-blue);
    border-radius: 4px;
    transition: width 1s ease;
}

/* ===== 风格趋势页面 ===== */
.styles-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.tag-cloud-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 28px;
}

.tag-cloud-section h3 {
    margin-bottom: 24px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.tag {
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.tag:hover {
    transform: scale(1.05);
}

.tag.size-xl {
    font-size: 1.2rem;
    padding: 14px 28px;
    background: var(--gradient-purple);
    border: none;
    color: white;
    font-weight: 600;
}

.tag.size-lg {
    font-size: 1rem;
    padding: 12px 24px;
    background: var(--gradient-blue);
    border: none;
    color: white;
}

.tag.size-md {
    font-size: 0.9rem;
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.tag.size-sm {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.color-trends {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 28px;
}

.color-trends h3 {
    margin-bottom: 24px;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.color-swatch {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.color-popularity {
    font-size: 0.7rem;
    color: var(--accent-green);
}

.style-details {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 28px;
}

.style-details h3 {
    margin-bottom: 24px;
}

.style-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.style-card-item {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: all var(--transition-normal);
}

.style-card-item:hover {
    background: var(--bg-card-hover);
}

.style-card-item h4 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.style-card-item p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.style-card-item .style-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

.style-card-item .style-growth {
    color: var(--accent-green);
    font-weight: 600;
}

/* ===== 季节趋势页面 ===== */
.seasonal-timeline {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 28px;
    margin-bottom: 32px;
}

.seasonal-timeline h3 {
    margin-bottom: 24px;
}

.timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--bg-tertiary);
    transform: translateY(-50%);
    border-radius: 2px;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 3px solid var(--bg-card);
    margin-bottom: 12px;
}

.timeline-item.active .timeline-dot {
    background: var(--accent-purple);
    box-shadow: 0 0 12px var(--accent-purple);
}

.timeline-item.upcoming .timeline-dot {
    background: var(--accent-orange);
}

.timeline-month {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-event {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: 80px;
}

.timeline-item.active .timeline-event {
    color: var(--accent-purple);
    font-weight: 600;
}

.upcoming-events {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 28px;
    margin-bottom: 32px;
}

.upcoming-events h3 {
    margin-bottom: 24px;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.event-card {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    transition: all var(--transition-normal);
}

.event-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
}

.event-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.event-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.event-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.event-countdown {
    font-size: 0.8rem;
    color: var(--accent-orange);
    font-weight: 600;
}

.seasonal-chart {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 28px;
}

.seasonal-chart h3 {
    margin-bottom: 24px;
}

.seasonal-chart .chart-body {
    height: 300px;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ranking-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ranking-card:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .style-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 70px;
    }
    
    .logo-text,
    .nav-item span,
    .sidebar-footer {
        display: none;
    }
    
    .logo {
        justify-content: center;
    }
    
    .nav-item {
        justify-content: center;
        padding: 14px;
    }
    
    .main-content {
        margin-left: 70px;
        padding: 20px;
    }
    
    .header {
        flex-direction: column;
        gap: 16px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .ranking-section {
        grid-template-columns: 1fr;
    }
    
    .ranking-card:last-child {
        grid-column: span 1;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .color-palette {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .style-cards {
        grid-template-columns: 1fr;
    }
    
    .timeline {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 20px;
    }
    
    .timeline::before {
        display: none;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 动画 ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    animation: slideUp 0.5s ease backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.chart-card {
    animation: slideUp 0.5s ease backwards;
    animation-delay: 0.5s;
}

.ranking-card {
    animation: slideUp 0.5s ease backwards;
}

.ranking-card:nth-child(1) { animation-delay: 0.6s; }
.ranking-card:nth-child(2) { animation-delay: 0.7s; }
.ranking-card:nth-child(3) { animation-delay: 0.8s; }
