/* ==========================================================================
   机电工时登记系统 · 毛玻璃主题 v2
   移动端优先，桌面端双栏；深浅双主题
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --brand: #e4002b;
  --brand-2: #ff5f6d;
  --brand-3: #ffb26b;
  --brand-soft: rgba(228, 0, 43, .14);
  --ok: #35d39a;
  --warn: #ffb020;
  --danger: #ff5b5b;

  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ring: 0 0 0 3px rgba(228, 0, 43, .28);
  --font: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Courier New", monospace;
  --header-h: 60px;
}

html[data-theme="dark"] {
  --bg: #060a14;
  --bg-2: #0a1224;
  --text: #f4f6ff;
  --muted: rgba(226, 233, 255, .66);
  --muted-2: rgba(226, 233, 255, .42);
  --glass: rgba(255, 255, 255, .062);
  --glass-2: rgba(255, 255, 255, .1);
  --glass-border: rgba(255, 255, 255, .13);
  --glass-highlight: rgba(255, 255, 255, .22);
  --input-bg: rgba(9, 14, 28, .55);
  --input-border: rgba(255, 255, 255, .12);
  --line: rgba(255, 255, 255, .08);
  --shadow: 0 24px 56px -30px rgba(0, 0, 0, .9);
  --blob-1: rgba(228, 0, 43, .45);
  --blob-2: rgba(70, 120, 255, .38);
  --blob-3: rgba(140, 70, 255, .28);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #eef1f8;
  --bg-2: #e2e8f6;
  --text: #141a2b;
  --muted: rgba(20, 26, 43, .66);
  --muted-2: rgba(20, 26, 43, .45);
  --glass: rgba(255, 255, 255, .62);
  --glass-2: rgba(255, 255, 255, .82);
  --glass-border: rgba(255, 255, 255, .9);
  --glass-highlight: rgba(255, 255, 255, 1);
  --input-bg: rgba(255, 255, 255, .78);
  --input-border: rgba(20, 26, 43, .1);
  --line: rgba(20, 26, 43, .08);
  --shadow: 0 22px 48px -28px rgba(38, 55, 98, .38);
  --blob-1: rgba(228, 0, 43, .18);
  --blob-2: rgba(70, 120, 255, .16);
  --blob-3: rgba(150, 90, 255, .14);
  color-scheme: light;
}

html, body { height: 100%; }

/* 字号（全站 rem 基准）+ 密度（卡片内边距 / 行距） */
html { font-size: 15px; }
html[data-font="1"] { font-size: 14px; }
html[data-font="3"] { font-size: 16.5px; }

html[data-density="1"] { --card-pad: 14px; --row-gap: 8px; --ctl-h: 38px; }
html[data-density="2"] { --card-pad: 20px; --row-gap: 12px; --ctl-h: 42px; }
html[data-density="3"] { --card-pad: 26px; --row-gap: 16px; --ctl-h: 46px; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}

/* 背景 */
.bg-stage {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1100px 720px at 8% -12%, rgba(228, 0, 43, .16), transparent 62%),
    radial-gradient(900px 640px at 96% 2%, rgba(70, 120, 255, .15), transparent 64%),
    linear-gradient(165deg, var(--bg) 0%, var(--bg-2) 100%);
}
.bg-stage .blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .85;
  animation: blobFloat 20s var(--ease) infinite alternate;
}
.bg-stage .b1 { width: 44vw; height: 44vw; left: -12vw; top: -10vw; background: var(--blob-1); }
.bg-stage .b2 { width: 38vw; height: 38vw; right: -10vw; top: 8vh; background: var(--blob-2); animation-delay: -7s; }
.bg-stage .b3 { width: 34vw; height: 34vw; left: 26vw; bottom: -20vw; background: var(--blob-3); animation-delay: -13s; }

@keyframes blobFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(2.5vw, 3.5vh, 0) scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .bg-stage .blob { animation: none; }
}

/* 玻璃 */
.glass, .card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-highlight);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .card { background: var(--glass-2); }
}
.card {
  border-radius: var(--r-xl);
  padding: var(--card-pad, 20px);
}

/* 文本 */
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 1.28rem; letter-spacing: .01em; }
h2 { font-size: 1.06rem; }
h3 { font-size: 1rem; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.small { font-size: .8rem; }
.mono { font-family: var(--mono); letter-spacing: .05em; }
.hint { color: var(--muted-2); font-size: .78rem; margin-top: 4px; }
.hint.ok { color: var(--ok); }
.hint.err { color: var(--danger); }
.eyebrow {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brand-2);
  margin-bottom: 4px;
}
.section-title {
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 18px 0 8px;
}
.section-title:first-child { margin-top: 4px; }
.section-gap { margin-top: 18px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ico { width: 18px; height: 18px; flex: 0 0 auto; }
.ico-lg { width: 26px; height: 26px; }

/* 顶栏 */
.appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 10, 20, .55);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
}
html[data-theme="light"] .appbar { background: rgba(255, 255, 255, .55); }
.appbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .05em;
  color: #fff;
  background: linear-gradient(140deg, var(--brand), #8e001b);
  box-shadow: 0 10px 24px -14px rgba(228, 0, 43, .95), inset 0 1px 0 rgba(255, 255, 255, .35);
}

/* 自定义 Logo 图片 */
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: inherit;
}
.brand-mark.has-img {
  background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 0 0 1px var(--glass-border);
  padding: 3px;
  overflow: hidden;
}
html[data-theme="light"] .brand-mark.has-img { background: #fff; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { font-size: 1rem; letter-spacing: .02em; }
.brand-text small {
  color: var(--muted-2);
  font-size: .72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appbar-actions { display: flex; align-items: center; gap: 6px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .74rem;
  color: var(--muted);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  white-space: nowrap;
}
.pill b { color: var(--text); font-size: .92rem; font-family: var(--mono); }
.pill small { color: var(--muted-2); font-size: .68rem; }

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  transition: background .2s, transform .16s, border-color .2s;
}
.icon-btn:hover { background: var(--glass-2); border-color: rgba(228, 0, 43, .35); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .ico { width: 17px; height: 17px; }

/* 吸顶分段标签 */
.tabsbar {
  position: sticky;
  top: var(--header-h);
  z-index: 45;
  padding: 10px 16px 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.segmented {
  pointer-events: auto;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 5px;
  width: min(520px, 100%);
  border-radius: 999px;
  background: rgba(8, 13, 26, .55);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  box-shadow: 0 14px 30px -24px rgba(0, 0, 0, .8);
}
html[data-theme="light"] .segmented { background: rgba(255, 255, 255, .6); }
.segmented.sm { width: 100%; border-radius: 14px; margin-bottom: 12px; }
.seg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-2);
  font-family: inherit;
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s;
  white-space: nowrap;
}
.segmented.sm .seg { border-radius: 10px; font-size: .82rem; padding: 7px 8px; }
.seg .ico { width: 16px; height: 16px; }
.seg:hover { color: var(--text); }
.seg.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 22px -14px rgba(228, 0, 43, .95);
}
.seg[disabled] { opacity: .4; cursor: not-allowed; }
.seg-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: .66rem;
  line-height: 18px;
  background: rgba(255, 255, 255, .22);
  font-family: var(--mono);
}
.seg:not(.is-active) .seg-count { background: var(--glass-2); color: var(--muted); }

