/* pre-auto · 桌面网页为主，窄屏再叠成单列 */

:root {
  --font-sans: "DM Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;

  --bg-base: #e8ecf4;
  --bg-mist-1: rgba(79, 70, 229, 0.09);
  --bg-mist-2: rgba(14, 165, 233, 0.06);
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.88);
  --text: #16161a;
  --text-secondary: #5c6370;
  --text-muted: #868e96;
  --border: rgba(22, 22, 26, 0.08);
  --border-strong: rgba(22, 22, 26, 0.12);

  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: rgba(37, 99, 235, 0.12);
  --brand-glow: rgba(37, 99, 235, 0.22);

  --pill-bg: #eef1f6;
  --pill-text: #3d4450;
  --win: #15803d;
  --loss: #b91c1c;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(22, 22, 26, 0.04);
  --shadow-md: 0 4px 14px rgba(22, 22, 26, 0.07), 0 1px 3px rgba(22, 22, 26, 0.04);
  --shadow-lg: 0 12px 40px rgba(22, 22, 26, 0.1), 0 4px 12px rgba(22, 22, 26, 0.05);

  /* 主内容最大宽度（桌面） */
  --shell-max: 72rem;
  --shell-pad-x: 2rem;
  --shell-pad-y: 1.75rem;
  /* 战报卡片最窄列宽，用于 auto-fit 网格 */
  --district-card-min: 17.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

