/* ==================== CSS 变量（浅色）==================== */
:root {
    /* 背景层 */
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-subtle: #f8fafc;

    /* 文字 */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-on-brand: #ffffff;

    /* 边框 */
    --border-subtle: #e2e8f0;
    --border-default: #cbd5e1;

    /* 品牌色 */
    --brand: #6366f1;
    --brand-light: #818cf8;
    --brand-dark: #4f46e5;
    --brand-soft: #eef2ff;

    /* 功能色 */
    --success: #10b981;
    --success-soft: #d1fae5;
    --warning: #f59e0b;
    --warning-soft: #fef3c7;
    --danger: #ef4444;
    --danger-soft: #fee2e2;

    /* 阴影 */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 24px rgba(15, 23, 42, 0.08), 0 4px 8px rgba(15, 23, 42, 0.04);
    --shadow-brand: 0 8px 24px rgba(99, 102, 241, 0.18);

    /* 渐变 */
    --gradient-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);

    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* 字体 */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

    /* 过渡 */
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);

    /* ===== 语义标签色（徽章 / 状态标记 / 提示文字）=====
       原先这些值散落在各处硬编码，暗色主题下不会跟随，会出现
       浅底浅字看不见的情况。统一令牌化，颜色值与原来保持一致。 */
    --tag-danger-bg: #fee2e2;
    --tag-danger-fg: #b91c1c;
    --tag-danger-strong: #dc2626;
    --tag-warning-fg: #b45309;
    --tag-warning-strong: #ca8a04;
    --tag-warning-deep: #a16207;
    --tag-success-bg: #dcfce7;
    --tag-success-fg: #15803d;
    --tag-success-strong: #16a34a;
    --tag-info-bg: #dbeafe;
    --tag-info-fg: #1d4ed8;
    --tag-accent-bg: #ede9fe;
    --tag-accent-fg: #6d28d9;
    --tag-accent-border: #ddd6fe;
    --tag-accent-strong: #5b21b6;
    --tag-accent-surface: #faf9ff;
    --tag-purple-fg: #7e22ce;

    /* 悬浮提示气泡（深底白字，暗色下反相） */
    --tooltip-bg: #1f2937;
    --tooltip-fg: #ffffff;

    /* 在线状态点 */
    --dot-online: #4ade80;

    /* 次要渐变（优先级卡、指标卡强调条） */
    --gradient-muted: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    --gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

/* ==================== CSS 变量（暗色）==================== */
[data-theme="dark"] {
    --bg-base: #0a0e1a;
    --bg-surface: #131826;
    --bg-elevated: #1a2030;
    --bg-sidebar: #0f1421;
    --bg-hover: #1e2536;
    --bg-subtle: #131826;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --text-on-brand: #ffffff;

    --border-subtle: #1e293b;
    --border-default: #334155;

    --brand: #818cf8;
    --brand-light: #a5b4fc;
    --brand-dark: #6366f1;
    --brand-soft: rgba(129, 140, 248, 0.12);

    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.15);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.5);
    --shadow-brand: 0 8px 24px rgba(129, 140, 248, 0.25);

    --gradient-brand: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    --gradient-success: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    --gradient-warm: linear-gradient(135deg, #fbbf24 0%, #f87171 100%);
    --gradient-muted: linear-gradient(135deg, #475569 0%, #334155 100%);
    --gradient-cyan: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);

    /* 语义标签色（暗色）：深底 + 亮字，保证对比度 */
    --tag-danger-bg: rgba(248, 113, 113, 0.16);
    --tag-danger-fg: #fca5a5;
    --tag-danger-strong: #f87171;
    --tag-warning-fg: #fcd34d;
    --tag-warning-strong: #fbbf24;
    --tag-warning-deep: #fbbf24;
    --tag-success-bg: rgba(52, 211, 153, 0.16);
    --tag-success-fg: #6ee7b7;
    --tag-success-strong: #34d399;
    --tag-info-bg: rgba(96, 165, 250, 0.16);
    --tag-info-fg: #93c5fd;
    --tag-accent-bg: rgba(167, 139, 250, 0.18);
    --tag-accent-fg: #c4b5fd;
    --tag-accent-border: rgba(167, 139, 250, 0.38);
    --tag-accent-strong: #ddd6fe;
    --tag-accent-surface: rgba(167, 139, 250, 0.08);
    --tag-purple-fg: #d8b4fe;

    /* 暗色下气泡反相：浅底深字 */
    --tooltip-bg: #e2e8f0;
    --tooltip-fg: #0f172a;

    --dot-online: #4ade80;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    transition: background-color var(--transition), color var(--transition);
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ==================== 应用布局 ==================== */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==================== 顶部导航栏 ==================== */
.topbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .topbar {
    background: rgba(15, 20, 33, 0.85);
}

.topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    flex-shrink: 0;
}

.brand-logo-frame {
    position: relative;
    display: block;
    width: 152px;
    height: 38px;
    overflow: hidden;
}

.brand-logo {
    position: absolute;
    top: -16px;
    left: -17px;
    width: 185px;
    max-width: none;
    height: auto;
}

[data-theme="dark"] .brand-logo-frame {
    background: #fff;
    border-radius: 7px;
}

.topbar-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}

.topbar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
}

.topbar-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.topbar-link.active {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
}

.link-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.link-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
}

.link-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--danger);
    margin-left: 2px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.auth-user {
    height: 38px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 5px 4px 6px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 12px;
}

.auth-avatar {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.auth-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-brand);
    background: var(--gradient-brand);
    font-weight: 700;
}

.auth-user-name {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-primary);
}

.auth-logout {
    padding: 4px 8px;
    border-radius: var(--radius-full);
    color: var(--text-tertiary);
    transition: all var(--transition);
}

.auth-logout:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: rotate(15deg);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-icon-dark,
.theme-icon-light {
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="light"] .theme-icon-dark,
[data-theme="dark"] .theme-icon-light {
    display: none;
}

/* ==================== 主内容 ==================== */
.main-content {
    flex: 1;
    width: 100%;
    background: var(--bg-base);
}

.main-content > *:not(.footer) {
    padding-left: 32px;
    padding-right: 32px;
}

.footer {
    padding: 24px 32px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 48px;
}

@media (max-width: 768px) {
    .topbar-inner {
        padding: 0 16px;
        gap: 12px;
    }
    .topbar-nav { gap: 2px; }
    .topbar-link { padding: 6px 10px; font-size: 13px; }
    .main-content > *:not(.footer) { padding-left: 16px; padding-right: 16px; }
    .brand-logo-frame { width: 36px; }
    .auth-user-name { display: none; }
    .auth-logout { padding: 4px 6px; }
}

/* 中屏（~1300px 以内）13 个导航链接也放不下，会竖排折断并把顶栏撑高，
   所以横向滚动规则从 720px 提前到 1320px；≤720px 那段继续负责字号/内边距。 */
@media (max-width: 1320px) {
    .topbar-nav {
        gap: 2px;
        min-width: 0;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
    }
    .topbar-nav::-webkit-scrollbar { height: 3px; }
    .topbar-nav::-webkit-scrollbar-thumb {
        background: var(--border-subtle);
        border-radius: 3px;
    }
    .topbar-link {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

/* 窄屏顶栏：导航横向滚动、文字不换行，右侧账号/退出/主题始终留在屏内。
   原来的 768px 断点只缩小了字号，但没有阻止链接文字换行，
   导航收缩后每个链接变成一列竖排汉字，右侧按钮被挤出屏幕（横向溢出）。 */
@media (max-width: 720px) {
    .topbar-inner {
        padding: 0 12px;
        gap: 10px;
        height: 56px;
    }
    .topbar-nav {
        gap: 2px;
        min-width: 0;                 /* 允许收缩，否则 flex 子项不会出现滚动条 */
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;        /* 保留细滚动条，提示还能横向拖 */
    }
    .topbar-nav::-webkit-scrollbar { height: 3px; }
    .topbar-nav::-webkit-scrollbar-thumb {
        background: var(--border-subtle);
        border-radius: 3px;
    }
    .topbar-link {
        flex: 0 0 auto;               /* 不压缩，靠滚动而不是换行容纳 */
        white-space: nowrap;
        padding: 6px 9px;
        font-size: 12.5px;
    }
    .topbar-brand { flex-shrink: 0; }
}

@media (max-width: 460px) {
    .topbar-inner { padding: 0 8px; gap: 6px; }
    .topbar-link { padding: 5px 7px; font-size: 12px; }
    .brand-logo-frame { width: 32px; height: 32px; }
    .brand-logo { top: -9px; left: -10px; width: 110px; }
    .auth-user { padding: 3px 4px; }
}

/* ==================== 账号登录与注册页 ==================== */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 18% 18%, rgba(99, 102, 241, 0.13), transparent 34%),
        radial-gradient(circle at 82% 82%, rgba(202, 158, 104, 0.16), transparent 30%),
        var(--bg-base);
}

