:root {
  --ink: #10211c;
  --ink-soft: #2a3f38;
  --pine: #1c4d3e;
  --moss: #3f6e58;
  --leaf: #6f9a7c;
  --clay: #b85c38;
  --clay-deep: #8f3f24;
  --gold: #c4a574;
  --paper: #f7f3ea;
  --paper-2: #efe8d9;
  --mist: #e4eee8;
  --line: #d3ddd6;
  --white: #fffcf7;
  --code: #0d1a16;
  --ok: #2f7d57;
  --warn: #c48a2a;
  --shadow: 0 18px 50px rgba(16, 33, 28, 0.12);
  --radius: 18px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 88px; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 90% -10%, rgba(196, 165, 116, 0.18), transparent 60%),
    radial-gradient(900px 420px at -10% 0%, rgba(63, 110, 88, 0.14), transparent 55%),
    var(--paper);
  font-family: "IBM Plex Sans", "IBM Plex Sans SC", "PingFang SC", "Noto Sans SC", sans-serif;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
code, pre, kbd {
  font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(247, 243, 234, 0.86);
  border-bottom: 1px solid rgba(16, 33, 28, 0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--pine), #0e2b24);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 1px rgba(196, 165, 116, 0.35);
}
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name strong { font-size: 15px; letter-spacing: 0.04em; }
.brand-name span { font-size: 11px; color: var(--ink-soft); }

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.nav a {
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-soft);
}
.nav a:hover, .nav a.is-active {
  color: var(--ink);
  background: rgba(28, 77, 62, 0.08);
}

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn, .menu-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 12px;
  cursor: pointer;
}
.menu-btn { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
}
.btn-primary { background: var(--clay); color: #fff; }
.btn-primary:hover { background: var(--clay-deep); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #183028; }

.hero {
  padding: 72px 0 48px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  background: var(--mist);
  color: var(--pine);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(47, 125, 87, 0.16);
}
h1, h2, h3 { font-family: "Noto Serif SC", serif; letter-spacing: 0.02em; margin: 0 0 12px; }
h1 { font-size: clamp(36px, 5vw, 58px); line-height: 1.18; }
h2 { font-size: clamp(28px, 3vw, 36px); }
.lede { font-size: 18px; color: var(--ink-soft); max-width: 42em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 18px; }
.hero-meta { display: flex; gap: 28px; color: var(--ink-soft); font-size: 13px; }
.hero-meta b { display: block; color: var(--ink); font-size: 22px; font-family: "Noto Serif SC", serif; }

.hero-panel {
  background: var(--code);
  color: #d7e6dc;
  border-radius: 24px;
  padding: 18px 18px 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-panel-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.hero-panel-bar i { width: 9px; height: 9px; border-radius: 50%; background: #3d5249; display: block; }
.hero-panel-bar i:nth-child(1) { background: #c45c3a; }
.hero-panel-bar i:nth-child(2) { background: #c4a574; }
.hero-panel-bar i:nth-child(3) { background: #6f9a7c; }
.hero-panel pre {
  margin: 0;
  padding: 0 8px 20px;
  font-size: 12.5px;
  line-height: 1.7;
  overflow: auto;
}
.tok-key { color: #9fd0b4; }
.tok-str { color: #e8c48a; }
.tok-cmt { color: #6d857a; }

.section { padding: 72px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 32px; }
.muted { color: var(--ink-soft); }

.grid-3, .grid-4, .grid-2 { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card .tag {
  font-size: 12px;
  color: var(--clay);
  letter-spacing: 0.08em;
}
.icon-chip {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--mist);
  margin-bottom: 14px;
  font-size: 18px;
}

.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.step {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  position: relative;
}
.step em {
  font-style: normal;
  font-family: "Noto Serif SC", serif;
  color: var(--gold);
  font-size: 22px;
}

.page-hero {
  padding: 48px 0 24px;
  border-bottom: 1px solid var(--line);
}
.crumb { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.crumb a:hover { color: var(--clay); }

.docs-layout, .api-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
  padding: 36px 0 80px;
}
.api-layout { grid-template-columns: 220px 1fr 320px; }
.side-nav {
  position: sticky;
  top: 92px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.side-nav a, .side-nav button {
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 14px;
}
.side-nav a.is-active, .side-nav button.is-active {
  background: var(--mist);
  color: var(--pine);
  font-weight: 600;
}

.prose h3 { margin-top: 32px; }
.prose p { color: var(--ink-soft); }
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 14px;
  overflow: hidden;
}
.table th, .table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.table th { background: var(--mist); font-weight: 600; }
.badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--mist);
}
.badge-post { background: #ead7cc; color: var(--clay-deep); }
.badge-get { background: #d7eadf; color: var(--pine); }

.codeblock {
  background: var(--code);
  color: #d7e6dc;
  border-radius: 16px;
  padding: 16px;
  overflow: auto;
  font-size: 13px;
}

.form {
  display: grid;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
}
label { font-size: 13px; font-weight: 500; display: grid; gap: 6px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  padding: 10px 12px;
}
textarea { min-height: 110px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.notice {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--mist);
  display: none;
}
.notice.show { display: block; }

.sandbox {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}
.sandbox-list { display: flex; flex-direction: column; gap: 8px; }
.sandbox-item {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}
.sandbox-item.is-active { border-color: var(--pine); background: var(--mist); }

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.ok { color: var(--ok); font-weight: 600; }

.search-modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 33, 28, 0.45);
  display: none;
  place-items: start center;
  padding-top: 12vh;
  z-index: 50;
}
.search-modal.open { display: grid; }
.search-box {
  width: min(640px, calc(100% - 32px));
  background: var(--white);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.search-box input { font-size: 16px; background: var(--paper); }
.search-results { margin-top: 10px; display: grid; gap: 6px; }
.search-results a {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--paper);
}
.search-results a:hover { background: var(--mist); }

.site-footer {
  background: var(--ink);
  color: #d5e4db;
  padding: 48px 0 24px;
  margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.site-footer a { color: #d5e4db; opacity: 0.85; }
.site-footer a:hover { opacity: 1; color: #fff; }
.footer-legal {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  opacity: 0.75;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.news-item { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.news-item time { color: var(--ink-soft); font-size: 13px; }

@media (max-width: 960px) {
  .nav, .header-actions .btn-ghost { display: none; }
  .menu-btn { display: grid; place-items: center; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 0; right: 0; top: 72px;
    background: var(--paper);
    padding: 12px 20px 20px;
    border-bottom: 1px solid var(--line);
  }
  .hero, .grid-3, .grid-4, .grid-2, .steps, .docs-layout, .api-layout, .sandbox, .footer-grid, .form-row {
    grid-template-columns: 1fr;
  }
  .hero { padding-top: 40px; }
}
