/* 加工看板样式：默认紧凑7列，全部区域用小标题分组，内容多时在内容区滚动。
   颜色全部走主题语义变量，三皮肤共用本文件。 */
* { box-sizing: border-box; }
.login-shell { width:100%; min-height:100vh; display:grid; place-items:center; padding:24px; background:#edf7fb; }
.login-card { display:flex; flex-direction:column; gap:12px; width:min(440px,100%); padding:32px; border-radius:16px; background:white; color:#153c5a; box-shadow:0 8px 36px #153c5a15; }
.login-card h1 { margin:0; font-size:24px; }
.login-note { margin:0 0 12px; color:#647c8b; }
.login-card input { width:100%; min-height:44px; border:1px solid #cadbe4; border-radius:8px; padding:10px; font-size:16px; }
.login-card button { min-height:44px; border:0; border-radius:8px; background:#079b91; color:white; font-size:16px; }
.login-card .login-error { color:#aa2938; margin:0; }
html, body { margin: 0; height: 100%; }
body {
  font: 13px/1.45 "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg); color: var(--text);
}
.app { display: flex; height: 100vh; overflow: hidden; }

/* 左窄导航 */
.nav { width: 152px; flex: 0 0 152px; background: var(--nav-bg); color: var(--nav-fg);
  display: flex; flex-direction: column; }
.nav .brand { padding: 10px 12px; font-size: 15px; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.14); }
.nav .brand small { display: block; font-size: 10.5px; font-weight: 400; opacity: .8; }
.nav button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 7px;
  padding: 8px 12px; cursor: pointer; font-size: 13px; color: var(--nav-fg); }
.nav button:hover { background: rgba(255,255,255,.08); }
.nav button.active { background: var(--nav-active); color: #fff; font-weight: 700; }
.nav button.disabled { opacity: .45; cursor: not-allowed; }
.nav .spacer { flex: 1; }
.nav .who { padding: 8px 12px; font-size: 11px; opacity: .85; border-top: 1px solid rgba(255,255,255,.14); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* 顶栏 */
.topbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: var(--panel); border-bottom: 1px solid rgba(0,0,0,.08); flex: 0 0 auto; }
.topbar h1 { font-size: 15px; margin: 0; font-weight: 700; }
.topbar .grow { flex: 1; }
.topbar select, .topbar input { font: inherit; padding: 4px 6px; border-radius: 5px;
  border: 1px solid rgba(0,0,0,.2); background: var(--panel); color: var(--text); }
.topbar input { width: 150px; }
.topbar button { font: inherit; padding: 4px 10px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--btn-secondary-border); background: var(--btn-secondary);
  color: var(--btn-secondary-fg); }
.topbar button.primary { background: var(--btn-primary); color: #fff; border-color: transparent; }
.modenote { font-size: 10.5px; color: var(--badge-warn); font-weight: 700; }

/* 区域栏 */
.sectbar { display: flex; align-items: center; gap: 6px; padding: 5px 10px; flex: 0 0 auto;
  background: var(--panel); border-bottom: 1px solid rgba(0,0,0,.06); flex-wrap: wrap; }
.sectbar button { font: inherit; padding: 3px 10px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(0,0,0,.18); background: transparent; color: var(--text); }
.sectbar button.active { background: var(--accent); border-color: var(--accent); color: #fff;
  font-weight: 700; }
.legend { margin-left: auto; font-size: 11px; color: var(--text-muted); display: flex; gap: 10px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 3px; }

/* 内容区 */
.content { flex: 1; overflow: auto; padding: 4px 8px 6px; }
.section-head { display: flex; align-items: baseline; gap: 8px; margin: 1px 0 3px; }
.section-head h2 { font-size: 12.5px; margin: 0; font-weight: 700;
  border-left: 4px solid var(--accent); padding-left: 6px; }
.section-head .cnt { font-size: 11.5px; color: var(--text-muted); }
.section-head .zoom { margin-left: auto; font-size: 11.5px; color: var(--accent);
  background: none; border: none; cursor: pointer; padding: 2px 4px; }

/* 全部区域的分区条仅占一行，业务按钮沿用原组件。 */
.region-group + .region-group { margin-top: 7px; }
.region-head { align-items: center; gap: 10px; min-height: 28px; margin: 0 0 4px;
  padding: 3px 8px; border: 1px solid var(--accent); border-left-width: 6px;
  border-radius: 4px; background: var(--nav-bg); color: var(--nav-fg); }
.region-head h2 { min-width: 0; max-width: 65%; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; font-size: 15px; font-weight: 800;
  border-left: 0; padding-left: 0; color: var(--nav-fg); }
.region-head .cnt { flex: 0 0 auto; white-space: nowrap; font-size: 12px;
  font-weight: 600; color: var(--nav-fg); }
.region-head::after { content: ''; flex: 1; min-width: 8px;
  border-top: 1px solid var(--nav-fg); opacity: .35; }
.region-head .zoom { color: var(--nav-fg); }
.region-group .region-grid { margin-bottom: 0; }
.card .completion-time { font-size: 9px; margin-left: auto; flex: 0 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.st-done .completion-time, .card.st-done .row2 .spec,
.card.st-done .qty .lbl, .card.st-done .qty .unit { color: var(--card-text); }
.card.st-done .ops .b-void { background: var(--btn-secondary); color: var(--btn-secondary-fg);
  border-color: var(--btn-secondary-border); }

/* 紧凑网格：默认7列。minmax(0,1fr) 防止内容 min-content 撑宽列。 */
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin-bottom: 6px; }
@media (max-width: 1250px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1050px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 860px)  { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 卡片（紧凑：1366×650 五行为准，单卡约 96-98px） */
.card { border-radius: 7px; padding: 4px 6px 5px; border: 1.5px solid transparent;
  display: grid; grid-template-rows: 16px 11px minmax(22px, 1fr) 24px;
  gap: 1px; height: 88px; min-height: 88px; min-width: 0; }
.card.st-open { background: var(--card-open-bg); border-color: var(--card-open-border); }
.card.st-partial { background: var(--card-partial-bg); border-color: var(--card-partial-border); }
.card.st-done { background: var(--card-done-bg); border-color: var(--card-done-border); }
.card .row1 { grid-row: 1; display: flex; align-items: center; gap: 4px; min-width: 0; line-height: 1.2; }
.card .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.st-open .dot { background: var(--badge-open); }
.st-partial .dot { background: var(--badge-partial); }
.st-done .dot { background: var(--badge-done); }
.card .name { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; color: var(--card-text); }
.card .badge { margin-left: auto; font-size: 9.5px; font-weight: 700;
  padding: 0 5px; border-radius: 8px; white-space: nowrap; }
.st-open .badge { background: var(--badge-open); color: var(--badge-open-fg); }
.st-partial .badge { background: var(--badge-partial); color: var(--badge-partial-fg); }
.st-done .badge { background: var(--badge-done); color: var(--badge-done-fg); }
/* 第二行小字：规格 / 累计 / 区域角标（不换行，防竖排） */
.card .row2 { grid-row: 2; display: flex; align-items: baseline; gap: 6px; font-size: 9.5px;
  color: var(--card-muted); line-height: 11px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card .row2 .spec { font-size: 9.5px; color: var(--card-muted); flex: 0 1 auto;
  overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card .row2 .acc { font-size: 9.5px; color: var(--card-muted); flex: 0 0 auto; margin-top: 0; }
.card .row2 .sectag { margin-left: auto; font-size: 9px; font-weight: 700;
  color: var(--card-muted); white-space: nowrap; flex: 0 1 auto;
  overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card .qty { grid-row: 3; display: flex; align-items: baseline; align-self: end; gap: 3px; min-width: 0; }
.card .qty .lbl { font-size: 10px; color: var(--card-muted); }
.card .qty .num { font-size: 22px; font-weight: 800; color: var(--number); line-height: 1.0; }
.card .qty .unit { font-size: 10px; color: var(--card-muted); font-weight: 700; }
.card .ops { grid-row: 4; display: flex; gap: 4px; min-width: 0; height: 24px; }
.card .ops button { flex: 1; font: inherit; font-size: 11px; font-weight: 700; padding: 0 3px; height: 24px; line-height: 1;
  border-radius: 5px; cursor: pointer; border: 1px solid transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card .ops .b-done { background: var(--btn-primary); color: #fff; }
.card .ops .b-part { background: var(--btn-secondary); color: var(--btn-secondary-fg);
  border-color: var(--btn-secondary-border); }
.card .ops button:disabled { opacity: .45; cursor: not-allowed; }
.card .ops button:focus-visible, .topbar button:focus-visible, .sectbar button:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 1px; }
/* 全站键盘焦点可见（含导航、对话框、皮肤管理按钮）：Tab 到任一可聚焦控件都有可见轮廓 */
.nav button:focus-visible, .dlg button:focus-visible, .dlg input:focus-visible,
.skin-card button:focus-visible, .state button:focus-visible, .topbar select:focus-visible,
.topbar input:focus-visible, .sectbar input:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 1px; }
.card.busy { opacity: .6; pointer-events: none; }

/* 已完成收底：展开后为整齐的绿色卡片，不是难读小字（R2-03）
   A复验-11 整改(2026-10-09)：横条文字原先复用徽章背景变量 --badge-done，
   在 b_solid 下是 rgba(0,0,0,.30) 透明黑、落在浅绿 --completed-bar 上仅 2.08:1，
   a_light 3.00:1、c_dark 4.26:1，三皮肤均未达 WCAG AA 正文 4.5:1。
   现改用专用文字变量 --done-bar-text（各皮肤实算：5.84 / 5.60 / 8.44），
   绿色语义仍由 .st-done .dot 与 .badge 承担，不因可读性而丢掉状态色。
   兜底回退 --card-text 再回退 --text，保证未定义该变量的旧主题也不至于不可读。 */
.done-bar { background: var(--completed-bar); border-radius: 7px; padding: 7px 10px;
  font-size: 12.5px; font-weight: 700;
  color: var(--done-bar-text, var(--card-text, var(--text))); cursor: pointer;
  display: flex; align-items: center; gap: 6px; }
.done-bar:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.done-list { list-style: none; margin: 7px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.done-list li { background: var(--card-done-bg); border: 1px solid var(--card-done-border);
  border-radius: 7px; padding: 6px 8px; font-size: 12px; line-height: 1.4;
  color: var(--card-text, var(--text)); }
.done-list li b { display: block; font-size: 12.5px; color: var(--card-text, var(--text)); }
/* A复验-11：完成数量文字用 card-text 保证三主题可读；保留绿色语义由 badge 承担 */
.done-list li .dn { font-weight: 700; color: var(--card-text, var(--text)); font-size: 13px; }
.done-list li .dt { color: var(--card-muted); font-size: 10.5px; }

/* 空态/错误态 */
.state { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }
.state.error { color: var(--badge-warn); }
.state.warn { color: var(--text); background: var(--completed-bar); border-radius: 7px;
  padding: 10px 12px; text-align: left; font-size: 12.5px; }
.state.warn .btns { margin-top: 8px; }
.state button { font: inherit; margin-top: 8px; padding: 4px 14px; border-radius: 5px;
  cursor: pointer; border: 1px solid var(--btn-secondary-border);
  background: var(--btn-secondary); color: var(--btn-secondary-fg); }
.state .btns button { margin-top: 0; margin-right: 6px; }

/* 顶栏日期与卡内新增元素 */
.datenote { font-size: 11px; color: var(--text-muted); margin-left: 6px; }
.card .pin { font-size: 9.5px; font-weight: 700; padding: 0 4px; border-radius: 7px;
  background: var(--badge-partial); color: var(--badge-partial-fg); }
.card .acc { font-size: 10.5px; color: var(--card-muted); margin-top: 1px; }
.card .ops .b-void { flex: 0 0 auto; padding: 0 7px; font-size: 11px;
  background: transparent; color: var(--card-text, var(--text));
  border: 1px solid var(--btn-secondary-border); }

/* 皮肤管理页 */
.skin-wrap { padding: 12px; overflow: auto; }
.skin-wrap h2 { font-size: 15px; margin: 0 0 4px; }
.skin-note { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.skin-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1000px) { .skin-cards { grid-template-columns: 1fr; } }
.skin-card { border-radius: 9px; overflow: hidden; border: 2px solid rgba(0,0,0,.12);
  background: var(--panel); display: flex; flex-direction: column; }
.skin-card.current { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.skin-card .pv { padding: 8px; }
.skin-card .pv .mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.skin-card .pv .m { border-radius: 4px; padding: 4px 5px; font-size: 9.5px; }
.skin-card .meta { padding: 8px 10px 10px; }
.skin-card .meta b { font-size: 13.5px; }
.skin-card .meta p { font-size: 11.5px; color: var(--text-muted); margin: 3px 0 8px; }
.skin-card .meta .cur { font-size: 11px; font-weight: 700; color: var(--accent); }
.skin-card .meta button { font: inherit; font-weight: 700; padding: 5px 14px; border-radius: 6px;
  cursor: pointer; border: none; background: var(--btn-primary); color: #fff; }
.skin-card .meta button:disabled { opacity: .5; cursor: not-allowed; }
.skin-save-msg { margin-top: 10px; font-size: 12.5px; font-weight: 700; }
.skin-save-msg.ok { color: var(--msg-ok); }
.skin-save-msg.err { color: var(--msg-err); }

/* 对话框 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex;
  align-items: center; justify-content: center; z-index: 50; }
.dlg { background: var(--panel); color: var(--text); border-radius: 9px; padding: 14px 16px;
  width: 320px; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.dlg h3 { margin: 0 0 6px; font-size: 14.5px; }
.dlg p { margin: 4px 0; font-size: 12.5px; color: var(--text-muted); }
.dlg input { width: 100%; font: inherit; font-size: 15px; padding: 6px 8px; margin: 6px 0;
  border-radius: 6px; border: 1px solid rgba(0,0,0,.25); background: var(--panel);
  color: var(--text); }
.dlg .btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.dlg .btns button { font: inherit; font-weight: 700; padding: 5px 16px; border-radius: 6px;
  cursor: pointer; border: 1px solid var(--btn-secondary-border);
  background: var(--btn-secondary); color: var(--btn-secondary-fg); }
.dlg .btns button.ok { background: var(--btn-primary); color: #fff; border-color: transparent; }
.dlg .err { color: var(--badge-warn); font-size: 12px; min-height: 16px; }
.dlg { max-height:calc(100vh - 32px);max-width:calc(100vw - 32px);overflow:auto; }
.dlg-header { position:sticky;top:-14px;z-index:4;display:flex;align-items:center;gap:10px;margin:-14px -16px 10px;padding:10px 16px;background:var(--panel);border-bottom:1px solid var(--btn-secondary-border); }
.dlg .dlg-header h3 { flex:1;min-width:0;margin:0;overflow-wrap:anywhere; }
.dlg-close { flex:0 0 32px;width:32px;height:32px;min-height:32px;padding:0;font-size:24px;line-height:1;cursor:pointer;border:1px solid var(--btn-secondary-border);border-radius:6px;background:var(--panel);color:var(--text); }

/* 触屏大按钮模式 */
body.touch-mode .grid { grid-template-columns: repeat(4, 1fr); }
body.touch-mode .card { height: 132px; min-height: 132px; grid-template-rows: 20px 14px minmax(38px, 1fr) 38px; }
body.touch-mode .card .qty .num { font-size: 32px; }
body.touch-mode .card .ops { height: 38px; }
body.touch-mode .card .ops button { height: 38px; padding: 0 3px; font-size: 13px; }

/* Keep controls readable in a narrow preview panel. */
@media (max-width: 640px) {
  .nav { width: 112px; flex-basis: 112px; }
  .nav .brand { padding: 10px 8px; font-size: 13px; }
  .nav button { padding-left: 8px; padding-right: 6px; font-size: 12px; }
  .topbar { flex-wrap: wrap; }
  .topbar h1 { white-space: nowrap; }
  .topbar .grow { display: none; }
  .topbar input { width: 100%; }
  .grid, body.touch-mode .grid { grid-template-columns: minmax(0, 1fr); }
}

/* 本区待加工→部分完成→已完成连续补位；三状态使用同一网格。 */
.status-scroll { min-width: 0; max-width: 100%; overflow-x: auto; padding-bottom: 2px; }
.status-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.status-lanes { display: grid; grid-template-columns: minmax(0, 1fr);
  min-width: 0; gap: 6px; align-items: start; }
.status-lane { min-width: 0; }
.status-lane-head { display: flex; align-items: center; justify-content: space-between;
  gap: 5px; height: 26px; padding: 3px 0; color: var(--text); }
.status-lane-head::before { content: ''; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; }
.status-lane-head h3 { margin: 0; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-lane-head span { margin-left: auto; font-size: 11px; font-weight: 700; white-space: nowrap; }
.lane-open .status-lane-head::before { background: var(--legend-open); }
.lane-partial .status-lane-head::before { background: var(--legend-partial); }
.lane-done .status-lane-head::before { background: var(--legend-done); }
.status-stream-head { justify-content: flex-start; gap: 12px; overflow: hidden; }
.status-stream-head::before { display: none; }
.status-key { display: flex; align-items: center; gap: 4px; min-width: 0; }
.status-key::before { content: ''; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; }
.status-key h3 { font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.key-open::before { background: var(--legend-open); }
.key-partial::before { background: var(--legend-partial); }
.status-lanes > .status-grid { grid-template-columns: minmax(0, 1fr);
  align-content: start; gap: 6px; padding: 0; margin: 0; }
.status-empty { grid-column: 1 / -1; padding: 12px 4px; text-align: center;
  color: var(--text-muted); font-size: 11px; }

/* SMS login only. Existing business layout stays unchanged. */
.web-sms-card .sms-trust{display:flex;align-items:center;gap:10px;font-size:14px;line-height:1.6}
.web-sms-card .sms-trust input{width:18px;min-height:18px;height:18px;flex:0 0 18px}
.web-sms-card button:disabled{opacity:.55;cursor:not-allowed}
@media(max-width:480px){.web-sms-card{padding:24px 20px}}