/* ---------------- 布局 ---------------- */
.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 16px 28px;
}
.layout { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.layout > * { min-width: 0; }

.view { animation: rise .4s var(--ease) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-heading { min-width: 0; }
.card-heading h1 { font-size: 1.22rem; }
.card-heading h2 { font-size: 1.04rem; }
.card-heading p { margin-top: 2px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  white-space: nowrap;
  flex: 0 0 auto;
}
.badge.warn {
  color: #3b2400;
  background: linear-gradient(135deg, #ffd377, #ffb020);
  border-color: transparent;
}
.badge.ok {
  color: #04291d;
  background: linear-gradient(135deg, #63e6b6, #35d39a);
  border-color: transparent;
}

/* ---------------- 按钮 ---------------- */
.btn {
  --btn-h: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: var(--btn-h);
  padding: 0 18px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .2s, background .2s, border-color .2s, opacity .2s;
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: scale(.985); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn .ico { width: 17px; height: 17px; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 14px 28px -14px rgba(228, 0, 43, .9), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-primary:hover { filter: brightness(1.05); }

.btn-soft {
  color: var(--text);
  background: var(--glass-2);
  border-color: var(--glass-border);
}
.btn-soft:hover { background: var(--glass); border-color: rgba(228, 0, 43, .35); }

.btn-ghost {
  color: var(--muted);
  background: transparent;
  border-color: var(--glass-border);
}
.btn-ghost:hover { color: var(--text); background: var(--glass); }

.btn-danger { color: #fff; background: linear-gradient(135deg, #d92b3f, #ff6b6b); }
.btn-lg { --btn-h: 48px; font-size: .98rem; border-radius: 15px; }
.btn.sm, .btn-sm { --btn-h: 34px; padding: 0 13px; font-size: .82rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-size: .75rem;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.mini-btn:hover { background: var(--brand-soft); border-color: rgba(228, 0, 43, .4); }
.mini-btn.danger { color: var(--danger); border-color: rgba(255, 91, 91, .32); }
.mini-btn.danger:hover { background: rgba(255, 91, 91, .14); }

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-size: .76rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .16s;
}
.chip-btn .ico { width: 15px; height: 15px; }
.chip-btn:hover { background: var(--brand-soft); border-color: rgba(228, 0, 43, .42); }
.chip-btn:active { transform: scale(.96); }
.chip-btn.danger { color: var(--danger); border-color: rgba(255, 91, 91, .32); }

/* ---------------- 表单 ---------------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.form-grid > .col-2 { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field[hidden] { display: none; }
.field.narrow { flex: 0 1 150px; }
.entry-card { padding: 20px; }
.row-check { width: 17px; height: 17px; accent-color: var(--brand); }
.label, .field > .label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
}
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.field-tools { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.req { font-style: normal; color: var(--brand-2); font-weight: 700; }
.req[hidden] { display: none; }

.field input,
.field select,
.field textarea,
.scan-manual input,
.mini-input,
.search-box input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: .96rem;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--r-md);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field input::placeholder, .search-box input::placeholder { color: var(--muted-2); }
.field input:focus,
.field select:focus,
.scan-manual input:focus,
.mini-input:focus,
.search-box input:focus {
  outline: none;
  border-color: rgba(228, 0, 43, .6);
  box-shadow: 0 0 0 3px rgba(228, 0, 43, .15);
  background: var(--glass-2);
}
.field input.input-xl {
  min-height: 56px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-align: center;
}
.field input.input-lg { font-size: 1.08rem; font-weight: 600; }
.field input[type="date"], .field input[type="month"] { color-scheme: inherit; }
.field input[readonly] { opacity: .85; }
.mini-input { width: auto; min-height: 34px; padding: 4px 10px; font-size: .8rem; border-radius: 10px; }

.input-affix { position: relative; display: flex; align-items: center; }
.input-affix input { padding-right: 38px; }
.input-affix .affix {
  position: absolute;
  right: 12px;
  font-size: .78rem;
  color: var(--muted-2);
  pointer-events: none;
}

.check { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 2px; }
.chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-size: .8rem;
  font-family: inherit;
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .16s;
  white-space: nowrap;
}
.chip:hover { background: var(--brand-soft); border-color: rgba(228, 0, 43, .42); }
.chip:active { transform: scale(.97); }
.chip.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
}
.chip small { opacity: .68; margin-left: 5px; font-size: .7rem; }

/* 照片 */
.photo-box {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px dashed var(--input-border);
  background: var(--input-bg);
  min-height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color .2s, background .2s;
}
.photo-box:hover { border-color: rgba(228, 0, 43, .4); }
.photo-empty { padding: 18px; text-align: center; }
.photo-illus {
  width: 46px;
  height: 46px;
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--brand-2);
  background: var(--brand-soft);
  border: 1px solid rgba(228, 0, 43, .22);
}
.photo-title { font-weight: 600; font-size: .9rem; margin-bottom: 2px; }
.photo-empty .hint { margin-bottom: 10px; }
.photo-preview { position: relative; width: 100%; }
.photo-preview[hidden] { display: none; }
.photo-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--r-lg);
}
.photo-tools {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
}
.photo-tools .chip-btn { background: rgba(0, 0, 0, .55); color: #fff; border-color: rgba(255, 255, 255, .25); }
.photo-tools .chip-btn:hover { background: rgba(0, 0, 0, .72); }
.photo-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: .84rem;
  color: var(--muted);
  background: rgba(6, 10, 20, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.photo-loading[hidden] { display: none; }
.photo-sources {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}
.photo-sources .btn { flex: 0 1 auto; }

/* 图片识别（拍照 / 相册） */
.ocr-sources {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 10px;
}
.ocr-sources .btn { flex: 1 1 130px; }
.ocr-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.plate-picker {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--glass-border);
  border-radius: 12px;
  background: var(--glass);
}
.plate-picker .hint { margin-bottom: 8px; }
.plate-picker .chip { padding: 6px 11px; font-size: .8rem; }
.plate-picker #platePickerSkip { margin-top: 6px; }
.link-btn {
  background: none;
  border: 0;
  padding: 2px 0;
  color: var(--muted-2);
  font-family: inherit;
  font-size: .78rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--text); }
#ocrModal .alert { margin: 4px 0 10px; }
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: var(--brand-2);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 吸底保存栏 */
.save-bar {
  position: sticky;
  bottom: 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 18px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(8, 13, 26, .6);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  box-shadow: 0 18px 38px -24px rgba(0, 0, 0, .9);
}
html[data-theme="light"] .save-bar { background: rgba(255, 255, 255, .72); }
.save-bar .btn-primary { grid-column: 1; }
.save-bar .btn-soft { grid-column: 2; }
.save-bar .btn-ghost { grid-column: 3; }

/* ---------------- KPI ---------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.kpi {
  padding: 10px 6px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  text-align: center;
}
.kpi b {
  display: inline-block;
  font-size: 1.26rem;
  font-family: var(--mono);
  letter-spacing: -.03em;
  line-height: 1.3;
}
.kpi small { color: var(--muted-2); font-size: .68rem; margin-left: 2px; }
.kpi-label { display: block; font-size: .68rem; color: var(--muted-2); letter-spacing: .04em; margin-bottom: 2px; }
.kpi-brand {
  background: linear-gradient(135deg, rgba(228, 0, 43, .22), rgba(255, 95, 109, .1));
  border-color: rgba(228, 0, 43, .3);
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--input-bg);
  overflow: hidden;
  margin: 14px 0 6px;
  border: 1px solid var(--input-border);
}
.progress > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--brand-3));
  transition: width .7s var(--ease);
}

/* ---------------- 条形图 ---------------- */
.bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bar-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: .82rem; }
.bar-item .bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-item .bar-val { font-family: var(--mono); color: var(--muted); white-space: nowrap; }
.bar-track {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: var(--input-bg);
  overflow: hidden;
  border: 1px solid var(--input-border);
}
.bar-track > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(228, 0, 43, .9), rgba(255, 95, 109, .85));
  transition: width .6s var(--ease);
}

.day-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 96px;
  padding-top: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.day-bar { flex: 1 0 11px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 11px; }
.day-bar i {
  display: block;
  width: 100%;
  border-radius: 5px 5px 3px 3px;
  background: linear-gradient(180deg, rgba(255, 95, 109, .95), rgba(228, 0, 43, .5));
  min-height: 3px;
  transition: height .5s var(--ease);
}
.day-bar span { font-size: .6rem; color: var(--muted-2); font-family: var(--mono); }

/* ---------------- 记录卡片 ---------------- */
.record-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.record-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  grid-template-areas:
    "thumb main hours"
    "actions actions actions";
  gap: 4px 10px;
  padding: 10px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: border-color .2s, transform .2s;
}
.record-item:hover { border-color: rgba(228, 0, 43, .28); }
.record-item.is-confirmed { opacity: .8; }
.re-thumb {
  grid-area: thumb;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--input-bg);
  cursor: zoom-in;
}
.re-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.re-thumb.placeholder {
  cursor: default;
  background:
    linear-gradient(135deg, rgba(228, 0, 43, .12), rgba(70, 120, 255, .12));
  position: relative;
}
.re-thumb.placeholder::after {
  content: "";
  position: absolute;
  inset: 30%;
  border: 1.5px solid var(--muted-2);
  border-radius: 4px;
  opacity: .5;
}
.re-main { grid-area: main; min-width: 0; }
.re-title {
  font-weight: 600;
  font-size: .92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.re-sub {
  font-size: .76rem;
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}
.re-hours {
  grid-area: hours;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--brand-2);
  white-space: nowrap;
}
.re-hours small { font-size: .68rem; opacity: .7; margin-left: 1px; }
.re-actions { grid-area: actions; display: flex; gap: 6px; flex-wrap: wrap; }
.re-actions:empty { display: none; }
.record-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.range-switch { margin-bottom: 12px; }
.range-switch .seg { font-size: .8rem; padding: 7px 6px; }

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  background: var(--warn);
}
.status-dot.confirmed { background: var(--ok); }
.status-dot.returned { background: var(--danger); }
.status-dot.pending { background: var(--warn); }

.empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--muted-2);
  font-size: .84rem;
  border-radius: var(--r-md);
  border: 1px dashed var(--glass-border);
  list-style: none;
}

/* ---------------- 弹窗 ---------------- */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 14, .64);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal-panel {
  position: relative;
  width: min(540px, 100%);
  max-height: min(88vh, 100%);
  overflow: auto;
  border-radius: var(--r-xl);
  padding: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .9), inset 0 1px 0 var(--glass-highlight);
  animation: pop .28s var(--ease) both;
}
.modal-panel.wide { width: min(720px, 100%); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .modal-panel { background: var(--glass-2); }
}
@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-head h3 { font-size: 1.02rem; }

/* 项目选择器 */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}
.search-box .ico {
  position: absolute;
  left: 13px;
  color: var(--muted-2);
  width: 17px;
  height: 17px;
}
.search-box input { padding-left: 38px; }
.item-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 46vh;
  overflow: auto;
}
.item-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .18s, border-color .18s;
}
.item-row:hover { background: var(--brand-soft); border-color: rgba(228, 0, 43, .35); }
.item-main { display: flex; flex-direction: column; min-width: 0; }
.item-name { font-size: .9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-cat { font-size: .72rem; color: var(--muted-2); }
.item-hours { font-family: var(--mono); font-weight: 700; color: var(--brand-2); white-space: nowrap; }
.item-hours small { font-size: .66rem; opacity: .7; margin-left: 1px; }
.item-row.is-picked { border-color: rgba(228, 0, 43, .55); background: var(--brand-soft); }
.item-row .pick-mark {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  display: grid;
  place-items: center;
  font-size: .7rem;
  color: transparent;
}
.item-row.is-picked .pick-mark {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.item-picker-bar {
  position: sticky;
  bottom: -18px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px -18px -18px;
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
@media (max-width: 640px) {
  .item-picker-bar { margin: 12px -15px -15px; padding: 10px 15px calc(10px + env(safe-area-inset-bottom)); }
  .sel-item { grid-template-columns: minmax(0, 1fr) 68px 48px 28px; gap: 6px; }
}

/* 已选项目清单 */
.selected-items {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed var(--glass-border);
  background: var(--input-bg);
}

/* 字段校验失败 */
input.is-invalid,
select.is-invalid,
.is-invalid input {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(255, 91, 91, .18) !important;
}
.sel-list.is-invalid {
  border-color: var(--danger) !important;
  background: rgba(255, 91, 91, .06);
}

/* 常用工时快捷键 */
.hours-quick { margin-top: 8px; }
.hours-quick .chip { min-height: 30px; padding: 3px 10px; font-family: var(--mono); }
.hours-quick .chip.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
}

/* 列表“加载更多” */
.list-more { display: flex; justify-content: center; padding: 10px 0 2px; }

/* 作业项目内的「本项目工时 / 本项目数量」 */
.item-lines {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--glass-border);
}
.item-lines .field { gap: 4px; }
.item-lines .label { font-size: .76rem; color: var(--muted); }
.item-lines .input-affix input { min-height: 40px; }
@media (max-width: 420px) {
  .item-lines { grid-template-columns: minmax(0, 1fr) 92px; }
}
.sel-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sel-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 56px 28px;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
}
.sel-name { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-item input {
  width: 100%;
  min-height: 32px;
  padding: 4px 8px;
  font-size: .82rem;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
}
.sel-del {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 91, 91, .3);
  background: rgba(255, 91, 91, .1);
  color: var(--danger);
  font-size: .8rem;
  cursor: pointer;
}

