:root {
  --navy: #15294A;
  --navy-deep: #0B1A33;
  --navy-2: #1F3A66;
  --cyan: #7FC9EA;
  --cyan-deep: #54AED6;
  --cyan-soft: #C7E7F5;
  --bg: #F1F5FB;
  --paper: #FAFCFF;
  --ink: #0F1A2E;
  --ink-soft: #4A5A78;
  --line: rgba(15,26,46,0.10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Zen Maru Gothic', system-ui, sans-serif;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.85;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}
:lang(en) body, body.lang-en { font-family: 'Inter', system-ui, sans-serif; }
:lang(zh) body, body.lang-zh { font-family: 'Inter', "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
:lang(ko) body, body.lang-ko { font-family: 'Inter', "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; }
.num, .mono { font-family: 'Inter', monospace; letter-spacing: 0; }
a { color: var(--cyan-deep); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }
strong { font-weight: 800; color: var(--ink); }

.topnav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(21,41,74,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(127,201,234,0.18);
}
.topnav-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1180px; margin: 0 auto; padding: 14px 32px; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 18px; color: #fff; }
.brand .pro { color: var(--cyan); }
.brand-sub { font-size: 11px; color: rgba(255,255,255,0.55); font-weight: 600; margin-left: 2px; }
.nav-right { display: flex; align-items: center; gap: 18px; }
.lang-switch {
  display: flex; gap: 2px;
  background: rgba(127,201,234,0.10);
  border: 1px solid rgba(127,201,234,0.20);
  border-radius: 999px; padding: 3px;
}
.lang-switch a {
  font-family: 'Inter'; font-size: 11px; font-weight: 800;
  letter-spacing: 0.06em;
  padding: 5px 11px; border-radius: 999px;
  color: rgba(255,255,255,0.70);
  text-decoration: none;
}
.lang-switch a:hover { color: var(--cyan); text-decoration: none; }
.lang-switch a.is-active { background: var(--cyan); color: var(--navy-deep); }
.back-link {
  font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,0.78);
  display: inline-flex; align-items: center; gap: 6px;
}
.back-link:hover { color: var(--cyan); text-decoration: none; }
.back-link::before { content: '←'; }

.doc-hero {
  background: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: #fff; padding: 80px 0 60px;
  position: relative; overflow: hidden;
}
.doc-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(127,201,234,0.12) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(700px 350px at 50% 50%, #000 30%, transparent 95%);
}
.doc-hero-inner { max-width: 880px; margin: 0 auto; padding: 0 32px; position: relative; z-index: 1; }
.doc-eyebrow {
  font-family: 'Inter'; font-weight: 800; font-size: 12px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--cyan);
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.doc-eyebrow::before { content: ''; width: 24px; height: 2px; background: var(--cyan); }
.doc-hero h1 {
  font-size: clamp(28px, 4vw, 44px); font-weight: 900; letter-spacing: -0.01em;
  line-height: 1.25; margin-bottom: 14px; color: #fff;
}
.doc-hero h1 .en { display: block; font-size: 0.55em; color: rgba(255,255,255,0.55); font-weight: 700; margin-top: 4px; letter-spacing: 0.04em; }
.doc-meta {
  display: flex; flex-wrap: wrap; gap: 14px 24px;
  font-family: 'Inter'; font-size: 12px; font-weight: 700;
  color: rgba(255,255,255,0.65); letter-spacing: 0.06em;
  padding-top: 18px;
  border-top: 1px solid rgba(127,201,234,0.20);
}
.doc-meta span strong { color: var(--cyan); font-weight: 800; }

.doc-wrap { max-width: 880px; margin: 0 auto; padding: 56px 32px 80px; }

.lead-box {
  background: var(--paper); border: 1.5px solid var(--line);
  border-left: 4px solid var(--cyan);
  border-radius: 12px;
  padding: 22px 26px; margin-bottom: 32px;
  font-size: 14.5px; line-height: 1.85; color: var(--ink-soft);
}
.lead-box strong { color: var(--ink); }
.lead-box .en { display: block; margin-top: 12px; font-size: 13px; color: var(--ink-soft); font-style: italic; }

.changelog-box {
  background: rgba(127,201,234,0.10);
  border: 1px solid rgba(127,201,234,0.30);
  border-radius: 12px;
  padding: 20px 26px; margin-bottom: 40px;
}
.changelog-box h3 {
  font-family: 'Inter'; font-size: 12px; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan-deep);
  margin-bottom: 10px;
}
.changelog-box ul { list-style: none; padding: 0; }
.changelog-box li {
  position: relative; padding-left: 18px;
  font-size: 14px; line-height: 1.75;
  margin-bottom: 4px;
}
.changelog-box li::before {
  content: ''; position: absolute; left: 0; top: 11px;
  width: 8px; height: 2px; background: var(--cyan-deep);
}

.doc h2 {
  font-family: 'Zen Maru Gothic'; font-weight: 900;
  font-size: 24px; line-height: 1.35;
  margin: 56px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--navy);
  color: var(--navy);
  display: flex; align-items: baseline; gap: 12px;
}
:lang(en) .doc h2, .lang-en .doc h2,
:lang(zh) .doc h2, .lang-zh .doc h2,
:lang(ko) .doc h2, .lang-ko .doc h2 { font-family: inherit; }
.doc h2 .num {
  font-family: 'Inter'; font-weight: 800; font-size: 14px;
  color: var(--cyan-deep); letter-spacing: 0.04em;
  background: var(--cyan-soft);
  padding: 4px 10px; border-radius: 6px;
  flex-shrink: 0;
}
.doc h3 {
  font-family: 'Zen Maru Gothic'; font-weight: 900;
  font-size: 17px; line-height: 1.5;
  margin: 32px 0 12px;
  color: var(--navy);
  position: relative;
  padding-left: 14px;
}
:lang(en) .doc h3, .lang-en .doc h3,
:lang(zh) .doc h3, .lang-zh .doc h3,
:lang(ko) .doc h3, .lang-ko .doc h3 { font-family: inherit; }
.doc h3::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 4px; background: var(--cyan);
  border-radius: 2px;
}
.doc h4 {
  font-weight: 900; font-size: 15px; margin: 20px 0 8px;
  color: var(--navy-2);
}
.doc p {
  font-size: 14.5px; line-height: 1.9; color: var(--ink-soft);
  margin-bottom: 14px;
}
.doc p strong { color: var(--ink); font-weight: 800; }
.doc ul, .doc ol {
  margin: 0 0 16px 0;
  padding-left: 0;
  list-style: none;
}
.doc ul li, .doc ol li {
  font-size: 14.5px; line-height: 1.85; color: var(--ink-soft);
  position: relative;
  padding-left: 22px;
  margin-bottom: 6px;
}
.doc ul li::before {
  content: ''; position: absolute; left: 4px; top: 12px;
  width: 8px; height: 2px; background: var(--cyan-deep);
  border-radius: 1px;
}
.doc ol { counter-reset: ol-counter; }
.doc ol li::before {
  counter-increment: ol-counter;
  content: counter(ol-counter) '.';
  position: absolute; left: 0; top: 0;
  font-family: 'Inter'; font-weight: 800; color: var(--cyan-deep);
}

