/* 渔来喔统一设计系统 · 3017 覆盖层（分支 feat/ui-unify）
 * 加载顺序：style.css 之后。只改外观，不改任何结构、数据和口径。
 * 字号只用 24/18/14/12/11；字重只用 400/600；主色薄荷绿只作底色；
 * 浅色 / 深色两套，默认跟随系统。
 */
:root {
    --brand: #6CCF8E; --on-brand: #0B2A1D; --brand-ink: #6CCF8E; --brand-bg: rgba(108, 207, 142, .16);
    --bg: #0B0F19; --surface: rgba(23, 30, 44, .85); --surface-2: rgba(30, 41, 59, .95); --surface-solid: #111827; --head-bg: rgba(11, 15, 25, .9);
    --border: #243046; --border-strong: #33415a;
    --text: #F8FAFC; --text-2: #94A3B8; --text-3: #7B8BA3;
    --blue: #38BDF8; --green: #34D399; --yellow: #FBBF24; --red: #F87171; --purple: #C084FC;
    --blue-bg: rgba(56, 189, 248, .12); --green-bg: rgba(52, 211, 153, .12); --yellow-bg: rgba(251, 191, 36, .12); --red-bg: rgba(248, 113, 113, .14);
    --neutral-bg: rgba(148, 163, 184, .12);
    --scrim: rgba(3, 6, 12, .62); --shadow: 0 24px 80px rgba(0, 0, 0, .6); --overlay: #0F1626;
    --r-panel: 20px; --r-card: 16px; --r-input: 9px; --r-tag: 6px; --r-pill: 9999px;
    --ease: cubic-bezier(.2, .8, .2, 1); --t: 180ms;
    --shell-head-h: 64px; --shell-sub-h: 48px;
    /* rgb 三元组：给 rgba(var(--x-rgb), 透明度) 用，换主题时整体跟着变 */
    --ov-rgb: 255, 255, 255; --sl-rgb: 148, 163, 184; --sh-rgb: 0, 0, 0; --sf-rgb: 15, 23, 42; --sh-k: 1; --sf2-rgb: 51, 65, 85;
    --green-rgb: 52, 211, 153; --red-rgb: 248, 113, 113; --yellow-rgb: 251, 191, 36; --blue-rgb: 56, 189, 248; --brand-rgb: 108, 207, 142;
    color-scheme: dark;

    /* 旧变量 → 新设计变量（旧模块里凡是用变量的地方自动跟随） */
    --bg-dark: var(--bg); --bg-card: var(--surface); --bg-sidebar: var(--surface-solid);
    --border-color: var(--border); --text-primary: var(--text); --text-secondary: var(--text-2);
    --primary-accent: var(--brand-ink); --primary-glow: transparent;
    --green-accent: var(--green); --green-glow: transparent;
    --blue-accent: var(--blue); --blue-glow: transparent;
    --orange-accent: var(--yellow); --orange-glow: transparent;
    --red-accent: var(--red);
    --green-fill: var(--green); --yellow-fill: var(--yellow); --blue-fill: var(--blue); --red-fill: var(--red);
}
@media (prefers-color-scheme: light) {
    :root {
        --brand-ink: #136A42; --on-brand: #0B2A1D;
        --bg: #F5F6F8; --surface: #FFFFFF; --surface-2: #F0F2F5; --surface-solid: #FFFFFF; --head-bg: rgba(245, 246, 248, .9);
        --border: rgba(52, 63, 85, .14); --border-strong: rgba(52, 63, 85, .28);
        /* D：浅色下弱化文字/状态文字常落在浅灰、浅红、浅绿的底上（不是纯白），按规范值只有 3.5–4.4，这里适度加深到所有实测底色上 ≥4.6 */
        --text: #343F55; --text-2: #5B6579; --text-3: #5F6677;
        --blue: #0369A1; --green: #136A42; --yellow: #85590D; --red: #BE123C; --purple: #9333EA;
        --blue-bg: rgba(3, 105, 161, .10); --green-bg: rgba(19, 106, 66, .10); --yellow-bg: rgba(133, 89, 13, .12); --red-bg: rgba(190, 18, 60, .08);
        --neutral-bg: rgba(52, 63, 85, .08);
        --scrim: rgba(52, 63, 85, .35); --shadow: 0 12px 40px rgba(52, 63, 85, .18); --overlay: #FFFFFF;
        --ov-rgb: 52, 63, 85; --sl-rgb: 52, 63, 85; --sh-rgb: 52, 63, 85; --sf-rgb: 255, 255, 255; --sh-k: .2; --sf2-rgb: 226, 230, 238;
        --green-rgb: 19, 106, 66; --red-rgb: 190, 18, 60; --yellow-rgb: 133, 89, 13; --blue-rgb: 3, 105, 161; --brand-rgb: 108, 207, 142;
        --green-fill: #6CCF8E; --yellow-fill: #E9B949; --blue-fill: #6AA9D8; --red-fill: #BE123C;
        --chart-green: #1F9D63; --chart-yellow: #D99A1E; --chart-blue: #2F86C8;
        --red-bg: rgba(190, 18, 60, .08);
        color-scheme: light;
    }
}