/* 扫码 */
.scanner-stage {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #000;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--glass-border);
}
.scanner-stage[hidden] { display: none; }
.scanner-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame {
  position: absolute;
  inset: 20% 9%;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, .45);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .26);
  pointer-events: none;
}
.scan-frame span {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #ff5f6d, transparent);
  animation: scanLine 2.4s linear infinite;
}
@keyframes scanLine {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(150px); }
  100% { transform: translateY(0); }
}
.scanner-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 12px;
  font-size: .76rem;
  color: #fff;
  background: linear-gradient(0deg, rgba(0, 0, 0, .7), transparent);
}
.scan-photo {
  padding: 18px;
  text-align: center;
  border-radius: var(--r-lg);
  border: 1px dashed var(--input-border);
  background: var(--input-bg);
}
.scan-photo[hidden] { display: none; }
.scan-photo .hint { margin-bottom: 10px; }
.scan-manual { display: flex; gap: 8px; margin-top: 12px; }
.scan-manual input { flex: 1; min-height: 42px; }

.ocr-preview { margin-top: 12px; border-radius: var(--r-md); overflow: hidden; display: none; }
.ocr-preview img { display: block; width: 100%; max-height: 240px; object-fit: contain; background: rgba(0, 0, 0, .25); }

/* 识别结果面板（可修正） */
.ocr-result {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ocr-result input[type="text"] {
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  font-size: 1.08rem;
  letter-spacing: .06em;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
}
#ocrCandidates .chip { font-family: var(--mono); letter-spacing: .04em; }
#ocrConfidence { font-variant-numeric: tabular-nums; }

/* 照片查看 */
.photo-viewer-panel {
  position: relative;
  max-width: min(94vw, 900px);
  max-height: 88vh;
}
.photo-viewer-panel img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  border-radius: var(--r-lg);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .95);
}
.photo-viewer-close {
  position: absolute;
  top: -12px;
  right: -6px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  z-index: 2;
}

/* Toast */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 130;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(430px, calc(100vw - 28px));
  pointer-events: none;
}
.toast {
  padding: 11px 16px;
  border-radius: 14px;
  font-size: .85rem;
  color: var(--text);
  background: var(--glass-2);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow);
  animation: toastIn .26s var(--ease) both;
}
html[data-theme="light"] .toast { background: rgba(255, 255, 255, .92); }
.toast.ok { border-color: rgba(53, 211, 154, .5); }
.toast.err { border-color: rgba(255, 91, 91, .55); }
.toast.out { animation: toastOut .22s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------------- 登录 / 安装 ---------------- */
.page-auth { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.auth-wrap { width: 100%; display: grid; place-items: center; }
.auth-card { width: min(420px, 100%); padding: 26px 24px; border-radius: 28px; }
.install-card { width: min(760px, 100%); }
.brand-row { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.brand-row h1 { font-size: 1.18rem; }
.brand-row p { font-size: .8rem; margin-top: 2px; }
.brand-row .brand-mark { width: 50px; height: 50px; font-size: .92rem; border-radius: 16px; }
.stack { display: flex; flex-direction: column; gap: 13px; }
.form-grid .field-row { grid-column: 1 / -1; }

.alert {
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: .84rem;
  line-height: 1.6;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  margin: 12px 0;
}
.alert-error { border-color: rgba(255, 91, 91, .45); background: rgba(255, 91, 91, .12); color: #ffd9d9; }
.alert-ok { border-color: rgba(53, 211, 154, .45); background: rgba(53, 211, 154, .12); color: #d6fff0; }
.alert-warn { border-color: rgba(255, 176, 32, .42); background: rgba(255, 176, 32, .12); color: #ffeec9; }
html[data-theme="light"] .alert-error { color: #8d1020; }
html[data-theme="light"] .alert-ok { color: #0c5b42; }
html[data-theme="light"] .alert-warn { color: #6b4600; }

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}
.check-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--muted);
}
.check-list .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); }
.check-list li.pass .dot { background: var(--ok); box-shadow: 0 0 10px rgba(53, 211, 154, .7); }
.check-list li.fail .dot { background: var(--danger); }
.check-list li.fail { color: var(--danger); }

code {
  font-family: var(--mono);
  font-size: .86em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--glass-2);
}

/* ---------------- 后台骨架 ---------------- */
.admin-body { min-height: 100vh; }
.admin-shell { max-width: 1440px; margin: 0 auto; padding: 16px; }
.admin-layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 16px; align-items: start; }

.sidebar {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 32px);
  min-height: 460px;
  border-radius: var(--r-xl);
  padding: 14px 11px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-highlight);
  overflow: hidden;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.side-brand b { font-size: .94rem; display: block; }
.side-brand small { color: var(--muted-2); font-size: .7rem; }
.side-brand .brand-mark { width: 38px; height: 38px; font-size: .74rem; border-radius: 12px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; overflow-y: auto; padding-right: 2px; }
.side-nav::-webkit-scrollbar { width: 5px; }
.side-nav::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 99px; }
.side-group { margin-top: 10px; }
.side-group:first-child { margin-top: 0; }
.side-group-title {
  padding: 0 11px 6px;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: .86rem;
  text-align: left;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.side-link .ico { width: 17px; height: 17px; }
.side-link:hover { background: var(--glass); color: var(--text); }
.side-link.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 24px -16px rgba(228, 0, 43, .95);
}
.side-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.side-foot .btn { flex: 1 1 90px; }
.side-foot .icon-btn { flex: 0 0 36px; }
.side-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: .76rem;
  color: var(--muted-2);
}
.side-user b { display: block; font-size: .82rem; color: var(--text); }

