/* Plan2Fill — order-state palette: amber = plan / pending, teal = filled */
:root {
  --paper: #eef1f4;
  --surface: #ffffff;
  --ink: #14202b;
  --muted: #586776;
  --line: #ccd4dc;
  --plan: #a86a12;
  --plan-soft: #f6ead6;
  --fill: #0d6b5b;
  --fill-soft: #dcefe9;
  --code-bg: #14202b;
  --code-ink: #e3e9ef;
  --radius-s: 4px;
  --radius-m: 10px;
  --measure: 68ch;
  --sans: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f171f;
    --surface: #16212b;
    --ink: #e4eaf0;
    --muted: #9aa8b5;
    --line: #2a3845;
    --plan: #e0a84a;
    --plan-soft: #33280f;
    --fill: #4fc4ab;
    --fill-soft: #12312b;
    --code-bg: #0a1117;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}
html[data-lang="zh"] [data-l="en"],
html[data-lang="en"] [data-l="zh"] { display: none !important; }

a { color: var(--fill); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--plan); outline-offset: 2px; border-radius: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.prose { max-width: var(--measure); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.brand-mark { width: 26px; height: 26px; }
.brand b { color: var(--plan); font-weight: 700; }
.nav { display: flex; gap: 22px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--fill); }
.lang-toggle {
  font: inherit; font-size: 14px; color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer;
}
.lang-toggle:hover { border-color: var(--ink); }

/* Type scale */
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(34px, 5vw, 54px); font-weight: 700; }
h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 650; margin-top: 0; }
h3 { font-size: 21px; font-weight: 600; }
p { margin: 0 0 1em; }
.lede { font-size: 20px; color: var(--muted); max-width: 52ch; }
.small { font-size: 14px; color: var(--muted); }

section { padding: 72px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: 0; }

/* Buttons */
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: 16px;
  padding: 12px 20px; border-radius: var(--radius-s); border: 2px solid var(--ink);
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--fill); border-color: var(--fill); }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover { border-color: var(--fill); color: var(--fill); }

/* Hero */
.hero { padding: 72px 0 80px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero h1 { max-width: 15ch; }

/* The order ticket — the one memorable element */
.ticket {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  overflow: hidden; box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(20, 32, 43, 0.45);
}
.ticket-row { padding: 20px 22px; display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: start; }
.ticket-row + .ticket-row { border-top: 1px dashed var(--line); }
.ticket-tag {
  font-size: 13px; font-weight: 600; text-align: center; padding: 3px 0; border-radius: 999px;
}
.ticket-plan .ticket-tag { background: var(--plan-soft); color: var(--plan); }
.ticket-code .ticket-tag { background: var(--paper); color: var(--muted); }
.ticket-fill .ticket-tag { background: var(--fill-soft); color: var(--fill); }
.ticket-body { font-size: 15px; line-height: 1.55; }
.ticket-body code { font-family: var(--mono); font-size: 13.5px; }
.ticket-fill .ticket-body strong { color: var(--fill); }
.ticket-caption { padding: 10px 22px; font-size: 13px; color: var(--muted); background: var(--paper); border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: no-preference) {
  .ticket-code { animation: reveal 0.5s ease-out 0.5s both; }
  .ticket-fill { animation: reveal 0.5s ease-out 1.4s both; }
  .ticket-fill .ticket-tag { animation: settle 0.6s ease-out 1.6s both; }
}
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { background: var(--plan-soft); color: var(--plan); } to { background: var(--fill-soft); color: var(--fill); } }

