/* ============================================================
   全局样式 - 清新风响应式
   ============================================================ */
:root {
    --primary:   #4A90D9;
    --primary-d: #357ABD;
    --accent:    #5EC4A1;
    --bg:        #F4F7FB;
    --card-bg:   #FFFFFF;
    --text:      #2C3E50;
    --text-sub:  #7F8C9A;
    --border:    #E2EAF4;
    --danger:    #E74C3C;
    --warn:      #F39C12;
    --success:   #27AE60;
    --shadow:    0 2px 12px rgba(74,144,217,.12);
    --radius:    12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
                 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); }

/* ---- 顶部导航 ---- */
.topbar {
    background: var(--primary);
    color: #fff;
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(74,144,217,.3);
}
.topbar .logo { font-size: 17px; font-weight: 600; flex: 1; }
.topbar .nav-right { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.topbar .btn-logout {
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.4);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
}
.topbar .btn-logout:hover { background: rgba(255,255,255,.3); }

/* ---- 容器 ---- */
.container { max-width: 960px; margin: 0 auto; padding: 16px 12px; }

/* ---- 卡片 ---- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

/* ============================================================
   登录/注册页（深色驾驶舱风格 · 简洁大气）
   风格原则：深色底 · 居中留白 · 柔和细节 · 克制装饰
   ============================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: #0B1A2B;
}

/* 居中卡片：深色玻璃卡 + 柔和单层阴影 + 大圆角 */
.auth-box {
    width: 100%;
    max-width: 460px;
    background: linear-gradient(180deg, rgba(24,44,70,.88) 0%, rgba(15,29,47,.95) 100%);
    border: 1px solid rgba(90, 130, 180, 0.18);
    border-radius: 22px;
    padding: 52px 44px 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

/* Logo + 系统名 顶部 */
.brand-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 44px;
}
.brand-head .brand-logo {
    height: 36px;
    width: auto;
}
.brand-head h1 {
    font-size: 18px;
    font-weight: 600;
    color: #E6EEF8;
    letter-spacing: 1px;
    -webkit-text-stroke: 0;
    text-shadow: none;
    paint-order: stroke fill;
}

/* 欢迎语层级 */
.welcome-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #E6EEF8;
    margin-bottom: 10px;
    letter-spacing: .5px;
}
.welcome-sub {
    text-align: center;
    font-size: 14px;
    color: #8FA4C0;
    margin-bottom: 32px;
}