/* ---------- 基础 ---------- */
html { scrollbar-gutter: stable; }
html, body, html body .app-container { background: var(--bg) !important; color: var(--text); }
body { font: 400 14px/1.5 var(--font-body); }
b, strong { font-weight: 600; }
button, input, select, textarea { font: inherit; }   /* 浏览器默认 13.33px 会破坏字号只用 5 档 */
:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* 点击热区：视觉 32px，热区 44px */
html body .btn, html body .sub-nav-pill { position: relative; }
html body .btn::after, html body .sub-nav-pill::after { content: ""; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px; }

/* ---------- 侧栏（桌面） ---------- */
html body .sidebar { width: 240px; background: var(--surface-solid); border-right: 1px solid var(--border); padding: 16px; }
html body .logo-container { gap: 12px; margin-bottom: 24px; }
html body .logo-icon { width: 36px; height: 36px; border-radius: var(--r-input); background: var(--brand); color: var(--on-brand); box-shadow: none; font-size: 18px; }
html body .logo-text h2 { font: 600 18px/1.3 var(--font-heading); letter-spacing: 0; color: var(--text); display: flex; align-items: center; gap: 8px; }
html body .logo-text h2 span, html body .ver-chip { font: 400 12px var(--font-mono); color: var(--text-3); border: 1px solid var(--border); background: none; border-radius: var(--r-pill); padding: 0 8px; opacity: 1; display: inline-block; margin: 0; }
html body .logo-text > span { font-size: 12px; color: var(--text-3); }
html body .nav-menu { gap: 4px; }
html body .nav-item { min-height: 44px; padding: 0 12px; gap: 12px; border-radius: var(--r-input); border: 1px solid transparent; color: var(--text-2); font-size: 14px; font-weight: 400; transition: background-color var(--t) var(--ease), color var(--t), border-color var(--t); }
html body .nav-item i { font-size: 16px; width: 20px; }
html body .nav-item:hover { background: var(--neutral-bg); color: var(--text); }
html body .nav-item.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; box-shadow: none; }
html body .sidebar-footer { font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border); }
html body .status-indicator { background: var(--green); box-shadow: none; }

