:root {
  --bg0: #f7f6f2;
  --bg1: #eef2ff;
  --ink: #0f172a;
  --muted: #475569;
  --paper: rgba(255, 255, 255, 0.72);
  --paper-strong: rgba(255, 255, 255, 0.9);
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 16px 46px rgba(2, 6, 23, 0.10);
  --accent: #0f766e;
  --accent-2: #4f46e5;
  --danger: #b91c1c;
  --success: #15803d;
  --warn: #a16207;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei",
    sans-serif;
  background: radial-gradient(980px 540px at 12% 0%, rgba(15, 118, 110, 0.12), transparent 62%),
    radial-gradient(1100px 620px at 92% 6%, rgba(79, 70, 229, 0.10), transparent 64%),
    radial-gradient(1200px 780px at 44% 112%, rgba(2, 6, 23, 0.08), transparent 60%),
    linear-gradient(180deg, #fbfbf6, #eef7f6),
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.015) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(0deg, rgba(15, 23, 42, 0.015) 0 1px, transparent 1px 18px);
}

.bg-inkwash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.26;
  background-image: radial-gradient(circle at 14% 22%, rgba(15, 23, 42, 0.08), transparent 46%),
    radial-gradient(circle at 76% 30%, rgba(15, 23, 42, 0.05), transparent 52%),
    radial-gradient(circle at 52% 86%, rgba(15, 23, 42, 0.04), transparent 58%),
    conic-gradient(from 210deg at 18% 10%, rgba(15, 118, 110, 0.06), transparent 24%, rgba(79, 70, 229, 0.05), transparent 54%);
  filter: blur(1.2px);
}

.page {
  position: relative;
  min-height: 100%;
  padding: 28px 18px 48px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.title {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.4px;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  user-select: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(15, 118, 110, 1), rgba(79, 70, 229, 0.92));
  color: white;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.84);
}

.alert {
  border-radius: 12px;
  padding: 10px 12px;
  margin: 12px 0 10px;
  font-size: 13px;
  border: 1px solid;
  background: var(--paper-strong);
}

.alert-danger {
  border-color: rgba(185, 28, 28, 0.26);
  color: var(--danger);
}

.auth {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 76px);
}

.auth-card {
  width: min(420px, 92vw);
  padding: 20px 18px 18px;
}

.auth-header {
  margin-bottom: 8px;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.app {
  max-width: 1260px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.topbar {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.seal {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6), transparent 55%),
    linear-gradient(135deg, rgba(15, 118, 110, 0.92), rgba(79, 70, 229, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.logo {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.72);
  object-fit: contain;
  display: block;
}

.brand-title {
  font-weight: 800;
  letter-spacing: 0.6px;
}

.brand-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
  align-items: start;
}

.side {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.main {
  display: grid;
  gap: 16px;
}

.hero {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  align-items: center;
}

.hero-title {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.4px;
}

.hero-desc {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.6;
}

.hero-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-frame {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.62);
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.hero-right {
  display: grid;
  gap: 8px;
}

.h2 {
  margin: 0 0 12px;
  font-size: 14px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.82);
}

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

label {
  font-size: 12px;
  color: var(--muted);
}

input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(2, 6, 23, 0.04);
  resize: vertical;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(15, 23, 42, 0.55) 50%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.55) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

textarea {
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(79, 70, 229, 0.42);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}

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

.switch {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.switch input {
  width: 16px;
  height: 16px;
}

.status {
  font-size: 12px;
  line-height: 1.4;
}

.opt-card {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(15, 23, 42, 0.22);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: none;
}

.opt-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: rgba(15, 23, 42, 0.72);
  text-transform: uppercase;
}

.opt-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.opt-hint {
  margin-top: 8px;
}

.quant-card {
  padding: 14px 16px 12px;
}

.viz-card {
  padding: 12px 12px 12px;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.56);
}

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

