/* ==========================================================================
   悦跑实验室 · 响应式面板
   ≥1024 侧边栏 240 + 多栏栅格 | 768-1023 图标栏 64 | <768 底部 tab bar
   纯原生 CSS，无外链、无外部字体。
   ========================================================================== */

:root {
  --bg: #0e1116;
  --card: #161b22;
  --card-2: #1b2230;
  --line: #243040;
  --fg: #e6edf3;
  --muted: #8b949e;
  --accent: #4ade80;
  --accent-dim: rgba(74, 222, 128, 0.12);
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 18px;
  --radius-sm: 12px;
  --tap: 46px;
  --side-w: 240px;
  --top-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

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

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(74, 222, 128, 0.08), transparent 62%),
    radial-gradient(760px 460px at 96% 2%, rgba(56, 189, 248, 0.06), transparent 58%),
    var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: 0.2px;
}

p {
  margin: 0;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font-family: inherit;
}

img {
  max-width: 100%;
}

/* ==========================================================================
   外壳：侧边栏 + 主列
   ========================================================================== */
.app-shell {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: rgba(16, 20, 26, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 18px;
}

.side-mark {
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(145deg, #1f6f45, #4ade80 68%, #86efac);
  color: #06130c;
  font-size: 15px;
  font-weight: 800;
}

.side-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.side-name em {
  font-style: normal;
  color: var(--accent);
}

.side-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: none;
  color: var(--muted);
  font-size: 13.5px;
  text-align: left;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}

.nav-item svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

.nav-item span {
  white-space: nowrap;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
}

.nav-item.is-active {
  border-color: rgba(74, 222, 128, 0.34);
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.side-foot {
  padding: 12px 12px 4px;
  border-top: 1px solid var(--line);
  margin-top: 10px;
}

.side-foot-label {
  display: block;
  color: #5b6572;
  font-size: 10.5px;
  letter-spacing: 0.5px;
}

.side-foot strong {
  display: block;
  margin-top: 2px;
  color: var(--fg);
  font-size: 12.5px;
  line-height: 1.4;
  word-break: break-word;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  height: var(--top-h);
  padding: 0 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 17, 22, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.crumbs {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumbs b {
  color: var(--fg);
  font-weight: 600;
}

.top-right {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.pill {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.pill.is-live {
  color: var(--accent);
  border-color: rgba(74, 222, 128, 0.38);
  background: var(--accent-dim);
}

.pill.is-warn {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.09);
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card-2);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.3px;
}

.avatar:active {
  border-color: rgba(74, 222, 128, 0.5);
}

.content {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 40px 40px;
}

/* ==========================================================================
   屏 / 页头 / 栅格
   ========================================================================== */
.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: screen-in 0.28s ease both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-head {
  margin-bottom: 18px;
}

.page-head h2 {
  font-size: 24px;
}

.head-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.btn-back {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.grid {
  display: grid;
  gap: 16px;
  align-items: start;
}

.grid-rules {
  grid-template-columns: 1.1fr 1fr;
}

.grid-run {
  grid-template-columns: minmax(0, 1fr) 380px;
}

.grid-strategy-lower {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
}

.grid-strategy-cta {
  grid-template-columns: 340px minmax(0, 1fr);
}

.grid-live {
  grid-template-columns: minmax(0, 1fr) 380px;
  margin-bottom: 16px;
}

.grid-profile {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-narrow {
  grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
}

.col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.col-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding-top: 4px;
}

/* ==========================================================================
   通用卡片 / 表单 / 按钮
   ========================================================================== */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 46%), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.card-head h3 {
  font-size: 15px;
}

.chip {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.chip.is-live {
  color: var(--accent);
  border-color: rgba(74, 222, 128, 0.4);
  background: var(--accent-dim);
}

.chip.is-warn {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
}

.chip-ok {
  color: var(--accent);
  border-color: rgba(74, 222, 128, 0.4);
  background: var(--accent-dim);
}

.chip-err {
  color: var(--err);
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.1);
}

.field {
  display: block;
  margin-bottom: 13px;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.4px;
}

.input,
.field input,
.manual-geo input {
  width: 100%;
  min-height: var(--tap);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0f141b;
  color: var(--fg);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.field input::placeholder,
.input::placeholder {
  color: #5b6572;
  font-size: 14px;
}

.field input:focus,
.input:focus {
  border-color: rgba(74, 222, 128, 0.6);
  background: #101720;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12);
}

.hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.hint.center {
  text-align: center;
}

.hint.is-err {
  color: var(--err);
}

.invite-hint {
  margin: -4px 0 14px;
  color: #7f8b99;
  font-size: 11.5px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  color: var(--fg);
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.12s, opacity 0.2s, background 0.2s, border-color 0.2s;
}

.btn:active {
  transform: scale(0.99);
}

.btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(160deg, #5eead4 0%, #4ade80 46%, #22c55e 100%);
  color: #06130c;
  box-shadow: 0 12px 26px rgba(74, 222, 128, 0.2);
}

.btn-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.btn-link {
  min-height: 38px;
  padding: 0 2px;
  background: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

.btn-link.danger {
  color: var(--err);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 38px;
  padding: 0 13px;
  font-size: 12.5px;
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-row .btn {
  flex: 1;
}

.btn-run {
  flex-direction: column;
  gap: 2px;
  min-height: 60px;
  font-size: 16.5px;
  letter-spacing: 0.4px;
}

.btn-run small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.72;
  letter-spacing: 0;
}

.btn-run.is-risk {
  background: linear-gradient(160deg, #fbbf24 0%, #f59e0b 55%, #d97706 100%);
  color: #1a1204;
  box-shadow: 0 12px 26px rgba(251, 191, 36, 0.22);
}

/* ==========================================================================
   屏 1 接入
   ========================================================================== */
.login-tools {
  display: flex;
  justify-content: flex-end;
  padding: 2px 0 0;
}

.btn-admin {
  min-height: 36px;
  color: var(--muted);
  font-size: 12px;
}

.brand {
  padding: 24px 6px 22px;
  text-align: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: linear-gradient(145deg, #1f6f45, #4ade80 68%, #86efac);
  box-shadow: 0 14px 34px rgba(74, 222, 128, 0.24);
}

.brand-mark span {
  font-size: 28px;
  font-weight: 800;
  color: #06130c;
}

.brand h1 {
  font-size: 26px;
  letter-spacing: 1px;
}

.login-card {
  max-width: 460px;
  margin: 0 auto;
}

/* ==========================================================================
   屏 2 账号
   ========================================================================== */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0f141b;
}

.tab {
  flex: 1;
  min-height: 40px;
  padding: 0 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  transition: background 0.18s, color 0.18s;
}

.tab.is-active {
  background: var(--card-2);
  color: var(--fg);
  font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.3);
}

.tabpane {
  display: none;
}

.tabpane.is-active {
  display: block;
}

.sms-row {
  display: flex;
  gap: 8px;
}

.sms-row .input {
  flex: 1;
  min-width: 0;
}

.sms-row .btn {
  flex: 0 0 auto;
  min-height: var(--tap);
  border: 1px solid var(--line);
}

.textarea {
  min-height: 82px;
  padding: 11px 13px;
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
}

.account-ok {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
}

.account-ok[hidden] {
  display: none;
}

.account-ok i {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.account-ok p {
  color: #bbf7d0;
  font-size: 13px;
}

.local-hint {
  padding: 10px 12px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(251, 191, 36, 0.07);
  color: #fde68a;
}

/* ==========================================================================
   屏 3 规则
   ========================================================================== */
.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search-row .input {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  font-size: 15px;
}

.school-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.school-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  transition: border-color 0.18s, background 0.18s;
}

.school-row:active {
  background: rgba(74, 222, 128, 0.08);
}

.school-row.is-active {
  border-color: rgba(74, 222, 128, 0.5);
  background: var(--accent-dim);
}

.school-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 10.5px;
  white-space: nowrap;
}

.badge-high {
  color: var(--accent);
  border-color: rgba(74, 222, 128, 0.4);
  background: var(--accent-dim);
}

.badge-medium {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
}

.badge-template {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.mine-wrap {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.mine-wrap[hidden] {
  display: none;
}

.mini-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.4px;
}

.row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(36, 48, 64, 0.75);
}

.row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.row.top-line {
  margin-top: 6px;
  padding-top: 14px;
}

.row-label {
  flex: 0 0 58px;
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.row-body {
  flex: 1;
  min-width: 0;
}

.pair-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pair-row .input {
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--tap);
  padding: 0 11px;
  font-size: 15px;
  text-align: center;
}

.pair-sep {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12.5px;
}

.pair-row .unit {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.live-hint {
  margin-top: 7px;
  color: var(--accent);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.live-hint.is-err {
  color: var(--err);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch-track {
  position: relative;
  display: block;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: #0f141b;
  border: 1px solid var(--line);
  transition: background 0.2s, border-color 0.2s;
}

.switch-track b {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #5b6572;
  transition: transform 0.2s, background 0.2s;
}

.switch input:checked + .switch-track {
  background: rgba(74, 222, 128, 0.22);
  border-color: rgba(74, 222, 128, 0.55);
}

.switch input:checked + .switch-track b {
  transform: translateX(19px);
  background: var(--accent);
}

.switch span:last-child {
  color: var(--muted);
  font-size: 12.5px;
}

.switch input:checked ~ span:last-child {
  color: var(--fg);
}

/* ---------- 点位 ---------- */
.wp-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.wp-actions .btn {
  flex: 1;
  min-height: 40px;
}

.wp-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 12px;
}

.wp-item {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.022);
}

.wp-line1 {
  display: flex;
  align-items: center;
  gap: 7px;
}

.wp-line1 .wp-name {
  flex: 1;
  min-width: 0;
  padding: 0 9px;
  font-size: 14px;
}

.wp-line1 .wp-kind {
  flex: 0 0 74px;
  padding: 0 4px;
}

.wp-item input,
.wp-item select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f141b;
  color: var(--fg);
  font-size: 13px;
  font-family: inherit;
}

.wp-item input:focus,
.wp-item select:focus {
  border-color: rgba(74, 222, 128, 0.55);
  outline: none;
}

.wp-del {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 9px;
  background: rgba(248, 113, 113, 0.08);
  color: var(--err);
  font-size: 17px;
  line-height: 1;
}

.wp-line2 {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}

.wp-field {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.wp-field input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 0 6px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* ---------- 折叠区 ---------- */
.fold summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  color: var(--fg);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.fold summary::-webkit-details-marker {
  display: none;
}

.fold summary::before {
  content: "▸";
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.2s;
}

.fold[open] summary::before {
  transform: rotate(90deg);
}

.fold summary .chip {
  margin-left: auto;
}

.fold textarea {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  min-height: 96px;
}

/* ---------- 校验结果 ---------- */
.problem-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.problem-row {
  display: flex;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12.5px;
  line-height: 1.5;
}

.problem-row.level-err {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
  color: #fecaca;
}

.problem-row.level-warn {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.07);
  color: #fde68a;
}

.problem-row.level-ok {
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(74, 222, 128, 0.07);
  color: #bbf7d0;
}

.problem-row b {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
}

.problem-row.level-err b {
  color: var(--err);
}

.problem-row.level-warn b {
  color: var(--warn);
}

.problem-row.level-ok b {
  color: var(--accent);
}

/* ==========================================================================
   屏 4 跑法
   ========================================================================== */
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.strategy-card {
  position: relative;
  padding: 12px 12px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.022);
  text-align: left;
  transition: border-color 0.18s, background 0.18s, transform 0.12s;
}

.strategy-card:active {
  transform: scale(0.995);
}

.strategy-card.is-active {
  border-color: rgba(74, 222, 128, 0.55);
  background: var(--accent-dim);
}

.strategy-card strong {
  display: block;
  padding-right: 36px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.strategy-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.risk-dots {
  position: absolute;
  top: 11px;
  right: 10px;
  display: flex;
  gap: 3px;
}

.risk-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2b3644;
}

.risk-dots i.on {
  background: var(--accent);
}

.risk-dots.lv2 i.on {
  background: var(--warn);
}

.risk-dots.lv3 i.on,
.risk-dots.lv4 i.on {
  background: var(--err);
}

.risk-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.risk-card {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.022);
  text-align: left;
  transition: border-color 0.18s, background 0.18s;
}

.risk-card.is-active {
  border-color: rgba(74, 222, 128, 0.5);
  background: var(--accent-dim);
}

.risk-card strong {
  font-size: 13px;
}

.risk-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip-btn {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12.5px;
  transition: all 0.18s;
}

.chip-btn.is-active {
  border-color: rgba(74, 222, 128, 0.6);
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 650;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn,
.pills .pill {
  min-width: 62px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  transition: all 0.18s;
}

.pills .pill.is-active {
  border-color: rgba(74, 222, 128, 0.65);
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 650;
}

.custom-km {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.custom-km .input {
  min-height: 42px;
  font-size: 15px;
}

.custom-km .unit {
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- 体检报告 ---------- */
.report-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.score-box {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 1px solid rgba(74, 222, 128, 0.4);
  background: var(--accent-dim);
}

.score-box strong {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.score-box span {
  font-size: 10px;
  color: var(--muted);
}

.report.is-bad {
  border-color: rgba(248, 113, 113, 0.45);
}

.report.is-bad .score-box {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.1);
}

.report.is-bad .score-box strong {
  color: var(--err);
}

.report.is-warn .score-box {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.1);
}

.report.is-warn .score-box strong {
  color: var(--warn);
}

.report-title {
  min-width: 0;
}

.report-title h3 {
  font-size: 15px;
  line-height: 1.4;
}

.report-title p {
  margin-top: 4px;
  font-size: 11.5px;
}

.report-body {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 13px;
}

.mini-map {
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid rgba(36, 48, 64, 0.8);
  border-radius: var(--radius-sm);
  background: #0b0f14;
  min-height: 180px;
  overflow: hidden;
}

.mini-map svg {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
}

.report-items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rp-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.rp-item .rp-icon {
  flex: 0 0 20px;
  margin-top: 1px;
  color: var(--muted);
}

.rp-item .rp-body {
  min-width: 0;
  flex: 1;
}

.rp-item .rp-msg {
  font-size: 12.5px;
  line-height: 1.5;
}

.rp-item .rp-hint {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.rp-item.ok {
  border-color: rgba(74, 222, 128, 0.22);
}

.rp-item.ok .rp-icon {
  color: var(--accent);
}

.rp-item.warn {
  border-color: rgba(251, 191, 36, 0.32);
  background: rgba(251, 191, 36, 0.06);
}

.rp-item.warn .rp-icon {
  color: var(--warn);
}

.rp-item.err {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
}

.rp-item.err .rp-icon {
  color: var(--err);
}

/* ==========================================================================
   屏 5 开跑
   ========================================================================== */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 170px;
  padding: 22px 16px;
  border: 1.5px dashed #2f3d51;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
  text-align: center;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}

.dropzone:active {
  border-color: rgba(74, 222, 128, 0.55);
  background: var(--accent-dim);
}

.dz-icon {
  color: #43536b;
  margin-bottom: 6px;
}

.dz-main {
  color: var(--fg);
  font-size: 14.5px;
  font-weight: 600;
}

.dz-sub {
  font-size: 11.5px;
}

.dz-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

.dropzone.has-photo {
  border-style: solid;
  border-color: rgba(74, 222, 128, 0.45);
  min-height: 210px;
}

.has-photo .dz-icon,
.has-photo .dz-main,
.has-photo .dz-sub {
  display: none;
}

.quality {
  margin-top: 14px;
}

.quality-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12.5px;
}

.quality-top strong {
  color: var(--fg);
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 6px;
  border-radius: 999px;
  background: #0f141b;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.45s ease;
}

.bar.is-warn i {
  background: linear-gradient(90deg, #d97706, var(--warn));
}

.bar.is-err i {
  background: linear-gradient(90deg, #b91c1c, var(--err));
}

.quality-reason {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.quality-reason.is-err {
  color: var(--err);
  font-weight: 600;
}

.quality-faces {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.geo-value {
  padding: 6px 0 2px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  word-break: break-all;
}

.manual-geo {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.manual-geo input {
  min-height: 42px;
  font-size: 15px;
  padding: 0 10px;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0f141b;
}

.seg {
  flex: 1;
  min-height: 38px;
  padding: 0 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s;
}

.seg.is-active {
  background: var(--card-2);
  color: var(--fg);
  font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.3);
}

#startAt {
  margin-top: 10px;
  color-scheme: dark;
}

.summary-card .summary-bar {
  margin: 0 0 14px;
}

.summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.022);
  color: var(--muted);
  font-size: 12px;
}

.summary-bar i {
  color: #3a4658;
  font-style: normal;
}

.summary-bar span {
  color: var(--fg);
}

.mode-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.mode-card {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.022);
  text-align: left;
  transition: border-color 0.18s, background 0.18s;
}

.mode-card strong {
  display: block;
  font-size: 13px;
}

.mode-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.mode-card.is-active {
  border-color: rgba(74, 222, 128, 0.5);
  background: var(--accent-dim);
}

/* ==========================================================================
   屏 6 进度 / 结果
   ========================================================================== */
.progress {
  height: 8px;
  border-radius: 999px;
  background: #0f141b;
  overflow: hidden;
}

.progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #5eead4);
  transition: width 0.5s ease;
}

.steps {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: #5b6572;
  font-size: 12.5px;
  transition: color 0.25s;
}

.steps li b {
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2b3644;
  transition: background 0.25s, box-shadow 0.25s;
}

.steps li.is-done {
  color: var(--muted);
}

.steps li.is-done b {
  background: #22c55e;
}

.steps li.is-active {
  color: var(--fg);
  font-weight: 600;
}

.steps li.is-active b {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.16);
  animation: pulse 1.4s ease-in-out infinite;
}

.steps li.is-error {
  color: var(--err);
  font-weight: 600;
}

.steps li.is-error b {
  background: var(--err);
  animation: none;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(74, 222, 128, 0.22);
  }
}

.logbox {
  max-height: 200px;
  padding: 11px 12px;
  border: 1px solid rgba(36, 48, 64, 0.8);
  border-radius: var(--radius-sm);
  background: #0b0f14;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: #8fa0b4;
  white-space: pre-wrap;
  word-break: break-word;
}

.logbox:empty::before {
  content: "等待后端日志…";
  color: #4b5666;
}

.logbox .log-line::before {
  content: "› ";
  color: #40506a;
}

.logbox .log-err {
  color: var(--err);
}

/* ---------- 跑步进行中 ---------- */
.live-card {
  border-color: rgba(74, 222, 128, 0.28);
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.06), transparent 60%), var(--card);
}

