:root {
  --ink: #15323a;
  --muted: #667980;
  --teal: #187f83;
  --teal-dark: #103a43;
  --blue: #3f718f;
  --paper: #ffffff;
  --wash: #f3f8f7;
  --line: #d9e6e3;
  --red: #e64032;
  --yellow: #fff1a8;
  --shadow: 0 18px 50px rgba(22, 64, 70, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.75;
}
a { color: var(--teal); text-underline-offset: 3px; }
button, input { font: inherit; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.skip-link { position: fixed; top: -60px; left: 20px; z-index: 100; padding: 10px 16px; background: var(--ink); color: white; }
.skip-link:focus { top: 12px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 max(24px, calc((100vw - 1480px) / 2));
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 22px; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand img { width: 128px; height: auto; display: block; }
.brand span { padding-left: 22px; border-left: 1px solid var(--line); letter-spacing: .08em; }
.top-actions { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.top-actions a { color: var(--ink); text-decoration: none; }
.free-badge { padding: 5px 12px; border-radius: 999px; color: #0a625e; background: #dff3ec; font-weight: 750; }
.toc-toggle { display: none; border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 10px; padding: 7px 12px; }

.page-shell { width: min(1420px, calc(100% - 48px)); margin: 0 auto; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
.toc { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; padding: 28px 20px 28px 2px; }
.toc-kicker { margin: 0 0 13px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.toc nav { display: grid; gap: 4px; border-left: 1px solid var(--line); }
.toc nav a { display: block; padding: 8px 12px 8px 18px; color: #52686f; text-decoration: none; font-size: 14px; border-left: 3px solid transparent; transform: translateX(-2px); }
.toc nav a:hover, .toc nav a.active { color: var(--teal); border-left-color: var(--teal); background: #e7f2f0; }
.toc-help { margin-top: 24px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.toc-help strong { display: block; margin-bottom: 7px; font-size: 13px; }
.toc-help code { display: block; color: var(--muted); overflow-wrap: anywhere; font-size: 11px; line-height: 1.55; }

main { min-width: 0; padding: 24px 0 64px; }
.hero { min-height: 410px; display: grid; grid-template-columns: minmax(0, .92fr) minmax(430px, 1.08fr); gap: 36px; align-items: center; padding: 46px; color: white; background: var(--teal-dark); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; position: relative; }
.hero::after { content: "编码 · 规则 · 支付"; position: absolute; right: 30px; top: 22px; writing-mode: vertical-rl; color: rgba(255,255,255,.08); font-family: "Songti SC", STSong, serif; font-size: 30px; letter-spacing: .35em; }
.eyebrow { margin: 0 0 14px; color: #8ed1cb; font-size: 13px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font-family: "Songti SC", STSong, serif; font-size: clamp(38px, 4.2vw, 58px); line-height: 1.12; letter-spacing: -.035em; font-weight: 800; }
.hero-lede { max-width: 650px; margin: 18px 0 0; color: #d6e8e7; font-size: 16px; line-height: 1.75; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.hero-meta span { border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 6px 12px; color: #e9f5f4; font-size: 13px; }

.tool-rail { position: relative; padding: 24px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.07); border-radius: 18px; }
.tool-rail > p { margin: 0 0 18px; color: #a7d7d2; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.tool-rail ol { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 0; margin: 0; position: relative; }
.tool-rail ol::before { content: ""; position: absolute; left: 7%; right: 7%; top: 27px; height: 2px; background: #5da8a5; }
.tool-rail li { min-width: 0; text-align: center; position: relative; }
.tool-rail b { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 11px; border-radius: 50%; background: #f6fbfa; color: var(--teal-dark); box-shadow: 0 0 0 6px rgba(31,123,126,.55); position: relative; z-index: 1; }
.tool-rail span { display: block; color: white; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; font-weight: 700; }
.tool-rail small { color: #aac8c7; font-size: 12px; white-space: nowrap; }

.guide-section { margin-top: 20px; padding: 34px 40px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 8px 30px rgba(23, 58, 63, .04); }
.section-heading { display: flex; align-items: flex-start; gap: 15px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.section-heading > span { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: white; background: var(--red); font-weight: 800; }
.section-heading p { margin: 0 0 3px; color: var(--teal); font-size: 13px; font-weight: 800; letter-spacing: .13em; }
h2 { margin: 0; font-family: "Songti SC", STSong, serif; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.3; }
h3 { color: var(--ink); }
.lead { margin: 0 0 18px; color: #445e66; font-size: 16px; }
.prose-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 28px; align-items: start; }
.steps-list { margin: 0; padding-left: 24px; }
.steps-list li { padding: 5px 0 5px 7px; }

.note { margin: 18px 0; padding: 14px 18px; border-left: 4px solid var(--teal); background: #eaf5f3; border-radius: 0 12px 12px 0; }
.note.warning { border-left-color: #d19b00; background: #fff7d8; }
.note strong { display: block; margin-bottom: 3px; }
.note p { margin: 0; color: #506269; }
.shot { margin: 20px 0; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid #d9e1e3; border-radius: 16px; box-shadow: var(--shadow); }
.shot figcaption { margin-top: 8px; color: var(--muted); font-size: 12px; }
.compact-shot { max-width: 900px; }
.shot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.shot-grid .shot { margin-bottom: 0; }

.code-card { margin: 14px 0 20px; overflow: hidden; border-radius: 12px; background: #10262e; color: #d9eeee; box-shadow: 0 12px 36px rgba(14,38,46,.18); }
.code-card.compact { box-shadow: none; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.12); color: #9cc7c6; font-size: 13px; }
.code-head button { border: 1px solid rgba(255,255,255,.24); background: transparent; color: white; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
pre { max-width: 100%; margin: 0; padding: 16px; overflow-x: auto; color: #d9eeee; background: #10262e; font-size: 12px; line-height: 1.55; }
.prompt-card { padding: 19px 22px; border: 1px solid #edc849; border-radius: 14px; background: var(--yellow); }
.prompt-card p { margin: 0 0 10px; color: #8e3328; font-weight: 800; }
.prompt-card blockquote { margin: 0; font-size: 16px; }
.action-prompt { display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: center; padding: 20px 22px; border: 2px solid #e6bb28; border-radius: 14px; background: var(--yellow); }
.action-prompt span { color: #8e3328; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.action-prompt p { margin: 5px 0 0; color: var(--ink); font-size: 17px; line-height: 1.65; }
.action-prompt button { border: 0; border-radius: 10px; padding: 10px 15px; color: white; background: var(--teal); cursor: pointer; white-space: nowrap; }
.micro-copy { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.config-details > summary { cursor: pointer; color: var(--teal); font-weight: 750; }
.tool-table { margin-top: 20px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tool-table div { display: grid; grid-template-columns: minmax(240px, .9fr) 1.1fr; gap: 20px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.tool-table div:last-child { border-bottom: 0; }
.tool-table code { color: var(--teal); font-size: 13px; font-weight: 750; }

.verification-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.verification-legend span { padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.verified { color: #05635d; background: #dff4ed; }
.format-only { color: #526674; background: #edf1f3; }
.client-accordion { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.client-accordion > details { padding: 0 18px; border-bottom: 1px solid var(--line); background: #fbfdfd; }
.client-accordion > details > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; cursor: pointer; color: var(--teal); font-weight: 800; }
.client-accordion summary small { color: var(--muted); font-size: 12px; font-weight: 500; }
.client-accordion details > p { margin: 0 0 8px; color: #50656d; font-size: 13px; }
.client-accordion .code-card { margin-bottom: 16px; }
.clawhub-note { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 13px 18px; background: #fff9df; font-size: 13px; }
.clawhub-note span { color: var(--muted); }
.faq-list summary { cursor: pointer; color: var(--teal); font-weight: 750; }
.faq-list details { padding: 14px 0; border-bottom: 1px solid var(--line); }
.faq-list p { margin-bottom: 0; color: #50656d; }

.guide-footer { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 24px 10px; color: var(--muted); font-size: 13px; }
.guide-footer img { width: 34px; height: 34px; }
.guide-footer p { margin: 0 auto 0 0; }
.copy-toast { position: fixed; left: 50%; bottom: 26px; z-index: 30; transform: translate(-50%, 20px); padding: 10px 16px; border-radius: 10px; background: var(--ink); color: white; opacity: 0; pointer-events: none; transition: .2s ease; }
.copy-toast.show { opacity: 1; transform: translate(-50%, 0); }
:focus-visible { outline: 3px solid #e0a800; outline-offset: 3px; }

@media (max-width: 1120px) {
  .hero { grid-template-columns: 1fr; }
  .tool-rail { max-width: 760px; }
}

@media (max-width: 900px) {
  .topbar { padding: 0 18px; }
  .brand span, .top-actions > a, .free-badge { display: none; }
  .toc-toggle { display: inline-block; }
  .page-shell { width: min(100% - 28px, 760px); display: block; }
  .toc { display: none; position: fixed; z-index: 19; top: 72px; left: 0; right: 0; max-height: calc(100vh - 72px); padding: 22px; background: white; box-shadow: var(--shadow); }
  .toc.open { display: block; }
  .toc nav { grid-template-columns: 1fr 1fr; }
  .toc-help { display: none; }
  main { padding-top: 20px; }
  .hero { min-height: auto; padding: 34px 28px; border-radius: 20px; gap: 28px; }
  .hero::after { display: none; }
  .guide-section { padding: 28px 26px; }
  .prose-grid { grid-template-columns: 1fr; }
  .shot-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .brand img { width: 108px; }
  .page-shell { width: calc(100% - 20px); }
  h1 { font-size: 38px; }
  .hero { padding: 28px 21px; }
  .tool-rail { padding: 22px 12px; overflow: visible; }
  .tool-rail ol { min-width: 0; gap: 2px; }
  .tool-rail ol::before { top: 21px; }
  .tool-rail b { width: 42px; height: 42px; box-shadow: 0 0 0 4px rgba(31,123,126,.55); }
  .tool-rail span { font-size: 9px; }
  .tool-rail small { font-size: 10px; white-space: normal; }
  .guide-section { padding: 24px 18px; border-radius: 16px; }
  .section-heading { gap: 12px; }
  .section-heading > span { width: 42px; height: 42px; }
  h2 { font-size: 28px; }
  .tool-table div { grid-template-columns: 1fr; gap: 3px; }
  .action-prompt { grid-template-columns: 1fr; gap: 12px; padding: 17px; }
  .action-prompt p { font-size: 15px; }
  .action-prompt button { width: 100%; }
  .clawhub-note { align-items: flex-start; flex-direction: column; gap: 3px; }
  .toc nav { grid-template-columns: 1fr; }
  pre { font-size: 11px; }
  .guide-footer { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