/* 登记单（一车多项目） */
.record-item.is-group { align-items: flex-start; }
.re-count {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: .68rem;
  font-weight: 600;
  border-radius: 999px;
  color: var(--brand-2);
  background: var(--brand-soft);
  vertical-align: 2px;
}
.re-items {
  list-style: none;
  margin: 8px 0 0;
  padding: 8px;
  border-radius: var(--r-md);
  background: var(--input-bg);
  border: 1px dashed var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.re-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "name hours act" "meta meta meta";
  gap: 2px 10px;
  align-items: center;
  font-size: .82rem;
}
.re-item-name { grid-area: name; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.re-item-meta { grid-area: meta; color: var(--muted-2); font-size: .72rem; }
.re-item-hours { grid-area: hours; font-family: var(--mono); font-weight: 700; color: var(--brand-2); white-space: nowrap; }
.re-item-hours small { font-size: .66rem; opacity: .7; margin-left: 1px; }
.re-item-act { grid-area: act; display: flex; gap: 4px; }
.re-item-act .mini-btn { padding: 3px 8px; font-size: .72rem; }
.re-hours.re-total { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.re-hours.re-total em { font-style: normal; font-size: .62rem; color: var(--muted-2); }

@media (max-width: 640px) {
  .re-item { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name hours" "meta act"; }
  .re-item-act { justify-content: flex-end; }
  .re-items { padding: 7px; }
}

/* 后台：登记单合并行 */
tr[hidden] { display: none !important; }
.data-table tbody tr.row-group > td { background: var(--input-bg); }
.data-table tbody tr.row-group td:first-child { border-top-left-radius: var(--r-md); border-bottom-left-radius: var(--r-md); }
.row-group-detail > td { padding: 8px 12px 12px !important; background: var(--input-bg); }
.group-items { display: flex; flex-direction: column; gap: 6px; }
.group-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  font-size: .82rem;
}
.gi-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gi-cat { color: var(--muted-2); font-size: .74rem; }
.gi-hours { font-family: var(--mono); font-weight: 700; color: var(--brand-2); }
.gi-act { display: flex; gap: 6px; }
.gi-act button {
  padding: 3px 9px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-size: .74rem;
  cursor: pointer;
}
.gi-act button.danger { color: var(--danger); border-color: rgba(255, 91, 91, .35); }
@media (max-width: 900px) {
  .group-item { grid-template-columns: minmax(0, 1fr) auto auto; }
  .gi-cat { display: none; }
}

/* ---------------- 后台：安全中心 ---------------- */
.sec-me { display: flex; flex-direction: column; gap: 2px; }
.sec-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: .82rem;
}
.sec-row:last-child { border-bottom: 0; }
.sec-row span { color: var(--muted-2); flex: 0 0 auto; }
.sec-row b { font-weight: 600; text-align: right; word-break: break-all; }
.stat-card .value.sm { font-size: .9rem; font-family: var(--font); }

/* 站点 Logo 设置 */
.logo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.logo-preview {
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--input-bg);
  border: 1px dashed var(--glass-border);
}
.logo-preview .brand-mark { width: 64px; height: 64px; font-size: 1.1rem; border-radius: 18px; }
.logo-tools { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.logo-tools .field { width: 100%; }

/* ---------------- 后台：角色权限 ---------------- */
.perm-table { min-width: 520px; }
.perm-table th { text-align: center; white-space: nowrap; }
.perm-table th:first-child { text-align: left; }
.perm-table td { vertical-align: middle; }
.perm-table tr.perm-group td {
  background: var(--input-bg);
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--muted-2);
  padding: 6px 12px;
  font-weight: 600;
}
.perm-table td b { display: block; font-size: .86rem; }
.perm-table td .cell-sub { display: block; font-size: .72rem; color: var(--muted-2); }
.perm-table td[data-label="技师"],
.perm-table td[data-label="管理员"],
.perm-table td[data-label="站长"] { text-align: center; }
.perm-table .switch {
  display: inline-block;   /* label 默认是 inline，宽高不生效会导致开关点不到 */
  vertical-align: middle;
  margin: 0 auto;
}
@media (max-width: 640px) {
  .perm-table { min-width: 0; }
  .perm-table thead { display: none; }
  .perm-table tbody { display: flex; flex-direction: column; gap: 8px; }
  .perm-table tr { display: grid; grid-template-columns: minmax(0, 1fr) 54px 54px 54px; align-items: center; gap: 6px; }
  .perm-table tr.perm-group { display: block; }
  .perm-table td { padding: 6px 8px !important; border: 0 !important; }
  .perm-table td[data-label="技师"]::before,
  .perm-table td[data-label="管理员"]::before,
  .perm-table td[data-label="站长"]::before {
    content: attr(data-label);
    display: block;
    font-size: .62rem;
    color: var(--muted-2);
    text-align: center;
    margin-bottom: 2px;
  }
}

