:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #0b0f14;
  --muted: #4b5563;
  --faint: #5c6570;
  --line: #e8e8ec;
  --accent: #0c7d70;
  --gold: #b45309;
  --ok: #0c7d70;
  --ok-bg: #e7f6f3;
  --wait: #92400e;
  --wait-bg: #fdf6e3;
  --err: #9f1239;
  --err-bg: #fdf1f1;
  --focus: rgba(15, 159, 143, 0.33);
  --radius: 12px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --header: 58px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0d12;
    --surface: #10151c;
    --text: #eef1f5;
    --muted: #a3adba;
    --faint: #8b95a3;
    --line: #1c2430;
    --accent: #5eead4;
    --gold: #fbbf24;
    --ok: #5eead4;
    --ok-bg: #0f2a28;
    --wait: #fbbf24;
    --wait-bg: #2a2410;
    --err: #fda4af;
    --err-bg: #2a1515;
    --focus: rgba(45, 212, 191, 0.33);
  }
}
html[lang="zh-TW"] body { font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", var(--sans); }
html[lang="ja"] body { font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", var(--sans); }
html[lang="ko"] body { font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", var(--sans); }
html[lang="ar"] body { font-family: "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", var(--sans); }
html[lang="th"] body { font-family: "Thonburi", "Leelawadee UI", "Noto Sans Thai", var(--sans); }
html[lang="hi"] body { font-family: "Nirmala UI", "Noto Sans Devanagari", var(--sans); }
html[lang="bn"] body { font-family: "Nirmala UI", "Noto Sans Bengali", var(--sans); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; flex: none; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.skip-link {
  position: absolute; left: 12px; top: -40px; background: var(--text); color: var(--bg);
  padding: 8px 12px; border-radius: 8px; z-index: 20;
}
.skip-link:focus { top: 8px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); border: 0;
}
.noscript { margin: 0; padding: 10px 16px; background: var(--wait-bg); color: var(--wait); text-align: center; }

.tipbar {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 10px;
  padding: 6px 16px; background: #9f1239; color: #fff; font-size: 12.5px; line-height: 1.4; text-align: center;
}
.tipbar a { color: #fff; }
.nav {
  position: sticky; top: 0; z-index: 5;
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
@media (prefers-color-scheme: dark) {
  .nav { background: rgba(10, 13, 18, 0.9); }
}
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 8px; }
.brand {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-weight: 650; letter-spacing: -0.02em; font-size: 16px; color: var(--text);
}
.brand svg { width: 24px; height: 24px; }
.brand.small { font-size: 13px; }
.brand.small svg { width: 18px; height: 18px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a, .menu-panel a {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
}
.nav-links a:hover, .menu-panel a:hover { color: var(--text); background: var(--surface); }
.nav-links a[aria-current="page"] { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 4px; }
.lang-switch { position: relative; }
.lang-btn, .menu-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent;
  color: var(--muted); border-radius: 8px; padding: 7px 10px; cursor: pointer; font-weight: 600; font-size: 13px;
}
.lang-btn:hover, .menu-btn:hover, .lang-btn[aria-expanded="true"] { color: var(--text); background: var(--surface); }
.lang-btn:focus-visible, .menu-btn:focus-visible, .tab:focus-visible, .btn:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.lang-menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; margin: 0; padding: 6px;
  list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  min-width: 180px; max-height: 320px; overflow: auto; box-shadow: 0 12px 32px rgb(0 0 0 / 0.16); z-index: 8;
}
.lang-menu button {
  display: block; width: 100%; text-align: start; border: 0; background: transparent;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text);
}
.lang-menu button:hover, .lang-menu button.is-active { background: var(--bg); }
.menu-btn { display: none; }
.menu-panel {
  display: none; border-top: 1px solid var(--line); padding: 8px 16px 14px; background: var(--bg);
}
.menu-panel.is-open { display: grid; }
.menu-panel a { padding: 10px 8px; }

.hero { padding: 56px 16px 8px; text-align: center; }
.eyebrow {
  margin: 0 0 14px; font-size: 12px; font-weight: 650; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent);
}
h1 { margin: 0 0 16px; font-size: clamp(32px, 6vw, 52px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 700; }
.lead { margin: 0 auto 28px; max-width: 540px; color: var(--muted); font-size: 17px; }
.auth-card .lead, .page-card .lead { margin-inline: 0; text-align: start; }
.checker { max-width: 640px; margin: 0 auto; text-align: start; }
.tabs {
  display: flex; width: max-content; gap: 4px; padding: 4px; margin: 0 auto 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.tab {
  border: 0; background: transparent; color: var(--muted); font: 500 14px var(--sans);
  padding: 7px 14px; border-radius: 7px; cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--text); color: var(--bg); }
.search {
  position: relative; display: flex; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px -12px rgb(0 0 0 / 0.12);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus); }
.search-ico { position: absolute; inset-inline-start: 18px; color: var(--faint); }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text);
  padding: 12px 12px 12px 42px; font: 14px var(--mono);
}
[dir="rtl"] .search input { padding: 12px 42px 12px 12px; }
.search input::placeholder { font-family: var(--sans); color: var(--faint); }
.search button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 11px 22px; background: var(--text); color: var(--bg);
  font: 600 14px var(--sans); cursor: pointer; text-decoration: none;
}
.search button:hover, .btn:hover { opacity: 0.88; }
.search button:disabled, .btn:disabled { opacity: 0.5; cursor: wait; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.wide { width: 100%; }
.linkish {
  background: none; border: 0; padding: 0; color: var(--accent); font: 600 13px var(--sans);
  text-decoration: underline; cursor: pointer;
}
.hint {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  margin: 14px 0 0; font-size: 12.5px; color: var(--faint); text-align: center;
}
.bulk textarea {
  display: block; width: 100%; box-sizing: border-box; resize: vertical; min-height: 132px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  background: var(--bg); color: var(--text); font: 13px/1.5 var(--mono);
}
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.bulk-bar .muted { font-size: 13px; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); margin: 28px 0 12px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat { padding: 20px 14px; border-inline-start: 1px solid var(--line); }
.stat:first-child { border-inline-start: 0; padding-inline-start: 0; }
.stat b { display: block; font-size: 22px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat span { display: block; font-size: 13px; font-weight: 600; margin-top: 2px; }
.stat small { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.45; }

.result { margin-top: 8px; padding-top: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-top: 10px;
}
.card p { margin: 0; }
.card p + p { margin-top: 4px; }
.muted { color: var(--muted); }
.summary { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.summary.none { font-weight: 500; }
.item { display: grid; gap: 8px; }
.item-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.amount { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.usd { color: var(--muted); font-size: 14px; margin-inline-start: 4px; }
.meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.meta code, code { font: 12px var(--mono); }
.badge { font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: var(--line); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.wait { background: var(--wait-bg); color: var(--wait); }
.step { font-size: 14px; padding-top: 10px; border-top: 1px dashed var(--line); }
.step a { color: var(--accent); text-decoration: none; font-weight: 600; }
.step a:hover { text-decoration: underline; }
.warn { margin-top: 14px; font-size: 13px; color: var(--muted); text-align: center; }
.err { background: var(--err-bg); color: var(--text); }
.lock-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: center; }

.section { padding: 48px 16px 8px; }
.section-head { margin-bottom: 20px; }
h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.03em; font-weight: 700; }
.section-head p, .info > p { margin: 0; color: var(--muted); }
.guide-filter {
  width: 100%; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); padding: 10px 12px;
}
.guide-list { border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary {
  list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; padding: 16px 2px;
}
summary::-webkit-details-marker { display: none; }
summary > span { font-weight: 650; font-size: 15px; }
summary small { color: var(--faint); font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
summary::after {
  content: ""; margin-inline-start: auto; width: 8px; height: 8px;
  border-inline-end: 1.6px solid var(--faint); border-bottom: 1.6px solid var(--faint);
  transform: rotate(45deg) translateY(-3px); flex: none;
}
details[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
summary:hover > span { color: var(--accent); }
.guide-body { padding: 0 2px 18px; }
.guide-body ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.guide-body li {
  counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: 14px;
}
.guide-body li::before {
  content: counter(s); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 650; background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.guide-body p { margin: 12px 0 0 36px; font-size: 13px; color: var(--muted); }
[dir="rtl"] .guide-body p { margin-left: 0; margin-right: 36px; }
.adv {
  margin: 16px 0 0 36px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface);
}
[dir="rtl"] .adv { margin-left: 0; margin-right: 36px; }
.adv h4 { margin: 0 0 8px; font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.rules li { position: relative; padding-inline-start: 22px; color: var(--muted); }
.rules li::before {
  content: ""; position: absolute; inset-inline-start: 2px; top: 9px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--accent);
}
.rules b { color: var(--text); font-weight: 650; }
.path { display: grid; gap: 10px; }
.path-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.back { display: inline-block; margin-bottom: 14px; font-size: 14px; color: var(--muted); text-decoration: none; }
.back:hover { text-decoration: underline; }
pre.code {
  margin: 12px 0 0; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; overflow-x: auto; font: 12px/1.55 var(--mono); white-space: pre-wrap;
}
.code-row { display: flex; justify-content: flex-end; margin-top: 8px; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 40px 16px 8px; }
.info h2 { font-size: 18px; margin: 0 0 8px; }
.info > p { margin: 0 0 14px; font-size: 14px; }
.info .rules { gap: 8px; font-size: 14px; }

.foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 72px; padding: 24px 16px 40px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--faint);
}
.foot a { color: var(--accent); text-decoration: none; }
.foot-links { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; margin: 0; padding: 0; }
.foot-official { display: block; margin-top: 6px; }

.official, .note-dialog {
  max-width: 440px; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / 0.35);
}
.official::backdrop, .note-dialog::backdrop { background: rgba(5, 8, 12, 0.6); }
.official h2, .note-dialog h2 { margin: 0 0 8px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.official p, .note-dialog p { margin: 8px 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.official button, .note-dialog .btn { margin-top: 10px; width: 100%; }

.page-main { padding: 28px 0 48px; }
.auth-card, .page-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 22px 18px;
}
.auth-form, .field { display: grid; gap: 6px; }
.auth-form { gap: 14px; margin-top: 16px; }
.field label { font-size: 13px; font-weight: 650; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  padding: 10px 12px; font: 14px var(--sans);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .guide-filter:focus, .bulk textarea:focus {
  outline: 2px solid var(--accent); border-color: var(--accent);
}
.field-err { margin: 0; color: var(--err); font-size: 13px; }
.form-banner {
  border-radius: 10px; padding: 10px 12px; background: var(--err-bg); color: var(--text); font-size: 14px;
}
.form-banner.ok { background: var(--ok-bg); }
.form-note, .hint-line { color: var(--muted); font-size: 13px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 4px; }
.record-list { display: grid; gap: 8px; margin: 8px 0 18px; }
.record {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg);
}
.record code { overflow-wrap: anywhere; }
.status-list { margin: 8px 0 16px; padding-inline-start: 18px; color: var(--muted); }
.prose-block h2 { font-size: 18px; margin-top: 22px; }
.prose-block p { color: var(--muted); }

body:not([data-view="guides"]) #guides,
body:not([data-view="api"]) #api { display: none; }
body[data-view="guides"] main > section:not(#guides),
body[data-view="api"] main > section:not(#api) { display: none; }
body[data-view="guides"] #guides,
body[data-view="api"] #api { padding-top: 28px; min-height: 70vh; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .menu-btn { display: inline-flex; }
  .header-actions .when-guest, .header-actions .when-auth { display: none; }
}
@media (max-width: 720px) {
  .hero { padding-top: 40px; }
  .stats, .info-grid { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .stat:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .search { flex-wrap: wrap; }
  .search button { width: 100%; }
  .bulk-bar { flex-direction: column; align-items: stretch; }
  summary small { display: none; }
  .adv, .guide-body p { margin-left: 0; margin-right: 0; }
  h1 { font-size: 32px; }
}
@media (max-width: 380px) {
  .tabs { width: 100%; }
  .tab { flex: 1; }
  .stat b { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
