/* Knotlore / 织微: system fonts only, no external requests. */

/* Chinese curly quotes from a CJK font: SF (first in the stack) draws narrow Latin “ ” otherwise. */
@font-face {
  font-family: "CJK Quotes";
  src: local("PingFang SC"), local("PingFangSC-Regular"), local("Microsoft YaHei"), local("Noto Sans CJK SC");
  unicode-range: U+2018-201D;
}

:root {
  color-scheme: light dark;
  --bg: #F6F7FF;
  --surface: #FFFFFF;
  --ink: #110C4A;
  --muted: #4F4C82;
  --line: #DCDEF5;
  --accent: #3A5BFF;
  --mint: #5CF5D0;
  --cell: #CFD2F0;
  --cell-accent: #3A5BFF;
  --stable: #110C4A;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans-hans: "CJK Quotes", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  --sans-hant: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", "Noto Sans TC", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 70rem;
  --measure: 40rem;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0930;
    --surface: #131042;
    --ink: #ECEBFF;
    --muted: #A9A6DA;
    --line: #29256A;
    --accent: #8FA2FF;
    --cell: #302C7C;
    --cell-accent: #6C84FF;
    --stable: #ECEBFF;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

/* body sets its own font-family, so the Chinese pages must target body too. */
[lang="zh-Hans"], html[lang="zh-Hans"] body { font-family: var(--sans-hans); }
[lang="zh-Hant"], html[lang="zh-Hant"] body { font-family: var(--sans-hant); }
/* Short Chinese terms inside English text stay on one line. */
html[lang="en"] span[lang^="zh"] { white-space: nowrap; }
html[lang^="zh"] body { line-height: 1.75; }

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
@media (min-width: 600px) { :root { --gutter: 28px; } }
@media (min-width: 1000px) { :root { --gutter: 40px; } }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { top: 10px; }

.n, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Header */

.site-header { border-bottom: 1px solid var(--line); }
.header-row {
  display: flex;
  align-items: center;
  gap: 12px 20px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.site-nav { display: flex; gap: 18px; font-size: 0.9375rem; }
.site-nav a { color: var(--muted); text-decoration: none; padding-block: 10px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
@media (max-width: 559px) { .site-nav .wide { display: none; } }

.lang {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  font-size: 0.8125rem;
  line-height: 1;
}
.lang a {
  display: inline-block;
  min-width: 36px;
  padding: 12px 10px;
  text-align: center;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}
.lang a:hover { color: var(--ink); }
.lang a[aria-current="true"] { background: var(--ink); color: var(--bg); }

/* Type */

h1, h2, h3 { margin: 0; font-weight: 650; }
h1 {
  font-size: clamp(2.375rem, 1.5rem + 4.4vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
}
h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}
h3 { font-size: 1.0625rem; line-height: 1.35; letter-spacing: -0.005em; }
html[lang^="zh"] h1 { letter-spacing: 0.01em; line-height: 1.18; }
html[lang^="zh"] h2 { letter-spacing: 0.01em; line-height: 1.3; }

p { margin: 0 0 1em; text-wrap: pretty; }
h2, h3 { text-wrap: balance; }
.lede {
  font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  line-height: 1.5;
  color: var(--ink);
  max-width: 34rem;
}
html[lang^="zh"] .lede { line-height: 1.75; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* Sections */

.section { padding-block: clamp(3.5rem, 2rem + 6vw, 6.5rem); border-top: 1px solid var(--line); }
.section-head { max-width: var(--measure); margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem); }
.section-head h2 { margin-bottom: 0.6em; }
.section-head p { color: var(--muted); }

/* Hero */

.hero { padding-block: clamp(3rem, 1.5rem + 7vw, 7rem) clamp(3.5rem, 2rem + 6vw, 6.5rem); }
.hero-grid { display: grid; gap: 48px; align-items: end; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 64px; }
}
.hero h1 { margin-bottom: 0.45em; }
.nb { display: inline-block; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0.5rem 0 0;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9375rem;
  color: var(--ink);
}
.node {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(92, 245, 208, 0.35), 0 0 10px 1px rgba(92, 245, 208, 0.9);
}

/* Odds figure: four rows of sixteen cells */

.odds {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}
@media (min-width: 600px) { .odds { padding: 24px 26px; } }
.odds-title { font-size: 0.9375rem; font-weight: 600; margin: 0 0 18px; }
.odds-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.odds-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 0.9375rem;
}
.odds-label .v { font-family: var(--mono); font-weight: 600; font-size: 1.0625rem; width: 1.1em; }
.odds-label .tag { font-size: 0.8125rem; color: var(--accent); }
.odds-label .p { margin-left: auto; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.cells { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; }
.cells span { height: 12px; border-radius: 2px; background: var(--cell); }
.cells span.on { background: var(--stable); }
.changing .cells span.on { background: var(--cell-accent); }
.odds figcaption { margin-top: 18px; font-size: 0.875rem; color: var(--muted); line-height: 1.55; }
html[lang^="zh"] .odds figcaption { line-height: 1.7; }

@media (prefers-reduced-motion: no-preference) {
  .cells span.on { animation: fill 420ms cubic-bezier(.2,.7,.2,1) backwards; }
  .cells span:nth-child(1) { animation-delay: 200ms; }
  .cells span:nth-child(2) { animation-delay: 240ms; }
  .cells span:nth-child(3) { animation-delay: 280ms; }
  .cells span:nth-child(4) { animation-delay: 320ms; }
  .cells span:nth-child(5) { animation-delay: 360ms; }
  .cells span:nth-child(6) { animation-delay: 400ms; }
  .cells span:nth-child(7) { animation-delay: 440ms; }
}
@keyframes fill { from { background: var(--cell); } }

/* Steps: a real sequence, so it is numbered */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 28px;
  counter-reset: step;
}
@media (min-width: 700px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 40px; } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.steps li { counter-increment: step; border-top: 1px solid var(--line); padding-top: 14px; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  font-size: 0.9375rem;
  color: var(--accent);
  margin-bottom: 10px;
}
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); }

