/* ============ Soft Minimal 工作台（2026-08-24 方案版：浅灰画布 + 边框分层 + 高密度数据优先） ============ */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  /* Apple 既视感令牌（2026-08-25 精调方案：白与浅灰主角，蓝只用于行动/当前态） */
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --surface-subtle: #FBFBFD;
  --text: #1D1D1F;
  --text-muted: #6E6E73;
  --border: #D2D2D7;
  --accent: #0071E3;
  --accent-hover: #0077ED;
  --accent-soft: #EAF3FF;
  --success: #248A3D;
  --warning: #A15C00;
  --danger: #D70015;
  --danger-soft: #FFF1F2;
  /* 旧名兼容映射 */
  --card: #FFFFFF;
  --label: #1D1D1F;
  --sub: #6E6E73;
  --sep: #D2D2D7;
  --sep-strong: #C7C7CC;
  --blue: #0071E3;
  --blue-soft: #EAF3FF;
  --green: #248A3D;
  --red: #D70015;
  --orange: #A15C00;
  /* 形状：控件 10 / 容器 16 / 浮层 20 */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 20px;
  /* 阴影：常规容器只用边框；浮层单一柔和阴影 */
  --shadow-sm: 0 0 0 1px var(--border);
  --shadow-md: 0 0 0 1px var(--border), 0 4px 12px rgba(0, 0, 0, .05);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, .08);
}
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; padding-bottom: 40px;
}
main { max-width: 1280px; margin: 0 auto; padding: 24px 24px 0; }
.view-page { animation: fadeIn .14s ease; }
.muted { color: var(--text-muted); }
/* 跳到主内容：默认视觉隐藏，仅键盘聚焦时出现（无障碍保留，不破坏首屏） */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 300; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0; font-size: 14px; font-weight: 600; }
.skip-link:focus { left: 0; }
/* 通用焦点环（与品牌色一致） */
:focus-visible { outline: 2px solid rgba(0, 113, 227, .5); outline-offset: 2px; border-radius: 4px; }

/* ---------- 顶部导航（非胶囊；激活态浅蓝底 + 底部 2px 标识） ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(251, 251, 253, .86); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); border-bottom: 1px solid rgba(0, 0, 0, .08); padding-top: env(safe-area-inset-top); }
.nav-inner { max-width: 1280px; margin: 0 auto; padding: 10px 24px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; }
.nav-title h1 { font-size: 20px; font-weight: 700; letter-spacing: -.3px; display: flex; align-items: center; gap: 8px; text-wrap: balance; }
.nav-logo { height: 26px; width: auto; }
.nav-title p { font-size: 12px; color: var(--text-muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 560px; }
.nav-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.user-name { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.tabs-nav { max-width: 1280px; margin: 0 auto; padding: 6px 24px 10px; display: flex; gap: 2px; overflow-x: auto; }
.tabs-nav .tab { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; color: var(--text-muted); background: transparent; cursor: pointer; transition: background .14s, color .14s; position: relative; touch-action: manipulation; border: none; font-family: inherit; }
.tabs-nav .tab:hover { background: var(--surface-subtle); color: var(--text); }
.tabs-nav .tab.on { background: var(--accent-soft); color: var(--accent); }
.tabs-nav .tab.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent); }
.tabs-nav .tab svg { width: 18px; height: 18px; flex-shrink: 0; }
.dot { position: absolute; top: 2px; right: 4px; min-width: 16px; height: 16px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 1.5px solid var(--bg); }
.dot.gray { background: var(--text-muted); }

/* ---------- 底部导航（移动端，方案 8.2） ---------- */
.bottom-nav { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
.bn-item { flex: 1; max-width: 96px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: none; color: var(--text-muted); font-size: 11px; font-weight: 600; cursor: pointer; padding: 6px 4px; border-radius: var(--radius-sm); font-family: inherit; touch-action: manipulation; position: relative; }
.bn-item svg { width: 22px; height: 22px; }
.bn-item.on { color: var(--accent); }
.bn-item .dot { position: absolute; top: 0; right: 14px; }

/* ---------- 登录页 ---------- */
.login-view { min-height: 100dvh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #EEF3F8 0%, #F6F7F9 55%); padding: 24px; }
.login-card { background: var(--surface); border-radius: 16px; padding: 32px 30px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); text-align: center; }
.login-logo-img { width: 200px; max-width: 78%; height: auto; margin: 0 auto 6px; display: block; }
.login-card h1 { font-size: 20px; font-weight: 700; margin-top: 10px; }
.login-sub { font-size: 13px; color: var(--text-muted); margin: 6px 0 20px; }
.login-seg { display: flex; background: var(--surface-subtle); border-radius: 8px; padding: 4px; margin-bottom: 20px; }
.login-seg .tab { flex: 1; text-align: center; padding: 8px 0; border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer; touch-action: manipulation; }
.login-seg .tab.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(30, 41, 54, .08); }
#loginForm { text-align: left; }
.login-card .field input { background: var(--surface-subtle); }
.login-tip { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 14px; }
.remember-row { display: flex; justify-content: flex-start; align-items: center; margin: 2px 0 12px; }
.remember { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-muted); cursor: pointer; user-select: none; }
.remember input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.ios-btn.block { width: 100%; padding: 12px; font-size: 15px; margin-top: 6px; }