/* ---------- 主区域与抬头：固定高度，切换页签不跳 ---------- */
html body .main-content { padding: 16px 20px; }
html body .top-app-header { margin: 0 0 16px 0; padding: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
html body .main-header {
    height: var(--shell-head-h) !important; min-height: var(--shell-head-h) !important; max-height: var(--shell-head-h) !important;
    margin: 0 !important; padding: 0 !important; border-bottom: 0 !important; gap: 12px;
}
html body .main-header.compact-actions-header { margin: 0 !important; padding: 0 !important; }   /* 旧的紧凑抬头变体会多出 16px，统一成固定高度 */
html body .header-title { min-width: 0; }
html body .header-title > div { display: flex; align-items: center; gap: 8px; }
html body .header-title h1 { font: 600 24px/1.2 var(--font-heading) !important; color: var(--text) !important; margin: 0 !important; white-space: nowrap; }
html body .mobile-version-tag { font: 400 12px var(--font-mono); color: var(--text-3); border: 1px solid var(--border); background: none; border-radius: var(--r-pill); padding: 0 8px; }
html body .date-selector-container { gap: 8px; flex-wrap: nowrap; }

/* 二级导航：胶囊；永远占位（空的时候隐藏内容但保留高度），避免首页与其他页签之间内容上下跳 */
html body .sub-nav-bar {
    display: flex !important; align-items: center !important; gap: 8px !important; flex-wrap: nowrap !important; overflow-x: auto !important; scrollbar-width: none;
    height: var(--shell-sub-h) !important; min-height: var(--shell-sub-h) !important; margin: 0 !important; padding: 0 !important;
    background: transparent !important; border: 0 !important; border-bottom: 1px solid var(--border) !important; border-radius: 0 !important; width: 100% !important;
}
html body .sub-nav-bar::-webkit-scrollbar { display: none; }
html body .sub-nav-bar:empty { display: none; }
html body .sub-nav-pill {
    flex: none !important; height: 32px !important; min-height: 32px !important; line-height: 1 !important; padding: 0 14px !important;
    border-radius: var(--r-pill) !important; border: 1px solid var(--border) !important; background: var(--surface) !important; color: var(--text-2) !important;
    font-size: 14px !important; font-weight: 400 !important; box-shadow: none !important; transition: background-color var(--t) var(--ease), border-color var(--t), color var(--t) !important;
}
html body .sub-nav-pill span { font-size: 14px !important; font-weight: inherit !important; }
html body .sub-nav-pill:hover { background: var(--surface) !important; border-color: var(--border-strong) !important; color: var(--text) !important; }
html body .sub-nav-pill.active { background: var(--brand) !important; border-color: var(--brand) !important; color: var(--on-brand) !important; font-weight: 600 !important; box-shadow: none !important; }

/* ---------- 按钮（全站统一）---------- */
html body .btn {
    min-height: 32px; padding: 0 14px; border-radius: var(--r-input); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    font-size: 14px; font-weight: 400; gap: 8px; box-shadow: none; transition: background-color var(--t), border-color var(--t), color var(--t);
}
html body .btn:hover { border-color: var(--brand-ink); color: var(--brand-ink); background: var(--surface); }
html body .btn.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
html body .btn.btn-primary:hover { border-color: var(--on-brand); color: var(--on-brand); background: var(--brand); }
html body .btn.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
html body .btn.btn-ghost:hover { color: var(--text); border-color: transparent; background: var(--neutral-bg); }
html body .btn:disabled { opacity: .5; cursor: not-allowed; }

/* 全局日期控件：上一天 / 日期 / 下一天 合成一个分段控件 */
html body .global-date-controls { gap: 0 !important; padding: 2px !important; background: var(--surface) !important; border: 1px solid var(--border-strong) !important; border-radius: var(--r-pill) !important; }
html body .global-date-controls .btn { min-height: 28px !important; min-width: 44px; padding: 0 12px !important; border-radius: var(--r-pill) !important; border: 0 !important; height: auto !important; width: auto !important; }
html body #global-date-picker {
    background: transparent !important; border: 0 !important; color: var(--text) !important; font: 600 14px var(--font-body) !important; min-width: 128px !important;
    min-height: 28px; padding: 0 8px !important; background-image: none !important; color-scheme: dark;
}
@media (prefers-color-scheme: light) { html body #global-date-picker { color-scheme: light; } }

/* ---------- 内容面板：切换只淡入，尺寸不参与动画 ---------- */
html body .tab-panel.active { animation: ui-fade var(--t) var(--ease); }
@keyframes ui-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 手机：顶部抬头紧凑、底部 5 个导航 ---------- */
@media (max-width: 768px) {
    html body .main-content { padding: 0 !important; }
    html body .top-app-header { margin: 0 !important; padding: 0 12px !important; background: var(--head-bg) !important; backdrop-filter: blur(10px); }
    html body .mobile-version-tag { font-size: 11px; padding: 0 6px; }
    html body .global-date-controls .btn { min-width: 36px; padding: 0 8px !important; }
    html body #global-date-picker { min-width: 104px !important; padding: 0 4px !important; }
    html body .main-header { height: 56px !important; min-height: 56px !important; max-height: 56px !important; }
    html body .header-title h1 { font-size: 18px !important; }
    html body .date-selector-container > .btn-primary, html body .date-selector-container > .btn-secondary { display: none; }   /* 只隐藏上传/校核；舍卫"保存"、合同"新增/导出"在 #header-module-actions 里，手机上必须保留 */
    html body .sub-nav-bar { height: 44px !important; min-height: 44px !important; margin: 0 !important; }
    html body .sub-nav-pill { height: 32px !important; padding: 0 12px !important; }
    html body .sidebar { background: var(--head-bg) !important; border-top: 1px solid var(--border) !important; box-shadow: none !important; }
    html body .nav-item { border: 0; font-size: 11px !important; color: var(--text-2) !important; border-radius: var(--r-input) !important; }
    html body .nav-item i { font-size: 18px !important; }
    html body .nav-item { position: relative; }
    html body .nav-item.active { background: transparent !important; color: var(--brand-ink) !important; font-weight: 600 !important; }
    html body .nav-item.active::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 20px; height: 3px; margin-left: -10px; border-radius: 2px; background: var(--brand); top: auto; right: auto; }
}