.auth-shell {
    width: min(440px, 100%);
}

.auth-card {
    padding: 38px 40px 34px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-brand-logo {
    width: 186px;
    max-height: 58px;
    object-fit: cover;
    object-position: center;
    margin-bottom: 22px;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    color: var(--brand);
    background: var(--brand-soft);
    font-size: 12px;
    font-weight: 700;
}

.auth-card h1 {
    margin: 0 0 9px;
    font-size: 25px;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    margin: 0 auto 25px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

.auth-submit {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 3px;
    border-radius: var(--radius-md);
    color: var(--text-on-brand);
    background: var(--gradient-brand);
    box-shadow: var(--shadow-brand);
    font-size: 15px;
    font-weight: 700;
    transition: transform var(--transition), box-shadow var(--transition);
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 11px 22px rgba(99, 102, 241, 0.28);
}

.auth-form {
    display: grid;
    gap: 15px;
    text-align: left;
}

.auth-field {
    display: grid;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.auth-field input {
    width: 100%;
    height: 44px;
    padding: 0 13px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    outline: none;
    color: var(--text-primary);
    background: var(--bg-surface);
    font: inherit;
    font-weight: 500;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-field input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.auth-field input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.auth-switch {
    margin: 18px 0 0;
    color: var(--text-tertiary);
    font-size: 13px;
}

.auth-switch a {
    color: var(--brand);
    font-weight: 700;
}

.auth-notice {
    padding: 14px 15px;
    border-radius: var(--radius-md);
    text-align: left;
    font-size: 13px;
    line-height: 1.65;
}

.auth-notice-error {
    margin-bottom: 17px;
    color: var(--tag-danger-fg);
    background: var(--danger-soft);
    border: 1px solid rgba(239, 68, 68, 0.22);
}

@media (max-width: 520px) {
    .auth-card { padding: 30px 24px 27px; }
}

/* ==================== 首页横幅 ==================== */
.hero-banner {
    background: var(--gradient-brand);
    color: white;
    padding: 40px 36px;
    border-radius: var(--radius-xl);
    margin-bottom: 32px;
    box-shadow: var(--shadow-brand);
    position: relative;
    overflow: hidden;
}

.hero-banner::before,
.hero-banner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.hero-banner::before {
    width: 320px;
    height: 320px;
    top: -120px;
    right: -100px;
}

.hero-banner::after {
    width: 200px;
    height: 200px;
    bottom: -60px;
    left: -50px;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 16px;
}

.dot-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dot-online);
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.hero-banner h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -1px;
    line-height: 1.1;
}

.hero-banner p {
    font-size: 16px;
    opacity: 0.85;
    margin-bottom: 28px;
    font-weight: 400;
}

.hero-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-stat {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    padding: 14px 22px;
    border-radius: var(--radius-md);
    min-width: 150px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.hero-stat-label {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== 区块标题 ==================== */
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 32px 0 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--gradient-brand);
    border-radius: var(--radius-full);
}

/* ==================== 面包屑 ==================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 10px 16px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    width: fit-content;
}

.breadcrumb a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    color: var(--text-tertiary);
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 600;
}

/* ==================== 缓存状态栏 ==================== */
.cache-bar {
    background: var(--bg-surface);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

/* 作为数据源分类的总览汇总时，5 个指标横向均匀排列 */
.cache-bar.data-source-summary {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 14px 20px;
    margin-bottom: 16px;
}
.cache-bar.data-source-summary .cache-info {
    display: contents;
}

.cache-info {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    flex: 1;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.info-text {
    display: flex;
    flex-direction: column;
}

.pull-rules {
    margin-bottom: 24px;
}

.data-sources {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* ==================== 首页数据中心 ==================== */
.home-data-hub {
    margin: 8px 0 18px;
    padding: 24px 26px 20px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: linear-gradient(120deg, var(--bg-surface) 0%, var(--brand-soft) 165%);
    box-shadow: var(--shadow-sm);
}
.home-hub-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:22px; }
.home-hub-head h1 { margin:0; color:var(--text-primary); font-size:22px; letter-spacing:-.3px; }
.home-hub-head p { margin:7px 0 0; color:var(--text-secondary); font-size:13px; }
.home-hub-status { display:flex; align-items:center; gap:7px; color:var(--text-secondary); font-size:12px; white-space:nowrap; }
.home-hub-status span { width:8px; height:8px; border-radius:50%; background:var(--success); box-shadow:0 0 0 4px color-mix(in srgb, var(--success) 14%, transparent); }
/* BI 登录态过期：绿灯变红 */
.home-hub-status.error { color: var(--danger); font-weight:600; }
.home-hub-status.error span { background: var(--danger); box-shadow:0 0 0 4px color-mix(in srgb, var(--danger) 16%, transparent); }
.home-status-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; }
.home-status-item { display:flex; align-items:center; gap:11px; min-width:0; padding:13px 14px; border-radius:var(--radius-md); background:var(--bg-surface); border:1px solid var(--border-subtle); }
.home-status-icon { display:grid; flex:0 0 auto; place-items:center; width:32px; height:32px; border-radius:10px; color:var(--brand); background:var(--brand-soft); font-size:15px; font-weight:700; }
.home-status-item div { min-width:0; display:flex; flex-direction:column; gap:2px; }
.home-status-item span:not(.home-status-icon) { color:var(--text-tertiary); font-size:11px; }
.home-status-item strong { color:var(--text-primary); font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home-workspaces { margin-bottom:28px; }
.home-workspaces .data-source-card { padding:18px 20px; }
.home-card-desc { min-height:36px; margin:0 0 12px; color:var(--text-secondary); font-size:13px; line-height:1.6; }
.home-card-links { display:flex; gap:16px; padding-bottom:12px; }
.home-card-links a { color:var(--brand); font-size:12px; font-weight:600; text-decoration:none; }
.home-card-links a:hover { text-decoration:underline; }

.account-settings-card {
    margin: 0 0 28px;
    padding: 20px 22px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
}
.account-settings-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:16px; }
.account-settings-head h2 { margin:0; color:var(--text-primary); font-size:17px; }
.account-settings-head p { margin:5px 0 0; color:var(--text-tertiary); font-size:12px; }
.account-role-badge { padding:5px 10px; border-radius:var(--radius-full); color:var(--text-secondary); background:var(--bg-subtle); border:1px solid var(--border-subtle); font-size:11px; font-weight:700; }
.account-role-badge.is-admin { color:var(--brand); background:var(--brand-soft); border-color:color-mix(in srgb, var(--brand) 24%, var(--border-subtle)); }
.account-settings-grid { display:grid; grid-template-columns:1fr 1.35fr; gap:14px; }
.account-setting-panel { min-width:0; padding:16px; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--bg-subtle); }
.account-setting-title { display:flex; align-items:flex-start; gap:10px; margin-bottom:15px; }
.account-setting-title h3 { margin:0; color:var(--text-primary); font-size:14px; }
.account-setting-title p { margin:3px 0 0; color:var(--text-tertiary); font-size:11px; }
.account-setting-icon { display:grid; flex:0 0 auto; place-items:center; width:32px; height:32px; border-radius:10px; background:var(--brand-soft); }
.account-registration-row { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:44px; padding:10px 12px; border-radius:var(--radius-md); background:var(--bg-surface); border:1px solid var(--border-subtle); }
.account-registration-row > div { display:flex; min-width:0; flex-direction:column; gap:2px; }
.account-registration-row strong { color:var(--text-primary); font-size:13px; }
.account-registration-row span { color:var(--text-tertiary); font-size:11px; }
.account-switch { position:relative; display:inline-flex; flex:0 0 auto; width:42px; height:24px; cursor:pointer; }
.account-switch input { width:0; height:0; opacity:0; }
.account-switch span { position:absolute; inset:0; border-radius:var(--radius-full); background:var(--border-default); transition:background var(--transition), opacity var(--transition); }
.account-switch span::after { content:''; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:var(--shadow-sm); transition:transform var(--transition); }
.account-switch input:checked + span { background:var(--success); }
.account-switch input:checked + span::after { transform:translateX(18px); }
.account-switch input:disabled + span { opacity:.48; cursor:not-allowed; }
.account-password-form { display:grid; grid-template-columns:repeat(3, minmax(120px, 1fr)) auto; gap:8px; }
.account-password-form input { min-width:0; height:36px; padding:0 10px; border:1px solid var(--border-default); border-radius:var(--radius-sm); outline:none; color:var(--text-primary); background:var(--bg-surface); font-family:inherit; font-size:12px; }
.account-password-form input:focus { border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft); }
.account-message { min-height:18px; margin-top:8px; color:var(--text-tertiary); font-size:11px; }
.account-message.success { color:var(--success); }
.account-message.error { color:var(--danger); }
.account-message.info { color:var(--brand); }
.account-members-panel { margin-top:16px; padding-top:16px; border-top:1px solid var(--border-subtle); }
.account-members-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:12px; }
.account-members-head h3 { margin:0; color:var(--text-primary); font-size:14px; }
.account-members-head p { margin:4px 0 0; color:var(--text-tertiary); font-size:11px; }
.account-member-count { flex:0 0 auto; padding:5px 10px; border-radius:var(--radius-full); color:var(--brand); background:var(--brand-soft); font-size:11px; font-weight:700; }
.account-members-table-wrap { overflow-x:auto; border:1px solid var(--border-subtle); border-radius:var(--radius-md); }
.account-members-table { width:100%; min-width:720px; border-collapse:collapse; background:var(--bg-surface); font-size:12px; }
.account-members-table th,
.account-members-table td { padding:11px 14px; border-bottom:1px solid var(--border-subtle); text-align:left; white-space:nowrap; }
.account-members-table th { color:var(--text-tertiary); background:var(--bg-subtle); font-size:11px; font-weight:600; }
.account-members-table td { color:var(--text-secondary); }
.account-members-table tbody tr:last-child td { border-bottom:0; }
.account-members-table tbody tr:hover td { background:color-mix(in srgb, var(--brand-soft) 42%, var(--bg-surface)); }
.account-member-name { color:var(--text-primary) !important; font-weight:700; }
.account-member-username { font-family:ui-monospace, SFMono-Regular, Consolas, monospace; }
.account-table-badge { display:inline-flex; align-items:center; min-height:22px; padding:2px 8px; border-radius:var(--radius-full); font-size:10px; font-weight:700; }
.account-table-badge.is-admin { color:var(--brand); background:var(--brand-soft); }
.account-table-badge.is-member { color:var(--text-secondary); background:var(--bg-subtle); border:1px solid var(--border-subtle); }
.account-table-badge.is-active { color:var(--success); background:color-mix(in srgb, var(--success) 12%, transparent); }
.account-table-badge.is-disabled { color:var(--danger); background:color-mix(in srgb, var(--danger) 12%, transparent); }
.account-members-empty { padding:24px !important; color:var(--text-tertiary) !important; text-align:center !important; }
.account-members-empty.is-error { color:var(--danger) !important; }
.account-login-logs-panel { margin-top:16px; padding-top:16px; border-top:1px solid var(--border-subtle); }
.account-login-log-actions { display:flex; align-items:center; gap:8px; }
.account-login-logs-table { min-width:760px; }
.account-login-logs-table td:nth-child(3) { display:flex; align-items:center; gap:7px; }
.account-login-reason { color:var(--text-tertiary); font-size:10px; }
/* 760~860px 之间：密码表单 3×120px + 按钮排不下，会把「修改密码」按钮挤出屏幕
   （实测 760px 溢出 32px），所以提前折成一列布局 */
