/* Paper Sizes - premium UI, following ui-skill design principles in the spec.
   Warm oklch tokens, single teal accent, two-layer shadows, no transition:all,
   CJK-safe typography, html.js-gated reveal, overflow clip. */
:root {
  --bg: oklch(98.5% 0.006 85);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(96.5% 0.012 80);
  --ink: oklch(24% 0.02 260);
  --ink-2: oklch(45% 0.02 260);
  --ink-3: oklch(60% 0.018 260);
  --accent: oklch(48% 0.09 185);
  --accent-strong: oklch(40% 0.1 185);
  --accent-soft: oklch(95% 0.02 185);
  --border: oklch(90% 0.01 80);
  --radius: 14px;
  --radius-full: 999px;
  --shadow-1: 0 1px 2px oklch(30% 0.03 260 / 0.06);
  --shadow-2: 0 12px 32px -12px oklch(30% 0.04 185 / 0.18);
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}
[hidden] { display: none !important; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.wrap { width: min(1080px, calc(100% - 2.5rem)); margin-inline: auto; }
.wrap-narrow { width: min(740px, calc(100% - 2.5rem)); margin-inline: auto; }
.h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.16; letter-spacing: -0.01em; margin: 0; }
.h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); line-height: 1.3; margin: 0 0 1rem; }
.h3 { font-size: 1.05rem; margin: 0 0 0.75rem; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: oklch(98.5% 0.006 85 / 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.25rem; min-height: 62px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--ink); letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  border-radius: 9px; background: var(--accent); color: #fff;
  font-family: Georgia, serif; font-size: 18px; line-height: 1;
}
.nav { display: flex; align-items: center; gap: 1.1rem; margin-left: 1rem; }
.nav a { color: var(--ink-2); font-size: .92rem; font-weight: 600; }
.nav a:hover, .nav a.active { color: var(--accent-strong); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: .9rem; margin-left: auto; }
.visit { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--ink-2); white-space: nowrap; }
.visit-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.visit-num { font-family: var(--mono); font-weight: 700; color: var(--ink); }
.visit-unit { color: var(--ink-3); }
.lang-switch {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 34px; padding: 0 .7rem;
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface); color: var(--ink); font-size: .82rem; font-weight: 700;
}
.lang-switch:hover { border-color: var(--accent); color: var(--accent-strong); text-decoration: none; }

/* hero */
.hero { padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2rem, 5vw, 3rem); }
.hero-inner { max-width: 760px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-strong); background: var(--accent-soft);
  padding: .4rem .85rem; border-radius: var(--radius-full);
  justify-self: start; width: fit-content;
}
.hero .h1 { margin-top: 1.1rem; }
.hero .h1 em { font-style: normal; color: var(--accent-strong); }
.hero-gap { white-space: pre; display: inline; }
.hero-sub { margin: 1.25rem 0 0; font-size: clamp(1rem, 2.2vw, 1.15rem); color: var(--ink-2); max-width: 62ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.hero-privacy { margin-top: 1.4rem; font-size: .84rem; color: var(--ink-3); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .65rem 1.25rem; border-radius: 11px;
  font-size: .95rem; font-weight: 700; cursor: pointer; border: 1px solid transparent;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-1), var(--shadow-2); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border); box-shadow: var(--shadow-1); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-strong); }

/* calculator */
.calc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-1); }
.calc-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.field { display: flex; flex-direction: column; gap: .4rem; flex: 1 1 280px; font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.field input {
  min-height: 46px; padding: .6rem .85rem; border: 1px solid var(--border);
  border-radius: 10px; font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg);
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.calc-hint { margin: .9rem 0 0; font-size: .82rem; color: var(--ink-3); }
.calc-result {
  margin-top: 1rem; padding: 1rem 1.1rem; border-radius: 11px;
  background: var(--accent-soft); border: 1px solid oklch(85% 0.04 185);
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
}
.result-label { font-size: .82rem; color: var(--ink-2); font-weight: 700; }
.result-value { font-size: 1.15rem; font-weight: 800; color: var(--accent-strong); }
.result-range { flex: 1 1 100%; font-size: .85rem; color: var(--ink-2); }

/* cards / facts */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.35rem; box-shadow: var(--shadow-1); }
.card h3 { margin: 0 0 .45rem; font-size: 1rem; color: var(--ink); }
.card p { margin: 0; color: var(--ink-2); font-size: .92rem; }

