/* ============================================
   多品牌 BI 仪表板 - Professional Analytics System
   ============================================ */

/* Import Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Variables - Professional BI Color System */
:root {
    /* Primary Colors - Refined Graphite */
    --primary-950: #070b11;
    --primary-900: #0f1720;
    --primary-850: #151d28;
    --primary-800: #1b2633;
    --primary-700: #2b394a;
    --primary-600: #455468;
    --primary-500: #667489;
    --primary-400: #94a3b8;
    --primary-300: #cbd5e1;
    --primary-200: #e2e8f0;
    --primary-100: #f1f5f9;
    --primary-50: #f8fafc;
    
    /* Accent Colors */
    --accent-blue: #2f6df6;
    --accent-blue-light: #dbe7ff;
    --accent-mint: #0ea77f;
    --accent-mint-light: #d9f6ec;
    --accent-purple: #5b66d6;
    --accent-purple-light: #e8ebff;
    --accent-cyan: #0f8ea0;
    --accent-cyan-light: #d9f2f6;
    --accent-amber: #d68916;
    --accent-amber-light: #fdf0d3;
    --accent-rose: #f43f5e;
    --accent-rose-light: #ffe4e6;
    
    /* Platform Colors - Fixed by platform identity */
    --color-meituan: #f4b400;
    --color-meituan-soft: #fff4cc;
    --color-taobao: #f97316;
    --color-taobao-soft: #ffedd5;
    --color-jingdong: #ef4444;
    --color-jingdong-soft: #fee2e2;
    
    /* Background & Surface */
    --bg-body: #eff4f8;
    --bg-body-deep: #e6edf3;
    --bg-card: rgba(255, 255, 255, 0.94);
    --bg-card-strong: rgba(255, 255, 255, 0.98);
    --bg-elevated: #ffffff;
    --bg-dark-panel: rgba(11, 17, 24, 0.86);
    --bg-dark-soft: rgba(15, 23, 32, 0.64);
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;
    
    /* Border & Divider */
    --border-light: rgba(15, 23, 42, 0.06);
    --border-default: rgba(15, 23, 42, 0.1);
    --border-strong: rgba(15, 23, 42, 0.16);
    --border-hover: rgba(47, 109, 246, 0.2);
    
    /* Shadows - Lighter, more restrained */
    --shadow-sm: 0 6px 18px rgba(15, 23, 35, 0.05), 0 1px 2px rgba(15, 23, 35, 0.04);
    --shadow-md: 0 12px 28px rgba(15, 23, 35, 0.08), 0 2px 8px rgba(15, 23, 35, 0.04);
    --shadow-lg: 0 20px 42px rgba(15, 23, 35, 0.1), 0 8px 18px rgba(15, 23, 35, 0.05);
    --shadow-xl: 0 28px 56px rgba(15, 23, 35, 0.14), 0 10px 24px rgba(15, 23, 35, 0.06);
    --shadow-glow: 0 0 0 1px rgba(47, 109, 246, 0.08), 0 14px 30px rgba(47, 109, 246, 0.14);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 8px;
    --radius-xl: 8px;
    --page-shell-max-width: 1460px;
    --page-shell-gutter: clamp(16px, 2.2vw, 40px);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(47, 109, 246, 0.05) 0%, transparent 18%),
        radial-gradient(circle at top right, rgba(14, 167, 127, 0.05) 0%, transparent 20%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(239, 244, 248, 0.92) 18%, rgba(230, 237, 243, 1) 100%),
        var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    position: relative;
}

body.is-mobile {
    -webkit-text-size-adjust: 100%;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
}

body::before {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 42%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 78%);
}

body::after {
    background:
        radial-gradient(circle at 16% 18%, rgba(47, 109, 246, 0.08) 0%, transparent 16%),
        radial-gradient(circle at 80% 12%, rgba(14, 167, 127, 0.06) 0%, transparent 14%);
    z-index: -3;
}

/* Header - Professional & Controlled */
.header {
    background:
        radial-gradient(circle at 0% 0%, rgba(96, 165, 250, 0.14), transparent 32%),
        radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.12), transparent 26%),
        linear-gradient(135deg, rgba(7, 11, 17, 0.96) 0%, rgba(13, 18, 25, 0.94) 48%, rgba(20, 28, 38, 0.92) 100%);
    color: white;
    padding: 28px var(--page-shell-gutter) 56px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 -44px 90px rgba(0, 0, 0, 0.16);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 26%, transparent 100%),
        linear-gradient(90deg, rgba(255,255,255,0.03) 0%, transparent 24%, transparent 76%, rgba(255,255,255,0.02) 100%);
    pointer-events: none;
}

