/*!
 * style.css — /circle-geometry/  (际和 GiTech Design · 公益)
 * Palette and restraint follow the main site: white paper, near-black ink,
 * one iridescent gradient used sparingly. Self-hosted only: no webfonts, no CDN
 * (fonts.googleapis is slow or blocked on the mainland).
 */
:root {
  --paper-pure: #fff;
  --paper: #f5f5f7;
  --mist: #fafafc;
  --ink: #1d1d1f;
  --ink-soft: #2a2a2e;
  --ink-muted: #6e6e73;
  --ink-faint: #86868b;
  --line: #e6e6ea;
  --blue: #0a66ff;
  --night: #08080a;
  --crimson: #d8315b;
  --violet: #7a3ff2;
  --amber: #c2410c;
  --iri: linear-gradient(102deg, #4e8cff, #8b7bff, #c77bff, #ff7eb0, #ffb37a);
  --maxw: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 78px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--paper-pure);
  line-height: 1.75;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
b, strong { font-weight: 650; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.iri-text {
  background: var(--iri); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.iri-line { background: var(--iri); }

/* ------------------------------------------------------------------ header */
.top {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; gap: 14px; height: 56px; }
.brand { font-weight: 650; letter-spacing: -.02em; font-size: 15px; color: var(--ink); }
.brand:hover { text-decoration: none; opacity: .7; }
.brand span { color: var(--ink-faint); font-weight: 450; margin-left: 8px; }
.top-sp { flex: 1; }
.top a.home { font-size: 13.5px; color: var(--ink-muted); }
.toc-toggle {
  display: none; border: 1px solid var(--line); background: var(--paper-pure);
  border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13.5px;
  color: var(--ink); cursor: pointer;
}

/* -------------------------------------------------------------------- hero */
.hero { padding: 62px 0 30px; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; left: 50%; bottom: -170px; width: 720px; height: 320px;
  transform: translateX(-50%); background: var(--iri); filter: blur(90px); opacity: .16;
  pointer-events: none;
}
.kicker {
  font-size: 12px; font-weight: 650; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-faint);
}
h1 { font-size: clamp(30px, 5.2vw, 52px); line-height: 1.14; letter-spacing: -.035em; font-weight: 700; margin: 14px 0 0; }
.hero p.lead { margin-top: 20px; max-width: 720px; font-size: 17.5px; color: var(--ink-muted); }
.hero .jp { color: var(--ink-faint); font-size: 14.5px; margin-top: 10px; }
.hero-cta { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 11px 22px; font-size: 14.5px; font-weight: 600; border: 1px solid transparent;
  cursor: pointer; transition: all .28s cubic-bezier(.22, 1, .36, 1); font-family: inherit;
}
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; text-decoration: none; transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--paper-pure); }
.btn-ghost:hover { border-color: #c9c9d1; text-decoration: none; transform: translateY(-1px); }

/* ------------------------------------------------------------------ layout */
.body-grid { display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 1080px) { .body-grid { grid-template-columns: minmax(0, 1fr); gap: 0; } }

.toc { position: sticky; top: 78px; padding: 8px 0 40px; font-size: 13.5px; }
.toc h2 { font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; font-weight: 650; }
.toc a { display: block; color: var(--ink-muted); padding: 4.5px 0 4.5px 11px; border-left: 2px solid var(--line); line-height: 1.5; }
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.on { color: var(--ink); font-weight: 620; border-left-color: var(--ink); }
.toc .grp { margin-top: 15px; }

@media (max-width: 1080px) {
  .toc-toggle { display: inline-block; }
  .toc {
    position: fixed; inset: 56px 0 auto 0; background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(18px); border-bottom: 1px solid var(--line);
    max-height: 72vh; overflow: auto; padding: 16px 22px 22px; display: none; z-index: 55;
  }
  .toc.open { display: block; }
}

/* ---------------------------------------------------------------- sections */
section.blk { padding: 46px 0 10px; scroll-margin-top: 74px; }
h2.sec { font-size: clamp(23px, 3.4vw, 31px); letter-spacing: -.03em; line-height: 1.25; font-weight: 700; }
h2.sec .n { color: var(--ink-faint); font-weight: 600; margin-right: 12px; font-size: .72em; letter-spacing: 0; }
.sec-lead { color: var(--ink-muted); margin-top: 12px; max-width: 760px; font-size: 16px; }

.card {
  border: 1px solid var(--line); border-radius: 22px; background: var(--paper-pure);
  padding: 26px 26px 22px; margin-top: 22px; scroll-margin-top: 74px;
}
.card.tinted { background: var(--mist); }
.card h3 { font-size: 20px; letter-spacing: -.02em; line-height: 1.35; font-weight: 680; }
.card h3 .num {
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em; color: var(--ink-faint);
  display: inline-block; margin-right: 10px; vertical-align: 2px;
}
.card h3 .ja { font-size: 14px; color: var(--ink-faint); font-weight: 500; margin-left: 10px; letter-spacing: 0; }
.card .stmt {
  margin-top: 13px; padding: 13px 16px; border-radius: 13px; background: var(--paper);
  font-size: 15.5px; line-height: 1.72;
}
.card .stmt.key { background: #fff; border: 1px solid var(--line); box-shadow: inset 3px 0 0 0 var(--crimson); }
.card p.note { margin-top: 13px; font-size: 14.5px; color: var(--ink-muted); }
.card p.note b { color: var(--ink); }

.tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.tags .lb { font-size: 12.5px; color: var(--ink-faint); margin-right: 2px; }
.tag {
  font-size: 12.5px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px;
  color: var(--ink-muted); background: var(--paper-pure);
}
a.tag:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }

/* ------------------------------------------------------------------ figure */
.fig { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(210px, .8fr); gap: 18px; align-items: start; }
@media (max-width: 720px) { .fig { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
.fig-stage { border: 1px solid var(--line); border-radius: 16px; background: var(--mist); overflow: hidden; }
.fig-svg { display: block; width: 100%; height: auto; touch-action: none; }
.fig.is-dragging .fig-svg { cursor: grabbing; }

.fig-panel { font-size: 14px; }
.fig-panel .row {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px solid var(--line);
}
.fig-panel .row:last-child { border-bottom: 0; }
.fig-panel dt { color: var(--ink-muted); flex: 1 1 auto; min-width: 0; }
.fig-panel dd { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.fig-panel .row-id { display: block; padding: 9px 11px; border-radius: 11px; border-bottom: 0; margin: 6px 0; }
.fig-panel .row-id dt { font-weight: 620; color: var(--ink); font-size: 13.5px; }
.fig-panel .row-id dd { margin-top: 3px; white-space: normal; font-size: 13.5px; }
.fig-panel .row-id.ok { background: rgba(10, 102, 255, .055); }
.fig-panel .row-id.bad { background: rgba(216, 49, 91, .07); }
.fig-panel .mark { margin-left: 9px; font-weight: 700; }
.fig-panel .row-id.ok .mark { color: var(--blue); }
.fig-panel .row-id.bad .mark { color: var(--crimson); }

.fig-bar { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.fig-hint { font-size: 13px; color: var(--ink-faint); flex: 1 1 240px; }
.fig-btns { display: flex; gap: 8px; }
.b {
  border: 1px solid var(--line); background: var(--paper-pure); color: var(--ink);
  border-radius: 999px; padding: 7px 16px; font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.b:hover:not(:disabled) { border-color: #c9c9d1; }
.b:disabled { opacity: .38; cursor: default; }
.b-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.b-dark:hover { background: #000; }
.fig-step {
  margin-top: 12px; padding: 13px 16px; border-radius: 13px; background: var(--paper);
  font-size: 15px; line-height: 1.72;
}
.fig-step b { color: var(--crimson); margin-right: 7px; font-variant-numeric: tabular-nums; }
.fig-err { color: var(--crimson); font-size: 14px; }

/* SVG primitives */
.p-circ { fill: none; stroke: #c3c3cb; }
.p-seg { stroke: var(--ink); stroke-linecap: round; fill: none; }
.p-seg.thin { stroke: #a9a9b2; }
.p-seg.dash { stroke: #a9a9b2; stroke-dasharray: 5 5; }
.p-seg.accent { stroke: var(--crimson); }
.p-seg.alt { stroke: var(--blue); }
.p-seg.chord { stroke: var(--violet); }
.p-seg.tangent { stroke: var(--amber); }
.p-circ.ghostcirc { stroke: var(--crimson); stroke-dasharray: 6 6; opacity: .5; }
.p-tick { stroke: var(--crimson); stroke-linecap: round; }
.p-ang { fill: none; stroke-linecap: round; }
.p-ang.hot-a { stroke: var(--crimson); }
.p-ang.hot-b { stroke: var(--blue); }
.p-ang.hot-c { stroke: var(--amber); }
.p-poly { stroke: none; }
.p-poly.fillsoft { fill: rgba(10, 102, 255, .05); }
.p-poly.fill-a { fill: rgba(216, 49, 91, .13); }
.p-poly.fill-b { fill: rgba(10, 102, 255, .11); }
.p-dot { fill: var(--ink); stroke: #fff; stroke-width: 1.5; }
.p-pt.is-drag .p-dot { fill: var(--crimson); }
.p-pt.small .p-dot { fill: var(--ink-faint); }
.p-grab { fill: transparent; }
.p-pt.is-drag { cursor: grab; }
.p-pt.is-drag:active { cursor: grabbing; }
.p-name { fill: var(--ink); font-weight: 700; text-anchor: middle; font-family: inherit; }
.p-pt.small .p-name { fill: var(--ink-faint); font-weight: 600; }
.p-txt { fill: var(--ink-muted); text-anchor: middle; font-family: inherit; }
.p-pt.is-drag:focus { outline: none; }
.p-pt.is-drag:focus-visible .p-dot { stroke: var(--blue); stroke-width: 3; }
.is-dim { opacity: .16; }
.is-hot { opacity: 1; }

/* -------------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 7px; margin-top: 16px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line); background: var(--paper-pure); color: var(--ink-muted);
  border-radius: 999px; padding: 6px 15px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.tab.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ----------------------------------------------------------------- roadmap */
.rm { margin-top: 20px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.rm-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1.05fr) minmax(0, 1.1fr);
  gap: 12px; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line);
  cursor: pointer; background: var(--paper-pure); transition: background .2s;
}
.rm-row:last-child { border-bottom: 0; }
.rm-row:hover { background: var(--mist); }
.rm-row .see { font-weight: 620; font-size: 15px; }
.rm-row .arw { color: var(--ink-faint); text-align: center; }
.rm-row .use { color: var(--crimson); font-weight: 620; font-size: 15px; }
.rm-row .then { color: var(--ink-muted); font-size: 14px; }
.rm-head { background: var(--paper); font-size: 12px; letter-spacing: .1em; color: var(--ink-faint); text-transform: uppercase; cursor: default; font-weight: 650; }
.rm-head:hover { background: var(--paper); }
@media (max-width: 720px) {
  .rm-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .rm-row .arw { display: none; }
  .rm-head { display: none; }
}

/* -------------------------------------------------------------------- quiz */
.qz { border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-top: 14px; background: var(--paper-pure); }
.qz-q { font-size: 16px; font-weight: 620; line-height: 1.65; }
.qz-q span {
  display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px;
  border-radius: 999px; background: var(--paper); color: var(--ink-muted); font-size: 12.5px;
  margin-right: 10px; font-weight: 700; vertical-align: 1px;
}
.qz-opts { display: grid; gap: 8px; margin-top: 13px; }
.qz-opt {
  text-align: left; border: 1px solid var(--line); background: var(--paper-pure); color: var(--ink);
  border-radius: 12px; padding: 10px 15px; font: inherit; font-size: 15px; cursor: pointer; transition: all .2s;
}
.qz-opt:hover { border-color: #c9c9d1; background: var(--mist); }
.qz.done .qz-opt { cursor: default; }
.qz.done .qz-opt:hover { border-color: var(--line); background: var(--paper-pure); }
.qz-opt.right { border-color: var(--blue); background: rgba(10, 102, 255, .06); font-weight: 620; }
.qz-opt.wrong { border-color: var(--crimson); background: rgba(216, 49, 91, .06); }
.qz-why { margin-top: 12px; font-size: 14.5px; color: var(--ink-muted); line-height: 1.7; }
.qz-score {
  margin-top: 16px; font-size: 13.5px; color: var(--ink-muted); font-variant-numeric: tabular-nums;
  position: sticky; top: 62px; background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px);
  padding: 7px 0; z-index: 20;
}

/* ------------------------------------------------------------------ footer */
.closing { margin-top: 48px; border-radius: 24px; background: var(--night); color: #fff; padding: 40px 30px; }
.closing h2 { font-size: clamp(21px, 3vw, 27px); letter-spacing: -.028em; font-weight: 680; }
.closing p { color: rgba(255, 255, 255, .68); margin-top: 13px; font-size: 15.5px; max-width: 640px; }
.closing .btn-white { background: #fff; color: var(--ink); margin-top: 22px; }
.closing .btn-white:hover { opacity: .9; text-decoration: none; }
.hair { height: 1px; background: var(--iri); opacity: .7; margin-bottom: 26px; }

footer.ft { padding: 34px 0 54px; font-size: 13px; color: var(--ink-faint); }
footer.ft a { color: var(--ink-muted); }
footer.ft p + p { margin-top: 7px; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 0 0 10px 0; z-index: 100;
}
.skip:focus { left: 0; }

.pane[hidden] { display: none; }
