/* ============================================================
   6S 检查记录系统 - H5 样式
   移动端优先 / 浅色主题 / 不依赖任何外部 CSS 框架或 CDN
   ============================================================ */

:root {
  --primary: #1677ff;
  --primary-dark: #0b5ed7;
  --primary-soft: #e8f1ff;
  --danger: #dc2626;
  --danger-soft: #fdeaea;
  --success: #16a34a;
  --success-soft: #e7f7ed;
  --warning: #d97706;
  --warning-soft: #fdf3e3;

  --bg: #f2f4f8;
  --card: #ffffff;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, .12);
  --tabbar-h: 58px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { overscroll-behavior-y: none; }

input, select, textarea, button { font-family: inherit; font-size: 15px; color: inherit; }
input, textarea, select { outline: none; }

.hidden { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }

/* ---------------- 启动遮罩 ---------------- */
.boot {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: var(--bg); color: var(--text-2);
}
.boot .brand {
  width: 62px; height: 62px; border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), #52a0ff);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; box-shadow: var(--shadow-lg);
}

/* ---------------- 登录页 ---------------- */
.login-view {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 28px 22px calc(28px + var(--safe-bottom));
  background: linear-gradient(180deg, #e8f1ff 0%, var(--bg) 42%);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand .logo {
  width: 68px; height: 68px; margin: 0 auto 12px; border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), #52a0ff);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; box-shadow: var(--shadow-lg);
}
.login-brand h1 { margin: 0; font-size: 21px; font-weight: 700; }
.login-brand p { margin: 6px 0 0; font-size: 13px; color: var(--text-2); }
.login-card { background: var(--card); border-radius: 18px; padding: 20px 18px; box-shadow: var(--shadow-lg); }
.login-tip { margin-top: 16px; text-align: center; font-size: 12px; color: var(--text-3); line-height: 1.7; }

/* ---------------- 表单元素 ---------------- */
.field { margin-bottom: 14px; }
.field > label {
  display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px;
}
.field > label .req { color: var(--danger); margin-left: 2px; }
.input, .textarea, .select {
  width: 100%; padding: 11px 13px;
  background: #fbfcfe; border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s, background .15s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); background: #fff; }
.textarea { resize: vertical; min-height: 68px; line-height: 1.5; }
.input.is-error, .textarea.is-error, .select.is-error { border-color: var(--danger); background: var(--danger-soft); }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 5px; }
.counter { text-align: right; font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 16px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font-weight: 600; cursor: pointer;
  transition: opacity .15s, background .15s, transform .06s;
  user-select: none; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--border-strong); color: var(--text); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 14px 18px; font-size: 16px; }
.btn-sm { padding: 7px 12px; font-size: 13px; font-weight: 500; }
.btn-link { background: none; border: none; color: var(--primary); padding: 4px 2px; font-weight: 600; }

/* ---------------- 应用骨架 ---------------- */
.app-header {
  position: sticky; top: 0; z-index: 40;
  padding: calc(10px + var(--safe-top)) 16px 12px;
  background: linear-gradient(135deg, var(--primary) 0%, #3d8bff 100%);
  color: #fff; border-radius: 0 0 18px 18px;
  box-shadow: 0 2px 10px rgba(22, 119, 255, .22);
}
.app-header .title { font-size: 18px; font-weight: 700; }
.app-header .subtitle { font-size: 12.5px; opacity: .9; margin-top: 2px; }
.app-header .header-actions { display: flex; gap: 8px; }
.app-header .icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .18); color: #fff; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.app-header .icon-btn:active { background: rgba(255, 255, 255, .3); }

.page {
  padding: 12px 14px calc(var(--tabbar-h) + 26px + var(--safe-bottom));
  min-height: calc(100vh - 120px);
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; background: #fff; border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -2px 10px rgba(16, 24, 40, .05);
}
.tabbar .tab {
  flex: 1; border: none; background: none; cursor: pointer;
  padding: 7px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-3); font-size: 11px; font-weight: 500;
}
.tabbar .tab .tab-icon { font-size: 19px; line-height: 1; }
.tabbar .tab.active { color: var(--primary); }
.tabbar .tab.active .tab-icon { transform: translateY(-1px); }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.card.tight { padding: 11px 12px; }
.card-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 15px; font-weight: 700; margin-bottom: 11px;
}
.card-title .hint { font-size: 12px; font-weight: 400; color: var(--text-3); }
.card-title .bar {
  display: inline-block; width: 3px; height: 14px; border-radius: 2px;
  background: var(--primary); margin-right: 7px; vertical-align: -2px;
}