/* ---------- 卡片（全站）：浮在底色上，细边框，无厚阴影、无彩色边 ---------- */
html body .glass, html body .card-block, html body .comp-card {
    background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--r-card) !important;
    box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}

/* ---------- 月份 / 日期胶囊（收入、采购、对账等多处共用）---------- */
html body .analysis-month-chip, html body .month-chip, html body .period-chip {
    min-height: 32px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
    font-size: 14px; font-weight: 400; box-shadow: none; display: inline-flex; align-items: center; transition: background-color var(--t) var(--ease), border-color var(--t), color var(--t);
}
html body .analysis-month-chip:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
html body .analysis-month-chip.active, html body .month-chip.active, html body .period-chip.active {
    background: var(--brand) !important; border-color: var(--brand) !important; color: var(--on-brand) !important; font-weight: 600; box-shadow: none !important;
}

/* 版本号小标签：各宽度一致，中性色 */
html body .mobile-version-tag { background: none !important; color: var(--text-3) !important; border: 1px solid var(--border) !important; border-radius: var(--r-pill) !important; font: 400 12px var(--font-mono) !important; padding: 0 8px !important; }

/* 月份胶囊行：一排可见，过多时横向滚动（规范：不折行、不折叠） */
html body .analysis-month-chip-row { display: flex !important; flex-wrap: wrap !important; gap: 8px !important; overflow: visible !important; padding: 2px 0 !important; min-width: 0; }
html body .analysis-month-chip-row::-webkit-scrollbar { display: none; }
html body .analysis-month-chip-row > * { flex: none !important; }

