:root {
  --bg: #0f1115;
  --bg-soft: #161a22;
  --panel: #1b2029;
  --panel-2: #20262f;
  --line: #2b323d;
  --ink: #eef2f7;
  --ink-soft: #aab4c2;
  --ink-dim: #7c8696;
  --brand: #6ee7b7;
  --brand-2: #38bdf8;
  --accent: #f59e0b;
  --good: #34d399;
  --ok: #60a5fa;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #1c2740 0%, transparent 55%), var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* Topbar */
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(15,17,21,.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  font-size: 26px; line-height: 1;
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #06121a; font-weight: 700;
}
h1 { font-size: 19px; margin: 0; letter-spacing: .3px; }
.tagline { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-soft); }

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 22px;
  padding-top: 24px;
  padding-bottom: 48px;
  align-items: start;
}
.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.input-panel { position: sticky; top: 86px; }
.panel-head h2, .scorecard h2 { font-size: 15px; margin: 0 0 4px; }
.panel-head .hint { margin: 0 0 14px; font-size: 12.5px; color: var(--ink-dim); }

/* Fields */
.field { margin-bottom: 12px; display: flex; flex-direction: column; gap: 5px; }
label { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.opt { color: var(--ink-dim); font-weight: 400; font-size: 11px; }
.req { color: var(--brand); font-weight: 600; font-size: 11px; }
input, select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none; border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(56,189,248,.15);
}
input::placeholder { color: #5c6675; }
.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 6px 0 4px; }
.metrics-grid .field { margin-bottom: 2px; }

/* Checklist */
.checklist-block { margin: 14px 0 6px; padding-top: 12px; border-top: 1px dashed var(--line); }
.block-label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin: 0 0 8px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.checks label { display: flex; align-items: center; gap: 7px; font-weight: 500; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; }
.checks input { width: auto; accent-color: var(--brand); }

/* Buttons */
.actions { display: flex; gap: 10px; margin-top: 16px; }
.primary-btn {
  flex: 1;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #06121a; font-weight: 700; font-size: 14px;
  border: none; border-radius: 10px; padding: 11px 16px; cursor: pointer;
  transition: transform .08s, filter .15s;
}
.primary-btn:hover { filter: brightness(1.06); }
.primary-btn:active { transform: translateY(1px); }
.ghost-btn {
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: 13px; cursor: pointer; font-family: inherit;
  transition: border-color .15s, color .15s;
}
.ghost-btn:hover { border-color: var(--brand-2); color: var(--ink); }
.privacy { font-size: 11.5px; color: var(--ink-dim); margin: 12px 0 0; }

/* Empty state */
.empty-state { text-align: center; padding: 40px 22px; color: var(--ink-soft); }
.empty-emoji { font-size: 46px; opacity: .5; }
.empty-state h2 { font-size: 17px; margin: 14px 0 8px; color: var(--ink); }
.empty-state p { font-size: 13.5px; max-width: 460px; margin: 0 auto 16px; }
.empty-points { text-align: left; max-width: 480px; margin: 0 auto; font-size: 13px; color: var(--ink-soft); padding-left: 18px; }
.empty-points li { margin-bottom: 6px; }

/* Scorecard */
.hidden { display: none; }
.score-hero {
  display: flex; align-items: center; gap: 22px;
  padding: 18px 20px; margin-bottom: 18px;
  border: 1px solid var(--line); border-radius: 12px;
  background: radial-gradient(420px 180px at 0% 0%, rgba(110,231,183,.10), transparent 60%), var(--panel-2);
}
.gauge { position: relative; width: 112px; height: 112px; flex: none; }
.gauge svg { transform: rotate(-90deg); }
.gauge .gauge-num { position: absolute; inset: 0; display: grid; place-items: center; }
.gauge .gauge-num b { font-size: 30px; line-height: 1; }
.gauge .gauge-num span { font-size: 11px; color: var(--ink-dim); }
.hero-meta h3 { margin: 0 0 4px; font-size: 16px; }
.grade-pill {
  display: inline-block; font-weight: 800; font-size: 13px;
  padding: 3px 12px; border-radius: 999px; margin-bottom: 8px;
}
.hero-meta .verdict { font-size: 13.5px; color: var(--ink-soft); margin: 0; }
.hero-meta .ctx { font-size: 12px; color: var(--ink-dim); margin: 6px 0 0; }

/* Dimension rows */
.dims { display: flex; flex-direction: column; gap: 10px; }
.dim {
  border: 1px solid var(--line); border-radius: 11px;
  padding: 12px 14px; background: var(--panel-2);
}
.dim-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.dim-name { font-weight: 700; font-size: 14px; }
.dim-name small { font-weight: 400; color: var(--ink-dim); font-size: 11.5px; margin-left: 6px; }
.dim-val { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink-soft); }
.dim-val b { font-size: 15px; }
.bar { height: 7px; border-radius: 999px; background: #2a313c; margin: 9px 0 8px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; transition: width .5s ease; }
.dim-diag { font-size: 12.5px; color: var(--ink-soft); margin: 0; }
.dim-diag .sug { color: var(--brand); }
.tier-tag { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 6px; margin-left: 8px; vertical-align: middle; }

.t-good { color: var(--good); } .bg-good { background: var(--good); } .pill-good { background: rgba(52,211,153,.15); color: var(--good); }
.t-ok { color: var(--ok); } .bg-ok { background: var(--ok); } .pill-ok { background: rgba(96,165,250,.15); color: var(--ok); }
.t-warn { color: var(--warn); } .bg-warn { background: var(--warn); } .pill-warn { background: rgba(251,191,36,.15); color: var(--warn); }
.t-bad { color: var(--bad); } .bg-bad { background: var(--bad); } .pill-bad { background: rgba(248,113,113,.15); color: var(--bad); }

/* Checklist output */
.next-block { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); padding: 16px 18px; }
.next-block h3 { margin: 0 0 10px; font-size: 15px; }
.next-list { list-style: none; margin: 0; padding: 0; counter-reset: n; }
.next-list li {
  counter-increment: n; position: relative;
  padding: 9px 10px 9px 38px; border-bottom: 1px dashed var(--line); font-size: 13.5px; color: var(--ink);
}
.next-list li:last-child { border-bottom: none; }
.next-list li::before {
  content: counter(n); position: absolute; left: 8px; top: 9px;
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #06121a; font-size: 12px; font-weight: 800;
}
.next-list li .why { display: block; color: var(--ink-dim); font-size: 12px; margin-top: 2px; }

/* Export bar */
.export-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.export-bar button { flex: 1; min-width: 130px; }

/* Toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--brand); color: #06121a; font-weight: 700; font-size: 13px;
  padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 50; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 22px 0 36px; }
.site-footer p { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 4px; }
.site-footer .muted { color: var(--ink-dim); font-size: 11.5px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .input-panel { position: static; }
  .score-hero { flex-direction: column; text-align: center; }
}
