:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-subtle: #f0f2f5;
  --text: #1d1d1f;
  --text-muted: #515154;
  --border: rgba(0, 0, 0, 0.09);
  --accent: #0071e3;
  --accent-soft: rgba(0, 113, 227, 0.12);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  --radius-lg: 18px;
  --radius-md: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans", "Apple SD Gothic Neo", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0d10;
    --surface: #16181d;
    --surface-subtle: #1f2229;
    --text: #f5f5f7;
    --text-muted: #a1a1a6;
    --border: rgba(255, 255, 255, 0.11);
    --accent: #3b9eff;
    --accent-soft: rgba(59, 158, 255, 0.16);
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.page-shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-icon-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brand-icon-wrap svg,
.brand-icon-wrap img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: block;
}

.brand-override {
  position: absolute;
  inset: 0;
  object-fit: cover;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-and-lang {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.nav-links {
  display: inline-flex;
  gap: 10px;
  font-size: 14px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.lang-switcher {
  display: inline-flex;
  background: var(--surface-subtle);
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
}

.lang-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px 34px;
}

[data-lang] { display: none; }
[data-lang].is-active { display: block; }

.doc-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

h1 {
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.lead {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0 0 26px;
}

h2 {
  font-size: 19px;
  margin: 28px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

p, li { font-size: 15px; }
ul, ol { padding-left: 20px; margin: 8px 0 14px; }
li + li { margin-top: 6px; }

.callout {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 18px 0;
}

.shortcut-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px;
  font-size: 14px;
}

.shortcut-table th,
.shortcut-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.shortcut-table th {
  color: var(--text-muted);
  font-weight: 600;
}

kbd {
  display: inline-block;
  padding: 2px 7px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: var(--surface-subtle);
  padding: 2px 6px;
  border-radius: 5px;
}

.faq-item {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 12px 0;
}

.faq-item strong { display: block; margin-bottom: 6px; }

.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 26px;
}

.footer a { color: var(--accent); text-decoration: none; }

@media (max-width: 640px) {
  .doc-card { padding: 24px 20px; }
  h1 { font-size: 24px; }
}
