/* ============================================
   游戏行业智能分析看板 V2 - 样式系统
   融合V4版战略分析模块 + 暗色主题
   ============================================ */

/* CSS Variables - 暗色主题 (优化) */
:root {
    --bg-primary: #0d1117;
    --bg-secondary: #131720;
    --bg-card: #161b26;
    --bg-card-hover: #1c2231;
    --bg-sidebar: #0c1018;
    --bg-input: #1a2030;
    --border-color: #2a3042;
    --border-light: #1f2537;
    --text-primary: #e8eaf0;
    --text-secondary: #8b8fa3;
    --text-muted: #5a5e73;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --teal: #14b8a6;
    --sky: #0ea5e9;
    --purple: #a855f7;
    --chart-1: #6366f1;
    --chart-2: #8b5cf6;
    --chart-3: #a78bfa;
    --chart-4: #c4b5fd;
    --chart-5: #3b82f6;
    --chart-6: #06b6d4;
    --chart-7: #22c55e;
    --chart-8: #f59e0b;
    --chart-9: #ef4444;
    --chart-10: #ec4899;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 64px;
    --topbar-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(99,102,241,0.15);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-display: 'DM Sans', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'DM Mono', 'JetBrains Mono', monospace;
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #f5f6fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fc;
    --bg-sidebar: #ffffff;
    --bg-input: #f0f1f5;
    --border-color: #e2e4ea;
    --border-light: #edeef2;
    --text-primary: #1a1c2e;
    --text-secondary: #64687a;
    --text-muted: #9a9eb2;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 20px rgba(99,102,241,0.08);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============ SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0;
    z-index: 100;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .data-status span,
.sidebar.collapsed .sidebar-version {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.2s ease, width 0.2s ease;
}

.sidebar.collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 16px 12px;
}

.sidebar.collapsed .logo {
    justify-content: center;
}

.sidebar-collapse-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    width: 28px; height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(99,102,241,0.08);
}

.sidebar-collapse-btn svg {
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.93rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item .nav-label {
    transition: opacity 0.2s ease;
}

.nav-badge {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.nav-badge.visible {
    display: flex;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-item.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--accent-gradient);
    border-radius: 0 3px 3px 0;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
}

/* === 数据新鲜度面板 === */
.data-freshness-panel {
    margin-bottom: 10px;
    padding: 8px 10px;
    background: var(--bg-tertiary, rgba(255,255,255,0.04));
    border-radius: 8px;
    border: 1px solid var(--border-light, rgba(255,255,255,0.06));
}
.freshness-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}
.freshness-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.freshness-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    line-height: 1.3;
    cursor: default;
}
.freshness-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.freshness-label {
    color: var(--text-secondary);
    flex: 1;
    white-space: nowrap;
}
.freshness-detail {
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.65rem;
}

.sidebar-version {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 8px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.data-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.status-dot.pulse { animation: pulse 2s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* ============ TOPBAR ============ */
.topbar {
    height: var(--topbar-height);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    gap: 12px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

/* PC端 → 移动版切换按钮（左上角） */
.gp-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px 5px 10px;
    border-radius: 8px;
    border: 1px solid var(--accent-primary);
    background: rgba(99,102,241,0.08);
    color: var(--accent-primary);
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.gp-switch-btn:hover {
    background: rgba(99,102,241,0.18);
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.gp-switch-btn svg { opacity: 0.85; }
[data-theme="light"] .gp-switch-btn {
    background: rgba(99,102,241,0.06);
    border-color: #818cf8;
    color: #4f46e5;
}
[data-theme="light"] .gp-switch-btn:hover {
    background: rgba(99,102,241,0.14);
    box-shadow: 0 2px 8px rgba(99,102,241,0.2);
}

.topbar-title-group {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.sidebar-expand-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    flex-shrink: 0;
}

.sidebar-expand-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.topbar-timestamp {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.15);
    padding: 4px 12px;
    border-radius: 100px;
    white-space: nowrap;
    flex-shrink: 0;
}

.timestamp-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

.topbar-search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 7px 14px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    min-width: 180px;
}

.topbar-search-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-secondary);
}

.topbar-search-btn kbd {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: auto;
    color: var(--text-muted);
}

.notification-btn {
    position: relative;
}

.notification-dot {
    position: absolute;
    top: 5px; right: 5px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--danger);
    display: none;
}

.notification-dot.active {
    display: block;
    animation: pulse 1.5s infinite;
}

/* Notification Panel */
.notification-panel {
    position: fixed;
    top: var(--topbar-height);
    right: 28px;
    width: 360px;
    max-height: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    display: none;
    overflow: hidden;
}

.notification-panel.open { display: block; animation: fadeIn 0.2s ease; }

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
}

.notification-header h4 { font-size: 0.92rem; font-weight: 700; }

.notification-clear {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.notification-list {
    max-height: 380px;
    overflow-y: auto;
    padding: 8px;
}

.notification-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: default;
    transition: var(--transition);
    font-size: 0.82rem;
}

.notification-item:hover { background: var(--bg-card-hover); }

.notification-item .noti-icon { font-size: 1.1rem; flex-shrink: 0; }

.notification-item .noti-content { flex: 1; min-width: 0; }

.notification-item .noti-title { font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }

.notification-item .noti-desc { font-size: 0.75rem; color: var(--text-muted); }

.notification-item .noti-time { font-size: 0.68rem; color: var(--text-muted); flex-shrink: 0; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.page-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; white-space: nowrap; }
.page-subtitle { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-actions { display: flex; gap: 4px; }

.icon-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--text-primary);
    background: var(--bg-input);
    border-color: var(--accent-primary);
}

/* ============ DATA BANNER (可折叠) ============ */
.data-banner {
    margin: 16px 28px 0;
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: var(--radius-lg);
    overflow: hidden;
    font-size: 0.82rem;
    transition: var(--transition);
}

.data-banner-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    cursor: pointer;
    transition: var(--transition);
}

.data-banner-toggle:hover { background: rgba(99, 102, 241, 0.06); }

.banner-chevron { color: var(--text-muted); transition: transform 0.3s ease; }

.data-banner.collapsed .banner-chevron { transform: rotate(-90deg); }

.data-banner-body {
    padding: 0 20px 12px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 200px;
    opacity: 1;
    overflow: hidden;
}

.data-banner.collapsed .data-banner-body {
    max-height: 0;
    opacity: 0;
    padding: 0 20px;
}

.data-banner-icon {
    font-weight: 700;
    color: var(--accent-primary);
    white-space: nowrap;
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.data-banner-text {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-secondary);
}

.data-banner-text span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============ FILTER BAR ============ */
.filter-bar {
    margin: 16px 28px 0;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
    white-space: nowrap;
}

.filter-label svg { color: var(--accent-primary); }

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.filter-group select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 130px;
    transition: var(--transition);
    outline: none;
}

.filter-group select:focus { border-color: var(--accent-primary); }

.filter-match {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(99, 102, 241, 0.15);
    margin-left: auto;
    white-space: nowrap;
}

.filter-reset {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    transition: var(--transition);
}

.filter-reset:hover { color: var(--danger); border-color: var(--danger); }

/* ============ TAB SYSTEM ============ */
.tab-content {
    display: none;
    padding: 20px 28px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.35s ease forwards;
}

/* ============ KPI CARDS ============ */
.kpi-grid {
    display: grid;
    gap: 16px;
}

.kpi-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
    cursor: default;
}

.kpi-card:hover {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kpi-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.revenue-icon { background: rgba(99, 102, 241, 0.12); color: var(--chart-1); }
.games-icon { background: rgba(139, 92, 246, 0.12); color: var(--chart-2); }
.units-icon { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.avg-icon { background: rgba(245, 158, 11, 0.12); color: var(--warning); }

.kpi-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.kpi-value {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.kpi-change {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.kpi-change.positive { color: var(--success); }
.kpi-change.negative { color: var(--danger); }

/* ============ CHART CARDS ============ */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    margin-top: 20px;
}

.charts-grid .chart-card {
    margin-top: 0;
}

.chart-card:hover { box-shadow: var(--shadow-md), 0 0 20px rgba(99,102,241,0.08); }

.chart-card.wide { grid-column: span 2; }

.chart-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
}

.chart-header h3 { font-family: var(--font-display); font-size: 0.95rem; font-weight: 600; }

.chart-actions { display: flex; gap: 4px; }

.chart-view-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition);
}

.chart-view-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.chart-body {
    padding: 16px 20px;
    height: 320px;
    position: relative;
}

.chart-card.wide .chart-body { height: 360px; }