/* answer block */
.section { padding-top: 1.5rem; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; font-size: .84rem; color: var(--ink-3); margin-bottom: 1.25rem; }
.crumbs .sep { opacity: .5; }
.answer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.5rem); box-shadow: var(--shadow-2); }
.answer-sub { margin: .6rem 0 1.4rem; color: var(--ink-2); max-width: 68ch; }
.answer-symbol {
  display: inline-block; font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 800;
  color: var(--accent-strong); letter-spacing: -.01em; line-height: 1.15;
  padding: .35rem 0; border-bottom: 3px solid var(--accent);
}
.answer-unit { font-size: .5em; color: var(--ink-2); }
.answer-caption { font-size: .85rem; color: var(--ink-3); margin: .5rem 0 1.5rem; }
.fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.75rem; border-top: 1px solid var(--border); }
.fact-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.fact-row dt { color: var(--ink-2); font-size: .88rem; }
.fact-row dd { margin: 0; text-align: right; font-size: .9rem; color: var(--ink); font-weight: 700; }
.fact-row dd a { font-weight: 700; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: .55rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 34px;
  padding: .35rem .75rem; border-radius: var(--radius-full);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--ink); font-size: .84rem; font-weight: 600; box-shadow: var(--shadow-1);
}
.chip:hover { border-color: var(--accent); color: var(--accent-strong); text-decoration: none; }
.chip-static { background: var(--surface-2); }
.chip-sym { color: var(--accent-strong); font-weight: 800; }
.chip-filter { cursor: pointer; font-family: inherit; }
.chip-filter.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip-filter.is-active .mono { color: #fff; }

/* table */
.table-wrap { margin-top: .5rem; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
caption { text-align: left; padding: .9rem 1rem; font-weight: 800; color: var(--ink); border-bottom: 1px solid var(--border); }
th, td { padding: .6rem 1rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--accent-soft); }
td.num { color: var(--ink-3); }
.sym-cell a { font-weight: 800; color: var(--accent-strong); }

/* faq / steps / caveat / disclaimer */
.faq { padding: 2rem 0 1rem; }
.faq details { border-bottom: 1px solid var(--border); padding: .7rem 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.faq p { margin: .6rem 0 .3rem; color: var(--ink-2); font-size: .93rem; }
.steps { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .9rem; }
.step { display: flex; gap: .9rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 1rem 1.15rem; }
.step-n { display: inline-grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-strong); font-family: var(--mono); font-weight: 800; }
.step p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.caveat { background: oklch(97% 0.02 75); border: 1px solid oklch(88% 0.03 75); border-radius: var(--radius); padding: 1.25rem 1.4rem; }
.caveat h3 { margin: 0 0 .5rem; font-size: 1rem; }
.caveat p { margin: 0; color: var(--ink-2); font-size: .92rem; }
.disclaimer { margin: 2.5rem 0 1rem; background: var(--surface-2); border-radius: var(--radius); padding: 1.1rem 1.35rem; }
.disclaimer h3 { margin: 0 0 .35rem; font-size: .95rem; }
.disclaimer p { margin: 0; color: var(--ink-3); font-size: .84rem; }

/* footer */
.site-footer { margin-top: 3rem; border-top: 1px solid var(--border); background: var(--surface); padding: 2rem 0 1.5rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: flex-start; }
.footer-tagline { margin: .5rem 0 0; color: var(--ink-3); font-size: .88rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: .88rem; }
.footer-legal { width: min(1080px, calc(100% - 2.5rem)); margin: 1.5rem auto 0; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--ink-3); font-size: .8rem; }

/* reveal (E12: hidden only when JS enabled, inline .js set before stylesheet) */
html.js .t-reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
html.js .t-reveal.in { opacity: 1; transform: none; }
/* t-word entrance uses an animation that ENDS visible. Unlike the old
   opacity:0-waiting-for-.in approach, a stalled JS can never leave the hero
   headline invisible (E12/E18 lesson). */
html.js .t-word { display: inline-block; animation: word-in .5s ease both; }
html.js .t-word.in { animation: word-in .5s ease both; }
@keyframes word-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html.js .t-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  html.js .t-word { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* responsive */
@media (max-width: 720px) {
  .cards, .fact-grid { grid-template-columns: 1fr; }
  .nav { margin-left: 0; order: 3; width: 100%; gap: .9rem; }
  .header-inner { padding-block: .6rem; }
  .field input { width: 100%; }
  .calc-form .btn { width: 100%; }
}
