:root {
  --bg: #f4f6fa;
  --bg2: #eef1f7;
  --card: #ffffff;
  --ink: #16202b;
  --ink2: #3d4a58;
  --muted: #6f7d8c;
  --line: #e3e8f0;
  --brand: #3055d8;
  --brand-soft: #eaefff;
  --accent: #ff7a59;
  --ok: #178a5a;
  --warn: #c07a05;
  --bad: #cf3d3d;
  --R: #e2703a;
  --I: #3f6fd8;
  --A: #a855d8;
  --S: #2fa47a;
  --E: #dfa018;
  --C: #5b7c99;
  --shadow: 0 1px 2px rgba(20, 32, 48, .04), 0 8px 24px -12px rgba(20, 32, 48, .16);
  --r: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 500px at 12% -10%, #e9eeff 0%, transparent 60%), var(--bg);
  color: var(--ink);
  font: 15px/1.65 "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--brand); }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: linear-gradient(140deg, var(--brand), #6b8cff);
  color: #fff; display: grid; place-items: center;
  font-size: 17px; font-weight: 700;
  box-shadow: 0 6px 16px -8px var(--brand);
}
.brand h1 { font-size: 16px; }
.brand p { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.topnav { display: flex; align-items: center; gap: 6px; }
.topnav button {
  border: 1px solid transparent; background: transparent; color: var(--ink2);
  padding: 7px 12px; border-radius: 9px; font-size: 13px;
}
.topnav button:hover { background: var(--brand-soft); color: var(--brand); }
.topnav button.on { background: var(--brand); color: #fff; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #cfd6e2; display: inline-block; margin-right: 6px; }
.dot.live { background: var(--ok); box-shadow: 0 0 0 3px rgba(23, 138, 90, .14); }
.svc { font-size: 12px; color: var(--muted); display: flex; align-items: center; white-space: nowrap; }

/* ---------- layout ---------- */
main { max-width: 1040px; margin: 0 auto; padding: 26px clamp(16px, 4vw, 40px) 80px; }
.view { animation: fade .28s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 22px; margin-bottom: 16px;
}
.card.tight { padding: 16px 18px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2 { font-size: 16.5px; }
.card-h h3 { font-size: 15px; }
.hint { font-size: 12.5px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2u { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- hero ---------- */
.hero { padding: 34px 30px 28px; border-radius: 18px; background: linear-gradient(135deg, #ffffff 0%, #f7f9ff 55%, #eef3ff 100%); border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 18px; }
.hero h2 { font-size: 26px; line-height: 1.35; margin-bottom: 10px; }
.hero h2 em { font-style: normal; color: var(--brand); }
.hero p { color: var(--ink2); max-width: 620px; }
.hero .tags { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.tagpill { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink2); }
.tagpill b { color: var(--brand); }

.entry { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.entry .card { margin: 0; display: flex; flex-direction: column; }
.entry .card h3 { font-size: 17px; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.badge.gray { background: var(--bg2); color: var(--muted); }
.entry ul { margin: 10px 0 16px; padding-left: 18px; color: var(--ink2); font-size: 13.5px; }
.entry ul li { margin-bottom: 4px; }
.entry .foot { margin-top: auto; }

/* ---------- form ---------- */
.field { margin-bottom: 12px; position: relative; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.input {
  width: 100%; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: #fbfcfe; font-size: 14px; color: var(--ink); outline: none; transition: .15s;
}
.input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(48, 85, 216, .1); }
.suggest { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; max-height: 240px; overflow-y: auto; }
.suggest div { padding: 8px 12px; font-size: 13px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.suggest div:hover, .suggest div.hi { background: var(--brand-soft); }
.suggest span { color: var(--muted); font-size: 11.5px; }
.seg { display: inline-flex; background: var(--bg2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 12.5px; color: var(--ink2); }
.seg button.on { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 600; }

.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 16px; border-radius: 10px; font-size: 13.5px; transition: .15s; display: inline-flex; align-items: center; gap: 7px; }
.btn:hover { border-color: #c9d3e4; background: #fafbff; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 8px 18px -10px var(--brand); }
.btn-primary:hover { background: #2348c6; border-color: #2348c6; }
.btn-primary:disabled { background: #b9c4e0; border-color: #b9c4e0; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: transparent; }
.btn-lg { padding: 11px 22px; font-size: 14.5px; }

/* ---------- quiz ---------- */
.qhead { position: sticky; top: 61px; z-index: 15; background: linear-gradient(180deg, var(--bg) 60%, rgba(244,246,250,.7)); padding: 8px 0 12px; }
.qhead .row { justify-content: space-between; }
.progress { height: 6px; background: #e5eaf3; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #7d97ff); border-radius: 99px; transition: width .25s ease; }
.qlist { display: flex; flex-direction: column; gap: 10px; }
.qitem { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; transition: .18s; }
.qitem.done { border-color: #cfd9f5; background: #fcfdff; }
.qtop { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.qno { flex: none; width: 24px; height: 24px; border-radius: 7px; background: var(--bg2); color: var(--muted); font-size: 12px; display: grid; place-items: center; font-weight: 600; }
.qitem.done .qno { background: var(--brand-soft); color: var(--brand); }
.qtext { font-size: 14.5px; line-height: 1.6; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.opt { border: 1px solid var(--line); background: #fbfcfe; border-radius: 9px; padding: 7px 4px; font-size: 12px; color: var(--ink2); text-align: center; transition: .13s; }
.opt:hover { border-color: #b9c8ee; background: #f6f9ff; }
.opt.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 6px 14px -10px var(--brand); }
.opt .k { display: none; }
.submitbar { position: sticky; bottom: 0; z-index: 15; margin-top: 14px; padding: 12px 0 14px; background: linear-gradient(0deg, var(--bg) 70%, rgba(244,246,250,.2)); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.submitbar .cnt { font-size: 13px; color: var(--muted); }
.submitbar .cnt b { color: var(--brand); }

.abgrid { display: grid; grid-template-columns: 1fr 96px 1fr; gap: 8px; }
.ab { border: 1px solid var(--line); background: #fbfcfe; border-radius: 10px; padding: 11px 13px; font-size: 13.5px; color: var(--ink2); text-align: left; line-height: 1.5; }
.ab:hover { border-color: #b9c8ee; background: #f6f9ff; }
.ab.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.ab-mid { display: grid; place-items: center; font-size: 12px; color: var(--muted); background: transparent; border-style: dashed; }
.ab-mid.on { background: #f1f3f8; border-style: solid; border-color: var(--muted); color: var(--ink2); }

/* ---------- result ---------- */
.codebar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.codes { display: flex; gap: 6px; }
.code-badge { width: 46px; height: 54px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: #fff; letter-spacing: 0; }
.code-name { font-size: 13px; color: var(--ink2); }
.metric { display: flex; align-items: flex-end; gap: 8px; }
.metric b { font-size: 44px; line-height: 1; font-weight: 700; letter-spacing: -.03em; }
.metric span { font-size: 13px; color: var(--muted); padding-bottom: 4px; }
.band { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.band.b1 { background: #e7f7ef; color: var(--ok); }
.band.b2 { background: #eaf1ff; color: var(--brand); }
.band.b3 { background: #fff5e3; color: var(--warn); }
.band.b4 { background: #fdeeee; color: var(--bad); }

.dimrow { display: grid; grid-template-columns: 88px 1fr 40px; gap: 10px; align-items: center; margin-bottom: 9px; }
.dimrow .nm { font-size: 12.5px; color: var(--ink2); display: flex; align-items: center; gap: 6px; }
.swatch { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.track { height: 9px; background: #eef1f7; border-radius: 99px; position: relative; overflow: hidden; }
.track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; transition: width .5s ease; }
.track u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #8fa1bb; opacity: .55; }
.dimrow .vl { font-size: 12.5px; text-align: right; color: var(--ink2); font-variant-numeric: tabular-nums; }

.joblist { display: flex; flex-direction: column; gap: 9px; }
.job { border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; background: #fff; transition: .15s; }
.job:hover { border-color: #cfd9f5; background: #fcfdff; }
.job .jt { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.job .jn { font-size: 14px; font-weight: 600; }
.job .jc { font-size: 11.5px; color: var(--muted); }
.job .js { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 8px; background: var(--bg2); color: var(--ink2); border: 1px solid transparent; }
.chip.core { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.chip.add { background: #fff; border-color: var(--line); }

.timeline { position: relative; padding-left: 22px; }
.timeline:before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, #cfd9f5, #eef1f7); }
.tl { position: relative; margin-bottom: 16px; }
.tl:last-child { margin-bottom: 0; }
.tl:before { content: ""; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); }
.tl h4 { font-size: 13.5px; margin-bottom: 2px; }
.tl .goal { font-size: 12.5px; color: var(--brand); margin-bottom: 6px; }
.tl ul { margin: 0; padding-left: 17px; font-size: 13px; color: var(--ink2); }
.tl ul li { margin-bottom: 3px; }
.tl .acc { margin-top: 6px; font-size: 12px; color: var(--ok); }

.callout { border-left: 3px solid var(--warn); background: #fffaf0; padding: 10px 14px; border-radius: 0 10px 10px 0; font-size: 13px; color: #7a5a12; }
.callout.info { border-color: var(--brand); background: #f5f8ff; color: #24408f; }
.callout.bad { border-color: var(--bad); background: #fdf3f3; color: #8f2b2b; }

.kv { display: grid; grid-template-columns: 86px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink2); }

.dual { display: grid; grid-template-columns: 58px 1fr 58px; gap: 8px; align-items: center; margin-bottom: 10px; font-size: 12.5px; }
.dual .l { text-align: right; color: var(--ink2); white-space: nowrap; }
.dual .r { color: var(--ink2); white-space: nowrap; }
.dual b.on { color: var(--brand); }
.dualtrack { height: 8px; background: #eef1f7; border-radius: 99px; position: relative; }
.dualtrack i, .dualtrack b { position: absolute; top: 0; bottom: 0; display: block; }
.dualtrack i { background: linear-gradient(90deg, #7d97ff, var(--brand)); border-radius: 99px 0 0 99px; }
.dualtrack b { background: linear-gradient(90deg, #f0b23f, #e2703a); border-radius: 0 99px 99px 0; }
.dualtrack .mid { position: absolute; left: 43%; width: 14%; top: 0; bottom: 0; background: rgba(110, 128, 155, .12); }
.dualtrack u { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: #b7c3d6; }

.typebig { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.typebig b { font-size: 38px; letter-spacing: .02em; color: var(--brand); line-height: 1; }
.typebig span { font-size: 16px; color: var(--ink); }

ul.clean { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--ink2); }
ul.clean li { margin-bottom: 4px; }

table.hist { width: 100%; border-collapse: collapse; font-size: 13px; }
table.hist th, table.hist td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
table.hist th { color: var(--muted); font-weight: 500; font-size: 12px; }
table.hist td.t { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: #16202b; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: 80vw; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #8f2b2b; }

footer { text-align: center; padding: 20px; font-size: 11.5px; color: var(--muted); }

@media (max-width: 820px) {
  .grid2, .grid2u, .entry { grid-template-columns: 1fr; }
  .hero { padding: 24px 20px; }
  .hero h2 { font-size: 21px; }
  .abgrid { grid-template-columns: 1fr; }
  .ab-mid { padding: 6px; }
  .scale { gap: 4px; }
  .opt { font-size: 11px; padding: 8px 2px; }
  .topnav button { padding: 6px 9px; font-size: 12px; }
  .brand p { display: none; }
  .qhead { top: 57px; }
  .dual { grid-template-columns: 48px 1fr 48px; font-size: 11.5px; }
}

@media print {
  .topbar, .submitbar, .btn, .topnav, footer, .print-hide { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #d8dee9; break-inside: avoid; }
  .view { animation: none; }
}