.viz-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.viz-item {
  --c: rgba(15, 118, 110, 0.95);
  padding: 10px 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-left: 4px solid var(--c);
  background: rgba(255, 255, 255, 0.65);
  display: grid;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.viz-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.viz-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--c);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.12);
}

.viz-sub {
  font-size: 11px;
  color: var(--muted);
}

.viz-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.donut {
  --pct: 0;
  --c: rgba(15, 118, 110, 0.95);
  width: 74px;
  height: 74px;
  border-radius: 999px;
  background: conic-gradient(var(--c) calc(var(--pct) * 1%), rgba(15, 23, 42, 0.10) 0);
  position: relative;
  display: grid;
  place-items: center;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.donut-center {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1.1;
}

.donut-val {
  font-size: 14px;
  font-weight: 900;
}

.donut-lab {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

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

.donut-tile {
  padding: 8px 8px 8px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.70);
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
}

.donut-k {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.4px;
  color: rgba(15, 23, 42, 0.74);
}

.donut-meta {
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pie {
  width: 74px;
  height: 74px;
  border-radius: 999px;
  position: relative;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: conic-gradient(rgba(15, 118, 110, 0.95) 0% 50%, rgba(79, 70, 229, 0.92) 50% 100%);
}

.pie::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.pie-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
  font-size: 11px;
  font-weight: 900;
  color: rgba(15, 23, 42, 0.76);
}

.legend {
  display: grid;
  gap: 6px;
}

.legend-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: rgba(15, 23, 42, 0.78);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.20);
}

.legend-val {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.field-list {
  display: grid;
  gap: 8px;
}

.field-row {
  display: grid;
  grid-template-columns: 56px 1fr 76px;
  gap: 10px;
  align-items: start;
  padding: 8px 8px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.70);
}

.field-name {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.3px;
  color: rgba(15, 23, 42, 0.74);
}

.field-mid {
  display: grid;
  gap: 6px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 22px;
}

.chip {
  --c: rgba(15, 118, 110, 0.95);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.70));
  font-size: 11px;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.84);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--c);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.12);
}

.viz-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.10);
  overflow: hidden;
  position: relative;
}

.viz-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--c), rgba(79, 70, 229, 0.86));
  opacity: 0.82;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
}

.viz-ci {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  width: 0%;
  background: rgba(79, 70, 229, 0.18);
  z-index: 1;
}

.field-right {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.field-pct {
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: rgba(15, 23, 42, 0.86);
}

.field-ci {
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stacked-wrap {
  display: grid;
  gap: 10px;
}

.stacked-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.10);
  overflow: hidden;
  display: flex;
}

.stack-seg {
  height: 100%;
}

.stack-seg:first-child {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
}

.stack-seg:last-child {
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
}

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

.quant-item {
  padding: 10px 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.55);
  display: grid;
  gap: 6px;
}

.quant-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.quant-label {
  font-size: 13px;
  font-weight: 700;
}

.quant-value {
  font-size: 12px;
  color: var(--muted);
}

.quant-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.10);
  overflow: hidden;
}

.quant-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.95), rgba(79, 70, 229, 0.90));
}

.prob-list {
  margin: 0 0 10px;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.70);
}

.prob-item {
  display: grid;
  gap: 6px;
}

.prob-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.prob-label {
  font-size: 13px;
  font-weight: 700;
}

.prob-value {
  font-size: 12px;
  color: var(--muted);
}

.prob-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.10);
  overflow: hidden;
  position: relative;
}

.prob-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.95), rgba(79, 70, 229, 0.90));
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0.88;
}

.prob-ci-band {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  width: 0%;
  background: rgba(79, 70, 229, 0.18);
}

.prob-marker {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 0%;
  width: 2px;
  border-radius: 2px;
  background: rgba(15, 23, 42, 0.58);
}

.progress-card {
  padding: 14px 16px 12px;
}

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

.progress-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.progress-list li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.55);
}