/* ---------------- 后台：外观主题 ---------------- */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}
.theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  text-align: left;
  border-radius: var(--r-md);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  transition: transform .18s var(--ease), border-color .18s, box-shadow .18s;
}
.theme-card:hover { transform: translateY(-2px); }
.theme-card.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-soft), var(--shadow);
}
.theme-swatch {
  height: 34px;
  margin-bottom: 6px;
  border-radius: 9px;
  background: linear-gradient(120deg, var(--sw1), var(--sw2) 55%, var(--sw3));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.theme-card b { font-size: .86rem; }
.theme-card small { color: var(--muted-2); font-size: .72rem; line-height: 1.35; }
.theme-card.is-active::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 9px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-size: .72rem;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.theme-bg-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.theme-bg-preview {
  width: 148px;
  height: 84px;
  flex: 0 0 auto;
  border-radius: var(--r-md);
  border: 1px solid var(--glass-border);
  background: var(--input-bg) center/cover no-repeat;
  display: grid;
  place-items: center;
  font-size: .72rem;
  color: var(--muted-2);
}
.theme-bg-preview.has-img { box-shadow: var(--shadow); }


.admin-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-top h1 { font-size: 1.18rem; }
.admin-top .sub { color: var(--muted-2); font-size: .78rem; margin-top: 2px; }
.admin-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.panel {
  border-radius: var(--r-xl);
  padding: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-highlight);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.panel-head h2 { font-size: .98rem; }
.admin-tab { display: none; }
.admin-tab.is-active { display: block; animation: rise .3s var(--ease) both; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat-card {
  padding: 14px 15px;
  border-radius: var(--r-lg);
  background: var(--glass);
  border: 1px solid var(--glass-border);
}
.stat-card .label { font-size: .7rem; color: var(--muted-2); letter-spacing: .08em; }
.stat-card .value { font-family: var(--mono); font-size: 1.62rem; font-weight: 700; line-height: 1.3; }
.stat-card .value small { font-size: .74rem; color: var(--muted); margin-left: 3px; font-family: var(--font); }
.stat-card.brand {
  background: linear-gradient(135deg, rgba(228, 0, 43, .22), rgba(255, 95, 109, .1));
  border-color: rgba(228, 0, 43, .32);
}

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.filter-bar .field { flex: 0 1 150px; }
.filter-bar .field.grow { flex: 1 1 220px; }
.filter-bar .field input,
.filter-bar .field select { min-height: 38px; padding: 6px 10px; font-size: .84rem; border-radius: 10px; }
.filter-bar .field > span { font-size: .74rem; }
.filter-bar .btn { align-self: flex-end; }
.split-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }

/* ---------------- 表格 ---------------- */
.table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .06);
}
html[data-theme="light"] .table-wrap { background: rgba(255, 255, 255, .35); }
table.data-table { width: 100%; border-collapse: collapse; font-size: .84rem; min-width: 720px; }
table.data-table th,
table.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data-table th {
  font-size: .72rem;
  letter-spacing: .06em;
  color: var(--muted-2);
  font-weight: 600;
  background: rgba(14, 20, 36, .92);
  position: sticky;
  top: 0;
  white-space: nowrap;
  z-index: 1;
}
html[data-theme="light"] table.data-table th { background: rgba(255, 255, 255, .9); }
table.data-table tbody tr { transition: background .15s; }
table.data-table tbody tr:hover { background: var(--glass); }
table.data-table tbody tr:last-child td { border-bottom: 0; }
table.data-table td.num { font-family: var(--mono); white-space: nowrap; font-size: .8rem; }
table.data-table .row-actions { display: flex; gap: 5px; flex-wrap: wrap; }
table.data-table .row-actions button {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  border-radius: 8px;
  padding: 3px 9px;
  font-size: .72rem;
  font-family: inherit;
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
table.data-table .row-actions button:hover { background: var(--brand-soft); border-color: rgba(228, 0, 43, .35); }
table.data-table .row-actions button.danger { color: var(--danger); border-color: rgba(255, 91, 91, .3); }
table.data-table .row-actions button.danger:hover { background: rgba(255, 91, 91, .12); }

.table-thumb {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--input-bg);
  cursor: zoom-in;
  display: block;
}
.table-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-empty {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1px dashed var(--glass-border);
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: .62rem;
}
.cell-sub { display: block; font-size: .7rem; color: var(--muted-2); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .7rem;
  border: 1px solid var(--glass-border);
  color: var(--muted);
  white-space: nowrap;
}
.tag.pending { color: #ffcf7a; border-color: rgba(255, 176, 32, .4); background: rgba(255, 176, 32, .12); }
.tag.confirmed { color: #79e8bf; border-color: rgba(53, 211, 154, .4); background: rgba(53, 211, 154, .12); }
.tag.returned { color: #ff9b9b; border-color: rgba(255, 91, 91, .4); background: rgba(255, 91, 91, .12); }
.tag.off { opacity: .55; }
html[data-theme="light"] .tag.pending { color: #7a5100; }
html[data-theme="light"] .tag.confirmed { color: #086347; }
html[data-theme="light"] .tag.returned { color: #8d1020; }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.pager button {
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-family: inherit;
  font-size: .8rem;
  cursor: pointer;
}
.pager button[disabled] { opacity: .4; cursor: not-allowed; }
.pager .cur { font-family: var(--mono); color: var(--text); }

/* ---------------- 字段矩阵 ---------------- */
.field-matrix {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--glass);
}
.matrix-head,
.matrix-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px 68px;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
}
.matrix-head {
  font-size: .7rem;
  letter-spacing: .08em;
  color: var(--muted-2);
  background: var(--glass);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.matrix-head span:first-child { text-align: left; }
.matrix-row { border-bottom: 1px solid var(--line); font-size: .84rem; }
.matrix-row:last-child { border-bottom: 0; }
.matrix-row .matrix-name { display: flex; align-items: center; gap: 8px; }
.matrix-row .matrix-fixed { font-size: .66rem; color: var(--muted-2); }
.matrix-row label { display: flex; justify-content: center; }
.matrix-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand); }
.matrix-row.is-disabled .matrix-req { opacity: .35; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.switch-row:last-child { border-bottom: 0; }
.switch-row .switch-text b { display: block; font-size: .88rem; }
.switch-row .switch-text small { color: var(--muted-2); font-size: .74rem; }
.switch {
  position: relative;
  display: inline-block;   /* 单独使用时（如表格内）宽高才生效，避免点不到 */
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
  vertical-align: middle;
}
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  transition: background .2s, border-color .2s;
  pointer-events: none;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted-2);
  transition: transform .2s var(--ease), background .2s;
}
.switch input:checked + span {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
}
.switch input:checked + span::after { transform: translateX(20px); background: #fff; }

.setting-block { padding: 4px 0 8px; }
.setting-block + .setting-block { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; }
.log-detail { max-width: 520px; font-size: .78rem; color: var(--muted); word-break: break-all; }

/* ---------------- 响应式：移动端 ---------------- */
@media (max-width: 999px) {
  body[data-view="entry"] .view-today,
  body[data-view="entry"] .view-stats,
  body[data-view="today"] .view-entry,
  body[data-view="today"] .view-stats,
  body[data-view="stats"] .view-entry,
  body[data-view="stats"] .view-today { display: none; }
  .side-col { display: flex; flex-direction: column; gap: 16px; }
}

@media (min-width: 1000px) {
  .tabsbar { display: none; }
  .shell { padding: 22px 22px 36px; max-width: 1360px; }
  .layout {
    grid-template-columns: minmax(0, 1.14fr) minmax(340px, .86fr);
    gap: 20px;
    align-items: start;
  }
  .view-entry { grid-column: 1; grid-row: 1; }
  /* 右列独立滚动：左侧表单再长也不会把右侧统计压下去 */
  .side-col {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: calc(var(--header-h) + 14px);
    max-height: calc(100vh - var(--header-h) - 34px);
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-right: 6px;
    scrollbar-width: thin;
  }
  .side-col::-webkit-scrollbar { width: 6px; }
  .side-col::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 99px; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .save-bar { position: static; background: transparent; border: 0; box-shadow: none; padding: 0; margin-top: 20px; backdrop-filter: none; }
  html[data-theme="light"] .save-bar { background: transparent; }
  .save-bar .btn-primary { --btn-h: 50px; }
  .view-today .card, .view-stats .card { border-radius: var(--r-xl); }
  .kpi b { font-size: 1.36rem; }
}

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; padding: 10px; }
  .side-brand { padding-bottom: 10px; margin-bottom: 8px; }
  .side-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-link { white-space: nowrap; padding: 8px 12px; font-size: .82rem; }
  .side-foot { margin-top: 8px; padding-top: 8px; }
  .admin-top { gap: 8px; }
  .admin-shell { padding: 12px; }
  .panel { padding: 14px; }
  .filter-bar .field { flex: 1 1 140px; }
}