/* ============ FLOW CHART (战略漏斗) ============ */
.flow-chart-container {
    padding: 20px;
}

.flow-insight {
    background: rgba(99, 102, 241, 0.06);
    border-left: 4px solid var(--accent-primary);
    padding: 14px 18px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 24px;
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.flow-insight b { color: var(--text-primary); }

.flow-chart {
    display: flex;
    justify-content: center;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 10px;
    position: relative;
}

.flow-svg-wrapper {
    min-width: 1080px;
    height: 800px;
    position: relative;
}

.flow-node {
    position: absolute;
    border: 2px solid;
    border-radius: var(--radius-lg);
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    background: var(--bg-card);
    transition: var(--transition);
    cursor: default;
}

.flow-node:hover {
    box-shadow: var(--shadow-md);
    transform: scale(1.03);
}

.flow-node .node-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.flow-node .node-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.flow-node .node-desc {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Flow node color variants */
.flow-node.blue { border-color: var(--info); background: rgba(59, 130, 246, 0.06); }
.flow-node.blue .node-value { color: var(--info); }
.flow-node.purple { border-color: var(--purple); background: rgba(168, 85, 247, 0.06); }
.flow-node.purple .node-value { color: var(--purple); }
.flow-node.green { border-color: var(--success); background: rgba(34, 197, 94, 0.06); }
.flow-node.green .node-value { color: var(--success); }
.flow-node.teal { border-color: var(--teal); background: rgba(20, 184, 166, 0.06); }
.flow-node.teal .node-value { color: var(--teal); }
.flow-node.sky { border-color: var(--sky); background: rgba(14, 165, 233, 0.06); }
.flow-node.sky .node-value { color: var(--sky); }
.flow-node.muted { border-color: var(--border-color); background: rgba(90, 94, 115, 0.06); }
.flow-node.muted .node-value { color: var(--text-secondary); }
.flow-node.amber { border-color: #f59e0b; background: rgba(245, 158, 11, 0.06); }
.flow-node.amber .node-value { color: #f59e0b; }

.flow-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ============ XGP ANALYSIS ============ */
.xgp-analysis {
    padding: 20px;
}

.xgp-table-section {
    margin-bottom: 28px;
}

.section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.section-label span:first-child {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.section-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: 100px;
}

/* XGP Cross Table */
#xgpCrossTable {
    width: 100%;
    border-collapse: collapse;
}

#xgpCrossTable th,
#xgpCrossTable td {
    padding: 10px 16px;
    text-align: center;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-light);
}

#xgpCrossTable th {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

#xgpCrossTable th.text-left,
#xgpCrossTable td.text-left { text-align: left; }

#xgpCrossTable th.highlight-col {
    color: var(--accent-secondary);
    background: rgba(139, 92, 246, 0.08);
}

#xgpCrossTable tbody tr:hover { background: var(--bg-card-hover); }

#xgpCrossTable td:first-child { font-weight: 700; color: var(--text-primary); }

.cross-highlight {
    color: var(--accent-secondary);
    font-weight: 800;
    background: rgba(139, 92, 246, 0.06);
}

/* XGP Stacked Bars */
.xgp-bars-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 8px;
}

.xgp-bar-section h4 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.xgp-bar-insight {
    background: rgba(20, 184, 166, 0.06);
    border-left: 4px solid var(--teal);
    padding: 12px 16px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 16px;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.xgp-bar-insight b { color: var(--text-primary); }

.bar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.bar-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.bar-legend .legend-dot {
    width: 10px; height: 10px;
    border-radius: 3px;
}

.stacked-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.stacked-bar-label {
    width: 110px;
    text-align: right;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-input);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    flex-shrink: 0;
    line-height: 1.3;
}

.stacked-bar-track {
    flex: 1;
    height: 32px;
    display: flex;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
}

.stacked-bar-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: white;
    transition: all 0.3s ease;
    cursor: default;
    min-width: 0;
}

.stacked-bar-seg:hover { filter: brightness(1.15); }

.stacked-bar-seg.blue { background: #3b82f6; }
.stacked-bar-seg.teal { background: #14b8a6; }
.stacked-bar-seg.slate { background: #64748b; color: #cbd5e1; }
.stacked-bar-seg.indigo { background: #6366f1; }
.stacked-bar-seg.sky { background: #0ea5e9; }
.stacked-bar-seg.emerald { background: #10b981; }

/* Tier color variants for vertical bars */
.stacked-bar-seg.tier-1 { background: #6366f1; }
.stacked-bar-seg.tier-2 { background: #3b82f6; }
.stacked-bar-seg.tier-3 { background: #0ea5e9; }
.stacked-bar-seg.tier-4 { background: #14b8a6; }
.stacked-bar-seg.tier-5 { background: #10b981; }
.stacked-bar-seg.tier-6 { background: #64748b; color: #cbd5e1; }

.stacked-bar-count {
    width: 56px;
    text-align: right;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ============ PUBLISHER ANALYSIS ============ */
.publisher-analysis { padding: 20px; }

.publisher-insight {
    background: rgba(168, 85, 247, 0.06);
    border-left: 4px solid var(--purple);
    padding: 14px 18px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 24px;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.publisher-insight b { color: var(--text-primary); }
.publisher-insight .insight-block {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.publisher-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: stretch;
}

.publisher-bars {
    background: rgba(99, 102, 241, 0.03);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.publisher-bars .bar-legend {
    justify-content: flex-end;
    margin-bottom: 20px;
}

.publisher-bar-row {
    margin-bottom: 18px;
}

.publisher-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 8px;
}

.publisher-bar-header .bar-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.publisher-bar-header .bar-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.publisher-bar-track {
    height: 32px;
    display: flex;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
}

.publisher-table-wrapper table {
    width: 100%;
    border-collapse: collapse;
}

.publisher-table-wrapper th,
.publisher-table-wrapper td {
    padding: 12px 14px;
    text-align: center;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--border-light);
}

.publisher-table-wrapper th {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.publisher-table-wrapper th.text-left,
.publisher-table-wrapper td.text-left { text-align: left; }

.publisher-table-wrapper td:first-child {
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.publisher-table-wrapper td .pct {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: 4px;
}

.publisher-table-wrapper td .num {
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--text-primary);
}

/* ============ AI INSIGHT PANEL ============ */
.ai-insight-panel {
    margin-top: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.ai-insight-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(139,92,246,0.05));
}

.ai-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.ai-refresh-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.ai-refresh-btn:hover { color: var(--accent-primary); border-color: var(--accent-primary); }

.ai-insight-content {
    padding: 16px 20px;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text-secondary);
    min-height: 60px;
}

.ai-insight-content p { margin-bottom: 8px; }
.ai-insight-content strong { color: var(--text-primary); font-weight: 600; }
.ai-insight-content .highlight { color: var(--accent-primary); font-weight: 600; }

.typing-indicator { color: var(--text-muted); font-style: italic; }
.dots span { animation: blink 1.4s infinite both; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

.ai-feedback {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.ai-feedback button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition);
}

.ai-feedback button:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

/* ============ DATA TABLE ============ */
.data-table-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.table-header h3 { font-size: 0.95rem; font-weight: 600; }

.table-count { font-weight: 400; color: var(--text-muted); font-size: 0.82rem; }

.table-controls { display: flex; gap: 8px; }

.table-search, .table-sort {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}

.table-search:focus, .table-sort:focus { border-color: var(--accent-primary); }

.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
    cursor: default;
    position: sticky;
    top: 0;
}

thead th.num, td.num { text-align: right; }
thead th.text-center, td.text-center { text-align: center; }
thead th.text-left, td.text-left { text-align: left; }

tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

tbody tr:hover { background: var(--bg-card-hover); }

tbody td {
    padding: 10px 14px;
    font-size: 0.85rem;
    white-space: nowrap;
}

tbody td.num { font-variant-numeric: tabular-nums; }

.game-name {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* XGP tags in table */
.xgp-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.xgp-tag.sim { background: rgba(20, 184, 166, 0.15); color: var(--teal); }
.xgp-tag.aft { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.xgp-tag.none { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }

/* Platform check marks */
.check-y { color: var(--success); font-weight: 700; }
.check-n { color: var(--text-muted); }

/* Pagination */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
}

.page-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover:not(:disabled) { background: var(--accent-primary); color: white; border-color: var(--accent-primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

#pageInfo { font-size: 0.82rem; color: var(--text-muted); }

/* ============ DRILLDOWN PANEL ============ */
.drilldown-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.drilldown-overlay.active { display: flex; }

.drilldown-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.drilldown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.drilldown-header h3 { font-size: 1.1rem; font-weight: 700; }

.drilldown-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.drilldown-close:hover { color: var(--text-primary); background: var(--bg-input); }

.drilldown-content { padding: 20px 24px; }
.drilldown-content table { width: 100%; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px) {
    .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .chart-card.wide { grid-column: span 1; }
    .xgp-bars-grid { grid-template-columns: 1fr; }
    .publisher-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: block; }
    .kpi-grid-4 { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-group select { width: 100%; }
    .topbar { padding: 0 16px; }
    .tab-content { padding: 16px; }
    .data-banner { margin-left: 16px; margin-right: 16px; }
    .filter-bar { margin-left: 16px; margin-right: 16px; }
    .page-subtitle { display: none; }
}

/* ============ ANIMATIONS ============ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.kpi-card, .chart-card, .data-table-section {
    animation: fadeIn 0.4s ease forwards;
}

.chart-card:nth-child(2) { animation-delay: 0.05s; }
.chart-card:nth-child(3) { animation-delay: 0.1s; }
.chart-card:nth-child(4) { animation-delay: 0.15s; }

/* ============ LOADING ============ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    text-align: center;
    color: var(--accent-primary);
}

.loading-spinner svg {
    width: 48px; height: 48px;
    animation: spin 1s linear infinite;
}

.loading-spinner p {
    margin-top: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============ CLICKABLE ELEMENTS ============ */
.flow-node.clickable {
    cursor: pointer !important;
}

.flow-node.clickable:hover {
    box-shadow: var(--shadow-lg), 0 0 15px rgba(99,102,241,0.3);
    transform: scale(1.06);
}

.clickable-cell {
    cursor: pointer;
    transition: var(--transition);
}

.clickable-cell:hover {
    background: rgba(99, 102, 241, 0.12) !important;
    color: var(--accent-primary) !important;
    font-weight: 800;
}

.stacked-bar-seg {
    cursor: pointer;
}

.stacked-bar-seg:hover {
    filter: brightness(1.2);
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.4);
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: rgba(99, 102, 241, 0.08) !important;
}

.drilldown-game-row:hover {
    background: rgba(99, 102, 241, 0.08) !important;
}

/* ============ BADGES ============ */
.major-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-secondary);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.inferred-badge {
    display: inline-block;
    margin-left: 4px;
    color: var(--warning);
    font-size: 0.68rem;
    font-weight: 700;
}

.check-warn {
    color: var(--warning);
    font-weight: 700;
}

.recent-badge {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

/* ============ AGENT BADGE ============ */
.agent-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
    padding: 2px 10px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(16, 185, 129, 0.08));
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: help;
    position: relative;
    vertical-align: middle;
    animation: agentPulse 3s ease-in-out infinite;
}

.agent-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: agentDot 2s ease-in-out infinite;
}

.agent-badge:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.15));
    border-color: rgba(34, 197, 94, 0.4);
}

.agent-badge.stale {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(234, 179, 8, 0.08));
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.25);
}

.agent-badge.stale::before {
    background: #f59e0b;
}

@keyframes agentPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes agentDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.section-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ============ RECENT GAMES TABLE ============ */
#recentGamesTable {
    width: 100%;
    border-collapse: collapse;
}

#recentGamesTable th,
#recentGamesTable td {
    padding: 10px 14px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

#recentGamesTable th {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
}

#recentGamesTable tbody tr:hover {
    background: var(--bg-card-hover);
}

/* ============ VALIDATION TABLE ============ */
#validationTable {
    width: 100%;
    border-collapse: collapse;
}

#validationTable th,
#validationTable td {
    padding: 8px 12px;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

#validationTable th {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 10;
}