/* ---------- 原生下拉 → 胶囊（ui-select-chips.js）：原 select 视觉隐藏但留在 DOM，取值/事件不变 ---------- */
html body select.ui-native-select {
    position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; padding: 0 !important; margin: 0 !important;
    border: 0 !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden !important; clip-path: inset(50%) !important;
}
html body .ui-chipsel { flex: 0 1 auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; min-width: 0; padding: 6px 0; vertical-align: middle; }
html body .ui-chipsel::-webkit-scrollbar { display: none; }
html body .ui-chip {
    flex: none; position: relative; height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
    font: 400 12px/1 var(--font-body); white-space: nowrap; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; box-shadow: none;
    transition: background-color var(--t) var(--ease), border-color var(--t), color var(--t);
}
html body .ui-chip::after { content: ""; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px; }
html body .ui-chip:hover { border-color: var(--border-strong); color: var(--text); }
html body .ui-chip.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
html body .ui-chip:disabled { opacity: .5; cursor: not-allowed; }
html body .ui-chip--trigger { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
html body .ui-chip--trigger::before { content: ""; order: 2; width: 6px; height: 6px; margin-left: 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); flex: none; }
html body .ui-chip-empty { font-size: 12px; color: var(--text-3); padding: 0 4px; }
html body td > .ui-chipsel { padding: 2px 0; }
html body #tab-dish-sales-catalog .dish-catalog-toolbar > .ui-chipsel { flex: 1 1 0; }
html body #tab-dish-sales-catalog .dish-catalog-toolbar > .btn { flex: none; }
@media (max-width: 768px) {   /* 手机：搜索+按钮一行，状态胶囊独占一行横滑，不互相挤压 */
    html body #tab-dish-sales-catalog .dish-catalog-toolbar { flex-wrap: wrap !important; height: auto !important; max-height: none !important; }
    html body #tab-dish-sales-catalog .dish-catalog-toolbar input[type="search"] { min-width: 0 !important; flex: 1 1 0; }
    html body #tab-dish-sales-catalog .dish-catalog-toolbar > .ui-chipsel { order: 9; flex: 1 0 100%; }
}
html body .ui-chip-drawer { position: fixed; inset: 0; z-index: 10000; display: none; }
html body .ui-chip-drawer.open { display: block; }
html body .ui-chip-drawer__scrim { position: absolute; inset: 0; background: var(--scrim); animation: ui-fade var(--t) var(--ease); }
html body .ui-chip-drawer__panel {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px)); max-height: min(70vh, 560px);
    display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--overlay); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--shadow); animation: ui-fade var(--t) var(--ease);
}
html body .ui-chip-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
html body .ui-chip-drawer__title { font: 600 18px/1.3 var(--font-heading); color: var(--text); }
html body .ui-chip-drawer__close { width: 44px; height: 44px; border: 0; background: none; color: var(--text-2); font-size: 24px; cursor: pointer; border-radius: var(--r-input); }
html body .ui-chip-drawer__search { height: 32px; padding: 0 12px; font-size: 16px; border-radius: var(--r-input); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
html body .ui-chip-drawer__list { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0; overflow-y: auto; }
@media (max-width: 768px) {
    html body .ui-chip-drawer__panel { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: auto; max-height: 75vh; border-radius: var(--r-panel) var(--r-panel) 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* ---------- C：卡片/标题左侧粗彩条 → 细边框、中性（警告提示条才用左侧 2px 琥珀竖条） ---------- */
html body .income-conclusion, html body .pdr-card, html body .dish-decision-col,
html body #tab-income-analysis .income-conclusion, html body #tab-purchase-analysis .income-conclusion, html body #tab-income-analysis .income-real-cash-card { border: 1px solid var(--border) !important; }
html body #tab-income-analysis .income-analysis-section-title, html body .income-analysis-section-title { border: 1px solid var(--border) !important; }

/* ---------- D：选中胶囊统一为主色底（旧样式是琥珀底+深绿字，对比度仅 1.9） ---------- */
html body #tab-dish-sales .dish-category-chip.active, html body #tab-dish-sales-trend .dish-category-chip.active, html body #tab-dish-sales-catalog .dish-category-chip.active,
html body #dish-shared-controls .dish-category-chip.active, html body #dish-trend-category-chips .dish-category-chip.active,
html body #tab-dish-sales-catalog #dish-catalog-category-filter-chips .dish-category-chip.active, html body #dish-catalog-category-filter-chips .dish-category-chip.active,
html body #tab-dish-sales .dish-context-bar .dish-category-chip.active, html body #tab-dish-sales-trend .dish-context-bar .dish-category-chip.active, html body #tab-dish-sales-catalog .dish-context-bar .dish-category-chip.active,
html body .dish-shared-nav .analysis-month-chip.active, html body #tab-dish-sales .dish-module-nav .analysis-month-chip.active, html body #tab-dish-sales-trend .dish-module-nav .analysis-month-chip.active, html body #tab-dish-sales-catalog .dish-module-nav .analysis-month-chip.active,
html body .contract-seg button.active, html body .wage-month-chip.active {
    background: var(--brand) !important; border-color: var(--brand) !important; color: var(--on-brand) !important;
}

/* ---------- E：剩余不合规字号、收入分析 KPI 卡空白 ---------- */
html body .rpt-be-num small { font-size: 18px; }                       /* 原 small 继承 24px×0.83=20px */
html body .shewei-table td small { font-size: 12px; }                  /* 原 12px×0.83=10px */
/* 收入分析 KPI 卡：去掉 260px 最小高度；明细块紧跟金额，不再被推到卡片底部留出中段大空白（同排仍等高） */
html body #tab-income-analysis #income-kpis.income-kpi-grid .comp-card { min-height: 0 !important; justify-content: flex-start !important; }
html body #tab-income-analysis #income-kpis.income-kpi-grid .comp-card > div:last-child { margin-top: 12px !important; }
/* 菜品销售共享导航：右上角「上传Excel」是绝对定位，原来月份胶囊会钻到按钮下面被挡住；给按钮让出位置、胶囊从左排起可横滑 */
html body .dish-shared-nav { justify-content: flex-start !important; overflow: hidden !important; gap: 12px !important; padding: 0 14px !important; }
html body .dish-shared-nav .dish-month-chip-row { flex: 1 1 auto !important; min-width: 0 !important; flex-wrap: wrap !important; overflow: visible !important; justify-content: flex-start !important; }
html body .dish-shared-nav .dish-month-chip-row::-webkit-scrollbar { display: none; }
html body .dish-shared-nav #btn-dish-sales-upload { position: relative !important; flex: none !important; margin: 0 !important; }
/* 手机：带操作按钮的紧凑抬头（舍卫/合同/进销）里，版本号小标签会被日期控件压住，窄屏下隐藏 */
@media (max-width: 480px) { html body .main-header.compact-actions-header .mobile-version-tag { display: none !important; } }

/* ---------- F：对账中心（报销对账 #tab-reconciliation-center、盈亏分析 #tab-profit-analysis）——只改颜色/边框/字号，不改任何高度与三栏栅格 ---------- */
/* 三栏卡片顶部 4px 粗条 → 1px 细边框；标题底色中性 */
html body #tab-reconciliation-center .reconcile-column:nth-child(n) .recon-section { border: 1px solid var(--border) !important; }
html body #tab-reconciliation-center .reconcile-column:nth-child(n) .recon-section-title { background: transparent !important; color: var(--text) !important; border-bottom: 1px solid var(--border) !important; }
html body #tab-reconciliation-center .reconcile-column:nth-child(n) .recon-section-title i { color: var(--text-2) !important; }
/* 明细行左侧 3px 彩条 → 去掉（行与行之间已有分隔线） */
html body #tab-reconciliation-center .detail-item-row { border-left: 0 !important; }
/* 原生日期/金额输入框：浏览器默认 2px 灰框、直角 → 规范输入框（高度不变） */
html body #tab-reconciliation-center input.filter-input, html body #tab-reconciliation-center #manual-entry-date, html body #tab-profit-analysis input.filter-input {
    border: 1px solid var(--border-strong) !important; border-radius: var(--r-input) !important; background: var(--surface) !important; color: var(--text) !important; font-size: 16px !important; color-scheme: light dark;
}
html body #tab-reconciliation-center .voice-input-btn { border: 1px solid var(--border-strong) !important; background: var(--surface) !important; color: var(--text-2) !important; }
/* 选中胶囊统一主色底（原为蓝底/浅绿底/白底三种） */
html body #tab-reconciliation-center .recon-chip.active, html body #tab-reconciliation-center .recon-chip.periodic-month-chip.active,
html body #tab-reconciliation-center .prepaid-month-chip.active, html body #tab-profit-analysis .profit-filter.active {
    background: var(--brand) !important; border-color: var(--brand) !important; color: var(--on-brand) !important; font-weight: 600 !important;
}
html body #tab-reconciliation-center .manual-type-btn.active { background: var(--brand) !important; border-color: var(--brand) !important; color: var(--on-brand) !important; }
/* 盈亏分析：工具栏/导入按钮没有 .btn 基础类，呈浏览器默认黑框 → 规范按钮 */
html body #tab-profit-analysis button.btn-secondary:not(.btn), html body #tab-profit-analysis button.btn-primary:not(.btn) {
    min-height: 32px; padding: 0 14px !important; border-radius: var(--r-input) !important; border: 1px solid var(--border-strong) !important; background: var(--surface) !important;
    color: var(--text) !important; font: 400 14px var(--font-body) !important; box-shadow: none !important; align-items: center; gap: 6px; cursor: pointer;   /* 不设 display：显隐仍由原逻辑控制 */
}
html body #tab-profit-analysis button.btn-primary:not(.btn), html body #tab-profit-analysis #btn-save-profit { border-radius: var(--r-input) !important; background: var(--brand) !important; border-color: var(--brand) !important; color: var(--on-brand) !important; font-weight: 600 !important; }
html body #tab-profit-analysis .partner-card .btn, html body #tab-profit-analysis .glass .btn { font-size: 14px !important; }   /* 原 16px，不在 5 档内 */
/* 动态账本卡：右上角装饰圆盖住「自动读取收入分析」胶囊 → 去掉装饰；胶囊可换行不被裁 */
html body #tab-profit-analysis .profit-dynamic-hero::after { display: none !important; }
html body #tab-profit-analysis .profit-dynamic-sync { white-space: normal !important; max-width: 100%; }
/* 卡片标题前的蓝色粗竖条 */
html body #tab-profit-analysis .profit-dynamic-panel h3::before { display: none !important; }