.header::after {
    content: '';
    position: absolute;
    left: max(var(--page-shell-gutter), calc((100vw - var(--page-shell-max-width)) / 2));
    right: max(var(--page-shell-gutter), calc((100vw - var(--page-shell-max-width)) / 2));
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.22), rgba(255,255,255,0.02));
}

.header h1 { 
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
    width: min(var(--page-shell-max-width), calc(100vw - (var(--page-shell-gutter) * 2)));
    margin-left: auto;
    margin-right: auto;
}

.header .subtitle { 
    display: block;
    font-size: 13px; 
    color: rgba(226, 232, 240, 0.76);
    line-height: 1.6;
    margin-top: 10px;
    font-weight: 500;
    position: relative;
    z-index: 1;
    width: min(var(--page-shell-max-width), calc(100vw - (var(--page-shell-gutter) * 2)));
    max-width: none;
    margin-left: auto;
    margin-right: auto;
}

body > .nav,
body > .breadcrumb,
body > .page-date-range-toolbar,
body > .page-content,
body > .kpi-cards,
body > .chart-grid,
body > .chart-grid-overview,
body > .overview-header,
body > .store-hero {
    width: min(var(--page-shell-max-width), calc(100vw - (var(--page-shell-gutter) * 2)));
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Navigation - Linear inspired */
.nav {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.88) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 14px;
    margin: -18px auto 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(15, 23, 35, 0.1);
    position: relative;
    z-index: 20;
}

.nav::-webkit-scrollbar {
    height: 0;
}

.nav a {
    padding: 9px 12px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0);
}

.nav a:hover { 
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-primary);
    border-color: rgba(17, 20, 24, 0.08);
    box-shadow: none;
}

.nav a.active { 
    background: linear-gradient(135deg, #2f6df6 0%, #1f57d9 100%);
    color: white;
    border-color: rgba(47, 109, 246, 0.4);
    box-shadow: 0 12px 24px rgba(47, 109, 246, 0.2);
}

.nav a svg {
    width: 18px;
    height: 18px;
    padding: 2px;
    border-radius: 4px;
    background: transparent;
    stroke-width: 2.15;
    transition: all var(--transition-fast);
}

.nav a:hover svg {
    background: transparent;
}

.nav a.active svg {
    background: rgba(255, 255, 255, 0.14);
}

/* Breadcrumb - restrained */
.breadcrumb {
    padding: 12px 0 8px;
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.breadcrumb a { 
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.breadcrumb a:hover { 
    color: var(--primary-700);
}

.breadcrumb span { 
    margin: 0 10px;
    color: var(--primary-400);
}

.page-date-range-toolbar {
    margin: 0 auto 14px;
    padding: 14px 16px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-md);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.92) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-md);
}

.page-date-range-toolbar__main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.page-date-range-toolbar__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.page-date-range-toolbar__label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-date-range-toolbar__hint,
.page-date-range-toolbar__status {
    font-size: 12px;
    color: var(--text-tertiary);
}

.page-date-range-toolbar__status {
    color: var(--text-secondary);
}

.page-date-range-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.range-chip,
.range-apply-btn {
    height: 36px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(17, 20, 24, 0.08);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.range-chip:hover,
.range-apply-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.range-chip.active {
    background: linear-gradient(135deg, #2a66ee 0%, #1548c8 100%);
    border-color: rgba(47, 109, 246, 0.4);
    color: white;
    box-shadow: 0 14px 28px rgba(47, 109, 246, 0.2);
}

.range-apply-btn {
    background: linear-gradient(135deg, #0f1720 0%, #1a2531 100%);
    border-color: rgba(17, 20, 24, 0.08);
    color: white;
}

.page-date-range-toolbar__custom {
    display: none;
    grid-template-columns: repeat(2, minmax(180px, 220px)) auto;
    gap: 12px;
    align-items: end;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(17, 20, 24, 0.06);
}

.page-date-range-toolbar.custom-open .page-date-range-toolbar__custom {
    display: grid;
}

.range-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.range-field span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.range-field input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(17, 20, 24, 0.08);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-fast);
}

.range-field input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-light);
}