/* 三不占 */

.rule-grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .rule-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; } }
.rule-grid .section-head { margin-bottom: 0; }
.rules { list-style: none; margin: 0; padding: 0; }
.rules li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 4px 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.rules li:first-child { border-top: 1px solid var(--line); }
.rules .zh { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 600; letter-spacing: 0.12em; line-height: 1.3; }
.rules .gloss { color: var(--muted); }
@media (max-width: 420px) { .rules li { grid-template-columns: 1fr; } }

/* Where the interpretation runs */

.band { background: var(--surface); }
.runs { margin: 0; display: grid; gap: 12px; }
@media (min-width: 900px) { .runs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
.runs > div {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px 20px;
}
.runs dt { font-weight: 650; margin-bottom: 6px; }
.runs dt .step { display: block; font-family: var(--mono); font-size: 0.8125rem; font-weight: 400; color: var(--accent); margin-bottom: 6px; }
html[lang^="zh"] .runs dt .step { font-family: inherit; }
.runs dd { margin: 0; color: var(--muted); max-width: var(--measure); }
.after-list { margin-top: 24px; max-width: var(--measure); color: var(--muted); }

/* Free and Pro */

.plans { width: 100%; max-width: 44rem; border-collapse: collapse; font-size: 1rem; }
.plans th, .plans td { text-align: left; padding: 14px 10px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.plans thead th { font-size: 0.9375rem; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.plans thead th.pro { color: var(--accent); }
.plans tbody th { font-weight: 500; width: 46%; }
.plans td.no { color: var(--muted); }
.plans td:last-child, .plans th:last-child { padding-right: 0; }
@media (max-width: 420px) { .plans { font-size: 0.9375rem; } }

.prices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 28px 0 0; max-width: 44rem; }
.prices > div { border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 12px; background: var(--surface); }
.prices dt { font-size: 0.875rem; color: var(--muted); }
.prices dd { margin: 4px 0 0; font-family: var(--mono); font-size: clamp(1.125rem, 1rem + 1vw, 1.625rem); font-weight: 600; letter-spacing: -0.02em; }
.prices dd small { display: block; font-family: var(--sans); font-size: 0.8125rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
html[lang="zh-Hans"] .prices dd small { font-family: var(--sans-hans); }
html[lang="zh-Hant"] .prices dd small { font-family: var(--sans-hant); }
@media (max-width: 400px) { .prices > div { padding: 12px 10px 10px; } }
.plan-note { margin-top: 18px; font-size: 0.875rem; color: var(--muted); max-width: var(--measure); }

/* Closing */

.closing h2 { margin-bottom: 0.5em; }
.closing p { max-width: var(--measure); }

/* Long-form pages: privacy, terms, support */

.page { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) clamp(3.5rem, 2rem + 6vw, 6rem); }
.page-head { max-width: var(--measure); margin-bottom: 2.5rem; }
.page-head h1 { font-size: clamp(2.125rem, 1.6rem + 2.6vw, 3.25rem); margin-bottom: 0.4em; }
.page-head .meta { color: var(--muted); font-size: 0.9375rem; margin: 0; }
.prose { max-width: var(--measure); }
.prose h2 { font-size: 1.375rem; letter-spacing: -0.015em; margin: 2.6rem 0 0.8rem; }
.prose h3 { margin: 1.8rem 0 0.5rem; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--accent); }
.summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px 12px 12px 4px;
  padding: 18px 20px 6px;
  margin-bottom: 1.5rem;
}
.summary h2 { margin-top: 0; font-size: 1.0625rem; letter-spacing: 0; }
.notice { font-size: 0.9375rem; color: var(--muted); }
.contact-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 1.5rem;
}
.contact-box .email { font-size: clamp(1.125rem, 1rem + 1vw, 1.5rem); font-weight: 650; letter-spacing: -0.01em; }
.faq h3 { font-size: 1.125rem; margin: 2.2rem 0 0.5rem; }

/* 404 */

.lost { padding-block: clamp(4rem, 2rem + 8vw, 8rem); }
.lost h1 { font-size: clamp(2rem, 1.5rem + 3vw, 3.5rem); margin-bottom: 0.4em; }
.lost .code { font-family: var(--mono); color: var(--accent); margin-bottom: 1.25rem; }
.lost .alt { margin-top: 2.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.lost .alt p { margin: 0 0 0.35em; }

/* Footer */

.site-footer { border-top: 1px solid var(--line); padding-block: 32px 40px; font-size: 0.875rem; color: var(--muted); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0 20px; margin-bottom: 14px; }
.footer-nav a { color: var(--ink); text-decoration: none; padding-block: 6px; }
.footer-nav a:hover { text-decoration: underline; }
.fine { max-width: 44rem; margin: 0 0 0.6em; }
.plans .sub { display: block; margin-top: 2px; font-size: 0.8125rem; font-weight: 400; color: var(--muted); }
