/* Shared styles for the standalone sub-pages (docs/api, about, terms, privacy).
   Same palette and chrome as index.html: dark header/footer, light content, dark code blocks. */
:root {
  --primary: #4f8cff; --accent: #22d3a6; --danger: #ff5d6c;
  --grad: linear-gradient(135deg, var(--primary), var(--accent));
  --radius: 16px;
  --bg: #ffffff; --text: #0f172a; --muted: #64748b; --card: #f8fafc; --border: #e2e8f0; --chip: #eef4ff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", "Noto Sans TC", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.65; background: #0b1020; color: var(--text); }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
[hidden] { display: none !important; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; color: #000; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* Header (dark, fixed) */
#site-header { position: fixed; inset: 0 0 auto; z-index: 50; color: #e6e9f2; background: rgba(11,16,32,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 1px 0 #1d2545; }
#site-header nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; white-space: nowrap; }
.mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; color: #fff; font-weight: 800; overflow: hidden; }
.mark img { width: 100%; height: 100%; object-fit: contain; }
.menu { display: flex; gap: 26px; list-style: none; color: #9aa3b8; font-size: .95rem; }
.menu a { position: relative; padding: 6px 0; transition: color .2s; }
.menu a:hover, .menu a.active { color: #fff; }
.menu a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px; background: var(--grad); }
.right { display: flex; align-items: center; gap: 12px; }
.login { color: #9aa3b8; font-size: .95rem; }
.login:hover { color: #fff; }
select.lang { background: #141b33; color: #e6e9f2; border: 1px solid #2c365a; border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.burger { display: none; background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; }

/* Page title band */
.page-head { background: #0b1020; color: #e6e9f2; padding: 124px 0 48px; position: relative; overflow: hidden; }
.page-head::before { content: ""; position: absolute; width: 480px; height: 480px; border-radius: 50%; filter: blur(110px); opacity: .22; background: var(--primary); top: -200px; left: -140px; pointer-events: none; }
.page-head .container { position: relative; }
.page-head h1 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); line-height: 1.15; margin-bottom: 12px; }
.page-head .lead { color: #9aa3b8; max-width: 760px; font-size: 1.05rem; }
.page-head .meta { margin-top: 14px; color: #9aa3b8; font-size: .9rem; }

/* Content area (light) */
main { background: var(--bg); }
.content { padding: 48px 0 88px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 12px 24px; border-radius: 10px; font-weight: 600; border: 0; cursor: pointer; transition: transform .15s, opacity .15s; }
.btn:hover { transform: translateY(-2px); opacity: .92; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(79,140,255,.25); }
.btn-ghost { border: 1px solid var(--border); background: transparent; color: var(--text); }

/* Legal / about articles */
.doc { max-width: 820px; margin: 0 auto; }
.doc h2 { font-size: 1.3rem; margin: 36px 0 10px; text-align: left; }
.doc h2:first-child { margin-top: 0; }
.doc p { color: #334155; margin-bottom: 12px; }
.doc ul { margin: 0 0 14px; padding-left: 22px; color: #334155; }
.doc li { margin-bottom: 6px; }
.doc .contact a { color: var(--primary); font-weight: 600; }
.doc .contact { list-style: none; padding: 0; display: grid; gap: 8px; }
.doc .note { margin-top: 40px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--muted); font-size: .92rem; }
.doc .cta-row, .docs-body .cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

/* API docs layout */
.docs { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; font-size: .92rem; padding-right: 8px; }
.toc summary { display: none; }
.toc ul { list-style: none; display: grid; gap: 2px; }
.toc a { display: block; padding: 6px 12px; border-left: 2px solid var(--border); color: var(--muted); transition: color .15s, border-color .15s; }
.toc a:hover { color: var(--text); }
.toc a.on { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.toc .sub a { padding-left: 26px; font-size: .88rem; }
.toc .method { font-size: .7rem; font-weight: 700; margin-right: 6px; }
.docs-body section { margin-bottom: 56px; }
.docs-body h2 { font-size: 1.55rem; text-align: left; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.docs-body h3 { font-size: 1.1rem; margin: 22px 0 8px; }
.docs-body p { color: #334155; margin-bottom: 10px; }
.docs-body code, .doc code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: #1d4ed8; padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.kv { display: grid; gap: 12px; margin: 12px 0; }
.kv div { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.kv small { display: block; color: var(--muted); font-size: .8rem; }
.kv code { background: none; padding: 0; word-break: break-all; }
.tablewrap { overflow-x: auto; margin: 10px 0 14px; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--card); color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.req { color: #b4232c; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.opt { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.steps-list { padding-left: 22px; color: #334155; display: grid; gap: 6px; margin-bottom: 10px; }
.endpoint { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; background: #fff; }
.endpoint > header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; background: var(--card); border-bottom: 1px solid var(--border); }
.endpoint > header code { background: none; padding: 0; color: var(--text); font-size: 1rem; font-weight: 600; }
.endpoint .inner { padding: 6px 18px 18px; }
.badge-m { display: inline-block; min-width: 54px; text-align: center; padding: 3px 10px; border-radius: 8px; font-size: .78rem; font-weight: 800; letter-spacing: .04em; color: #fff; }
.badge-m.get { background: #0f9e7b; }
.badge-m.post { background: #d97706; }
.notes { padding-left: 20px; color: #334155; display: grid; gap: 6px; margin: 8px 0; }
.code { background: #0f172a; color: #e2e8f0; border-radius: 12px; overflow: hidden; margin: 8px 0 14px; position: relative; }
.code .bar { display: flex; align-items: center; gap: 4px; padding: 8px 12px; background: #0b1222; border-bottom: 1px solid #1e293b; color: #94a3b8; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.code .bar .tabs { display: flex; gap: 4px; }
.code .bar .tabs button { background: none; border: 0; color: #94a3b8; padding: 5px 12px; border-radius: 8px; cursor: pointer; font-size: .82rem; text-transform: none; letter-spacing: 0; }
.code .bar .tabs button.on { background: #1e293b; color: #fff; }
.code .bar .copy { margin-left: auto; background: #1e293b; border: 0; color: #e2e8f0; padding: 5px 12px; border-radius: 8px; cursor: pointer; font-size: .8rem; text-transform: none; letter-spacing: 0; }
.code .bar .copy:hover { background: #2c3a56; }
.code pre { padding: 16px 18px; overflow-x: auto; font: .85rem/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; margin: 0; }
/* Dark #0f172a block; colours are the brand scheme brightened to keep >= 4.5:1 contrast on it:
   default #f87171 (6.4:1, from #b11b1b), key #00ffdc (13.9:1), value #e8892b (6.8:1, from #d16e19), comment #94a3b8 (7.0:1). */
.code pre { color: #f87171; }
.code pre code { color: inherit; background: none; padding: 0; border-radius: 0; font-size: inherit; }
.code .c { color: #94a3b8; } .code .k { color: #00ffdc; } .code .v { color: #e8892b; }
.http { display: inline-block; min-width: 40px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Footer (dark) */
footer { background: #070c16; color: #e6e9f2; padding: 64px 0 28px; border-top: 1px solid #1d2545; }
.fgrid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.fgrid h4 { margin-bottom: 14px; font-size: .95rem; }
.fgrid ul { list-style: none; display: grid; gap: 8px; color: #9aa3b8; }
.fgrid ul a:hover { color: #e6e9f2; }
.fgrid .tag { color: #9aa3b8; margin-top: 12px; max-width: 280px; }
.bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid #1d2545; margin-top: 44px; padding-top: 22px; color: #9aa3b8; font-size: .9rem; }
#toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px); background: #0f172a; color: #fff; padding: 10px 20px; border-radius: 10px; opacity: 0; transition: .25s; pointer-events: none; z-index: 99; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 960px) {
  .docs { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; max-height: none; border: 1px solid var(--border); border-radius: 12px; padding: 0; background: var(--card); }
  .toc summary { display: block; cursor: pointer; padding: 12px 16px; font-weight: 600; }
  .toc ul { padding: 0 8px 12px; }
  .fgrid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .burger { display: block; }
  .login { display: none; }
  .menu { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0; background: rgba(11,16,32,.97); padding: 8px 24px 16px; border-bottom: 1px solid #1d2545; }
  .menu.open { display: flex; }
  .menu a { display: block; padding: 12px 0; }
  .menu a.active::after { display: none; }
}
@media (max-width: 640px) {
  .content { padding: 32px 0 64px; }
  .fgrid { grid-template-columns: 1fr; }
}