/* Two-part offer */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.split > div { padding: 32px; }
.split > div + div { border-left: 1px solid var(--line); }
.split h3 { display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot-plan { background: var(--plan); }
.dot-fill { background: var(--fill); }
.split ul { padding-left: 1.1em; margin: 0; }
.split li { margin-bottom: 6px; }

/* Fit / not fit */
.fit { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.fit ul { list-style: none; padding: 0; margin: 0; }
.fit li { padding: 10px 0 10px 28px; border-bottom: 1px solid var(--line); position: relative; }
.fit .yes li::before { content: "✓"; position: absolute; left: 4px; color: var(--fill); font-weight: 700; }
.fit .no li::before { content: "✕"; position: absolute; left: 4px; color: var(--plan); font-weight: 700; }

/* Steps (a real sequence) */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border-top: 2px solid var(--ink); }
.steps li { counter-increment: step; padding: 22px 20px 0 0; }
.steps li::before { content: counter(step); display: block; font-size: 40px; font-weight: 300; color: var(--muted); line-height: 1; margin-bottom: 12px; }
.steps h3 { font-size: 18px; margin-bottom: 6px; }
.steps p { font-size: 15px; color: var(--muted); }

/* Price */
.price { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.price-item { border-top: 2px solid var(--ink); padding-top: 18px; }
.price-amount { font-size: 34px; font-weight: 650; letter-spacing: -0.02em; }
.price-amount span { font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 6px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 1.5em; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; background: var(--paper); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ok { color: var(--fill); font-weight: 600; }
.warn { color: var(--plan); font-weight: 600; }

/* Code */
pre {
  background: var(--code-bg); color: var(--code-ink); padding: 18px 20px; border-radius: var(--radius-s);
  overflow-x: auto; font-family: var(--mono); font-size: 14px; line-height: 1.6; margin: 0 0 1.5em;
}
code { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { background: var(--surface); border: 1px solid var(--line); padding: 1px 5px; border-radius: 3px; }

/* Article / document pages */
.doc { padding: 56px 0 80px; }
.doc .wrap { display: grid; grid-template-columns: 220px 1fr; gap: 56px; }
.toc { position: sticky; top: 24px; align-self: start; font-size: 14px; }
.toc ol { padding-left: 1.2em; margin: 0; color: var(--muted); }
.toc li { margin-bottom: 8px; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.doc h2 { margin-top: 56px; padding-top: 8px; }
.doc h2:first-of-type { margin-top: 0; }
.doc h3 { margin-top: 32px; }
.doc .prose ul, .doc .prose ol { padding-left: 1.3em; }
.doc .prose li { margin-bottom: 6px; }
.note {
  border-left: 4px solid var(--plan); background: var(--plan-soft); padding: 14px 18px; margin: 0 0 1.5em;
  border-radius: 0 var(--radius-s) var(--radius-s) 0; font-size: 15px;
}
.page-head { padding: 64px 0 40px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(32px, 4.5vw, 46px); }
blockquote { margin: 0 0 1.5em; padding: 4px 0 4px 18px; border-left: 3px solid var(--line); color: var(--muted); }

/* Blog list */
.post-list { list-style: none; padding: 0; margin: 0; max-width: 760px; }
.post-list li { padding: 26px 0; border-bottom: 1px solid var(--line); }
.post-list a.title { font-size: 22px; font-weight: 600; color: var(--ink); text-decoration: none; }
.post-list a.title:hover { color: var(--fill); }
.post-meta { font-size: 14px; color: var(--muted); margin-top: 4px; }
.post-list p { margin: 8px 0 0; color: var(--muted); }
.article { max-width: 72ch; }
.article h2 { margin-top: 44px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.channel { border-top: 2px solid var(--ink); padding: 20px 0 8px; }
.channel h3 { margin-bottom: 6px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: grid; grid-template-columns: 1fr 1.6fr; gap: 40px; }
.site-footer a { color: var(--muted); }

@media (max-width: 860px) {
  .hero .wrap, .split, .fit, .price, .contact-grid, .site-footer .wrap { grid-template-columns: 1fr; }
  .split > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 24px; }
  .doc .wrap { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; }
  section { padding: 52px 0; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .steps { grid-template-columns: 1fr; }
  .split > div { padding: 22px; }
  .nav { gap: 14px; margin-left: 0; width: 100%; order: 3; }
  .site-header .wrap { padding-top: 10px; padding-bottom: 6px; gap: 10px; }
  .lang-toggle { margin-left: auto; }
}
figure.ticket { margin: 0; }
.intro { margin-bottom: 28px; }
.more { margin-top: 20px; }
.doc .wrap.single { display: block; }
.ticket-body code { background: none; border: 0; padding: 0; overflow-wrap: anywhere; }
.price-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .price-3 { grid-template-columns: 1fr; } }

.reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; margin-bottom: 24px; }
.reasons > div { border-top: 2px solid var(--ink); padding: 18px 0 8px; }
.reasons h3 { font-size: 19px; margin-bottom: 8px; }
.reasons p { color: var(--muted); max-width: 56ch; }
.reasons-note { max-width: var(--measure); }
@media (max-width: 860px) { .reasons { grid-template-columns: 1fr; } }

:root { --loss: #b3412e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --loss: #ec8a76; } }
.chase { margin: 8px 0 28px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); max-width: 760px; }
.chase h3 { margin-bottom: 12px; }
.chase-chart { display: block; width: 100%; height: auto; margin-bottom: 16px; }
.chase-chart .g-grid { stroke: var(--line); stroke-width: 1; }
.chase-chart .g-tick { fill: var(--muted); font-size: 12px; font-family: var(--sans); }
.chase-chart .g-exit { stroke: var(--fill); stroke-width: 1.5; stroke-dasharray: 6 5; }
.chase-chart .g-exit-label { fill: var(--fill); font-weight: 600; }
.chase-chart .g-price { fill: none; stroke: var(--ink); stroke-width: 2.25; stroke-linejoin: round; }
.chase-chart .g-lead { stroke-width: 1.25; }
.chase-chart .g-lead.a { stroke: var(--fill); } .chase-chart .g-lead.b { stroke: var(--loss); }
.chase-chart .g-dot.a, .chase-chart .g-badge.a { fill: var(--fill); }
.chase-chart .g-dot.b, .chase-chart .g-badge.b { fill: var(--loss); }
.chase-chart .g-num { fill: var(--surface); font-size: 13px; font-weight: 700; font-family: var(--sans); }
.chase-legend { margin: 0 0 12px; padding-left: 0; list-style: none; counter-reset: ev; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; font-size: 15px; }
.chase-legend li { counter-increment: ev; position: relative; padding-left: 32px; }
.chase-legend li::before { content: counter(ev); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; color: var(--surface); font-size: 13px; font-weight: 700; text-align: center; line-height: 22px; }
.chase-legend li.a::before { background: var(--fill); } .chase-legend li.b::before { background: var(--loss); }
.chase-legend li.a strong { color: var(--fill); } .chase-legend li.b strong { color: var(--loss); }
.chase figcaption { margin: 0; }
@media (max-width: 640px) { .chase { padding: 16px; } .chase-legend { grid-template-columns: 1fr; } }
