:root {
  --bg: #0b0d11;
  --bg-soft: #101318;
  --surface: #151920;
  --surface-2: #1b2029;
  --line: #262c37;
  --line-soft: #1f242d;
  --text: #e9ecf1;
  --text-dim: #a3abb8;
  --muted: #79818f;
  --accent: #d5001c;
  --accent-soft: rgba(213, 0, 28, 0.16);
  --ok: #2ecc71;
  --ok-soft: rgba(46, 204, 113, 0.14);
  --warn: #f5a623;
  --warn-soft: rgba(245, 166, 35, 0.14);
  --bad: #ef4444;
  --bad-soft: rgba(239, 68, 68, 0.14);
  --info: #4aa8ff;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans SC',
    'Microsoft YaHei', sans-serif;
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body {
  background: radial-gradient(1200px 500px at 50% -10%, rgba(213, 0, 28, 0.12), transparent 65%),
    var(--bg);
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  background: linear-gradient(180deg, rgba(11, 13, 17, 0.98), rgba(11, 13, 17, 0.82) 70%, transparent);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar.hidden {
  display: none;
}
.topbar .brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.topbar .brand .name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar .brand .name::before {
  content: '';
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent);
}
.topbar .brand .sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 12px;
}
.topbar .spacer {
  flex: 1;
}

.view {
  flex: 1;
  padding: 4px 16px calc(96px + var(--safe-bottom));
  outline: none;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + var(--safe-bottom));
  background: rgba(14, 17, 22, 0.94);
  border-top: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}
.tabbar a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0 4px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  border-radius: 12px;
  transition: color 0.15s;
}
.tabbar a.active {
  color: var(--text);
}
.tabbar a.active .ico {
  color: var(--accent);
}
.tabbar a.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.tabbar .ico {
  color: var(--muted);
}

/* ---------------- 通用 ---------------- */
h1,
h2,
h3,
p {
  margin: 0;
}
.ico {
  flex: none;
  display: block;
}
.muted {
  color: var(--muted);
}
.dim {
  color: var(--text-dim);
}
.small {
  font-size: 12.5px;
}
.tiny {
  font-size: 11.5px;
}
.mt8 {
  margin-top: 8px;
}
.mt12 {
  margin-top: 12px;
}
.mt16 {
  margin-top: 16px;
}
.mt24 {
  margin-top: 24px;
}
.row {
  display: flex;
  align-items: center;
}
.gap8 {
  gap: 8px;
}
.gap12 {
  gap: 12px;
}
.between {
  justify-content: space-between;
}
.wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1;
  min-width: 0;
}
.center {
  justify-content: center;
}
.ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hr {
  height: 1px;
  background: var(--line-soft);
  margin: 14px 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 2px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.4px;
}
.section-title .link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