#validationTable tbody tr:hover {
    background: var(--bg-card-hover);
}

/* ============ SORTABLE TABLE HEADERS ============ */
.sortable-th {
    cursor: pointer !important;
    user-select: none;
    transition: var(--transition);
    position: relative;
}

.sortable-th:hover {
    color: var(--accent-primary) !important;
    background: rgba(99, 102, 241, 0.08) !important;
}

.sortable-th .sort-icon {
    font-size: 0.7rem;
    margin-left: 4px;
    opacity: 0.5;
    transition: var(--transition);
}

.sortable-th:hover .sort-icon {
    opacity: 1;
}

.sortable-th.sort-active {
    color: var(--accent-primary) !important;
}

.sortable-th.sort-active .sort-icon {
    opacity: 1;
    color: var(--accent-primary);
}

/* ============ PIPELINE TAB ============ */
.pipeline-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pipeline-filter {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.pipeline-filter:focus { border-color: var(--accent-primary); }

/* Pipeline Timeline */
.pipeline-timeline-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.timeline-quarter {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.timeline-quarter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.timeline-quarter-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.timeline-quarter-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 3px 10px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
}

.timeline-quarter-games {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 16px;
}

.timeline-game-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: var(--transition);
    cursor: default;
}

.timeline-game-card:hover {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.timeline-game-card.heat-high {
    border-left: 3px solid #ef4444;
}

.timeline-game-card.heat-mid-high {
    border-left: 3px solid #f59e0b;
}

.timeline-game-card.heat-mid {
    border-left: 3px solid #3b82f6;
}

.timeline-game-card.heat-mid-low {
    border-left: 3px solid #64748b;
}

.timeline-game-card.heat-low {
    border-left: 3px solid var(--border-color);
}

.timeline-game-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
}

.timeline-game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.timeline-game-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.heat-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
}

.heat-tag.heat-high { background: rgba(239,68,68,0.15); color: #ef4444; }
.heat-tag.heat-mid-high { background: rgba(245,158,11,0.15); color: #f59e0b; }
.heat-tag.heat-mid { background: rgba(59,130,246,0.15); color: #3b82f6; }
.heat-tag.heat-mid-low { background: rgba(100,116,139,0.15); color: var(--text-secondary); }
.heat-tag.heat-low { background: rgba(100,116,139,0.08); color: var(--text-muted); }

.platform-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(99,102,241,0.1);
    color: var(--accent-primary);
}

/* === 已发售标记 === */
.released-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    background: rgba(34,197,94,0.15);
    color: #22c55e;
    vertical-align: middle;
    margin-left: 4px;
}
.released-badge-sm {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(34,197,94,0.15);
    color: #22c55e;
    vertical-align: middle;
    margin-left: 4px;
}
.timeline-card-released {
    opacity: 0.7;
    border-left: 3px solid #22c55e !important;
}
tr.row-released {
    opacity: 0.75;
}
tr.row-released td:first-child {
    border-left: 3px solid #22c55e;
}

.platform-tag-sm {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(99,102,241,0.08);
    color: var(--accent-primary);
    white-space: nowrap;
}

/* Pipeline Table */
#pipelineTable {
    width: 100%;
    border-collapse: collapse;
}

#pipelineTable th,
#pipelineTable td {
    padding: 10px 14px;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

#pipelineTable th {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
}

#pipelineTable tbody tr:hover {
    background: var(--bg-card-hover);
}

/* ============ PIPELINE V2 新增样式 ============ */

/* 6列 KPI 网格 */
.kpi-grid-6 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

@media (max-width: 1200px) {
    .kpi-grid-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .kpi-grid-6 { grid-template-columns: repeat(2, 1fr); }
}

/* 数据来源声明 */
.pipeline-source-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.78rem;
}

.source-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
}

.source-badge.mcp {
    background: rgba(99,102,241,0.12);
    color: #6366f1;
    border: 1px solid rgba(99,102,241,0.25);
}

.source-badge.web {
    background: rgba(14,165,233,0.12);
    color: #0ea5e9;
    border: 1px solid rgba(14,165,233,0.25);
}

.source-note {
    color: var(--text-muted);
    margin-left: auto;
}

/* Pipeline 搜索框 */
.pipeline-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.pipeline-search-icon {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    pointer-events: none;
}

.pipeline-search-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px 6px 30px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    outline: none;
    width: 180px;
    transition: var(--transition);
}

.pipeline-search-input:focus {
    border-color: var(--accent-primary);
    width: 220px;
}

/* Pipeline Section Title */
.pipeline-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pipeline-section-title h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 卡片展开功能 */
.timeline-game-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.card-expand-icon {
    font-size: 0.7rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    padding: 2px;
}

.card-expand-icon.expanded {
    color: var(--accent-primary);
}

.card-detail-panel {
    margin-top: 10px;
}

.detail-divider {
    height: 1px;
    background: var(--border-light);
    margin: 8px 0 10px;
}