/* ===== 2026-10-07 响应式加固(老板反馈 1000px 窗口: 内容被裁/月份胶囊被截/工具条叠压) ===== */
/* 数据分析 grid 的列原本按内容撑开，被宽内容撑到 940px+ 然后右侧被 overflow:hidden 裁掉；列宽改为可收缩 */
html body .deep-cost-report { grid-template-columns: minmax(0, 1fr); }
html body .deep-cost-report > *, html body .boss-cockpit, html body .boss-cockpit > * { min-width: 0; max-width: 100%; }
/* 月份工具条: 胶囊自己换行，不横滑；工具按钮另起一行不叠压 */
html body .analysis-month-toolbar { flex-wrap: wrap; row-gap: 10px; min-width: 0; }
html body .analysis-month-toolbar > .analysis-month-chip-row { flex: 1 1 auto; }
html body #tab-profit-analysis .profit-month-toolbar { flex-wrap: wrap !important; justify-content: flex-start !important; position: static; }
html body #tab-profit-analysis #profit-month-chips { flex: 1 1 auto !important; min-width: 0; }
html body #tab-profit-analysis .profit-month-tools { flex: 1 1 auto !important; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }

/* 经营大屏等无二级导航的页签: 不再留出一整行空白(抬头与胶囊位置不变，只是下方内容上移) */
/* 盈亏分析工具条做成规范卡片 */
html body #tab-profit-analysis .profit-month-toolbar { padding: 12px 16px !important; background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: 16px !important; box-shadow: none !important; backdrop-filter: none !important; }
/* 图表配色收敛: 薄荷=主色(收入/起点)，中性灰=小计/支出，红=亏损/超线 */
html body #cockpit-mount .ck-wf .bar.start { background: var(--brand) !important; }
html body #cockpit-mount .ck-wf .bar.sub { background: rgba(var(--sl-rgb), 0.28) !important; }
html body #cockpit-mount .ck-wf .bar.inc { background: rgba(var(--green-rgb), 0.55) !important; }
html body #cockpit-mount .ck-wf .bar.dec { background: rgba(var(--red-rgb), 0.7) !important; }
/* 没有二级导航的页签(经营大屏)：页面脚本把它设为 display:none，之前被 !important 盖掉了所以留一整行空白 */
html body .sub-nav-bar[style*="display: none"], html body .sub-nav-bar[style*="display:none"] { display: none !important; }