@media (max-width: 880px) {
    .account-settings-grid { grid-template-columns: 1fr; }
    .account-password-form { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
}
@media (max-width: 640px) {
    .account-password-form { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .home-data-hub { padding:18px; }
    .home-hub-head { flex-direction:column; }
    .home-status-grid { grid-template-columns:1fr; }
    .account-settings-grid { grid-template-columns:1fr; }
    .account-password-form { grid-template-columns:1fr; }
    .account-members-head { align-items:center; }
    .account-login-log-actions { align-items:flex-end; flex-direction:column; }
}

/* 综合交付看板：左侧悬浮卡片定位 */
.floating-section-nav {
    position: fixed;
    z-index: 30;
    left: 14px;
    top: 50%;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 7px;
    transform: translateY(-50%);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
}
.floating-section-nav a {
    position: relative;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    color: var(--text-secondary);
    font-size: 15px;
    text-decoration: none;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}
.floating-section-nav a:hover { color: var(--brand); background: var(--brand-soft); transform: translateX(1px); }
.floating-section-nav a::after {
    content: attr(data-label);
    position: absolute;
    left: 42px;
    top: 50%;
    padding: 6px 9px;
    border-radius: 7px;
    color: var(--tooltip-fg);
    background: var(--tooltip-bg);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(-5px, -50%);
    transition: opacity var(--transition), transform var(--transition);
}
.floating-section-nav a:hover::after { opacity: 1; transform: translate(0, -50%); }
@media (max-width: 1100px) { .floating-section-nav { display: none; } }

/* 页面内锚点跳转（悬浮导航、目录链接等）统一给吸顶顶栏留出偏移。
   顶栏 position:sticky 高 64px，不设偏移时目标会顶到 y=0，
   标题被压在顶栏下面看不见（实测 titleTop=21~41 < 65）。 */
[id] { scroll-margin-top: 84px; }
@media (max-width: 720px) { [id] { scroll-margin-top: 74px; } }

.data-source-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.data-source-card.active {
    border-left: 4px solid var(--brand);
}

.data-source-card.pending {
    opacity: 0.65;
}

.ds-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
    flex-wrap: wrap;
}

.ds-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ds-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.ds-badge.active {
    background: var(--brand-soft);
    color: var(--brand);
}

.ds-badge.pending {
    background: var(--bg-subtle);
    color: var(--text-tertiary);
}

.ds-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.ds-code {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    background: var(--bg-subtle);
    padding: 2px 6px;
    border-radius: 4px;
}

.ds-rules {
    display: grid;
    /* 四张卡片并排时每张只有 360~400px，两列会把「最新数据」挤成三四行，所以统一单列 */
    grid-template-columns: 1fr;
    gap: 6px 16px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
}

.ds-rules-empty {
    display: block;
    color: var(--text-tertiary);
    font-size: 12px;
}

.ds-rules-empty code {
    background: var(--bg-subtle);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: var(--font-mono);
}

.ds-rule {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 12px;
    line-height: 1.6;
}

.ds-rule-icon {
    font-size: 14px;
}

.ds-rule-label {
    color: var(--text-tertiary);
    font-weight: 600;
    white-space: nowrap;
}

.ds-rule-value {
    color: var(--text-secondary);
    min-width: 0;
    overflow-wrap: break-word;
}

/* 拉取异常等需要一眼看到的提示 */
.ds-rule-value.warn {
    color: var(--tag-warning-strong, #d97706);
    font-weight: 650;
}

/* 四张数据源卡片统一：标题右侧的手动操作区（231 卡片带一个补数日期） */
.ds-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ds-date-input {
    width: 132px;
    padding: 3px 6px;
    font-size: 12px;
}
.ds-pull {
    white-space: nowrap;
}

/* 好服务名单卡片：名单太长，默认收起，只留「最新名单 / 对比上次」两行摘要 */
.ds-collapse {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: color 120ms, border-color 120ms, transform 120ms;
}
.ds-collapse:hover {
    color: var(--brand);
    border-color: var(--brand);
}
.data-source-card:not(.is-collapsed) .ds-collapse {
    transform: rotate(180deg);
}
.data-source-card.is-collapsed .gs-collapsible {
    display: none;
}
.data-source-card.is-collapsed #gsStatus,
.data-source-card.is-collapsed #gsWarn {
    display: none !important;
}

/* ==================== 多选下拉（multi-select.js）====================
   外观对齐日期选择器 .od-dr-input：同样的边框/圆角/内边距/hover，
   面板用卡片样式 + 勾选项，替掉原生 <select multiple> 那个又矮又丑的列表框。 */
.ms-select {
    position: relative;
    display: inline-flex;
    min-width: 140px;
    max-width: 100%;
    vertical-align: middle;
}
.ms-select > select.ms-hidden {
    display: none;
}
.ms-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-primary);
    transition: border-color 120ms, box-shadow 120ms;
}
.ms-trigger:hover {
    border-color: var(--brand);
}
.ms-select.open .ms-trigger {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.ms-display {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ms-display.ms-placeholder {
    color: var(--text-tertiary);
}
.ms-caret {
    flex: 0 0 auto;
    color: var(--text-tertiary);
    font-size: 12px;
    transition: transform 120ms;
}
.ms-select.open .ms-caret {
    transform: rotate(180deg);
}
.ms-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1001;
    min-width: 100%;
    max-height: 300px;
    overflow-y: auto;
    padding: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    text-align: left;
}
.ms-select.open .ms-panel {
    display: block;
}
/* 面板内的选项搜索框（选项 >= 10 个时才出现） */
.ms-search {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 2px 0 6px;
    padding: 6px 9px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background: var(--bg-base);
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.4;
}
.ms-search::placeholder {
    color: var(--text-tertiary);
}
.ms-search:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-soft);
}
.ms-empty {
    display: block;
    padding: 10px 8px;
    color: var(--text-tertiary);
    font-size: 12px;
    text-align: center;
}

