:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --bg-card: #ffffff;
  --text: #15171c;
  --text-soft: #5a6270;
  --text-faint: #868d9a;
  --line: #e4e7ec;
  --line-strong: #d3d8e0;
  --accent: #2f6fed;
  --accent-ink: #1b4fc4;
  --accent-soft: #ecf2ff;
  --ok-bg: #eaf7f0;
  --ok-line: #b6dfc8;
  --ok-ink: #1d6b44;
  --warn-bg: #fff8e8;
  --warn-line: #eed49a;
  --warn-ink: #7a5a12;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 22, 31, 0.05), 0 8px 24px rgba(18, 22, 31, 0.05);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216;
    --bg-soft: #161920;
    --bg-card: #181c23;
    --text: #eef0f4;
    --text-soft: #a7aebc;
    --text-faint: #7c8492;
    --line: #262b34;
    --line-strong: #333944;
    --accent: #6f9bff;
    --accent-ink: #9dbaff;
    --accent-soft: #18243d;
    --ok-bg: #13291f;
    --ok-line: #245c40;
    --ok-ink: #79d3a5;
    --warn-bg: #2a2313;
    --warn-line: #574421;
    --warn-ink: #e3c777;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "PingFang TC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 640;
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  flex: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, #4a83ff, #2f5fd0);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar { display: none; }

.nav a {
  padding: 6px 11px;
  border-radius: 8px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav a:hover { background: var(--bg-soft); color: var(--text); }

.nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 560;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  flex: none;
}

.lang-switch a {
  padding: 3px 8px;
  border-radius: 7px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 540;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-switch a:hover { color: var(--text); }

.lang-switch a[aria-current="true"] {
  background: var(--accent);
  color: #fff;
}

/* ---------- locale visibility ---------- */

.loc { display: none; }

html[data-lang="zh-Hans"] .loc[data-locale="zh-Hans"],
html[data-lang="zh-Hant"] .loc[data-locale="zh-Hant"],
html[data-lang="en"] .loc[data-locale="en"] {
  display: revert;
}

html:not([data-lang]) .loc { display: revert; }

/* ---------- document ---------- */

main {
  padding: 48px 0 72px;
}

.doc-title {
  font-size: clamp(30px, 6vw, 40px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 10px;
}

.doc-meta {
  color: var(--text-faint);
  font-size: 14.5px;
  margin: 0 0 36px;
}

.doc-meta strong { color: var(--text-soft); font-weight: 560; }

.lede {
  font-size: 19px;
  line-height: 1.7;
  color: var(--text-soft);
  margin: 0 0 40px;
}

h2 {
  font-size: 23px;
  line-height: 1.35;
  letter-spacing: -0.015em;
  font-weight: 660;
  margin: 48px 0 14px;
  padding-top: 8px;
}

h3 {
  font-size: 17.5px;
  line-height: 1.5;
  font-weight: 620;
  margin: 28px 0 8px;
}

p { margin: 0 0 16px; }

a { color: var(--accent); }

a:hover { color: var(--accent-ink); }

ul, ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

li { margin-bottom: 7px; }

li > ul, li > ol { margin-top: 7px; }

strong { font-weight: 620; }

code {
  font-family: var(--mono);
  font-size: 0.87em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  word-break: break-word;
}

pre {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 18px;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}

/* ---------- callouts ---------- */

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 0 0 22px;
}

.callout > :last-child { margin-bottom: 0; }

.callout-title {
  font-weight: 640;
  margin: 0 0 6px;
  font-size: 16px;
}

.callout p { font-size: 16px; }

.callout.local {
  border-left-color: var(--ok-line);
  background: var(--ok-bg);
}

.callout.local .callout-title { color: var(--ok-ink); }

.callout.remote {
  border-left-color: var(--warn-line);
  background: var(--warn-bg);
}

.callout.remote .callout-title { color: var(--warn-ink); }

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 0 22px;
  background: var(--bg-card);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15.5px;
  min-width: 560px;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 620;
  font-size: 14px;
  color: var(--text-soft);
  background: var(--bg-soft);
  white-space: nowrap;
}

tr:last-child td { border-bottom: 0; }

td:first-child { font-weight: 560; }

/* ---------- FAQ ---------- */

.faq { margin: 0 0 8px; }

.faq details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-card);
  margin-bottom: 10px;
  overflow: hidden;
}

.faq summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 16.5px;
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: background-color 0.15s ease;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: 9px;
  border-right: 2px solid var(--text-faint);
  border-bottom: 2px solid var(--text-faint);
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
}

.faq details[open] summary::before { transform: rotate(45deg); }

.faq summary:hover { background: var(--bg-soft); }

.faq .faq-body {
  padding: 0 18px 16px 35px;
  font-size: 16px;
}

.faq .faq-body > :last-child { margin-bottom: 0; }

/* ---------- contact card ---------- */

.contact {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin: 0 0 28px;
}

.contact-name {
  font-size: 19px;
  font-weight: 660;
  margin: 0 0 4px;
}

.contact-mail {
  font-size: 17px;
  font-family: var(--mono);
}

.contact-note {
  color: var(--text-soft);
  font-size: 15.5px;
  margin: 10px 0 0;
}

/* ---------- landing ---------- */

.hero {
  padding: 64px 0 8px;
}

.hero h1 {
  font-size: clamp(34px, 7.5vw, 50px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 730;
  margin: 0 0 14px;
}

.hero p {
  font-size: 19px;
  color: var(--text-soft);
  max-width: 56ch;
  margin: 0 0 8px;
}

.hero .eyebrow {
  font-size: 13px;
  font-weight: 640;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 36px 0 0;
}

.card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  color: inherit;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 19px;
  padding: 0;
}

.card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 15.5px;
  line-height: 1.65;
}

.card-arrow {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 560;
}

.facts {
  margin: 40px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.facts h2 {
  font-size: 17px;
  margin: 0 0 10px;
  padding: 0;
}

.facts ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-soft);
  font-size: 15.5px;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 44px;
  color: var(--text-faint);
  font-size: 14.5px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
}

.footer-inner nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
}

.footer-inner nav a {
  color: var(--text-soft);
  text-decoration: none;
}

.footer-inner nav a:hover { color: var(--accent); }

@media (max-width: 560px) {
  body { font-size: 16.5px; }
  main { padding: 34px 0 56px; }
  .header-inner { height: 56px; gap: 10px; }
  .nav a { padding: 6px 8px; font-size: 14px; }
  .footer-inner nav { margin-left: 0; width: 100%; }
}

@media print {
  .site-header, .lang-switch, .footer-inner nav { display: none; }
  body { font-size: 11pt; }
  main { padding: 0; }
  .faq details { border: 0; }
}