.page-date-range-toolbar__tip {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.page-date-range-toolbar__tip [data-role="error-text"] {
    color: var(--accent-rose);
    font-weight: 600;
}

/* KPI Cards - Product analytics style */
.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 18px 0 20px;
}

.kpi-card {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.94) 100%);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    border: 1px solid rgba(15, 23, 42, 0.06);
    position: relative;
    overflow: hidden;
    min-height: 118px;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(14, 167, 127, 0.58), rgba(47, 109, 246, 0.52), rgba(214, 137, 22, 0.3));
    opacity: 1;
}

.kpi-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(47, 109, 246, 0.03) 0%, transparent 28%, transparent 100%);
    pointer-events: none;
}

.kpi-card:hover { 
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(15, 23, 35, 0.1);
    border-color: var(--border-hover);
}

.kpi-label { 
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    letter-spacing: 0.04em;
    font-weight: 600;
    text-transform: uppercase;
}

.kpi-value { 
    font-size: 30px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0;
    line-height: 1.2;
}

.kpi-unit { 
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 6px;
    font-weight: 500;
}

/* Chart Grid - clear structure */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
    padding: 0 0 34px;
}

.chart-full { grid-column: 1 / -1; }

/* Chart Container - restrained analytics cards */
.chart-container {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.94) 100%);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(15, 23, 42, 0.06);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.chart-container:hover {
    box-shadow: 0 16px 34px rgba(15, 23, 35, 0.1);
    border-color: var(--border-hover);
}

.chart-container::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(14,167,127,0.14), rgba(47,109,246,0.12), transparent 72%);
}

.chart-container::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.36);
    pointer-events: none;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 70%);
}

.chart-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: 0;
    position: relative;
    padding-left: 16px;
}

.chart-title > span:first-child {
    min-width: 0;
}

.chart-title-meta {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
}

.chart-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 4px;
    height: 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent-mint), var(--accent-blue));
}

.chart { 
    width: 100%; 
    height: 340px;
}

.chart-large { 
    height: 420px;
}

/* Platform Tags - Soft Pills */
.platform-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tag-meituan { 
    background: var(--color-meituan-soft);
    color: #a16207;
}

.tag-taobao { 
    background: var(--color-taobao-soft);
    color: #c2410c;
}

.tag-jingdong { 
    background: var(--color-jingdong-soft);
    color: #b91c1c;
}

/* Data Table - Airtable inspired */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    background: transparent;
}

.data-table th, .data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    background: rgba(248, 250, 252, 0.92);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 0;
}

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

.data-table tr:hover { 
    background: rgba(248, 250, 252, 0.86);
}

.data-table td {
    color: var(--text-primary);
    font-weight: 400;
    background: rgba(255, 255, 255, 0.4);
}

/* Rank Badges */
.rank-1 { 
    color: var(--accent-amber);
    font-weight: 700;
    font-size: 16px;
}

.rank-2 { 
    color: var(--primary-400);
    font-weight: 700;
    font-size: 16px;
}

.rank-3 { 
    color: var(--accent-rose);
    font-weight: 700;
    font-size: 16px;
}

/* Loading Animation - Refined Spinner */
.loading {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at top, rgba(47, 109, 246, 0.14) 0%, transparent 20%),
        rgba(238, 243, 247, 0.8);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity var(--transition-slow);
}

.loading-spinner {
    width: 54px;
    height: 54px;
    border: 3px solid rgba(17, 20, 24, 0.08);
    border-top-color: var(--accent-blue);
    border-right-color: rgba(14, 167, 127, 0.6);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.72), 0 20px 46px rgba(15, 23, 35, 0.12);
}

@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

/* Checkboxes & Form Elements */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid var(--primary-300);
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--accent-blue);
    transition: all var(--transition-fast);
}

input[type="checkbox"]:hover {
    border-color: var(--accent-blue);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="file"],
select,
textarea,
button {
    font: inherit;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(17, 20, 24, 0.08);
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
}

.eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent-mint), var(--accent-blue));
}

