/* 所有站点共用的基础样式。各站在自己的 CSS 里覆盖下面的变量来换配色和字体。 */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f4efe8;
  --text: #2b2420;
  --muted: #74685f;
  --line: #e9e1d6;
  --accent: #b5532f;
  --accent-ink: #ffffff;
  --accent-soft: #f7e6dc;
  --accent-2: #5f8a6a;
  --accent-2-soft: #e3eee5;
  --accent-3: #d4a03c;
  --accent-3-soft: #f8edd6;
  --ok: #3f7d55;
  --warn: #a15c00;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 6px 24px rgba(60, 40, 20, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1816;
    --surface: #24201d;
    --surface-2: #2c2723;
    --text: #f0e9e1;
    --muted: #ab9f94;
    --line: #3a332e;
    --accent: #e48663;
    --accent-ink: #1b1816;
    --accent-soft: #3a2a22;
    --accent-2: #8fbc98;
    --accent-2-soft: #26332a;
    --accent-3: #e7bd62;
    --accent-3-soft: #3a3020;
    --ok: #7cc795;
    --warn: #e7b05a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 var(--font); }
a { color: var(--accent); text-underline-offset: 2px; }
img, svg { max-width: 100%; }
.wrap { max-width: 900px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.12; margin: 10px 0 14px; }
h2 { font-size: clamp(22px, 4vw, 27px); line-height: 1.25; margin: 44px 0 12px; }
h3 { font-size: 19px; margin: 28px 0 10px; }

/* 页头 */
.site-header { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; color: var(--text); text-decoration: none; font-size: 21px; }
.logo svg { width: 30px; height: 30px; }
.site-header nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 15px; padding: 6px 12px; border-radius: 99px; }
.site-header nav a:hover { color: var(--text); background: var(--surface-2); }
.site-header nav a[aria-current] { color: var(--accent); background: var(--accent-soft); }

main { padding: 18px 16px 56px; }
.lead { font-size: 19px; color: var(--muted); margin-top: 0; max-width: 680px; }
.crumbs { font-size: 14px; color: var(--muted); margin-top: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

/* 工具区 */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 26px 0; box-shadow: var(--shadow); }
.tool h3 { margin-top: 22px; }
.tool .row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.tool label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; flex: 1 1 160px; }
.tool label small { font-weight: 400; color: var(--muted); }
.tool input, .tool select, .tool textarea {
  font: inherit; font-size: 16px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); width: 100%; transition: border-color .15s, box-shadow .15s;
}
.tool textarea { min-height: 96px; resize: vertical; }
.tool input:focus, .tool select:focus, .tool textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tool input[type="checkbox"] { width: auto; padding: 0; accent-color: var(--accent); }
.tool label.inline { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }

/* 带 − / + 按钮的数字框，手机上不用弹键盘也能调 */
.stepper { display: flex; align-items: stretch; }
.stepper input { border-radius: 0; text-align: center; min-width: 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper button { flex: none; width: 42px; font: inherit; font-size: 20px; line-height: 1; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
.stepper button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: 0; }
.stepper button:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; }
.stepper button:hover { background: var(--accent-soft); color: var(--accent); }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 99px; padding: 4px; gap: 2px; }
.seg button { font: inherit; font-size: 15px; border: 0; background: transparent; color: var(--muted); padding: 7px 16px; border-radius: 99px; cursor: pointer; transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 15px; font-weight: 600; border: 1.5px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 8px 16px; border-radius: 99px; cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn:hover { filter: brightness(1.05); }
.btn.ghost:hover { background: var(--accent-soft); }

/* 结果区 */
.result { margin-top: 20px; padding-top: 20px; border-top: 1.5px dashed var(--line); }
.answer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; background: var(--accent-soft); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px; }
.answer .label { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 700; width: 100%; }
.answer .big { font-family: var(--font-display); font-size: clamp(28px, 6vw, 38px); font-weight: 700; line-height: 1.1; margin: 0; }
.answer .sub { color: var(--muted); font-size: 15px; }
.big { font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.instruction { font-family: var(--font-mono); background: var(--surface-2); padding: 14px 16px; border-radius: var(--radius-sm); font-size: 16px; word-break: break-word; border-left: 4px solid var(--accent); }
.instruction mark { background: var(--accent-3-soft); color: inherit; padding: 0 3px; border-radius: 3px; font-weight: 700; }
.error { color: var(--warn); font-weight: 600; background: var(--accent-3-soft); padding: 10px 14px; border-radius: var(--radius-sm); }
.note { font-size: 14px; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.panel { background: var(--surface-2); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.panel h3:first-child { margin-top: 0; }
.figure { margin: 10px 0; }
.figure svg { display: block; width: 100%; height: auto; }
.figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 6px; }
table.grid { border-collapse: collapse; width: 100%; font-size: 15px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 9px 8px; text-align: left; }
table.grid th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 正文 */
.content { margin-top: 8px; max-width: 720px; }
.content table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 12px 0; }
.content th, .content td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; }
.content code { font-family: var(--font-mono); font-size: .92em; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.content li { margin: 4px 0; }
.faq { max-width: 720px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details div { margin-top: 8px; color: var(--muted); }

/* 卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 18px 0; }
.card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card .icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.card .icon svg { width: 26px; height: 26px; }
.card strong { font-family: var(--font-display); font-size: 19px; }
.card span { font-size: 14px; color: var(--muted); }
.card .go { margin-top: auto; font-size: 14px; font-weight: 600; font-style: normal; color: var(--accent); }

.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: center; padding: 28px 0 8px; }
.hero h1 { font-size: clamp(34px, 6.5vw, 52px); }
.hero-art svg { width: 100%; height: auto; display: block; }
@media (max-width: 700px) { .hero { grid-template-columns: 1fr; } .hero-art { max-width: 340px; } }

.ad-slot { margin: 28px 0; min-height: 90px; }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 14px; color: var(--muted); background: var(--surface-2); }
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--muted); }
.updated { font-size: 14px; margin-top: 36px; }

@media (max-width: 520px) {
  .tool { padding: 16px; margin: 20px -4px; }
  .answer { padding: 14px 16px; }
}

@media print {
  .site-header, .site-footer, .crumbs, .faq, .related, .ad-slot, .no-print, .content, .lead, h1 { display: none !important; }
  body { background: #fff; color: #000; }
  .tool { border: 0; padding: 0; box-shadow: none; }
}