/* 窄桌面(约 1000px)下不再需要左右滑才能看全: 周单卡片/状态卡/校核汇总自动换行；周单卡片圆角按规范(原 9999px 变椭圆) */
html body .inventory-week-cards { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 12px !important; overflow: visible !important; align-items: stretch !important; }
html body .inventory-week-card { width: auto !important; min-width: 0 !important; height: auto !important; min-height: 76px !important; border-radius: 16px !important; padding: 12px 16px !important; }
html body .inventory-status-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important; }
html body .prepaid-audit-summary-bar { flex-wrap: wrap !important; overflow: visible !important; row-gap: 10px; }
html body .prepaid-audit-summary-bar .audit-stat-group { flex-shrink: 1; }
/* 抬头/卡片里的小按钮文字不折行 */
html body .btn, html body .btn-primary, html body .btn-secondary { white-space: nowrap; }


/* ===== 2026-10-07 第二轮(老板反馈) ===== */
/* 一种语义色只有一个值：红=--red，图表填充用 *-fill(浅色下比文字色更亮，深色下与文字色相同) */
html body #cockpit-mount .ck-wf .bar.dec, html body #cockpit-mount .hr .track .fill.over { background: var(--red) !important; }
html body #cockpit-mount .hr .track .fill.over { opacity: 1; }
html body #cockpit-mount .hr .track { height: 8px; border-radius: 9999px; }
html body #cockpit-mount .hr .track .fill { border-radius: 9999px; }
html body #cockpit-mount .ck-vb-bad { color: var(--red) !important; background-color: var(--red-bg) !important; border-color: var(--red) !important; }
html body #cockpit-mount .sev.hi { color: var(--red) !important; background-color: var(--red-bg) !important; }
html body [style*="background:var(--green)"], html body [style*="background: var(--green)"], html body [style*="background-color:var(--green)"], html body [style*="background-color: var(--green)"],
html body [style*="background:var(--brand-ink)"], html body [style*="background: var(--brand-ink)"] { background: var(--green-fill) !important; }
html body [style*="background:var(--yellow)"], html body [style*="background: var(--yellow)"], html body [style*="background-color:var(--yellow)"], html body [style*="background-color: var(--yellow)"] { background: var(--yellow-fill) !important; }
html body [style*="background:var(--blue)"], html body [style*="background: var(--blue)"], html body [style*="background-color:var(--blue)"], html body [style*="background-color: var(--blue)"] { background: var(--blue-fill) !important; }
html body .rpt-dot, html body .ck-vdot { background: var(--green-fill); }
/* 月份折叠：新的在前，旧的收进「更早 N 个月」 */
html body .ui-fold-hide { display: none !important; }
html body .ui-fold-toggle {
    min-height: 32px; padding: 0 14px; border-radius: var(--r-pill); border: 1px dashed var(--border-strong); background: transparent; color: var(--text-2);
    font-size: 14px; font-weight: 400; cursor: pointer; display: inline-flex; align-items: center; position: relative; white-space: nowrap;
}
html body .ui-fold-toggle:hover { color: var(--text); border-color: var(--text-3); }
html body .ui-fold-toggle::after { content: ""; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px; }
/* 月份工具条：胶囊在左、操作在右，同一行；放不下才整体换行 */
html body .deep-cost-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; justify-content: flex-start; }
html body .deep-cost-actions > .analysis-month-chip-row { flex: 1 1 auto; }
html body .deep-cost-toolbar { padding: 12px 16px; }
html body .analysis-month-toolbar { align-items: center; }

