:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #182234;
  --ink-soft: #5b6879;
  --line: #e3e8f1;
  --brand: #2f6df6;
  --brand-ink: #1b4fd0;
  --ok: #12a150;
  --warn: #d98600;
  --bad: #d64545;
  --ring-track: #e7edf8;
  --shadow: 0 8px 30px rgba(24, 44, 84, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #eef2fb 0%, var(--bg) 260px);
  line-height: 1.6;
}

.wrap { width: min(1120px, 92vw); margin: 0 auto; }

/* Topbar */
.topbar {
  background: linear-gradient(120deg, #24345c 0%, #2f4c9c 55%, #2f6df6 100%);
  color: #fff;
  padding: 22px 0;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  font-size: 34px;
  background: rgba(255, 255, 255, 0.14);
  width: 58px; height: 58px;
  display: grid; place-items: center;
  border-radius: 16px;
  flex: none;
}
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: 0.3px; }
.topbar .tag { margin: 3px 0 0; font-size: 13.5px; opacity: 0.9; max-width: 640px; }
.ghost-link {
  color: #fff; text-decoration: none; font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 8px 16px; border-radius: 999px; white-space: nowrap;
  transition: background 0.15s;
}
.ghost-link:hover { background: rgba(255, 255, 255, 0.16); }

/* Layout */
.layout {
  display: grid;
  grid-template-columns: minmax(320px, 400px) 1fr;
  gap: 22px;
  margin: 26px auto;
  align-items: start;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.panel-title { margin: 0 0 4px; font-size: 17px; }
.panel-sub { margin: 0 0 16px; color: var(--ink-soft); font-size: 13px; }

/* Form */
.fields { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field .label { font-size: 13px; font-weight: 600; color: #2a3648; }
.field select {
  appearance: none;
  width: 100%;
  padding: 10px 34px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235b6879' d='M6 8 0 0h12z'/%3E%3C/svg%3E") no-repeat right 12px center;
  font-size: 14px; color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.15);
}
.form-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 18px; gap: 12px;
}
.selftest { font-size: 12px; color: var(--ink-soft); }
.selftest.ok { color: var(--ok); }
.selftest.err { color: var(--bad); font-weight: 600; }

/* Buttons */
.btn {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, background 0.15s;
}
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: #fff; color: var(--brand-ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand); background: #f5f8ff; }

/* Score head */
.score-head {
  display: flex; align-items: center; gap: 22px;
  padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px;
}
.score-ring {
  --val: 0;
  --col: var(--brand);
  position: relative;
  width: 128px; height: 128px; flex: none;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, #fff 78%, transparent 79% 100%),
    conic-gradient(var(--col) calc(var(--val) * 1%), var(--ring-track) 0);
  display: grid; place-items: center;
  text-align: center;
  transition: background 0.4s ease;
}
.score-num { font-size: 30px; font-weight: 700; line-height: 1; color: var(--ink); }
.score-num small { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.score-cap { font-size: 11.5px; color: var(--ink-soft); margin-top: 4px; letter-spacing: 1px; }
.verdict { flex: 1; }
.verdict-badge {
  display: inline-block;
  font-size: 14px; font-weight: 700;
  padding: 5px 14px; border-radius: 999px;
  color: #fff; background: var(--ink-soft);
}
.verdict-badge.ready { background: var(--ok); }
.verdict-badge.prep { background: var(--warn); }
.verdict-badge.block { background: var(--bad); }
.verdict-detail { margin: 12px 0 0; color: #3a4658; font-size: 14px; }

/* Dimensions */
.dims { display: grid; gap: 11px; margin-bottom: 20px; }
.dim { display: grid; grid-template-columns: 92px 1fr 42px; align-items: center; gap: 10px; }
.dim-name { font-size: 13px; color: #35435a; font-weight: 600; }
.dim-bar { height: 9px; border-radius: 6px; background: var(--ring-track); overflow: hidden; }
.dim-fill { height: 100%; border-radius: 6px; width: 0; transition: width 0.4s ease, background 0.3s; }
.dim-val { font-size: 13px; text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* Cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 16px;
  background: #fbfcff;
}
.card h3 { margin: 0 0 10px; font-size: 14.5px; }
.card-body { font-size: 13.5px; color: #37445a; }
.chunk-row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }
.chunk-row b { color: var(--ink); font-weight: 600; }
.chunk-note { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--ink-soft); }

ul.bullet, ul.meta-list, ul.risk-list { margin: 0; padding-left: 0; list-style: none; }
ul.bullet li { font-size: 13.5px; color: #37445a; padding: 5px 0 5px 18px; position: relative; }
ul.bullet li::before { content: "›"; position: absolute; left: 4px; color: var(--brand); font-weight: 700; }
.meta-list li { font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.meta-list li:last-child { border-bottom: none; }
.meta-list code {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  background: #eef2fb; color: var(--brand-ink);
  padding: 1px 6px; border-radius: 5px; font-size: 12px;
}
.meta-list .why { color: var(--ink-soft); }
.risk-list li { font-size: 13.5px; color: #37445a; padding: 6px 0; }
.risk-tag {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  color: var(--bad); background: #fdecec;
  padding: 1px 8px; border-radius: 6px; margin-right: 6px;
}

/* Export */
.export { display: flex; align-items: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.copied { font-size: 13px; color: var(--ok); font-weight: 600; opacity: 0; transition: opacity 0.2s; }
.copied.show { opacity: 1; }

/* How */
.how { margin: 40px auto 10px; }
.how h2 { font-size: 20px; margin-bottom: 18px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.how-grid h4 { margin: 0 0 6px; font-size: 15px; }
.how-grid p { margin: 0; color: var(--ink-soft); font-size: 13.5px; }
.disclaimer { margin-top: 18px; color: var(--ink-soft); font-size: 13px; }

/* Footer */
.foot { margin-top: 46px; padding: 22px 0; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 12.5px; }
.foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .score-head { flex-direction: column; text-align: center; align-items: center; }
  .verdict { text-align: center; }
}
@media (max-width: 560px) {
  .topbar h1 { font-size: 19px; }
  .topbar .tag { font-size: 12.5px; }
  .foot .wrap { flex-direction: column; }
}
