/* 小哆说量化 — PC桌面布局（≥900px自动启用）
 * 设计语言参照 quant_research QuantLab：浅灰底 + 白色圆角卡片 + 深色侧边栏 + 蓝色accent
 * 移动端（<900px）不受影响，保持金融金深色主题
 */

@media (min-width: 900px) {
    /* 主题变量切换：浅色 + 蓝accent */
    :root {
        --gold: #3b82f6;
        --gold-light: #2563eb;
        --gold-dark: #1d4ed8;
        --bg-primary: #f9fafb;
        --bg-card: #ffffff;
        --bg-card-hover: #f3f4f6;
        --text-primary: #1f2937;
        --text-secondary: #6b7280;
        --text-muted: #9ca3af;
        --border: #e5e7eb;
        --green: #10b981;
        --red: #ef4444;
    }

    body {
        padding-bottom: 0;
        padding-left: 224px;
    }

    /* 底部tab栏 → QuantLab深色侧边栏 */
    .tab-bar {
        top: 0;
        bottom: 0;
        left: 0;
        right: auto;
        width: 224px;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 0 0 20px;
        background: #0f172a;
        border-top: none;
        border-right: 1px solid #1e293b;
    }
    .tab-bar::before {
        content: '🐾 小哆说量化';
        display: block;
        font-size: 18px;
        font-weight: 700;
        color: #ffffff;
        letter-spacing: 1px;
        padding: 20px 20px 16px;
        border-bottom: 1px solid #1e293b;
        margin-bottom: 12px;
    }
    .tab-item {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        width: auto;
        margin: 2px 12px;
        padding: 10px 14px;
        font-size: 14px;
        color: #94a3b8;
        border-radius: 8px;
    }
    .tab-item:hover { background: #1e293b; }
    .tab-item.active {
        background: #3b82f6;
        color: #ffffff;
        border-right: none;
    }
    .tab-icon { font-size: 18px; margin-bottom: 0; }

    /* 白色顶栏 + 宽屏内容区 */
    .header {
        background: #ffffff;
        border-bottom: 1px solid var(--border);
        padding: 16px 24px;
    }
    .header h1 { font-size: 18px; color: #1f2937; }
    .container { max-width: 1200px; padding: 20px 24px; }
    .xiaoduo-banner {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, #ffffff 100%);
        border-bottom: 1px solid var(--border);
        padding: 16px 24px;
    }
    .xiaoduo-banner .xiaoduo-tip-card {
        max-width: 1200px;
        margin: 0 auto;
        border-color: var(--border);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    /* 卡片白底微阴影 */
    .strategy-card, .stat-card, .holding-card, .history-item, .chart-container,
    .about-section, .factor-card, .timeline-card, .action-item, .feature-card,
    .compare-table, .groups-details, .summary-bar, .drawdown-status, .cal-controls,
    .cal-body, .cal-summary-row, .notice-banner, .group-hero,
    #pane-today, #pane-nav, #pane-drawdown, #pane-history {
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    /* 首页：三卡片横排 + 大图 */
    #strategyCards {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    .strategy-card { margin-bottom: 0; }
    #homeChart { height: 420px; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .drawdown-grid { grid-template-columns: repeat(6, 1fr); }

    /* 策略切换器 */
    .strategy-switcher { max-width: 1200px; padding: 16px 24px 0; }
    .switch-pill { flex: 0 0 auto; padding: 7px 22px; font-size: 13px; }
    .switch-pill.active { color: #ffffff; }

    /* 策略详情：四pane同屏仪表盘 */
    .inner-tabs { display: none; }
    .tab-pane { display: block; }
    #pane-today, #pane-nav, #pane-drawdown, #pane-history {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 16px 18px;
    }
    .container:has(#pane-today) {
        display: grid;
        grid-template-columns: 5fr 7fr;
        grid-template-areas:
            "today nav"
            "today dd"
            "hist hist";
        gap: 16px;
        align-items: start;
    }
    #pane-today { grid-area: today; align-self: stretch; }
    #pane-nav { grid-area: nav; }
    #pane-drawdown { grid-area: dd; }
    #pane-history { grid-area: hist; }
    .tab-pane .section-title:first-child { margin-top: 4px; }
    #chartWrapper { height: 360px; }
    #ddChart { height: 300px; }
    #episodesList, #historyList {
        max-height: 420px;
        overflow-y: auto;
        padding-right: 6px;
    }
    #pane-history #historyList {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        max-height: 360px;
    }
    #pane-history .history-item { margin-bottom: 0; }
    .cal-day { min-height: 44px; }

    /* 对比页 */
    #compareChart { height: 480px; }
    #featureCards {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    .feature-card { margin-bottom: 0; }
    .compare-table { font-size: 13px; }
    .compare-table th, .compare-table td { padding: 12px 14px; }
    .compare-table thead th { background: #f9fafb; }

    /* 关于页限宽 */
    .container:has(#aboutTable) { max-width: 1000px; }

    /* 课程培训定位：PC专属内容切换 */
    .pc-only { display: revert; }
    .mobile-only { display: none; }

    /* 首页课程hero：浅色加大版 */
    .course-hero {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, #ffffff 55%);
        padding: 28px 32px;
        margin-bottom: 20px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }
    .course-hero-title { font-size: 26px; color: #1f2937; }
    .course-hero-title em { color: #3b82f6; }
    .course-hero-sub { font-size: 14px; color: #2563eb; margin: 6px 0 10px; }
    .course-hero p { font-size: 13px; color: #6b7280; max-width: 780px; }
    .course-hero-tags { gap: 8px; margin-top: 14px; }
    .course-hero-tags span {
        font-size: 12px; color: #1d4ed8; background: #dbeafe;
        border: none; padding: 4px 14px;
    }

    /* 侧边栏底部定位说明 */
    .tab-bar::after {
        content: '量化课程培训 · 策略仅供教学参考';
        position: absolute;
        bottom: 16px; left: 20px; right: 20px;
        font-size: 11px; color: #64748b; line-height: 1.5;
    }

    /* 页脚 / 法务页 */
    .site-footer { max-width: 1200px; padding: 24px; margin-top: 16px; }
    .footer-links { font-size: 13px; gap: 10px; }
    .legal-page .container { max-width: 860px; }
    .legal-section { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
    .legal-section p, .legal-section li { font-size: 13px; }

    /* 深色主题遗留硬编码色 → 浅色修正 */
    .notice-defense { color: #0369a1; background: #e0f2fe; border: 1px solid #bae6fd; }
    .notice-pending { color: #92400e; background: #fef3c7; border: 1px solid #fde68a; }
    .badge-holding { color: #047857; background: #d1fae5; }
    .badge-defense { color: #0369a1; background: #e0f2fe; }
    .badge-cash { color: #4b5563; background: #e5e7eb; }
    .status-recovering { color: #b91c1c; background: #fee2e2; }
    .status-recovered { color: #047857; background: #d1fae5; }
    .action-buy { color: #b91c1c; background: #fee2e2; }
    .action-sell { color: #15803d; background: #dcfce7; }
    .cal-day.positive .cal-ret { color: #b91c1c; }
    .cal-day.negative .cal-ret { color: #15803d; }
    .cal-month-cell.positive .cal-month-ret { color: #b91c1c; }
    .cal-month-cell.negative .cal-month-ret { color: #15803d; }
    .timeline-time { background: rgba(59, 130, 246, 0.1); }
    .gtag-core { color: #1d4ed8; background: #dbeafe; }
    .group-hero {
        background: linear-gradient(135deg, rgba(171, 71, 188, 0.08) 0%, #ffffff 60%);
        border-color: rgba(171, 71, 188, 0.3);
    }

    /* 中等宽屏（900-1099）：仪表盘单列纵排，避免双栏过挤 */
    @media (max-width: 1099px) {
        .container:has(#pane-today) {
            grid-template-columns: 1fr;
            grid-template-areas: "today" "nav" "dd" "hist";
        }
        #pane-history #historyList { grid-template-columns: repeat(2, 1fr); }
        #strategyCards { grid-template-columns: 1fr; }
        #featureCards { grid-template-columns: 1fr; }
    }

    /* 滚动条美化 */
    #episodesList::-webkit-scrollbar, #historyList::-webkit-scrollbar { width: 6px; }
    #episodesList::-webkit-scrollbar-thumb, #historyList::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 3px;
    }
}