.progress-list .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.28);
}

.progress-list .name {
  font-size: 13px;
}

.progress-list .tag {
  font-size: 12px;
  color: var(--muted);
}

.progress-list li.is-processing .dot {
  background: var(--warn);
}

.progress-list li.is-completed .dot {
  background: var(--success);
}

.progress-list li.is-error .dot {
  background: var(--danger);
}

.progress-list li.is-skipped .dot {
  background: rgba(15, 23, 42, 0.22);
}

.float-nav {
  position: fixed;
  right: 18px;
  top: 104px;
  width: 190px;
  max-height: calc(100vh - 140px);
  overflow: auto;
  padding: 12px 10px;
  display: grid;
  gap: 6px;
  z-index: 20;
}

.nav-head {
  padding: 4px 8px 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.nav-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.4px;
}

.nav-link {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 14px;
  border-radius: 12px;
  color: rgba(15, 23, 42, 0.82);
  text-decoration: none;
  font-size: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.52);
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
  position: relative;
  overflow: hidden;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 10px;
  bottom: 7px;
  height: 3px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
}

.nav-link::before {
  content: "";
  position: absolute;
  left: 28px;
  right: 10px;
  bottom: 7px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.92), rgba(79, 70, 229, 0.88));
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  transition: transform 180ms ease;
}

.nav-link.is-processing {
  --p: 0.66;
}

.nav-link.is-completed {
  --p: 1;
}

.nav-link.is-skipped {
  --p: 1;
}

.nav-link.is-error {
  --p: 1;
}

.nav-link.is-error::before {
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.95), rgba(161, 98, 7, 0.92));
}

.nav-link.is-skipped::before {
  background: rgba(15, 23, 42, 0.22);
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.22);
}

.nav-state {
  font-size: 11px;
  color: var(--muted);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.nav-link.is-processing .nav-dot {
  background: var(--warn);
}

.nav-link.is-completed .nav-dot {
  background: var(--success);
}

.nav-link.is-error .nav-dot {
  background: var(--danger);
}

.nav-link.is-skipped .nav-dot {
  background: rgba(15, 23, 42, 0.22);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 23, 42, 0.10);
}

.nav-link:active {
  transform: translateY(1px);
}

.nav-link.is-active {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(79, 70, 229, 0.26);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.10);
  transform: scale(1.02);
  padding: 12px 10px 18px;
  font-size: 13px;
}

.nav-split {
  height: 1px;
  background: rgba(15, 23, 42, 0.10);
  margin: 6px 8px;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(360px, 92vw);
  display: grid;
  gap: 10px;
  z-index: 50;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 12px 10px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.18);
  display: grid;
  gap: 8px;
}

.toast-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.toast-title {
  font-weight: 900;
  letter-spacing: 0.4px;
  font-size: 13px;
}

.toast-msg {
  font-size: 12px;
  color: var(--muted);
}

.toast-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.10);
  overflow: hidden;
  position: relative;
}

.toast-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.95), rgba(79, 70, 229, 0.92));
  transform: translateX(-120%);
  animation: toast-indeterminate 1.25s infinite ease;
}

.toast.is-done .toast-bar {
  width: 100%;
  transform: translateX(0);
  animation: none;
}

.toast.is-error .toast-bar {
  width: 100%;
  transform: translateX(0);
  animation: none;
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.95), rgba(161, 98, 7, 0.92));
}

.toast.is-skipped .toast-bar {
  width: 100%;
  transform: translateX(0);
  animation: none;
  background: rgba(15, 23, 42, 0.22);
}