.doc table {
  width: 100%; border-collapse: collapse;
  background: var(--paper); border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line);
  margin: 14px 0 24px;
  font-size: 13.5px;
}
.doc table th {
  background: var(--navy); color: #fff;
  font-weight: 800; font-size: 13px;
  padding: 12px 16px; text-align: left;
  letter-spacing: 0.02em;
}
.doc table td {
  padding: 14px 16px; border-top: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-soft); line-height: 1.75;
}
.doc table td:first-child { font-weight: 800; color: var(--navy); width: 220px; }
.doc table td strong { color: var(--ink); }

.doc blockquote {
  margin: 16px 0;
  padding: 16px 22px;
  background: var(--paper);
  border-left: 4px solid var(--cyan-deep);
  border-radius: 8px;
  font-size: 14px; color: var(--ink-soft);
  line-height: 1.85;
}
.doc blockquote strong { color: var(--ink); }

.doc code, .doc pre {
  font-family: 'Inter', monospace; font-size: 13px;
  background: var(--bg); color: var(--navy);
  padding: 2px 8px; border-radius: 4px;
}
.doc pre {
  display: block; padding: 16px 20px; margin: 12px 0;
  white-space: pre-wrap; word-break: break-all;
  border-left: 4px solid var(--cyan); color: var(--navy);
  font-size: 13px; line-height: 1.7;
}