/* 表格页成图用：标题 + 当前筛选摘要（会出现在导出的图里） */
.od-snapshot-head {
    margin: 4px 0 10px;
    padding: 10px 12px;
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-base);
}
.od-snapshot-head h3 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
}
.od-snapshot-sub {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-tertiary);
    word-break: break-word;
}
/* 靠近视口底部时向上弹（multi-select.js 会加 .ms-up） */
.ms-select.ms-up .ms-panel {
    top: auto;
    bottom: calc(100% + 6px);
}
.ms-options {
    display: block;
}
.ms-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
}
.ms-option:hover {
    background: var(--bg-hover);
}
/* 勾选框：不用 <input>（会成为外层 label 的标注控件），用 span 画 */
.ms-box {
    flex: 0 0 auto;
    position: relative;
    width: 15px;
    height: 15px;
    border: 1.5px solid var(--border-default);
    border-radius: 4px;
    background: var(--bg-surface);
    transition: background-color 100ms, border-color 100ms;
}
.ms-option:hover .ms-box {
    border-color: var(--brand);
}
.ms-option[data-on="1"] .ms-box {
    background: var(--brand);
    border-color: var(--brand);
}
.ms-option[data-on="1"] .ms-box::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.ms-option-all {
    margin-bottom: 5px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0;
    color: var(--text-tertiary);
}
.ms-option-all:hover {
    background: transparent;
    color: var(--brand);
}
.od-dr-input-sm + .ms-select,
.ms-select + .ms-select {
    margin-left: 0;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.employee-ranking {
    margin-bottom: 24px;
}
/* 员工排名包装为 chart-box 后，标题 h3 沿用原 h2.section-title 视觉 */
.employee-ranking .chart-header .emp-title {
    font-size: 18px;
    color: var(--brand);
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    margin: 0;
}

.employee-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.emp-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.emp-total {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-left: auto;
}

.employee-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

.employee-table th,
.employee-table td {
    padding: 10px 14px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--border-subtle);
}

.employee-table th {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 11px;
    white-space: nowrap;
}

.employee-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color var(--transition);
}

.employee-table th.sortable:hover {
    color: var(--brand);
}

.employee-table th.sorted-asc::after {
    content: ' ↑';
    color: var(--brand);
}

.employee-table th.sorted-desc::after {
    content: ' ↓';
    color: var(--brand);
}

.employee-table td {
    color: var(--text-primary);
}

.employee-table .rate-cell {
    font-weight: 600;
    color: var(--brand);
}

.employee-table .empty {
    text-align: center;
    color: var(--text-tertiary);
    padding: 24px;
}

/* 合计与人员行共用同一张表，固定在外层滚动区底部。 */
#empTable {
    overflow: visible;
    border-collapse: separate;
    border-spacing: 0;
}

#empFoot > tr > th,
#empFoot > tr > td {
    position: sticky;
    bottom: 0;
    z-index: 7;
    background: var(--bg-subtle);
    border-top: 2px solid var(--brand);
    border-bottom: 0;
    box-shadow: 0 -3px 6px rgba(0, 0, 0, 0.04);
    font-weight: 700;
}

#empFoot .employee-total-label {
    color: var(--brand);
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
}

/* 员工排名：按需显示 662 员工天指标大类 */
.emp-metric-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12px;
}

.emp-metric-filter-label {
    color: var(--text-tertiary);
    font-weight: 600;
}

.emp-metric-picker {
    position: relative;
    display: inline-flex;
}

.emp-metric-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 132px;
    height: 32px;
    cursor: pointer;
}

.emp-metric-panel {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 6px);
    right: 0;
    display: none;
    grid-template-columns: repeat(2, minmax(145px, 1fr));
    width: min(330px, calc(100vw - 32px));
    /* 缩放/小屏时不能无限长：限高 + 内部滚动，避免盖住下面的筛选控件或跑出屏幕 */
    max-height: min(56vh, 340px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    background: var(--bg-surface);
}

/* 下方空间不够时向上弹（report.html 打开时判断） */
.emp-metric-picker.open-up .emp-metric-panel {
    top: auto;
    bottom: calc(100% + 6px);
}

/* 打开时让面板以 .chart-header 为参照（.emp-metric-picker 变成 static），
   这样它落在整个筛选行下面，而不是从触发器往左压住组别/游戏/好服务等选择框 */
.emp-metric-picker.open {
    position: static;
}

.emp-metric-picker.open .emp-metric-panel {
    display: grid;
}

.emp-metric-panel label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 8px;
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.emp-metric-panel label:hover {
    background: var(--bg-hover);
}

.emp-metric-panel > small {
    grid-column: 1 / -1;
    padding: 7px 8px 2px;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-tertiary);
    line-height: 1.45;
}

.employee-table .emp-metric-heading {
    min-width: 235px;
    text-align: center;
    vertical-align: middle;
}

.emp-metric-heading-label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.emp-metric-sort-field {
    display: block;
    width: 100%;
    min-width: 150px;
    height: 27px;
    padding: 2px 24px 2px 7px;
    border: 1px solid var(--border-subtle);
    border-radius: 5px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}

.emp-metric-heading.sorted-asc .emp-metric-heading-label,
.emp-metric-heading.sorted-desc .emp-metric-heading-label {
    color: var(--brand);
}

.employee-table .emp-metric-cell {
    min-width: 235px;
    padding: 7px 10px;
    vertical-align: top;
}

.emp-metric-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(92px, 1fr));
    gap: 5px 10px;
}

.emp-metric-item {
    min-width: 0;
}

