:root {
  --ink: #172033;
  --muted: #667085;
  --line: #e6e8ee;
  --bg: #f6f7fb;
  --card: #ffffff;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --post: #2563eb;
  --ok: #057a55;
  --code: #1e2430;
  --code-bar: #171c27;
  --sidebar: 272px;
  --sample: clamp(300px, 26vw, 400px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #fff;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; align-items: center; color: var(--ink); font-weight: 700; }
.logo { height: 32px; width: auto; display: block; }
.top-links { display: flex; gap: 16px; align-items: center; font-size: 14px; }
.top-links a { color: var(--ink); }
.btn {
  display: inline-block; background: var(--brand); color: #fff !important;
  border-radius: 8px; padding: 8px 14px; font-size: 14px; text-decoration: none !important;
  border: 0; cursor: pointer;
}
.btn.secondary { background: #fff; color: var(--ink) !important; border: 1px solid var(--line); }
.layout { display: flex; min-height: calc(100vh - 56px); }
.sidenav {
  flex: 0 0 var(--sidebar);
  width: var(--sidebar);
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 16px 12px 32px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow: auto;
}
.sidenav input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 14px;
}
.group-name { font-size: 12px; color: var(--muted); margin: 14px 8px 6px; }
.sidenav a.item {
  display: flex; gap: 8px; align-items: center; color: var(--ink);
  padding: 7px 10px; border-radius: 8px; font-size: 13px; line-height: 1.35;
}
.sidenav a.item.active, .sidenav a.item:hover { background: #eef4ff; text-decoration: none; }
.method {
  font-size: 11px; font-weight: 700; color: #fff; background: var(--post);
  border-radius: 4px; padding: 1px 5px; min-width: 42px; text-align: center;
}
.method.doc { background: #64748b; }
.doc-main { display: flex; flex: 1 1 auto; min-width: 0; align-items: flex-start; }
.article { flex: 1 1 auto; min-width: 0; padding: 28px 40px 80px; }
.article h1 { margin: 0 0 8px; font-size: 28px; }
.summary { color: #344054; line-height: 1.7; }
.endpoint {
  display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin: 18px 0; font-family: Consolas, monospace; font-size: 13px;
}
.article { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 10px 12px; font-size: 13px; vertical-align: top; }
th { background: #f8fafc; color: #475467; font-weight: 600; white-space: nowrap; }
td.field.d1 { padding-left: 28px; }
td.field.d2 { padding-left: 44px; }
td.field.d3 { padding-left: 60px; }
.req { color: #b42318; font-weight: 600; }
.opt { color: var(--muted); }
.section { margin-top: 22px; }
.section h2 { font-size: 18px; }
.section p { line-height: 1.7; color: #344054; }
.table-filter {
  width: 100%;
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0 0 12px;
}
.rule-table thead th { position: sticky; top: 56px; z-index: 1; }
.sample {
  flex: 0 0 var(--sample);
  width: var(--sample);
  margin-left: auto;
  background: var(--code);
  color: #abb2bf;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  overflow: auto;
  border-left: 1px solid #2c3344;
}
.sample-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--code-bar);
  border-bottom: 1px solid #2c3344;
  flex: 0 0 auto;
}
.sample-label { font-size: 13px; color: #d6deea; font-weight: 600; }
.sample-tools { display: flex; align-items: center; gap: 8px; }
.sample-tools select {
  background: #11151d;
  color: #e6edf7;
  border: 1px solid #3a4458;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
}
.code-view {
  margin: 0;
  padding: 16px 16px 24px;
  overflow: auto;
  flex: 0 0 auto;
  max-height: 42vh;
  min-height: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.65;
  font-family: Consolas, "Sarasa Mono SC", "Courier New", monospace;
  tab-size: 2;
}
.code-view.resp { max-height: none; overflow: visible; }
.resp-bar { margin-top: 20px; border-top: 1px solid #2c3344; }
.status-ok {
  margin-left: 8px;
  color: #86efac;
  font-size: 12px;
  font-weight: 700;
}
.copy {
  background: transparent;
  color: #93c5fd;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
}
.copy:hover { background: #243044; }
.tok-kw { color: #c792ea; }
.tok-str { color: #c3e88d; }
.tok-key { color: #f07178; }
.tok-num { color: #f78c6c; }
.tok-cmt { color: #676e95; font-style: italic; }
.tok-fn { color: #82aaff; }
.tok-flag { color: #89ddff; }
.home { max-width: 1040px; margin: 0 auto; padding: 48px 20px 72px; }
.hero { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 36px; }
.hero h1 { margin: 0 0 10px; font-size: 36px; }
.hero p { color: #344054; font-size: 16px; line-height: 1.7; max-width: 680px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.card h3 { margin: 0 0 8px; }
.card p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 14px; }
@media (max-width: 980px) {
  .layout { display: block; }
  .sidenav { position: relative; top: 0; width: auto; height: auto; max-height: 280px; }
  .doc-main { display: block; }
  .sample {
    position: relative;
    top: 0;
    width: auto;
    height: auto;
    min-height: 520px;
    margin-left: 0;
  }
  .grid { grid-template-columns: 1fr; }
  .article { padding: 20px 16px 40px; }
}
