/* ===== CSS Variables - Theme System ===== */
:root {
    /* Light Theme (Default) */
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.85);
    --bg-chart: #ffffff;
    --bg-table-hover: #f5f7fa;
    --bg-tab-active: #4f7cff;
    
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #8898aa;
    --text-inverse: #ffffff;
    
    --border-color: #e2e8f0;
    --border-hover: #cbd5e0;
    
    --accent-primary: #4f7cff;
    --accent-secondary: #00d4aa;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-glow: rgba(79, 124, 255, 0.15);
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1c2333;
    --bg-header: rgba(22, 27, 34, 0.85);
    --bg-chart: #1c2333;
    --bg-table-hover: #242d3f;
    --bg-tab-active: #4f7cff;
    
    --text-primary: #e6edf3;
    --text-secondary: #b1bac4;
    --text-muted: #6e7681;
    --text-inverse: #ffffff;
    
    --border-color: #30363d;
    --border-hover: #484f58;
    
    --accent-primary: #58a6ff;
    --accent-secondary: #2ea043;
    --accent-gradient: linear-gradient(135deg, #1a1f35 0%, #2d1b4e 100%);
    --accent-glow: rgba(88, 166, 255, 0.2);
    
    --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 32px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* ===== Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.4s ease, color 0.4s ease;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Header ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.title-block h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.title-block .subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.03em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.update-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.data-badge {
    font-size: 0.72rem;
    color: var(--accent, #4f7cff);
    background: color-mix(in srgb, var(--accent, #4f7cff) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent, #4f7cff) 30%, transparent);
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
    font-weight: 600;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

/* ===== Share Button ===== */
.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.share-btn:hover {
    transform: scale(1.1);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    color: var(--accent-primary);
}

/* ===== Share Menu (fallback) ===== */
.share-menu {
    position: fixed;
    top: 64px;
    right: 16px;
    z-index: 1000;
    min-width: 248px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    padding: 6px;
    animation: shareMenuIn 0.18s ease;
}

@keyframes shareMenuIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.share-menu[hidden] { display: none; }

.share-menu-title {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 4px 10px 8px;
    letter-spacing: 0.04em;
}

.share-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 4px 6px 8px;
}

.share-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 4px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.72rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.share-menu-item:hover {
    background: var(--accent-glow);
}

.share-menu-item:hover .share-icon {
    transform: scale(1.08);
}

.share-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    transition: transform 0.15s;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%) translateY(20px);
    z-index: 1100;
    background: var(--text-primary);
    color: var(--bg-card);
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast[hidden] { display: none; }

/* ===== QR Overlay ===== */
.qr-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.qr-overlay[hidden] { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.qr-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 22px;
    text-align: center;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.qr-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.qr-img {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 10px;
    padding: 8px;
    margin: 0 auto 12px;
    width: 236px;
}

.qr-url {
    font-size: 0.72rem;
    color: var(--text-muted);
    word-break: break-all;
    margin-bottom: 14px;
}

.qr-close {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 9px 26px;
    border-radius: 999px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
}

.qr-close:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}


/* ===== Region Switcher ===== */
.region-switcher {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px 0;
    display: flex;
    gap: 0;
    background: transparent;
}

.region-switcher .region-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 24px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.region-switcher .region-btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-right: none;
}

.region-switcher .region-btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left: none;
}

.region-switcher .region-btn:hover {
    color: var(--accent-primary);
    background: var(--accent-glow);
}

.region-switcher .region-btn.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.region-switcher .region-btn.active + .region-btn {
    border-left: 1px solid var(--border-color);
}

/* ===== Metric Switcher (出货 / 活跃) ===== */
.metric-switcher {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 24px 0;
    display: flex;
    justify-content: center;
    gap: 0;
}

.metric-switcher .metric-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 22px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.metric-switcher .metric-btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-right: none;
}

.metric-switcher .metric-btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left: none;
}

.metric-switcher .metric-btn:hover {
    color: #00b894;
    background: rgba(0, 184, 148, 0.1);
}

.metric-switcher .metric-btn.active {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.25);
}

.metric-switcher .metric-btn.active + .metric-btn {
    border-left: 1px solid var(--border-color);
}

/* ===== Summary Cards ===== */
.summary-cards {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.summary-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-accent, var(--accent-primary));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

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

.summary-card .card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    background: var(--card-accent-bg, var(--accent-glow));
    color: var(--card-accent, var(--accent-primary));
}