.icon-inline {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-inline svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
select,
textarea {
    border: 1px solid rgba(17, 20, 24, 0.1);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
input[type="number"]:hover,
input[type="search"]:hover,
select:hover,
textarea:hover {
    border-color: rgba(17, 20, 24, 0.16);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(47, 109, 246, 0.38);
    box-shadow: 0 0 0 4px rgba(47, 109, 246, 0.12);
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23647385' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 38px;
}

button {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

button:hover {
    transform: translateY(-1px);
}

label {
    cursor: pointer;
    user-select: none;
}

/* Growth/Decline Indicators */
.growth-positive {
    color: var(--accent-mint);
    font-weight: 600;
}

.growth-negative {
    color: var(--accent-rose);
    font-weight: 600;
}

.growth-neutral {
    color: var(--text-muted);
}

/* Tooltip Styling */
.tooltip {
    background: var(--primary-800);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-100);
    border-radius: 4px;
}

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

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

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

.chart-container,
.kpi-card {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Stagger animation for cards */
.kpi-cards .kpi-card:nth-child(1) { animation-delay: 0.1s; }
.kpi-cards .kpi-card:nth-child(2) { animation-delay: 0.15s; }
.kpi-cards .kpi-card:nth-child(3) { animation-delay: 0.2s; }
.kpi-cards .kpi-card:nth-child(4) { animation-delay: 0.25s; }

/* Responsive Design */
@media (max-width: 768px) {
    .chart-grid { 
        grid-template-columns: 1fr; 
        padding: 0 0 20px;
        gap: 16px;
    }
    
    .kpi-cards { 
        grid-template-columns: repeat(2, 1fr); 
        padding: 16px 0;
        gap: 12px;
    }
    
    .kpi-card {
        padding: 16px;
        min-width: 0;
    }
    
    .kpi-value {
        font-size: clamp(20px, 6vw, 24px);
    }

    .kpi-label {
        font-size: 11px;
        margin-bottom: 8px;
    }
    
    .header { 
        padding: 20px var(--page-shell-gutter) 64px; 
    }
    
    .header h1 { 
        font-size: 22px;
        line-height: 1.2;
    }

    .header .subtitle {
        font-size: 13px;
        margin-top: 6px;
        max-width: 100%;
    }
    
    .nav { 
        padding: 10px 16px 12px;
        margin: -20px auto 0;
        gap: 6px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        position: sticky;
        top: 8px;
        z-index: 40;
    }
    
    .nav a {
        padding: 9px 14px;
        font-size: 12px;
        min-height: 38px;
        scroll-snap-align: start;
    }

    .nav a svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }
    
    .breadcrumb {
        padding: 12px 0 10px;
        font-size: 12px;
        overflow-x: auto;
        white-space: nowrap;
    }

    .page-date-range-toolbar {
        margin: 0 auto 8px;
        padding: 14px;
    }

    .page-date-range-toolbar__custom {
        grid-template-columns: 1fr;
    }

    .page-date-range-toolbar__tip {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-container {
        padding: 16px;
    }

    .chart-title {
        font-size: 14px;
        margin-bottom: 14px;
        align-items: flex-start;
        gap: 10px;
    }
    
    .chart { 
        height: 260px;
    }
    
    .chart-large { 
        height: 320px;
    }

    .data-table {
        min-width: 720px;
    }
}

/* Print Styles */
@media print {
    .nav, .breadcrumb, .loading {
        display: none;
    }
    
    .header {
        background: var(--primary-900);
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .chart-container,
    .kpi-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-default);
    }
}

/* ============================================
   顶部动作区 / 租户选择器
   ============================================ */

.header-action-cluster {
    position: absolute;
    top: 28px;
    right: max(var(--page-shell-gutter), calc((100vw - var(--page-shell-max-width)) / 2));
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    z-index: 120;
}

.tenant-selector-wrapper,
.header-logout-wrapper {
    position: relative;
    z-index: 1;
}

.tenant-selector {
    position: relative;
    display: inline-block;
}

.tenant-selector__current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 14px;
    color: white;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tenant-selector__current:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.26);
}

.tenant-selector__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tenant-selector__name {
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.96);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.header-action-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.header-action-btn:disabled {
    opacity: 0.64;
    cursor: wait;
    transform: none;
}

.header-action-btn svg,
.header-action-btn i {
    width: 14px;
    height: 14px;
}

.tenant-selector__arrow {
    font-size: 10px;
    opacity: 0.7;
    transition: transform var(--transition-fast);
}

.tenant-selector.open .tenant-selector__arrow {
    transform: rotate(180deg);
}

.tenant-selector__dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 200px;
    background: linear-gradient(180deg, rgba(13, 18, 25, 0.98) 0%, rgba(19, 26, 34, 0.96) 100%);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 1000;
    overflow: hidden;
}

.tenant-selector.open .tenant-selector__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tenant-selector__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: white;
}