.emp-metric-item small,
.emp-metric-item b {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.emp-metric-item small {
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 500;
}

.emp-metric-item b {
    margin-top: 1px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 650;
}

/* ==================== BI 交叉表 ==================== */
.cross-tab-table {
    width: 100%;
    min-width: 960px;
    border-collapse: collapse;
    background: var(--bg-surface);
    font-size: 12px;
}

.cross-tab-table th,
.cross-tab-table td {
    padding: 8px 10px;
    border: 1px solid var(--border-subtle);
    text-align: center;
    white-space: nowrap;
}

.cross-tab-table thead th {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
}

.cross-tab-table th.ct-group {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
    font-size: 12px;
}

.cross-tab-table th.ct-metric {
    font-weight: 600;
}

.cross-tab-table th.ct-rowhead {
    text-align: left;
    background: var(--bg-subtle);
    color: var(--text-primary);
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 1;
}

.cross-tab-table tbody tr:nth-child(even) td,
.cross-tab-table tbody tr:nth-child(even) th.ct-rowhead {
    background: var(--bg-hover);
}

.cross-tab-table td.ct-num {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.cross-tab-table td.ct-rate {
    color: var(--brand);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.cross-tab-table tfoot th,
.cross-tab-table tfoot td {
    background: var(--bg-subtle);
    border-top: 2px solid var(--border-default);
    font-weight: 700;
    color: var(--text-primary);
}

.cross-tab-table tfoot td.ct-rate {
    color: var(--brand);
}

/* 日期A/B 对比列（暖色区分） */
.cross-tab-table th.ct-cmp {
    background: var(--warning-soft);
    color: var(--warning);
}
.cross-tab-table td.ct-cmp {
    background: var(--warning-soft);
}
.cross-tab-table td.ct-cmp.ct-rate {
    color: var(--tag-warning-fg);
}

/* ==================== 四小组对比表 ==================== */
.group-tab-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
    font-size: 13px;
}

.group-tab-table th,
.group-tab-table td {
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    text-align: center;
    white-space: nowrap;
}

.group-tab-table thead th {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
    font-size: 12px;
}

.group-tab-table tbody th {
    text-align: left;
    background: var(--bg-subtle);
    color: var(--text-primary);
    font-weight: 600;
}

.group-tab-table tbody tr:nth-child(even) td {
    background: var(--bg-hover);
}

.group-tab-table td.gt-num {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.group-tab-table td.gt-rate {
    color: var(--brand);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.group-tab-table tfoot th,
.group-tab-table tfoot td {
    background: var(--bg-subtle);
    border-top: 2px solid var(--border-default);
    font-weight: 700;
    color: var(--text-primary);
}

.group-tab-table tfoot td.gt-rate {
    color: var(--brand);
}

/* ==================== 游戏分类管理 ==================== */
.category-page {
    margin-bottom: 24px;
}
.category-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.cat-group-tabs {
    display: inline-flex;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
}
.cat-group-tabs button {
    background: transparent;
    border: none;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    margin: 0;
}
.cat-group-tabs button:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}
.cat-group-tabs button.active {
    background: var(--brand);
    color: var(--text-on-brand);
}
.category-group-section {
    margin-bottom: 14px;
}
.category-group-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 6px;
}
.category-games {
    margin-bottom: 16px;
}
.category-games-label {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 8px;
}
.category-game-tools {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.category-game-tools .filter-input { flex: 1; min-width: 160px; }
.category-game-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px 14px;
    padding: 10px 12px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
}
.category-game-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.category-game-check .vol {
    color: var(--text-tertiary);
    font-size: 11px;
    margin-left: auto;
    flex-shrink: 0;
}
.category-list {
    display: grid;
    gap: 10px;
}
.category-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}
.category-item-name {
    font-weight: 600;
    color: var(--text-primary);
}
.category-item-games {
    color: var(--text-secondary);
    font-size: 13px;
}
.category-item-actions {
    display: inline-flex;
    gap: 8px;
}

/* ==================== 人员表 ==================== */
.personnel-page {
    margin-bottom: 24px;
}

.personnel-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.personnel-search {
    width: min(320px, 100%);
}

.personnel-low-order-note {
    color: var(--tag-warning-deep);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.personnel-recent-hire-note {
    color: var(--tag-purple-fg);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.personnel-exclusion-card {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 12px 20px;
    align-items: center;
    margin: 0 0 14px;
    padding: 14px 16px;
    border: 1px solid var(--tag-accent-border);
    border-radius: var(--radius-lg);
    background: var(--tag-accent-surface);
}

.personnel-exclusion-copy h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
}

.personnel-exclusion-copy h3 span {
    color: var(--brand);
    font-size: 11px;
    font-weight: 600;
}

.personnel-exclusion-copy p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.personnel-exclusion-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.personnel-exclusion-form .filter-input {
    min-width: 175px;
}

.personnel-exclusion-list {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.personnel-exclusion-empty {
    color: var(--text-tertiary);
    font-size: 12px;
}

.personnel-exclusion-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 7px 4px 9px;
    border: 1px solid var(--tag-accent-border);
    border-radius: 999px;
    background: var(--bg-surface);
    color: var(--tag-accent-strong);
    font-size: 12px;
}

.personnel-exclusion-chip button {
    width: 17px;
    height: 17px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--tag-accent-bg);
    color: var(--tag-accent-fg);
    font-size: 15px;
    line-height: 15px;
    cursor: pointer;
}

.personnel-exclusion-chip button:hover {
    background: var(--tag-accent-border);
}

.personnel-groups {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 1000px) {
    .personnel-groups {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .personnel-groups {
        grid-template-columns: 1fr;
    }
}

/* 排除名单卡片：两列网格（minmax(260px,1fr) + 表单 auto）在视口约 575px 以下
   就会撑破屏幕，这里提前折成一列，输入框也放开 min-width 改成自适应。 */
@media (max-width: 640px) {
    .personnel-exclusion-card {
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: stretch;
    }
    .personnel-exclusion-form {
        width: 100%;
    }
    .personnel-exclusion-form .filter-input {
        min-width: 0;
        flex: 1 1 auto;
    }
}

.personnel-group {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.personnel-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 13px 16px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.personnel-group-header:hover {
    background: var(--bg-subtle);
}

.personnel-group.is-open .personnel-group-header {
    border-bottom: 1px solid var(--border-subtle);
}

.personnel-group-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.personnel-group-count {
    font-size: 12px;
    color: var(--text-tertiary);
}

.personnel-group-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.personnel-group-chevron {
    color: var(--text-tertiary);
    font-size: 20px;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform var(--transition);
}

.personnel-group.is-open .personnel-group-chevron {
    transform: rotate(90deg);
}

.personnel-list {
    display: none;
    flex-direction: column;
    gap: 6px;
    max-height: 420px;
    overflow-y: auto;
    padding: 10px 12px 12px;
}

.personnel-group.is-open .personnel-list {
    display: flex;
}

.personnel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-md);
    transition: background var(--transition);
    flex-wrap: wrap;
}

.personnel-row:hover {
    background: var(--bg-subtle);
}

.personnel-name {
    font-size: 13px;
    color: var(--text-primary);
    min-width: 70px;
    flex-shrink: 0;
}

.personnel-name.is-low-month-deals {
    color: var(--tag-warning-strong);
    font-weight: 700;
}

.personnel-name.is-recent-hire {
    color: var(--tag-purple-fg);
    font-weight: 700;
}

.personnel-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 12px;
    user-select: none;
}

.personnel-check input {
    accent-color: var(--brand);
    cursor: pointer;
}

.personnel-date {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.personnel-date.is-departed {
    color: var(--tag-danger-strong);
}

/* 徽章 */
.badge {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}

.badge.hidden {
    background: var(--tag-danger-bg);
    color: var(--tag-danger-fg);
}

.badge.new {
    background: var(--tag-info-bg);
    color: var(--tag-info-fg);
}

.badge.excluded {
    background: var(--tag-accent-bg);
    color: var(--tag-accent-fg);
}

.badge.good {
    background: var(--tag-success-bg);
    color: var(--tag-success-fg);
}

.emp-badge {
    display: inline-block;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 600;
    margin-left: 4px;
    white-space: nowrap;
}

.emp-badge.new {
    background: var(--tag-info-bg);
    color: var(--tag-info-fg);
}

.emp-badge.good {
    background: var(--tag-success-bg);
    color: var(--tag-success-fg);
}

/* 售中订单归属多选下拉 */
.emp-guishu-filter {
    /* 与其它筛选框保持行布局：标签在左，下拉按钮在右 */
    gap: 6px;
    align-items: center;
}

.emp-filter-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 600;
    white-space: nowrap;
}

.guishu-dropdown {
    position: relative;
    display: inline-block;
}

.guishu-btn {
    padding: 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    min-width: 160px;
    text-align: left;
    transition: all var(--transition);
}

.guishu-btn:hover {
    border-color: var(--brand);
}

.guishu-panel {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 8px;
    z-index: 100;
    min-width: 200px;
    max-height: 260px;
    overflow-y: auto;
}

.guishu-check {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
}

.guishu-check:hover {
    background: var(--bg-subtle);
}

.guishu-check input {
    accent-color: var(--brand);
    cursor: pointer;
}

.game-panel {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 8px;
    z-index: 101;
    min-width: 240px;
    max-width: 320px;
}

.game-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.game-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
}

.game-list-item:hover {
    background: var(--bg-hover);
}

.game-list-item.selected {
    background: var(--brand-soft);
    color: var(--brand);
}

.game-list-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-list-vol {
    color: var(--text-tertiary);
    font-size: 11px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.pull-rules .section-title {
    margin-top: 0;
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    background: var(--bg-surface);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: background var(--transition);
}

.rule-item:hover {
    background: var(--bg-subtle);
}

.rule-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.rule-text {
    flex: 1;
    min-width: 0;
}

.rule-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.rule-value {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

.info-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}

.cache-actions {
    display: flex;
    gap: 8px;
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-default);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.btn-primary:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    box-shadow: var(--shadow-brand);
}