.live-card[hidden] {
  display: none;
}

.live-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.live-label {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.4px;
}

.countdown {
  display: block;
  margin: 2px 0 4px;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.live-sub {
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.live-pace {
  display: flex;
  gap: 18px;
}

.live-pace div {
  text-align: right;
}

.live-pace span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
}

.live-pace b {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.live-bar {
  height: 8px;
}

.live-hint {
  margin-top: 10px;
}

/* ---------- 结果 ---------- */
.result-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.mapbox {
  padding: 6px;
  border: 1px solid rgba(36, 48, 64, 0.8);
  border-radius: var(--radius-sm);
  background: #0b0f14;
  overflow: hidden;
  min-height: 260px;
  display: grid;
  place-items: center;
}

.mapbox svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.mapbox .muted {
  padding: 34px 12px;
  text-align: center;
}

.result-time {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.result-side {
  min-width: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  padding: 12px;
  border: 1px solid rgba(36, 48, 64, 0.8);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.022);
}

.metric:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.metric strong {
  display: block;
  margin-top: 3px;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.metric strong em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
  margin-left: 3px;
  font-weight: 500;
}

.fail .fail-reason {
  margin: 2px 0 16px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(248, 113, 113, 0.09);
  border: 1px solid rgba(248, 113, 113, 0.28);
  color: #fecaca;
  font-size: 13px;
  word-break: break-word;
}

/* ==========================================================================
   屏 7 我的
   ========================================================================== */
.kv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1px dashed rgba(36, 48, 64, 0.7);
}

.kv span {
  color: var(--muted);
  font-size: 12px;
}

.kv b {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

/* ==========================================================================
   屏 8 看板
   ========================================================================== */
.tunnel-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 9px 12px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.08);
}

