/* SRI-Open 样式 —— 零依赖、移动端优先 */

:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #1c2130;
  --ink-2: #5a6377;
  --line: #e4e7f0;
  --accent: #5b5bd6;
  --accent-2: #4747b8;
  --accent-soft: #eeeefc;
  --ok: #1a9e6c;
  --warn: #d0762b;
  --mid: #5b5bd6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 33, 48, .05), 0 8px 28px rgba(28, 33, 48, .07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 880px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  font-weight: 800; font-size: 17px; color: var(--ink);
  text-decoration: none; letter-spacing: .3px;
}
.brand .free {
  background: var(--accent-soft); color: var(--accent-2);
  font-size: 11px; font-weight: 700; border-radius: 999px;
  padding: 2px 8px; margin-left: 6px; vertical-align: 2px;
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--ink-2); text-decoration: none; font-size: 14px;
  padding: 6px 12px; border-radius: 8px;
}
.nav-links a:hover { background: var(--accent-soft); color: var(--accent-2); }

/* ---------- 通用卡片/排版 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 26px;
}
.card + .card { margin-top: 18px; }

.hero { padding: 56px 0 30px; text-align: center; }
.hero h1 { font-size: clamp(26px, 5vw, 40px); line-height: 1.3; margin: 0 0 12px; }
.hero .sub { color: var(--ink-2); font-size: 16px; max-width: 620px; margin: 0 auto 22px; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 26px 0;
}
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 8px; text-align: center;
}
.stat b { display: block; font-size: 22px; color: var(--accent-2); }
.stat span { font-size: 12px; color: var(--ink-2); }

.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 600;
  padding: 13px 26px; border-radius: 12px;
  transition: background .15s ease, transform .1s ease;
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: transparent; color: var(--accent-2);
  border: 1.5px solid var(--accent);
}
.btn.ghost:hover { background: var(--accent-soft); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

h2.section { font-size: 24px; margin: 34px 0 6px; }
p.lead { color: var(--ink-2); margin: 0 0 18px; }

.tag {
  display: inline-block; background: var(--accent-soft); color: var(--accent-2);
  font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 3px 12px;
  margin: 0 6px 8px 0;
}

/* ---------- 徽章 / 提示 ---------- */
.notice {
  border-radius: 12px; padding: 14px 16px; font-size: 14px;
  background: #fff8ec; border: 1px solid #f2ddb7; color: #7a5417;
  margin: 16px 0;
}
.notice.blue { background: #eef4ff; border-color: #c9dafc; color: #2c4d8f; }
.notice.green { background: #ecfbf3; border-color: #bfe9d6; color: #14684a; }

/* ---------- 表格 ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }

/* ---------- 测评页 ---------- */
.progress-shell { position: sticky; top: 0; z-index: 40; background: rgba(246,247,251,.94); backdrop-filter: blur(8px); padding: 10px 0 12px; }
.progress-bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #8a7ff0); border-radius: 999px; transition: width .25s ease; }
.progress-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }

.q-scale-tag { color: var(--accent-2); font-weight: 700; font-size: 13px; letter-spacing: .5px; }
.q-text { font-size: 21px; font-weight: 650; line-height: 1.6; margin: 10px 0 22px; }

.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; padding: 13px 16px; cursor: pointer; font-size: 16px;
  transition: border-color .12s, background .12s;
  text-align: left; width: 100%; font-family: inherit; color: inherit;
}
.opt:hover { border-color: var(--accent); }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.opt .dot {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%;
  border: 2px solid var(--line); background: #fff;
}
.opt.sel .dot { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 4px #fff; }

.nav-btns { display: flex; justify-content: space-between; margin-top: 20px; gap: 10px; }

/* ---------- 结果页 ---------- */
.sri-big {
  display: flex; align-items: baseline; justify-content: center; gap: 10px;
  margin: 6px 0 2px;
}
.sri-big .num { font-size: 72px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.sri-big .unit { font-size: 18px; color: var(--ink-2); }
.level-pill {
  display: inline-block; font-weight: 700; border-radius: 999px; padding: 4px 16px;
  font-size: 15px; margin-bottom: 8px;
}
.level-pill.ok { background: #e2f7ee; color: var(--ok); }
.level-pill.mid { background: var(--accent-soft); color: var(--accent-2); }
.level-pill.warn { background: #fdeede; color: var(--warn); }

.scale-note { color: var(--ink-2); font-size: 13.5px; margin: 4px 0 18px; }

.dim { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 10px 0; background: #fbfbfe; }
.dim-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.dim-name { font-weight: 700; }
.dim-z { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dim-raw { font-size: 13px; color: var(--ink-2); }
.dim-bar { height: 8px; border-radius: 999px; background: var(--line); margin: 10px 0 4px; position: relative; overflow: hidden; }
.dim-bar i {
  position: absolute; top: 0; bottom: 0; background: var(--accent);
  border-radius: 999px; transition: all .4s ease;
}
.dim-bar .midline { position: absolute; top: -2px; bottom: -2px; left: 50%; width: 2px; background: #b9bfd4; }
.dim-text { font-size: 14px; color: var(--ink-2); margin-top: 8px; }

.chart-wrap { margin: 8px 0 4px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }

.history-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 8px 0;
  background: #fff; flex-wrap: wrap;
}
.history-item .h-sri { font-weight: 800; font-size: 18px; color: var(--accent-2); min-width: 90px; }
.history-item .h-date { color: var(--ink-2); font-size: 13px; flex: 1; }

details.refs { margin: 10px 0; }
details.refs summary { cursor: pointer; font-weight: 600; color: var(--accent-2); }
.refs ol { padding-left: 20px; margin: 10px 0 0; }
.refs li { margin-bottom: 8px; font-size: 14px; }

footer.site {
  margin: 48px 0 40px; color: var(--ink-2); font-size: 13px; text-align: center;
}
footer.site a { color: var(--accent-2); }

code.inline {
  background: #eef0f7; border-radius: 6px; padding: 1px 7px;
  font-size: 13px; font-family: Consolas, "Courier New", monospace;
}

pre.formula {
  background: #23283b; color: #dfe4ff; border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; font-size: 14px; line-height: 1.9;
}

@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 20px 18px; }
  .q-text { font-size: 18.5px; }
  .nav-links a { padding: 6px 8px; font-size: 13px; }
}
