:root {
  --ink: #17223a;
  --blue: #2456f4;
  --coral: #f2644b;
  --cream: #f5f0e6;
  --paper: #fffdf7;
  --line: #17223a;
  --muted: #687184;
  --shadow: 8px 8px 0 var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-width: 300px;
}
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }

.topbar {
  height: 72px;
  padding: 0 clamp(20px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--line);
  background: var(--paper);
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-weight: 900; letter-spacing: .12em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--blue); color: white; letter-spacing: -.08em; transform: rotate(-3deg); }
.topbar p { margin: 0; color: var(--muted); font-size: 13px; }

main { overflow: hidden; }
.hero {
  max-width: 1320px;
  margin: 0 auto;
  min-height: 430px;
  padding: 76px clamp(20px, 5vw, 76px) 64px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  align-items: end;
  gap: 60px;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  width: 380px; height: 380px; border: 58px solid rgba(36,86,244,.09); border-radius: 50%;
  right: -90px; top: -170px; pointer-events: none;
}
.eyebrow { margin: 0 0 18px; color: var(--blue); font-size: 12px; font-weight: 900; letter-spacing: .18em; }
h1 { margin: 0; max-width: 790px; font-size: clamp(58px, 9vw, 128px); line-height: .82; letter-spacing: -.075em; font-weight: 900; }
h1 em { color: var(--blue); font-style: normal; }
.hero-note { padding: 22px 0 6px 28px; border-left: 5px solid var(--coral); display: grid; gap: 10px; line-height: 1.65; }
.hero-note strong { font-size: 18px; }
.hero-note span { color: var(--muted); font-size: 14px; }

.workspace { background: var(--blue); color: white; padding: 64px max(20px, calc((100vw - 1180px) / 2)) 72px; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 30px; }
.workspace .eyebrow { color: #b9c8ff; }
h2 { margin: 0; font-size: clamp(34px, 5vw, 58px); letter-spacing: -.045em; }
.known-status { border: 1px solid rgba(255,255,255,.5); padding: 11px 15px; font-size: 13px; letter-spacing: .08em; }
.known-status span { font-weight: 900; font-size: 20px; }
.preset-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 20px; }
.preset-row > span { margin-right: 6px; font-size: 12px; font-weight: 700; letter-spacing: .1em; color: #dbe2ff; }
.preset-row button { border: 1px solid rgba(255,255,255,.7); background: transparent; color: white; padding: 8px 16px; font-weight: 800; }
.preset-row button:hover, .preset-row button.active { background: white; color: var(--blue); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { min-width: 0; padding: 18px; background: #1745db; border: 1px solid rgba(255,255,255,.36); transition: transform .15s, background .15s, box-shadow .15s; }
.metric-card.is-known { background: var(--paper); color: var(--ink); transform: translateY(-5px); box-shadow: 0 6px 0 #0e2d9b; }
.metric-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 36px; }
.metric-index { font-size: 11px; font-weight: 900; opacity: .65; }
.known-toggle { border: 1px solid currentColor; background: transparent; padding: 5px 8px; text-transform: uppercase; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.metric-card.is-known .known-toggle { background: var(--coral); color: white; border-color: var(--coral); }
.metric-card label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 900; letter-spacing: .08em; }
.input-wrap { display: flex; align-items: baseline; gap: 6px; border-bottom: 3px solid currentColor; padding-bottom: 8px; }
.input-wrap input { display: block; width: 100%; min-width: 0; padding: 0; border: 0; outline: none; background: transparent; font-size: clamp(25px, 3vw, 40px); font-weight: 900; letter-spacing: -.05em; }
.input-wrap input[type="number"] { appearance: textfield; }
.input-wrap input::-webkit-inner-spin-button { appearance: none; }
.input-wrap span { flex: none; font-size: 11px; font-weight: 700; opacity: .7; }
.metric-card small { display: block; min-height: 30px; margin-top: 10px; font-size: 10px; line-height: 1.45; opacity: .65; }
.metric-card.has-error { outline: 3px solid #ffb7aa; outline-offset: -3px; }
.action-row { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; }
.message { margin: 0; font-size: 14px; line-height: 1.5; color: #fff; }
.message.error { color: #ffd0c8; font-weight: 700; }
.calculate { border: 2px solid white; background: white; color: var(--blue); padding: 13px 20px; font-weight: 900; box-shadow: 4px 4px 0 #102b8f; }
.calculate:hover { transform: translate(1px, 1px); box-shadow: 3px 3px 0 #102b8f; }
.calculate span { margin-left: 18px; }

.splits { max-width: 1180px; margin: 0 auto; padding: 76px 20px 90px; }
.split-heading .eyebrow { color: var(--coral); }
.split-select { display: flex; align-items: center; border: 2px solid var(--line); background: var(--paper); }
.split-select span { padding: 10px 12px; border-right: 2px solid var(--line); font-size: 12px; font-weight: 800; }
.split-select select { border: 0; outline: none; background: transparent; padding: 10px 30px 10px 12px; font-weight: 900; }
.summary-strip { display: grid; grid-template-columns: 1fr 1fr 1.4fr; border: 2px solid var(--line); border-bottom: 0; background: var(--paper); }
.summary-strip div { padding: 20px 22px; border-right: 2px solid var(--line); display: grid; gap: 6px; }
.summary-strip div:last-child { border-right: 0; }
.summary-strip span { font-size: 11px; color: var(--muted); font-weight: 800; letter-spacing: .1em; }
.summary-strip strong { font-size: clamp(23px, 3vw, 38px); letter-spacing: -.04em; }
.summary-strip .finish { background: var(--coral); color: white; }
.summary-strip .finish span { color: white; opacity: .8; }
.table-wrap { border: 2px solid var(--line); overflow-x: auto; background: var(--paper); }
table { width: 100%; border-collapse: collapse; min-width: 670px; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid #d7d3c9; }
th { background: var(--ink); color: white; font-size: 10px; letter-spacing: .12em; }
td { font-size: 14px; font-variant-numeric: tabular-nums; }
td:first-child { color: var(--blue); font-weight: 900; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f2eee4; }
.empty-splits { padding: 42px 20px; text-align: center; color: var(--muted); }

footer { padding: 24px clamp(20px, 5vw, 76px); background: var(--ink); color: white; display: flex; justify-content: space-between; gap: 20px; font-size: 11px; letter-spacing: .07em; }

@media (max-width: 900px) {
  .hero { min-height: 390px; grid-template-columns: 1fr; gap: 40px; }
  .hero-note { max-width: 520px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 560px) {
  .topbar { height: 62px; }
  .topbar p { display: none; }
  .hero { padding-top: 58px; padding-bottom: 52px; min-height: 340px; }
  h1 { font-size: clamp(54px, 18vw, 82px); }
  .workspace { padding-top: 46px; padding-bottom: 52px; }
  .section-heading { align-items: flex-start; }
  .known-status { margin-top: 6px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { padding: 16px 18px; }
  .metric-head { margin-bottom: 18px; }
  .input-wrap input { font-size: 36px; }
  .action-row { align-items: stretch; flex-direction: column; }
  .calculate { width: 100%; }
  .split-heading { align-items: end; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-strip .finish { grid-column: 1 / -1; border-top: 2px solid var(--line); }
  .summary-strip div:nth-child(2) { border-right: 0; }
  footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