/* ---------------- 卡片 ---------------- */
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}
.card + .card {
  margin-top: 12px;
}
.card.tight {
  padding: 12px 14px;
}
.card.flat {
  background: var(--surface);
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------------- 首页 ---------------- */
.hero {
  position: relative;
  border-radius: 20px;
  padding: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #1c0a0e 0%, #151920 45%, #12161c 100%);
  border: 1px solid var(--line-soft);
}
.hero::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(213, 0, 28, 0.35), transparent 65%);
}
.hero .ev-name {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.hero .ev-meta {
  color: var(--text-dim);
  font-size: 12.5px;
  margin-top: 4px;
}
.hero .chips {
  margin-top: 14px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}
.kpi .v {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kpi .k {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}
.kpi.good .v {
  color: var(--ok);
}
.kpi.warn .v {
  color: var(--warn);
}
.kpi.bad .v {
  color: var(--bad);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.12s, border-color 0.15s;
}
.action:active {
  transform: scale(0.985);
}
.action .a-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: #ff5a6a;
}
.action .a-txt b {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.action .a-txt span {
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------------- 芯片 / 胶囊 ---------------- */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.chip .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  opacity: 0.7;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.pill.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.pill.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.pill.neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}
.pill.accent {
  background: var(--accent-soft);
  color: #ff6b78;
}

/* ---------------- 按钮 ---------------- */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
  min-height: 46px;
}
.btn:active {
  transform: scale(0.98);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.ghost {
  background: transparent;
}
.btn.danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ff7b7b;
}
.btn.small {
  padding: 8px 12px;
  font-size: 12.5px;
  min-height: 36px;
  border-radius: 10px;
}
.btn.block {
  width: 100%;
}
.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon-btn:active {
  background: var(--surface-2);
}
.rot45 {
  transform: rotate(45deg);
}

/* ---------------- 表单 ---------------- */
.input,
.select,
textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  min-height: 46px;
}
.input:focus,
textarea:focus,
.select:focus {
  border-color: var(--accent);
}
.input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.55;
}
.field-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px 2px;
  font-weight: 500;
}
.field + .field {
  margin-top: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid.three {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.scan-input {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.6px;
  min-height: 56px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}
.switch {
  position: relative;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: var(--line);
  border: none;
  cursor: pointer;
  flex: none;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s;
}
.switch.on {
  background: var(--accent);
}
.switch.on::after {
  transform: translateX(19px);
}

/* ---------------- 列表 ---------------- */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rowitem {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.rowitem:active {
  background: var(--surface-2);
}
.rowitem .main {
  min-width: 0;
  flex: 1;
}
.rowitem .t1 {
  font-size: 14.5px;
  font-weight: 600;
}
.rowitem .t2 {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.rowitem .right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* 详情页元信息 */
.meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.meta-row {
  display: flex;
  gap: 6px;
  font-size: 12.5px;
  min-width: 0;
  max-width: 100%;
}
.meta-k {
  color: var(--muted);
  flex: none;
}
.meta-v {
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ---------------- 磁贴式首页 ---------------- */
.home-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px 2px;
}
.home-ev {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.home-ev-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-ev-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-height: 100px;
  padding: 14px;
  border: none;
  border-radius: 18px;
  color: #fff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  transition: transform 0.12s ease;
}
.tile:active {
  transform: scale(0.975);
}
.tile::after {
  content: '';
  position: absolute;
  right: -30px;
  bottom: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
}
.tile.full {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  min-height: 104px;
}
.tile.amber {
  background: linear-gradient(155deg, #f7b81c, #dd8f00);
}
.tile.teal {
  background: linear-gradient(155deg, #14b6a3, #078a7d);
}
.tile.red {
  background: linear-gradient(155deg, #e11334, #ad0018);
}
.tile.blue {
  background: linear-gradient(155deg, #3a82ff, #1250c9);
}
.t-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  flex: none;
  position: relative;
  z-index: 1;
}
.tile.full .t-ico {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}
.t-txt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  z-index: 1;
  min-width: 0;
}
.t-label {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.6px;
  line-height: 1.2;
}
.tile.full .t-label {
  font-size: 19px;
}
.t-sub {
  font-size: 11.5px;
  font-weight: 500;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-foot {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}


/* ---------------- 赛事/分站照片方块 ---------------- */
.logo-box {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-dim);
  font-family: inherit;
}
.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.logo-box .ph {
  font-weight: 800;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0.3px;
}
.logo-box:active {
  opacity: 0.85;
}
.logo-add {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.6);
  border-top-left-radius: 7px;
  display: grid;
  place-items: center;
  color: #fff;
  pointer-events: none;
}

/* ---------------- 轮胎登记总览 ---------------- */
.ev-banner {
  border-radius: 16px;
  padding: 14px 16px;
  margin-top: 6px;
  color: #1c1500;
  background: linear-gradient(135deg, #f9c42b, #e09400);
}
.ev-banner .b-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.4px;
}
.ev-banner .b-sub {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.72;
  margin-top: 3px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 11.5px;
  color: var(--muted);
  margin: 12px 2px 2px;
}
.legend-hint {
  margin-left: auto;
  font-size: 10.5px;
  color: #5f6672;
}
.legend .lg {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
}
.lg.ok,
.dot-st.ok {
  background: #16a34a;
}
.lg.low,
.dot-st.low {
  background: #eab308;
}
.lg.over,
.dot-st.over {
  background: #dc2626;
}
.lg.none,
.dot-st.none {
  background: #4a5260;
}

.car-card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 12px 12px 8px;
  margin-top: 10px;
  cursor: pointer;
}
.car-card:active {
  border-color: var(--line);
}
.car-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
}
.car-no {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.07);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  flex: none;
}
.car-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.car-info b {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.car-info span {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.car-sum {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
  flex: none;
}
.car-sum b {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.car-sum span {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}
.car-sum.ok b {
  color: #4ade80;
}
.car-sum.low b {
  color: #fbbf24;
}
.car-sum.over b {
  color: #f87171;
}
.car-chev {
  color: var(--muted);
  display: flex;
  flex: none;
}
.chev-r {
  transform: rotate(180deg);
}

.matrix-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -2px;
  padding: 0 2px;
}
table.matrix {
  border-collapse: separate;
  border-spacing: 5px;
  width: 100%;
}
table.matrix th.corner {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  padding: 0 4px 2px 2px;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 2;
  white-space: nowrap;
}
table.matrix th.col {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  padding: 0 2px 2px;
  white-space: nowrap;
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.matrix th.rowh {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: left;
  white-space: nowrap;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 2;
  padding-right: 6px;
}
table.matrix td.cell {
  min-width: 50px;
  height: 44px;
  border-radius: 10px;
  text-align: center;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
table.matrix td.cell b {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
td.cell.ok {
  background: #16a34a;
  color: #fff;
}
td.cell.low {
  background: #eab308;
  color: #241c00;
}
td.cell.over {
  background: #dc2626;
  color: #fff;
}
td.cell.none {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-dim);
}

/* 登记抽屉里的已登记列表 */
.reg-list {
  margin-top: 6px;
}
.reg-set {
  margin-top: 10px;
}
.reg-set-head {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 2px;
}
.reg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 2px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  cursor: pointer;
}
.reg-row:last-child {
  border-bottom: none;
}
.reg-bc {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reg-ses {
  font-size: 11.5px;
  color: var(--muted);
  flex: none;
}
.dot-st {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.warn-box {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.45);
}
.warn-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fbbf24;
}
.warn-text {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
}
.divider-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}
.divider-label::before,
.divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.logo-preview {
  width: 132px;
  height: 64px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
  padding: 4px;
}
.logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.logo-preview span {
  color: #777;
  font-size: 10.5px;
  text-align: center;
  padding: 0 6px;
  line-height: 1.4;
}
.pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
}
.pick-row input[type='checkbox'] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  flex: none;
}
.pick-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pick-main b {
  font-size: 14px;
  font-weight: 600;
}
.pick-main small {
  font-size: 11.5px;
  color: var(--muted);
}
.edit-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin: 10px 0;
  background: var(--bg-soft);
}

/* ---------------- 进度 ---------------- */
.bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ok);
  transition: width 0.25s;
}
.bar.warn > i {
  background: var(--warn);
}
.bar.bad > i {
  background: var(--bad);
}
.bar.accent > i {
  background: var(--accent);
}
.quota-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}
.quota-row .bar {
  flex: 1;
}
.quota-row b {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  min-width: 52px;
  text-align: right;
}