/* ---------------- 区域 / 类别 chips ---------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 13px; border-radius: 10px; cursor: pointer; user-select: none;
  background: #fbfcfe; border: 1px solid var(--border); color: var(--text);
  font-size: 13.5px; line-height: 1.3; transition: all .14s;
}
.chip:active { transform: scale(.97); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.chip.deduct.active { background: var(--danger); border-color: var(--danger); }
.chip.bonus.active { background: var(--success); border-color: var(--success); }
.chip .chip-sub { display: block; font-size: 11px; opacity: .75; margin-top: 1px; }
.chip.group-label {
  background: none; border: none; padding: 0 0 6px; font-size: 12.5px;
  font-weight: 700; color: var(--text-2); width: 100%; cursor: default;
}
.chip.group-label.deduct { color: var(--danger); }
.chip.group-label.bonus { color: var(--success); }

/* ---------------- 拍照 ---------------- */
.photo-row { display: flex; gap: 10px; align-items: flex-start; }
.photo-box {
  position: relative; width: 108px; height: 108px; flex: 0 0 auto;
  border-radius: 12px; border: 1.5px dashed var(--border-strong);
  background: #fbfcfe; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  color: var(--text-3); cursor: pointer; overflow: hidden;
}
.photo-box .icon { font-size: 26px; }
.photo-box .txt { font-size: 11.5px; }
.photo-box.has-photo { border-style: solid; border-color: var(--primary); }
.photo-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-box .overlay {
  position: absolute; inset: 0; background: rgba(15, 23, 42, .5); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600;
}
.photo-box .remove {
  position: absolute; top: 4px; right: 4px; z-index: 3;
  width: 21px; height: 21px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(15, 23, 42, .68); color: #fff; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.photo-actions { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-width: 0; }

/* ---------------- 分值步进 ---------------- */
.score-stepper { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stepper {
  display: inline-flex; align-items: center; border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; background: #fff;
}
.stepper button {
  width: 38px; height: 38px; border: none; background: #f7f9fc; cursor: pointer;
  font-size: 17px; color: var(--text-2); line-height: 1;
}
.stepper button:active { background: var(--primary-soft); color: var(--primary); }
.stepper input {
  width: 54px; height: 38px; border: none; text-align: center; font-weight: 700;
  font-size: 16px; background: #fff; -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.quick-scores { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-scores .qs {
  padding: 6px 11px; border-radius: 8px; font-size: 13px; cursor: pointer;
  background: #f7f9fc; border: 1px solid var(--border); color: var(--text-2); font-weight: 600;
}
.quick-scores .qs.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

/* ---------------- 待提交清单 ---------------- */
.pending-list { display: flex; flex-direction: column; gap: 9px; }
.pending-item {
  display: flex; gap: 10px; padding: 9px; border-radius: 12px;
  background: #fbfcfe; border: 1px solid var(--border);
}
.pending-item .thumb {
  width: 58px; height: 58px; border-radius: 9px; flex: 0 0 auto;
  background: #eef2f7 center/cover no-repeat; border: 1px solid var(--border);
}
.pending-item .info { flex: 1 1 auto; min-width: 0; }
.pending-item .cat { font-size: 12.5px; font-weight: 700; }
.pending-item .desc { font-size: 13px; margin-top: 2px; word-break: break-all; }
.pending-item .rm {
  width: 26px; height: 26px; flex: 0 0 auto; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text-2); cursor: pointer; font-size: 14px; line-height: 1;
}
.pending-item .rm:active { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }

/* ---------------- 得分徽标 ---------------- */
.score-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; padding: 3px 9px; border-radius: 8px;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.score-badge.deduct { background: var(--danger-soft); color: var(--danger); }
.score-badge.bonus { background: var(--success-soft); color: var(--success); }
.score-badge.zero { background: #f1f3f7; color: var(--text-2); }
.score-badge.big { font-size: 17px; min-width: 56px; padding: 6px 12px; border-radius: 10px; }

.score-pill {
  display: inline-flex; align-items: baseline; gap: 2px;
  font-weight: 800; font-variant-numeric: tabular-nums;
}
.score-pill .num { font-size: 22px; line-height: 1; }
.score-pill.good .num { color: var(--success); }
.score-pill.mid .num { color: var(--warning); }
.score-pill.bad .num { color: var(--danger); }

/* ---------------- 记录卡片 ---------------- */
.record-card {
  background: var(--card); border-radius: var(--radius); padding: 13px;
  box-shadow: var(--shadow); margin-bottom: 10px; cursor: pointer;
}
.record-card:active { background: #fafbfe; }
.record-card.voided { opacity: .62; }
.record-card .rc-top { display: flex; gap: 10px; align-items: flex-start; }
.record-card .rc-thumb {
  width: 56px; height: 56px; border-radius: 10px; flex: 0 0 auto;
  background: #eef2f7 center/cover no-repeat; border: 1px solid var(--border);
}
.record-card .rc-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.record-card .rc-no { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.record-card .rc-area { font-size: 15px; font-weight: 700; }
.tag {
  display: inline-block; padding: 1px 7px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; background: #f1f3f7; color: var(--text-2);
}
.tag.void { background: var(--danger-soft); color: var(--danger); }
.tag.ok { background: var(--success-soft); color: var(--success); }
.tag.warn { background: var(--warning-soft); color: var(--warning); }

/* ---------------- 统计 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.stat-grid.two { grid-template-columns: repeat(2, 1fr); }
.stat-cell {
  background: #fbfcfe; border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 8px; text-align: center;
}
.stat-cell .v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-cell .v.danger { color: var(--danger); }
.stat-cell .v.success { color: var(--success); }
.stat-cell .v.primary { color: var(--primary); }
.stat-cell .k { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }

.rank-row { padding: 8px 0; border-bottom: 1px solid #f1f3f7; }
.rank-row:last-child { border-bottom: none; }
.rank-row .rr-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.rank-row .rank-no {
  width: 21px; height: 21px; border-radius: 6px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; background: #f1f3f7; color: var(--text-2);
}
.rank-row .rank-no.top1 { background: #fff2d6; color: #b45309; }
.rank-row .rank-no.top2 { background: #eef1f6; color: #475569; }
.rank-row .rank-no.top3 { background: #fdeee0; color: #b45309; }
.rank-bar { height: 7px; border-radius: 4px; background: #f1f3f7; margin-top: 6px; overflow: hidden; }
.rank-bar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #3d8bff, var(--primary)); }
.rank-bar > i.low { background: linear-gradient(90deg, #f87171, var(--danger)); }

.legend { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-item .dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.legend-item .val { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-2); }

.chart-wrap { width: 100%; overflow: hidden; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

.seg {
  display: flex; background: #eef1f6; border-radius: 10px; padding: 3px; gap: 2px;
}
.seg button {
  flex: 1; border: none; background: none; padding: 7px 6px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer;
}
.seg button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow); }

/* ---------------- 空状态 / 加载 ---------------- */
.empty { text-align: center; padding: 38px 20px; color: var(--text-3); }
.empty .icon { font-size: 42px; margin-bottom: 10px; opacity: .55; }
.empty .txt { font-size: 13.5px; }

.skeleton { background: linear-gradient(90deg, #f1f3f7 25%, #e8ecf2 37%, #f1f3f7 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid rgba(22, 119, 255, .2); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-mask {
  position: fixed; inset: 0; z-index: 300; background: rgba(255, 255, 255, .72);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  font-size: 13.5px; color: var(--text-2);
}

/* ---------------- 弹层 ---------------- */
.mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .45);
  opacity: 0; transition: opacity .22s;
}
.mask.show { opacity: 1; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 110;
  background: #fff; border-radius: 18px 18px 0 0;
  max-height: 90vh; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.22, .61, .36, 1);
  padding-bottom: var(--safe-bottom);
}
.sheet.show { transform: translateY(0); }
.sheet .sheet-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px 11px;
  border-bottom: 1px solid var(--border);
}
.sheet .sheet-head .st { font-size: 16px; font-weight: 700; flex: 1 1 auto; }
.sheet .sheet-body { overflow-y: auto; padding: 14px 16px calc(16px + var(--safe-bottom)); -webkit-overflow-scrolling: touch; }
.sheet .sheet-foot { padding: 11px 16px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--border); display: flex; gap: 9px; }