/* ---------- 按钮（8px 圆角，无彩色阴影；主操作唯一强调） ---------- */
.ios-btn { border: none; border-radius: var(--radius-sm); padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform .08s ease, opacity .14s, background .14s, box-shadow .14s; touch-action: manipulation; font-family: inherit; }
.ios-btn:hover { filter: brightness(1.03); }
.ios-btn:active { transform: scale(.98); opacity: .88; }
.ios-btn.primary { background: var(--accent); color: #fff; box-shadow: none; }
.ios-btn.primary:hover { background: #295f8c; }
.ios-btn.ghost { background: var(--surface-subtle); color: var(--text); }
.ios-btn.ghost:hover { background: #E7EAEE; }
.ios-btn.danger { background: var(--danger); color: #fff; }
.ios-btn.dark { background: #E7EAEE; color: var(--text); }
.ios-btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }
.link-btn { background: none; border: none; color: var(--accent); font-size: 13px; cursor: pointer; padding: 2px 6px; border-radius: 4px; touch-action: manipulation; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }
button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 卡片（边框分层，不用阴影堆叠） ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; border: 1px solid var(--border); box-shadow: none; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.card-head h2 { font-size: 16px; font-weight: 700; letter-spacing: -.1px; text-wrap: balance; }
.panel-ops { display: flex; gap: 8px; flex-wrap: wrap; }
.count { color: var(--text-muted); font-size: 12px; font-weight: 400; margin-left: 4px; }
.count.danger { color: var(--danger); }

/* ---------- 筛选 ---------- */
.filters { display: flex; flex-direction: column; gap: 14px; }
.f-label { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.f-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sep { color: var(--text-muted); }
select, input, textarea {
  font-family: inherit; font-size: 14px; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface);
  transition: border-color .14s, box-shadow .14s, background .14s;
}
select:focus, input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 111, 159, .14); background: #fff; outline: none; }
textarea { resize: vertical; width: 100%; }

/* 筛选摘要（方案 6.2：单行摘要 + 按需抽屉） */
.filter-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fs-item { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: var(--radius-sm); cursor: pointer; touch-action: manipulation; font-family: inherit; min-height: 36px; }
.fs-item:hover { border-color: var(--accent); color: var(--accent); }
.fs-item .fs-k { color: var(--text-muted); font-weight: 500; margin-right: 2px; }
.fs-item.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.fs-item.primary:hover { color: #fff; }
/* 筛选折叠（PC/移动一致：默认收起成「筛选条件」按钮，点开展开；报表页使用） */
.filter-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 2px; touch-action: manipulation; font-family: inherit; }
.filter-toggle:hover { background: var(--surface-subtle); }
.filter-toggle .ft-arrow { color: var(--text-muted); font-size: 12px; }
.filter-body { display: none; flex-direction: column; gap: 14px; }
.filter-body.open { display: flex; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 12.5px; color: var(--text); user-select: none; transition: background .14s, border-color .14s, color .14s; touch-action: manipulation; font-family: inherit; }
.chip:hover { border-color: var(--accent); }
/* 选中态：浅蓝底 + 深色字 + 细描边（方案 P0.3，不用满蓝大胶囊） */
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* 店铺按平台分组（需求4） */
.shop-groups { display: flex; flex-direction: column; gap: 10px; }
.sgroup-name { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }

/* 日期单独常驻栏（需求3） */
.date-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 已选标签（需求4：标签展示、可单独删除、一键清空） */
.sel-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.sel-tag-label { font-size: 12px; color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.sel-tags-wrap { display: flex; gap: 6px; flex-wrap: wrap; }
.sel-tag { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: var(--surface-subtle); color: var(--text); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; font-family: inherit; touch-action: manipulation; }
.sel-tag:hover { border-color: var(--accent); color: var(--accent); }
.sel-tag-x { color: var(--text-muted); font-size: 13px; line-height: 1; margin-left: 2px; }

/* 标签式多选框（需求4：输入框样式的容器，内放已选标签，点开分组选择器） */
.multi-select { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 7px 10px; min-height: 44px; cursor: pointer; transition: border-color .14s, box-shadow .14s; touch-action: manipulation; }
.multi-select:hover, .multi-select:focus-visible { border-color: var(--accent); }
.multi-select:focus-visible { box-shadow: 0 0 0 3px rgba(0, 113, 227, .14); }
.ms-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.ms-tag { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 500; cursor: pointer; font-family: inherit; touch-action: manipulation; }
.ms-tag:hover { background: var(--accent); color: #fff; }
.ms-tag-x { font-size: 13px; line-height: 1; margin-left: 2px; }
.ms-placeholder { color: var(--text-muted); font-size: 13px; }
.shop-picker { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 8px; background: var(--surface); }

.metric-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.mgroup { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.mgroup h4 { font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 8px 12px 6px; display: flex; justify-content: space-between; align-items: center; letter-spacing: .3px; background: var(--surface-subtle); }
.mgroup h4 a { font-weight: 500; letter-spacing: 0; }
.mitem { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 13.5px; cursor: pointer; border-top: 1px solid var(--border); transition: background .1s; touch-action: manipulation; }
.mitem:first-of-type { border-top: none; }
.mitem:hover { background: var(--accent-soft); }
.mitem .hint { color: var(--text-muted); font-size: 11px; margin-left: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.mitem input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; }

/* ---------- KPI（无彩色顶边；默认 4 项，数字右对齐） ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; border: 1px solid var(--border); box-shadow: none; }
.kpi .k { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.kpi .v { font-size: 22px; font-weight: 700; letter-spacing: -.3px; margin-top: 2px; font-variant-numeric: tabular-nums; text-align: right; }
.kpi.neg .v { color: var(--danger); }
.kpi .s { font-size: 11px; color: #9AA2AC; margin-top: 2px; text-align: right; }
/* 「更多指标」改为 KPI 标题行右侧的文字入口（方案 4.3，不再用虚线大卡） */
.kpi-more { display: inline-flex; align-items: center; gap: 2px; border: none; background: none; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; padding: 8px 2px; min-height: 36px; font-family: inherit; touch-action: manipulation; }
.kpi-more:hover { color: var(--accent-hover); text-decoration: underline; }

/* 报表指标汇总（需求 2026-08-25：统一卡片尺寸、左对齐、5/3/2 断点、无×、无阴影/渐变/蓝边/抬升） */
.kpis-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.kpis-title { font-size: 15px; font-weight: 700; color: var(--text); }
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; justify-content: start; margin-bottom: 16px; }
.rpkpi { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; height: 104px; padding: 10px 8px 8px; background: #FFFFFF; border: 1px solid #D2D2D7; border-radius: 12px; cursor: pointer; overflow: hidden; }
.spark-wrap { display: flex; justify-content: center; width: 100%; color: var(--accent); line-height: 0; }
.spark { display: block; width: 100%; height: 32px; }
.rpkpi-num { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; width: 100%; }
.rpkpi-num .v { font-size: 18px; font-weight: 700; color: #1D1D1F; font-variant-numeric: tabular-nums; line-height: 1.25; white-space: nowrap; }
.rpkpi.neg .v { color: var(--danger); }
.rpkpi-num .k { font-size: 12px; color: #6E6E73; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 1024px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } .rpkpi { height: 96px; } .rpkpi-num .v { font-size: 16px; } }

/* ---------- 二级工作标签（方案 6.6：账本数据 / 差异处理） ---------- */
.workspace-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.wtab { background: none; border: none; padding: 9px 14px; font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: inherit; touch-action: manipulation; }
.wtab:hover { color: var(--text); }
.wtab.on { color: var(--accent); border-bottom-color: var(--accent); }
.wtab .count { font-weight: 500; }

/* ---------- 供应商对账 / 异常订单 ---------- */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.sup-check-text { white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.7; background: var(--surface-subtle); border-radius: var(--radius-sm); padding: 14px; }
.exc-pending { color: var(--warning); font-weight: 700; }
.exc-amt-done { color: var(--success); font-weight: 700; }
.exc-row-done td { background: #F2F8F5; }
.exc-row-done:hover td { background: #E8F3ED !important; }
#supTable td, #supErpTable td { white-space: nowrap; }
#supErpCard .f-controls { margin-left: auto; }

/* ---------- 服务器页：三模式链路 ---------- */
.sv-chain { display: flex; flex-direction: column; gap: 0; }
.sv-node { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.sv-node-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-weight: 800; font-size: 15px; }
.sv-node-head.file { background: #EEF3F8; color: #1F3A66; }
.sv-node-head.local { background: #EDF6F1; color: #14532D; }
.sv-node-head.cloud { background: #FAF3E8; color: #7C4A03; }
.sv-tag { font-size: 11px; font-weight: 600; background: rgba(255, 255, 255, .75); border-radius: 999px; padding: 2px 10px; color: inherit; }
.sv-node-body { padding: 12px 16px; font-size: 13px; }
.sv-row { display: flex; gap: 8px; margin-bottom: 6px; align-items: baseline; }
.sv-row span { color: var(--text-muted); min-width: 88px; flex-shrink: 0; }
.sv-path { word-break: break-all; font-size: 12px; }
.sv-list { margin: 6px 0 0; padding-left: 18px; color: #3C4351; line-height: 1.75; }
.sv-arrow { text-align: center; color: var(--accent); font-size: 12.5px; font-weight: 600; padding: 8px 4px; line-height: 1.6; }
.sv-sync-map { display: flex; flex-direction: column; gap: 8px; }
.sv-sync-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; background: #fff; }
.sv-sync-item b { color: var(--accent); margin-right: 10px; white-space: nowrap; }
.sv-sync-item span { color: #3C4351; line-height: 1.65; }
.sv-feed { display: flex; flex-direction: column; gap: 10px; }
.sv-feed-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; background: #fff; }
.sv-feed-title { font-weight: 800; font-size: 14px; color: #1F3A66; margin-bottom: 6px; }
.sv-steps { margin: 0; padding-left: 20px; color: #3C4351; line-height: 1.8; font-size: 13px; }
.sv-steps code { background: var(--surface-subtle); border-radius: 5px; padding: 1px 6px; font-size: 12px; }

/* ---------- 服务器页多卡片模式（2026-08-27 重构） ---------- */
.sv-head-card .sv-head-main { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; justify-content: space-between; }
.sv-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sv-ops-head { margin: 2px 0 10px; }
.sv-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.sync-op-card { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.sync-op-card .card-head { padding: 14px 16px 0; }
.sync-op-desc { margin: 0; padding: 0 16px; font-size: 12.5px; color: var(--text-muted); line-height: 1.6; word-break: break-all; }
.sync-op-desc code { background: var(--surface-subtle); border-radius: 5px; padding: 1px 5px; font-size: 11.5px; }
.sync-op-foot { margin-top: auto; padding: 12px 16px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sync-op-foot .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 注释问号按钮：统一定义见文件末尾「问号折叠说明气泡」一节（2026-10-24 收拢，此处不再重复定义） */
/* 同步逻辑说明文档（弹窗内） */
.sync-help-doc { display: flex; flex-direction: column; gap: 14px; }
.sync-help-section { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; background: #fff; scroll-margin-top: 12px; }
.sync-help-section h4 { margin: 0 0 6px; font-size: 14px; color: #1F3A66; }
.sync-help-section p { margin: 0; font-size: 13px; color: #3C4351; line-height: 1.75; }
.sync-help-section code { background: var(--surface-subtle); border-radius: 5px; padding: 1px 6px; font-size: 12px; }
@media (max-width: 768px) {
  .sv-card-grid { grid-template-columns: 1fr; }
}

/* ---------- 服务器页二轮重构（2026-08-27，按设计建议） ---------- */
/* 运行概览 4 状态块 */
.sv-ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.sv-ov-block { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: 14px 16px; }
.sv-ov-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.sv-ov-val { font-size: 17px; font-weight: 800; color: var(--text); }
.sv-ov-val.ok { color: var(--success, #248A3D); }
.sv-ov-val.warn { color: var(--warning, #A15C00); }
.sv-ov-val.err { color: var(--danger, #D70015); }
/* 数据同步区 */
.sv-sync-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; }
#svSyncTable td:first-child { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#svSyncTable .sv-dir { color: var(--text-muted); font-size: 12.5px; white-space: nowrap; }
#svSyncTable .badge { white-space: nowrap; }
#svSyncTable select { max-width: 150px; padding: 5px 8px; font-size: 12.5px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); cursor: pointer; }
#svSyncTable select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* 帮助按钮（问号圆钮）：统一定义见文件末尾，此处不再重复定义 */
/* 三节点链路简图 */
.sv-nodes3 { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sv-node3 { flex: 1; min-width: 140px; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: #fff; }
.sv-node3.current { border-color: var(--accent); background: var(--accent-soft); }
.sv-node3-name { font-weight: 800; font-size: 15px; }
.sv-node3-role { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.sv-node3-status { font-size: 12px; color: var(--accent); margin-top: 6px; font-weight: 600; }
.sv-node3-arrow { align-self: center; color: var(--text-muted); font-size: 12.5px; font-weight: 600; padding: 0 2px; white-space: nowrap; }
/* 技术详情折叠 */
.sv-tech-details { border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; margin-bottom: 12px; }
.sv-tech-details summary { cursor: pointer; padding: 10px 14px; font-size: 13px; color: var(--accent); font-weight: 600; }
.sv-tech-body { padding: 4px 14px 12px; }
/* 系统维护分区 */
.sv-maint-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.sv-maint-item { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: 14px 16px; }
.sv-maint-title { font-weight: 800; font-size: 14.5px; margin-bottom: 6px; }
.sv-maint-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin: 0 0 12px; word-break: break-all; }
.sv-maint-desc code { background: var(--surface-subtle); border-radius: 5px; padding: 1px 5px; font-size: 11.5px; }
/* 同步设置弹窗分段 */
.seg-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.seg-tab { border: none; background: none; padding: 8px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent; }
.seg-tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.cfg-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
/* 预览全部变更弹窗 */
.sync-all-groups { display: flex; flex-direction: column; gap: 12px; }
.sync-all-group { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.sync-all-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: var(--surface-subtle); border-bottom: 1px solid var(--border); }
.sync-all-name { font-weight: 800; font-size: 14px; }
.sync-all-head .badge { margin-left: auto; }
.sync-all-items { max-height: 260px; overflow: auto; padding: 6px 8px; }
.sync-all-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; font-size: 13px; border-radius: 8px; cursor: pointer; }
.sync-all-item:hover { background: var(--surface-subtle); }
.sync-all-item input { flex-shrink: 0; }
.sync-all-main { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-all-tag { font-size: 11px; padding: 1px 7px; border-radius: 9px; font-weight: 600; flex-shrink: 0; }
.sync-all-tag.new { background: #E8F5E9; color: #2E7D32; }
.sync-all-tag.ov { background: #FFF3E0; color: #E65100; }
.sync-all-dir { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.sync-all-val { font-size: 12px; color: #3C4351; margin-left: auto; text-align: right; word-break: break-all; }
@media (max-width: 768px) {
  .sv-ov-grid { grid-template-columns: repeat(2, 1fr); }
  .sv-nodes3 { flex-direction: column; }
  .sv-node3-arrow { align-self: flex-start; transform: rotate(90deg); padding: 4px 0; }
  .sync-all-item { flex-wrap: wrap; }
  .sync-all-val { margin-left: 0; width: 100%; text-align: left; }
}



/* ---------- 表格（静音：表头 #F5F5F7、行分隔 rgba(0,0,0,.08)、极浅 hover） ---------- */
.table-wrap { overflow: auto; max-height: 560px; border-radius: 16px; border: 1px solid var(--border); background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 13px; white-space: nowrap; }
thead th { position: sticky; top: 0; z-index: 2; background: #F5F5F7; color: var(--text-muted); font-weight: 700; font-size: 12px; padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(0, 0, 0, .08); cursor: pointer; }
thead th.num, td.num { text-align: right; }
.sort-arrow { margin-left: 2px; color: var(--accent); font-size: 10px; }
/* 报表页表格排序（2026-09-21 新增）：点表头排序，箭头 + 高亮指示当前列与方向 */
#rpTable thead th[data-k] { cursor: pointer; user-select: none; }
#rpTable thead th[data-k]:hover { background: #ECECEF; }
#rpTable thead th[aria-sort="ascending"], #rpTable thead th[aria-sort="descending"] { color: var(--accent); }
#rpTable thead th.rp-nosort { cursor: default; }
.table-note { color: var(--text-muted); font-size: 12px; margin: -2px 0 8px; }
tbody td { border-bottom: 1px solid rgba(0, 0, 0, .08); padding: 9px 12px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.row-click { cursor: pointer; transition: background .1s; }
tbody tr.row-click:hover { background: #F5F5F7; }

/* 对账页数据明细：店铺列 + 日期列冻结 */
#dataTable thead th:nth-child(1), #dataTable thead th:nth-child(2) {
  position: sticky; left: 0; z-index: 5;
  min-width: 168px; max-width: 168px; overflow: hidden; text-overflow: ellipsis;
}
#dataTable thead th:nth-child(2) { left: 168px; min-width: 104px; max-width: 104px; }
#dataTable tbody td:nth-child(1) {
  position: sticky; left: 0; z-index: 3; background: #fff;
  min-width: 168px; max-width: 168px; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 1px 0 0 var(--border);
}
#dataTable tbody td:nth-child(2) {
  position: sticky; left: 168px; z-index: 3; background: #fff;
  min-width: 104px; max-width: 104px;
  box-shadow: 1px 0 0 var(--border);
}
#dataTable tbody tr:hover td:nth-child(1), #dataTable tbody tr:hover td:nth-child(2) { background: #F4F7FA; }
tfoot td { background: var(--surface-subtle); font-weight: 700; padding: 9px 12px; text-align: right; border-top: 2px solid var(--accent); font-variant-numeric: tabular-nums; }
tfoot td:first-child, tfoot td:nth-child(2) { text-align: left; }
td.num { font-variant-numeric: tabular-nums; }
td.metric-cell { cursor: pointer; transition: background .1s; touch-action: manipulation; }
td.metric-cell:hover { background: #FBF4E4; }
td.metric-cell.marked { background: #F9F0D8; }
.mk-badge { display: inline-block; margin-left: 6px; font-size: 10px; background: var(--warning); color: #fff; border-radius: 6px; padding: 1px 6px; font-weight: 700; }
.mk-badge.done { background: var(--success); }
.mk-badge.ignore { background: var(--text-muted); }
.neg { color: var(--danger); }
.tip { font-size: 12px; color: var(--text-muted); margin-top: 10px; }
.tip code { background: var(--surface-subtle); padding: 1px 6px; border-radius: 5px; font-size: 11px; }

/* ---------- 差异标记 ---------- */
.marks-filter { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.marks-wrap { max-height: 420px; }
.badge { display: inline-block; border-radius: 6px; padding: 2px 9px; font-size: 12px; font-weight: 600; }
.badge.差异 { background: #F9E9EA; color: var(--danger); }
.badge.已确认一致 { background: #E7F2EC; color: var(--success); }
.badge.待确认 { background: var(--accent-soft); color: var(--accent); }
.badge.disp.待处理 { background: #F9F0E0; color: var(--warning); }
.badge.disp.已解决 { background: #E7F2EC; color: var(--success); }
.badge.disp.忽略 { background: var(--surface-subtle); color: var(--text-muted); }
.badge.disp.待办 { background: #F9F0E0; color: var(--warning); }
.badge.disp.进行中 { background: var(--accent-soft); color: var(--accent); }
.badge.disp.已完成 { background: #E7F2EC; color: var(--success); }
.row-ops { display: flex; gap: 6px; }

/* 首页：公告 / 任务条目（2026-08-25） */
.home-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; background: var(--surface); }
.home-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.home-item-meta { color: var(--text-muted); font-size: 12px; margin-left: auto; }
.home-item-body { font-size: 13.5px; color: var(--text); line-height: 1.7; margin-top: 4px; }
.home-item-ops { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- 弹窗（16px；浮层单一柔和阴影） ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(30, 41, 54, .42); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(2px); animation: fadeIn .14s ease; overflow-y: auto; padding: 24px 0; overscroll-behavior: contain; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { margin: auto; background: var(--surface); border-radius: var(--radius-lg); max-width: 1180px; width: 94%; max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .16s cubic-bezier(.2, .9, .3, 1.1); overflow: hidden; overscroll-behavior: contain; }
@keyframes pop { from { transform: scale(.97) translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail-modal { max-width: 1300px; }
.mark-modal { max-width: 620px; }
.import-modal { max-width: 640px; }
.cost-style-modal { max-width: 860px; }
.changelog-modal { max-width: 720px; }
.changelog-entry { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 12px; background: var(--surface-subtle); }
.changelog-entry h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.changelog-entry .cl-time { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.changelog-entry .cl-detail { font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; color: #3A404C; }
.changelog-entry .cl-files { font-size: 12px; color: var(--text-muted); margin-top: 6px; word-break: break-all; }
.changelog-entry .cl-backup { font-size: 12px; color: var(--accent); margin-top: 4px; }
.changelog-empty { text-align: center; color: var(--text-muted); padding: 30px 0; }
/* --------------------------------------------------------------------------
   更新日志 v2（2026-10-31 用户要求）
   分大小版本 / 只提炼重点 / 最新在最上 / 折叠起来点开才是详情
   原来的 .changelog-entry 那套保留不动（还有别处在用），这里是新的 .cl-*
   -------------------------------------------------------------------------- */
.changelog-modal .detail-body { padding: 14px 16px 18px; }
.cl-list { display: flex; flex-direction: column; gap: 10px; }
.cl-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-subtle); overflow: hidden;
}
.cl-item.is-new { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(32, 98, 230, .09); }
.cl-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 11px 14px 5px; border: 0; background: transparent;
  text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.cl-ver {
  flex: none; padding: 1px 7px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; color: #fff; background: #2062e6;
  font-variant-numeric: tabular-nums;
}
.cl-ver.minor { background: #7a8699; }
.cl-lvl { flex: none; font-size: 11px; color: var(--text-muted); }
.cl-tt {
  flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cl-day { flex: none; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cl-chev {
  flex: none; width: 12px; height: 12px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  color: var(--text-muted); transition: transform .16s ease;
}
.cl-item.open .cl-chev { transform: rotate(180deg); }
.cl-sum { padding: 0 14px 11px; font-size: 13px; line-height: 1.6; color: #5b6472; }
.cl-body { padding: 0 14px 13px; border-top: 1px dashed var(--border); }
.cl-ul { margin: 10px 0 0; padding-left: 17px; }
.cl-ul li { font-size: 13px; line-height: 1.75; color: #3A404C; margin-bottom: 5px; }
.cl-ul li:last-child { margin-bottom: 0; }
.cl-ul li::marker { color: var(--accent); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.x { background: var(--surface-subtle); border: none; color: var(--text); width: 30px; height: 30px; border-radius: 50%; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .14s; touch-action: manipulation; }
.x:hover { background: #E2E6EB; }

.tabs { display: flex; gap: 4px; padding: 12px 20px 0; flex-wrap: wrap; flex-shrink: 0; }
.tab { padding: 7px 14px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-muted); background: var(--surface-subtle); transition: background .14s, color .14s; border: none; touch-action: manipulation; font-family: inherit; }
.tab:hover { background: #E7EAEE; }
.tab.on { background: var(--accent); color: #fff; }
.detail-body { padding: 16px 20px 20px; overflow: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
.detail-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ds-card { background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 14px; min-width: 120px; }
.ds-card .v { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.ds-card .k { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.detail-body .table-wrap { max-height: 420px; }
.detail-body h4 { margin: 12px 0 6px; font-size: 14px; color: var(--text-muted); font-weight: 700; }

/* 表单 */
.form-section { font-size: 12.5px; font-weight: 700; color: var(--accent); margin: 16px 0 8px; padding-left: 10px; border-left: 3px solid var(--accent); letter-spacing: .2px; }
.form-section:first-of-type { margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; }
#mfAuto { background: var(--surface-subtle); color: var(--text-muted); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; flex-wrap: wrap; }

/* 差异详情 */
.mark-detail-modal { max-width: 680px; }
.md-headline { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.md-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.md-note { background: var(--surface-subtle); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 14px; }
.conclusion { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 12px 16px; margin: 8px 0 8px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; }
.disp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.code-sample { background: var(--surface-subtle); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 12.5px; line-height: 1.7; overflow-x: auto; margin: 8px 0 12px; font-family: "SF Mono", Consolas, monospace; color: #3A404C; }

/* 导入预览清单 + 重复策略 + 导入历史 */
.import-preview { margin-top: 10px; }
.dup-box { margin: 10px 0; padding: 10px 14px; border: 1px solid #E8C98F; background: #FDF7EC; border-radius: var(--radius-sm); }
.dup-box .form-section { color: #8A5A12; }
.dup-options { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.dup-options label { display: inline-flex; align-items: center; gap: 5px; }
.hist-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; }
.hist-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; cursor: pointer; user-select: none; border-radius: 6px; padding: 2px 4px; }
.hist-head:hover { background: var(--surface-subtle); }
.hist-arrow { font-size: 11px; color: var(--accent); width: 14px; text-align: center; }
.hist-time { font-weight: 700; font-size: 13.5px; }
.hist-head .count { font-size: 12px; color: #8A9099; }
.hist-items { margin-top: 6px; }

/* 工单页 */
.ticket-modal .modal { max-width: 640px; }
.ticket-title { color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.ticket-title:hover { opacity: 0.8; }

/* ---------- 报表页 ---------- */
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg .tab { padding: 7px 14px; }
.metric-sort { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.sort-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 600;
  cursor: grab; user-select: none;
  box-shadow: none; transition: box-shadow .12s, opacity .12s;
  touch-action: none;
}
.sort-chip:active { cursor: grabbing; }
.sort-chip:hover { box-shadow: 0 4px 10px rgba(47, 111, 159, .25); }
.sort-chip .grip { opacity: .7; font-size: 13px; letter-spacing: -2px; }
.sort-chip .hint { color: rgba(255, 255, 255, .75); font-size: 11px; font-weight: 400; }
.sort-chip-x { background: none; border: none; color: rgba(255, 255, 255, .85); font-size: 14px; line-height: 1; cursor: pointer; padding: 0 0 0 4px; border-radius: 4px; font-family: inherit; touch-action: manipulation; }
.sort-chip-x:hover { color: #fff; }
.sort-chip.dragging { opacity: .4; }
.sort-chip.drop-before { box-shadow: -4px 0 0 0 var(--danger), 0 3px 10px rgba(47,111,159,.2); }
.sort-chip.drop-after { box-shadow: 4px 0 0 0 var(--danger), 0 3px 10px rgba(47,111,159,.2); }
.metric-picker { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-top: 10px; background: var(--surface); }
.picker-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* ---------- 成本维护 ---------- */
.cost-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #FDF7EC; border: 1px solid #E8C98F; }
.cost-banner-text { font-size: 14px; color: #7C5A1E; }
.red-num { color: var(--danger); font-size: 13px; }
.cost-search-bar { display: flex; gap: 10px; margin-bottom: 12px; }
.cost-search-bar input { flex: 1; }
.cost-wrap { max-height: 460px; }
.style-link { background: none; border: none; color: var(--accent); font-weight: 600; cursor: pointer; font-size: 13.5px; padding: 0; text-decoration: underline dotted; border-radius: 4px; touch-action: manipulation; font-family: inherit; }
.style-link:hover { color: #295f8c; }
.order-no { cursor: pointer; color: var(--text); font-variant-numeric: tabular-nums; border-bottom: 1px dashed var(--text-muted); touch-action: manipulation; }
.order-no:hover { color: var(--accent); }
/* 刷单对账异常订单号：加粗无下划线，悬停变蓝（2026-08-26） */
.order-no-strong {
  cursor: pointer; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums;
  background: none; border: none; padding: 0; font-family: inherit; font-size: inherit;
  touch-action: manipulation;
}
.order-no-strong:hover { color: var(--accent); }
.cost-fix-card { background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px; }
.cost-fix-card .form-section { margin-top: 0; }

/* ---------- 设置 ---------- */
.settings-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 4px; border-bottom: 1px solid var(--border); font-size: 14px; }
.settings-row b { word-break: break-all; text-align: right; }
#stDataRoot, #stMarksFile { max-width: 70%; font-size: 12.5px; }
.sync-actions { display: flex; gap: 8px; align-items: flex-end; }
.sync-accounting { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid #BBD8EE; background: #EDF5FB; border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 4px; }
.sync-accounting-text { flex: 1; min-width: 220px; font-size: 13px; color: #1D4E78; }
.sync-ok { color: var(--success); font-size: 13px; }
.sync-result { margin-top: 8px; }
.sync-last { background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.sync-err { color: var(--danger); font-size: 13px; }
.sync-block { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 12px; background: var(--surface); }
.sync-block-head { font-weight: 600; font-size: 14px; margin-bottom: 4px; color: var(--text); }
.sync-block-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; word-break: break-all; }
.mhint { display: inline-block; cursor: help; color: var(--accent); font-size: 11px; margin-left: 2px; padding: 0 2px; user-select: none; vertical-align: super; border-radius: 4px; }
.mhint:hover { opacity: .7; }
.mhint-pop { position: absolute; z-index: 180; max-width: 340px; background: #1E2936; color: #fff; font-size: 12.5px; line-height: 1.55; padding: 10px 12px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); pointer-events: none; white-space: normal; }
.src-detail { margin: 6px 0 12px; }
.src-detail h4 { margin: 10px 0 4px; font-size: 13px; color: var(--text); }
.src-detail h5 { margin: 8px 0 4px; font-size: 12.5px; color: var(--text); }
.src-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 4px 0 8px; }
.src-table th { background: var(--surface-subtle); color: #333; padding: 5px 7px; text-align: left; border: 1px solid var(--border); white-space: nowrap; }
.src-table td { border: 1px solid var(--border); padding: 4px 7px; word-break: break-all; }
.src-table td.num { text-align: right; }
.src-table td.concl-cell { white-space: pre-wrap; text-align: left; min-width: 220px; max-width: 480px; line-height: 1.55; }
.src-table tr.src-excluded { background: var(--surface-subtle); color: #9AA2AC; }
.src-table tr.src-excluded td { text-decoration: line-through; }
.src-excl-badge { display: inline-block; background: #E8EAEE; color: #7A818C; font-size: 11px; border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.src-toggle { display: flex; align-items: center; gap: 6px; margin: 12px 0 4px; padding: 8px 12px; background: var(--accent-soft); color: var(--accent); border: 1px solid #CFE0EF; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; cursor: pointer; user-select: none; touch-action: manipulation; font-family: inherit; }
.src-toggle:hover { background: #DDEBF5; }
.src-arrow { margin-left: auto; }
.excl-badge { display: inline-block; background: #F9E9EA; color: var(--danger); font-size: 10.5px; font-weight: 600; border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; }
.perm-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.perm-checks label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; cursor: pointer; padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); transition: background .12s, border-color .12s; touch-action: manipulation; }
.perm-checks label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.perm-checks input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }

/* 设置 → 数据库管理（2026-10-25）：三个上传目录的文件列表 + 下载/重命名/删除 */
.dbf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 12px; }
.dbf-tabs { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.dbf-tab { font-size: 13px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  touch-action: manipulation; }
.dbf-tab.on { color: #fff; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.dbf-bar .sycm-input { flex: 1 1 200px; min-width: 160px; max-width: 320px; }
.dbf-table { width: 100%; }
.dbf-table th, .dbf-table td { white-space: nowrap; }
.dbf-table .dbf-name { max-width: 340px; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums; }
.dbf-area { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-subtle); color: var(--text-muted); }
.dbf-a-data { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.dbf-a-cost { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.dbf-a-market { color: #0f766e; border-color: #99f6e4; background: #f0fdfa; }
.dbf-who { font-size: 12.5px; }
.dbf-who.is-unknown { color: var(--text-muted); }
.dbf-ops { display: flex; gap: 10px; }
.dbf-ops .link-btn.danger { color: #dc2626; }
@media (max-width: 768px) {
  .dbf-table .dbf-name { max-width: 150px; }
  .dbf-bar .sycm-input { max-width: none; }
}

/* 设置页菜单 */
.settings-menu { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.set-item { text-align: left; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; font-size: 15px; font-weight: 600; color: var(--text); cursor: pointer; transition: background .14s, color .14s; touch-action: manipulation; font-family: inherit; }
.set-item:hover { background: var(--surface-subtle); }
.set-item.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); box-shadow: none; }
.settings-panel { animation: fadeIn .14s ease; }
.backup-list { margin: 8px 0 12px 22px; line-height: 1.9; font-size: 13.5px; }
.backup-list code { background: var(--surface-subtle); padding: 1px 6px; border-radius: 6px; font-size: 12px; }

#markForm { padding: 4px 20px 20px; flex: 1 1 auto; overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
#markForm .form-section:first-of-type { margin-top: 6px; }

#srcMask { z-index: 150; }
.src-modal { max-width: 880px; }
.src-modal .src-modal-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding: 14px 20px 20px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.src-modal .src-modal-body .table-wrap { max-height: 46vh; }

/* Toast */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: rgba(30, 41, 54, .94); color: #fff; padding: 12px 22px; border-radius: var(--radius-sm); z-index: 200; font-size: 14px; max-width: 82vw; word-break: break-all; box-shadow: var(--shadow-lg); animation: pop .14s ease; white-space: pre-line; }
.toast.ok { background: rgba(60, 122, 94, .96); }
.toast.err { background: rgba(183, 70, 78, .96); }

/* 骨架屏 */
.skeleton { position: relative; overflow: hidden; background: #ECEFF2; border-radius: 6px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); animation: skeletonShimmer 1.3s infinite; }
@keyframes skeletonShimmer { to { transform: translateX(100%); } }

/* 筛选抽屉（方案 6.3：桌面 480px，移动端全屏由 @media 接管） */
.filter-drawer { max-width: 480px; }
/* 更多功能抽屉（移动端底部导航的收纳抽屉） */
.more-nav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.more-nav-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 14px; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; font-family: inherit; touch-action: manipulation; text-align: left; }
.more-nav-item:hover { background: var(--accent-soft); color: var(--accent); }
/* 表格分页栏 */
.table-more-bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }

/* ============================================================
   移动端（方案 8：52px 顶栏 + 底部导航 + 单页滚动 + 44px 触控）
   ============================================================ */
@media (max-width: 768px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  /* 顶栏收敛：只保留品牌与账号；模块导航移交底部 */
  .nav-inner { padding: 8px 14px 0; min-height: 44px; }
  .nav-title h1 { font-size: 18px; }
  .nav-title p { display: none; }
  .tabs-nav { display: none; }
  .bottom-nav { display: flex; }

  main { padding: 14px 12px 0; }

  /* 筛选：摘要行堆叠 + 触控 44px */
  .filters { gap: 12px; }
  .filter-summary { gap: 6px; }
  .fs-item { flex: 1 1 auto; justify-content: center; min-height: 44px; font-size: 13px; }
  .filter-toggle { min-height: 44px; }
  .f-controls select { flex: 1 1 100%; }
  .f-label { font-size: 12px; }
  .chip { padding: 8px 12px; font-size: 13px; min-height: 40px; }
  .metric-groups { grid-template-columns: 1fr; }

  /* KPI 2×2 */
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi .v { font-size: 19px; }

  /* 表格：单页纵向滚动（方案 8.3：移除 max-height 与 overflow-y 双滚动） */
  .table-wrap { max-height: none; overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; }
  #markTable th:nth-child(1), #markTable td:nth-child(1) { position: sticky; left: 0; z-index: 4; background: #fff; box-shadow: 1px 0 0 var(--border); }
  #markTable th:nth-child(2), #markTable td:nth-child(2) { position: sticky; left: 76px; z-index: 4; background: #fff; box-shadow: 1px 0 0 var(--border); }
  #rpTable th:nth-child(1), #rpTable td:nth-child(1),
  #rpTable th:nth-child(2), #rpTable td:nth-child(2) { position: sticky; z-index: 4; background: #fff; }
  #rpTable th:nth-child(1), #rpTable td:nth-child(1) { left: 0; box-shadow: 1px 0 0 var(--border); }
  #rpTable th:nth-child(2), #rpTable td:nth-child(2) { left: 32px; }
  thead th { font-size: 11.5px; padding: 8px 9px; z-index: 5; }
  table { font-size: 12.5px; }
  tbody td { padding: 8px 9px; }

  /* 弹窗 → 底部上滑 */
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal { width: 100%; max-width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; animation: sheetUp .26s cubic-bezier(.3, 1, .4, 1); }
  @keyframes sheetUp { from { transform: translateY(64px); opacity: .5; } to { transform: none; opacity: 1; } }
  .modal-head { padding: 14px 16px; border-radius: 14px 14px 0 0; }
  .tabs { padding: 10px 14px 0; }
  .detail-body { padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); }
  #markForm { padding: 2px 16px calc(16px + env(safe-area-inset-bottom)); }
  .detail-summary .ds-card { min-width: 40%; }

  .seg { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .seg .tab { flex-shrink: 0; white-space: nowrap; }
  .metric-sort { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  .sort-chip { flex-shrink: 0; }
  .metric-picker { max-height: 46vh; overflow-y: auto; }

  .cost-search-bar { flex-direction: column; align-items: stretch; }
  .cost-search-bar input { width: 100%; }
  .cost-banner { flex-direction: column; align-items: flex-start; }
  .cost-fix-card .grid2 { grid-template-columns: 1fr; }

  .ios-btn { min-height: 40px; }
  .row-ops .ios-btn { min-height: 34px; padding: 5px 10px; font-size: 12px; }
  .style-link { padding: 4px 0; }
  .mk-badge { font-size: 9px; }

  .settings-row { font-size: 13px; }
  #stDataRoot, #stMarksFile { max-width: 60%; font-size: 12px; }

  .toast { bottom: calc(20px + env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .ios-btn { width: 100%; min-height: 44px; }
  .panel-ops { width: 100%; }
  .panel-ops .ios-btn { flex: 1; }
  #rpSummary { display: none; }
  .card { padding: 12px; }
  .card-head h2 { font-size: 15px; }
  .kpi .k { font-size: 11px; }
  .login-card { padding: 26px 20px; }
  .workspace-tabs { overflow-x: auto; }
  .wtab { white-space: nowrap; padding: 8px 12px; }
}

/* 动效降级（方案第 9 节） */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- 对账二级菜单（2026-08-26）：PC 顶部导航 hover 下拉 ---------- */
.nav-drop { position: relative; display: inline-flex; flex-shrink: 0; }
.nav-drop .tab { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.nav-drop .caret { width: 12px; height: 12px; opacity: .6; transition: transform .16s ease; }
.nav-drop:hover .caret, .nav-drop:focus-within .caret { transform: rotate(180deg); }
.nav-drop-menu {
  display: none; position: fixed; z-index: 200; min-width: 168px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 6px; flex-direction: column; gap: 2px;
  /* 位置由 app.js placeMenu() 用按钮 getBoundingClientRect 计算（fixed 定位，避免被 tabs-nav overflow 裁剪） */
}
.nav-drop-menu.open, .nav-drop:hover .nav-drop-menu, .nav-drop:focus-within .nav-drop-menu { display: flex; }
.nav-drop-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: none; border-radius: 8px; padding: 10px 12px;
  font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer;
  font-family: inherit; touch-action: manipulation;
}
.nav-drop-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .75; }
.nav-drop-item:hover, .nav-drop-item:focus-visible { background: var(--accent-soft); color: var(--accent); }

/* 移动端「对账」居中弹窗（账本对账 / 刷单对账） */
.dz-nav-modal { max-width: 420px; }
.dz-nav-grid { display: grid; gap: 10px; }
.dz-nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; cursor: pointer; font-family: inherit; touch-action: manipulation;
  transition: background .14s, border-color .14s;
}
.dz-nav-item:hover { background: var(--accent-soft); border-color: var(--accent); }
.dz-nav-ico { width: 34px; height: 34px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); border-radius: 10px; color: var(--accent); }
.dz-nav-ico svg { width: 20px; height: 20px; }
.dz-nav-item b { display: block; font-size: 15px; color: var(--text); }
.dz-nav-item small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---------- 刷单对账页（2026-08-26） ---------- */
.brush-issue {
  display: inline-block; border-radius: 6px; padding: 2px 8px; margin: 1px 2px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.brush-err { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(215, 0, 21, .25); }
.brush-warn { background: #FFF7E8; color: var(--warning); border: 1px solid rgba(161, 92, 0, .25); }

/* 异常表头「异常」按钮 + 多选气泡弹窗（2026-08-26：fixed 定位，位置由 app.js 计算，避免被表格 overflow 裁剪） */
.brush-type-th { position: relative; }
.brush-type-btn {
  display: inline-flex; align-items: center; gap: 3px; background: none; border: none;
  font-size: inherit; font-weight: inherit; color: inherit; cursor: pointer;
  font-family: inherit; touch-action: manipulation; padding: 2px 4px; border-radius: 6px;
}
.brush-type-btn:hover { background: var(--surface-subtle); color: var(--accent); }
.brush-type-btn .caret { font-size: 10px; opacity: .6; }
.brush-type-panel {
  display: none; position: fixed; z-index: 200; min-width: 190px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 10px 12px;
  /* 气泡小三角 */
}
.brush-type-panel.open { display: block; }
.brush-type-panel::before {
  content: ""; position: absolute; top: -6px; left: 18px; width: 10px; height: 10px;
  background: var(--surface); border-left: 1px solid var(--border); border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
.btp-title { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.btp-item {
  display: flex; align-items: center; gap: 6px; padding: 4px 0;
  font-size: 13px; cursor: pointer; font-weight: 500;
}
.btp-item input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.btp-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }

/* 异常订单处理弹窗：数据来源 */
.bf-source { margin: 4px 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-subtle); padding: 8px 12px; }
.bf-src-row { display: flex; gap: 8px; padding: 2px 0; font-size: 12.5px; }
.bf-src-k { flex-shrink: 0; color: var(--text-muted); width: 60px; }
.bf-src-v { color: var(--text); word-break: break-all; }


/* 订单工单子项处理建议小字（20260828） */.sub-how { font-size: 12px; color: #8a8a8e; margin-top: 2px; }

/* 点击复制单元格 + 工单编号徽标（20260828d） */
.copy-cell { cursor: pointer; color: #0a6fd8; text-decoration: underline dotted; text-underline-offset: 2px; }
.copy-cell:hover { background: rgba(10,111,216,.08); }
.copy-cell.hint { color: #6e6e73; }
.ticket-no { background: #e8eaf6 !important; color: #3949ab !important; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; margin-right: 4px; }

/* ============ 设置 → 店铺管理（2026-09-02） ============ */
.sc-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.sc-table th, .sc-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border, #e5e5ea); vertical-align: middle; }
.sc-table th { font-size: 12.5px; color: #6e6e73; white-space: nowrap; }
.sc-table input[type=text] { width: 100%; min-width: 120px; box-sizing: border-box; }
.sc-table td.sc-name { min-width: 200px; }
.sc-inactive td { opacity: .6; }
.sc-removed td { background: #fdecec; text-decoration: line-through; }

/* ===== 数据页（淘工厂数据，2026-10-21 新增） ===== */
.dt-search { min-width: 170px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--text); }
.dt-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; line-height: 1.7; }
.dt-meta b { font-weight: 600; color: var(--text-muted); margin-right: 7px; }
.dt-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-tag { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-subtle); border: 1px solid var(--border); color: var(--text-muted); white-space: nowrap; }
.dt-tag.warn { background: #FFF4E5; border-color: #F0C88A; color: #8A5A00; }
.dt-tag.bad { background: #FFECEC; border-color: #F0B4B4; color: #A11414; }
.dt-tag.ok { background: #EAF7EE; border-color: #AADDB9; color: #1B6B34; }
/* F层级小标签（2026-10-25）：与「刷单状态」同一套 .dt-tag，只按层级 F0/F1/F2/F3 换色。
   仅做视觉区分，不暗示好坏；F3 及以上统一用 flv3。 */
.dt-tag.flv-none { opacity: .65; }
.dt-tag.flv0 { background: #F3F4F6; border-color: #D5D8DD; color: #5B6470; }
.dt-tag.flv1 { background: #EEF4FF; border-color: #BFD3F5; color: #1D4ED8; }
.dt-tag.flv2 { background: #EFF8F1; border-color: #A9D9B7; color: #17703A; }
.dt-tag.flv3 { background: #FDF3E3; border-color: #EFC98E; color: #8A5A00; }
/* 「沿用上次」的 F层级（2026-10-25 用户口径）：最新库没更新这一款时，保留原来的 F"N" 但标签变灰 + 虚线边，
   和「这次更新过」的彩色标签一眼区分开。放在 flv* 之后，同特异性下后者生效。 */
.dt-tag.is-stale { background: #F3F4F6; border-color: #C9CDD4; border-style: dashed; color: #8A9099; }
/* 商品明细「点表头复选筛选」（2026-10-25 用户口径，第二版）
   点「区域 / 刷单状态 / F层级」字样 → 表头下面弹一个带复选框的气泡（fixed 定位，不被表格 overflow 裁掉） */
.dt-fth { white-space: nowrap; }
.dt-fname {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 4px; margin: 0;
  background: none; border: 0; border-radius: 6px; cursor: pointer;
  font: inherit; font-weight: 600; color: inherit; touch-action: manipulation;
}
.dt-fname:hover { background: var(--surface-subtle); color: var(--accent); }
.dt-fname.is-on { color: var(--accent); background: rgba(10, 111, 216, .08); }
.dt-fcaret { font-size: 10px; opacity: .55; font-style: normal; }
.dt-fname.is-on .dt-fcaret { opacity: 1; }
.dt-fcnt {
  min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; text-align: center;
}
.dt-fpop {
  position: fixed; z-index: 240; min-width: 168px; max-width: 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 10px 12px;
}
.dt-fpop[hidden] { display: none; }
.dt-fpop-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.dt-fpop-head #dtFilterPopTitle { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.dt-fpop-hint { font-size: 11px; color: var(--text-muted); opacity: .75; }
.dt-fpop-list { max-height: 240px; overflow: auto; }
.dt-fpop-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 2px;
  font-size: 13.5px; cursor: pointer; font-weight: 500; touch-action: manipulation;
}
.dt-fpop-item input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
/* 商品ID 筛选：气泡里是输入框（2026-10-25） */
.dt-fpop-input {
  width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13.5px; font-family: inherit; background: #fff; color: var(--text);
}
.dt-fpop-input:focus { outline: none; border-color: var(--accent); }
@media (max-width: 768px) { .dt-fpop-input { font-size: 16px; padding: 9px 10px; } }
.dt-fpop-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
}
@media (max-width: 768px) {
  .dt-fpop { min-width: 180px; }
  .dt-fpop-item { padding: 9px 2px; font-size: 15px; }
  .dt-fpop-item input { width: 18px; height: 18px; }
}
.dt-note-list { margin: 10px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.8; color: var(--text); }
.dt-note-list li { margin-bottom: 4px; }
.dt-pid { color: var(--accent); cursor: pointer; text-decoration: underline dotted;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.dt-pid:hover { text-decoration: underline solid; }
/* 商品ID 单元格两行（2026-10-26，对齐市场页商品排行）：
   上行 = 商品ID（黑色加粗，点开逐日明细），下行 = 店铺名（11px 灰字）。
   以前只有一行 ID，看不出是哪家店的（多店铺后必需）。 */
.dt-pmeta { display: inline-flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.dt-pmeta .dt-pid {
  color: var(--text-title, #1D1D1F); font-weight: 700;
  text-decoration: none; letter-spacing: .2px;
}
.dt-pmeta .dt-pid:hover { color: var(--accent); text-decoration: underline; }
.dt-pstore { font-size: 11px; color: var(--text-muted, #6E6E73); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.dt-empty { text-align: center; color: var(--text-muted); padding: 26px 0; }
/* 编辑类弹窗（data-dismiss="strict"）被点空白时：轻微回弹，提示"请点 ✕ 关闭"（2026-10-26） */
@keyframes maskBump {
  0%, 100% { transform: none; }
  28% { transform: scale(1.014); }
  62% { transform: scale(0.996); }
}
.modal.mask-bump { animation: maskBump .32s ease; }
@media (prefers-reduced-motion: reduce) { .modal.mask-bump { animation: none; } }
#dtSegTable th.num, #dtSegTable td.num,
#dtProdTable th.num, #dtProdTable td.num { text-align: right; font-variant-numeric: tabular-nums; }
#dtProdTable th[data-dt-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
#dtProdTable th[data-dt-sort]:hover { color: var(--accent); }
#dtProdTable th .ar { font-size: 10px; margin-left: 3px; color: var(--accent); }
#dtSegTable tr.dt-row-store td, #dtSegTable tr.dt-row-total td { background: var(--surface-subtle); }
#dtSegTable tr.dt-row-total td { font-weight: 700; border-top: 2px solid var(--border); }
#dtProdTable td, #dtSegTable td { white-space: nowrap; }
#dtKpis .kpi-grid { margin-bottom: 16px; }

/* ===== 数据页 · 商品缩略图（2026-10-21） ===== */
.dt-pcell { display: inline-flex; align-items: center; gap: 8px; }
.dt-thumb-wrap { width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 8px; overflow: hidden; background: var(--surface-subtle);
  border: 1px solid var(--border); }
.dt-thumb-wrap.lg { width: 72px; height: 72px; border-radius: 12px; }
.dt-thumb-wrap.miss::before { content: "无图"; font-size: 10px; color: var(--text-muted); }
.dt-thumb { width: 100%; height: 100%; object-fit: cover; display: block; background: #fff; }
.dt-daily-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.dt-daily-head .dt-meta { flex: 1 1 auto; }
.dt-thumb-wrap.lg { width: 72px; height: 72px; border-radius: 12px; }
a.dt-thumb-wrap { cursor: zoom-in; }

/* ==========================================================================
   问号折叠说明气泡（2026-10-24）
   —— 页面上所有注释字样改成 help-btn「?」，点开才显示（见 app.js initHelpPop）
   ========================================================================== */
.help-btn {
  cursor: pointer; flex: none;
  width: 18px; height: 18px; padding: 0;
  font-size: 11px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: middle; margin-left: 5px;
}
.help-btn.sm { width: 16px; height: 16px; font-size: 10px; }
.help-btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.card-head h2 .help-btn { margin-left: 5px; vertical-align: 1px; }

.help-pop {
  position: fixed; z-index: 300;
  max-width: min(360px, calc(100vw - 24px));
  background: #fff; color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px; line-height: 1.7;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  word-break: break-word;
}
.help-pop[hidden] { display: none; }

@media (max-width: 768px) {
  .help-pop { max-width: calc(100vw - 20px); font-size: 13px; line-height: 1.75; padding: 12px 14px; }
  /* 移动端问号保持和桌面一样小、且必须跟标题同一行（2026-10-24：
     原来放大到 30px 又排在 .count 后面，结果又大又单独占一行） */
  .help-btn { width: 18px; height: 18px; font-size: 11px; }
  .help-btn.sm { width: 16px; height: 16px; font-size: 10px; }
  .card-head h2 { line-height: 1.5; }
  .card-head h2 .help-btn { vertical-align: 0; }
}

/* ==========================================================================
   成本页卡片头：移动端不要把「状态 + 上传」压到标题下面（2026-10-24）
   --------------------------------------------------------------------------
   sycm-theme.css 的移动端规则 `#main > .view-page > .card > .card-head { display: block }`
   会让卡片头变成块级，于是成本页由 cost-upload.js 注入的 .row-ops（成本库状态 + 上传按钮）
   被迫另起一行，看起来就是"上下排版"。用户要求上传跟标题同一行。
   这里用更强的选择器（两个 id）只对成本页恢复 flex 行排布，其它页保持不变。
   ========================================================================== */
@media (max-width: 768px) {
  #main > #view-cost > .card > .card-head {
    display: flex; align-items: center; flex-wrap: nowrap; gap: 8px;
  }
  #main > #view-cost > .card > .card-head h2 { min-width: 0; font-size: 15px; }
  #main > #view-cost > .card > .card-head .row-ops {
    margin-left: auto; flex: none; display: flex; align-items: center; gap: 8px;
  }
  /* 状态文字在窄屏会挤爆标题行，藏起来（详情在点上传后的提示条里） */
  #main > #view-cost > .card > .card-head .row-ops .count { display: none; }
  #main > #view-cost > .card > .card-head .ios-btn { min-height: 32px; padding: 0 12px; }
}
/* ==========================================================================
   顶部「公司动态」滚动条（2026-11 用户要求第 20 条）
   —— 位置在商账云标题右边，逐条横滚，点一下跳首页公告卡片。
   这里只定义新类（.nav-marquee*），不改既有 .nav / .nav-inner 规则。
   ========================================================================== */
.nav-marquee {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 620px;
  margin: 0 14px;
  height: 28px;
}
.nav-marquee[hidden] { display: none !important; }
.nav-marquee-label {
  flex: none;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-soft, rgba(32, 98, 230, .10));
  color: var(--accent, #2062e6);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.nav-marquee-view {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  position: relative;
  height: 28px;
  display: block;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
}
.nav-marquee-view:hover { background: var(--surface-subtle, #f2f3f5); }
.nav-marquee-track {
  display: flex;
  align-items: center;
  height: 28px;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--color-text-regular, #4b5563);
  animation: navMarqueeScroll 24s linear infinite;
  will-change: transform;
}
.nav-marquee-view:hover .nav-marquee-track { animation-play-state: paused; }
.nav-marquee-seg { padding-right: 0; }
.nav-marquee-track.static {
  animation: none !important;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes navMarqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .nav-marquee-track { animation: none !important; }
}
/* 公告卡片被「跳过来」时闪一下，让人知道要看的就是它 */
#cardAnnounce.flash {
  box-shadow: 0 0 0 3px rgba(32, 98, 230, .35);
  transition: box-shadow .3s ease;
}
/* 移动端：顶栏本来就窄，滚动条收窄并缩小字号 */
@media (max-width: 768px) {
  .nav-marquee { margin: 0 8px; max-width: none; }
  .nav-marquee-label { display: none; }
  .nav-marquee-track { font-size: 12px; }
}
/* ==========================================================================
   用户信息 / 强制改密（2026-11 用户要求第 19 条）
   ========================================================================== */
/* 右上角用户名变成可点按钮：保留原来的排版，只换成按钮语义 */
.user-name.is-btn {
  background: none;
  border: 0;
  padding: 2px 4px;
  margin: 0;
  border-radius: 6px;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.user-name.is-btn:hover { background: var(--surface-subtle, #f2f3f5); color: var(--accent, #2062e6); }
.user-name.is-btn:focus-visible { outline: 2px solid var(--accent, #2062e6); outline-offset: 1px; }
.modal-narrow { max-width: 400px; }
.af-info-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #1f2328);
  padding: 6px 0 2px;
  word-break: break-all;
}
@media (max-width: 768px) {
  .user-name.is-btn { font-size: 11px; padding: 4px 6px; min-height: 26px; }
  .modal-narrow { max-width: calc(100vw - 24px); }
}
/* ==========================================================================
   用户权限三级树（2026-11 用户要求第 17 条）
   一级 = 每个 tab / 板块（.pt-group 的 summary）
   二级 = tab 下的子页面（.pt-l2 里的 label）
   三级 = 二级下的指标 / 店铺（.pt-l3、.pt-shops）
   `<details>` 原生折叠：点 checkbox / 按钮不会误折叠（已用 Chrome 实测确认）
   ========================================================================== */
.perm-tree { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; }

.pt-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.pt-group > summary {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 12px;
  background: var(--surface-subtle);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; user-select: none;
  list-style: none;
}
.pt-group > summary::-webkit-details-marker { display: none; }
.pt-group > summary::before {
  content: "▸";
  font-size: 11px; color: var(--text-muted);
  flex: none; transition: transform .15s ease;
}
.pt-group[open] > summary::before { transform: rotate(90deg); }
.pt-group > summary > label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.pt-group > summary input[type="checkbox"] {
  width: 17px; height: 17px; flex: none;
  accent-color: var(--accent); cursor: pointer;
}
.pt-hint { font-weight: 400; font-size: 11.5px; color: var(--text-muted); }
.pt-group > summary .f-ops { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; }

/* 二级：子页面 */
.pt-l2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2px 10px;
  padding: 8px 12px 10px 30px;
  border-top: 1px solid var(--border);
}
.pt-l2 > label {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 4px; border-radius: 6px;
  font-size: 13px; cursor: pointer;
  transition: background .12s;
}
.pt-l2 > label:hover { background: var(--accent-soft); }
.pt-l2 > label input[type="checkbox"] {
  width: 16px; height: 16px; flex: none;
  accent-color: var(--accent); cursor: pointer;
}
.pt-l2 .muted { font-size: 12.5px; padding: 4px 2px; }

/* 三级：指标 */
.pt-l3 {
  padding: 8px 12px 12px 30px;
  border-top: 1px dashed var(--border);
  background: var(--surface-subtle);
}
.pt-l3-head {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
}
.pt-l3-head .f-ops { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; }

/* 可见店铺：二级直接是店铺 chip */
.pt-l2.pt-shops { display: block; padding-left: 30px; }

@media (max-width: 768px) {
  .pt-group > summary { padding: 10px 12px; font-size: 13px; gap: 6px; }
  .pt-group > summary input[type="checkbox"] { width: 19px; height: 19px; }
  .pt-l2 { grid-template-columns: 1fr; padding: 8px 10px 10px 18px; }
  .pt-l2 > label { min-height: 40px; font-size: 14px; padding: 6px 4px; }
  .pt-l2 > label input[type="checkbox"] { width: 19px; height: 19px; }
  .pt-l3 { padding: 8px 10px 12px 18px; }
  .pt-l2.pt-shops { padding-left: 10px; }
}