.btn-secondary {
    background: var(--bg-surface);
}

/* ==================== 报表卡片 ==================== */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.report-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 0;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: relative;
}

.report-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-brand);
    opacity: 0;
    transition: opacity var(--transition);
}

.report-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-light);
}

.report-card:hover::before {
    opacity: 1;
}

.report-card.priority-high::before {
    background: var(--gradient-warm);
    opacity: 1;
}

.report-card.priority-low::before {
    background: var(--gradient-muted);
    opacity: 1;
}

.report-card-header {
    padding: 20px 20px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.report-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.report-meta {
    padding: 0 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.meta-icon {
    width: 16px;
    text-align: center;
    color: var(--text-tertiary);
}

.meta-value {
    color: var(--text-primary);
    font-weight: 500;
}

.report-cache {
    padding: 12px 20px;
    background: var(--bg-subtle);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-subtle);
}

.cache-label {
    color: var(--text-tertiary);
}

.cache-value {
    color: var(--brand);
    font-weight: 600;
}

.cache-remain {
    color: var(--success);
    margin-left: auto;
    font-weight: 500;
}

.report-footer {
    padding: 14px 20px;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
}

.report-link {
    color: var(--brand);
    font-size: 13px;
    font-weight: 600;
    transition: gap var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.report-card:hover .report-link {
    gap: 8px;
}

/* ==================== 优先级徽章 ==================== */
.priority-badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.priority-badge.priority-high {
    background: var(--danger-soft);
    color: var(--danger);
}

.priority-badge.priority-normal {
    background: var(--brand-soft);
    color: var(--brand);
}

.priority-badge.priority-low {
    background: var(--bg-hover);
    color: var(--text-tertiary);
}

/* ==================== 维度切换 ==================== */
.dimension-bar {
    background: var(--bg-surface);
    padding: 6px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

.dim-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 0 12px;
}

.dim-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
}

.dim-tab {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition);
}

.dim-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dim-tab.active {
    background: var(--gradient-brand);
    color: white;
    box-shadow: var(--shadow-brand);
}

/* ==================== 指标卡 ==================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metric-card {
    background: var(--bg-surface);
    padding: 22px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    transition: all var(--transition);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-brand);
}

.metric-card:nth-child(1)::before { background: var(--gradient-brand); }
.metric-card:nth-child(2)::before { background: var(--gradient-success); }
.metric-card:nth-child(3)::before { background: var(--gradient-warm); }
.metric-card:nth-child(4)::before { background: var(--gradient-cyan); }

.metric-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.metric-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}

.metric-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.1;
    font-family: var(--font-mono);
}

.metric-sub {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== 订单概览（筛选 + 指标 + 趋势） ==================== */
.order-overview {
    margin-bottom: 16px;
}

.order-overview-title {
    padding-bottom: 10px;
}

.order-overview-title h3 {
    color: var(--text-primary);
    font-size: 16px;
}

.order-overview-filters {
    padding: 10px 0 14px;
    margin: 0 0 14px;
    border: 0;
    border-radius: 0;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: none;
    background: transparent;
    gap: 12px;
}

.order-overview-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.order-overview-metrics .metric-card {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    box-shadow: none;
}

.order-overview-metrics .metric-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

.order-overview-metrics .metric-icon {
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    font-size: 14px;
}

.order-overview-metrics .metric-label {
    margin-bottom: 5px;
    font-size: 11px;
}

.order-overview-metrics .metric-value {
    font-size: 25px;
}

.order-overview-metrics .metric-sub {
    margin-top: 2px;
    font-size: 10px;
}

.order-overview-trend {
    padding-top: 2px;
}

/* 员工 A/B 对比：与 BI 表格一致，差异正负一眼可辨 */
.employee-table th small {
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 500;
}

.employee-table .emp-rate-up { color: var(--tag-success-strong); font-weight: 700; }
.employee-table .emp-rate-down { color: var(--tag-danger-strong); font-weight: 700; }
.employee-table .emp-rate-flat { color: var(--text-tertiary); font-weight: 600; }

/* 员工排名：展开游戏明细 */
.employee-game-trigger { padding: 0; border: 0; background: transparent; color: var(--brand); font: inherit; font-weight: 650; cursor: pointer; }
.employee-game-trigger:hover { text-decoration: underline; }
.report-employee-detail td { padding: 0 !important; background: var(--bg-base); }
.report-employee-games { padding: 14px 16px 18px; }
.report-employee-games h4 { margin: 14px 0 8px; font-size: 12px; color: var(--text-secondary); }
.report-employee-game-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.report-employee-game { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; background: var(--bg-surface); margin-top: 10px; }
.report-employee-game-list .report-employee-game { margin-top: 0; }
.report-employee-game-summary { display: flex; flex-wrap: wrap; gap: 12px; padding: 9px 11px; font-size: 12px; color: var(--text-secondary); }
.report-employee-game-summary b { color: var(--text-primary); font-size: 13px; }
.report-employee-game table { width: 100%; border-collapse: collapse; font-size: 11px; }
.report-employee-game th, .report-employee-game td { padding: 6px 8px !important; border-top: 1px solid var(--border-subtle); text-align: right; background: transparent; }
.report-employee-game th:first-child, .report-employee-game td:first-child { text-align: left; }
@media (max-width: 1100px) { .report-employee-game-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .report-employee-game-list { grid-template-columns: 1fr; } }

/* 订单概览：每日趋势下的小组表现 */
.overview-group-breakdown { margin: 8px 12px 0; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
.overview-group-title { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--text-secondary); display: flex; align-items: center; gap: 10px; }