.tenant-selector__item:last-child {
    border-bottom: none;
}

.tenant-selector__item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.tenant-selector__item.active {
    background: linear-gradient(135deg, #2a66ee 0%, #1548c8 100%);
    color: white;
}

.tenant-selector__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--tenant-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.tenant-selector__item-name {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.icon-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: currentColor;
}

.icon-glyph svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-glyph--solid svg {
    fill: currentColor;
    stroke: none;
}

.icon-glyph--sm {
    width: 14px;
    height: 14px;
}

.icon-glyph--md {
    width: 18px;
    height: 18px;
}

.icon-glyph--lg {
    width: 22px;
    height: 22px;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex-shrink: 0;
}

.status-dot--success {
    background: var(--accent-mint);
}

.status-dot--danger {
    background: var(--accent-rose);
}

.status-dot--warning {
    background: var(--accent-amber);
}

.status-dot--processing {
    background: var(--accent-blue);
}

.status-dot--pending {
    background: #94a3b8;
}

.status-dot--meituan {
    background: var(--color-meituan);
}

.status-dot--taobao {
    background: var(--color-taobao);
}

.status-dot--jingdong {
    background: var(--color-jingdong);
}

/* 响应式适配 */
@media (max-width: 768px) {
    .header-action-cluster {
        position: static;
        margin: 16px 16px 0;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .tenant-selector__current,
    .header-action-btn {
        padding: 6px 12px;
        font-size: 13px;
        max-width: 100%;
        min-height: 38px;
    }
    
    .tenant-selector__name {
        max-width: 80px;
    }
}

/* 租户管理页面样式 */
.tenant-management {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.tenant-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all var(--transition-fast);
}

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

.tenant-card__logo {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: var(--primary-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.tenant-card__info {
    flex: 1;
}

.tenant-card__name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tenant-card__desc {
    font-size: 13px;
    color: var(--text-tertiary);
}

.tenant-card__actions {
    display: flex;
    gap: 12px;
}

.tenant-card__btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.tenant-card__btn--primary {
    background: var(--accent-blue);
    color: white;
}

.tenant-card__btn--primary:hover {
    background: var(--primary-700);
}

.tenant-card__btn--secondary {
    background: var(--primary-100);
    color: var(--text-secondary);
}

.tenant-card__btn--secondary:hover {
    background: var(--primary-200);
}

/* Shared Product Components */
.page-content {
    padding: 0 0 32px;
}

.page-header {
    margin-bottom: 18px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-tertiary);
    font-size: 13px;
    line-height: 1.55;
}

.panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.panel-header,
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px 14px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(248, 250, 252, 0.84);
}

.panel-title,
.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.panel-desc {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.panel-tools {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.panel-footer,
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 22px 20px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(248, 250, 252, 0.56);
}

.table-wrap {
    overflow-x: auto;
}

.btn {
    height: 40px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

.btn-primary {
    background: linear-gradient(135deg, #2f6df6 0%, #1f57d9 100%);
    border-color: rgba(47, 109, 246, 0.38);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2a66ea 0%, #194fcf 100%);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(15, 23, 42, 0.08);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(241, 245, 249, 0.92);
}

.btn-success {
    background: linear-gradient(135deg, #0ea77f 0%, #0a8b6a 100%);
    border-color: rgba(14, 167, 127, 0.26);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #0b9a75 0%, #087f61 100%);
}

.btn-danger {
    background: rgba(254, 226, 226, 0.92);
    border-color: rgba(248, 113, 113, 0.18);
    color: #dc2626;
}

.btn-danger:hover {
    background: rgba(254, 202, 202, 0.92);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: white;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-sm {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
    box-shadow: none;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-secondary);
    box-shadow: none;
}

.btn-icon:hover {
    background: rgba(241, 245, 249, 0.92);
    border-color: rgba(15, 23, 42, 0.14);
}

.form-row,
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.form-group,
.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label,
.form-group label,
.form-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.search-input,
.select-input,
.text-input,
.form-input,
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.form-group select,
.form-group textarea,
.form-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.form-field select,
.form-field textarea {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-group textarea,
.form-field textarea {
    min-height: 96px;
    padding: 12px;
    resize: vertical;
}

.search-input:focus,
.select-input:focus,
.text-input:focus,
.form-input:focus,
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.form-group select:focus,
.form-group textarea:focus,
.form-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-light);
}

.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination-info {
    color: var(--text-tertiary);
    font-size: 13px;
}

.hint-text {
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1.6;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 11, 17, 0.48);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1200;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    width: min(560px, 100%);
    max-height: min(88vh, 820px);
    overflow: auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(255, 255, 255, 0.95));
    border-radius: var(--radius-md);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--shadow-xl);
}

.modal-body {
    padding: 22px;
}

.modal-close {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
    border-color: rgba(15, 23, 42, 0.14);
}

.empty-state {
    padding: 52px 24px;
    text-align: center;
    color: var(--text-tertiary);
}

.empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    margin-bottom: 12px;
}

.toast,
.save-status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 18px;
    background: var(--primary-850);
    color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform var(--transition-normal);
}