/* 菜品销售导航：与其他页面同款胶囊；容器随内容增高(不再裁掉第二行)；分类胶囊自动换行不再左右滑 */
html body .dish-shared-nav { height: auto !important; min-height: 64px; padding: 12px 16px !important; align-items: center; }
html body .dish-shared-nav .analysis-month-chip { background: var(--surface) !important; border: 1px solid var(--border) !important; box-shadow: none !important; font-size: 14px !important; font-weight: 400 !important; min-height: 32px !important; height: 32px !important; padding: 0 14px !important; color: var(--text-2) !important; }
html body .dish-shared-nav .analysis-month-chip.active { background: var(--brand) !important; border-color: var(--brand) !important; color: var(--on-brand) !important; font-weight: 600 !important; }
html body .dish-shared-context .dish-category-chips { display: grid !important; grid-auto-flow: row !important; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)) !important; grid-auto-columns: auto !important; overflow: visible !important; gap: 8px !important; }

html body #tab-dish-sales .dish-top-category-bar { height: auto !important; min-height: 58px; overflow: visible !important; }
html body #tab-dish-sales .dish-top-category-bar .dish-category-chips { min-width: 0 !important; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)) !important; overflow: visible !important; }
/* 大屏条形图细一点、不压人；同一红色 */
html body #cockpit-mount .ck-wf .bar { height: 8px !important; top: 50% !important; transform: translateY(-50%); border-radius: 9999px !important; }
html body #cockpit-mount .hr .track { height: 6px !important; }
html body #cockpit-mount .kv > span:first-child { white-space: nowrap; }

/* ===== 经营大屏：结论 + 四个指标(方向 B+C) ===== */
html body .ck-brief { display: flex; flex-direction: column; gap: 12px; }
html body .ck-brief-hero { background: var(--brand); color: var(--on-brand); border-radius: var(--r-panel); padding: 20px 24px; }
html body .ck-brief-hero.caution { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 2px solid var(--yellow); border-radius: var(--r-card); }
html body .ck-brief-k { font-size: 12px; opacity: .8; }
html body .ck-brief-t { font-size: 24px; font-weight: 600; line-height: 1.3; margin: 4px 0; }
html body .ck-brief-s { font-size: 14px; }
html body .ck-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
html body .ck-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 14px 16px; min-width: 0; }
html body .ck-kpi-l { font-size: 12px; color: var(--text-2); }
html body .ck-kpi-v { font-size: 24px; font-weight: 600; line-height: 1.3; margin: 2px 0; font-variant-numeric: tabular-nums; }
html body .ck-kpi-v.neg { color: var(--red); } html body .ck-kpi-v.pos { color: var(--green); }
html body .ck-kpi-s { font-size: 12px; color: var(--text-3); }
html body .ck-kpi-bar { height: 6px; border-radius: 9999px; background: var(--neutral-bg); margin: 8px 0 6px; overflow: hidden; }
html body .ck-kpi-bar i { display: block; height: 100%; border-radius: 9999px; background: var(--brand); }
html body .ck-brief-next { list-style: none; margin: 0; padding: 4px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
html body .ck-brief-next li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
html body .ck-brief-next li:last-child { border-bottom: 0; }
html body .ck-brief-next b { font-weight: 600; min-width: 36px; } html body .ck-brief-next b.neg { color: var(--red); }
html body #cockpit-mount .ck-verdict { font-size: 12px; color: var(--text-2); background: transparent; border: 0; padding: 0 4px; }

/* 财务对账·定期结算专区：分类/月份胶囊自动换行，不再出现横向滚动条把「结算…」截掉(窄列只有 280px) */
html body #tab-reconciliation-center .recon-chip-row { flex-wrap: wrap !important; overflow: visible !important; row-gap: 8px; }
html body #tab-reconciliation-center .recon-chip-row::-webkit-scrollbar { display: none; }
html body #tab-reconciliation-center .check-badge { font-size: 14px; font-weight: 600; }
/* 定期结算专区：分类胶囊与月份胶囊同一套样式(同高、同选中色)；「结算」是操作按钮，不是筛选胶囊，单独靠右并做成有边框的按钮 */
html body #tab-reconciliation-center .recon-chip { height: 32px; min-height: 32px; padding: 0 14px; background: var(--surface); }
html body #tab-reconciliation-center #periodic-category-chips .recon-chip.active { background: var(--brand) !important; border-color: var(--brand) !important; color: var(--on-brand) !important; font-weight: 600; }
html body #tab-reconciliation-center .periodic-settle-action { margin-left: auto; height: 32px; padding: 0 14px; border: 1px solid var(--border-strong) !important; border-radius: var(--r-input) !important; background: var(--surface) !important; color: var(--text) !important; font-weight: 600; }