.detail-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.78rem;
    line-height: 1.5;
}

.detail-label {
    color: var(--text-muted);
    font-weight: 600;
    min-width: 90px;
    flex-shrink: 0;
    white-space: nowrap;
}

.detail-value {
    color: var(--text-secondary);
    word-break: break-all;
}

/* 版号标签 */
.license-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 4px;
}

.license-tag.license-approved {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}

.license-tag.license-pending {
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
}

.license-tag.license-none {
    background: rgba(239,68,68,0.12);
    color: #ef4444;
}

/* 国内/海外地区标签 */
.region-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.66rem;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 4px;
    letter-spacing: 0.02em;
}

.region-tag.region-domestic {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.region-tag.region-overseas {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.18);
}

[data-theme="light"] .region-tag.region-domestic {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

[data-theme="light"] .region-tag.region-overseas {
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

/* 已上线折叠区 */
.released-section-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.released-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.released-section-header:hover {
    background: var(--bg-card-hover);
}

.released-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.92rem;
}

.released-icon {
    font-size: 1.1rem;
}

.released-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 2px 10px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
}

.released-chevron {
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.released-section-body {
    padding: 16px;
}

.released-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

/* 卡片可点击效果 */
.timeline-game-card {
    cursor: pointer;
}

/* 卡片展开动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

/* ============ /PIPELINE V2 ============ */
.news-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Spotlight Cards */
.spotlight-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.spotlight-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.spotlight-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: #ef4444;
    background: rgba(239,68,68,0.08);
    padding: 4px 12px;
    border-radius: 100px;
    border: 1px solid rgba(239,68,68,0.15);
}

.spotlight-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.spotlight-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
    border-left: 4px solid #ef4444;
}

.spotlight-card:hover {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.spotlight-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.spotlight-category {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(99,102,241,0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.spotlight-sentiment {
    font-size: 0.72rem;
    font-weight: 700;
}

.spotlight-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.spotlight-title-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.spotlight-title-link:hover .spotlight-title {
    color: var(--accent-primary);
    text-decoration: underline;
}

.spotlight-link {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    flex-shrink: 0;
}

.spotlight-link:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(99,102,241,0.08);
}

.spotlight-summary {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.spotlight-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.spotlight-source {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.spotlight-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.spotlight-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.news-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.news-tag-sm {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}

/* News Feed */
.news-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.news-feed-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.news-feed-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.news-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color);
}

.news-item.news-important {
    border-left: 3px solid #ef4444;
}

/* Featured (重点新闻) 样式 */
.news-item.news-featured {
    border-left: 3px solid #f59e0b;
    background: rgba(245, 158, 11, 0.03);
}
.news-item.news-featured:hover {
    background: rgba(245, 158, 11, 0.06);
    border-color: #f59e0b;
}
.news-item.news-featured .news-item-title {
    color: var(--text-primary);
}
.news-item-featured-badge {
    color: #f59e0b !important;
    font-weight: 800 !important;
}
.featured-star {
    font-size: 0.82rem;
}
.featured-reason-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    white-space: nowrap;
}

/* Spotlight 重点新闻卡片金色主题 */
.spotlight-card {
    border-left: 4px solid #f59e0b;
}
.spotlight-header h4 {
    color: #f59e0b;
}
.spotlight-count {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

/* v5.0 核心新闻升级：火焰色主题 */
.spotlight-header h4 {
    color: #f97316;
}

/* 动态网格：根据卡片数量自适应 */
.spotlight-grid-dynamic {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

/* ═══ 主题聚类样式 v6.0 ═══ */
.spotlight-cluster {
    margin-bottom: 20px;
    border-left: 3px solid rgba(255, 255, 255, 0.08);
    padding-left: 0;
}

.spotlight-cluster-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px 8px 0 0;
    margin-bottom: 4px;
}

.spotlight-cluster-icon {
    font-size: 1.1rem;
}

.spotlight-cluster-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.spotlight-cluster-count {
    font-size: 0.72rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 10px;
}

/* 聚类主题色 */
.spotlight-cluster[data-cluster="upstream-hw"] { border-left-color: #06b6d4; }
.spotlight-cluster[data-cluster="hot-product"] { border-left-color: #ef4444; }
.spotlight-cluster[data-cluster="sony-ps"] { border-left-color: #2563eb; }
.spotlight-cluster[data-cluster="xbox-ms"] { border-left-color: #16a34a; }
.spotlight-cluster[data-cluster="steam-valve"] { border-left-color: #1d4ed8; }
.spotlight-cluster[data-cluster="epic"] { border-left-color: #7c3aed; }
.spotlight-cluster[data-cluster="nintendo"] { border-left-color: #dc2626; }
.spotlight-cluster[data-cluster="market-info"] { border-left-color: #8b5cf6; }

/* 增强版核心新闻卡片 */
.spotlight-card-enhanced {
    border-left: 4px solid #f97316;
    display: flex;
    flex-direction: column;
}

/* 洞察分析区块 */
.spotlight-insight {
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

.spotlight-insight-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 6px;
}

.spotlight-insight-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}

/* 关联新闻区块 */
.spotlight-related {
    background: rgba(20, 184, 166, 0.05);
    border: 1px solid rgba(20, 184, 166, 0.12);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

.spotlight-related-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--teal);
    margin-bottom: 8px;
}

.spotlight-related-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spotlight-related-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    transition: var(--transition);
    color: var(--text-secondary);
}

.spotlight-related-item:hover {
    background: rgba(20, 184, 166, 0.08);
    color: var(--teal);
}

.spotlight-related-date {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 42px;
    flex-shrink: 0;
}

.spotlight-related-title {
    font-size: 0.75rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 空状态 */
.spotlight-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-style: italic;
}

/* 非重点新闻折叠区 */
.news-nonfeatured-section {
    margin-top: 20px;
    border-top: 1px dashed var(--border-light);
    padding-top: 12px;
}

.news-nonfeatured-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.news-nonfeatured-toggle:hover {
    background: var(--bg-card-hover);
}

.news-nonfeatured-toggle.expanded .news-history-chevron {
    transform: rotate(180deg);
}

/* 非重点新闻灰化 */
.news-item-muted {
    opacity: 0.65;
}

.news-item-muted:hover {
    opacity: 0.85;
}

.news-list-muted {
    padding: 8px 0;
}

.news-item-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 100px;
    flex-shrink: 0;
}

.news-item-importance {
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.news-item-category {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.news-item-content {
    flex: 1;
    min-width: 0;
}

.news-item-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 6px;
}

.news-item-summary {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
}

.news-item-source {
    font-weight: 700;
    color: var(--accent-primary);
}

.news-item-date {
    color: var(--text-muted);
}

.news-item-sentiment {
    font-weight: 700;
}

.news-item-link {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.news-item-link:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(99,102,241,0.08);
}

/* News Empty Hint */
.news-empty-hint {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-style: italic;
}

/* ── 历史新闻折叠区 ── */
.news-history-section {
    margin-top: 24px;
    border-top: 2px solid var(--border-light);
    padding-top: 16px;
}

.news-history-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}
.news-history-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color);
}
.news-history-toggle-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.news-history-toggle-left h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.news-history-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(99,102,241,0.1);
    padding: 2px 8px;
    border-radius: 10px;
}
.news-history-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.news-history-chevron {
    transition: transform 0.25s ease;
}
.news-history-toggle.expanded .news-history-chevron {
    transform: rotate(180deg);
}

.news-history-body {
    margin-top: 12px;
}

/* 月份分组 */
.news-month-group {
    margin-bottom: 8px;
}
.news-month-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(99,102,241,0.04);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}
.news-month-header:hover {
    background: rgba(99,102,241,0.08);
    border-color: var(--border-color);
}
.news-month-chevron {
    transition: transform 0.25s ease;
    flex-shrink: 0;
}
.news-month-header.expanded .news-month-chevron {
    transform: rotate(180deg);
}
.news-month-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}
.news-month-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: auto;
}
.news-month-body {
    padding: 4px 0 4px 12px;
    border-left: 2px solid var(--border-light);
    margin-left: 8px;
    margin-top: 4px;
}
.news-list-history .news-item {
    opacity: 0.85;
}
.news-list-history .news-item:hover {
    opacity: 1;
}
.news-item-history .news-item-date {
    font-weight: 600;
}

/* News Sources */
.sources-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.sources-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sources-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.sources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.source-category {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.source-category-label {
    padding: 12px 16px;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
}

.source-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 0.82rem;
}

.source-item:hover {
    background: rgba(99,102,241,0.08);
    color: var(--accent-primary);
}