/* 表单（注册/登录通用） */
.auth-form { margin-bottom: 10px; }
.form-group { margin-bottom: 20px; }
.auth-form .form-group label {
    display: block;
    font-size: 13px;
    color: #9FB0C6;
    margin-bottom: 8px;
    font-weight: 500;
}
.auth-form .form-group input, .auth-form .form-group select {
    width: 100%;
    height: 50px;
    border: 1px solid rgba(90, 130, 180, 0.28);
    border-radius: 12px;
    padding: 0 16px;
    font-size: 14px;
    color: #E6EEF8;
    background: rgba(255,255,255,.04);
    transition: border-color .18s, box-shadow .18s, background .18s;
    outline: none;
    appearance: none;
}
.auth-form .form-group input::placeholder, .auth-form .form-group select::placeholder {
    color: #5C7693;
}
.auth-form .form-group input:focus, .auth-form .form-group select:focus {
    border-color: #4A90D9;
    background: rgba(255,255,255,.07);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

/* 提交按钮：纯色主题 + 柔和投影 + 轻过渡 */
.btn-submit {
    margin-top: 8px;
    height: 52px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4A90D9 0%, #357ABD 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(74, 144, 217, 0.28);
    transition: background .18s, box-shadow .18s, transform .18s;
}
.btn-submit:hover {
    background: linear-gradient(135deg, #5BA3EF 0%, #3A80C8 100%);
    box-shadow: 0 6px 18px rgba(74, 144, 217, 0.36);
}
.btn-submit:active {
    transform: translateY(1px);
    box-shadow: 0 3px 10px rgba(74, 144, 217, 0.30);
}

/* 底部文字与链接 */
.auth-foot {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: #8895AA;
    padding-top: 6px;
}
.auth-foot a {
    font-weight: 500;
    color: #5FACFF;
}
.auth-foot a:hover { color: #7FB9FF; text-decoration: underline; }

/* ---------- 登录/注册页响应式 ---------- */
@media (max-width: 520px) {
    .auth-page { padding: 20px 16px; }
    .auth-box {
        padding: 40px 28px 32px;
        border-radius: 18px;
    }
    .brand-head { margin-bottom: 26px; }
    .welcome-title { font-size: 24px; }
    .welcome-sub  { font-size: 13px; margin-bottom: 26px; }
    .form-group    { margin-bottom: 18px; }
    .form-group input, .form-group select { height: 48px; border-radius: 10px; }
    .btn-submit    { height: 50px; border-radius: 10px; }
}
@media (max-width: 380px) {
    .auth-box { padding: 32px 22px 26px; }
    .welcome-title { font-size: 22px; }
    .brand-head h1 { font-size: 16px; }
    .brand-head .brand-logo { height: 32px; }
}

/* ---- 按钮 ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    padding: 0 22px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-block { width: 100%; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 6px; }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-warn { background: var(--warn); color: #fff; }
.btn-home {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
}
.btn-home:hover { background: var(--primary); color: #fff; }

/* ---- 提示 ---- */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}
.alert-danger  { background: #FDECEA; color: var(--danger); border-left: 3px solid var(--danger); }
.alert-success { background: #EAF7EE; color: var(--success); border-left: 3px solid var(--success); }
.alert-warn    { background: #FEF6E4; color: var(--warn);    border-left: 3px solid var(--warn); }
.alert-info    { background: #EBF4FF; color: var(--primary); border-left: 3px solid var(--primary); }

/* ---- 昨日数据卡片 ---- */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.summary-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    box-shadow: var(--shadow);
}
.summary-item .s-label { font-size: 12px; color: var(--text-sub); margin-bottom: 8px; }
.summary-item .s-value { font-size: 20px; font-weight: 700; color: var(--primary); }
.summary-item .s-unit  { font-size: 11px; color: var(--text-sub); margin-top: 2px; }

/* ---- 导航列表（一行两个） ---- */
.module-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.module-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 14px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    position: relative;
    overflow: hidden;
}
.module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74,144,217,.22);
    border-color: var(--primary);
}
.module-card .m-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.module-card .m-name { font-size: 14px; font-weight: 600; white-space: nowrap; }
.module-card.no-perm { opacity: .6; cursor: pointer; }
.module-card.no-perm::after {
    content: '🔒';
    position: absolute;
    top: 6px; right: 8px;
    font-size: 11px;
}

/* 颜色组 */
.c1 { background: #EBF4FF; color: var(--primary); }
.c2 { background: #E8F8F4; color: var(--accent); }
.c3 { background: #FEF6E4; color: var(--warn); }
.c4 { background: #FDECEA; color: var(--danger); }
.c5 { background: #F0F0FF; color: #7B68EE; }
.c6 { background: #FFF0F6; color: #FF69B4; }
.c7 { background: #F0FFF4; color: #2ECC71; }
.c8 { background: #FFF8F0; color: #E67E22; }

/* ---- 查询页 ---- */
.query-header { margin-bottom: 16px; }
.query-header h2 { font-size: 17px; font-weight: 700; color: var(--text); }
.query-header .breadcrumb { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.breadcrumb a { color: var(--primary); }

.filter-bar {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}
.filter-item { display: flex; flex-direction: column; gap: 4px; min-width: 130px; flex: 1; }
.filter-item label { font-size: 12px; color: var(--text-sub); font-weight: 500; }
.filter-item input, .filter-item select {
    height: 38px;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    padding: 0 10px;
    font-size: 13px;
    color: var(--text);
    background: #FAFCFF;
    outline: none;
    transition: border-color .2s;
    appearance: none;
}
.filter-item input:focus, .filter-item select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(74,144,217,.12);
}
.filter-actions { display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0; }
.filter-actions .btn { height: 38px; font-size: 13px; }

/* ---- 汇总栏 ---- */
.result-summary {
    background: linear-gradient(135deg, var(--primary) 0%, #5BA8F0 100%);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 12px;
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
}
.result-summary .sum-item {}
.result-summary .sum-label { font-size: 11px; opacity: .85; }
.result-summary .sum-value { font-size: 18px; font-weight: 700; }

/* ---- 2026-08-27 第14轮：result-summary 蓝色胶囊专用 环比/同比%配色
   原 #27AE60 绿 / #E74C3C 红 叠加蓝色渐变底上对比度太低 → 看不清。
   改：正=浅金+白描 / 负=柔粉+白描，蓝底高对比，保留涨跌语义。 */
.result-summary .pct-up,
.result-summary .pct-down { font-weight: 600; letter-spacing: .02em; padding: 0 1px; border-radius: 3px; text-shadow: 0 1px 1px rgba(0,0,0,0.22); }
.result-summary .pct-up   { color: #FFF4B7; /* 浅金/鹅黄：蓝底上对比 ~10:1 */ }
.result-summary .pct-down { color: #FFD5D9; /* 柔粉：蓝底上对比 ~7.5:1，语义清晰 */ }

/* ---- 数据表格 ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); position: relative; }
table { width: 100%; border-collapse: collapse; background: var(--card-bg); font-size: 13px; table-layout: auto; border: 2px solid #D0D7E2; }

/* 集团销售表格：自适应列宽一屏显示 */
.group-sale-table { overflow-x: auto; }
.group-sale-table table { width: auto; min-width: 100%; }
.group-sale-table .col-org { white-space: nowrap; }
.group-sale-table .col-money { text-align: right; white-space: nowrap; width: 1%; padding: 9px 14px; }
.group-sale-table .col-rate { text-align: right; white-space: nowrap; width: 1%; padding: 9px 10px; font-size: 12px; }
thead th {
    background: #F0F6FF;
    color: var(--text-sub);
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
    border: 1.5px solid #D0D7E2;
}
/* 列宽拖拽手柄 */
thead th .col-resizer {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: col-resize;
    z-index: 5;
    background: transparent;
    transition: background .15s;
}
thead th .col-resizer:hover,
thead th .col-resizer.active {
    background: var(--primary);
    opacity: .4;
}
thead th.resizing {
    border-right: 2px solid var(--primary);
}
/* 组织列固定 */
thead th.sticky-col,
tbody td.sticky-col,
tfoot td.sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: inherit;
}
thead th.sticky-col { z-index: 3; background: #F0F6FF; }
tbody td.sticky-col { background: #fff; }
tfoot td.sticky-col { background: #EBF4FF; }
tbody tr:hover td.sticky-col { background: #F0F7FF; }
tbody tr.row-bold td.sticky-col,
tbody tr.row-header td.sticky-col { background: inherit; }

/* 00开头行底色加深 */
tbody tr.row-header td { background: #DCE9F7; font-weight: 700; }
tbody tr.row-header:hover td { background: #D0E0F2; }

/* 实收/毛利列加深 */
.col-highlight { background: #E8F4FD !important; font-weight: 600; }
thead th.col-highlight { background: #D6E8F9 !important; }
tfoot td.col-highlight { background: #D6E8F9 !important; }

tbody td { padding: 9px 12px; border: 1.5px solid #D0D7E2; white-space: nowrap; }
tbody tr:hover td { background: #F7FBFF; }
tbody tr.row-bold td { background: #f0f7ff; font-weight: 700; }
tbody tr.row-bold:hover td { background: #e5f0ff; }
tfoot td {
    background: #EBF4FF;
    font-weight: 600;
    padding: 10px 12px;
    color: var(--primary);
    border: 1.5px solid #D0D7E2;
}

/* ---- 分页 ---- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px 0 8px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 6px;
    font-size: 13px;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text);
    transition: all .15s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .info { width: auto; padding: 0 10px; border: none; background: none; color: var(--text-sub); font-size: 12px; }

/* ---- 后台 ---- */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 200px;
    background: #1C2B3A;
    flex-shrink: 0;
    padding-top: 60px;
}
.admin-sidebar a {
    display: block;
    padding: 12px 20px;
    color: #A0ADB8;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all .15s;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    background: rgba(74,144,217,.15);
    color: #fff;
    border-left-color: var(--primary);
}
.admin-main { flex: 1; padding: 20px; }
.admin-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 52px;
    background: #243447;
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 200;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

/* ---- 徽章 ---- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}
.badge-success { background: #EAF7EE; color: var(--success); }
.badge-warn    { background: #FEF6E4; color: var(--warn); }
.badge-danger  { background: #FDECEA; color: var(--danger); }
.badge-info    { background: #EBF4FF; color: var(--primary); }

/* ---- 响应式 ---- */
/* v17_0828：后台手机端汉堡按钮 + 侧边栏滑出 + 遮罩（替代原 display:none，让手机也能访问菜单） */
.admin-menu-btn {
    display: none;
    width: 36px; height: 36px;
    margin-right: 10px;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
}
.admin-menu-btn:hover { background: rgba(255,255,255,.12); }
.admin-mask {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 150;
}
.admin-mask.show { display: block; }

@media (max-width: 600px) {
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .module-grid  { grid-template-columns: repeat(2, 1fr); }
    .module-card  { padding: 12px 10px; }
    .module-card .m-icon { width: 36px; height: 36px; font-size: 16px; }
    .module-card .m-name { font-size: 13px; }
    .filter-item  { min-width: 100%; }
    .auth-box     { padding: 24px 18px; }
    .result-summary { gap: 10px 16px; }
    .result-summary .sum-value { font-size: 16px; }
    /* 汉堡按钮显示 */
    .admin-menu-btn { display: inline-block; }
    /* 侧边栏改为左侧滑出式，默认隐藏，.open 时滑入 */
    .admin-sidebar {
        position: fixed !important;
        top: 52px; left: 0; bottom: 0;
        width: 220px;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 160;
        padding-top: 0;
    }
    .admin-sidebar.open { transform: translateX(0); }
}
@media (max-width: 400px) {
    .module-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* ---- 折线图 ---- */
.chart-wrap {
    margin: 16px 0;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 16px 12px;
    height: 320px;
    position: relative;
}

/* 编码列样式 */
.code-cell {
    color: var(--text-sub);
    white-space: nowrap;
}

/* 数字列右对齐 */
.num-cell { text-align: right; white-space: nowrap; }

/* ---- 树形搜索下拉框 ---- */
.ts-wrap {
    position: relative;
}
.ts-input {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 14px;
    background: #fff;
    color: var(--text);
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
.ts-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(74,144,217,0.15);
}
.ts-btn:hover {
    background: #e8ecf0 !important;
}
.ts-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 999;
    margin-top: 1px;
}
.ts-tree-item {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    transition: background 0.12s;
    border-bottom: 1px solid #f0f0f0;
}
.ts-tree-item:hover,
.ts-tree-item.ts-active {
    background: var(--primary-bg);
    color: var(--primary);
}

/* ============================================================
   数据驾驶舱（深色科技风 · 可折叠隐藏侧边栏）
   ============================================================ */
.dash-body {
    margin: 0;
    background: #0B1A2B;
    color: #E6EEF8;
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC',
                 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ---- 侧边栏（默认收起：64px → 展开：240px） ---- */
.dash-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 64px;
    background: linear-gradient(180deg, #0E2033 0%, #0A1624 100%);
    border-right: 1px solid rgba(90, 130, 180, 0.12);
    z-index: 1001;
    transition: width .28s cubic-bezier(.4,0,.2,1), transform .28s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.dash-sidebar.side-open { width: 240px; }

.side-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 64px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(90, 130, 180, 0.12);
    flex-shrink: 0;
    white-space: nowrap;
}
/* LOGO 图片白边处理：深色背景上用 multiply 混合，把 PNG 导出时白边抗锯齿像素融进深色背景 */
.side-logo img {
    height: 28px; width: auto; flex-shrink: 0;
    mix-blend-mode: multiply;        /* 白边×深蓝 → 深蓝，白边消失；黑字×深蓝 → 黑字保持 */
    filter: contrast(1.15) brightness(1.02);
}
.side-logo .side-text {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    -webkit-text-stroke: 0;          /* 去掉字体描边 */
    text-shadow: none;               /* 去掉文字白边阴影 */
    paint-order: stroke fill;
}

.side-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0 20px;
}
.side-group { margin-bottom: 10px; }
.side-group-title {
    display: block;
    padding: 10px 18px 4px;
    font-size: 11px;
    color: #5C7693;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}
.side-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    color: #A7B7CC;
    text-decoration: none;
    font-size: 14px;
    position: relative;
    transition: all .18s;
    white-space: nowrap;
    cursor: pointer;
}
.side-item::before {
    content: '';
    position: absolute;
    left: 0; top: 6px; bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: transparent;
    transition: background .18s;
}
.side-item:hover {
    color: #fff;
    background: rgba(74, 144, 217, 0.10);
}
.side-item:hover::before { background: #4A90D9; }
.side-icon {
    font-size: 17px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}
.side-item.no-perm { opacity: .5; cursor: not-allowed; }
.side-item.no-perm::after {
    content: '🔒';
    margin-left: auto;
    font-size: 11px;
}

/* 收起时，隐藏文字 */
.side-text {
    opacity: 0;
    transition: opacity .18s ease;
    pointer-events: none;
}
.dash-sidebar.side-open .side-text { opacity: 1; pointer-events: auto; }

/* 遮罩层（只在移动端 + 展开时显示） */
.side-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
}

/* ---- 主区域 ---- */
.dash-main {
    margin-left: 64px;
    min-height: 100vh;
    transition: margin-left .28s cubic-bezier(.4,0,.2,1);
    padding: 0 22px 22px;
    box-sizing: border-box;
}
.dash-body.side-open .dash-main { margin-left: 240px; }

/* ---- 顶部栏（允许移动端自动高度2行堆叠）---- */
.dash-topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    align-content: center;
    gap: 10px;
    height: auto;
    min-height: 64px;
    padding: 10px 6px;
    background: linear-gradient(180deg, rgba(11,26,43,.95) 0%, rgba(11,26,43,.75) 100%);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(90, 130, 180, 0.10);
    margin-bottom: 18px;
}
.dash-topbar .dash-date-group { flex: 1 1 220px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dash-topbar .dash-user { flex: 0 1 auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.hamburger { flex-shrink: 0; }
.hamburger {
    width: 40px; height: 40px;
    border: none;
    background: rgba(255,255,255,.05);
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background .18s;
}
.hamburger:hover { background: rgba(255,255,255,.10); }
.hamburger span {
    display: block;
    width: 18px; height: 2px;
    background: #CBD7E6;
    border-radius: 2px;
    transition: all .18s;
}
.dash-title h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #8CC8FF 0%, #4A90D9 60%, #C9A6FF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    margin-right: 12px;
}
.dash-date {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    color: #8DA2BE;
    background: rgba(74, 144, 217, 0.12);
    border: 1px solid rgba(74, 144, 217, 0.22);
    border-radius: 20px;
}
.dash-user {
    display: flex;
    align-items: center;
    gap: 14px;
}
.dash-date-input {
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid rgba(90, 130, 180, 0.22);
    background: rgba(255,255,255,.05);
    color: #E6EEF8;
    color-scheme: dark;
    font-size: 13px;
    outline: none;
    transition: border-color .18s;
}
.dash-date-input:focus { border-color: #4A90D9; }
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(90, 130, 180, 0.18);
    border-radius: 30px;
}
.avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A90D9 0%, #8762D0 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.user-name { font-size: 13px; color: #D4DFEF; }
.logout-link {
    font-size: 16px;
    color: #7F92AB;
    text-decoration: none;
    padding: 0 4px;
}
.logout-link:hover { color: #fff; }

/* ---- KPI 指标卡 4 列 ---- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
.kpi-card {
    position: relative;
    padding: 18px 20px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(30,50,75,.7) 0%, rgba(16,30,48,.8) 100%);
    border: 1px solid rgba(90, 130, 180, 0.14);
    overflow: hidden;
}
.kpi-card::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 140px; height: 140px;
    border-radius: 50%;
    opacity: .10;
    filter: blur(10px);
}
.kpi-blue::before   { background: #4A90D9; }
.kpi-green::before  { background: #5EC4A1; }
.kpi-orange::before { background: #F39C12; }
.kpi-purple::before { background: #9B6CF0; }
.kpi-label {
    font-size: 12px;
    color: #8DA2BE;
    margin-bottom: 8px;
    letter-spacing: 1px;
}
.kpi-value {
    /* 2026-08-27 第15轮：KPI 元单位响应式字号（千万 8 位数 11 字符不换行破版）*/
    font-size: clamp(20px, 3.0vw, 30px);
    font-weight: 700;
    font-family: 'DIN Alternate', 'Arial', sans-serif;
    font-variant-numeric: tabular-nums;  /* 数字等宽，避免跳行 */
    letter-spacing: -0.02em;            /* 收紧 1-2% 字间距多放 1 位 */
    line-height: 1.1;
    margin-bottom: 10px;
    white-space: nowrap;                 /* 禁止换行破版 */
    overflow: hidden;
    text-overflow: ellipsis;             /* 极端超小时省略号兜底 */
    max-width: 100%;
}
.kpi-unit {
    font-size: 13px;
    font-weight: 500;
    color: inherit;
    opacity: 0.8;
    margin-left: 4px;
    letter-spacing: 0;
    font-variant-numeric: normal;
}
.kpi-blue .kpi-value   { color: #5FACFF; text-shadow: 0 0 18px rgba(74,144,217,.35); }
.kpi-green .kpi-value  { color: #6FD9B6; text-shadow: 0 0 18px rgba(94,196,161,.35); }
.kpi-orange .kpi-value { color: #FFB64A; text-shadow: 0 0 18px rgba(243,156,18,.35); }
.kpi-purple .kpi-value { color: #B78CFF; text-shadow: 0 0 18px rgba(155,108,240,.35); }
.kpi-foot {
    font-size: 12px;
    color: #6F86A4;
}
.kpi-foot em {
    font-style: normal;
    color: #B9CCE5;
    font-weight: 600;
    margin: 0 2px;
}

/* ---- 图表行通用 ---- */
.dash-row {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}
.row-2 { grid-template-columns: 1.1fr 1fr; }
.row-3 { grid-template-columns: repeat(3, 1fr); }
.row-4 { }

.dash-card {
    background: linear-gradient(180deg, rgba(20,38,60,.7) 0%, rgba(13,25,40,.85) 100%);
    border: 1px solid rgba(90, 130, 180, 0.12);
    border-radius: 14px;
    padding: 16px 18px 14px;
    position: relative;
    backdrop-filter: blur(4px);
}
.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(90, 130, 180, 0.10);
}
.card-head h3 {
    font-size: 14px;
    font-weight: 600;
    color: #D4DFEF;
    letter-spacing: 1px;
    position: relative;
    padding-left: 12px;
}
.card-head h3::before {
    content: '';
    position: absolute;
    left: 0; top: 3px; bottom: 3px;
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(180deg, #4A90D9, #8762D0);
}
.card-sub {
    font-size: 11px;
    color: #6F86A4;
}
.card-body {
    min-height: 240px;
    position: relative;
}
.card-full .card-body { min-height: 360px; }

/* ---- 排行榜表格 ---- */
.rank-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: transparent;
    border: none;
}
.rank-table thead th {
    background: rgba(74, 144, 217, 0.10);
    color: #8DA2BE;
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
    border: none;
    border-bottom: 1px solid rgba(90, 130, 180, 0.16);
    font-size: 12px;
}
.rank-table tbody td {
    padding: 11px 12px;
    color: #CFDBEA;
    border: none;
    border-bottom: 1px dashed rgba(90, 130, 180, 0.12);
    white-space: nowrap;
}
.rank-table tbody tr:hover td { background: rgba(74,144,217,.06); }
.rank-table th.right, .rank-table td.right { text-align: right; }
.rank-no {
    display: inline-block;
    width: 24px; height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255,255,255,.05);
    color: #8DA2BE;
}
.rank-no.n1 { background: linear-gradient(135deg, #FFB44A, #F39C12); color: #fff; }
.rank-no.n2 { background: linear-gradient(135deg, #B0B8C8, #8490A5); color: #fff; }
.rank-no.n3 { background: linear-gradient(135deg, #D4926A, #A26A44); color: #fff; }
.rank-bar {
    height: 6px;
    background: rgba(255,255,255,.06);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    min-width: 140px;
}
.rank-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #4A90D9, #8762D0);
    border-radius: 3px;
}

/* ---- 页脚 ---- */
.dash-foot {
    text-align: center;
    padding: 20px 0 8px;
    font-size: 12px;
    color: #4A5F7A;
    letter-spacing: 1px;
}

/* ---- 驾驶舱响应式（与 index.php 内联规则保持一致）---- */
/* ===== 驾驶舱表格深色化兜底（防止白底灰字）===== */
body.dash-body table.slow-table,
body.dash-body table.rank4-table {
    background: #0F2033 !important;
    color: #E8F1FB !important;
    border: none !important;
}
body.dash-body table.slow-table thead th,
body.dash-body table.rank4-table thead th {
    background: linear-gradient(180deg, #132A46 0%, #183A60 100%) !important;
    color: #7CD9FF !important;
    border: none !important;
    border-bottom: 1px solid rgba(90,130,180,0.28) !important;
}
body.dash-body table.slow-table tbody td,
body.dash-body table.rank4-table tbody td {
    background: #0F2033 !important;
    color: #D7E3F3 !important;
    border: none !important;
    border-bottom: 1px solid rgba(90,130,180,0.08) !important;
}
body.dash-body table.slow-table tbody tr:nth-child(even) td,
body.dash-body table.rank4-table tbody tr:nth-child(even) td {
    background: #11243B !important;
}
body.dash-body table.slow-table tbody tr:hover td,
body.dash-body table.rank4-table tbody tr:hover td {
    background: rgba(74,144,217,.12) !important;
    color: #FFFFFF !important;
}
@media (max-width: 1200px) {
    .row-3 { grid-template-columns: repeat(2, 1fr); }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .dash-main { padding: 0 16px 16px; }
    .row-2 { grid-template-columns: 1fr; }
    .row-3 { grid-template-columns: 1fr; }
    .kpi-grid { gap: 12px; }
    .dash-card { padding: 12px 14px 10px; }
    .dash-row  { gap: 12px; margin-bottom: 12px; }
}
@media (max-width: 720px) {
    .dash-sidebar { transform: translateX(-100%); }
    .dash-sidebar.side-open { transform: translateX(0); width: 260px; }
    .dash-sidebar .side-text,
    .dash-sidebar.side-open .side-text { opacity: 1; pointer-events: auto; }
    .side-mask.show { display: block; }
    .dash-main,
    .dash-body.side-open .dash-main { margin-left: 0; padding: 0 12px 12px; }
    /* 关键：KPI 手机端保持 2 列（参考看板移动端 162.5+162.5）*/
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
    .kpi-card  { padding: 12px 12px 10px; border-radius: 12px; }
    .kpi-label { font-size: 12px; margin-bottom: 6px; }
    .kpi-value { font-size: clamp(15px, 4.5vw, 22px); margin-bottom: 6px; letter-spacing: -0.02em; }
    .kpi-unit  { font-size: 12px; margin-left: 3px; }
    .kpi-foot  { font-size: 11px; }
    .dash-title h1 { font-size: 15px; letter-spacing: 1px; }
    .dash-date  { display: none; }
    .dash-date-input { display: none; }
    .user-name { display: none; }
    .dash-row  { gap: 10px; margin-bottom: 10px; }
    .dash-card { padding: 12px 12px 10px; border-radius: 12px; }
    .dash-card .card-head h3 { font-size: 13px; }
    .card-body { min-height: 220px; }
    .card-full .card-body { min-height: 320px; }
    .dash-topbar { height: auto; min-height: 58px; padding: 8px 6px; gap: 8px; margin-bottom: 12px; }
}
@media (max-width: 420px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .kpi-card  { padding: 10px 10px 9px; border-radius: 10px; }
    .kpi-value { font-size: clamp(13px, 4.4vw, 19px); letter-spacing: -0.025em; }
    .kpi-label { font-size: 11px; }
    .kpi-unit  { font-size: 11px; }
    .dash-card { padding: 10px 10px 9px; border-radius: 10px; }
    .dash-card .card-head h3 { font-size: 12px; }
    .dash-row  { gap: 8px; margin-bottom: 8px; }
    .card-body { min-height: 200px; }
    .card-full .card-body { min-height: 300px; }
    .dash-topbar .hamburger { width: 36px; height: 36px; }
}
