:root {
  --bg: #030814;
  --header: #050e1e;
  --panel: #071325;
  --panel2: #0b1b31;
  --field: #040d1b;
  --line: #223b57;
  --line2: #3b5e7f;
  --sky: #5dd6ff;
  --sky2: #b9e8ff;
  --silver: #dbe8f8;
  --text: #edf5ff;
  --soft: #c5d7ec;
  --muted: #9ab5d5;
  --muted2: #6d8caf;
  --gold: #ffc857;
  --danger: #ff5c72;
  --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; padding: 0; background: var(--bg); color: var(--text); }
body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 14px;
  padding-top: calc(58px + var(--safe-top));
  padding-bottom: calc(62px + var(--safe-bottom));
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.appbar {
  position: fixed;
  left: 0; right: 0; top: 0;
  z-index: 20;
  height: calc(58px + var(--safe-top));
  padding: calc(8px + var(--safe-top)) 14px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(5, 14, 30, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brandmark {
  width: 30px; height: 30px; flex: 0 0 30px;
  border: 1px solid rgba(93, 214, 255, .5);
  border-radius: 8px;
  background: #0a2340;
  position: relative;
  overflow: hidden;
}
.brandmark span {
  position: absolute;
  top: 6px; width: 7px; height: 19px;
  transform: skew(-22deg);
  background: var(--sky);
}
.brandmark span:first-child { left: 7px; }
.brandmark span:last-child { left: 16px; background: var(--silver); }
.brandtext { min-width: 0; flex: 1; }
.brandline { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; overflow: hidden; }
.brandline strong { font-size: 17px; letter-spacing: .1px; }
.brandline em { font-style: normal; color: var(--sky); font-size: 10px; letter-spacing: .4px; }
.brandtext small { display: block; color: var(--muted); font-size: 9px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statusbox { text-align: right; flex: 0 0 auto; }
.statusbox span { display: block; font-family: Consolas, monospace; font-size: 10px; font-weight: 700; }
.statusbox span.ok { color: var(--sky); }
.statusbox span.warn { color: var(--gold); }
.statusbox span.error { color: var(--danger); }
.statusbox small { display: block; color: var(--muted2); font-family: Consolas, monospace; font-size: 8px; margin-top: 2px; }

main { max-width: 960px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }
.view-inner { padding: 12px 12px 24px; }
.page-title { margin: 2px 0 0; font-size: 21px; }
.eyebrow { color: var(--muted2); font-family: Consolas, monospace; font-size: 9px; letter-spacing: 1.4px; }

.section-head { display: flex; align-items: center; gap: 8px; margin: 18px 2px 7px; }
.section-head span { color: var(--sky); font-family: Consolas, monospace; font-size: 10px; font-weight: 700; }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.section-head b { margin-left: auto; color: var(--sky); font-family: Consolas, monospace; font-size: 12px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px;
  margin-bottom: 9px;
}
.field { display: block; margin: 9px 0; }
.field > span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
input[type=number], input[type=text], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--soft);
  padding: 9px 10px;
  outline: none;
  font-size: 14px;
}
input[type=number]:focus, input[type=text]:focus, select:focus, textarea:focus { border-color: var(--sky); }
input:disabled { opacity: .38; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
input[type=checkbox] {
  appearance: none;
  width: 17px; height: 17px;
  border: 1px solid #6d8caf;
  border-radius: 4px;
  background: #071325;
  vertical-align: -3px;
  margin: 0;
  position: relative;
  flex: 0 0 17px;
}
input[type=checkbox]:checked { background: var(--sky); border-color: var(--sky); }
input[type=checkbox]:checked::after {
  content: "";
  position: absolute; left: 5px; top: 1px;
  width: 4px; height: 9px;
  border: solid #03101f; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type=range] {
  width: 100%;
  height: 26px;
  accent-color: var(--sky);
  background: transparent;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: var(--field);
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px;
  font-size: 12px;
}
.segmented button.active { background: #132f4e; color: var(--sky); font-weight: 700; }

.driver-list { display: flex; flex-direction: column; gap: 8px; }
.driver-card {
  background: #0c1c30;
  border: 1px solid #1d3a55;
  border-radius: 9px;
  padding: 9px;
  position: relative;
}
.driver-card::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--dcolor, var(--sky));
}
.driver-top { display: flex; gap: 7px; align-items: center; margin-left: 5px; }
.driver-top .dindex { color: var(--dcolor); font-family: Consolas, monospace; font-size: 10px; font-weight: 700; }
.driver-top input.name { flex: 1; padding: 7px 8px; font-size: 13px; }
.driver-top button.remove {
  border: 0; background: transparent; color: var(--muted2);
  font-size: 18px; width: 26px; height: 28px; padding: 0;
}
.driver-fields { display: grid; grid-template-columns: 1fr 1fr 78px; gap: 7px; margin: 8px 0 0 5px; }
.driver-fields label { display: block; }
.driver-fields label span { display: block; color: var(--muted2); font-size: 9px; margin-bottom: 3px; }
.driver-fields input { padding: 7px 8px; font-size: 13px; }
.ballast-badge {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(93,214,255,.3);
  border-radius: 7px;
  color: var(--sky2);
  font-family: Consolas, monospace;
  font-size: 12px;
  background: rgba(93,214,255,.07);
}
.hintline { color: var(--muted2); font-size: 10px; line-height: 1.45; margin: 7px 0 0; }
.hintline.strong { color: var(--muted); }
.wide { width: 100%; }

.toggle-line {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding-top: 11px; border-top: 1px solid #17304a;
}
.toggle-line > span { flex: 1; color: var(--muted); font-size: 12px; }
.toggle-line > input[type=number] { width: 72px; text-align: right; padding: 7px 8px; font-size: 13px; }
.range-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.range-head b { color: var(--sky); font-family: Consolas, monospace; }

.advanced summary {
  list-style: none;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary span { color: var(--sky); font-family: Consolas, monospace; font-size: 10px; font-weight: 700; }
.advanced summary strong { font-size: 15px; }
.advanced summary i { margin-left: auto; font-style: normal; color: var(--muted2); font-size: 10px; }
.advanced-grid { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
.param-field { border-top: 1px solid #142b43; padding-top: 9px; }
.param-field:first-child { border-top: 0; padding-top: 2px; }
.param-field label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.param-input { position: relative; }
.param-input input { padding-right: 40px; text-align: right; }
.param-input .unit {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted2); font-family: Consolas, monospace; font-size: 9px;
  pointer-events: none;
}

.btn {
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: #0c1f35;
  color: var(--soft);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
}
.btn.primary { background: var(--sky); color: #03101f; border-color: var(--sky); }
.btn:active { opacity: .75; }
.btn.danger { border-color: rgba(255,92,114,.55); color: var(--danger); }
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.footnote { text-align: center; color: var(--muted2); font-size: 9px; margin: 9px 0 0; }
.error-banner {
  background: rgba(255,92,114,.1);
  border: 1px solid rgba(255,92,114,.4);
  color: #ff9aad;
  border-radius: 9px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 10px;
}

/* Overview */
.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid #2a5474;
  border-radius: 15px;
  padding: 15px;
  background: linear-gradient(135deg, #0e2b4b, #061223);
  margin-bottom: 10px;
}
.hero::before {
  content: ""; position: absolute; width: 240px; height: 240px; right: -80px; top: -100px;
  border-radius: 50%; background: rgba(93,214,255,.07);
}
.hero-label { color: var(--sky); font-family: Consolas, monospace; font-size: 9px; letter-spacing: .6px; }
.big-lap { font-family: "Bahnschrift", "Segoe UI", sans-serif; font-size: 62px; line-height: .95; color: var(--sky); font-weight: 700; margin-top: 7px; }
.big-lap span { font-family: inherit; font-size: 18px; color: var(--soft); font-weight: 400; margin-left: 3px; }
.hero-meta { color: var(--soft); font-size: 12px; margin-top: 8px; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.chip {
  border: 1px solid var(--line);
  background: rgba(8, 20, 38, .7);
  border-radius: 5px;
  padding: 4px 7px;
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 9px;
}
.chip.accent { border-color: rgba(93,214,255,.45); color: var(--sky2); background: rgba(93,214,255,.08); }
.hero-bottom { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.hero-stats { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.hstat { display: flex; align-items: baseline; gap: 6px; justify-content: space-between; border-bottom: 1px solid rgba(46,80,108,.35); padding-bottom: 4px; }
.hstat span { color: var(--muted); font-size: 9px; }
.hstat b { color: var(--soft); font-family: Consolas, monospace; font-size: 12px; font-weight: 600; }
.donut-wrap { flex: 0 0 118px; text-align: center; }
.donut {
  width: 112px; height: 112px; border-radius: 50%;
  position: relative; margin: 0 auto;
}
.donut::after {
  content: ""; position: absolute; inset: 15px; border-radius: 50%;
  background: #08182b;
}
.donut-center {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut-center b { font-family: "Bahnschrift", Consolas, sans-serif; font-size: 22px; }
.donut-center span { color: var(--muted); font-family: Consolas, monospace; font-size: 8px; }
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 10px; min-width: 0; }
.kpi span { color: var(--muted); font-size: 9px; }
.kpi b { display: block; margin-top: 5px; color: var(--text); font-family: "Bahnschrift", Consolas, sans-serif; font-size: 19px; font-weight: 700; }
.kpi small { display: block; color: var(--muted2); font-size: 9px; margin-top: 4px; line-height: 1.35; }
.kpi.accent b { color: var(--sky); }
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.card-title h3 { margin: 0; font-size: 14px; }
.card-title span { color: var(--muted2); font-family: Consolas, monospace; font-size: 8px; }
.compare-row { display: flex; align-items: center; gap: 6px; margin: 7px 0; font-size: 10px; }
.compare-row .dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; }
.compare-row .cname { width: 65px; flex: 0 0 65px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-row .bar { flex: 1; height: 6px; border-radius: 4px; background: #122a44; overflow: hidden; }
.compare-row .bar i { display: block; height: 100%; border-radius: 4px; }
.compare-row b { width: 55px; text-align: right; color: var(--soft); font-family: Consolas, monospace; font-size: 9px; }
.callout {
  margin-top: 9px; padding: 8px 9px; border-radius: 7px;
  background: rgba(93,214,255,.07); border: 1px solid rgba(93,214,255,.22);
  color: var(--sky2); font-size: 10px; line-height: 1.5;
}
.insight { display: flex; gap: 8px; padding: 8px 0; border-top: 1px solid #142b43; }
.insight:first-child { border-top: 0; padding-top: 0; }
.insight .idot { width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; flex: 0 0 6px; background: var(--sky); }
.insight .idot.warn { background: var(--gold); }
.insight .idot.info { background: var(--muted); }
.insight b { display: block; font-size: 11px; line-height: 1.35; }
.insight p { margin: 2px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.assumptions { margin-top: 10px; font-size: 9.5px; color: var(--muted); }
.assumptions summary { color: var(--muted2); cursor: pointer; }
.assumptions p { margin: 5px 0; line-height: 1.45; }

/* Plan */
.plan-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin: 2px 2px 10px; }
.plan-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.plan-actions .btn { padding: 8px 10px; font-size: 11px; }
.timeline-card { padding: 12px 10px; }
.tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.tl-title { font-size: 14px; font-weight: 700; }
.tl-sub { color: var(--muted2); font-family: Consolas, monospace; font-size: 8px; margin-top: 2px; }
.tl-summary { color: var(--muted); font-family: Consolas, monospace; font-size: 8px; text-align: right; line-height: 1.5; }
.tl-hint { color: var(--sky2); font-size: 9px; margin: 7px 0 2px; }
.tl-canvas { position: relative; margin-top: 8px; }
.tl-axis-label { position: absolute; color: var(--muted2); font-family: Consolas, monospace; font-size: 8px; transform: translateX(-50%); }
.tl-tick { position: absolute; width: 1px; background: rgba(93,214,255,.14); }
.tl-lane-name { position: absolute; color: var(--soft); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-lane-pace { position: absolute; color: var(--muted2); font-family: Consolas, monospace; font-size: 8px; text-align: right; }
.tl-lane-line { position: absolute; left: 0; right: 0; height: 1px; background: #142b43; }
.tl-block {
  position: absolute;
  height: 22px;
  border-radius: 4px;
  overflow: visible;
  min-width: 3px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.tl-block span.label {
  position: absolute; left: 5px; top: 5px;
  color: #062033; font-family: Consolas, monospace; font-size: 8px; font-weight: 700;
  white-space: nowrap; overflow: hidden; max-width: calc(100% - 8px);
}
.tl-block .grip {
  position: absolute; right: -6px; top: -4px; bottom: -4px; width: 14px;
  cursor: ew-resize; touch-action: none; z-index: 3;
}
.tl-block .grip::after {
  content: ""; position: absolute; left: 6px; top: 2px; bottom: 2px;
  width: 2px; border-radius: 2px; background: rgba(255,255,255,.85);
}
.tl-block.dragging { outline: 2px solid var(--silver); z-index: 4; }
.tl-finish { position: absolute; width: 1px; background: var(--sky); opacity: .8; }
.tl-deadline { position: absolute; width: 1px; border-left: 1px dashed rgba(255,200,87,.55); }
.tl-tip {
  position: absolute; z-index: 6; right: 8px; top: 8px;
  background: rgba(4,15,29,.97); border: 1px solid rgba(93,214,255,.5);
  border-radius: 7px; padding: 7px 9px; color: var(--sky2); font-size: 9px;
  line-height: 1.4; pointer-events: none; max-width: 220px;
}
.warning-box {
  border: 1px solid rgba(255,200,87,.28);
  background: rgba(255,200,87,.06);
  border-radius: 9px;
  padding: 9px 10px;
  margin-bottom: 9px;
  color: var(--gold);
  font-size: 10px;
  line-height: 1.45;
  max-height: 110px;
  overflow: auto;
}
.warning-box.good { border-color: rgba(93,214,255,.25); background: rgba(93,214,255,.05); color: var(--sky2); }
.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; min-width: 720px; font-family: Consolas, monospace; font-size: 10px; }
th, td { padding: 8px 7px; text-align: right; white-space: nowrap; border-bottom: 1px solid #132b43; }
th { position: sticky; top: 0; background: #0e223a; color: var(--muted); font-family: -apple-system, "Microsoft YaHei UI", sans-serif; font-size: 9px; font-weight: 600; z-index: 2; }
td:first-child, th:first-child { text-align: left; padding-left: 10px; }
td.name { text-align: left; color: var(--soft); }
td.name .tdot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-right: 5px; }
tr:nth-child(even) td { background: rgba(8,20,37,.55); }
td input, td select { padding: 5px 6px; font-size: 10px; border-radius: 5px; }
td input.target { width: 60px; text-align: right; }
td select.driver { width: 82px; }
.table-note { color: var(--muted2); font-size: 9px; padding: 8px 10px; }

/* Drivers */
.driver-cards { display: grid; grid-template-columns: 1fr; gap: 9px; }
.driver-big {
  border: 1px solid var(--line);
  border-left: 2px solid var(--dcolor);
  border-radius: 11px;
  background: linear-gradient(100deg, rgba(93,214,255,.055), var(--panel));
  padding: 11px;
}
.driver-big .top { display: flex; align-items: baseline; gap: 6px; }
.driver-big .rank { color: var(--dcolor); font-family: Consolas, monospace; font-size: 9px; }
.driver-big .name { font-size: 14px; font-weight: 700; }
.driver-big .weight { margin-left: auto; color: var(--muted); font-family: Consolas, monospace; font-size: 9px; }
.driver-big .pace { color: var(--dcolor); font-family: "Bahnschrift", Consolas, sans-serif; font-size: 26px; margin-top: 5px; }
.driver-big .pace small { color: var(--muted2); font-family: -apple-system, sans-serif; font-size: 9px; }
.driver-big .share { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; margin-top: 3px; }
.driver-big .share b { color: var(--soft); font-family: Consolas, monospace; }
.sharebar { height: 4px; border-radius: 3px; background: #122a44; margin-top: 7px; overflow: hidden; }
.sharebar i { display: block; height: 100%; border-radius: 3px; background: var(--dcolor); }
.driver-metrics { display: flex; gap: 12px; margin-top: 8px; color: var(--muted); font-size: 9px; }
.driver-metrics b { color: var(--soft); font-family: Consolas, monospace; font-size: 10px; }
.driver-big .base { color: var(--muted2); font-family: Consolas, monospace; font-size: 8px; margin-top: 5px; }
.pace-card { margin-top: 10px; }
.pace-chart { position: relative; height: 190px; margin: 12px 2px 4px 34px; border-left: 1px solid #294764; border-bottom: 1px solid #294764; }
.pace-grid { position: absolute; left: 0; right: 0; height: 1px; background: #142b43; }
.pace-axis { position: absolute; left: -33px; color: var(--muted2); font-family: Consolas, monospace; font-size: 7px; transform: translateY(-50%); }
.pace-bar { position: absolute; bottom: 0; width: 7%; border-radius: 3px 3px 0 0; min-width: 5px; }
.pace-x { position: absolute; bottom: -16px; color: var(--muted2); font-family: Consolas, monospace; font-size: 7px; transform: translateX(-50%); }
.pace-value { position: absolute; color: var(--muted); font-family: Consolas, monospace; font-size: 7px; transform: translateX(-50%); white-space: nowrap; }

/* Nav / toast / modal */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(60px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(5,14,30,.98);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.tabbar button {
  border: 0; background: transparent; color: var(--muted2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10px;
}
.tabbar .ico { font-size: 17px; line-height: 1; }
.tabbar button.active { color: var(--sky); }
.tabbar button.active .ico { text-shadow: 0 0 12px rgba(93,214,255,.55); }
.toast {
  position: fixed; left: 50%; bottom: calc(78px + var(--safe-bottom));
  transform: translateX(-50%) translateY(12px);
  background: rgba(12,35,58,.98); border: 1px solid var(--line2);
  color: var(--soft); border-radius: 9px; padding: 9px 13px;
  font-size: 11px; z-index: 50; opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
  max-width: calc(100vw - 30px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(2,7,15,.82);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal-card { width: 100%; max-width: 520px; background: var(--panel); border: 1px solid var(--line2); border-radius: 13px; padding: 15px; }
.modal-card h3 { margin: 0 0 5px; font-size: 15px; }
.modal-card textarea { height: 220px; resize: none; font-family: Consolas, monospace; font-size: 10px; }
.modal-actions { display: flex; gap: 8px; margin-top: 10px; }
.modal-actions .btn { flex: 1; }

@media (min-width: 620px) {
  .advanced-grid { grid-template-columns: 1fr 1fr; }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .driver-cards { grid-template-columns: 1fr 1fr; }
  .hero { padding: 18px; }
  .hero-bottom { gap: 20px; }
  .donut-wrap { flex-basis: 138px; }
  .donut { width: 132px; height: 132px; }
  .donut::after { inset: 18px; }
}
@media (max-width: 390px) {
  .brandline em { display: none; }
  .brandline strong { font-size: 15px; }
  .big-lap { font-size: 52px; }
  .driver-fields { grid-template-columns: 1fr 1fr 66px; }
  .two-col { grid-template-columns: 1fr; }
}

/* ===========================================================
   iOS 26 / 27 Liquid Glass
   由 index.html 的启动脚本写入 html[data-glass="on"] 与
   html[data-ios="26|27"]（原生层通过 __ER_ENV__ 注入真实版本）
   =========================================================== */
html[data-glass="on"] {
  --lg-gap: 10px;
  --lg-height: 60px;
  --lg-radius: 26px;
  --lg-blur: 24px;
  --lg-sat: 185%;
  --lg-fill: rgba(9, 21, 38, .46);
  --lg-stroke: rgba(255, 255, 255, .16);
  --lg-sheen: rgba(255, 255, 255, .20);
}

/* iOS 27：更厚的透镜、更大的圆角与更轻的底色 */
html[data-glass="on"][data-ios="27"] {
  --lg-gap: 12px;
  --lg-height: 64px;
  --lg-radius: 30px;
  --lg-blur: 30px;
  --lg-sat: 195%;
  --lg-fill: rgba(9, 21, 38, .40);
  --lg-sheen: rgba(255, 255, 255, .26);
}

html[data-glass="on"] body {
  padding-bottom: calc(var(--lg-height) + var(--lg-gap) + var(--safe-bottom) + 14px);
}

/* 顶部栏：同样玻璃化，但保持贴边结构，避免挤压状态栏 */
html[data-glass="on"] .appbar {
  background: linear-gradient(180deg, rgba(6, 16, 32, .88), rgba(6, 16, 32, .64));
  border-bottom: 1px solid rgba(255, 255, 255, .10);
  -webkit-backdrop-filter: blur(20px) saturate(175%);
  backdrop-filter: blur(20px) saturate(175%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

/* 底部菜单栏：悬浮胶囊 */
html[data-glass="on"] .tabbar {
  left: var(--lg-gap);
  right: var(--lg-gap);
  bottom: calc(var(--lg-gap) + var(--safe-bottom));
  height: var(--lg-height);
  padding-bottom: 0;
  border: 1px solid var(--lg-stroke);
  border-radius: var(--lg-radius);
  background: var(--lg-fill);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, .50),
    0 2px 8px rgba(0, 0, 0, .38),
    inset 0 1px 0 rgba(255, 255, 255, .22),
    inset 0 -1px 0 rgba(255, 255, 255, .05);
  overflow: hidden;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html[data-glass="on"] .tabbar {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03) 42%, rgba(255, 255, 255, .07)),
      var(--lg-fill);
    -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
    backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  }
}

/* 高光：模拟玻璃边缘的折射与顶部反光 */
html[data-glass="on"] .tabbar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(140% 72% at 50% -32%, var(--lg-sheen), rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 26%);
}

/* 选项卡：玻璃胶囊内的选中态 */
html[data-glass="on"] .tabbar button {
  position: relative;
  z-index: 1;
  margin: 5px 4px;
  border-radius: calc(var(--lg-radius) - 9px);
  color: var(--muted);
  transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .12s ease;
}

html[data-glass="on"] .tabbar button.active {
  color: var(--sky2);
  background: linear-gradient(180deg, rgba(93, 214, 255, .26), rgba(93, 214, 255, .08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .32),
    inset 0 -1px 0 rgba(0, 0, 0, .18),
    0 4px 14px rgba(0, 0, 0, .28);
}

html[data-glass="on"] .tabbar button.active .ico {
  text-shadow: 0 0 14px rgba(93, 214, 255, .65);
}

html[data-glass="on"] .tabbar button:active {
  transform: scale(.94);
}

html[data-glass="on"] .toast {
  bottom: calc(var(--lg-height) + var(--lg-gap) + var(--safe-bottom) + 18px);
}

/* iPad / 宽屏：限制悬浮条宽度，避免被拉成一条长带 */
@media (min-width: 620px) {
  html[data-glass="on"] .tabbar {
    left: 50%;
    right: auto;
    width: min(600px, calc(100% - 28px));
    transform: translateX(-50%);
  }
}

/* 系统「降低透明度」开关 */
@media (prefers-reduced-transparency: reduce) {
  html[data-glass="on"] .tabbar,
  html[data-glass="on"] .appbar {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(5, 14, 30, .98);
  }
  html[data-glass="on"] .tabbar::after { display: none; }
}

/* ---------- native iOS shell (UITabBarController + UINavigationBar) ---------- */
html[data-native="on"] .appbar,
html[data-native="on"] .tabbar {
  display: none !important;
}
html[data-native="on"] .view-inner {
  padding-top: 16px;
  padding-bottom: 28px;
}