.summary-card .card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.summary-card .card-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.summary-card .card-change {
    font-size: 0.78rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-change.up {
    color: #e74c3c;
}

.card-change.down {
    color: #27ae60;
}

/* ===== Tab Navigation ===== */
.tab-nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.tab-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.tab-btn.active {
    background: var(--bg-tab-active);
    border-color: var(--bg-tab-active);
    color: #fff;
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* ===== Chart Section ===== */
.chart-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

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

.chart-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chart-controls select,
.chart-controls button {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    outline: none;
}

.chart-controls select:hover,
.chart-controls button:hover {
    border-color: var(--accent-primary);
}

.chart-controls button.active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.chart-container {
    background: var(--bg-chart);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.chart {
    width: 100%;
    height: 500px;
    min-height: 400px;
}

/* ===== Data Table ===== */
.data-table-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 24px;
}

.data-table-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    transition: var(--transition);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table thead th {
    padding: 14px 20px;
    text-align: left;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 14px 20px;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-table-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.brand-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.share-bar {
    display: inline-block;
    height: 6px;
    border-radius: 3px;
    background: var(--accent-glow);
    vertical-align: middle;
    margin-left: 8px;
    min-width: 20px;
    transition: width 0.5s ease;
}

.change-cell {
    font-weight: 600;
}

.change-cell.up {
    color: #e74c3c;
}

.change-cell.down {
    color: #27ae60;
}

.change-cell.flat {
    color: var(--text-muted);
}

/* ===== Footer ===== */
.footer {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
}

.footer p {
    margin-bottom: 4px;
}

.footer-source {
    font-size: 0.78rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.5;
    max-width: 720px;
    margin: 0 auto 6px;
}

/* ===== Loading Animation ===== */
.chart-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== Responsive Design ===== */

/* Tablet */
@media (max-width: 1024px) {
    .header-inner {
        padding: 12px 16px;
    }
    
    .region-switcher {
        padding: 12px 16px 0;
    }
    
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px;
    }
    
    .chart-section,
    .data-table-section,
    .tab-nav {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .chart {
        height: 420px;
    }
    
    .title-block h1 {
        font-size: 1.1rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .header-inner {
        padding: 12px;
        flex-wrap: wrap;
    }
    
    .region-switcher {
        padding: 8px 12px 0;
    }
    
    .region-switcher .region-btn {
        padding: 6px 16px;
        font-size: 0.82rem;
    }
    
    .update-time {
        display: none;
    }

    .data-badge {
        font-size: 0.62rem;
        padding: 2px 7px;
    }
    
    .title-block h1 {
        font-size: 1rem;
    }
    
    .title-block .subtitle {
        font-size: 0.65rem;
    }
    
    .logo {
        width: 36px;
        height: 36px;
    }
    
    .summary-cards {
        grid-template-columns: 1fr 1fr;
        padding: 12px;
        gap: 12px;
    }
    
    .summary-card {
        padding: 16px;
    }
    
    .summary-card .card-value {
        font-size: 1.3rem;
    }
    
    .summary-card .card-icon {
        width: 32px;
        height: 32px;
    }
    
    .tab-nav {
        padding: 0 12px;
        gap: 6px;
    }
    
    .tab-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    
    .tab-btn span {
        font-size: 0.8rem;
    }
    
    .chart-section,
    .data-table-section {
        padding: 12px;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-container {
        padding: 12px;
    }
    
    .chart {
        height: 350px;
        min-height: 300px;
    }
    
    .data-table thead th {
        padding: 10px 14px;
        font-size: 0.75rem;
    }
    
    .data-table tbody td {
        padding: 10px 14px;
        font-size: 0.82rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .tab-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 8px;
    }
    
    .tab-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .chart {
        height: 300px;
    }
    
    .header-left {
        gap: 10px;
    }
    
    .title-block h1 {
        font-size: 0.9rem;
    }
}

/* ===== Smooth scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

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

/* ===== Fade In Animation ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.summary-card,
.chart-container,
.table-wrapper {
    animation: fadeInUp 0.4s ease-out;
}

/* =========================================================
   手机版适配增强 (Mobile Enhancement)
   说明: 以下规则定义在文件末尾，同优先级下后定义者优先生效，
   用于覆盖上方默认响应式样式，提供真正的「手机 App 化」体验。
   ========================================================= */

/* 移除移动端点击高亮闪烁 */
html, body {
    -webkit-tap-highlight-color: transparent;
}

/* 分享遮罩（移动端底部抽屉用） */
.share-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.45);
    animation: fadeIn 0.2s ease;
}
.share-backdrop[hidden] { display: none; }

/* 底部抽屉上滑动画 */
@keyframes sheetUp {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============ Tablet (<=1024px) ============ */
@media (max-width: 1024px) {
    .metric-switcher {
        padding: 10px 16px 0;
    }
}

/* ============ Mobile (<=768px) ============ */
@media (max-width: 768px) {
    /* 为底部固定 Tab 留出空间，避免遮挡页脚 */
    body {
        padding-bottom: 78px;
    }

    /* ---- 顶栏: 紧凑、不换行、适配刘海屏 ---- */
    .header {
        padding-top: env(safe-area-inset-top);
    }
    .header-inner {
        padding: 10px 12px;
        flex-wrap: nowrap;
        gap: 8px;
    }
    .header-left {
        gap: 10px;
        min-width: 0;
    }
    .logo {
        width: 34px;
        height: 34px;
        border-radius: 9px;
        flex-shrink: 0;
    }
    .logo svg { width: 20px; height: 20px; }
    .title-block { min-width: 0; }
    .title-block h1 {
        font-size: 0.98rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .title-block .subtitle {
        font-size: 0.62rem;
        display: none;
    }

    .header-right {
        gap: 8px;
        flex-shrink: 0;
    }
    .update-time { display: none; }
    .data-badge {
        font-size: 0.6rem;
        padding: 2px 7px;
        max-width: 96px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .theme-toggle,
    .share-btn {
        width: 36px;
        height: 36px;
    }
    .theme-toggle svg,
    .share-btn svg { width: 18px; height: 18px; }

    /* 触控优化 */
    .tab-btn, .region-btn, .metric-btn, .share-menu-item,
    .theme-toggle, .share-btn {
        touch-action: manipulation;
    }

    /* ---- 区域 / 指标 切换: 全宽分段控件 ---- */
    .region-switcher,
    .metric-switcher {
        padding: 8px 12px 0;
        max-width: 100%;
    }
    .region-switcher .region-btn,
    .metric-switcher .metric-btn {
        flex: 1 1 0;
        justify-content: center;
        padding: 9px 4px;
        font-size: 0.82rem;
    }

    /* ---- 摘要卡片: 两列网格 ---- */
    .summary-cards {
        grid-template-columns: 1fr 1fr;
        padding: 12px;
        gap: 10px;
    }
    .summary-card {
        padding: 14px;
        border-radius: 14px;
    }
    .summary-card .card-icon {
        width: 30px;
        height: 30px;
        margin-bottom: 8px;
    }
    .summary-card .card-icon svg { width: 16px; height: 16px; }
    .summary-card .card-value { font-size: 1.25rem; }
    .summary-card .card-label { font-size: 0.72rem; }
    .summary-card .card-change { font-size: 0.68rem; }

    /* ---- 底部固定 Tab 导航（App 化） ---- */
    .tab-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        z-index: 90;
        max-width: none;
        margin: 0;
        flex-wrap: nowrap;
        gap: 6px;
        justify-content: space-between;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        background: var(--bg-header);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    }
    .tab-btn {
        flex: 1 1 0;
        flex-direction: column;
        gap: 3px;
        padding: 6px 2px;
        border: none;
        border-radius: 10px;
        font-size: 0.64rem;
        font-weight: 600;
        color: var(--text-muted);
        background: transparent;
    }
    .tab-btn svg { width: 20px; height: 20px; }
    .tab-btn:hover {
        border: none;
        color: var(--text-muted);
        background: transparent;
    }
    .tab-btn.active {
        background: var(--bg-tab-active);
        color: #fff;
        box-shadow: 0 4px 12px var(--accent-glow);
    }
    .tab-btn.active:hover { color: #fff; }

    /* ---- 图表区 ---- */
    .chart-section,
    .data-table-section {
        padding: 12px;
    }
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 12px;
    }
    .chart-header h2 { font-size: 1.05rem; }
    .chart-container {
        padding: 14px 10px;
        border-radius: 14px;
        position: relative;
    }
    .chart {
        height: 320px;
        min-height: 280px;
    }

    /* ---- 数据表 ---- */
    .data-table-section h2 { font-size: 1.05rem; }
    .data-table { min-width: 0; }
    .data-table thead th {
        padding: 10px 12px;
        font-size: 0.72rem;
    }
    .data-table tbody td {
        padding: 10px 12px;
        font-size: 0.78rem;
    }
    .brand-cell { gap: 7px; }
    .share-bar { display: none; }   /* 手机端隐藏内联条，节省横向空间 */

    .footer {
        padding: 20px 16px;
        font-size: 0.72rem;
    }

    /* ---- 分享菜单: 移动端底部抽屉 ---- */
    .share-menu {
        top: auto;
        right: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        min-width: 0;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25);
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
        z-index: 1000;
        animation: sheetUp 0.25s ease;
    }
    .share-menu::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: var(--border-hover);
        margin: 4px auto 8px;
    }
    .share-menu-title {
        text-align: center;
        padding: 6px 0 10px;
        font-size: 0.78rem;
    }
    .share-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        padding: 0 4px 8px;
    }
    .share-menu-item { padding: 10px 2px; }
}

/* ============ Small Mobile (<=480px) ============ */
@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
    .chart {
        height: 300px;
    }
    .tab-btn span {
        font-size: 0.6rem;
    }
    .data-badge { max-width: 84px; }
}

/* ============ Extra narrow (<=360px) ============ */
@media (max-width: 360px) {
    .title-block h1 { font-size: 0.9rem; }
    .tab-btn svg { width: 18px; height: 18px; }
    .chart { height: 280px; }
}