.source-name {
    font-weight: 600;
    flex: 1;
}

.source-platform {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 1px 6px;
    border-radius: 3px;
}

.source-type {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ═══════════════ 新闻详情弹窗 ═══════════════ */
.news-detail-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-y: auto;
}
.news-detail-overlay.active {
    display: flex;
}
.news-detail-modal {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    max-width: 720px;
    width: 100%;
    padding: 28px 32px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    animation: newsDetailSlideIn 0.25s ease-out;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}
@keyframes newsDetailSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
.news-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.news-detail-badges {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.news-detail-category {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
}
.news-detail-featured {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}
.news-detail-importance {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
}
.news-detail-sentiment {
    font-size: 0.72rem;
    font-weight: 700;
}
.news-detail-close {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.news-detail-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: #ef4444;
}
.news-detail-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0 0 12px 0;
}
.news-detail-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.news-detail-source {
    font-weight: 700;
    color: var(--accent-primary);
}
.news-detail-id {
    color: var(--text-muted);
    font-family: monospace;
}
.news-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}
.news-detail-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.news-detail-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
}
.news-detail-section h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px 0;
}
.news-detail-summary-text {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}
.news-detail-insight {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.15);
}
.news-detail-insight p {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin: 0;
}
.news-detail-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.news-detail-source-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-primary);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(59, 130, 246, 0.15);
    transition: all 0.15s;
}
.news-detail-source-link:hover {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.3);
}
.news-detail-source-name {
    white-space: nowrap;
}
.news-detail-related {
    background: rgba(20, 184, 166, 0.04);
    border-color: rgba(20, 184, 166, 0.15);
}
.news-detail-related-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.news-detail-related-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.news-detail-related-item:hover {
    background: rgba(20, 184, 166, 0.08);
}
.news-detail-related-date {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--teal, #14b8a6);
    white-space: nowrap;
    min-width: 72px;
    padding-top: 2px;
}
.news-detail-related-badge {
    font-size: 0.75rem;
    padding-top: 1px;
}
.news-detail-related-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.news-detail-related-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}
.news-detail-related-summary {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Responsive adjustments for new tabs */
@media (max-width: 1200px) {
    .spotlight-grid { grid-template-columns: 1fr; }
    .sources-grid { grid-template-columns: 1fr; }
    .timeline-quarter-games { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

@media (max-width: 768px) {
    .pipeline-controls { flex-direction: column; }
    .news-controls { flex-direction: column; }
    .news-item { flex-direction: column; }
    .news-item-left { flex-direction: row; min-width: 0; }
}

/* ============ EARNINGS TAB ============ */
.earnings-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Earnings Bar Charts */
.earnings-bar-chart {
    padding: 20px;
    max-height: 480px;
    overflow-y: auto;
}

.earnings-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.earnings-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.earnings-bar-name {
    width: 120px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.earnings-bar-track-wrapper {
    flex: 1;
    height: 24px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-light);
    position: relative;
}

.earnings-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 2px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
}

.earnings-bar-fill.negative {
    margin-left: auto;
}

.earnings-bar-value {
    width: 65px;
    font-size: 0.82rem;
    font-weight: 800;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* Earnings Section */
.earnings-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.earnings-section-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.earnings-section-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Company Card Grid */
.earnings-company-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.earnings-company-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.earnings-company-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, 0.3);
}

/* V12: 卡片顶部区域 — 增强身份识别 */
.earnings-card-top {
    padding: 18px 20px 14px;
    position: relative;
}

.earnings-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
}

