:root {
  --brand: #0f6f5f;
  --brand-dark: #0a5348;
  --brand-soft: rgba(15, 111, 95, 0.10);
  --brand-line: rgba(15, 111, 95, 0.22);
  --bg: #f4f7f6;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --text: #1a2e29;
  --text-2: #4b5a56;
  --muted: #5f6f6b;
  --line: rgba(15, 111, 95, 0.10);
  --line-strong: rgba(15, 111, 95, 0.18);
  --ok: #16a34a;
  --ok-soft: rgba(22, 163, 74, 0.10);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.10);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.10);
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 4px 18px rgba(10, 83, 72, 0.08);
  --nav-h: 60px;
  /* 双栏页（工作台 / 开单 / 下单）共用同一套列宽与间距 —— 否则切 tab 时侧栏和主列会跳（R111） */
  --side-w: 360px;
  --grid-gap: 22px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* ★手机稳定性：禁止横向拖动与回弹（左右滑不再晃）。
   只在 html 上 hidden——body 加 hidden 会破坏顶栏的 sticky；
   支持 clip 的新内核用 clip，效果相同且不产生滚动容器。 */
html {
  overflow-x: hidden;
  overscroll-behavior-x: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* ★ 2026-11-23（用户：「左右跳」）：Windows 的滚动条占宽度 —— 列表一抽短、滚动条消失，
     居中的 .page 就会整体右移几像素（反之左移），看着像"左右跳"。
     这里永远给滚动条留位置：老内核用 overflow-y:scroll，新内核用 scrollbar-gutter:stable。 */
  overflow-y: scroll;
}
@supports (scrollbar-gutter: stable) {
  html { overflow-y: auto; scrollbar-gutter: stable; }
}
@supports (overflow-x: clip) {
  body { overflow-x: clip; }
}
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;      /* 长地址 / 长货号换行，不撑宽页面 */
  touch-action: manipulation;     /* 去掉双击放大，点按更跟手 */
}
button, input, select, textarea { font: inherit; color: inherit; }
/* iOS 原生按钮有默认立体样式，统一去掉，各端观感一致 */
button { -webkit-appearance: none; appearance: none; }
/* 按钮类元素：禁长按系统菜单 / 禁选中，点按更像原生 App */
.btn, .chip, .quick, .icon-btn, .nav-item { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
a { color: var(--brand); text-decoration: none; }
[hidden] { display: none !important; }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  background: linear-gradient(165deg, #e7f4f1 0%, #f4f7f6 60%, #bfe0d9 100%);
  color: #0f6f5f; z-index: 90;
}
.boot-logo {
  width: 68px; height: 68px; border-radius: 22px;
  background: rgba(15, 111, 95, 0.10);
  border: 1px solid rgba(15, 111, 95, 0.25);
  box-shadow: 0 8px 32px rgba(15, 111, 95, 0.14);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 600; letter-spacing: 2px;
}
.boot-text { font-size: 14px; opacity: 1; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(15, 111, 95, .18); border-top-color: var(--brand);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- layout ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.page {
  flex: 1;
  padding: 14px 14px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
  max-width: 720px; width: 100%; margin: 0 auto;
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  border-bottom: 1px solid var(--line);
  padding: calc(12px + env(safe-area-inset-top)) 16px 14px;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.topbar-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; letter-spacing: .5px; }
.topbar .sub { font-size: 12px; opacity: 1; margin-top: 2px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.icon-btn {
  background: rgba(15, 111, 95, .08); border: 1px solid var(--brand-line);
  color: var(--brand); border-radius: 10px; padding: 6px 10px; font-size: 13px; cursor: pointer;
}

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
  display: flex;
}
.nav-item {
  flex: 1; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); font-size: 11px; padding: 0;
  transition: color .15s ease;
}
.nav-item:active { opacity: .55; }
.nav-item svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nav-item.active {
  color: var(--brand);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  width: 48px; height: 32px;
  background: var(--brand-soft);
  border-radius: 16px;
  opacity: 1;
  z-index: -1;
}
.nav-item.active svg { stroke-width: 2.2; }

/* ---------- card ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px;
  border: 1px solid rgba(15, 111, 95, 0.06);
}
.card.flush { padding: 0; overflow: hidden; }
.card-title { font-size: 14px; font-weight: 600; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.card-title .tag { font-size: 11px; font-weight: 400; color: var(--muted); }
.section-label { font-size: 12px; color: var(--muted); margin: 20px 4px 8px; letter-spacing: .5px; text-transform: uppercase; }

/* ---------- hero / dashboard ---------- */
.welcome-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.welcome-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; flex: 0 0 auto;
}
.welcome-text { flex: 1; min-width: 0; }
.welcome-greet { font-size: 16px; font-weight: 600; color: var(--text); }
.welcome-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.hero-card {
  background: var(--card); border-radius: var(--radius); padding: 18px 16px;
  box-shadow: var(--shadow); border: 1px solid rgba(15, 111, 95, 0.06);
  margin-bottom: 12px;
  display: flex; flex-direction: column; gap: 0;
  justify-content: flex-start;
  min-height: 228px;
}
.hero-card.me-hero {
  display: flex;
  flex-direction: column;
  min-height: 228px;
}
.hero-card.has-trend { cursor: pointer; }
.hero-card.has-trend:active { transform: scale(.995); }
.hero-left { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.hero-right { min-width: 0; }
.hero-head { display: flex; align-items: center; justify-content: space-between; height: 24px; margin-bottom: 10px; flex: 0 0 auto; }
.hero-title { font-size: 14px; font-weight: 600; color: var(--text); }
.hero-badge {
  font-size: 11px; color: var(--brand); font-weight: 500;
  background: var(--brand-soft); padding: 3px 9px; border-radius: 12px;
}
.hero-value {
  font-size: 32px; font-weight: 700; margin-top: 2px;
  font-variant-numeric: tabular-nums; letter-spacing: -.8px; color: var(--text);
  height: 46px; line-height: 46px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 0 0 auto;
}
.hero-value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.hero-trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; color: var(--ok); margin-top: 8px; font-weight: 500;
  background: var(--ok-soft); padding: 4px 10px; border-radius: 20px;
  height: 26px; flex: 0 0 auto;
}
.hero-trend.down { color: var(--danger); background: var(--danger-soft); }
.hero-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 16px; }
.metric-pill {
  flex: 1; min-width: 0; background: var(--bg); border-radius: var(--radius-sm);
  padding: 10px 12px; border: 1px solid var(--line);
}
.metric-pill .mp-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.metric-pill .mp-value {
  font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 欠款类指标（如客户页「待收总额」）红色强调，与全局欠款红色语义一致 */
.metric-pill .mp-value.danger { color: var(--danger); }
/* R126：本月已收按单封顶；有超收时在本金下面补一行，不静默吞掉 */
.metric-pill .mp-sub { font-size: 10.5px; color: #b45309; margin-top: 2px; line-height: 1.2; white-space: nowrap; }

.todo-chips {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.todo-chips::-webkit-scrollbar { display: none; }
.todo-chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  min-height: 44px; padding: 7px 15px; font-size: 13px; color: var(--text-2); cursor: pointer;
  transition: transform .08s ease, background .15s ease;
}
.todo-chip:active { transform: scale(.96); background: var(--brand-soft); }
.todo-chip .tc-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: 0 0 auto;
}
.todo-chip .tc-dot.warn { background: var(--warn); }
.todo-chip .tc-dot.danger { background: var(--danger); }
.todo-chip .tc-count {
  min-width: 18px; height: 18px; border-radius: 9px; background: var(--brand-soft);
  color: var(--brand); font-size: 11px; font-weight: 600; text-align: center; line-height: 18px;
  padding: 0 5px;
}
/* 待办数字跟随紧急程度：红=欠款/异常，橙=次紧急 */
.todo-chip .tc-count.danger { background: var(--danger-soft); color: var(--danger); }
.todo-chip .tc-count.warn { background: var(--warn-soft); color: #b45309; }

.order-cta { display: flex; gap: 10px; margin-bottom: 12px; }
.order-cta-btn { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 14px 6px; background: var(--brand); color: #fff; border: none; border-radius: var(--radius); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.order-cta-btn:active { opacity: .9; transform: scale(.985); }
.order-cta-icon { font-size: 24px; line-height: 1; }
.order-cta-label { font-size: 14px; font-weight: 600; }

.dashboard-grid { display: block; }
.dashboard-main, .dashboard-side { display: block; }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 4px 8px;
}
.section-head .section-label { margin: 0; }
.section-head .section-more {
  font-size: 12px; color: var(--brand); cursor: pointer; font-weight: 500;
}

.row-mini {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.row-mini:last-child { border-bottom: 0; padding-bottom: 0; }
.row-mini:first-child { padding-top: 0; }
.row-mini .rm-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: 0 0 auto;
}
.row-mini .rm-dot.ok { background: var(--ok); }
.row-mini .rm-dot.warn { background: var(--warn); }
.row-mini .rm-dot.danger { background: var(--danger); }
.row-mini .rm-main { flex: 1; min-width: 0; }
.row-mini .rm-title { font-size: 14px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-mini .rm-sub { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-mini .rm-tail { text-align: right; font-size: 13px; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.row-mini .rm-tail .rm-tail-sub { font-size: 11px; color: var(--muted); font-weight: 400; }
.row-mini .rm-tail .rm-tail-sub.is-warn { color: var(--danger); font-weight: 600; }

/* ---------- kpi ---------- */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  border: 1px solid rgba(15, 111, 95, 0.06); box-shadow: var(--shadow);
  position: relative; overflow: hidden; min-width: 0;
}
.kpi::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--brand-line);
}
.kpi.is-ok::before { background: var(--ok); }
.kpi.is-warn::before { background: var(--warn); }
.kpi .k-label { font-size: 12px; color: var(--muted); }
.kpi .k-value { font-size: 20px; font-weight: 700; margin-top: 4px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.kpi .k-foot { font-size: 11px; color: var(--muted); margin-top: 4px; }
.kpi.is-ok .k-value { color: var(--ok); }
.kpi.is-warn .k-value { color: var(--warn); }
.kpi.is-warn { background: linear-gradient(180deg, var(--card) 0%, rgba(217, 119, 6, 0.06) 100%); }

/* ---------- quick grid ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
/* 工作台快捷入口：开单已单独做主按钮，剩 8 个入口，手机 2 列更舒展、宽屏 4 列 */
.dashboard-main .quick-grid { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) {
  .dashboard-main .quick-grid { grid-template-columns: repeat(4, 1fr); }
}
.quick {
  border: 1px solid var(--line); background: var(--bg-elevated); border-radius: var(--radius-sm);
  padding: 14px 6px; text-align: center; cursor: pointer; font-size: 12px; color: var(--text-2);
  transition: transform .08s ease, background .15s ease;
}
.quick:active { background: var(--brand-soft); transform: scale(.97); }
.quick .qi {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: 0 auto 7px;
  background: var(--brand-soft);
  border-radius: 13px; font-size: 24px; line-height: 1;
}

/* ---------- list rows ---------- */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; background: var(--card);
}
.row:last-child { border-bottom: 0; }
.row:active { background: rgba(15, 111, 95, 0.04); }
.row .r-main { flex: 1; min-width: 0; }
.row .r-title { font-size: 14px; font-weight: 500; color: var(--text); }
.row .r-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.row .r-contact { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; }
.row .r-phone { color: var(--brand); font-weight: 600; font-size: 13px; }
.row .r-addr { color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r-tail { font-size: 12px; color: var(--muted); text-align: right; }
.chev { color: var(--muted); font-size: 14px; }

/* 下单列表行（2026-11-20 用户）：左右同一基线、行数永远一致；状态徽章单独占一整行（不折行） */
.row.prow { display: block; padding: 12px 14px; }
.prow .pline { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.prow .pline + .pline { margin-top: 4px; }
.prow .pline .pl {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 8px;
  overflow: hidden; white-space: nowrap;
}
.prow .pline .pl > .r-phone { flex: 0 0 auto; }
.prow .pline .pl > .r-sub,
.prow .pline .pl > .r-addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; margin: 0; }
.prow .pline .pr { flex: 0 0 auto; text-align: right; white-space: nowrap; }
.prow .pline .pr .r-sub { margin: 0; }
.prow .pline .pr .badge { margin-left: 0; }
.prow .pline-badges { display: flex; flex-wrap: nowrap; gap: 4px; margin-top: 7px; overflow: hidden; }
.prow .pline-badges .prog-badges { display: flex; flex-wrap: nowrap; gap: 4px; min-width: 0; overflow: hidden; }
.prow .pline-badges .badge { font-size: 11px; padding: 1px 7px; white-space: nowrap; margin: 0; }

.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.empty .ei { font-size: 28px; display: block; margin-bottom: 8px; opacity: .5; }

/* ---------- 商业化空状态（新手引导） ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text); }
.empty-state .es-icon {
  width: 80px; height: 80px; margin: 0 auto 18px;
  color: var(--brand); display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); border-radius: 24px;
}
.empty-state .es-icon svg { width: 100%; height: 100%; padding: 18px; }
.empty-state .es-title { font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.empty-state .es-desc { font-size: 13px; color: var(--muted); margin: 0 auto 20px; max-width: 280px; line-height: 1.7; }
.empty-state .es-actions { display: flex; align-items: center; justify-content: center; gap: 10px; }
.empty-state .es-actions .btn { padding: 8px 18px; font-size: 14px; width: auto; flex-shrink: 0; }
.empty-state .es-hint {
  display: inline-block; margin-top: 16px; font-size: 12px; color: var(--brand);
  text-decoration: none; cursor: pointer;
}
.empty-state .es-hint:active { opacity: .7; }

/* 列表分页「加载更多」（客户多的大店一屏一屏往下翻） */
.load-more { padding: 12px 16px 16px; }
.load-more .btn { width: 100%; }

/* ---------- 骨架屏 ----------
   切页时先按这一页的形状把灰条摆好，数据一到原地换成真内容。
   纯静态、不加动画：老内核（微信内置浏览器）也零负担，绝不会是新的卡顿源。 */
.sk { background: rgba(15, 111, 95, 0.10); border-radius: 6px; display: block; }
.sk-l { height: 12px; }
.sk-l.sm { height: 10px; }
/* 列表行占位：对齐 .row 的尺寸，换真内容时不会跳 */
.sk-row { padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--card); }
.sk-row:last-child { border-bottom: 0; }
.sk-row .sk-l { width: 40%; }
.sk-row .sk-l + .sk-l { width: 66%; height: 10px; margin-top: 9px; }
/* KPI 占位 */
.sk-kpi {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  border: 1px solid rgba(15, 111, 95, 0.06); box-shadow: var(--shadow);
}
.sk-kpi .sk-l { width: 54%; }
.sk-kpi .sk-l.v { width: 70%; height: 22px; margin-top: 10px; }
.sk-kpi .sk-l.f { width: 42%; height: 10px; margin-top: 9px; }
/* 卡片里的若干条灰线 */
.sk-card {
  background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  border: 1px solid rgba(15, 111, 95, 0.06); box-shadow: var(--shadow);
}
.sk-card .sk-l { width: 38%; }
.sk-card .sk-l + .sk-l { width: 58%; margin-top: 13px; }
/* 条形图占位（报表 12 个月） */
.sk-bars { display: flex; align-items: flex-end; gap: 7px; height: 96px; padding: 0 2px; }
.sk-bars i { flex: 1; background: rgba(15, 111, 95, 0.10); border-radius: 4px 4px 0 0; }
/* 菜单行占位（「我的」等纯菜单页） */
.sk-menu { display: flex; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.sk-menu:last-child { border-bottom: 0; }
.sk-menu .sk-l { width: 34%; height: 13px; }

/* ---------- form ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
/* 表单弹窗的普通字段：宽屏两列，少滚动（full 项 / 更多区不受影响，仍通栏） */
.form-grid { display: grid; grid-template-columns: 1fr; }
/* 勾选行（登录页「记住账号密码」等） */
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin: -2px 0 14px; cursor: pointer; user-select: none; }
.check-row input { width: 17px; height: 17px; accent-color: var(--brand); margin: 0; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--text); outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 111, 95, .12); }
.input::placeholder { color: var(--muted); }
/* 只读（自动算出来的字段，比如「未付款」） */
.input.ro, .input[readonly] { background: rgba(15, 111, 95, 0.05); color: var(--text-2); }
.row-inline { display: flex; gap: 8px; }
.row-inline .input { flex: 1; }
/* 联想输入的外层包（.row-inline 里要能拉伸，否则输入框比同排其他输入短一截） */
.row-inline .combo-wrap { flex: 1 1 auto; min-width: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--brand); color: #fff;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: transform .08s ease, background .15s ease;
}
.btn:active { background: var(--brand-dark); transform: scale(.985); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--brand); border-color: var(--brand-line); }
.btn.plain { background: var(--bg-elevated); color: var(--text-2); border-color: var(--line); }
.btn.danger { background: rgba(220, 38, 38, 0.10); color: var(--danger); border-color: rgba(220, 38, 38, 0.20); }
.btn.sm { width: auto; padding: 8px 14px; font-size: 13px; }
.btn-row { display: flex; gap: 10px; }
/* 按压反馈：轻微缩一下，操作感更「稳」 */
.quick:active { transform: scale(.97); }
.chip:active { transform: scale(.96); }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px; max-width: 460px; margin: 0 auto; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-logo {
  width: 58px; height: 58px; border-radius: 18px; margin: 0 auto 12px;
  background: linear-gradient(160deg, #128573, #0a5348); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 600;
}
.auth-head h1 { font-size: 20px; margin: 0 0 4px; color: var(--text); }
.auth-head p { margin: 0; font-size: 13px; color: var(--muted); }
.tabs { display: flex; background: var(--bg); border-radius: var(--radius-sm); padding: 3px; margin-bottom: 16px; border: 1px solid var(--line); }
.tabs button {
  flex: 1; border: 0; background: none; padding: 9px 0; border-radius: 10px;
  font-size: 14px; color: var(--text-2); cursor: pointer;
}
.tabs button.on { background: var(--card); color: var(--brand); font-weight: 600; box-shadow: 0 2px 8px rgba(10, 83, 72, .10); }
/* 二级分段（注册方式 / 找回方式）：两个并排小胶囊，一眼看出还能换手机号或邮箱 */
.tabs.sm { background: none; border: 0; padding: 0; gap: 8px; margin-bottom: 12px; }
.tabs.sm button {
  border: 1px solid var(--line); background: var(--bg-elevated);
  padding: 7px 0; font-size: 13px; color: var(--text-2);
}
.tabs.sm button.on {
  background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line);
  box-shadow: none;
}
.auth-foot { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin-top: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.btn.sm { white-space: nowrap; }
.auth-note { font-size: 12px; color: var(--text-2); background: var(--bg-elevated); border-radius: 10px; padding: 10px 12px; margin-top: 14px; line-height: 1.6; border: 1px solid var(--line); }

/* 桌面端登录页：左侧品牌区 + 右侧表单（手机端隐藏品牌区，保持原样） */
.auth-side { display: none; }
@media (min-width: 768px) {
  .auth-wrap {
    max-width: none; min-height: 100vh;
    display: flex; flex-direction: row; align-items: stretch;
    padding: 0; margin: 0; justify-content: flex-start;
  }
  .auth-side {
    display: flex; align-items: center; justify-content: center;
    flex: 1 1 56%;
    background: linear-gradient(160deg, #128573, #0a5348);
    color: #fff; padding: 48px;
  }
  .auth-side-inner { max-width: 430px; }
  .auth-side-logo {
    width: 64px; height: 64px; border-radius: 20px;
    background: rgba(255, 255, 255, 0.16); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 600;
  }
  .auth-side h2 { font-size: 28px; font-weight: 700; color: #fff; margin: 22px 0 8px; letter-spacing: 1px; }
  .auth-side-sub { font-size: 14px; color: rgba(255, 255, 255, 0.72); margin: 0; }
  .auth-side-points { margin: 36px 0 0; padding: 0; list-style: none; display: grid; gap: 16px; }
  .auth-side-points li { color: rgba(255, 255, 255, 0.92); font-size: 14px; padding-left: 28px; position: relative; }
  .auth-side-points li::before {
    content: '✓'; position: absolute; left: 0; top: 0;
    color: #7ee2c8; font-weight: 700;
  }
  .auth-main {
    flex: 1 1 44%; max-width: 560px; margin: 0 auto;
    display: flex; flex-direction: column; justify-content: center;
    padding: 32px 24px;
  }
  .auth-main .auth-head { margin-bottom: 8px; }
}

/* ---------- toast / modal ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 26px);
  transform: translate(-50%, 12px);
  background: rgba(26, 46, 41, .96); color: #fff;
  padding: 10px 16px; border-radius: 12px; font-size: 13px;
  max-width: 84vw; text-align: center; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 60;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(10, 83, 72, 0.18);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: rgba(127, 29, 29, .96); border-color: rgba(220, 38, 38, 0.20); }
.toast.ok { background: rgba(6, 78, 59, .96); border-color: rgba(22, 163, 74, 0.20); }

/* ★滚动容器：老内核加惯性滚动；滑到头不再把底下的页面带着晃（滚动穿透） */
.modal, .pick-list, .combo-list, .draft-list, .bill-imgs {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.modal-root { position: fixed; inset: 0; z-index: 70; }
.modal-layer { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(10, 30, 26, .55); }
.modal {
  position: relative; background: var(--bg-elevated); width: 100%; max-width: 560px;
  border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 86vh; overflow-y: auto; animation: up .22s ease;
  border: 1px solid rgba(15, 111, 95, 0.08);
  border-bottom: 0;
  transition: transform .18s ease;
}
@keyframes up { from { transform: translateY(24px); opacity: .6; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
/* 可拖动弹窗（2026-11-18：回单比对要能挪开看后面的主材表格）——手柄是标题栏；拖动时别选中文字、别出拖影 */
.modal.draggable .modal-head { cursor: move; user-select: none; -webkit-user-select: none; touch-action: none; }
.modal.dragging { transition: none; }
.modal-head.no-title { margin-bottom: 0; justify-content: flex-end; }
.modal-head h3 { margin: 0; font-size: 16px; color: var(--text); flex: 1; min-width: 0; }
.modal-x { flex: 0 0 auto; width: 44px; height: 44px; margin-right: -10px; border: none; background: transparent; color: var(--muted); font-size: 24px; line-height: 44px; cursor: pointer; text-align: center; padding: 0; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
.modal-x:active { background: rgba(15, 111, 95, 0.10); }
.modal .modal-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ---------- misc ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; background: var(--brand-soft); color: var(--brand); }
.badge.gray { background: rgba(15, 111, 95, 0.06); color: var(--muted); }
.badge.warn { background: var(--warn-soft); color: #b45309; }
.stat-line { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; color: var(--text-2); }
.stat-line:last-child { border-bottom: 0; }
/* 数据概览卡：两列排布，压缩高度，让侧栏更紧凑 */
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.overview-grid .stat-line { min-width: 0; }
.stat-line b { font-variant-numeric: tabular-nums; color: var(--text); }
/* 标签永不折行；长值单行省略（悬停/长按看全） */
.stat-line > span { white-space: nowrap; flex: 0 0 auto; }
.stat-line .one-line { min-width: 0; margin-left: 12px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.placeholder { text-align: center; padding: 34px 16px; color: var(--muted); }
.placeholder .pi { font-size: 32px; display: block; margin-bottom: 10px; opacity: .55; }
.placeholder h3 { color: var(--text); font-size: 14px; margin: 0 0 6px; }
.placeholder p { font-size: 13px; margin: 0 auto; max-width: 320px; line-height: 1.7; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid var(--line); background: var(--bg-elevated); border-radius: 20px;
  padding: 5px 11px; font-size: 12px; color: var(--text-2); cursor: pointer;
  transition: transform .08s ease;
}
.chip:disabled { opacity: .4; cursor: not-allowed; }
/* 筛选行的标签 chip 与右侧按钮（btn.sm）等高对齐，避免「按钮高度不一」 */
.toolbar-sub .chip { padding: 0 11px; }

/* 下单详情：大分段 tab（窗帘/辅材/安装下单） */
.seg-tab { flex: 1 1 0; min-width: 0; padding: 12px 6px; text-align: center; border: 1px solid var(--line); background: var(--bg-elevated); border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg-tab.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* 下单详情：精简头部 + 折叠单据详情 */
.order-head-card { padding: 14px 16px; }
.order-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.order-head-left { flex: 1; min-width: 0; }
.order-head-right { flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; max-width: 46%; }
.order-head-card .dh-title { white-space: nowrap; }
.order-head-meta { font-size: 13px; color: var(--text-2); margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.order-head-meta .is-warn { color: var(--warn); font-weight: 600; }
.order-head-meta .is-ok { color: var(--ok); font-weight: 600; }
.order-fold { margin-top: 12px; border-top: 1px solid var(--line); }
.order-fold summary { font-size: 13px; color: var(--brand); cursor: pointer; padding: 10px 0; list-style: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.order-fold summary::-webkit-details-marker { display: none; }
.order-fold summary::after { content: ' ▾'; font-size: 11px; }
.order-fold[open] summary::after { content: ' ▴'; }
.fold-body { padding: 2px 0 6px; }
.chip.off { color: var(--muted); text-decoration: line-through; background: rgba(15, 111, 95, 0.04); }
.chip.add { border-style: dashed; color: var(--brand); }

/* ---------- M2 客户 / 开单 ---------- */
.toolbar { margin-bottom: 10px; }
.toolbar-sub { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
/* 财务登记入口分两组：单张单的成本（回单/安装费） vs 整店固定支出（用户 2026-11-11 定） */
.bill-group { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-elevated); flex-wrap: wrap; }
.bill-group-t { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.bill-group-b { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.toolbar-sub .btn.sm { width: auto; }
.btn-pair { margin-left: auto; display: flex; gap: 8px; }
/* 草稿入口搬到 chip 排之后，手机端这一对主按钮独占一行、平分宽度（不再缩在右边留个空档） */
@media (max-width: 767px) {
  .toolbar-sub .btn-pair { margin-left: 0; width: 100%; }
  .toolbar-sub .btn-pair > .btn { flex: 1 1 0; }
}
.chip-row { display: flex; gap: 7px; flex-wrap: wrap; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.badge.red { background: var(--danger-soft); color: #991b1b; }
.badge.ok { background: var(--ok-soft); color: #166534; }

/* 进行中：蓝色，与「已完成」的绿色一眼区分（蓝=进行中、绿=完成、灰=取消、红=欠款） */


.r-title .badge { margin-left: 6px; vertical-align: 1px; }
.r-tail .badge { margin-top: 4px; }
.r-tail .mono { font-variant-numeric: tabular-nums; }
.mono.strong { font-weight: 600; }
.r-sub + .r-sub { margin-top: 3px; }

.stat-line.is-ok b { color: var(--ok); }
.stat-line.is-warn b { color: var(--warn); }
.stat-line.is-warn { background: linear-gradient(90deg, transparent, rgba(217, 119, 6, 0.06)); }
/* 详情里为空的字段：整行可点，直接补录 */
.stat-line.fill-row { cursor: pointer; margin: 0 -8px; padding: 9px 8px; border-radius: 8px; }
.stat-line.fill-row:active { background: var(--bg-elevated); }
.stat-line.fill-row .fill-hint { color: var(--muted); font-weight: 400; font-size: 12px; }

.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.dh-title { font-size: 16px; font-weight: 600; color: var(--text); }
.dh-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.form-err:not(:empty) {
  margin-top: 10px; background: var(--danger-soft); color: #991b1b;
  border-radius: 10px; padding: 9px 12px; font-size: 13px; line-height: 1.6;
}

.pick-list { max-height: 52vh; overflow-y: auto; margin-top: 10px; border-top: 1px solid var(--line); }
.pick-item {
  padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; color: var(--text);
}
.pick-item:last-child { border-bottom: 0; }
.pick-item.on { color: var(--brand); font-weight: 600; }
.pick-item.add { color: var(--brand); border-bottom-style: dashed; }
.pick-item .pick-main { min-width: 0; }
.pick-item .pick-title { font-size: 14px; }
.pick-item .pick-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- 客户输入联想（文档流内，不用浮层，避免被弹窗裁掉） ---------- */
.combo-list {
  margin-top: 6px; border: 1px solid var(--brand-line); border-radius: var(--radius-sm);
  background: var(--bg-elevated); max-height: 30vh; overflow-y: auto;
}
.combo-item { padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.combo-item:last-child { border-bottom: 0; }
.combo-item:active { background: var(--brand-soft); }
.combo-item .pick-title { font-size: 14px; font-weight: 500; color: var(--text); }
.combo-item .pick-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- 更多选项折叠 ---------- */
.more-box { margin: 2px 0 12px; border-top: 1px dashed var(--line); padding-top: 8px; }
.more-box > summary {
  list-style: none; cursor: pointer; font-size: 12px; color: var(--brand);
  display: flex; align-items: center; gap: 6px; padding: 2px 0 4px;
}
.more-box > summary::-webkit-details-marker { display: none; }
.more-box > summary::after { content: '展开'; margin-left: auto; font-size: 11px; color: var(--muted); }
.more-box[open] > summary::after { content: '收起'; }
.more-box[open] > summary { margin-bottom: 10px; }

/* 单据详情里的一键收款 */
.quick-pay { margin: 12px 0 4px; }

/* ---------- 客户扫码看进度：客户侧免登录页 ---------- */
.track-wrap { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg); }
.track-top {
  background: linear-gradient(160deg, #128573, #0a5348); color: #fff;
  padding: calc(20px + env(safe-area-inset-top)) 18px 22px;
}
.track-top-inner { max-width: 520px; margin: 0 auto; }
.track-shop, .track-title { font-size: 16px; font-weight: 600; letter-spacing: .5px; }
.track-sub { font-size: 12px; opacity: 1; margin-top: 3px; }
.track-body { padding: 14px 14px calc(34px + env(safe-area-inset-bottom)); }
.track-loading { padding: 90px 20px; text-align: center; color: var(--muted); font-size: 14px; }

.track-status { border-left: 4px solid var(--brand); padding: 2px 0 2px 12px; margin-bottom: 18px; }
.track-status .ts-label { font-size: 12px; color: var(--muted); }
.track-status .ts-value { font-size: 24px; font-weight: 700; margin: 4px 0 6px; letter-spacing: -.5px; color: var(--text); }
.track-status .ts-note { font-size: 13px; color: var(--text-2); line-height: 1.7; }
.track-status.is-done { border-left-color: var(--ok); }
.track-status.is-done .ts-value { color: var(--ok); }
.track-status.is-run .ts-value { color: var(--brand); }

.track-hero { margin-bottom: 14px; }
.track-hero.is-run { border-left: 4px solid var(--brand); }
.track-hero.is-done { border-left: 4px solid var(--ok); }
.track-hero.is-warn { border-left: 4px solid var(--warn); }
.track-hero.is-ok { border-left: 4px solid var(--ok); }

.steps { padding-top: 14px; border-top: 1px dashed var(--line); }
.step { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ''; position: absolute; left: 11px; top: 26px; bottom: -2px; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step-dot {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; background: rgba(15, 111, 95, 0.10); color: var(--muted);
}
.step.done .step-dot { background: var(--brand); color: #fff; }
.step-main { min-width: 0; padding-top: 1px; }
.step-title { font-size: 14px; font-weight: 500; color: var(--text); }
.step:not(.done) .step-title { color: var(--muted); }
.step-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.track-empty { padding: 96px 24px; text-align: center; color: var(--muted); }
.track-empty .ei { font-size: 32px; display: block; margin-bottom: 10px; opacity: .5; }
.track-empty h3 { color: var(--text); font-size: 16px; margin: 0 0 8px; }
.track-empty p { font-size: 14px; margin: 0 auto; max-width: 300px; line-height: 1.8; }

/* 分享弹窗里的二维码 */
.share-qr { text-align: center; padding: 6px 0 2px; }
.share-img { width: 230px; height: 230px; max-width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.share-no { font-size: 13px; color: var(--text-2); margin-top: 8px; letter-spacing: .5px; }

/* 列表加载中：压暗过渡，不再反复闪骨架 */
.card.flush { transition: opacity .15s ease; }
.card.flush.loading { opacity: .45; }

/* 「一键生成」预览窗：一行一条建议，可勾选、可改数字 */
.draft-list { max-height: 50vh; overflow: auto; margin: 2px -4px 0; }
.draft-row {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 6px; border-bottom: 1px solid var(--line);
}
.draft-row:last-child { border-bottom: 0; }
.draft-row.off { opacity: .42; }
.draft-pick { flex: 0 0 auto; padding-top: 4px; }
.draft-cb { width: 18px; height: 18px; accent-color: var(--brand); }
.draft-cells { flex: 1 1 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 7px 10px; min-width: 0; }
.draft-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.draft-label { font-size: 11px; color: var(--muted); }
.draft-cell .input { padding: 6px 8px; font-size: 13px; }

/* 明细行右侧：到货 / 删除 两个小按钮 */
.row .r-acts {
  flex: 0 0 auto; display: flex; flex-direction: column;
  align-items: flex-end; gap: 6px;
}
.row .r-acts .btn.sm { width: auto; margin: 0; }
/* 明细行操作按钮：胶囊形 + 柔和配色 + 轻投影，精致不抢眼 */
.row .r-acts .btn.sm {
  border-radius: 999px; padding: 3px 12px; font-size: 11.5px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 60, 42, 0.06); letter-spacing: 0.5px;
}
.row .r-acts .btn.danger { background: #fff1f0; color: #c0392b; border-color: #f5c6c2; }
.row .r-acts .btn.danger:active { background: #ffe4e1; }
.row .r-acts .btn.ghost { background: var(--card); }
.btn.arrived-on {
  background: var(--ok-soft); color: #166534;
  border-color: transparent; font-weight: 600;
}
/* 已下单未到货：琥珀色，和「已到货」的绿色区分开 */
.btn.ordered-on {
  background: var(--warn-soft); color: #b45309;
  border-color: transparent; font-weight: 600;
}

/* 到货进度条 */
.arrive-bar { margin-bottom: 10px; }
.arrive-bar .detail-head { margin-bottom: 0; align-items: center; }

/* 窗帘明细行：带标签的字段网格（左列定宽 190，右列紧随其后——货号值末尾≈工艺行末尾；
   长值在各自列内换行，永不重叠。工艺和状态独立通栏行） */
.dv-grid { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 5px 24px; font-size: 12px; }
.dv-cell { display: flex; min-width: 0; }
.dv-cell span { color: var(--muted); flex: 0 0 3em; }
.dv-cell b { font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.dv-line { display: flex; margin-top: 5px; font-size: 12px; }
.dv-line span { color: var(--muted); flex: 0 0 3em; }
.dv-line b { font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
/* 手机：单列竖排，字段值再长也不折行错位 */
@media (max-width: 640px) {
  .dv-grid { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .dv-line { font-size: 11.5px; }
}
/* ---------- 明细按厂家分组的组头（截屏整段发给对应工厂） ---------- */
.fg-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; row-gap: 7px;
  padding: 8px 16px 7px; background: var(--brand-soft);
}
/* 厂家名弹性占满（过长省略号）→ 操作按钮固定靠右，不随名字长度漂移；单号信息整行换到第二行 */
.fg-name { font-size: 14px; font-weight: 600; color: var(--brand); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-no { order: 9; flex: 1 1 100%; margin-left: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; line-height: 1.55; }
.fg-copy {
  flex: 0 0 auto; border: 1px solid var(--brand); color: var(--brand);
  background: var(--card); border-radius: 6px; padding: 2px 9px; font-size: 12px; cursor: pointer;
}
/* 一键下单：同厂家未到货行全标下单 + 出订货图片自动复制 */
.fg-order {
  flex: 0 0 auto; border: 1px solid var(--brand); color: #fff;
  background: var(--brand); border-radius: 6px; padding: 2px 9px; font-size: 12px; cursor: pointer;
}
/* 组级状态开关：未到货（可点 = 这一家全部到货）/ 已到货（静态） */
.fg-state {
  flex: 0 0 auto; border: 1px solid var(--line); color: var(--text-2);
  background: var(--card); border-radius: 6px; padding: 2px 9px; font-size: 12px; cursor: pointer;
}
.fg-state.arrived { border-color: var(--brand); color: var(--brand); cursor: pointer; }
button.fg-state { font-family: inherit; }
/* 按厂家看：已到货的行，副行到货进度用绿色强调 */.fac-arrived { color: var(--brand); font-weight: 600; }
/* 安装单整单信息行：电话地址一行带过 + 安装完成按钮 */
.fg-info {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.fg-contact { font-size: 12px; color: var(--text-2); min-width: 0; flex: 1; }
.fg-acts { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.fg-info .btn { flex: 0 0 auto; width: auto; margin: 0; }

/* 售后记录行 */
.sales-line {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.sales-line:last-child { border-bottom: 0; }
.sales-note { flex: 1; min-width: 0; color: var(--text-2); }
.sales-line .r-sub { flex: 0 0 auto; }
.sales-acts { flex: 0 0 auto; display: flex; gap: 6px; }
.sales-acts .btn { width: auto; margin: 0; }

/* 厂家档案：一行一家，带已积累货号数 */
.fac-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 2px; border-bottom: 1px solid var(--line);
}
.fac-row:last-child { border-bottom: 0; }
.fac-row .fac-main { flex: 1; min-width: 0; }
.fac-row .fac-name { font-size: 14px; color: var(--text); }
.fac-row .fac-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fac-row .fac-acts { flex: 0 0 auto; display: flex; gap: 6px; }
.fac-row .fac-acts .btn.sm { width: auto; margin: 0; }

/* 一次加多个房间：一行一个房间 + 宽 / 高 / 下料米数 */
.pair-list { margin: 2px 0 0; }
.pair-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.pair-row:last-child { border-bottom: 0; }
.pair-head { display: flex; align-items: center; gap: 8px; }
.pair-head .row-inline { flex: 1 1 auto; min-width: 0; }
.pair-head .row-inline .input { min-width: 0; }
.pair-nums { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.pair-nums .input { min-width: 0; }
/* 成品尺寸块：每行头上标注对应房间名（随房间输入实时更新） */
.pair-size-tag { font-size: 12px; color: var(--muted); line-height: 1.2; }
/* 房间 + 类型并排一行：左右两列各占一半，和下方 form-grid 两列两端对齐（gap 与 grid 的 14px 一致） */
.room-cat-row { display: flex; gap: 14px; align-items: flex-start; }
.room-cat-row .rc-room { flex: 0 0 calc(50% - 7px); min-width: 0; }
.room-cat-row .rc-cat { flex: 0 0 calc(50% - 7px); }
.room-cat-row .rc-add { width: 100%; margin: 8px 0 0; padding: 7px 6px; font-size: 12px; line-height: 1.35; white-space: normal; }
/* 工艺点选 chips：拉通整列、两端对齐，高度与输入栏一致（仅窗帘下单更多区用 chip-fill） */
.chip-fill { flex-wrap: nowrap; }
.chip-fill .chip { flex: 1 1 0; text-align: center; padding: 12.5px 4px; font-size: 13px; border-radius: 10px; }

/* ---------- 返单 / 成本 ---------- */
.bill-imgs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; }
.bill-thumb {
  width: 74px; height: 74px; object-fit: cover; flex: 0 0 auto;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-elevated);
}
.bill-full { width: 100%; max-height: 68vh; object-fit: contain; border-radius: var(--radius-sm); }
/* 回单登记拖拽/粘贴框 */
.bill-drop {
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--bg-elevated);
  min-height: 130px; display: flex; align-items: center; justify-content: center;
  padding: 14px; margin: 10px 0 4px; cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s;
}
.bill-drop.on { border-color: var(--brand); background: rgba(15, 111, 95, 0.06); }
.bill-drop-big { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.bill-drop-empty .hint { margin: 2px 0; }
.bill-drop-thumbs { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%; }
.bill-drop-thumb {
  position: relative; width: 104px; height: 104px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); overflow: hidden; background: var(--bg-elevated);
}
.bill-drop-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.bill-drop-x {
  position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; line-height: 20px;
  border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff;
  font-size: 14px; cursor: pointer; padding: 0;
}
.bill-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* 开单核对页头部字段容器：手机竖屏两列，横屏（wide）下自动多列 */
.bill-head { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bill-head .field { margin-bottom: 0; }
.bill-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.bill-grid2 .field { margin-bottom: 0; }
/* 回单比对 · 逐行逐字段对照清单 */
.bill-cmp-row {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px;
  background: var(--bg-elevated);
}
.bill-cmp-row.matched { border-color: #2f9e6e; }
.bill-cmp-head { font-weight: 600; margin-bottom: 6px; color: var(--text); }
.bill-cmp-cell { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 14px; }
.bill-cmp-label { flex: 0 0 56px; color: var(--text-2); }
.bill-cmp-ok { color: #2f9e6e; }
.bill-cmp-diff { color: #d64545; word-break: break-all; }
.bill-cmp-note { color: var(--muted); }

.bill-grid3 .field { margin-bottom: 0; }
.btn.dim { opacity: 0.55; }
.bill-cell { min-width: 0; }
.bill-cell label { display: block; font-size: 11.5px; color: var(--text-2); margin-bottom: 4px; }
.bill-cell .input { padding: 7px 8px; font-size: 14px; min-width: 0; width: 100%; }
.bill-h { margin: 16px 0 8px; font-size: 14px; color: var(--brand); }
.bill-rows { display: grid; grid-template-columns: 1fr; gap: 0 12px; align-items: start; }
.bill-room-block { min-width: 0; }

/* 桌面端（≥768px，与左侧导航侧边栏同断点）：开单核对 / 下单表单 / 单据详情的 .wide 弹窗
   显示在内容区卡片位置（导航栏右侧、页头下方、四周留 .page 同款边距、最大宽 1240 居中）
   ——像列表页那张卡片，不铺满到屏幕边缘；平板与电脑一致，手机（<768px）保持原版式 */
@media (min-width: 768px) {
  /* ★ 2026-11-14（用户）：整页表单不要遮罩 —— 垫白底铺满内容区，面板贴边，没有可误触的灰条。
     ★ 选择器挂在 .wide-layer 上（不是 .wide-root）：否则叠在整页表单上的小弹窗也会被拉满屏。 */
  .modal-layer.wide-layer {
    left: 260px;
    align-items: stretch; justify-content: center;
    padding: 0;
    background: var(--bg-elevated);
    overflow-y: auto;
  }
  .modal-layer.wide-layer .modal-mask { display: none; }
  /* mask 用 inset:0 自动跟随 layer（layer 已从导航栏右侧开始），不要再偏移 */
  .modal-layer.wide-layer .modal.wide {
    max-width: 1320px; margin: 0 auto; width: 100%; flex: 1 1 auto; height: auto; max-height: none;
    border: 0; border-radius: 0;
    padding: 22px 28px calc(28px + env(safe-area-inset-bottom));
    animation: none;   /* 整页表单不做上滑动画 */
    box-shadow: none;
  }
  /* 下单表单字段连续，auto-fit 按屏宽自适应（核对页宽屏走 .bill-tables 表格，不再渲染卡片字段） */
  .modal.wide .form-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); column-gap: 16px; }
  /* 开单核对页头部：横屏下短字段自动多列，输入框不再拉长 */
  .modal.wide .bill-head { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); column-gap: 16px; }
  .modal.wide .bill-row { padding: 10px 14px; }
  .modal.wide .bill-grid2 .row-inline .input { flex: 1 1 auto; min-width: 0; }
}
/* ≥1280px：导航栏 280px、.page 边距 32px，同步跟随 */
@media (min-width: 1280px) {
  .modal-layer.wide-layer { left: 280px; }
}
/* 核对页电脑端表格化（2026-10-25）：≥900px 由 JS 渲染 .bill-tables（每房间一组：组头 + 窗帘明细表 + 辅材表）；
   手机与中屏仍走 .bill-rows 卡片式，样式互不影响 */
.bill-tables { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.bill-table-block { min-width: 0; }
.bill-table { margin: 0 0 4px; }
.bill-table .it-table-wrap { max-height: none; }
/* fixed 布局：表格永远铺满容器宽度、按列均分收窄，不出横向滚动条（用户 2026-10-25 定） */
.bill-table .it-table { table-layout: fixed; width: 100%; }
.bill-table .it-table th { white-space: normal; padding: 6px 5px; font-size: 12px; }
/* 飘窗垫小表（9 列）：按布/纱那套 fixed + 百分比的思路定宽，视觉一致 */
.bill-table .it-table.cushion th:first-child { width: 5%; }      /* 序号 */
.bill-table .it-table.cushion th:nth-child(2) { width: 10%; }    /* 类型 */
.bill-table .it-table.cushion th:nth-child(3) { width: 15%; }    /* 主材厂家 */
.bill-table .it-table.cushion th:nth-child(4) { width: 15%; }    /* 主材型号 */
.bill-table .it-table.cushion th:nth-child(5) { width: 8%; }     /* 长度 */
.bill-table .it-table.cushion th:nth-child(6) { width: 8%; }     /* 宽度 */
.bill-table .it-table.cushion th:nth-child(7) { width: 8%; }     /* 厚度 */
.bill-table .it-table.cushion th:nth-child(8) { width: 23%; }    /* 备注 */
.bill-table .it-table.cushion th:nth-child(9) { width: 8%; }     /* 删 */
.bill-table .it-table.fab th:first-child { width: 5%; }     /* 序号 */
.bill-table .it-table.fab th:nth-child(2) { width: 9%; }     /* 类型 */
.bill-table .it-table.fab th:nth-child(3) { width: 15%; }    /* 窗帘厂家 */
.bill-table .it-table.fab th:nth-child(4) { width: 15%; }    /* 主材型号 */
.bill-table .it-table.fab th:nth-child(5) { width: 7%; }     /* 用料 */
.bill-table .it-table.fab th:nth-child(6) { width: 7%; }     /* 成品宽 */
.bill-table .it-table.fab th:nth-child(7) { width: 7%; }     /* 成品高 */
.bill-table .it-table.fab th:nth-child(8) { width: 9%; }     /* 开向 */
.bill-table .it-table.fab th:nth-child(9) { width: 20%; }    /* 工艺（摘要 + 更多同一行） */
.bill-table .it-table.fab th:last-child { width: 6%; }       /* 删 */
/* 窄屏（≤1280px）：工艺列挤，让厂家/型号各收 2%，把空间还给「工艺 + 更多」（2026-11-14） */
@media (max-width: 1280px) {
  .bill-table .it-table.fab th:nth-child(3),
  .bill-table .it-table.fab th:nth-child(4) { width: 13%; }
  .bill-table .it-table.fab th:nth-child(9) { width: 24%; }
  .bill-table .craft-col .btn { padding: 4px 8px; }
}
/* 辅材表列宽：安装位置/厂家/型号/安装方式宽，备注最宽 */
/* 辅材表 9 列（2026-11-14 把「安装位置」改成房间名、新增「安装类型」列） */
.bill-table .it-table.foot th:nth-child(1) { width: 10%; }   /* 安装位置（房间） */
.bill-table .it-table.foot th:nth-child(2) { width: 10%; }   /* 安装类型（布/纱） */
.bill-table .it-table.foot th:nth-child(3) { width: 12%; }   /* 辅材厂家 */
.bill-table .it-table.foot th:nth-child(4) { width: 10%; }   /* 辅材类型 */
.bill-table .it-table.foot th:nth-child(5) { width: 12%; }   /* 辅材型号 */
.bill-table .it-table.foot th:nth-child(6) { width: 11%; }   /* 尺寸 */
.bill-table .it-table.foot th:nth-child(7) { width: 12%; }   /* 安装方式 */
.bill-table .it-table.foot th:nth-child(8) { width: 17%; }   /* 辅材备注 */
.bill-table .it-table.foot th:last-child { width: 6%; }
/* 按钮行：下移与组头/表格留距，垂直居中（用户 2026-10-25 定） */
/* 同名房间不合并后的序号（客厅 1 / 客厅 2，2026-11-14） */
.bill-room-seq {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px;
  border-radius: 999px; background: var(--accent-weak, #e6f4ef); color: var(--accent, #0f6f5f);
  font-size: 12px; font-weight: 600;
}
.bill-table-btns { margin: 12px 0 14px; align-items: center; }
.bill-table .it-table td { padding: 5px 5px; vertical-align: middle; text-align: center; }
.bill-table .it-table td .input { text-align: center; }
/* 备注这类长文本左对齐更好读（显式 class，别依赖 placeholder 文案） */
.bill-table .it-table td .input.ta-left { text-align: left; }
/* 花边：勾选「加花边」+ 货号（2026-11-14）；填货号会自动勾上，不用再点 */
.bill-cell .chk-label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; white-space: nowrap; color: var(--text-2); }
.bill-cell .chk-label input.chk { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); flex: 0 0 auto; }
.bill-table .it-table td .lace-row .input { flex: 1 1 auto; min-width: 0; }
.bill-table .it-table td .lace-row .chk-label { flex: 0 0 auto; }
.bill-table .it-table td .input { width: 100%; min-width: 0; padding: 6px 5px; font-size: 12px; height: 34px; }
.bill-table .it-table td .row-inline { display: flex; gap: 4px; align-items: center; }
.bill-table .it-table td .row-inline .input { flex: 1 1 auto; min-width: 0; width: auto; }
.bill-table .it-table td .row-inline .btn.plain.sm { flex: 0 0 auto; }
.bill-table .it-table td .chip { padding: 3px 8px; font-size: 12px; }
.bill-table .it-table tbody tr { cursor: default; }
/* 工艺列纵向排：浓缩文本在上、「更多」按钮在下，窄列放得下 */
/* 工艺列（2026-11-14 用户）：摘要与「更多」同一行、按钮靠右；内容多也不换行成两截 */
.bill-table .craft-col { display: flex; flex-direction: row; gap: 6px; align-items: center; }
.bill-table .craft-col .bill-craft-summary {
  flex: 1 1 auto; min-width: 0; text-align: left;
  font-size: 11.5px; color: var(--text-2);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  line-clamp: 2; overflow: hidden; word-break: break-word;
  /* 老内核（部分 Android WebView / 旧微信 X5）不支持 line-clamp 时，靠 max-height 兜底裁剪 */
  max-height: 2.9em;
}
.bill-table .craft-col .btn { flex: 0 0 auto; align-self: center; white-space: nowrap; }
.bill-craft-summary { font-size: 11.5px; color: var(--text-2); }
/* 分装时布/纱与各自辅材配对：侧标题条（布块 / 纱块） */
.bill-side-head {
  margin: 6px 0 6px; padding: 4px 10px; display: inline-block;
  font-size: 13px; font-weight: 600; color: var(--brand);
  background: rgba(15, 118, 110, 0.07); border-radius: 6px;
}
.bill-expand td { background: rgba(15, 118, 110, 0.04); }
/* 展开行是「表单区」：标签和字段统一左对齐（不跟着表格数据居中，2026-11-14）。
   选择器要比 `.bill-table .it-table td`（0,2,1）更具体，否则被居中规则盖掉。 */
.bill-table .it-table tr.bill-expand td { text-align: left; }
.bill-table .it-table tr.bill-expand .bill-cell,
.bill-table .it-table tr.bill-expand .bill-cell label { text-align: left; }
.bill-expand .bill-cell { min-width: 150px; }
/* 宽屏（电脑横屏/平板上）：明细按房间双列铺开，减少上下滚动 */
@media (min-width: 768px) {
  .bill-rows { grid-template-columns: 1fr 1fr; }
}
.bill-room {
  margin: 10px 0 0; padding: 6px 10px;
  font-size: 13px; font-weight: 600; color: var(--brand);
  background: rgba(15, 118, 110, 0.07); border-radius: var(--radius-sm);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
/* 组头房间名输入框：融进组头条，点进去就能填/改房间 */
.bill-room-in {
  flex: 1; min-width: 0; border: none; background: transparent; padding: 2px 4px;
  font-size: 13px; font-weight: 600; color: var(--brand); height: auto;
}
.bill-room-in::placeholder { color: rgba(15, 118, 110, 0.55); font-weight: 500; }
.bill-room-in:focus { outline: none; box-shadow: 0 1px 0 var(--brand); border-radius: 0; }
.bill-room-ctrl {
  border: 1px dashed var(--line); border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 8px 10px 2px; margin-bottom: 8px;
  background: rgba(15, 118, 110, 0.03);
}
.bill-room-foot {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px 2px; margin-top: 2px; margin-bottom: 8px;
  background: rgba(15, 118, 110, 0.03);
}
/* 辅料栏标题栏：左标题 + 右「删」 */
.bill-foot-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.bill-foot-title { font-size: 13px; font-weight: 600; color: var(--muted); }
/* 核对页行内「更多」工艺折叠区 */
.bill-more { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.bill-more > .btn { margin-bottom: 8px; }
/* 核对页：输入栏 / 选择 chips / 按钮高度统一（对齐窗帘厂家输入栏） */
.bill-row .input, .bill-room-foot .input { height: 36px; padding-top: 0; padding-bottom: 0; }
.bill-row .chip, .bill-room-foot .chip {
  height: 36px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.bill-row .btn.plain.sm, .bill-room-foot .btn.plain.sm {
  height: 36px; padding-top: 0; padding-bottom: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
/* 日期输入统一左对齐（部分内核日期文字会居中） */
.bill-row {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px; margin-bottom: 8px;
}
.bill-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.bill-row-no { font-size: 12px; color: var(--muted); }
.bill-row .bill-grid2 { margin-bottom: 8px; }
.bill-line {
  display: grid; grid-template-columns: 1fr 1.3fr .8fr .8fr .9fr; gap: 6px;
  padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 12px;
}
.bill-line.head { color: var(--muted); font-size: 11.5px; border-bottom: 1px solid var(--line); }
.bill-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bill-line span:nth-child(3), .bill-line span:nth-child(4), .bill-line span:nth-child(5) { text-align: right; }
.bill-issue {
  background: var(--warn-soft); color: #92400e; border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 12px; margin: 8px 0; line-height: 1.65;
}
.bill-issue.info { background: rgba(15, 111, 95, 0.08); color: var(--brand); }
.bill-issue.warn { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.bill-sum { margin-top: 10px; font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.bill-owner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.bill-owner-label { color: var(--text-2); }
.bill-owner .row-inline { margin-left: auto; }
.hint.ok { color: var(--ok); }
.hint.warn { color: var(--warn); }
.bill-total {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; margin-bottom: 10px;
}
.bill-total-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); padding: 3px 0; }
.bill-total-line b { font-variant-numeric: tabular-nums; color: var(--text); }
.bill-total-line.big { font-size: 14px; color: var(--text); border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 8px; }
.bill-total-line.big b { color: var(--brand); font-size: 16px; }

/* 单据详情里的成本块 */
.cost-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; margin-top: 12px;
}
.cost-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cost-head h4 { margin: 0; font-size: 14px; color: var(--text); }
.cost-line { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.cost-line:last-child { border-bottom: 0; }
.cost-line .mono { font-variant-numeric: tabular-nums; }
.cost-line .cost-fac { flex: 1; min-width: 0; }
.cost-line .cost-acts { display: inline-flex; gap: 6px; align-items: center; margin-left: 8px; flex-shrink: 0; }
.cost-line .cost-acts .btn { padding: 1px 9px; font-size: 12px; line-height: 1.6; }
.cost-line.profit b { color: var(--brand); }
.cost-line.loss b { color: var(--danger); }
/* 成本卡：汇总行（主材返单/安装费/成本合计）加粗顶格、上方实线分隔；明细子项缩进淡化 */
.cost-line.cost-sum { border-top: 1px solid var(--line); border-bottom: 0; padding-top: 8px; margin-top: 2px; font-weight: 600; color: var(--text); }
.cost-line.cost-sum .mono { font-weight: 600; color: var(--text); }
/* 成本子项（回单 / 安装费）：金额给一个**固定下限宽度 + 右对齐**，各行右边缘才在一条线上（R68）。
   为什么不写死 px 宽：用户放大字号/字体回退/超长金额（¥1,234,567.89）时，写死会被压字或重叠；
   min-width 让它在够用时保持 92px（跨行对齐），真超长就这一行长大，也压不到「改 / 删」。
   注意：`.cost-sub` 还被回单选择弹窗、工作台「待处理」等**只有两格**的行复用（js/bill.js / js/dashboard.js），
   所以这里只给金额本身上限，**不把整行改成 grid**（那样两格行的金额会掉进第二列）。 */
.cost-line.cost-sub { padding-left: 16px; color: var(--text-2); }
.cost-line.cost-sub > .mono { flex: 0 0 auto; min-width: 92px; text-align: right; white-space: nowrap; }
.cost-line.cost-sub .cost-acts { justify-content: flex-end; }
@media (max-width: 420px) {
  .cost-line.cost-sub > .mono { min-width: 82px; }
}
.cost-line.cost-sub .mono { color: var(--text-2); }
.cost-sub-hint { padding-left: 16px; margin: 4px 0 6px; }
/* 漏厂家返单提醒：黄条，放在成本卡片顶部 */
.cost-miss {
  margin: 2px 0 6px; padding: 8px 10px;
  background: var(--warn-soft); border: 1px solid var(--warn); border-radius: 8px;
  font-size: 12px; color: var(--warn); line-height: 1.5;
}

/* ---------- 桌面端：左侧导航（≥900px） ----------
   手机优先：窄屏仍走底部导航。宽屏把 .nav 从底部挪到左侧做常驻侧边栏。 */
.nav-brand { display: none; }

@media (min-width: 768px) {
  .app-shell { margin-left: 260px; }
  /* 宽屏弹窗居中显示（手机保持底部抽屉） */
  .modal-layer { align-items: center; padding: 40px 16px; box-sizing: border-box; }
  .modal { border-radius: 20px; border-bottom: 1px solid rgba(15, 111, 95, 0.08); max-height: 82vh; }

  .form-grid { grid-template-columns: 1fr 1fr; column-gap: 14px; }

  .nav {
    position: fixed; left: 0; top: 0; right: auto; bottom: 0;
    width: 260px; height: auto;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
    padding-left: calc(18px + env(safe-area-inset-left));
    border-top: 0; border-right: 1px solid var(--line);
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 4px; overflow-y: auto; scrollbar-width: thin;
    background: var(--bg-elevated);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav::-webkit-scrollbar { width: 6px; }

  .nav-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 4px 10px 22px; margin-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }
  .nav-logo {
    width: 44px; height: 44px; border-radius: 14px; flex: 0 0 auto;
    background: linear-gradient(160deg, #128573, #0a5348); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 600;
  }
  .nav-brand-text { flex: 1; min-width: 0; }
  .nav-brand-name { font-size: 16px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-brand-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .nav-item {
    flex: 0 0 auto; width: 100%;
    flex-direction: row; justify-content: flex-start; align-items: center;
    gap: 12px; padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px; color: var(--text-2);
    position: relative;
  }
  .nav-item:active { opacity: 1; }
  .nav-item svg { width: 22px; height: 22px; }
  .nav-item:hover { background: rgba(15, 111, 95, 0.08); color: var(--brand); }
  .nav-item.active {
    color: #fff; background: var(--brand); font-weight: 600;
  }
  .nav-item.active::before { display: none; }
  .nav-item.active svg { stroke-width: 1.8; }

  .topbar { padding-left: 0; padding-right: 0; }
  .topbar-inner { padding-left: 28px; padding-right: 28px; max-width: 1240px; }

  .page {
    max-width: 1240px;
    padding: 24px 28px calc(40px + env(safe-area-inset-bottom));
  }
  .page > .kpi-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .page > .kpi-grid .kpi { padding: 16px; }
  .page > .kpi-grid .kpi .k-value { font-size: 20px; }
  .page > .quick-grid { grid-template-columns: repeat(6, 1fr); gap: 14px; }
  .page > .card { padding: 18px; }
  .page > .card.flush { padding: 0; }
  .toast { bottom: calc(34px + env(safe-area-inset-bottom)); }

  .dashboard-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); gap: var(--grid-gap); align-items: start;
  }
  .dashboard-main { min-width: 0; }
  .dashboard-side { min-width: 0; }
  .dashboard-side .hero-card,
  .dashboard-side .card { margin-bottom: 14px; }
  .hero-value { font-size: 32px; }
  .metric-pill { padding: 12px 14px; }
  .metric-pill .mp-value { font-size: 20px; }
}
/* Pad 横竖屏/小笔记本（768~1279）三卡并排变窄，金额字号收回，避免被省略号截断 */
@media (min-width: 768px) and (max-width: 1279px) {
  .metric-pill .mp-value { font-size: 14px; }
}

/* Pad 横屏（1024~1279）：左侧导航占 260px，再留 360 侧栏主列只剩 300 多 → 侧栏收窄、间距收小，
   三页仍然共用同一套变量（R111：切 tab 不许跳） */
@media (min-width: 1024px) and (max-width: 1279px) {
  :root { --side-w: 300px; --grid-gap: 16px; }
}

/* 更宽屏：≥1280px 充分利用大屏 */
@media (min-width: 1280px) {
  .app-shell { margin-left: 280px; }
  .nav { width: 280px; padding-left: calc(22px + env(safe-area-inset-left)); padding-right: 22px; }
  .page { padding: 28px 32px calc(40px + env(safe-area-inset-bottom)); }
  .page > .card { padding: 20px; }
  .page > .card.flush { padding: 0; }
}

/* ---------- 报表页 ---------- */
/* 分组柱状图：柱子多时横向滚动，SVG 用 viewBox 缩放 */
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.report-chart { display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 2px 8px; font-size: 12px; color: var(--muted); }
.chart-legend .lg-item { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .dot, .stack-legend .dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.chart-readout { font-size: 12px; color: var(--text-2); margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); line-height: 1.7; }

/* 月度明细行 */
.month-row { padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.month-row:last-child { border-bottom: 0; }
.month-row.current { background: rgba(15, 111, 95, 0.04); }
.month-head { display: flex; align-items: baseline; gap: 8px; }
.month-name { font-size: 13px; color: var(--muted); flex: 1; font-variant-numeric: tabular-nums; }
.month-row.current .month-name { color: var(--brand); font-weight: 700; }
.month-amt { font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.month-paid { font-size: 12px; color: var(--muted); }
.month-bar { height: 5px; border-radius: 3px; background: rgba(15, 111, 95, 0.10); margin-top: 6px; overflow: hidden; }
.month-fill { height: 100%; border-radius: 3px; transition: width .25s ease; }
.month-foot { display: flex; gap: 10px; margin-top: 6px; font-size: 11px; color: var(--muted); }

/* 横向堆叠条（账龄 / 成本结构） */
.stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: rgba(15, 111, 95, 0.08); }
.stack .stack-seg { height: 100%; display: block; }
.stack-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.stack-legend .it { display: inline-flex; align-items: center; gap: 5px; }
/* 导出按钮排 */
.export-row { display: flex; flex-wrap: wrap; gap: 8px; }
.export-row .btn { width: auto; margin: 0; }

/* ---------- 工作台：营业趋势图 ---------- */
.chart-head { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.hero-chart {
  height: 130px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border-radius: var(--radius-sm);
  border: 1px solid var(--line); overflow: hidden;
}
.trend-chart { height: 160px; }
.trend-chart.compact { height: 100%; }
.trend-svg {
  width: auto; height: 100%; max-width: 100%;
  display: block; border-radius: 8px;
}

@media (min-width: 768px) {
  /* 非趋势卡（开单/客户/下单等页面）：768 起统一 padding 与 pill 单行，避免指标丸换行挤乱 */
  .hero-card:not(.has-trend) { flex-direction: column; padding: 20px 18px; }
  .hero-card:not(.has-trend) .hero-pills { flex-wrap: nowrap; }
}
@media (min-width: 1024px) {
  /* 桌面端统一 Hero 卡片高度，切页时第一个栏不上下跳（基准已在基础类设置） */
  /* 只有带趋势图的工作台卡片才左右分栏；其他页面保持上下堆叠，避免指标丸被挤窄 */
  .hero-card.has-trend { flex-direction: row; align-items: stretch; gap: 18px; padding: 20px 18px; }
  .hero-left { display: flex; flex-direction: column; justify-content: space-between; }
  .hero-right { width: 46%; max-width: 340px; flex-shrink: 0; }
  .hero-chart { height: 100%; min-height: 140px; max-height: 188px; }
  .trend-chart { height: 180px; }
}
@media (min-width: 1280px) {
  .hero-right { width: 44%; max-width: 380px; }
  .hero-chart { min-height: 155px; }
  .trend-chart { height: 200px; }
}

/* ---------- 「我的」新版：Hero 门店卡 + 分组菜单 ---------- */
.hero-card.me-hero {
  padding: 16px;
  overflow: hidden;
}
.me-head {
  display: flex; align-items: center; gap: 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.me-avatar {
  width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600;
}
.me-name-block { flex: 1; min-width: 0; }
.me-name { font-size: 16px; font-weight: 600; }
.me-role {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px;
  background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 500; vertical-align: 2px;
}
.me-hero .hero-pills { margin-top: 12px; padding-top: 0; }
.me-actions {
  display: flex; gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}
.me-actions .btn { flex: 1; }

/* 邀请码常驻栏（红框大卡底部） */
.me-invite {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 10px 12px;
  background: var(--brand-soft); border-radius: 10px;
}
.me-invite-ico {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.me-invite-body { flex: 1; min-width: 0; }
.me-invite-label { font-size: 11px; color: var(--brand); line-height: 1.3; }
.me-invite-code {
  font-size: 16px; font-weight: 600; letter-spacing: 2px;
  color: var(--text); line-height: 1.2; cursor: pointer;
}
.me-invite .btn { flex-shrink: 0; }

/* 套餐 / 充值：手机纵向、桌面横向三列 */
.plan-grid, .pack-grid { display: flex; flex-direction: column; gap: 10px; }
.plan-grid .card, .pack-grid .card { margin-bottom: 0; }
@media (min-width: 768px) {
  .plan-grid, .pack-grid { display: grid; grid-template-columns: repeat(3, 1fr); align-items: stretch; }
}

/* 报表页（2026-11-23 改版 R116）：
   · 长列表（厂家排行 / 欠款账龄 / 客户贡献）一律**全宽**，不再挤半宽；
     桌面端在卡片内部排成两列（.rows.cols2），手机单列。
   · 只有「品类结构 + 成本结构」这两个短块并排（.report-pair）。 */
.report-grid { display: block; }
.report-pair { display: block; }
@media (min-width: 768px) {
  .report-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; align-items: stretch; }
  /* 2026-11-23 用户：「电脑端 本年成本结构 加高 跟左边品类结构一致」
     两张卡等高（stretch），环图在卡里垂直居中并放大一点，避免下面一大片留白 */
  .report-pair .card { margin-bottom: 0; display: flex; flex-direction: column; }
  .report-pair .donut-wrap { flex: 1; align-items: center; margin-top: 0; }
  .report-pair .donut-box,
  .report-pair .donut-svg { width: 148px; height: 148px; }
  .report-pair .donut-legend { gap: 10px; font-size: 13px; }
  .rows.cols2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 26px; }
  .rows.cols2 .row:last-child,
  .rows.cols2 .row:nth-last-child(2) { border-bottom: 0; }
}
/* 「更多 / 收起」：虚线整条，点了就地展开，不跳页 */
.more-btn {
  display: block; width: 100%; margin-top: 10px; padding: 9px 12px;
  border: 1px dashed var(--line-strong, #d7e2dd); border-radius: 10px;
  background: #fbfdfc; color: var(--brand); font-size: 13px; font-weight: 600;
  cursor: pointer; text-align: center;
}
.more-btn:active { background: #f2f8f5; }
.more-btn .mb-sub { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
/* 品类结构：一格一个品类（不再是一长段文字；没有米数的只写单数） */
.chip-g { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-g .cg {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: #f7faf9; border: 1px solid #e8efec; border-radius: 10px;
  padding: 7px 11px; font-size: 12.5px; color: var(--muted);
}
.chip-g .cg b { font-size: 13px; font-weight: 650; color: var(--text); max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-g .cg i { font-style: normal; font-weight: 650; color: var(--brand); }
.chip-g .cg.is-plain { opacity: .75; }

/* 我的页菜单：手机单列、桌面三列并排（同行等高） */
.menu-grid { display: block; }
@media (min-width: 768px) {
  .menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
  .menu-grid .menu-group { margin-bottom: 0; }
}

/* 列表页（开单/下单/客户/库存）：手机单列、桌面双栏（列表为主 + 统计侧栏） */
.list-layout { display: block; }
@media (min-width: 1024px) {
  .list-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); gap: var(--grid-gap); align-items: start; }
  /* 侧栏卡片的竖向间距也统一（不然工作台和列表页的"卡与卡之间"看着不一样） */
  .list-side .card { margin-bottom: 14px; }
  /* 列表区给一个最小高度：切到空/少结果时整页不至于塌陷（那一下"跳"主要来自高度突变） */
  .list-main { min-height: 60vh; }
  .list-main { min-width: 0; }
  .list-side { min-width: 0; }
  .list-side .hero-card { position: sticky; top: 84px; }
}
/* 开单 / 下单页专用（R106）：手机/竖屏把右栏卡片提到列表上面，且默认收起成一行（省地方） */
@media (max-width: 1023px) {
  .list-layout.orders-layout,
  .list-layout.place-layout { display: flex; flex-direction: column; }
  .list-layout.orders-layout .list-side,
  .list-layout.place-layout .list-side { order: -1; }
}
.side-fold-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; margin-bottom: 8px; }
.side-fold-t { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; }
.side-fold-pills { display: flex; gap: 6px; flex: 1; min-width: 0; overflow: hidden; }
.side-fold-pill { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: #f1f5f4; color: #4b5a56; white-space: nowrap; }
.side-fold-chev { color: var(--muted); font-size: 12px; transition: transform .15s ease; }
.side-fold-chev.open { transform: rotate(180deg); }
/* 下单页「工序进度」每一档可点 = 直接筛那一档（2026-11-22 用户：图上点要能跳） */
.side-step-row { cursor: pointer; border-radius: 8px; padding: 2px 4px; margin: 0 -4px; }
.side-step-row:hover { background: rgba(15,111,95,.05); }
.side-step-row:active { transform: scale(.995); }
@media (min-width: 1024px) { .side-fold-head { display: none; } }

/* 分组菜单 */
.menu-group { overflow: hidden; }
.menu-group-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  padding: 14px 16px 10px;
  background: rgba(15, 111, 95, 0.03);
  border-bottom: 1px solid var(--line);
}
.menu-group .row { background: transparent; }
.menu-group .row:first-of-type { border-top: none; }

@media (min-width: 768px) {
  .me-head { padding-bottom: 14px; margin-bottom: 14px; }
  .me-hero .hero-value { font-size: 32px; }
}

.row .r-ico {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.row .r-badge {
  display: inline-block; margin-left: 8px; vertical-align: 1px;
  font-size: 11px; color: var(--brand); background: var(--brand-soft);
  padding: 2px 8px; border-radius: 99px; white-space: nowrap; font-weight: 400;
}
.row.danger .r-title { color: var(--danger); }
.row.danger .r-ico { background: rgba(220, 38, 38, 0.10); color: var(--danger); }

.cascade > .row .chev { transition: transform .25s ease; }
.cascade.open > .row .chev { transform: rotate(90deg); }
.cascade .sub { max-height: 0; overflow: hidden; transition: max-height .3s ease; background: #fafcfb; }
.cascade.open .sub { max-height: 540px; }
.cascade .sub .row { padding-left: 34px; background: #fafcfb; }
.cascade .sub .r-ico { width: 26px; height: 26px; font-size: 13px; border-radius: 8px; }
.cascade .sub .r-title { font-size: 14px; color: var(--text-2); }

/* ---- 窗帘下单：每房间一块（房间+尺寸+开向+工艺，2026-10-18 方案B）---- */
.pair-block { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 10px; }
.pair-block-head { display: flex; align-items: center; gap: 8px; }
.pair-block-head .row-inline { flex: 1 1 auto; min-width: 0; }
.pair-block-head .row-inline .input { min-width: 0; }
.pair-block .pair-nums { margin-top: 8px; }
.pair-block .form-grid { margin-top: 4px; }
.pair-block details.more-box { margin: 6px 0 0; }

/* ---- 手机端：厂家分组头两行化（用户 2026-10-18：画圈处不美观）----
   第一行：厂家名 + 三个操作按钮等宽均分（好点）；第二行：单号/套数/间数整行展示不挤成三行 */
@media (max-width: 640px) {
  .fg-head { padding: 10px 12px; }
  .fg-name { font-size: 14px; }
  .fg-copy, .fg-order, .fg-state {
    text-align: center; white-space: nowrap;
    padding: 7px 10px; font-size: 12px; min-width: 0;
  }
}

/* 详情头/列表长文本防溢出：电话/地址/客户名过长时不挤破左右布局（审查 2026-10-18） */
.detail-head > div:first-child { min-width: 0; }
.dh-title, .dh-sub, .r-sub { overflow-wrap: anywhere; }

/* ---- 手机端弹窗顶部对齐（2026-10-18 防晃关键）----
   原来 bottom-sheet 底部锚定：每次点输入框键盘弹起→视口缩小→弹窗整体重排上移，收起又落下 = 老晃。
   顶对齐后键盘 resize 只影响底部（被滚动容器裁掉），顶部内容位置不动。开单表单/回单比对等所有弹窗受益。
   断点 640→767：大屏手机/小平板（640~767px）原来落进「既不贴顶也不居中」的真空带，退成底部抽屉，
   用户反馈「弹窗不在最上边」（2026-10-27）。统一到 767px，≥768px 才切桌面居中。 */
@media (max-width: 767px) {
  .modal-layer { align-items: flex-start; padding-top: max(2vh, env(safe-area-inset-top)); }
  .modal { max-height: 94vh; border-radius: 16px; border-bottom: 1px solid rgba(15, 111, 95, 0.08); }
}

/* ---- 手机端弹窗横向溢出根治（2026-10-18：手指左右滑界面跟着动）----
   元凶：input[type=date] 在移动端有不可压缩的最小宽（约200px），把网格列/弹窗撑到比屏幕宽，
   弹窗居中溢出两侧（标题左裁、输入框右伸），横向滚动带动整页晃。 */
.modal { min-width: 0; overflow-x: hidden; }
.modal-layer { overflow: hidden; }
.field { min-width: 0; }
input[type="date"] { min-width: 0; width: 100%; }
/* iOS（含微信内置 WKWebView）的日期输入框有内在样式，会无视 width 按内容自然宽度渲染——
   「2026年10月18日」直接伸出容器被裁（用户 2026-10-18 实测）。appearance:none + 内部值 min-width:0 是标准修法。 */
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-height: 43px;
}
input[type="date"]::-webkit-date-and-time-value { min-width: 0; text-align: left; }

/* ---- 手机端工作台 Hero 卡防挤压（2026-10-18：指标值被竖裁 11px、与趋势图 0 间距）----
   根因：桌面统一的 min-height:228px 在手机上压缩 flex 子项。手机端高度交给内容，间距给足。 */
@media (max-width: 640px) {
  .hero-card, .hero-card.me-hero { min-height: 0; }
  .hero-left { flex: 0 0 auto; }
  .hero-card.has-trend { gap: 14px; }
  .hero-pills { padding-top: 2px; padding-bottom: 2px; gap: 8px; }
  .metric-pill { flex: 1 1 0; flex-shrink: 0; padding: 10px 10px; }
  .metric-pill .mp-value { font-size: 14px; line-height: 1.4; }
}

/* ---- 桌面/iPad：趋势图卡与左侧指标底部对齐（用户 2026-10-18）----
   原来 hero-chart 有 188px 高度上限，左侧内容更高时图表撑不满右侧、底部留白错位。
   改为 chart 填满右侧高度（卡片高度由左侧内容决定，不会失控）。 */
@media (min-width: 1024px) {
  .hero-card.has-trend .hero-right { display: flex; flex-direction: column; }
  .hero-card.has-trend .hero-chart { flex: 1 1 auto; height: auto; max-height: none; min-height: 140px; }
}

/* ---- 修：iPad 上业绩曲线空白（2026-10-18）----
   根因：hero-chart 改弹性高度后，trend-chart/svg 的 height:100% 百分比链在 iOS WKWebView
   解析失效（flex 子项高度作百分比基准在 iOS 不可靠）→ svg 高度算成 0 → 曲线消失。
   方案：chart 定位锚点 + trend-chart 绝对定位填满（不依赖百分比解析），两端通吃。 */
@media (min-width: 1024px) {
  .hero-card.has-trend .hero-chart { position: relative; }
  .hero-card.has-trend .hero-chart .trend-chart {
    position: absolute; left: 10px; right: 10px; top: 10px; bottom: 10px;
    height: auto !important;
  }
  .hero-card.has-trend .hero-chart .trend-svg { height: 100% !important; }
}

/* ---- 安装单明细表格（与辅材/窗帘订货卡片同风格：表头浅绿、细边、尺寸/尾款红字） ---- */
.it-table-wrap { padding: 10px 12px; overflow-x: auto; }
.it-table { width: 100%; border-collapse: collapse; font-size: 12px; }
/* 窗帘明细表：固定列宽布局 —— 多个厂家组的表格列竖向对齐（状态列等不随内容漂移） */
.it-table.fab { table-layout: fixed; min-width: 640px; }
.it-table th { background: #eef6f1; color: #0f6b4a; font-weight: 600; padding: 7px 6px; border: 1px solid #d8e5dd; text-align: center; white-space: nowrap; }
.it-table td { padding: 7px 6px; border: 1px solid #d8e5dd; text-align: center; vertical-align: middle; }
.it-table td.it-red { color: #d03a2b; font-weight: 600; white-space: nowrap; }
/* 安装单：单元格点一下直接改（用户 2026-11-16：不要弹窗）
   列宽固定（colgroup + fixed）：点格子变输入框时整张表和别的列都不许变宽。
   手机端也不放开（设 min-width 横向滑动），否则一编辑列宽就跳。 */
.it-table.install { table-layout: fixed; min-width: 900px; }
/* 成本卡片：同一厂家多张回单不标红、不提示（R67：登记时已问过覆盖/新增，事后红字只会打扰） */
/* 回单比对：「回单有 · 下单未选」这种只提示的项，灰字（不是不符） */
.bill-cmp-note { color: #6b7280; font-size: 12px; }   /* 灰字：只是提示，不是不符（R55） */

/* 工作台待办：固定两行、每行一件事（R63） */
.draft-bar-t .todo-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
/* 备注列「有内容就加宽」（用户 2026-11-16）：这几张表带 colgroup 时要 fixed 才认宽度 */
.it-table.rod.wide-note { table-layout: fixed; min-width: 760px; }
/* 2026-11-25 用户：手机端「删」字按钮顶出单元格 → 表格固定列宽 + 最后一列留 10%，按钮收紧 */
.it-table.rod { table-layout: fixed; width: 100%; }
.it-table.rod th:last-child, .it-table.rod td:last-child { padding-left: 2px; padding-right: 2px; }
.it-table.rod td:last-child .btn { min-width: 0; padding: 6px 6px; font-size: 12px; }
@media (max-width: 640px) {
  /* 手机端 9 列挤在 336px 会把表头挤重叠：保底 620px，横向滑动看，删列 10% 放得下 */
  .it-table.rod { min-width: 560px; }
  /* 有备注时 wide-note 的 760 特异性更高，这里一起收到 560 */
  .it-table.rod.wide-note { min-width: 560px; }
}
.it-table.cushion { table-layout: fixed; min-width: 620px; }
.it-table.install th { white-space: nowrap; padding: 6px 4px; font-size: 12px; }
.it-table.install td { padding: 4px 4px; }
.it-table.install td .inline-edit { height: 30px; padding: 4px 4px; font-size: 12px; box-sizing: border-box; }
.it-table td.editable { cursor: pointer; }
.it-table td.editable:hover { background: rgba(15, 118, 110, 0.07); }
.it-table td.editable::after { content: ''; }
.it-table td .inline-edit { width: 100%; min-width: 0; padding: 6px 5px; font-size: 12px; height: 32px; text-align: center; }
.it-table tbody tr { cursor: pointer; }
.it-table tbody tr:nth-child(even) { background: rgba(15, 118, 110, 0.03); }

/* 开单核对页：iOS 的日期输入默认居中，统一左对齐 */

/* 下单详情：返回列表悬浮固定（左下角，避开底部导航），滑到哪都能直接返回 */
.float-back {
  position: fixed; left: 14px; bottom: 78px; z-index: 60;
  background: var(--card); border: 1.5px solid var(--brand); border-radius: 22px;
  padding: 9px 16px; box-shadow: 0 4px 14px rgba(15, 111, 95, 0.22);
  color: var(--brand); font-weight: 600;
}

/* 开单页「单据详情」（点开单号）：**尺寸和下单详情一致**（占据导航右侧的整个内容区，
   跟 `.page` 一样留 24/28 边距，宽屏 1240 上限），但多了遮罩（内容区压暗、导航仍可见）、
   点遮罩**不关闭**（maskClose:false，防误触闪退），桌面与手机左下角都有「← 返回列表」。
   ★ 选择器带三层类名，才能压过上面那条「wide 整页表单」的规则（同类名数量的规则里靠后生效）。
   ★ 这颗按钮**不能用 z-index:60**：它和面板同层，z-index 一高就会盖在「后开的确认框/收款表单」上面，
     用户点它等于绕过二次确认直接关详情（Kimi P1）。改成 z-index:auto + 固定定位：
     只压在本层 mask/panel 之上（DOM 顺序靠后），又低于后面新加的层。 */
.modal-layer.detail-layer > .float-back { position: fixed; z-index: auto; display: inline-flex; align-items: center; }
@media (min-width: 768px) {
  .modal-layer.wide-layer.detail-layer {
    left: 260px;                      /* 对齐内容区：导航仍然可见（同下单详情） */
    align-items: stretch; justify-content: center;
    padding: 24px 28px;
    background: transparent;          /* 露出后面的开单列表，靠遮罩压暗 */
    overflow-y: auto;
  }
  .modal-layer.wide-layer.detail-layer .modal-mask { display: block; background: rgba(10, 30, 26, .38); }
  .modal-layer.wide-layer.detail-layer .modal.wide {
    max-width: 1240px; width: 100%; margin: 0 auto;
    flex: 1 1 auto; height: auto;
    max-height: calc(100vh - 48px);
    border: 1px solid rgba(15, 111, 95, .10);
    border-radius: 14px;
    padding: 18px 24px 20px;
    box-shadow: 0 18px 50px rgba(10, 30, 26, .18);
    animation: none;
  }
}
@media (min-width: 1280px) {
  .modal-layer.wide-layer.detail-layer { left: 280px; padding: 28px 32px; }
  .modal-layer.wide-layer.detail-layer .modal.wide { max-height: calc(100vh - 56px); }
}
/* 手机：底部弹层，下面留一条给「← 返回列表」——按钮浮在遮罩上，不压弹层内容 */
@media (max-width: 767px) {
  .modal-layer.detail-layer.has-dock .modal.wide { max-height: calc(100vh - 150px); }
  .modal-layer.detail-layer.has-dock > .float-back { bottom: calc(78px + env(safe-area-inset-bottom)); }
}

/* 拍照开单核对页：识别没勾到的字段（开向/辅材类型）红框醒目提醒，避免静默出错单 */
.input.need-fill {
  border-color: #d03a2b !important;
  box-shadow: 0 0 0 1px rgba(208, 58, 43, 0.18) inset;
}
.input.need-fill::placeholder { color: #d03a2b; opacity: 0.85; }

/* ---- 手机端明细表格防溢出（2026-10-18：成品尺寸红字压线、删按钮顶出屏幕）----
   fixed 布局按百分比锁列宽，「3.36×2.48」这类 nowrap 红字比列宽宽时会溢出单元格压线。
   手机改自然列宽（列宽随内容），表格整体在 .it-table-wrap 里横向滑动查看。 */
@media (max-width: 640px) {
  .it-table, .it-table.fab { table-layout: auto; }
  .it-table.fab { min-width: 620px; }
  .it-table-wrap { max-width: 100%; -webkit-overflow-scrolling: touch; }
  .it-table th, .it-table td { word-break: keep-all; }
  /* R41（2026-11-16）：备注列可能是长自由文本（开单的做法备注/现场尺寸/花边型号全并进这一列）。
     keep-all 会把整列变成不可断的一长串 → 表格撑到几千像素，状态和「删」要横滑很远。
     备注列单独放行断词 + 限宽。 */
  .it-table td.it-note {
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    min-width: 120px;
    max-width: 180px;
  }
}

/* ---------- 添加到主屏幕引导弹窗 ---------- */
.a2h-body { padding: 2px 2px 6px; }
.a2h-tip {
  font-size: 12px; color: var(--brand); background: var(--brand-soft);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; font-weight: 600;
}
.a2h-step { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.a2h-step:last-child { margin-bottom: 2px; }
.a2h-num {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.a2h-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.45; }
.a2h-sub { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 1px; }

/* 草稿恢复提示条（2026-11-10，第 8 项：断网/断电/杀进程不丢已填内容） */
.draft-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #fff8e6; border: 1px solid #f0d18a; color: #7a5600;
  border-radius: 10px; padding: 10px 12px; margin: 0 0 12px;
}
.draft-bar-t { font-size: 13px; font-weight: 600; line-height: 1.45; }
.draft-bar-a { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 560px) {
  /* R63：手机上文字与按钮分两排 —— 文字拿满宽度，两行文案才不会折成三行/被省略号截断 */
  .draft-bar { flex-direction: column; align-items: stretch; }
  .draft-bar-a { justify-content: flex-end; }
}

/* R97：下单页厂家名可点改（同名的会自动并组） */
.fg-name-edit { cursor: pointer; border-bottom: 1px dashed rgba(15,111,95,.45); }
.fg-name-edit:hover { color: #0f6f5f; }
/* 「?」口径提示：点一下 toast 出说明（手机上 title 不可达，2026-11-21 审查 P2） */
.qmark { display: inline-flex; width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--brand-line); color: var(--brand); font-size: 11px; font-weight: 800; align-items: center; justify-content: center; margin-left: 6px; vertical-align: 1px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.qmark:active { background: var(--brand-soft); }
/* 待办条里的金额（M11：待收款金额只在待办条出现一次） */
.tc-amt { font-size: 12px; font-weight: 700; color: var(--danger); margin-left: 2px; }
/* M02：「今天还能顺手做的事」两行入口 */
.today-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; cursor: pointer; }
.today-row + .today-row { border-top: 1px dashed var(--line); }
.today-ico { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); flex: 0 0 auto; }
.today-main { flex: 1; min-width: 0; }
.today-t { font-size: 14px; font-weight: 600; color: var(--text); }
.today-s { font-size: 11.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-n { font-size: 13px; font-weight: 700; color: var(--brand); white-space: nowrap; }
/* M17：侧栏「讲活」用的小排版（单量 / 引导链接） */
.side-big { font-size: 24px; font-weight: 700; margin-top: 6px; color: var(--text); }
.side-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.side-link { font-size: 12px; font-weight: 600; color: var(--brand); margin-top: 10px; cursor: pointer; }
/* 右栏三张卡（R106）：期间量 / 完成情况 / 回款 —— 每张卡各自一个分母，钱和进度不混 */
.side-figure { display: flex; align-items: baseline; gap: 10px; }
.side-figure .side-big { margin-top: 6px; }
.side-money { margin-left: auto; font-size: 18px; font-weight: 700; color: var(--text); }
/* 右栏三张卡的进度条（类名避开已有的 .side-bar —— 那个是下单页工序进度用的 6px 条） */
.side-prog { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: #eef4f2; margin: 12px 0 8px; }
.side-prog i { display: block; height: 100%; background: var(--brand); }
.side-prog u { display: block; height: 100%; background: #f3c58e; }   /* 未收：淡橙，与全局「欠款=橙」一致 */
.side-kv { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; color: #4b5a56; }
.side-kv b { font-size: 13px; color: var(--text); }
.side-kv .side-link { margin-top: 0; }
.side-sub.is-inline { margin: 0 0 0 4px; }
.side-sub.is-warn { color: #b45309; margin-top: 6px; }
.side-link.is-ok, b.is-ok { color: var(--brand); }
b.is-warn { color: #b45309; }
/* 完成情况的环 + 图例（环 120px，右栏宽度够；图例三行：已交付 / 进行中 / 已取消不计） */
.side-donut { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.side-donut svg { width: 104px; height: 104px; flex: 0 0 auto; }
.side-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: #4b5a56; }
.side-legend-r { display: flex; align-items: center; gap: 6px; }
.side-legend-r.side-link { margin-top: 0; }
.side-legend-r i { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.side-legend-r b { margin-left: auto; font-size: 12.5px; color: var(--text); }
.side-legend-r.muted { color: #9aa8a4; cursor: default; }
.side-legend-r.muted b { color: #9aa8a4; }
.side-steps { margin-top: 8px; }
.side-step { display: flex; align-items: baseline; gap: 8px; font-size: 13px; padding: 4px 0; }
.side-step .n { margin-left: auto; font-weight: 700; }
.side-step .lbl { color: var(--text-2); }
.side-bar { height: 6px; border-radius: 99px; background: rgba(15,111,95,.10); overflow: hidden; margin: 2px 0 4px; }
.side-bar i { display: block; height: 100%; border-radius: 99px; }
/* M61/M63：工作台三类卡点待办（货齐待派 / 已派待装 / 已交付待收） */
.tb-wrap { display: flex; flex-direction: column; gap: 9px; }
.tb-card { background: #fff; border: 1px solid rgba(15,111,95,.12); border-radius: 12px; padding: 11px 12px; }
.tb-head { display: flex; align-items: center; gap: 8px; }
.tb-ico { width: 26px; height: 26px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; background: rgba(15,111,95,.10); color: var(--brand); }
.tb-ico.warn { background: rgba(217,119,6,.14); color: #b45309; }
.tb-ico.red { background: rgba(220,38,38,.12); color: #b91c1c; }
.tb-title { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; color: var(--text); }
.tb-count { font-size: 11px; font-weight: 700; border-radius: 99px; padding: 2px 8px; white-space: nowrap; background: rgba(15,111,95,.10); color: var(--brand); }
.tb-count.warn { background: rgba(217,119,6,.14); color: #b45309; }
.tb-count.red { background: rgba(220,38,38,.10); color: #b91c1c; }
.tb-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.tb-btn { margin-top: 9px; height: 32px; width: 100%; border-radius: 9px; border: 1px dashed rgba(15,111,95,.35); background: rgba(15,111,95,.04); color: var(--brand); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 4px; }
.tb-btn.warn { border-color: rgba(217,119,6,.45); background: rgba(217,119,6,.06); color: #b45309; }
.tb-btn.red { border-color: rgba(220,38,38,.4); background: rgba(220,38,38,.05); color: #b91c1c; }
.tb-list { max-height: min(46vh, 420px); overflow: auto; margin-top: 6px; border: 1px solid rgba(15,111,95,.12); border-radius: 10px; }
.tb-row { display: block; padding: 10px 12px; cursor: pointer; }
.tb-row + .tb-row { border-top: 1px solid rgba(15,111,95,.10); }
.tb-row-off { opacity: .45; }
.tb-top { display: flex; align-items: flex-start; gap: 10px; }
.tb-left { flex: 1; min-width: 0; }
.tb-left > div + div { margin-top: 3px; }
.tb-t1 { font-size: 14px; font-weight: 600; white-space: nowrap; color: var(--text); }
.tb-t2 { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-right { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.tb-date { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.tb-badges { display: flex; gap: 4px; margin-top: 7px; flex-wrap: wrap; }
.tb-badges .badge { font-size: 11px; padding: 1px 7px; margin: 0; }
.tb-hint { font-size: 11.5px; color: var(--muted); margin: 6px 0 0; }
.tb-sec { font-size: 12px; color: var(--text-2); margin: 12px 0 6px; }
.tb-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.tb-check { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; margin-top: 10px; }
/* R103：宽屏（≥768）—— 按钮不拉满、待办卡左右分栏、开单按钮不再巨块 */
@media (min-width: 768px) {
  .order-cta { justify-content: flex-start; flex-wrap: wrap; }
  .order-cta-btn { flex: 1 1 0; padding: 11px 8px; }
  /* ≥1024 主列够宽 → 按钮定宽，不再拉满 */
  .order-cta-icon { font-size: 24px; }
  .order-cta-label { font-size: 14px; }

  .today-row { max-width: 560px; }
}
/* R103：定高输入框（M21）—— 展示态与编辑态同高 */
.input, select.input { height: 36px; padding: 0 12px; box-sizing: border-box; }
textarea.input { height: auto; padding: 10px 12px; }
.it-table .input, .bill-table .input { height: 32px; padding: 0 6px; box-sizing: border-box; }
/* R103：「选」→ 小三角（M23）：窄一点、只放一个 ▾ */
.btn.caret { padding: 0 9px; min-width: 32px; }
.badge.off { text-decoration: line-through; opacity: .8; }
/* R103：待办卡两列（仅 ≥1024；768 主列太窄，两列会把标题挤成竖排） */
@media (min-width: 1024px) {
  .tb-card { display: grid; grid-template-columns: 1fr 220px; column-gap: 14px; align-items: center; }
  .tb-head { grid-column: 1; }
  .tb-sub { grid-column: 1; margin-top: 2px; }
  .tb-btn { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
}
/* R103：768~1023 主列窄 —— 快捷入口字号/图标收一号，标签不挤成两行 */
@media (min-width: 768px) and (max-width: 1023px) {
  .quick { font-size: 11px; padding: 12px 4px; }
  .quick .qi { width: 38px; height: 38px; font-size: 20px; margin-bottom: 6px; }
}
/* R103：≥1024 开单按钮定宽（左对齐，不拉满整行） */
@media (min-width: 1024px) {
  .order-cta-btn { flex: 0 0 240px; max-width: 260px; }
}
/* R103 补：先定的局部 padding 不能被后面的通高规则顶掉（审查 P2） */
.bill-cell .input { padding: 0 8px; }
.bill-row .input { padding: 0 10px; }
/* 已取消：灰底 + 删除线之外，再加一点淡红，弱光下也分得清（审查 P2） */
.badge.gray.off { background: rgba(220, 38, 38, .06); color: #7a5a5a; }
/* 今日待办和提醒（2026-11-21 用户定：待办 + 提醒合成一张卡）
   手机：默认收起，点标题展开；电脑/Pad 横屏：进右栏、常驻展开 */
.todo-card { background: #fff; border: 1px solid rgba(15,111,95,.12); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.todo-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px; cursor: pointer; }
.todo-title { font-size: 14px; font-weight: 700; color: var(--text); flex: 0 0 auto; }
/* 展开后「今日待办」和「提醒事项」是同级标题，字号/字重完全一致 */
.todo-sec { font-size: 14px; font-weight: 700; color: var(--text); padding: 10px 12px 2px; }
.todo-card.open .t-collapsed { display: none; }
.todo-card.collapsed .t-open { display: none; }
.todo-tip { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.todo-dot-new { width: 7px; height: 7px; border-radius: 50%; background: var(--danger, #dc2626); flex: 0 0 auto; }
.todo-chev { color: var(--brand); font-size: 12px; transition: transform .15s ease; }
.todo-card.open .todo-chev { transform: rotate(180deg); }
.todo-sum { display: flex; flex-wrap: nowrap; gap: 6px; padding: 0 12px 11px; overflow: hidden; }
.todo-card.open .todo-sum { display: none; }
.todo-body { display: none; }
.todo-card.open .todo-body { display: block; }
.trow { display: flex; align-items: center; gap: 9px; padding: 10px 12px; }
.trow + .trow { border-top: 1px dashed rgba(15,111,95,.14); }
.trow-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: #9aa8a4; }
.trow-dot.warn { background: #d97706; }
.trow-dot.ok { background: var(--brand); }
.trow-dot.red { background: #dc2626; }
.trow-main { flex: 1; min-width: 0; }
.trow-t { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 副标题单行：金额+按钮一挤就换行，行高会参差 */
.trow-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-n { font-size: 12px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.trow-n.red { color: #b91c1c; }
.trow-go { color: var(--muted); font-size: 13px; }

/* 3 字按钮（去下单/去登记）与 4 字按钮等宽，右列左边缘才对齐 */
.trow-btn { height: 26px; min-width: 64px; padding: 0 9px; border-radius: 8px; font-size: 11px; font-weight: 700; text-align: center; box-sizing: border-box; border: 1px solid rgba(217,119,6,.45); background: rgba(217,119,6,.06); color: #b45309; white-space: nowrap; }
.trow-btn.ok { border-color: rgba(15,111,95,.35); background: rgba(15,111,95,.05); color: var(--brand); }
.trow-btn.red { border-color: rgba(220,38,38,.4); background: rgba(220,38,38,.05); color: #b91c1c; }
.trow-btn.gray { border-color: rgba(15,111,95,.22); background: #f6faf9; color: #4b5a56; }
/* 提醒行里的次要动作（如「不用」）：不要边框，别和主按钮抢视线；触控区别太窄（390 宽易误触） */
.trow-btn.plain { border-color: transparent; background: transparent; color: var(--muted); min-width: 0; padding: 0 8px; font-weight: 500; }
.tpill { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: #f1f5f4; color: #4b5a56; white-space: nowrap; flex: 0 0 auto; }
.tpill.more { background: rgba(15,111,95,.08); color: var(--brand); font-weight: 700; }
.tpill.warn { background: rgba(217,119,6,.14); color: #b45309; }
.tpill.red { background: rgba(220,38,38,.10); color: #b91c1c; }

/* 手型只给真能点的行：.trow-click 处处可点，.trow-narrow 只在窄屏 */
.todo-body .trow-click { cursor: pointer; }
@media (max-width: 767px) {
  .todo-body .trow-narrow { cursor: pointer; }
}

/* 待办卡：手机在正文、电脑在右栏（同一份组件，两处只显示一处） */
.todo-side { display: none; }
@media (min-width: 1024px) {
  .dashboard-main > .todo-card { display: none; }
  .todo-side { display: block; }
}
/* M31–M35 报表：横条排行 / 环状成本 / 环形毛利 / 2 点不画图（2026-11-21） */
.rank-bar { margin-top: 6px; height: 8px; border-radius: 6px; background: #eef4f2; overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 6px; background: var(--brand); }
.donut-wrap { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.donut-box { position: relative; width: 118px; height: 118px; flex: 0 0 auto; }
.donut-svg { width: 118px; height: 118px; display: block; }
.donut-ctr { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-ctr b { font-size: 14px; color: var(--text); }
.donut-ctr span { font-size: 11px; color: var(--muted); margin-top: 2px; }
.donut-legend { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--text-2); min-width: 0; }
.donut-legend .it { display: flex; align-items: center; gap: 6px; }
.donut-legend .it i { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.donut-legend .it b { margin-left: auto; color: var(--text); }
.gauge-box { position: relative; width: 84px; height: 84px; flex: 0 0 auto; }
.gauge-svg { width: 84px; height: 84px; display: block; }
.hero-kpi-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.two-point { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 4px; font-size: 13px; color: var(--text-2); }
.two-point .tp-l { color: var(--text); font-weight: 600; }
.two-point .tp-arrow { color: var(--muted); }
.two-point .tp-delta { color: #15803d; font-weight: 700; }
/* M31：分段控件统一 28px */
.tabs button { height: 32px; padding: 0 14px; font-size: 13px; }
.hero-gauge { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.hg-txt { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--text-2); }
.hg-txt b { font-size: 16px; color: var(--text); }
.hg-txt .hg-sub { color: var(--muted); font-size: 11.5px; }
/* 空数据折叠卡（M67，2026-11-21）：没数据折成一行，点开看说明 */
.efold { padding: 0; }
.efold-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px; cursor: pointer; }
.efold-badge { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--muted); background: #f1f5f4; border-radius: 99px; padding: 2px 9px; white-space: nowrap; }
.efold-badge.ok { color: #15803d; background: rgba(21,128,61,.10); }
.efold-chev { color: var(--muted); font-size: 11px; transition: transform .15s ease; }
.efold.open .efold-chev { transform: rotate(90deg); }
.efold-body { display: none; }
.efold.open .efold-body { display: block; }

/* M39（2026-11-21）：chip / 分段 / 大分段只有一个高度 —— 28 / 32 */
.tabs button { height: 32px; padding: 0 12px; font-size: 13px; }
.tabs.sm button { height: 28px; padding: 0 10px; font-size: 13px; }
.seg-tab { height: 32px; padding: 0 6px; font-size: 14px; display: flex; align-items: center; justify-content: center; }

/* M39 收尾：chip 统一 28px 高（后置覆盖，优先级足够） */
.chip { height: 28px; padding: 0 11px; display: inline-flex; align-items: center; font-size: 12px; }
.toolbar-sub .chip { padding: 0 11px; }
/* M36 收尾：全站字号只这些档（10 档）—— 11 / 11.5 / 12 / 13 / 14 / 16 / 20 / 24 / 28 / 32 */

/* 安装费结账（迁移 84） */
.settle-sum { display: flex; gap: 8px; margin: 10px 0 6px; }
.settle-sum .ss-item { flex: 1; background: #f6faf9; border: 1px solid rgba(15,111,95,.12); border-radius: 10px; padding: 8px 10px; font-size: 11.5px; color: var(--muted); display: flex; align-items: baseline; gap: 6px; }
.settle-sum .ss-item b { font-size: 14px; color: var(--text); }
.settle-sum .ss-item b.warn { color: #b45309; }
.settle-sum .ss-item b.ok { color: #15803d; }
.settle-list { max-height: min(44vh, 400px); overflow: auto; border: 1px solid rgba(15,111,95,.12); border-radius: 10px; }
.settle-row { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; }
.settle-row + .settle-row { border-top: 1px dashed rgba(15,111,95,.10); }
.settle-row.on { background: rgba(15,111,95,.05); }
.settle-row.settled { opacity: .72; }
.settle-row .sr-main { flex: 1; min-width: 0; }
.settle-row .sr-t { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settle-row .sr-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.settle-row .sr-right { text-align: right; }
.settle-row .sr-fee { font-size: 13px; font-weight: 700; color: var(--text); }
.btn.armed { background: #b45309; }
/* 2026-11-22（用户）：货齐 / 已装完 = 深绿填充，和浅绿「已指派」拉开 */
.prog-badge.ok { background: #047857; color: #fff; font-weight: 700; }

/* ---------------- 辅材对账单（R119，2026-11-23） ---------------- */
.rodstmt { display: flex; flex-direction: column; gap: 10px; }
.rodstmt-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rodstmt-toolbar .chips { margin: 0; }
.rodstmt-custom { display: flex; align-items: center; gap: 6px; }
.rodstmt-custom .input { width: auto; padding: 6px 8px; font-size: 13px; }
.rodstmt-dash { color: var(--muted); }
.rodstmt-range { font-size: 12.5px; color: var(--muted); }
.rodstmt-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-left: auto; }
.rodstmt-sum { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding: 2px 2px 6px; }
.rodstmt-sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.rodstmt-unsettled { color: #b45309; font-weight: 600; }
.rodstmt-tbl { width: 100%; }
.rodstmt-tbl td:nth-child(1), .rodstmt-tbl th:nth-child(1) { padding-right: 4px; }
.rodstmt-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 2px 2px; border-top: 1px solid var(--line); margin-top: 8px; }
.rodstmt-sel { font-size: 13px; color: var(--muted); margin-right: auto; }
.rodstmt .loading, .rodstmt .empty { padding: 26px; text-align: center; color: var(--muted); }
/* 对账单表格（app.css 里没有 .tbl，这里单独给） */
.rodstmt-tbl { width: 100%; border-collapse: collapse; }
.rodstmt-tbl th, .rodstmt-tbl td { padding: 10px 8px; font-size: 13.5px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.rodstmt-tbl th { font-size: 12px; color: var(--muted); font-weight: 600; background: #f7faf9; }
.rodstmt-tbl td:nth-child(4), .rodstmt-tbl td:nth-child(5), .rodstmt-tbl td:nth-child(6),
.rodstmt-tbl th:nth-child(4), .rodstmt-tbl th:nth-child(5), .rodstmt-tbl th:nth-child(6) { text-align: right; font-variant-numeric: tabular-nums; }
.rodstmt-tbl tbody tr:hover { background: #f9fbfa; }
.rodstmt-sum { background: #f7faf9; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.rodstmt-allsettled { color: var(--ok); font-weight: 600; }
/* ---------------- 多店切换器（2026-11-23） ---------------- */
.store-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 46vw; padding: 5px 10px; }
.store-chip .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-chip .ar { flex: 0 0 auto; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .65; }
.pick-item .ck { width: 16px; flex: 0 0 16px; color: var(--brand); font-weight: 700; }
.pick-item .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: auto; }
/* ---------------- 我的页：电脑端（≥1280）布局（2026-11-23） ----------------
   问题（用户截图）：① hero 上下堆叠占 409px，指标/按钮各拉满一行；② 三列卡片被拉成等高，
   「经营工具」底部空两行；③ 第四张「系统与安全」孤零零占第二行第一列，右边 2/3 全空。
   改法（只动版式，不动菜单项与文案）：
   ① hero 压成一行工具条（积分 | 三个指标 | 两个按钮）+ 邀请码整行；
   ② 菜单项按组匀成 4/4/4，三列等高（底边一条直线，不再长长短短）；
   ③ 「系统与安全」横跨整行、内部三列，把右下角用起来。
   手机 / 平板（<1280）保持原样。 */
@media (min-width: 1280px) {
  .hero-card.me-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "head head head"
      "value pills actions"
      "invite invite invite";
    column-gap: 28px;
    align-items: center;
    padding: 14px 20px 16px;
    min-height: 0;
  }
  .me-hero .me-head { grid-area: head; margin-bottom: 8px; padding-bottom: 10px; }
  .me-hero .me-avatar { width: 42px; height: 42px; font-size: 17px; }
  .me-hero .hero-value { grid-area: value; height: auto; line-height: 1; font-size: 34px; margin: 0; }
  /* 「免费版 · 每单扣 10 分」与右侧两丸重复，电脑端隐藏（手机仍显示） */
  .me-hero .hero-trend { display: none; }
  .me-hero .hero-pills {
    grid-area: pills; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  }
  .me-hero .metric-pill { padding: 7px 10px; }
  .me-hero .metric-pill .mp-label { font-size: 10.5px; margin-bottom: 2px; }
  .me-hero .metric-pill .mp-value { font-size: 14px; }
  .me-hero .me-actions { grid-area: actions; margin: 0; padding: 0; justify-content: flex-end; gap: 8px; }
  .me-hero .me-actions .btn { flex: 0 0 auto; min-width: 104px; }
  .me-hero .me-invite { grid-area: invite; margin: 12px 0 0; }

  /* 三列等高（stretch）：菜单项已按组匀成 4/4/4，等高后底边是一条直线，卡内几乎不留白 */
  .menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
  /* 员工视角项少（1~3 项/组），拉高等只会留一大块白 → 自然高度 + 两列（三列会空出一整列） */
  .menu-grid.is-staff { align-items: start; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-grid .menu-group { margin-bottom: 0; }
  /* 每行同高：没有副标题的行（如「最近删除」）不会被压矮，卡片内容才等高、底边齐 */
  .menu-grid .menu-group .row { min-height: 64px; }
  .menu-grid .menu-group .r-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .menu-grid .menu-group:last-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .menu-grid .menu-group:last-child .menu-group-title { grid-column: 1 / -1; }
  .menu-grid .menu-group:last-child .row { border-bottom: 0; border-top: 1px solid var(--line); }
  .menu-grid .menu-group:last-child .row:nth-child(-n+3) { border-top: 0; }
}

/* 分组标题：去掉灰底，改成细分隔 + 小号灰字（手机/电脑都更轻） */
.menu-grid .menu-group-title {
  background: transparent;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: .3px;
  padding: 14px 16px 9px;
}

/* 桌面行悬停：给「可点」反馈（触屏不受影响） */
@media (hover: hover) {
  .menu-group .row { transition: background .12s ease; }
  .menu-group .row:hover { background: #f7faf9; }
  .menu-group .row .chev { transition: transform .12s ease, color .12s ease; }
  .menu-group .row:hover .chev { transform: translateX(2px); color: var(--brand); }
}

/* 触摸按压反馈：.menu-group .row 的 transparent 背景会盖掉全局 .row:active，这里补一条 */
.menu-group .row:active { background: rgba(15, 111, 95, 0.06);
}