/* 小组表现的「全部 / 好服务」切换 */
.gs-switch { display: inline-flex; padding: 2px; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-base); }
.gs-switch-btn { padding: 3px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text-secondary); font-size: 12px; font-weight: 600; line-height: 18px; cursor: pointer; transition: background-color 120ms, color 120ms; }
.gs-switch-btn:hover { color: var(--brand); }
.gs-switch-btn.active { background: var(--bg-surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.gs-switch-hint { font-size: 11px; font-weight: 500; color: var(--brand); }
.overview-group-empty { padding: 18px 4px; color: var(--text-tertiary); font-size: 12px; }
.overview-group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.overview-group-card { padding: 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-base); }
.overview-group-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.overview-group-rate { min-width: 112px; }
.overview-group-name { display: block; color: var(--text-primary); font-size: 13px; font-weight: 700; }
/* 完结率：字号收小 + 禁止换行。
   卡片是 auto-fit minmax(220px,1fr)，一排放 5 个组时每张只有约 220px，
   右侧「满意度/客诉」又占 min-width:144px，22px 的数字加上「完结率」
   会被挤到放不下，把「率」折到下一行。 */
.overview-group-rate > strong {
    display: block;
    margin: 6px 0 9px;
    color: var(--text-primary);
    font-size: 19px;
    line-height: 1.15;
    white-space: nowrap;
}
.overview-group-rate > strong small { margin-left: 3px; color: var(--text-secondary); font-size: 10px; font-weight: 500; }
.overview-group-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.overview-group-summary span { color: var(--text-tertiary); font-size: 10px; }
.overview-group-summary i { display: block; margin-top: 3px; color: var(--text-primary); font-size: 13px; font-style: normal; font-weight: 650; }
.overview-group-service { display: grid; grid-template-columns: repeat(2, minmax(62px, 1fr)); gap: 10px; min-width: 144px; padding: 3px 0 0 12px; border-left: 1px solid var(--border-subtle); }
.overview-group-service span { display: block; color: var(--text-tertiary); font-size: 10px; white-space: nowrap; }
.overview-group-service b { display: block; margin-top: 4px; color: var(--text-primary); font-size: 15px; line-height: 1.1; }
.overview-group-service b em { margin-left: 2px; color: var(--text-secondary); font-size: 10px; font-style: normal; font-weight: 500; }
.overview-group-service small { display: block; margin-top: 3px; color: var(--text-tertiary); font-size: 9px; }
.overview-group-title .btn { margin-left: 6px; vertical-align:middle; }
.overview-group-card > .overview-group-daily { display: none; margin-top: 12px; border-top: 1px solid var(--border-subtle); padding-top: 8px; overflow-x: auto; }
.overview-group-card.expanded > .overview-group-daily { display: block; }
.overview-group-daily table { width: 100%; border-collapse: collapse; font-size: 11px; }
.overview-group-daily th, .overview-group-daily td { padding: 5px 4px; border-bottom: 1px solid var(--border-subtle); text-align: right; white-space: nowrap; }
.overview-group-daily th:first-child, .overview-group-daily td:first-child { text-align: left; }
@media (max-width: 580px) { .overview-group-top { flex-direction: column; } .overview-group-service { width: 100%; padding: 9px 0 0; border-top: 1px solid var(--border-subtle); border-left: 0; } }

/* 成交率波动游戏详情 */
.game-detail-trigger {
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-primary);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

.game-detail-trigger:hover { color: var(--brand); text-decoration: underline; }
.game-detail-row > td { padding: 0 !important; background: var(--bg-muted); }
.game-inline-detail { padding: 16px 20px 20px; border-top: 1px solid var(--border-subtle); }
.game-inline-title { color: var(--text-primary); font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.game-detail-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px 22px; }
.game-inline-detail .game-detail-summary { padding: 0 0 14px; }
.game-detail-summary > div { padding: 10px 12px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.game-detail-summary span { display: block; color: var(--text-tertiary); font-size: 11px; margin-bottom: 4px; }
.game-detail-summary b { color: var(--text-primary); font-family: var(--font-mono); font-size: 17px; }
.game-detail-table-wrap { max-height: 360px; margin: 0; background: var(--bg-surface); }
.game-detail-table td, .game-detail-table th { text-align: center; }
@media (max-width: 640px) { .game-inline-detail { padding: 12px; } .game-detail-summary { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 900px) {
    .order-overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .order-overview-filters > span:last-child { width: 100%; margin-left: 0 !important; }
}

/* ==================== 图表 ==================== */
.charts-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.chart-box {
    background: var(--bg-surface);
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

/* 相邻卡片统一留 16px 间距。
   以前 report.html 是逐个元素写 style="margin-bottom:16px" 拼出来的，
   交付对比页没写就变成紧贴（间距 0），页面之间不一致。 */
.chart-box + .chart-box,
.chart-box + .compare-overview-card,
.compare-overview-card + .chart-box {
    margin-top: 16px;
}

.chart-box.half {
    width: 50%;
}

.half-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.right-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 0;
    flex-wrap: wrap;
    padding-bottom: 12px;
    position: relative;   /* 扩展指标面板以此为定位参照，避免盖住同一行的筛选控件 */
}
.snapshot-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}
.snapshot-btn {
    margin-left: 0;
    flex-shrink: 0;
}

.chart-header h3 {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-toggle {
    display: inline-flex;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
}

.metric-toggle button {
    background: transparent;
    border: none;
    padding: 8px 24px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    margin: 0 8px;
}

.metric-toggle button:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.metric-toggle button.active {
    background: var(--brand);
    color: var(--text-on-brand);
}

.chart-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.chart-box h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart {
    width: 100%;
    height: 420px;
}

/* ==================== 成交率波动 TOP30 ==================== */
.fluctuation-wrapper {
    overflow-x: auto;
    overflow-y: visible;
}
.fluctuation-body {
    min-width: 100%;
}
.fluct-hint {
    color: var(--text-tertiary);
    font-size: 12px;
}
.fluct-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    background: var(--bg-surface);
    font-size: 12px;
    table-layout: fixed;
}
.fluct-table th,
.fluct-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border-subtle);
    text-align: center;
    vertical-align: middle;
}
.fluct-table thead th {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    /* 吸顶：表格可滚动（.table-wrap max-height:600px），
       滚到后面的游戏时日期表头始终可见 */
    position: sticky;
    top: 0;
    z-index: 5;
}
.fluct-table .fth-rank { width: 44px; }
.fluct-table .fth-game { width: 250px; text-align: left; }
.fluct-table .fth-chart { text-align: left; padding-left: 10px; padding-right: 10px; }
.fluct-table .fth-chart-title { font-size: 11px; }
.fluct-table .fth-date {
    font-weight: 400;
    color: var(--text-tertiary);
    font-size: 10px;
    padding: 2px;
}
.fluct-table .fth-date-hide {
    color: transparent;
}
.fluct-table tbody tr:hover {
    background: var(--bg-hover);
}
.fluct-table .ftd-rank {
    color: var(--text-tertiary);
    font-weight: 600;
    font-size: 13px;
}
.fluct-table .ftd-game {
    text-align: left;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.ftd-game-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}
.ftd-stats {
    color: var(--text-secondary);
    font-size: 11px;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}
.fluct-table .ftd-stats {
    color: var(--text-secondary);
    font-size: 11px;
    white-space: nowrap;
}
/* 与 .fth-chart 左右内边距保持一致，日期表头才能和曲线节点对齐 */
.fluct-table .ftd-chart {
    padding: 4px 10px;
}
.fluct-svg {
    width: 100%;
    height: 78px;
    display: block;
}
/* 曲线区块：HTML 标签叠加在 SVG 之上（SVG 横向拉伸，文字不能放里面） */
.fluct-spark {
    position: relative;
}
.fluct-spark .fluct-svg {
    position: relative;
    z-index: 0;
}
/* 日期表头（像表格列头一样，只在最上面一行） */
.fluct-dates-row {
    position: relative;
    height: 11px;
    margin-top: 3px;
}
.fluct-date {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 8px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    color: var(--text-tertiary);
    pointer-events: none;
}
/* 曲线上的完结率百分比：加底色「挖空」曲线，避免数字与线重合看不清 */
.fluct-text {
    position: absolute;
    transform: translate(-50%, -115%);
    font-size: 8px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    color: var(--text-primary);
    background: var(--bg-surface);
    padding: 0 1px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 2;
}
.emp-day-main {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}
.emp-day-sub {
    color: var(--text-tertiary);
    font-size: 10px;
    line-height: 1.2;
    margin-top: 1px;
}
/* .fluct-group-tag 已移除：组别由线条颜色区分，且页面已按交付组分页签 */
.fluct-date-range {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12px;
}
.fluct-date-range label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.fluct-tabs button {
    background: transparent;
    border: none;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    margin: 0;
}
.fluct-tabs button:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}
.fluct-tabs button.active {
    background: var(--brand);
    color: var(--text-on-brand);
}

@media (max-width: 900px) {
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; }
    .sidebar-nav { padding: 12px; }
    .main-content { padding: 16px; }
    .chart-box.half { width: 100%; }
    .half-row { grid-template-columns: 1fr; }
}

/* ==================== 数据筛选栏 ==================== */
.filter-bar {
    background: var(--bg-surface);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select,
.filter-input {
    padding: 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--bg-surface);
    color: var(--text-primary);
    min-width: 140px;
    transition: all var(--transition);
    outline: none;
    font-family: inherit;
}

.filter-input {
    font-family: var(--font-mono);
    min-width: 130px;
}

.filter-select:focus,
.filter-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--bg-surface);
    color: var(--text-primary);
    min-width: 140px;
    min-height: 37px;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition);
}

.filter-checkbox:hover {
    border-color: var(--brand);
}

.filter-checkbox input[type="checkbox"] {
    accent-color: var(--brand);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.filter-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    font-size: 13px;
    color: var(--text-secondary);
}

.filter-info strong {
    color: var(--brand);
    font-weight: 600;
}

/* ==================== 工具栏 ==================== */
.toolbar {
    background: var(--bg-surface);
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

.search-input,
.select {
    padding: 9px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: all var(--transition);
    outline: none;
    font-family: inherit;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.select {
    min-width: 140px;
    cursor: pointer;
}

.search-input:focus,
.select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.toolbar-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: auto;
    padding: 0 12px;
}

.toolbar-stats strong {
    color: var(--brand);
    font-weight: 700;
}

/* ==================== 表格 ==================== */
.table-wrap {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: auto;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
    max-height: 600px;
}

#dataTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#dataTable th {
    background: var(--bg-subtle);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 1;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#dataTable td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

#dataTable tbody tr {
    transition: background var(--transition);
}

#dataTable tbody tr:hover {
    background: var(--bg-subtle);
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    padding: 16px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    margin-top: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
}

.pagination button:hover:not(:disabled) {
    border-color: var(--brand);
    color: var(--brand);
}