.toast.show,
.save-status.show {
    transform: translateX(0);
}

.save-status {
    background: linear-gradient(135deg, #0ea77f 0%, #0a8b6a 100%);
}

.toast.success {
    background: linear-gradient(135deg, #0ea77f 0%, #0a8b6a 100%);
}

.toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.hidden-file-input {
    display: none !important;
}

.w-full {
    width: 100% !important;
}

.is-hidden {
    display: none !important;
}

.kpi-value--meta {
    font-size: 15px;
    margin-top: 8px;
    line-height: 1.4;
    word-break: break-word;
}

.table-col-10 { width: 10%; }
.table-col-12 { width: 12%; }
.table-col-16 { width: 16%; }
.table-col-18 { width: 18%; }
.table-col-22 { width: 22%; }

.tooltip-panel {
    min-width: 180px;
}

.tooltip-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.tooltip-title + .tooltip-muted,
.tooltip-title + .tooltip-row {
    margin-top: 4px;
}

.tooltip-muted {
    color: #94a3b8;
    font-size: 12px;
}

.tooltip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0;
}

.tooltip-row strong,
.tooltip-value {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.tooltip-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-metric {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.tooltip-metric:last-child {
    margin-bottom: 0;
}

.tooltip-metric--revenue { background: rgba(59, 130, 246, 0.15); }
.tooltip-metric--orders { background: rgba(16, 185, 129, 0.15); }
.tooltip-metric--stores { background: rgba(245, 158, 11, 0.15); }

.tooltip-label {
    font-size: 12px;
}

.tooltip-label--revenue { color: #60a5fa; }
.tooltip-label--orders { color: #34d399; }
.tooltip-label--stores { color: #fbbf24; }

.tooltip-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    margin-top: 6px;
    overflow: hidden;
}

.tooltip-progress-bar {
    height: 100%;
    width: var(--progress-width, 0%);
    border-radius: 999px;
    background: linear-gradient(90deg, #FFC72C, #E1251B);
}

.tooltip-empty {
    padding: 24px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.chart-empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.rank-metrics {
    margin-left: 32px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rank-revenue {
    font-size: 16px;
    font-weight: 700;
    color: #92400e;
}

.rank-meta {
    font-size: 12px;
    color: #a16207;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .header {
        padding-top: 24px;
        padding-bottom: 44px;
    }

    .header h1 {
        font-size: 24px;
    }

    .header .subtitle {
        font-size: 12px;
    }

    .nav {
        padding: 8px 10px;
        margin-top: -14px;
    }

    .nav a {
        padding: 8px 10px;
        font-size: 12px;
    }

    .breadcrumb {
        padding: 10px 0 6px;
    }

    .page-date-range-toolbar {
        padding: 12px 14px;
        margin-bottom: 12px;
    }

    .kpi-cards {
        gap: 12px;
        padding: 14px 0 16px;
    }

    .kpi-card {
        padding: 16px;
        min-height: 104px;
    }

    .kpi-value {
        font-size: 26px;
    }

    .chart-grid {
        gap: 16px;
        padding-bottom: 24px;
    }

    .chart-container {
        padding: 16px;
    }

    .page-content {
        padding: 0 0 28px;
    }

    .panel-header,
    .panel-footer,
    .modal-header,
    .modal-footer,
    .modal-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .panel-header,
    .panel-footer,
    .modal-header,
    .modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .panel-tools {
        width: 100%;
    }

    .form-row,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .toast,
    .save-status {
        left: 16px;
        right: 16px;
        top: auto;
        bottom: 16px;
        transform: translateY(120px);
    }

    .toast.show,
    .save-status.show {
        transform: translateY(0);
    }

    .kpi-value--meta {
        font-size: 13px;
        margin-top: 4px;
    }
}