.earnings-card-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.earnings-card-logo {
    font-size: 1.6rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.earnings-card-name {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.earnings-card-ticker {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.earnings-ir-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    transition: var(--transition);
    flex-shrink: 0;
}

.earnings-ir-link:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
}

/* V12: 业务板块和报告期标签栏 */
.earnings-card-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.earnings-card-segment {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
    padding: 3px 10px;
    border-radius: 4px;
    display: inline-block;
}

.earnings-card-period {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* V12: 核心财务摘要条（Hero Strip） */
.earnings-hero-strip {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    background: linear-gradient(135deg, rgba(99,102,241,0.04) 0%, rgba(16,185,129,0.03) 100%);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}
.earnings-hero-cell {
    flex: 1;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: relative;
}
.earnings-hero-cell:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: var(--border-light);
}
.earnings-hero-cell.hero-margin {
    flex: 0 0 auto;
    min-width: 100px;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
}
.hero-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
}
.hero-value {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.hero-value .hero-usd {
    font-size: 0.72rem;
    color: var(--teal);
    font-weight: 600;
    margin-left: 4px;
}
.hero-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
/* 利润率圆形指示器 */
.margin-ring {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    border: 3px solid currentColor;
}
.margin-ring.margin-excellent { color: #22c55e; border-color: #22c55e; background: rgba(34,197,94,0.06); }
.margin-ring.margin-good { color: #3b82f6; border-color: #3b82f6; background: rgba(59,130,246,0.06); }
.margin-ring.margin-ok { color: #f59e0b; border-color: #f59e0b; background: rgba(245,158,11,0.06); }
.margin-ring.margin-loss { color: #ef4444; border-color: #ef4444; background: rgba(239,68,68,0.06); }
.margin-ring.margin-na { color: var(--text-muted); border-color: var(--border-color); background: var(--bg-input); font-size: 0.72rem; }

/* V12: Financials Section — 保留原始结构兼容 */
.earnings-card-financials {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    background: rgba(99, 102, 241, 0.02);
}

.earnings-financial-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    gap: 8px;
}

.earnings-financial-row.highlight {
    padding: 8px 0 4px;
    margin-top: 4px;
    border-top: 1px dashed var(--border-light);
}

.fin-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.fin-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.fin-value.negative {
    color: #ef4444;
}

.earnings-yoy {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.earnings-yoy.positive {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.earnings-yoy.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.fin-margin {
    font-size: 1.1rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.fin-margin.margin-excellent { color: #22c55e; }
.fin-margin.margin-good { color: #3b82f6; }
.fin-margin.margin-ok { color: #f59e0b; }
.fin-margin.margin-loss { color: #ef4444; }

/* V12: 运营指标区 — 增强视觉表达 */
.earnings-card-metrics {
    padding: 12px 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.earnings-metric {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 10px 10px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    border-left: 3px solid rgba(99,102,241,0.4);
    transition: var(--transition);
}

.earnings-metric:hover {
    border-left-color: var(--accent-primary);
    background: rgba(99,102,241,0.04);
}

.metric-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.3;
}

.metric-value {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-primary);
}

.metric-yoy {
    font-size: 0.68rem;
    font-weight: 700;
}

.metric-yoy.positive { color: #22c55e; }
.metric-yoy.negative { color: #ef4444; }

/* V12: 产品标签区 — 增加小标题 */
.earnings-card-products {
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}
.earnings-products-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 2px;
    letter-spacing: 0.3px;
}

.earnings-product-tag {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 600;
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}
.earnings-product-tag:hover {
    background: rgba(99,102,241,0.06);
    border-color: rgba(99,102,241,0.3);
    color: var(--accent-primary);
}

/* V12: Expand Button — 更明显的交互提示 */
.earnings-card-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    cursor: pointer;
    color: var(--accent-primary);
    font-size: 0.82rem;
    font-weight: 600;
    border-top: 1px solid var(--border-light);
    transition: var(--transition);
    background: linear-gradient(180deg, transparent 0%, rgba(99,102,241,0.03) 100%);
}

.earnings-card-expand:hover {
    background: rgba(99, 102, 241, 0.08);
}

.earnings-card-expand.expanded {
    background: rgba(99, 102, 241, 0.06);
    border-bottom: 1px solid var(--border-light);
}

.earnings-card-expand.expanded svg {
    transform: rotate(180deg);
}

.earnings-card-expand svg {
    transition: transform 0.3s ease;
}

/* V12: Detail Section — 增强分析区域的信息层次 */
.earnings-card-detail {
    padding: 16px 20px 20px;
    animation: fadeIn 0.3s ease forwards;
    background: linear-gradient(180deg, rgba(99,102,241,0.02) 0%, transparent 100%);
}

.earnings-detail-section {
    margin-bottom: 14px;
    padding: 14px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    border-left: 3px solid transparent;
    transition: border-left-color 0.2s ease;
}
.earnings-detail-section:nth-child(1) { border-left-color: #3b82f6; }
.earnings-detail-section:nth-child(2) { border-left-color: #8b5cf6; }
.earnings-detail-section:nth-child(3) { border-left-color: #f59e0b; }
.earnings-detail-section:nth-child(4) { border-left-color: #10b981; }

.earnings-detail-section h5 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}

.earnings-detail-section p {
    font-size: 0.82rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.earnings-detail-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(99, 102, 241, 0.04);
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.12);
    margin-top: 4px;
}

.earnings-filing-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.earnings-filing-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition);
    padding: 3px 10px;
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius-sm);
}
.earnings-filing-link:hover {
    background: rgba(99,102,241,0.08);
    border-color: var(--accent-primary);
}

.earnings-filing-link:hover {
    text-decoration: underline;
}

/* Private Companies */
.earnings-private-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.earnings-private-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    border-left: 3px solid var(--text-muted);
}

.earnings-private-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.earnings-private-icon {
    font-size: 1.1rem;
}

.earnings-private-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.earnings-private-status {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

.earnings-private-note {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Triple Charts Layout (deprecated, kept for backward compat) */
.earnings-charts-triple {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.earnings-charts-triple .chart-card {
    margin: 0;
}

.earnings-charts-triple .earnings-bar-chart {
    max-height: 520px;
    overflow-y: auto;
}

/* V7: 2x2 Charts Grid Layout */
.earnings-charts-grid-2x2 .chart-card {
    margin: 0;
}

.earnings-charts-grid-2x2 .earnings-bar-chart {
    max-height: 520px;
    overflow-y: auto;
    padding: 12px 16px;
}

/* Company Overall Data */
.earnings-card-overall {
    padding: 10px 20px;
    border-top: 1px solid var(--border-light);
    background: rgba(99, 102, 241, 0.03);
}

.earnings-overall-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.earnings-overall-header span {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.earnings-overall-rows {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.earnings-overall-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
}

.earnings-overall-row .overall-label {
    color: var(--text-muted);
}

.earnings-overall-row .overall-value {
    font-weight: 600;
    color: var(--text-secondary);
}

.earnings-overall-row .overall-yoy {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 6px;
}

.earnings-overall-row .overall-yoy.positive {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.earnings-overall-row .overall-yoy.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.earnings-overall-note {
    margin-top: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.4;
}

/* Data source badge */
.data-source-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    margin-left: 6px;
}

.data-estimated-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 4px;
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    margin-left: 6px;
}

/* ============ EARNINGS SEARCH ============ */
.earnings-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.earnings-search-icon {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.earnings-search-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 7px 12px 7px 32px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
    width: 220px;
}

.earnings-search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
    width: 280px;
}

.earnings-search-input::placeholder {
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ============ USD EQUIVALENT LABELS ============ */
.usd-equiv {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--teal);
    background: rgba(20, 184, 166, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    letter-spacing: -0.2px;
    vertical-align: middle;
}

.currency-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    padding: 0 5px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
    text-transform: uppercase;
}

.exchange-rate-note {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
    display: block;
}

/* ============ DATA SOURCES SECTION ============ */
.earnings-card-sources {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    background: rgba(59, 130, 246, 0.02);
}

.earnings-sources-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.earnings-source-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin-bottom: 4px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: var(--transition);
    text-decoration: none;
}

.earnings-source-item:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(99,102,241,0.06);
}

.earnings-source-type {
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(99,102,241,0.08);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.68rem;
    flex-shrink: 0;
}

.earnings-source-name {
    flex: 1;
    font-weight: 500;
}

.earnings-source-date {
    color: var(--text-muted);
    font-size: 0.68rem;
    flex-shrink: 0;
}

.earnings-source-link-icon {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: var(--transition);
}

.earnings-source-item:hover .earnings-source-link-icon {
    color: var(--accent-primary);
}

/* ============ CLICKABLE CHART BARS ============ */
.earnings-bar-row.clickable {
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    margin: 0 -6px;
    transition: var(--transition);
}

.earnings-bar-row.clickable:hover {
    background: rgba(99, 102, 241, 0.06);
}

.earnings-bar-row.clickable:hover .earnings-bar-name {
    color: var(--accent-primary);
}

.earnings-bar-row.clickable:hover .earnings-bar-fill {
    filter: brightness(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ============ EARNINGS TOOLTIP ============ */
.earnings-tooltip {
    position: fixed;
    z-index: 1000;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: var(--shadow-lg);
    max-width: 340px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 0.82rem;
}

.earnings-tooltip.visible {
    opacity: 1;
}

.earnings-tooltip-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.earnings-tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
    font-size: 0.78rem;
}

.earnings-tooltip-label {
    color: var(--text-muted);
}

.earnings-tooltip-value {
    font-weight: 700;
    color: var(--text-primary);
}

.earnings-tooltip-source {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--border-light);
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ============ ENHANCED FINANCIAL ROW CLICKABLE ============ */
.earnings-financial-row.clickable-fin {
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 5px 6px;
    margin: 0 -6px;
    transition: var(--transition);
}

.earnings-financial-row.clickable-fin:hover {
    background: rgba(99, 102, 241, 0.06);
}

.earnings-financial-row.clickable-fin:hover .fin-value {
    color: var(--accent-primary);
}

/* ============ EARNINGS CARD NO-RESULT ============ */
.earnings-no-result {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.earnings-no-result svg {
    margin-bottom: 12px;
    opacity: 0.4;
}

.earnings-search-highlight {
    background: rgba(99, 102, 241, 0.15);
    padding: 0 2px;
    border-radius: 2px;
}

/* ============ REGION TAG ============ */
.earnings-region-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
}

.earnings-region-tag.us { background: rgba(59,130,246,0.1); color: #3b82f6; }
.earnings-region-tag.jp { background: rgba(239,68,68,0.1); color: #ef4444; }
.earnings-region-tag.cn { background: rgba(245,158,11,0.1); color: #f59e0b; }
.earnings-region-tag.eu { background: rgba(99,102,241,0.1); color: #6366f1; }
.earnings-region-tag.kr { background: rgba(168,85,247,0.1); color: #a855f7; }

/* Responsive for Earnings Tab */
@media (max-width: 1400px) {
    .earnings-charts-triple { grid-template-columns: 1fr; }
    .earnings-charts-grid-2x2 { grid-template-columns: 1fr !important; }
}

@media (max-width: 1200px) {
    .earnings-company-grid { grid-template-columns: 1fr; }
    .earnings-private-grid { grid-template-columns: 1fr; }
    .earnings-card-metrics { grid-template-columns: repeat(2, 1fr); }
    .earnings-search-input { width: 180px; }
    .earnings-search-input:focus { width: 220px; }
}

@media (max-width: 768px) {
    .earnings-controls { flex-direction: column; }
    .earnings-card-metrics { grid-template-columns: 1fr; }
    .earnings-bar-name { width: 80px; font-size: 0.72rem; }
    .earnings-search-input { width: 100%; }
    .earnings-search-input:focus { width: 100%; }
    .earnings-search-wrapper { width: 100%; }
}

/* ============ EXECUTIVE SUMMARY STRIP ============ */
.exec-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin: 0 28px 16px;
    background: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, rgba(139,92,246,0.04) 100%);
    border: 1px solid rgba(99,102,241,0.12);
    border-radius: var(--radius-lg);
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-secondary);
    animation: fadeIn 0.5s ease;
}

.exec-summary-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    color: white;
}

.exec-summary-text {
    flex: 1;
    min-width: 0;
}

.exec-summary-text strong {
    color: var(--text-primary);
    font-weight: 700;
}

.exec-summary-text .highlight {
    color: var(--accent-primary);
    font-weight: 700;
}

.exec-summary-text .up { color: var(--success); font-weight: 600; }
.exec-summary-text .down { color: var(--danger); font-weight: 600; }

/* ============ COMMAND PALETTE (Cmd+K) ============ */
.cmd-palette-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}

.cmd-palette-overlay.open {
    display: flex;
    animation: fadeIn 0.15s ease;
}

.cmd-palette {
    width: 560px;
    max-width: 92vw;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03);
    overflow: hidden;
    animation: slideDown 0.2s cubic-bezier(0.2, 0, 0, 1.1);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.cmd-palette-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
}

.cmd-palette-input-wrap svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.cmd-palette-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-body);
}

.cmd-palette-input-wrap input::placeholder {
    color: var(--text-muted);
}

.cmd-palette-input-wrap kbd {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.cmd-palette-results {
    max-height: 380px;
    overflow-y: auto;
    padding: 8px;
}

.cmd-section {
    padding: 4px 0;
}

.cmd-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 6px 12px;
}

.cmd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.cmd-item:hover,
.cmd-item.active {
    background: rgba(99,102,241,0.1);
    color: var(--text-primary);
}

.cmd-icon {
    font-size: 1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.cmd-item-subtitle {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.cmd-no-result {
    text-align: center;
    padding: 28px 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============ SKELETON LOADING ============ */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
    animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.skeleton-kpi {
    height: 100px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
}

.skeleton-chart {
    height: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
}

.skeleton-text {
    height: 14px;
    width: 60%;
    border-radius: 7px;
    background: var(--border-light);
    margin: 8px 0;
}

.skeleton-text.short { width: 35%; }
.skeleton-text.long { width: 85%; }

/* ============ KPI STAGGER ANIMATION ============ */
@keyframes kpiEnter {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kpi-card {
    animation: kpiEnter 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.kpi-card:nth-child(1) { animation-delay: 0ms; }
.kpi-card:nth-child(2) { animation-delay: 80ms; }
.kpi-card:nth-child(3) { animation-delay: 160ms; }
.kpi-card:nth-child(4) { animation-delay: 240ms; }
.kpi-card:nth-child(5) { animation-delay: 320ms; }
.kpi-card:nth-child(6) { animation-delay: 400ms; }

/* KPI value countup highlight */
.kpi-value.counting {
    color: var(--accent-primary);
    transition: color 0.3s ease;
}

/* ============ CHART CARD HOVER GLOW (增强) ============ */
.chart-card:hover {
    border-color: rgba(99,102,241,0.2);
    box-shadow: var(--shadow-md), 0 0 24px rgba(99,102,241,0.08);
}

.chart-header h3 {
    font-family: var(--font-display);
}

/* ============ PRESENTATION MODE ============ */
body.presentation-mode .sidebar {
    display: none !important;
}

body.presentation-mode .main-content {
    margin-left: 0 !important;
}

body.presentation-mode .filter-bar {
    display: none !important;
}

body.presentation-mode .data-banner {
    display: none !important;
}

body.presentation-mode .topbar {
    background: var(--bg-primary);
    border-bottom-color: transparent;
}

body.presentation-mode .topbar-right .icon-btn:not(#presentationBtn) {
    display: none;
}

body.presentation-mode .topbar-search-btn {
    display: none !important;
}

body.presentation-mode .exec-summary {
    margin: 0 16px 16px;
}

body.presentation-mode .kpi-grid {
    margin: 0 16px;
}

body.presentation-mode .tab-content {
    padding: 0 16px 16px;
}

body.presentation-mode .chart-card {
    border: none;
    box-shadow: none;
}

/* Presentation mode indicator */
.presentation-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent-gradient);
    color: white;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    z-index: 9999;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    display: none;
}

body.presentation-mode .presentation-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.3s ease;
}

/* ============ RESPONSIVE (NEW ELEMENTS) ============ */
@media (max-width: 1200px) {
    .topbar-timestamp { display: none; }
    .topbar-search-btn span { display: none; }
    .topbar-search-btn kbd { display: none; }
    .topbar-search-btn { min-width: auto; padding: 7px 10px; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0 !important; }
    .mobile-menu-btn { display: block; }
    .sidebar.open { display: flex; z-index: 200; }
    .exec-summary { margin: 0 12px 12px; }
    .cmd-palette { width: 95vw; }
    .topbar-search-btn { display: none; }
    .notification-panel { width: 100%; right: 0; border-radius: var(--radius-md) var(--radius-md) 0 0; }
}

/* ============ STOREWATCH TAB ============ */

/* ============================================================
   STOREWATCH V2 — 高管汇报级 UI
   ============================================================ */

/* --- Top Area --- */
.sw2-top-area { margin-bottom: 28px; }

.sw2-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}

.sw2-title-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sw2-main-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
}

.sw2-meta-info {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sw2-meta-chip {
    font-size: 11px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    border: 1px solid var(--border-primary);
    font-weight: 500;
}

.sw2-source-bar {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--text-tertiary);
    border: 1px solid var(--border-primary);
}

.sw2-source-bar svg {
    flex-shrink: 0;
    margin-top: 3px;
    opacity: 0.6;
}

/* --- Navigation Tabs --- */
.sw2-nav {
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: 14px;
    width: fit-content;
    border: 1px solid var(--border-primary);
}

.sw2-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.sw2-nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}

.sw2-nav-btn.active.sw2-nav-summary {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #fff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.sw2-nav-btn.active.sw2-nav-ps {
    background: linear-gradient(135deg, #003087, #0060c0);
    color: #fff;
    box-shadow: 0 4px 16px rgba(0, 48, 135, 0.4);
}

.sw2-nav-btn.active.sw2-nav-xbox {
    background: linear-gradient(135deg, #107c10, #1fa01f);
    color: #fff;
    box-shadow: 0 4px 16px rgba(16, 124, 16, 0.4);
}

.sw2-ps-icon {
    font-size: 10px;
    letter-spacing: -1px;
}

.sw2-xbox-icon {
    font-size: 11px;
    font-weight: 800;
}

/* --- KPI Strip --- */
.sw2-kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.sw2-kpi-strip.sw2-kpi-ps .sw2-kpi-item { border-color: rgba(0, 48, 135, 0.25); }
.sw2-kpi-strip.sw2-kpi-ps .sw2-kpi-num { color: #4da6ff; }
.sw2-kpi-strip.sw2-kpi-xbox .sw2-kpi-item { border-color: rgba(16, 124, 16, 0.25); }
.sw2-kpi-strip.sw2-kpi-xbox .sw2-kpi-num { color: #4cca4c; }

.sw2-kpi-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    padding: 22px 20px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sw2-kpi-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.sw2-kpi-item.sw2-kpi-ps-accent {
    border-left: 3px solid #003087;
    background: linear-gradient(135deg, rgba(0,48,135,0.08), transparent);
}

.sw2-kpi-item.sw2-kpi-ps-accent .sw2-kpi-num { color: #4da6ff; }

.sw2-kpi-item.sw2-kpi-xbox-accent {
    border-left: 3px solid #107c10;
    background: linear-gradient(135deg, rgba(16,124,16,0.08), transparent);
}

.sw2-kpi-item.sw2-kpi-xbox-accent .sw2-kpi-num { color: #4cca4c; }

.sw2-kpi-item.sw2-kpi-highlight {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(99,102,241,0.06), transparent);
}

.sw2-kpi-item.sw2-kpi-highlight .sw2-kpi-num { color: var(--accent); }

.sw2-kpi-num {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.sw2-kpi-desc {
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.4;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* --- Panel Container --- */
.sw2-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 24px;
}

.sw2-panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
}

.sw2-panel-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sw2-panel-sub {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-tertiary);
    margin-left: 8px;
}

/* --- Executive Table --- */
.sw2-exec-table {
    width: 100%;
    border-collapse: collapse;
}

.sw2-exec-table thead th {
    padding: 12px 20px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-align: left;
    background: rgba(0,0,0,0.1);
    border-bottom: 1px solid var(--border-primary);
}

.sw2-exec-table tbody td {
    padding: 14px 20px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
}

.sw2-exec-table tbody tr:hover td {
    background: rgba(255,255,255,0.02);
}

.sw2-exec-table tbody tr.sw2-row-top3 td {
    background: rgba(245, 158, 11, 0.03);
}

/* --- Game Name Cells (双语) --- */
.sw2-game-cell {
    line-height: 1.35;
}

.sw2-game-cell.non-game {
    opacity: 0.5;
    font-style: italic;
}

.sw2-game-promo {
    color: var(--text-tertiary);
    font-size: 12px;
}

.sw2-game-primary {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.sw2-game-secondary {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 1px;
    font-weight: 400;
    opacity: 0.75;
}

.sw2-vendor-micro {
    display: inline-block;
    font-size: 9.5px;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-tertiary);
    font-weight: 500;
    margin-top: 2px;
    opacity: 0.7;
}

.sw2-vendor-quiet {
    font-size: 11.5px;
    color: var(--text-tertiary);
    font-weight: 400;
}

.sw2-vendor-name {
    font-weight: 700;
    color: var(--text-primary);
}

/* --- Rank Badge --- */
.sw2-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    font-weight: 800;
    font-size: 12px;
    color: var(--text-secondary);
}

.sw2-rank.gold {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.sw2-count-bold {
    font-weight: 800;
    font-size: 15px;
    color: var(--text-primary);
}

/* --- Bar Chart --- */
.sw2-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.sw2-bar-fg {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #818cf8);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Platform Pills --- */
.sw2-platform-pill {
    display: inline-block;
    font-size: 10px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-weight: 700;
    letter-spacing: 0.3px;
}

.sw2-platform-pill.ps {
    background: rgba(0, 48, 135, 0.18);
    color: #4da6ff;
}

.sw2-platform-pill.xbox {
    background: rgba(16, 124, 16, 0.18);
    color: #4cca4c;
}

.sw2-slot-chips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.sw2-slot-chip {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: rgba(99,102,241,0.07);
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* --- Horizontal Bar Chart (Vendor) --- */
.sw2-bar-chart-area {
    padding: 20px 24px;
}

.sw2-h-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sw2-h-bar-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sw2-h-bar-label {
    min-width: 90px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
}

.sw2-h-bar-track {
    flex: 1;
    height: 30px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
}

@keyframes sw2BarGrow {
    from { width: 0; }
}

.sw2-h-bar-fill {
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    min-width: 70px;
    animation: sw2BarGrow 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.sw2-h-bar-fill.sw2-fill-ps {
    background: linear-gradient(90deg, #003087, #0070d1);
}

.sw2-h-bar-fill.sw2-fill-xbox {
    background: linear-gradient(90deg, #107c10, #2d9d2d);
}

.sw2-h-bar-val {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* --- Slot Legend --- */
.sw2-slot-legend {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.sw2-slot-legend.sw2-legend-ps { border-left: 4px solid #003087; }
.sw2-slot-legend.sw2-legend-xbox { border-left: 4px solid #107c10; }

.sw2-legend-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.sw2-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sw2-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    font-size: 12.5px;
    border-left: 3px solid transparent;
    transition: background 0.2s;
}

.sw2-legend-item:hover { background: rgba(255,255,255,0.04); }

.sw2-legend-item.sw2-tier-1.sw2-ps { border-left-color: #003087; }
.sw2-legend-item.sw2-tier-2.sw2-ps { border-left-color: #0070d1; }
.sw2-legend-item.sw2-tier-3.sw2-ps { border-left-color: #00bfff; }
.sw2-legend-item.sw2-tier-1.sw2-xbox { border-left-color: #107c10; }
.sw2-legend-item.sw2-tier-2.sw2-xbox { border-left-color: #2d9d2d; }
.sw2-legend-item.sw2-tier-3.sw2-xbox { border-left-color: #50bb50; }

.sw2-legend-rank {
    font-weight: 800;
    color: var(--text-tertiary);
    font-size: 11px;
}

.sw2-legend-label {
    font-weight: 600;
    color: var(--text-primary);
}

.sw2-legend-name {
    color: var(--text-tertiary);
    font-size: 11.5px;
}

.sw2-legend-sub {
    font-size: 10.5px;
    color: var(--text-tertiary);
    opacity: 0.7;
    font-weight: 400;
}

/* --- Days Stack (7-day) --- */
.sw2-days-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 24px 24px;
}

.sw2-day-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    overflow: hidden;
}

.sw2-day-ps { border-left: 3px solid #003087; }
.sw2-day-xbox { border-left: 3px solid #107c10; }

.sw2-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-primary);
}

.sw2-head-ps { background: linear-gradient(90deg, rgba(0,48,135,0.12), transparent); }
.sw2-head-xbox { background: linear-gradient(90deg, rgba(16,124,16,0.12), transparent); }

.sw2-day-date-label {
    font-weight: 800;
    font-size: 14px;
    color: var(--text-primary);
}

.sw2-day-weekday-label {
    font-size: 11px;
    color: var(--text-tertiary);
    padding: 2px 12px;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-full);
}

.sw2-day-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* --- Slot Section --- */
.sw2-slot-section {
    border-left: 3px solid var(--border-primary);
}

.sw2-tier-1-ps { border-left-color: #003087; }
.sw2-tier-2-ps { border-left-color: #0070d1; }
.sw2-tier-3-ps { border-left-color: #00bfff; }
.sw2-tier-1-xbox { border-left-color: #107c10; }
.sw2-tier-2-xbox { border-left-color: #2d9d2d; }
.sw2-tier-3-xbox { border-left-color: #50bb50; }

.sw2-slot-title-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    flex-wrap: wrap;
}

.sw2-slot-tier-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sw2-dot-ps-1 { background: #003087; }
.sw2-dot-ps-2 { background: #0070d1; }
.sw2-dot-ps-3 { background: #00bfff; }
.sw2-dot-xbox-1 { background: #107c10; }
.sw2-dot-xbox-2 { background: #2d9d2d; }
.sw2-dot-xbox-3 { background: #50bb50; }

.sw2-slot-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.sw2-slot-name {
    font-size: 11.5px;
    color: var(--text-tertiary);
}

.sw2-slot-sub {
    font-size: 10.5px;
    color: var(--text-tertiary);
    opacity: 0.6;
}

/* --- Region Table --- */
.sw2-region-table {
    width: 100%;
    border-collapse: collapse;
    margin-left: 14px;
    font-size: 12px;
}

.sw2-region-table thead th {
    padding: 7px 12px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-align: left;
    background: rgba(0,0,0,0.08);
    border-bottom: 1px solid var(--border-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sw2-region-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.025);
    vertical-align: top;
}

.sw2-region-table tbody tr:hover td {
    background: rgba(255,255,255,0.015);
}

.sw2-region-table tbody tr.sw2-non-game td {
    opacity: 0.45;
    font-style: italic;
}

.sw2-rank-cell {
    text-align: center;
    vertical-align: middle !important;
}

.sw2-pos-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-weight: 800;
    font-size: 11px;
    color: var(--text-secondary);
}

.sw2-src-tag {
    display: inline-block;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255,255,255,0.04);
    color: var(--text-tertiary);
    margin-left: 3px;
    font-weight: 400;
}

/* --- Latest Day Detail --- */
.sw2-latest-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0 24px 24px;
}

.sw2-latest-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    overflow: hidden;
}

.sw2-latest-ps.sw2-latest-tier-1 { border-top: 3px solid #003087; }
.sw2-latest-ps.sw2-latest-tier-2 { border-top: 3px solid #0070d1; }
.sw2-latest-ps.sw2-latest-tier-3 { border-top: 3px solid #00bfff; }
.sw2-latest-xbox.sw2-latest-tier-1 { border-top: 3px solid #107c10; }
.sw2-latest-xbox.sw2-latest-tier-2 { border-top: 3px solid #2d9d2d; }
.sw2-latest-xbox.sw2-latest-tier-3 { border-top: 3px solid #50bb50; }

.sw2-latest-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-primary);
}

.sw2-tier-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: var(--radius-full);
}

.sw2-pill-ps-1 { background: rgba(0,48,135,0.2); color: #4da6ff; }
.sw2-pill-ps-2 { background: rgba(0,112,209,0.2); color: #66b8ff; }
.sw2-pill-ps-3 { background: rgba(0,191,255,0.2); color: #00bfff; }
.sw2-pill-xbox-1 { background: rgba(16,124,16,0.2); color: #4cca4c; }
.sw2-pill-xbox-2 { background: rgba(45,157,45,0.2); color: #5dd55d; }
.sw2-pill-xbox-3 { background: rgba(80,187,80,0.2); color: #70e070; }

.sw2-latest-slot-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.sw2-latest-table {
    margin-left: 0 !important;
}

.sw2-latest-table thead th {
    padding: 10px 16px;
}

.sw2-latest-table tbody td {
    padding: 12px 16px;
    font-size: 13px;
}

/* --- Empty & Loading --- */
.sw2-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-tertiary);
    font-size: 14px;
}

.sw-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.agent-badge-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.agent-meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ============ STOREWATCH V2 RESPONSIVE ============ */
@media (max-width: 1024px) {
    .sw2-kpi-strip { grid-template-columns: repeat(2, 1fr); }
    .sw2-game-primary { max-width: 200px; }
}

@media (max-width: 768px) {
    .sw2-kpi-strip { grid-template-columns: repeat(2, 1fr); }
    .sw2-nav { width: 100%; flex-wrap: wrap; }
    .sw2-nav-btn { flex: 1; justify-content: center; padding: 8px 14px; font-size: 12px; }
    .sw2-main-title { font-size: 17px; }
    .sw2-exec-table { font-size: 11px; }
    .sw2-exec-table thead th, .sw2-exec-table tbody td { padding: 8px 12px; }
    .sw2-game-primary { max-width: 140px; font-size: 12px; }
    .sw2-region-table { font-size: 11px; }
    .sw2-source-bar { font-size: 10.5px; }
    .sw2-days-stack, .sw2-latest-stack { padding: 0 12px 16px; }
}

/* ============ FADE IN ANIMATION ============ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