.toc {
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 40px;
  font-size: 13.5px;
}
.toc h4 {
  font-family: 'Inter'; font-size: 11px; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan-deep);
  margin-bottom: 14px;
}
.toc-list {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 24px;
}
@media (max-width: 720px) { .toc-list { grid-template-columns: 1fr; } }
.toc-list li { padding: 0; margin: 0; }
.toc-list li::before { display: none; }
.toc-list a {
  display: flex; gap: 10px; align-items: baseline;
  padding: 6px 0; font-size: 13px; font-weight: 700;
  color: var(--ink); text-decoration: none;
  line-height: 1.5;
}
.toc-list a:hover { color: var(--cyan-deep); }
.toc-list a .n {
  font-family: 'Inter'; font-size: 11px; font-weight: 800;
  color: var(--cyan-deep); min-width: 22px;
}

.doc-foot {
  margin-top: 80px; padding-top: 36px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  font-size: 13px; color: var(--ink-soft);
}
.doc-foot a { font-weight: 800; }
.doc-foot .home-link {
  background: var(--navy); color: #fff;
  padding: 12px 22px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
}
.doc-foot .home-link::before { content: '←'; }
.doc-foot .home-link:hover { background: var(--navy-deep); text-decoration: none; color: var(--cyan); }

.side-toc {
  position: fixed; top: 50%; right: 24px;
  transform: translateY(-50%) translateX(20px);
  z-index: 90;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  width: 220px; max-height: 70vh; overflow-y: auto;
  font-size: 12px;
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease, transform .35s cubic-bezier(0.22, 1.2, 0.36, 1);
  box-shadow: 0 16px 40px rgba(15,26,46,0.12);
}
.side-toc.show { opacity: 1; pointer-events: auto; transform: translateY(-50%) translateX(0); }
.side-toc h5 {
  font-family: 'Inter'; font-size: 10px; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan-deep);
  margin-bottom: 10px;
}
.side-toc ol { list-style: none; padding: 0; margin: 0; }
.side-toc li { padding: 0; margin: 0; }
.side-toc li::before { display: none; }
.side-toc a {
  display: flex; gap: 8px; align-items: baseline;
  padding: 5px 6px; border-radius: 6px;
  font-size: 12px; font-weight: 700;
  color: var(--ink); text-decoration: none;
  line-height: 1.4;
  position: relative;
  transition: background .35s ease, color .35s ease, box-shadow .35s ease, transform .35s cubic-bezier(0.34, 1.45, 0.64, 1), padding .35s ease;
}
.side-toc a:hover { background: var(--cyan-soft); color: var(--navy); }
.side-toc a.is-active {
  background: var(--navy); color: #fff;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(21,41,74,0.25);
  transform: translateX(-4px);
  padding-left: 10px;
}
.side-toc a.is-active::before {
  content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 70%;
  background: var(--cyan);
  border-radius: 2px;
  animation: side-toc-mark .5s cubic-bezier(0.34, 1.45, 0.64, 1);
}
.side-toc a.is-active .n {
  color: var(--cyan);
  transition: color .35s ease;
}
@keyframes side-toc-mark {
  0% { transform: translateY(-50%) scaleY(0.2); opacity: 0; }
  100% { transform: translateY(-50%) scaleY(1); opacity: 1; }
}
.side-toc a .n {
  font-family: 'Inter'; font-size: 10px; font-weight: 800;
  color: var(--cyan-deep); min-width: 18px;
  transition: color .35s ease;
}
@media (max-width: 1240px) { .side-toc { display: none; } }