.pagination button.active {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==================== 历史快照 ==================== */
.history-panel {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

.history-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.history-header h3 {
    margin: 0;
    flex: 1;
    font-size: 15px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-close {
    background: var(--bg-subtle);
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-tertiary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    line-height: 1;
    transition: all var(--transition);
}

.btn-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 4px;
    transition: background var(--transition);
}

.history-item:hover {
    background: var(--bg-subtle);
}

.history-item.status-error {
    background: var(--danger-soft);
}

.h-time { color: var(--text-primary); font-weight: 500; }
.h-rows { color: var(--text-secondary); }
.h-status { color: var(--success); font-weight: 600; }
.history-item.status-error .h-status { color: var(--danger); }
.h-duration { color: var(--text-tertiary); font-size: 12px; font-family: var(--font-mono); }

/* ==================== 通用 ==================== */
.loading, .empty, .error {
    padding: 48px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
}

.error {
    color: var(--danger);
}

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ==================== 动画 ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.report-card,
.cache-bar,
.metric-card,
.chart-box,
.toolbar,
.table-wrap,
.pagination,
.dimension-bar,
.history-panel,
.hero-banner {
    animation: fadeIn 0.4s ease-out;
}

.nav-item {
    animation: slideIn 0.3s ease-out;
}

.sidebar-brand {
    animation: fadeIn 0.5s ease-out;
}

/* ==================== 订单明细表页 ==================== */
.od-page .page-head {
    margin: 8px 0 20px;
}
.od-page .page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}
.od-page .page-sub {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

.od-filter-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}
/* 更多筛选折叠区：横跨整行，内部继续 4 列 grid */
.od-filter-more {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 10px 14px;
    padding-top: 12px;
    margin-top: 4px;
    border-top: 1px dashed var(--border-subtle);
}
.od-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.od-filter-group label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 600;
}
.od-filter-group .filter-input {
    min-width: 130px;
}
.od-range-sep {
    align-self: center;
    color: var(--text-tertiary);
    font-size: 12px;
    padding: 0 2px;
}
.od-filter-actions {
    grid-column: 2 / -1;
    flex-direction: row;
    gap: 8px;
    align-items: flex-end;
    justify-content: flex-start;
    flex-wrap: nowrap;
}
.od-filter-actions .btn {
    flex: 0 0 88px;
    width: 88px;
    height: 34px;
    min-height: 34px;
    padding: 5px 8px;
    justify-content: center;
    white-space: nowrap;
    line-height: 1;
}

/* 订单明细筛选栏原本固定 4 列 × minmax(160px,1fr)，最小要约 714px，
   窄屏会直接撑破页面。这里逐级降列，并把 160px 下限放开成 minmax(0,1fr)。 */
@media (max-width: 780px) {
    .od-filter-bar,
    .od-filter-more {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .od-filter-group .filter-input {
        min-width: 0;
    }
    .od-filter-actions {
        grid-column: 1 / -1;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .od-filter-bar,
    .od-filter-more {
        grid-template-columns: 1fr;
    }
    .od-filter-actions .btn {
        flex: 1 1 calc(50% - 4px);
        width: auto;
    }
}

/* 列选择器（分组折叠）*/
.od-col-picker {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}
.od-col-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.od-col-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.od-col-count {
    color: var(--text-tertiary);
    font-weight: normal;
    margin-left: 6px;
}
.od-col-count strong {
    color: var(--brand);
    font-weight: 700;
}
.od-col-toolbar-btns {
    display: flex;
    gap: 6px;
}
.od-col-groups {
    margin-top: 10px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 10px;
    max-height: 480px;
    overflow-y: auto;
}
.od-col-group {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    background: var(--bg-base);
}
.od-col-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    cursor: pointer;
    user-select: none;
}
.od-col-group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.od-col-group-tools {
    display: flex;
    gap: 4px;
}
.od-col-group-btn,
.od-col-group-foldbtn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.od-col-group-btn:hover,
.od-col-group-foldbtn:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand);
}
.od-col-group-foldbtn {
    font-size: 14px;
    padding: 0 8px;
    line-height: 1;
}
.od-col-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 4px 12px;
    padding: 8px 10px;
}
.od-col-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background 0.12s;
}
.od-col-check:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.od-col-check input {
    cursor: pointer;
    margin: 0;
}

/* 统计信息 */
.od-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* 明细表 */
.od-table-wrap {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: auto;
    max-height: 65vh;
    box-shadow: var(--shadow-sm);
}
.od-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 12px;
    white-space: nowrap;
}
.od-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-default);
    z-index: 2;
    text-align: left;
}
.od-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}
.od-table tbody tr:hover {
    background: var(--bg-hover);
}
.od-table .od-empty {
    text-align: center;
    color: var(--text-tertiary);
    padding: 40px;
}

/* 分页 */
.od-pager {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.od-pager-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-right: 6px;
}

/* ==================== 日期范围选择器（双月历）==================== */
.od-filter-group-date {
    position: relative;
}
.od-dr-input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    min-width: 230px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--text-primary);
    transition: border-color var(--transition);
}
.od-dr-input:hover {
    border-color: var(--brand);
}
.od-dr-icon {
    font-size: 14px;
    opacity: 0.7;
}

.od-dr-pop {
    position: absolute;
    z-index: 1000;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 12px 14px;
    font-family: var(--font-sans);
    min-width: 540px;
}
.od-dr-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 4px;
}
.od-dr-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    text-align: center;
}
.od-dr-nav {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}
.od-dr-nav:hover {
    background: var(--bg-hover);
    color: var(--brand);
}
.od-dr-cals {
    display: flex;
    gap: 16px;
}
.od-dr-cal {
    flex: 1;
    min-width: 220px;
}
.od-dr-cal-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 6px;
}
.od-dr-week, .od-dr-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.od-dr-week span {
    text-align: center;
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 600;
    padding: 4px 0;
}
.od-dr-day {
    text-align: center;
    padding: 6px 0;
    font-size: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    transition: background-color 100ms;
}
.od-dr-day:hover:not(.od-dr-day-off):not(.od-dr-day-prev) {
    background: var(--bg-hover);
}
.od-dr-day-prev {
    color: var(--text-tertiary);
    cursor: default;
}
.od-dr-day-off {
    color: var(--text-tertiary);
    opacity: 0.4;
    cursor: not-allowed;
}
.od-dr-day-today {
    border: 1px solid var(--brand);
}
.od-dr-day-in, .od-dr-day-pre {
    background: var(--brand-soft);
    color: var(--brand-dark);
}
.od-dr-day-start, .od-dr-day-end {
    background: var(--brand);
    color: var(--text-on-brand);
    font-weight: 600;
}
.od-dr-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}
.od-dr-from-input, .od-dr-to-input {
    flex: 1;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-primary);
    text-align: center;
}
.od-dr-sep {
    color: var(--text-tertiary);
    font-size: 12px;
}
.od-dr-foot button {
    min-width: 64px;
}
/* 小尺寸日期选择器（波动图/员工栏） */
.od-dr-input-sm {
    min-width: 150px;
    padding: 4px 8px;
    font-size: 12px;
}
.emp-filter-date {
    flex-wrap: wrap;
}

/* 月份选择器弹窗 */
.od-month-pop {
    min-width: 300px;
}
.od-month-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 4px 0;
}
.od-month-cell {
    text-align: center;
    padding: 10px 0;
    font-size: 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    transition: background-color 100ms, border-color 100ms;
}
.od-month-cell:hover:not(.od-month-cell-off) {
    background: var(--bg-hover);
    border-color: var(--brand);
}
.od-month-cell-off {
    color: var(--text-tertiary);
    opacity: 0.4;
    cursor: not-allowed;
}
.od-month-cell-sel {
    background: var(--brand);
    color: var(--text-on-brand);
    border-color: var(--brand);
    font-weight: 600;
}

/* ==================== 首屏数据加载指示 ==================== */
/* 数据接口要几秒才回来，空卡片容易被误认为「白屏/卡死」，这里给个持续可见的进度提示 */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
}
.page-loading.active {
    opacity: 1;
}
.page-loading-bar {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--brand), #06b6d4, transparent);
    animation: page-loading-slide 1.15s ease-in-out infinite;
}
@keyframes page-loading-slide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}
.page-loading-text {
    position: absolute;
    top: 72px;
    right: 16px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
    .page-loading-bar { animation-duration: 2.4s; }
}