@keyframes toast-indeterminate {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.outputs {
  display: grid;
  gap: 12px;
}

.output-card {
  padding: 10px 12px 12px;
}

.module-split {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 12px;
  align-items: start;
}

.module-viz {
  --c: rgba(15, 23, 42, 0.22);
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-left: 4px solid var(--c);
  background: rgba(255, 255, 255, 0.70);
  padding: 10px 10px;
  overflow: auto;
  max-height: min(72vh, 760px);
}

.module-viz .donut,
.module-viz .pie {
  width: 88px;
  height: 88px;
}

.module-viz .donut::after,
.module-viz .pie::after {
  inset: 12px;
}

.module-viz .donut-val {
  font-size: 16px;
}

.module-viz .donut-lab {
  font-size: 11px;
}

.module-card {
  border-left: 4px solid rgba(15, 23, 42, 0.12);
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background: radial-gradient(720px 260px at 0% 0%, var(--mod, rgba(15, 23, 42, 0.18)), transparent 58%);
}

.module-card > * {
  position: relative;
}

.module-card[data-module="bagang"] {
  --mod: rgba(15, 118, 110, 0.95);
  border-left-color: rgba(15, 118, 110, 0.60);
}

.module-card[data-module="liujing"] {
  --mod: rgba(79, 70, 229, 0.92);
  border-left-color: rgba(79, 70, 229, 0.58);
}

.module-card[data-module="weiqi"] {
  --mod: rgba(161, 98, 7, 0.92);
  border-left-color: rgba(161, 98, 7, 0.56);
}

.module-card[data-module="zangfu"] {
  --mod: rgba(21, 128, 61, 0.92);
  border-left-color: rgba(21, 128, 61, 0.56);
}

.module-card[data-module="qixue"] {
  --mod: rgba(14, 165, 233, 0.92);
  border-left-color: rgba(14, 165, 233, 0.56);
}

.module-card[data-module="plan"] {
  --mod: rgba(109, 40, 217, 0.92);
  border-left-color: rgba(109, 40, 217, 0.56);
}

.module-card[data-module="review"] {
  --mod: rgba(185, 28, 28, 0.92);
  border-left-color: rgba(185, 28, 28, 0.54);
}

.module-card[data-module="kb"] {
  --mod: rgba(2, 132, 199, 0.92);
  border-left-color: rgba(2, 132, 199, 0.54);
}

.module-card[data-module="ancient"] {
  --mod: rgba(71, 85, 105, 0.92);
  border-left-color: rgba(71, 85, 105, 0.40);
}

.module-card[data-module="modern"] {
  --mod: rgba(51, 65, 85, 0.92);
  border-left-color: rgba(51, 65, 85, 0.40);
}

.module-card[data-module="rehab"] {
  --mod: rgba(15, 118, 110, 0.92);
  border-left-color: rgba(15, 118, 110, 0.40);
}

.module-card[data-module="report"] {
  --mod: rgba(79, 70, 229, 0.92);
  border-left-color: rgba(79, 70, 229, 0.40);
}

details {
  width: 100%;
}

summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 10px;
}

.module-card summary::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--mod, rgba(15, 23, 42, 0.22));
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.10);
}

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

.output-md {
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.86);
  padding: 10px 12px;
  overflow: auto;
  max-height: min(72vh, 760px);
  font-family: ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei",
    sans-serif;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.output-md h2,
.output-md h3,
.output-md h4 {
  margin: 10px 0 6px;
  line-height: 1.35;
}

.output-md h2 {
  font-size: 16px;
}

.output-md h3 {
  font-size: 15px;
}

.output-md h4 {
  font-size: 14px;
}

.output-md p {
  margin: 6px 0;
}

.output-md ul,
.output-md ol {
  margin: 6px 0 8px 18px;
  padding: 0;
}

.output-md li {
  margin: 4px 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-img {
    height: 220px;
  }
  .quant-grid {
    grid-template-columns: 1fr;
  }
  .viz-grid {
    grid-template-columns: 1fr;
  }
  .module-split {
    grid-template-columns: 1fr;
  }
  .module-viz {
    max-height: none;
  }
  .float-nav {
    display: none;
  }
}

@media (max-width: 1180px) {
  .float-nav {
    display: none;
  }
}