.report-body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -30%, var(--bg-mist-1), transparent 55%),
    radial-gradient(ellipse 90% 60% at 100% 0%, var(--bg-mist-2), transparent 50%),
    radial-gradient(ellipse 70% 50% at 0% 100%, rgba(99, 102, 241, 0.05), transparent 45%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* —— 顶栏：与主内容同宽 —— */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface-glass);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.app-nav__inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0.65rem var(--shell-pad-x);
  padding-left: max(var(--shell-pad-x), env(safe-area-inset-left, 0));
  padding-right: max(var(--shell-pad-x), env(safe-area-inset-right, 0));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.app-nav__brand {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  background: linear-gradient(125deg, #1e3a8a 0%, var(--brand) 55%, #0ea5e9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.app-nav__brand:hover {
  opacity: 0.88;
}

.app-nav__list {
  list-style: none;
  margin: 0;
  padding: 0.2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.app-nav__link {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.app-nav__link:hover {
  background: rgba(22, 22, 26, 0.06);
  color: var(--text);
}

.app-nav__link--active {
  background: linear-gradient(145deg, var(--brand-soft), rgba(14, 165, 233, 0.12));
  color: var(--brand-dark);
  box-shadow: 0 1px 3px var(--brand-glow);
}

/* —— 主内容区 —— */
.report-page,
.module-page {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: var(--shell-pad-y) var(--shell-pad-x);
  padding-bottom: calc(var(--shell-pad-y) + env(safe-area-inset-bottom, 0));
  min-height: calc(100dvh - 4rem);
}

/* —— 战报页头（桌面左对齐） —— */
.report-header {
  text-align: left;
  padding: 0 0 1.5rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.report-header__crumb {
  display: inline-block;
  margin: 0 0 0.5rem;
  padding: 0.22rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 999px;
}

.report-header__title {
  margin: 0;
  font-size: clamp(1.5rem, 2.2vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.report-header__meta {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  max-width: 48rem;
}

.report-header__warn {
  margin: 0.5rem 0 0;
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  max-width: 48rem;
}

/* —— 展示页 · 三区专精沙盘 —— */
.sandbox-panel {
  margin-bottom: 1.75rem;
  padding: 1.35rem 1.35rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.sandbox-panel__head {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.sandbox-panel__title {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sandbox-panel__sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 52rem;
}

.sandbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-bottom: 1.15rem;
}

.sandbox-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sandbox-field__label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.sandbox-field__input {
  width: 6.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.sandbox-toolbar__btn {
  padding: 0.48rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, var(--brand), #1d4ed8);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.sandbox-toolbar__btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.sandbox-toolbar__btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.sandbox-toolbar__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sandbox-preset {
  padding: 0.32rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--pill-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.sandbox-preset:hover {
  color: var(--brand-dark);
  border-color: #bfdbfe;
}

.sandbox-zones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 60rem) {
  .sandbox-zones {
    grid-template-columns: 1fr;
  }
}

.sandbox-zone {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
}

.sandbox-zone--red {
  box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.12);
  background: linear-gradient(165deg, rgba(185, 28, 28, 0.06), #fff 45%);
}

.sandbox-zone--blue {
  box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.12);
  background: linear-gradient(165deg, rgba(29, 78, 216, 0.06), #fff 45%);
}

.sandbox-zone--green {
  box-shadow: inset 0 0 0 1px rgba(21, 128, 61, 0.12);
  background: linear-gradient(165deg, rgba(21, 128, 61, 0.06), #fff 45%);
}

.sandbox-zone__title {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.sandbox-zone__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.sandbox-zone__picked {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.sandbox-zone__meta {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.sandbox-zone__meta strong {
  color: var(--text);
  font-weight: 800;
}

.sandbox-zone__ailine {
  margin-top: 0.65rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.sandbox-keypad {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
}

.sandbox-key {
  padding: 0.42rem 0.2rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  color: var(--text);
}

.sandbox-key:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.sandbox-key--active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-dark);
  box-shadow: 0 0 0 1px var(--brand-glow);
}

.sandbox-zone__summary {
  margin-top: 0.75rem;
  padding: 0.75rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.06);
}

.sandbox-summary__rate {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
}

.sandbox-summary__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-dark);
}

.sandbox-summary__pct {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
}

.sandbox-summary__count {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sandbox-summary__streaks {
  margin-top: 0.55rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.sandbox-summary__win {
  color: var(--win);
  font-weight: 900;
}

.sandbox-summary__loss {
  color: var(--loss);
  font-weight: 900;
}

.sandbox-summary__next {
  margin-top: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(37, 99, 235, 0.18);
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 700;
  text-align: center;
}

.sandbox-summary__next strong {
  color: var(--brand-dark);
  font-weight: 900;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.sandbox-ai-buyk__title,
.sandbox-replay__title {
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.sandbox-ai-buyk {
  margin-bottom: 1.15rem;
}

.sandbox-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.75);
}

.sandbox-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.sandbox-table th,
.sandbox-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.sandbox-table thead th {
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.sandbox-table thead th:first-child,
.sandbox-table tbody th {
  text-align: left;
}

.sandbox-table tbody th {
  font-weight: 600;
  color: var(--text-secondary);
}

.sandbox-table tbody tr:last-child th,
.sandbox-table tbody tr:last-child td {
  border-bottom: none;
}

.period-issue {
  font-weight: 700;
  color: var(--brand-dark);
  background: rgba(2, 132, 199, 0.05);
}

.period-zone {
  font-weight: 700;
  color: var(--text-secondary);
}

.period-rank {
  font-weight: 600;
  color: var(--brand-dark);
}

.period-pred-cell {
  background: rgba(16, 185, 129, 0.08);
}

.period-pred-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  align-items: flex-start;
}

.period-slot {
  width: 2.25rem;
  min-width: 2.25rem;
  padding: 0.18rem 0.12rem 0.22rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(22, 22, 26, 0.12);
  background: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.period-slot__d {
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.period-slot__p {
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.05;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.period-pred-strip--z0 .period-slot--picked {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
}

.period-pred-strip--z1 .period-slot--picked {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.35);
}

.period-pred-strip--z2 .period-slot--picked {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
}

.period-slot--open {
  outline: 2px solid rgba(245, 158, 11, 0.55);
  outline-offset: 1px;
}

.period-pred-meta {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.period-est-rate {
  font-weight: 700;
  color: #0f766e;
}

.period-hit {
  font-weight: 700;
}

.period-hit--yes {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.period-hit--no {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.period-result {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.period-group-start td {
  border-top: 2px solid rgba(59, 130, 246, 0.2);
}

.period-group-end td {
  border-bottom: 2px solid rgba(59, 130, 246, 0.2);
}

.sandbox-chip {
  display: inline-block;
  padding: 0.06rem 0.28rem;
  margin-right: 0.1rem;
  border-radius: 4px;
  font-weight: 700;
  background: #f1f5f9;
}

.sandbox-chip--hit {
  background: rgba(21, 128, 61, 0.2);
  color: var(--win);
}

.sandbox-status {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.sandbox-status--err {
  color: var(--loss);
  font-weight: 600;
}

/* —— 三区卡片网格 —— */
.district-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--district-card-min), 1fr));
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 0.5rem;
}

.district-card--red {
  --accent: #b91c1c;
  --accent-soft: rgba(185, 28, 28, 0.1);
  --accent-mid: rgba(185, 28, 28, 0.22);
  --accent-glow: rgba(185, 28, 28, 0.15);
}

.district-card--blue {
  --accent: #1d4ed8;
  --accent-soft: rgba(29, 78, 216, 0.1);
  --accent-mid: rgba(29, 78, 216, 0.2);
  --accent-glow: rgba(29, 78, 216, 0.12);
}

.district-card--green {
  --accent: #15803d;
  --accent-soft: rgba(21, 128, 61, 0.1);
  --accent-mid: rgba(21, 128, 61, 0.2);
  --accent-glow: rgba(21, 128, 61, 0.12);
}

.district-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--accent-mid);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.2rem 1.25rem;
  margin-bottom: 0;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.district-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), rgba(255, 255, 255, 0.35));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.district-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, var(--accent-soft), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.district-card__head,
.district-card__stats,
.district-card__hint,
.district-card .pills {
  position: relative;
  z-index: 1;
}

.district-card .pills {
  margin-top: auto;
}

.district-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
  padding-top: 0.15rem;
}

.district-card__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.35;
  flex: 1;
}

.district-card__overall {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.district-card__stats {
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.8rem 0.4rem;
  margin-bottom: 0.8rem;
  border-top: 1px solid var(--accent-mid);
  border-bottom: 1px solid var(--accent-mid);
  background: rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-sm);
}

.stat {
  text-align: center;
  flex: 1;
}

.stat__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.28rem;
}

.stat__value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat__value--win {
  color: var(--win);
}

.stat__value--loss {
  color: var(--loss);
}

.district-card__hint {
  margin: 0 0 0.7rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pill {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pill-text);
  background: var(--pill-bg);
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button.pill {
  font-family: inherit;
  cursor: pointer;
}

button.pill:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

button.pill--pick:hover {
  border-color: #bfdbfe;
  color: var(--brand-dark);
}

.district-card__pick {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.75);
  border: 1px dashed var(--accent-mid);
  border-radius: var(--radius-sm);
  line-height: 1.45;
}

.pill--active {
  background: linear-gradient(145deg, var(--accent), rgba(0, 0, 0, 0.18));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* —— 页脚快捷链接 —— */
.report-footer {
  padding: 1.75rem 0 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.report-footer__chips {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.footer-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.footer-chip:hover {
  color: var(--brand-dark);
  border-color: #bfdbfe;
  box-shadow: var(--shadow-md);
}

/* —— 模块子页 —— */
.module-page__head {
  margin-bottom: 1.5rem;
  text-align: left;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.module-page__crumb {
  display: inline-block;
  margin: 0 0 0.55rem;
  padding: 0.22rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 999px;
}

.module-page__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 2.2vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.module-page__lead {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 42rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.module-card--span {
  grid-column: 1 / -1;
}

.accuracy-filter-card {
  margin-bottom: 1.25rem;
}

.range-filter-form__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1rem;
}

.range-filter-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 10rem;
}

.range-filter-form__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.range-filter-form__input {
  padding: 0.45rem 0.65rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-variant-numeric: tabular-nums;
}

.range-filter-form__submit {
  padding: 0.48rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, var(--brand), #0369a1);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.range-filter-form__submit:hover {
  filter: brightness(1.05);
}

.range-filter-form__warn {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  color: var(--loss);
  line-height: 1.5;
}

.range-filter-form__meta {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.accuracy-section__title {
  margin: 1.35rem 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.accuracy-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.65);
}

.accuracy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.accuracy-table th,
.accuracy-table td {
  padding: 0.55rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.accuracy-table thead th {
  text-align: right;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.accuracy-table thead th:first-child {
  text-align: left;
}

.accuracy-table tbody th[scope="row"] {
  text-align: left;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  max-width: 14rem;
}

.accuracy-table tbody tr:last-child th,
.accuracy-table tbody tr:last-child td {
  border-bottom: none;
}

.accuracy-table tbody tr:hover td,
.accuracy-table tbody tr:hover th[scope="row"] {
  background: rgba(14, 165, 233, 0.06);
}

.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  margin-bottom: 0;
  box-shadow: var(--shadow-md);
}

.module-card--muted {
  background: #f4f6fa;
  border-style: dashed;
}

.module-card__h {
  margin: 0 0 0.8rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.module-card__h::before {
  content: "";
  width: 4px;
  height: 1em;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), #0ea5e9);
}

.module-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.module-list li {
  margin-bottom: 0.4rem;
}

.module-list li:last-child {
  margin-bottom: 0;
}

.module-list code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--pill-bg);
  padding: 0.12em 0.35em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.module-card__note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.module-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.module-actions__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: var(--pill-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.module-actions__btn:hover {
  background: var(--surface);
  border-color: #c7d2fe;
  color: var(--brand-dark);
}

.module-actions__btn--primary {
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--brand-glow);
}

.module-actions__btn--primary:hover {
  color: #fff;
  filter: brightness(1.05);
  border-color: transparent;
}

/* —— 数据采集配置（表单不宜过宽） —— */
.settings-page {
  max-width: 52rem;
  margin-left: auto;
  margin-right: auto;
}

.settings-head {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.settings-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  margin-bottom: 0.55rem;
  transition: opacity 0.15s ease;
}

.settings-back:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.settings-head__crumb {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.settings-title {
  margin: 0 0 0.45rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.settings-note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 40rem;
}

.settings-form {
  margin-top: 0.5rem;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-md);
}

.settings-card--muted {
  background: #f1f4f9;
  border-style: dashed;
}

.settings-card__title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.field {
  margin-bottom: 0.75rem;
}

.field--half {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.field-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.field__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.32rem;
}

.field__input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.field__input--readonly {
  background: var(--pill-bg);
  color: var(--text-secondary);
}

.field__hint {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.28rem;
  line-height: 1.4;
}

.settings-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.settings-list code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--pill-bg);
  padding: 0.08em 0.3em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.btn {
  padding: 0.6rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  color: #fff;
  box-shadow: 0 2px 10px var(--brand-glow);
}

.btn--ghost {
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--brand);
}

/* —— 窄屏：恢复单列与紧凑边距 —— */
@media (max-width: 52rem) {
  :root {
    --shell-pad-x: 1.25rem;
    --shell-pad-y: 1.25rem;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 36rem) {
  html {
    font-size: 15px;
  }

  :root {
    --shell-pad-x: 1rem;
    --shell-pad-y: 1rem;
    --district-card-min: 100%;
  }

  .app-nav__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .app-nav__list {
    justify-content: center;
  }

  .app-nav__link {
    padding: 0.38rem 0.65rem;
    font-size: 0.8rem;
  }

  .app-nav__brand {
    font-size: 1.05rem;
    text-align: center;
  }

  .report-header,
  .module-page__head {
    text-align: center;
  }

  .module-page__lead {
    margin-left: auto;
    margin-right: auto;
  }

  .report-footer__chips {
    flex-direction: column;
  }

  .footer-chip {
    width: 100%;
  }

  .module-actions {
    flex-direction: column;
  }

  .module-actions__btn {
    width: 100%;
  }

  .field-row {
    flex-direction: column;
    gap: 0;
  }
}