.dialog {
  position: fixed; z-index: 120; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.96);
  width: min(92vw, 400px); background: #fff; border-radius: 16px;
  padding: 20px 18px 16px; box-shadow: var(--shadow-lg); opacity: 0; transition: all .2s;
}
.dialog.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.dialog h3 { margin: 0 0 8px; font-size: 16.5px; font-weight: 700; }
.dialog p { margin: 0; font-size: 14px; color: var(--text-2); word-break: break-word; }
.dialog .dialog-actions { display: flex; gap: 9px; margin-top: 18px; }
.dialog .dialog-actions .btn { flex: 1; }

/* ---------------- 轻提示 ---------------- */
.toast-root {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + 24px + var(--safe-bottom));
  z-index: 400; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; padding: 0 16px;
}
.toast {
  max-width: 92vw; padding: 10px 16px; border-radius: 11px;
  background: rgba(31, 41, 55, .93); color: #fff; font-size: 13.5px; line-height: 1.45;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px);
  transition: all .22s; text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: rgba(22, 163, 74, .95); }
.toast.error { background: rgba(220, 38, 38, .95); }

/* ---------------- 照片九宫格 ---------------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.photo-grid .ph {
  aspect-ratio: 1 / 1; border-radius: 10px; border: 1px solid var(--border);
  background: #eef2f7 center/cover no-repeat; cursor: pointer;
}

/* ---------------- 明细行 ---------------- */
.item-line { padding: 11px 0; border-bottom: 1px solid #f1f3f7; }
.item-line:last-child { border-bottom: none; }
.item-line .il-head { display: flex; align-items: flex-start; gap: 8px; }
.item-line .il-cat { font-size: 13px; font-weight: 700; }
.item-line .il-desc { font-size: 14px; margin-top: 3px; word-break: break-word; }
.item-line .il-remark { font-size: 12.5px; color: var(--text-2); margin-top: 4px; background: #f8fafc; border-radius: 7px; padding: 5px 8px; }
.item-line .il-photo { margin-top: 8px; }
.item-line .il-photo img { width: 78px; height: 78px; object-fit: cover; border-radius: 9px; border: 1px solid var(--border); }

/* ---------------- 图片查看器 ---------------- */
.viewer {
  position: fixed; inset: 0; z-index: 500; background: rgba(0, 0, 0, .92);
  display: flex; align-items: center; justify-content: center;
}
.viewer img { max-width: 100%; max-height: 88vh; object-fit: contain; }
.viewer .close {
  position: absolute; top: calc(14px + var(--safe-top)); right: 16px;
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 19px; cursor: pointer;
}

/* ---------------- 列表项 ---------------- */
.list-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid #f1f3f7;
}
.list-item:last-child { border-bottom: none; }
.list-item .li-main { flex: 1 1 auto; min-width: 0; }
.list-item .li-title { font-size: 14.5px; font-weight: 600; }
.list-item .li-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

.switch {
  position: relative; width: 46px; height: 26px; border-radius: 13px; flex: 0 0 auto;
  background: var(--border-strong); border: none; cursor: pointer; transition: background .18s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(20px); }

.back-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.back-bar button {
  border: none; background: none; color: var(--primary); font-size: 14.5px;
  font-weight: 600; cursor: pointer; padding: 4px 0; display: flex; align-items: center; gap: 4px;
}

/* 桌面端收窄，保持手机观感 */
@media (min-width: 720px) {
  body { background: #e9edf3; }
  .app-header, .tabbar, .page, .login-view { max-width: 560px; margin-left: auto; margin-right: auto; }
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 560px; border-radius: 16px 16px 0 0; }
  .app-header { border-radius: 0 0 18px 18px; }
  .sheet { max-width: 560px; left: 50%; right: auto; transform: translate(-50%, 100%); border-radius: 18px 18px 0 0; }
  .sheet.show { transform: translate(-50%, 0); }
  .toast-root { bottom: 24px; }
}