@media (max-width: 720px) {
  .appbar-inner { padding: 7px 12px; }
  .brand-text small { display: none; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: .72rem; }
  .pill { padding: 5px 9px; font-size: .7rem; }
  .pill small { display: none; }
  .tabsbar { padding: 8px 12px 0; }
  .segmented { width: 100%; }
  .seg { padding: 8px 6px; font-size: .8rem; }
  .shell { padding: 12px 12px 26px; }
  .card { padding: 16px; border-radius: 22px; }
  .card-heading h1 { font-size: 1.12rem; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day-bars { height: 84px; }
  .save-bar {
    grid-template-columns: 1fr auto;
    bottom: 8px;
    padding: 8px;
    border-radius: 16px;
  }
  .save-bar .btn-primary { grid-column: 1; }
  .save-bar .btn-soft { grid-column: 2; }
  .save-bar .btn-ghost { display: none; }
  .record-item { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .re-thumb { width: 42px; height: 42px; }
  .modal { padding: 10px; }
  .modal-panel { padding: 15px; border-radius: 22px; }

  /* 表格转卡片 */
  table.data-table.cards { min-width: 0; }
  table.data-table.cards thead { display: none; }
  table.data-table.cards tbody { display: flex; flex-direction: column; gap: 9px; }
  table.data-table.cards tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 12px;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: var(--glass);
  }
  table.data-table.cards tbody tr:hover { background: var(--glass-2); }
  table.data-table.cards td {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    border: 0;
    font-size: .84rem;
    min-width: 0;
  }
  table.data-table.cards td::before {
    content: attr(data-label);
    font-size: .64rem;
    letter-spacing: .05em;
    color: var(--muted-2);
  }
  table.data-table.cards td[data-label=""]::before,
  table.data-table.cards td.cell-full::before { display: none; }
  table.data-table.cards td.cell-full { grid-column: 1 / -1; }
  table.data-table.cards td.num { font-size: .84rem; }
  table.data-table.cards td .re-actions { margin-top: 2px; }
  .table-wrap { border: 0; background: transparent; }
  .field-matrix .matrix-head, .field-matrix .matrix-row { padding: 8px 10px; grid-template-columns: minmax(0, 1fr) 56px 56px; }
  .matrix-head { font-size: .64rem; }
}

@media (max-width: 420px) {
  .brand-text b { font-size: .92rem; }
  .appbar-actions { gap: 4px; }
  .icon-btn { width: 32px; height: 32px; }
  .kpi b { font-size: 1.12rem; }
  .chip { padding: 6px 11px; font-size: .76rem; }
  .photo-tools { right: 6px; bottom: 6px; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb {
  background: rgba(160, 170, 200, .26);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-track { background: transparent; }

/* 打印 */
@media print {
  .bg-stage, .appbar, .tabsbar, .sidebar, .admin-actions, .filter-bar, .pager, .save-bar, .btn, .icon-btn, .chip-btn, .mini-btn { display: none !important; }
  body { background: #fff; color: #000; }
  .glass, .card, .panel { box-shadow: none; border: 1px solid #ddd; background: #fff; }
  .layout, .admin-layout { display: block; }
}











/* ==========================================================================
   分段步骤 / 数字步进 / 骨架屏 / 加载态（v2.12）
   ========================================================================== */

/* 登记表单分段标题（①车辆 ②项目 ③补充） */
.step-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0 -2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.step-head:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.step-head b {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: .76rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  flex: 0 0 auto;
}
.step-head span { font-weight: 700; font-size: .92rem; letter-spacing: .2px; }
.step-head i { font-style: normal; font-size: .74rem; color: var(--muted-2); }

/* 工时/数量 步进器 */
.stepper {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.stepper .input-affix { flex: 1 1 auto; min-width: 0; }
.step-btn {
  width: var(--ctl-h, 42px);
  min-width: 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background .16s var(--ease), transform .12s var(--ease);
}
.step-btn:hover { background: var(--glass-2); }
.step-btn:active { transform: scale(.94); }

/* 骨架屏 */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--glass-2);
  min-height: 14px;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
  animation: skeletonSweep 1.3s infinite;
}
html[data-theme="light"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .07), transparent);
}
@keyframes skeletonSweep { to { transform: translateX(100%); } }
.skeleton-lines { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.skeleton-lines .skeleton:nth-child(1) { width: 42%; height: 15px; }
.skeleton-lines .skeleton:nth-child(2) { width: 74%; height: 11px; }
.skeleton-lines .skeleton:nth-child(3) { width: 58%; height: 11px; }

/* 按钮加载态 */
.btn[data-loading="1"], .chip-btn[data-loading="1"] { opacity: .72; pointer-events: none; }
.btn[data-loading="1"]::after {
  content: "";
  width: 13px;
  height: 13px;
  margin-left: 6px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  vertical-align: -2px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
  .btn[data-loading="1"]::after { animation: none; border-right-color: currentColor; }
}

/* 触控优化：小屏步进器按钮更宽 */
@media (max-width: 520px) {
  .step-btn { width: 44px; }
  .step-head i { display: none; }
}

/* 打印：隐藏交互元素 */
@media print {
  .appbar-actions, .tabsbar, .dock-save, .side-nav, .admin-top .admin-actions { display: none !important; }
  .glass, .card { box-shadow: none !important; backdrop-filter: none !important; }
}



/* ==========================================================================
   后台 · 移动端专用布局（底部导航 + 抽屉 + 粘性标题）
   ========================================================================== */
.m-head, .m-tabbar, .m-sheet { display: none; }

@media (max-width: 900px) {
  .sidebar { display: none !important; }
  .admin-shell { padding: 0 10px 92px; }
  .admin-layout { display: block; }

  /* 顶部品牌条（吸顶） */
  .m-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 40;
    margin: 0 -10px 8px;
    padding: 9px 12px calc(9px + env(safe-area-inset-top, 0px));
    background: var(--glass-2);
    border-bottom: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    backdrop-filter: blur(22px) saturate(170%);
  }
  .m-head-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
  .m-head-brand b { display: block; font-size: .88rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
  .m-head-brand small { display: block; font-size: .68rem; color: var(--muted-2); line-height: 1.2; }
  .m-head-brand .brand-mark { width: 32px; height: 32px; font-size: .68rem; border-radius: 10px; }
  .m-head-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
  .m-head-actions .icon-btn { width: 36px; height: 36px; }

  /* 标题行吸顶在品牌条下方 */
  .admin-top {
    position: sticky;
    top: 54px;
    z-index: 30;
    margin: 0 -10px 10px;
    padding: 8px 12px;
    background: var(--glass-2);
    border-bottom: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    flex-wrap: nowrap;
  }
  .admin-top > div:first-child { min-width: 0; }
  .admin-top h1 { font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .admin-top .sub { display: none; }
  .admin-top .admin-actions { flex: 0 0 auto; gap: 6px; }
  .admin-top .mini-input { max-width: 118px; }
  .admin-top .btn { min-height: 34px; padding: 0 10px; font-size: .78rem; }

  .panel { padding: 12px; border-radius: 18px; }
  .panel-head { margin-bottom: 8px; gap: 8px; }
  .panel-head h2 { font-size: .92rem; }
  .admin-main { gap: 10px; }

  /* 筛选区：横向滚动一行 */
  .filter-bar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-bar .field { flex: 0 0 132px; min-width: 132px; }
  .filter-bar .field .label { font-size: .7rem; }
  .filter-bar .field input, .filter-bar .field select { min-height: 36px; font-size: .82rem; }
  .filter-bar .btn { flex: 0 0 auto; min-height: 36px; }

  /* 卡片化表格 */
  .data-table.cards tbody tr { border-radius: 14px; padding: 10px 12px; }
  .data-table.cards tbody td { padding: 3px 0; font-size: .84rem; }
  .data-table.cards tbody td::before { font-size: .66rem; }
  .data-table.cards tbody td.cell-full { padding-top: 8px !important; }

  /* 行内操作：大按钮 */
  .row-actions {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
    gap: 6px;
    width: 100%;
  }
  .row-actions button {
    min-height: 38px;
    padding: 0 8px;
    font-size: .8rem;
    border-radius: 10px;
    justify-content: center;
  }
  .gi-act button { min-height: 34px; padding: 4px 12px; font-size: .78rem; }

  .pager { justify-content: center; gap: 10px; }
  .pager button { min-height: 38px; min-width: 82px; font-size: .82rem; }

  .stat-grid { gap: 8px; }
  .stat-card { padding: 11px 12px; border-radius: 16px; }
  .stat-card .value { font-size: 1.22rem; }

  .modal { align-items: flex-end; padding: 0; }
  .modal-panel { width: 100%; max-width: 100%; border-radius: 20px 20px 16px 16px; max-height: 88vh; overflow-y: auto; }
}

@media (max-width: 900px) {
  /* ---------- 底部导航 ---------- */
  .m-tabbar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--glass-2);
    border-top: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 -12px 30px -22px rgba(0, 0, 0, .9);
  }
  .m-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 50px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font-size: .64rem;
    letter-spacing: .02em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .16s var(--ease), background .16s var(--ease);
  }
  .m-tab .ico { width: 21px; height: 21px; }
  .m-tab.is-active { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
  .m-tab:active { transform: scale(.96); }

  /* ---------- 「更多」抽屉 ---------- */
  .m-sheet { display: block; position: fixed; inset: 0; z-index: 70; }
  .m-sheet[hidden] { display: none; }
  .m-sheet-mask {
    position: absolute;
    inset: 0;
    background: rgba(4, 8, 18, .55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }
  .m-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 76vh;
    overflow-y: auto;
    padding: 8px 14px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px 22px 0 0;
    background: var(--bg-2);
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -20px 50px -24px rgba(0, 0, 0, .85);
  }
  .m-sheet-grip {
    width: 42px;
    height: 4px;
    border-radius: 99px;
    background: var(--glass-border);
    margin: 2px auto 10px;
  }
  .m-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .m-sheet-head b { font-size: .92rem; }
  .m-sheet-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .m-sheet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 76px;
    padding: 10px 4px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--text);
    font-size: .72rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .m-sheet-item .ico { width: 22px; height: 22px; color: var(--brand-2); }
  .m-sheet-item.is-primary { background: var(--brand-soft); border-color: rgba(228, 0, 43, .32); }
  .m-sheet-item:active { transform: scale(.97); }
}

@media (max-width: 420px) {
  .m-sheet-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-shell { padding: 0 8px 88px; }
  .m-head, .admin-top { margin-left: -8px; margin-right: -8px; }
}

@media (min-width: 901px) {
  .m-tabbar, .m-sheet, .m-head { display: none !important; }
}


/* 登记页：小屏隐藏官网入口，避免顶栏拥挤 */
@media (max-width: 420px) {
  .appbar-actions .hide-sm { display: none; }
}

/* ==========================================================================
   后台 · 官网内容编辑器（动态行）
   ========================================================================== */
.ld-rows { display: flex; flex-direction: column; gap: 8px; }
.ld-row {
  display: grid;
  grid-template-columns: 88px 72px minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
}
.ld-row.grow { grid-template-columns: minmax(0, 1fr); }
.ld-row-feature { grid-template-columns: 96px 150px minmax(0, 1fr) 52px 32px; }
.ld-row-faq { grid-template-columns: 180px minmax(0, 1fr) 32px; align-items: start; }
.ld-in {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  font-size: .82rem;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--input-border);
  border-radius: 9px;
  font-family: inherit;
}
.ld-in.grow { min-width: 0; }
.ld-in:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
textarea.ld-in { resize: vertical; line-height: 1.5; }
.ld-row-del {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(255, 91, 91, .32);
  background: rgba(255, 91, 91, .1);
  color: var(--danger);
  font-size: .78rem;
  cursor: pointer;
}
.ld-row-del:hover { background: rgba(255, 91, 91, .18); }

/* 行内迷你开关 */
.ld-mini-switch { position: relative; display: inline-block; width: 38px; height: 22px; cursor: pointer; }
.ld-mini-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ld-mini-switch span {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--glass-2);
  border: 1px solid var(--input-border);
  transition: background .18s var(--ease);
}
.ld-mini-switch span::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  left: 2px; top: 2px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .18s var(--ease), background .18s;
}
.ld-mini-switch input:checked + span { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; }
.ld-mini-switch input:checked + span::after { transform: translateX(16px); background: #fff; }

@media (max-width: 900px) {
  .ld-row { grid-template-columns: 74px 62px minmax(0, 1fr) 32px; }
  .ld-row-feature { grid-template-columns: 84px minmax(0, 1fr) 52px 32px; }
  .ld-row-feature .ld-in[data-k="desc"] { grid-column: 1 / -2; }
  .ld-row-faq { grid-template-columns: minmax(0, 1fr) 32px; }
  .ld-row-faq .ld-in[data-k="a"] { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .ld-row, .ld-row-feature { grid-template-columns: minmax(0, 1fr) 32px; }
  .ld-row .ld-in, .ld-row-feature .ld-in { grid-column: 1 / -1; }
  .ld-row .ld-mini-switch { grid-column: 1; justify-self: start; }
  .ld-row-del { grid-row: 1; grid-column: 2; }
}