/* 圆环 */
.ring {
  --p: 0;
  --c: var(--ok);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex: none;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0);
  display: grid;
  place-items: center;
  position: relative;
}
.ring::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--surface);
}
.ring span {
  position: relative;
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------------- 扫码结果 ---------------- */
.result-panel {
  border-radius: 20px;
  padding: 22px 18px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid var(--line);
  transition: background 0.2s, border-color 0.2s;
}
.result-panel.idle {
  background: var(--surface);
}
.result-panel.ok {
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.2), rgba(46, 204, 113, 0.06));
  border-color: rgba(46, 204, 113, 0.45);
}
.result-panel.warn {
  background: linear-gradient(180deg, rgba(245, 166, 35, 0.2), rgba(245, 166, 35, 0.06));
  border-color: rgba(245, 166, 35, 0.45);
}
.result-panel.bad {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.06));
  border-color: rgba(239, 68, 68, 0.45);
}
.result-panel .big {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.15;
}
.result-panel.ok .big {
  color: #4ade80;
}
.result-panel.warn .big {
  color: #fbbf24;
}
.result-panel.bad .big {
  color: #f87171;
}
.result-panel .sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
}
.result-panel .barcode {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 12px;
  letter-spacing: 1px;
}
.result-panel .ico-big {
  margin: 0 auto 10px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
}

/* ---------------- 检查项 ---------------- */
.check-group {
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.check-group > summary {
  list-style: none;
  padding: 14px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  user-select: none;
}
.check-group > summary::-webkit-details-marker {
  display: none;
}
.check-group > summary .count {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.check-group[open] > summary {
  border-bottom: 1px solid var(--line-soft);
}
.check-group > summary .chev {
  transition: transform 0.18s;
  transform: rotate(-90deg);
  color: var(--muted);
}
.check-group[open] > summary .chev {
  transform: rotate(90deg);
}
.check-group .items {
  padding: 6px 10px 10px;
}

.citem {
  padding: 10px 4px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.citem:last-child {
  border-bottom: none;
}
.citem .c-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.citem .c-label {
  flex: 1;
  font-size: 14px;
  line-height: 1.45;
}
.citem .c-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}
.citem .c-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.seg {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px;
  gap: 2px;
}
.seg button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 9px;
  border-radius: 8px;
  cursor: pointer;
  min-width: 44px;
}
.seg button.on.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.seg button.on.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.seg button.on.none {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}
.citem .remark-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
}
.citem .remark-btn.has {
  color: var(--warn);
  border-color: rgba(245, 166, 35, 0.45);
}
.citem .remark-btn .dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
}
.citem .remark-preview {
  font-size: 12px;
  color: var(--warn);
  margin-top: 6px;
  background: var(--warn-soft);
  border-radius: 8px;
  padding: 7px 9px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.citem .value-input {
  margin-top: 8px;
  max-width: 220px;
  min-height: 40px;
  padding: 9px 12px;
  font-size: 14px;
}
.thumb-strip {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
}
.thumb-strip img {
  width: 58px;
  height: 46px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.sticky-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(62px + var(--safe-bottom));
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(180deg, rgba(11, 13, 17, 0.2), rgba(11, 13, 17, 0.97) 40%);
  backdrop-filter: blur(10px);
  display: flex;
  gap: 10px;
  z-index: 20;
}

/* ---------------- 抽屉 ---------------- */
body.sheet-open {
  overflow: hidden;
}
.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  transition: opacity 0.18s;
}
.sheet-wrap.on {
  opacity: 1;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}
