:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1a1d23;
  --muted: #5c6570;
  --line: #e3e6ea;
  --accent: #1f5fa8;
  --accent-soft: #eaf1f9;
  --ok: #1a7f55;
  --warn: #a8641f;
  --radius: 10px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.75;
  font-size: 16px;
}

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

header.site {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}
header.site a.brand {
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 17px;
  letter-spacing: .2px;
}
header.site nav a {
  color: var(--muted); text-decoration: none; font-size: 14px; margin-left: 18px;
}
header.site nav a:hover { color: var(--accent); }

main { padding: 30px 0 60px; }

h1 {
  font-size: 27px; line-height: 1.35; margin: 0 0 8px;
  letter-spacing: -.3px;
}
.sub { color: var(--muted); font-size: 15px; margin: 0 0 26px; }

h2 {
  font-size: 20px; margin: 38px 0 12px; padding-top: 4px;
  letter-spacing: -.2px;
}
h3 { font-size: 16px; margin: 22px 0 6px; }

p { margin: 10px 0; }
ul, ol { padding-left: 22px; margin: 10px 0; }
li { margin: 6px 0; }

code {
  background: #eef1f4; padding: 1px 6px; border-radius: 4px;
  font-size: .92em; font-family: ui-monospace, Consolas, monospace;
}

/* 工具卡片 */
.tool {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin: 0 0 8px;
}

.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 14px; color: var(--muted);
  margin-bottom: 6px; font-weight: 600;
}
.field .hint { font-size: 12.5px; color: #8a929c; margin-top: 5px; }

input[type="number"], input[type="text"], textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cfd5dc;
  border-radius: 7px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
input:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31,95,168,.12);
}
textarea { min-height: 96px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 14px; }

button.calc {
  background: var(--accent); color: #fff; border: 0;
  padding: 12px 26px; border-radius: 7px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
button.calc:hover { background: #18497f; }
button.calc:active { transform: translateY(1px); }

.result {
  margin-top: 18px; padding: 18px;
  background: var(--accent-soft);
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  display: none;
}
.result.show { display: block; }
.result .big {
  font-size: 34px; font-weight: 700; color: var(--accent);
  line-height: 1.2; letter-spacing: -.5px;
}
.result .label { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.result .verdict { margin-top: 10px; font-size: 14.5px; }
.result .detail { margin-top: 8px; font-size: 13.5px; color: var(--muted); }

.err {
  margin-top: 14px; padding: 12px 16px;
  background: #fdf1ec; border-left: 4px solid #c04a22;
  border-radius: 6px; color: #8a3312; font-size: 14px;
  display: none;
}
.err.show { display: block; }

/* 公式 */
.formula {
  background: #f2f4f7; border: 1px solid var(--line);
  border-radius: 7px; padding: 14px 18px; margin: 14px 0;
  font-family: ui-monospace, Consolas, monospace; font-size: 15px;
  overflow-x: auto;
}

/* FAQ */
.faq-item {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item .q { font-weight: 700; margin: 0 0 6px; font-size: 15.5px; }
.faq-item .a { margin: 0; color: #3c434c; font-size: 15px; }

/* 相关工具 */
.related {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; margin-top: 14px;
}
.related a {
  display: block; padding: 15px 17px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; text-decoration: none; color: var(--text);
  transition: border-color .15s;
}
.related a:hover { border-color: var(--accent); }
.related a .t { font-weight: 700; font-size: 15px; }
.related a .d { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* 首页工具列表 */
.tool-list { display: grid; gap: 14px; margin-top: 22px; }
.tool-list a {
  display: block; padding: 20px 22px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.tool-list a:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.tool-list .t { font-size: 17px; font-weight: 700; }
.tool-list .d { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* 提示条 */
.note {
  background: #fbf7ec; border-left: 4px solid #c9a227;
  padding: 13px 17px; border-radius: 6px; font-size: 14px;
  color: #5c4a10; margin: 18px 0;
}
.warnbox {
  background: #fdf1ec; border-left: 4px solid #c04a22;
  padding: 13px 17px; border-radius: 6px; font-size: 14px;
  color: #8a3312; margin: 18px 0;
}

footer.site {
  border-top: 1px solid var(--line);
  padding: 26px 0; color: var(--muted); font-size: 13px;
  background: var(--card);
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between; }

.updated { color: #8a929c; font-size: 13px; margin-top: 30px; }

@media (max-width: 560px) {
  h1 { font-size: 23px; }
  .wrap { padding: 0 16px; }
  .tool { padding: 17px; }
  .result .big { font-size: 28px; }
  header.site nav a { margin-left: 12px; font-size: 13px; }
}