.tunnel-line[hidden] {
  display: none;
}

.tunnel-label {
  flex: 0 0 auto;
  color: #7dd3fc;
  font-size: 11px;
}

.tunnel-line code {
  flex: 1;
  min-width: 0;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tunnel-line .btn {
  flex: 0 0 auto;
  min-height: 32px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat-card {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 60%), var(--card);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.stat-card strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.target-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.target-head strong {
  color: var(--fg);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.board {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.board-row {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.022);
  grid-template-columns: 1fr;
}

.board-row.is-lead {
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.05);
}

.b-rank {
  display: none;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.lead-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.16);
  color: var(--accent);
  font-size: 9.5px;
  vertical-align: 1px;
}

.b-id {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.b-phone {
  font-family: var(--mono);
  font-size: 13px;
}

.b-nick {
  font-size: 12.5px;
}

.b-school {
  color: var(--muted);
  font-size: 11px;
}

.b-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 11.5px;
}

.b-item b {
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.b-quota {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.q {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.q.is-over {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

.b-km {
  display: flex;
  align-items: center;
  gap: 9px;
}

.km-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #0f141b;
  overflow: hidden;
}

.km-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.4s ease;
}

.is-lead .km-bar i {
  background: linear-gradient(90deg, #4ade80, #86efac);
}

.km-left {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.dev-tag {
  padding: 1px 7px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  color: #7dd3fc;
  font-size: 10px;
  font-family: var(--mono);
}

.b-dev {
  display: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.board-head {
  display: none;
  padding: 0 12px 2px;
  color: #5b6572;
  font-size: 10.5px;
  letter-spacing: 0.4px;
}

.invite-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.inv-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.022);
}

.inv-main {
  flex: 1;
  min-width: 0;
}

.inv-main code {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.4px;
}

.inv-note {
  margin-left: 7px;
  color: var(--muted);
  font-size: 10.5px;
}

.inv-url {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-copy {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
}

/* ==========================================================================
   底部 tab bar（<768px）
   ========================================================================== */
.tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(14, 17, 22, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.tab-item {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 48px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10.5px;
}

.tab-item svg {
  width: 20px;
  height: 20px;
}

.tab-item.is-active {
  color: var(--accent);
}

/* ==========================================================================
   toast / modal / onboarding
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 90;
  max-width: min(88vw, 420px);
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #1d2531;
  color: var(--fg);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
}

.toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-err {
  border-color: rgba(248, 113, 113, 0.45);
  background: #2a1a1e;
  color: #fecaca;
}

.toast.is-ok {
  border-color: rgba(74, 222, 128, 0.4);
  background: #14231b;
  color: #bbf7d0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 9, 13, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.modal-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.modal-card .hint {
  margin: 0 0 12px;
}

.modal-card code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--mono);
  font-size: 11.5px;
}

.modal-card .input {
  margin-bottom: 14px;
}

/* 新手引导 */
.onboard {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 9, 13, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.onboard[hidden] {
  display: none;
}

.onboard-card {
  width: 100%;
  max-width: 460px;
  padding: 18px;
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.onboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.onboard-step {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.onboard-skip {
  min-height: 30px;
  color: var(--muted);
  font-size: 12px;
}

.onboard-card h2 {
  font-size: 19px;
  margin-bottom: 7px;
}

.onboard-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  min-height: 44px;
}

.onboard-dots {
  display: flex;
  gap: 6px;
  margin: 14px 0 12px;
}

.onboard-dots i {
  width: 22px;
  height: 4px;
  border-radius: 999px;
  background: #2b3644;
}

.onboard-dots i.on {
  background: var(--accent);
}

/* 引导高亮的目标元素 */
.spot {
  position: relative;
  z-index: 101;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.55), 0 18px 60px rgba(0, 0, 0, 0.6);
  border-radius: var(--radius);
}

/* ==========================================================================
   断点：1024 以下（平板 / 竖屏笔记本）
   ========================================================================== */
@media (max-width: 1023px) {
  :root {
    --side-w: 64px;
  }

  .app-shell {
    grid-template-columns: var(--side-w) minmax(0, 1fr);
  }

  .sidebar {
    align-items: center;
    padding: 14px 6px;
  }

  .side-brand {
    padding: 0 0 16px;
  }

  .side-name,
  .side-foot-label,
  .side-foot strong,
  .nav-item span {
    display: none;
  }

  .side-nav {
    width: 100%;
    align-items: stretch;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
    min-height: 46px;
  }

  .side-foot {
    width: 100%;
    padding: 10px 2px 0;
    text-align: center;
  }

  .topbar {
    padding: 0 20px;
  }

  .content {
    padding: 18px 20px 32px;
  }

  .grid-rules {
    grid-template-columns: 1fr 1fr;
  }

  .grid-run,
  .grid-live {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid-profile {
    grid-template-columns: 1fr 1fr;
  }

  .grid-strategy-cta {
    grid-template-columns: minmax(0, 1fr);
  }

  .strategy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-head {
    display: none;
  }
}

/* ==========================================================================
   断点：<768（手机）
   ========================================================================== */
@media (max-width: 767px) {
  :root {
    --top-h: 54px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    padding: 0 14px;
  }

  .crumbs {
    font-size: 12.5px;
  }

  .top-right .pill {
    display: none;
  }

  .top-right .pill.is-live,
  .top-right .pill.is-warn {
    display: inline-block;
  }

  .content {
    padding: 14px 12px calc(76px + env(safe-area-inset-bottom));
  }

  .screen.is-active {
    animation: none;
  }

  .page-head {
    margin-bottom: 12px;
  }

  .page-head h2 {
    font-size: 20px;
  }

  .card {
    padding: 14px;
    border-radius: 16px;
    box-shadow: none;
  }

  .grid {
    gap: 12px;
  }

  .grid-rules,
  .grid-run,
  .grid-live,
  .grid-strategy-lower,
  .grid-profile,
  .grid-narrow,
  .grid-strategy-cta,
  .result-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .col {
    gap: 12px;
  }

  .strategy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .strategy-card {
    padding: 10px 10px 11px;
  }

  .strategy-card strong {
    padding-right: 30px;
    font-size: 12.5px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-card {
    padding: 11px 12px;
  }

  .stat-card strong {
    font-size: 19px;
  }

  .countdown {
    font-size: 34px;
  }

  .live-top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .live-pace {
    justify-content: space-between;
  }

  .live-pace div {
    text-align: left;
  }

  .tabbar {
    display: flex;
  }

  .toast {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .onboard {
    align-items: flex-end;
  }

  .onboard-card {
    padding: 16px;
  }

  .result-time {
    font-size: 11.5px;
  }

  .metrics {
    gap: 8px;
  }

  .metric {
    padding: 10px;
  }

  .metric strong {
    font-size: 18px;
  }

  .wp-field span {
    display: none;
  }

  .board-row {
    padding: 10px;
  }
}

/* 很窄（<380）收紧一档 */
@media (max-width: 379px) {
  .strategy-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pair-row .input {
    font-size: 14px;
    padding: 0 8px;
  }

  .countdown {
    font-size: 30px;
  }

  .brand h1 {
    font-size: 22px;
  }
}

/* ---------- 宽屏专门的栅格细节 ---------- */
@media (min-width: 1024px) {
  .board-head {
    display: grid;
    grid-template-columns: 34px minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) 96px;
    gap: 10px;
  }

  .board-row {
    grid-template-columns: 34px minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) 96px;
    align-items: center;
    gap: 10px;
  }

  .b-rank {
    display: block;
  }

  .b-dev {
    display: block;
  }

  .b-stats,
  .b-quota {
    flex-wrap: nowrap;
  }

  .strategy-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-strategy-lower {
    grid-template-columns: 1fr 1fr;
  }

  .result-body {
    grid-template-columns: minmax(0, 1fr) 380px;
  }

  .content {
    padding: 24px 40px 48px;
  }
}

/* ---------- 无障碍 / 降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

:focus-visible {
  outline: 2px solid rgba(74, 222, 128, 0.7);
  outline-offset: 2px;
}

/* ==========================================================================
   起点卡 + 地图选点
   注意：/map-picker.js 的遮罩 z-index 是 9999，弹窗（95/100）和 toast（90）都比它低，
   这里不要再往上抬。
   ========================================================================== */
.geo-card {
  cursor: pointer;
  transition: border-color 0.18s;
}

.geo-card:hover {
  border-color: rgba(74, 222, 128, 0.32);
}

.geo-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.022);
  text-align: left;
}

.geo-summary:active {
  background: rgba(74, 222, 128, 0.08);
}

.geo-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.geo-value {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.geo-arrow {
  flex: 0 0 auto;
  color: #40506a;
  font-size: 17px;
  line-height: 1;
}

.geo-advice {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
}

.geo-advice[hidden] {
  display: none;
}

.geo-advice.is-ok {
  border-color: rgba(74, 222, 128, 0.32);
  background: rgba(74, 222, 128, 0.08);
  color: #bbf7d0;
}

.geo-advice.is-warn {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
  color: #fde68a;
}

.geo-advanced {
  margin-top: 12px;
}

.geo-advanced summary {
  min-height: 36px;
  font-size: 12.5px;
  color: var(--muted);
}

.geo-actions {
  margin-top: 12px;
}

.geo-actions .btn {
  min-height: 42px;
  font-size: 13.5px;
}

@media (max-width: 767px) {
  /* 手机：只留「在地图上选」，其它操作收进高级 */
  .geo-actions .btn-ghost {
    display: none;
  }

  .geo-actions .btn-primary {
    min-height: 46px;
  }

  .geo-value {
    font-size: 11px;
  }
}

/* ---------- 修正：接入屏右上角「管理」被挤出视口 ---------- */
.content { overflow-x: hidden; }
#screen-login .login-tools {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 4px 0 0;
  margin: 0;
}
#screen-login .btn-admin {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
}
@media (max-width: 768px) {
  #screen-login .login-tools { padding: 0 2px; }
}
/* 顶栏右侧集群在窄屏允许收缩，不要把内容顶出去 */
.topbar { gap: 10px; }
.topbar > * { min-width: 0; }

/* ---------- 分享给同学（登录页二维码卡片） ---------- */
.share-card {
  max-width: 440px;
  margin: 14px auto 0;
  padding: 14px 16px;
}
.share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
}
.share-body { display: flex; gap: 14px; align-items: flex-start; }
.share-body img {
  flex: 0 0 auto;
  width: 132px;
  height: 132px;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
  box-sizing: border-box;
}
.share-info { flex: 1 1 auto; min-width: 0; }
.share-info code {
  display: block;
  word-break: break-all;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  background: rgba(127, 127, 127, .14);
  padding: 6px 8px;
  border-radius: 8px;
  margin-bottom: 6px;
}
.share-info .hint { margin: 0 0 4px; }
.share-info .btn { margin-top: 6px; }
@media (max-width: 480px) {
  .share-body { flex-direction: column; align-items: center; text-align: center; }
  .share-info { width: 100%; }
}

/* ---------- 看板：邀请码筛选 / 状态 / 成员移除 ---------- */
.inv-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.inv-filter button {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.inv-filter button:hover { color: var(--fg, #e6e8eb); border-color: rgba(127, 127, 127, .45); }
.inv-filter button.is-on {
  color: #34c77b;
  border-color: rgba(52, 199, 123, .55);
  background: rgba(52, 199, 123, .14);
}
.inv-actions { display: flex; flex-shrink: 0; align-items: center; gap: 6px; }
.inv-tip { font-size: 11px; color: var(--muted); white-space: nowrap; }
.inv-row.inv-revoked { opacity: .55; }
.inv-row.inv-revoked .inv-main code { text-decoration: line-through; }
.inv-row .badge { margin-left: 7px; }

/* 成员行：设备格右侧放「移除」 */
.b-dev {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.b-dev-id { color: var(--muted); font-size: 11px; }
.b-dev .del-user {
  flex-shrink: 0;
  color: #e8806f;
  border-color: rgba(232, 128, 111, .4);
}
.b-dev .del-user:hover {
  color: #ff6b52;
  border-color: rgba(255, 107, 82, .7);
  background: rgba(255, 107, 82, .1);
}