.sheet {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  border-top: 1px solid var(--line);
  padding: 8px 18px calc(16px + var(--safe-bottom));
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: translateY(18px);
  transition: transform 0.2s;
  box-shadow: var(--shadow);
}
.sheet-wrap.on .sheet {
  transform: none;
}
.sheet.tall {
  max-height: 94vh;
}
.sheet-grip {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  margin: 4px auto 10px;
}
.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
}
.sheet-title {
  font-size: 17px;
  font-weight: 700;
  flex: 1;
}
.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 8px;
}
.sheet-foot {
  display: flex;
  gap: 10px;
  padding-top: 12px;
}
.sheet-foot .btn {
  flex: 1;
}
.confirm-msg {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-dim);
  padding: 4px 2px 8px;
}

/* 签字 */
.sig-pad {
  width: 100%;
  display: block;
  margin-top: 10px;
  background: #0a0c10;
  border: 1px dashed var(--line);
  border-radius: 12px;
  touch-action: none;
  cursor: crosshair;
}

/* 相机 */
.scanner-box {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 3 / 4;
  max-height: 58vh;
}
.scanner-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scanner-frame {
  position: absolute;
  inset: 18% 10%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35);
}
.scanner-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  text-align: center;
  font-size: 12.5px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  padding: 0 16px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + var(--safe-bottom));
  transform: translate(-50%, 12px);
  background: rgba(28, 32, 41, 0.98);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 120;
  max-width: 86vw;
  text-align: center;
  box-shadow: var(--shadow);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.bad {
  border-color: rgba(239, 68, 68, 0.5);
  color: #ffb4b4;
}
.toast.ok {
  border-color: rgba(46, 204, 113, 0.5);
  color: #b7f7cd;
}

/* 空状态 */
.empty {
  text-align: center;
  padding: 40px 18px;
  color: var(--muted);
}
.empty .e-ico {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  color: var(--text-dim);
}
.empty h3 {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.empty p {
  font-size: 12.5px;
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto 16px;
}

/* 隐藏的扫码枪输入框 */
.hid-kbd {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  caret-color: transparent;
  border: none;
  padding: 0;
  font-size: 16px;
  background: transparent;
  color: transparent;
  pointer-events: none;
}
.hid-sink {
  position: fixed;
  left: -100px;
  bottom: 0;
  width: 10px;
  height: 10px;
  opacity: 0;
  border: none;
  padding: 0;
  font-size: 16px;
}

/* 扫码悬浮提示 */
.scan-fab {
  position: fixed;
  right: 16px;
  bottom: calc(78px + var(--safe-bottom));
  z-index: 35;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(213, 0, 28, 0.45);
  cursor: pointer;
}

/* 表格 */
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.data th,
table.data td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line-soft);
}
table.data th {
  color: var(--muted);
  font-weight: 500;
  font-size: 11.5px;
}
table.data td.num {
  font-variant-numeric: tabular-nums;
}

/* 小标签组 */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* 分页/段控 */
.tabs2 {
  display: flex;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 4px;
  margin: 10px 0 14px;
}
.tabs2 button {
  flex: 1;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 8px;
  border-radius: 9px;
  cursor: pointer;
}
.tabs2 button.on {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

/* 页面进入动画 */
.view > * {
  animation: fadeUp 0.22s ease both;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 桌面（浏览器预览）适配 */
@media (min-width: 820px) {
  .actions {
    grid-template-columns: repeat(4, 1fr);
  }
  .kpis {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

.computed-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.computed-box b {
  font-size: 17px;
  color: var(--accent);
}

/* 实测总重（车重 + 车手重量） */
.weight-box {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.weight-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.weight-row .input {
  flex: 1;
  text-align: right;
}
.weight-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
.weight-total b {
  font-size: 18px;
  color: var(--accent);
}

/* 当前分站高亮 */
.rowitem.current {
  border-color: rgba(229, 30, 42, 0.55);
  background: linear-gradient(90deg, rgba(229, 30, 42, 0.14), rgba(229, 30, 42, 0.03));
  box-shadow: inset 3px 0 0 var(--accent);
}
.rowitem.current .t1 {
  color: #fff;
  font-weight: 700;
}
