/* UA Pro 文档页（使用指南、隐私政策）：与首页共用同一套设计语言 */
:root {
  --bg: #fbfbfd; --bg-2: #f2f3f7; --surface: #ffffff;
  --text: #0b0c10; --text-2: #4a4f5c; --text-3: #868b98;
  --line: rgba(11,12,16,.08); --line-2: rgba(11,12,16,.14);
  --brand: #4f46e5; --brand-2: #0ea5e9; --brand-soft: rgba(79,70,229,.08);
  --ok: #10b981; --glow: rgba(79,70,229,.18);
  --shadow-lg: 0 1px 1px rgba(0,0,0,.02), 0 8px 16px -4px rgba(16,18,40,.06), 0 32px 64px -16px rgba(16,18,40,.16);
  --shadow-sm: 0 1px 2px rgba(16,18,40,.05), 0 4px 12px -4px rgba(16,18,40,.06);
  --code: #f1f2f8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07080b; --bg-2: #0d0f14; --surface: #111318; --text: #f4f5f8; --text-2: #a9aebb; --text-3: #6f7482;
    --line: rgba(255,255,255,.07); --line-2: rgba(255,255,255,.13); --brand: #8b85ff; --brand-2: #38bdf8;
    --brand-soft: rgba(139,133,255,.10); --ok: #34d399; --glow: rgba(124,116,255,.28);
    --shadow-lg: 0 0 0 1px rgba(255,255,255,.04), 0 32px 80px -16px rgba(0,0,0,.7); --shadow-sm: 0 0 0 1px rgba(255,255,255,.03); --code: #171a22;
  }
}
:root[data-theme="dark"] {
  --bg: #07080b; --bg-2: #0d0f14; --surface: #111318; --text: #f4f5f8; --text-2: #a9aebb; --text-3: #6f7482;
  --line: rgba(255,255,255,.07); --line-2: rgba(255,255,255,.13); --brand: #8b85ff; --brand-2: #38bdf8;
  --brand-soft: rgba(139,133,255,.10); --ok: #34d399; --glow: rgba(124,116,255,.28);
  --shadow-lg: 0 0 0 1px rgba(255,255,255,.04), 0 32px 80px -16px rgba(0,0,0,.7); --shadow-sm: 0 0 0 1px rgba(255,255,255,.03); --code: #171a22;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* ---------- 导航 ---------- */
.nav { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid transparent; transition: background .2s, border-color .2s; }
.nav.scrolled { background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-color: var(--line); }
.nav .wrap { height: 64px; display: flex; align-items: center; gap: 36px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; letter-spacing: -.01em; }
.brand img { width: 28px; height: 28px; display: block; border-radius: 7px; }
.nav-links { display: flex; gap: 28px; font-size: 14px; color: var(--text-2); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); }
.nav-links a[aria-current] { font-weight: 600; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { color: var(--text); background: var(--bg-2); }
.icon-btn svg { width: 17px; height: 17px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; transition: transform .15s; }
.btn-primary { background: var(--text); color: var(--bg); box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 20px -6px rgba(0,0,0,.35); }
.btn-primary:hover { transform: translateY(-1px); }
@media (max-width: 1000px) { .nav-links { gap: 18px; margin-left: auto; } .nav-right { margin-left: 0; } .nav .wrap { gap: 18px; } }
@media (max-width: 640px) { .nav .btn { display: none; } .nav-links { font-size: 13px; gap: 14px; } }

/* ---------- 页头 ---------- */
.policy-hero { position: relative; padding: 64px 0 40px; isolation: isolate; }
.policy-hero::before { content: ""; position: absolute; inset: -64px 0 0; z-index: -1; background: radial-gradient(520px 240px at 20% 10%, var(--glow), transparent 70%); }
.eyebrow { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--brand); }
.policy-hero h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.1; letter-spacing: -.04em; font-weight: 700; margin: 20px 0 14px; overflow-wrap: anywhere; }
.policy-hero p { color: var(--text-2); max-width: 38em; margin: 0 0 10px; font-size: 18px; }
.policy-hero .smallprint, .policy-hero .guide-version-note { font-size: 13px; color: var(--text-3); margin-top: 14px; }
.policy-hero .guide-version-note { margin-top: 0; }
.language-link { display: inline-flex; margin: 4px 0 6px; font-size: 14px; font-weight: 600; color: var(--brand); }
.language-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- 版式：左侧目录 + 正文 ---------- */
.policy-layout { max-width: 1160px; margin: 0 auto; padding: 8px 16px 96px; display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 56px; align-items: start; }
@media (min-width: 720px) { .policy-layout { padding: 8px 32px 96px; } }
.policy-content { min-width: 0; max-width: 760px; }

/* 目录 */
.toc { position: sticky; top: 88px; --p: 0; }
.toc-head { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 0 0 14px 18px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: default; }
.toc-t { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--text-3); }
.toc-cur { display: none; flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc-pct { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--brand); font-weight: 650; }
.toc-chev { display: none; width: 18px; height: 18px; color: var(--text-3); transition: transform .3s; flex: none; align-self: center; }
.toc ol { list-style: none; margin: 0; padding: 0; position: relative; max-height: calc(100vh - 160px); overflow: auto; scrollbar-width: none; }
.toc ol::-webkit-scrollbar { display: none; }
.toc ol::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; border-radius: 2px; background: var(--line-2); }
.toc li { margin: 0; padding: 0; position: relative; }
.toc-thumb { position: absolute; left: 0; top: 0; width: 2px; height: 0; border-radius: 2px; background: linear-gradient(180deg, var(--brand), var(--brand-2)); box-shadow: 0 0 12px var(--glow); opacity: 0; transition: transform .45s cubic-bezier(.3,.8,.2,1), height .45s cubic-bezier(.3,.8,.2,1), opacity .2s; pointer-events: none; z-index: 1; }
.toc a { display: block; position: relative; padding: 7px 10px 7px 18px; margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--text-2); border-radius: 0 10px 10px 0; text-decoration: none !important; transition: color .2s, background .2s, padding-left .25s cubic-bezier(.3,.8,.2,1); }
.toc a:hover { color: var(--text); background: var(--bg-2); padding-left: 24px; }
.toc a.on { color: var(--brand); font-weight: 650; background: linear-gradient(90deg, var(--brand-soft), transparent); padding-left: 24px; }
.toc a:focus-visible { outline-offset: -2px; }
.policy-content li::before { display: none; }

.policy-content section, .policy-content h2, .policy-content h3 { scroll-margin-top: 88px; }
.policy-content h2 { font-size: clamp(24px, 3vw, 30px); letter-spacing: -.03em; line-height: 1.3; font-weight: 700; margin: 64px 0 20px; padding-top: 32px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.policy-content h2 .num { color: var(--text-3); font-weight: 500; margin-right: .5em; font-variant-numeric: tabular-nums; }
.policy-content h2 .num::after { content: "."; }
.policy-content h3 { font-size: 19px; letter-spacing: -.015em; margin: 36px 0 10px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.policy-content p, .policy-content li { color: var(--text-2); font-size: 17px; line-height: 1.9; }
.policy-content p { margin: 0 0 18px; }
.policy-content ul, .policy-content ol { padding-left: 1.4em; margin: 12px 0 22px; }
.policy-content li + li { margin-top: 8px; }
.policy-content li::marker { color: var(--text-3); }
.policy-content strong { color: var(--text); font-weight: 650; }
.policy-content a:not(.language-link) { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent); overflow-wrap: anywhere; }
.policy-content code { font-family: "SF Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .88em; background: var(--code); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: .1em .4em; overflow-wrap: anywhere; }
.guide-content > p:first-of-type { font-size: 19px; color: var(--text); line-height: 1.8; }
.policy-content > section:first-of-type h2, .guide-content > p:first-of-type + h2 { margin-top: 40px; }
.policy-content h2.flash, .policy-content h3.flash { animation: flash 1.4s ease-out; border-radius: 6px; }
@keyframes flash { 0% { background: color-mix(in srgb, var(--brand) 22%, transparent); box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand) 22%, transparent); } 100% { background: transparent; box-shadow: 0 0 0 8px transparent; } }
.policy-callout { background: var(--brand-soft); border-left: 3px solid var(--brand); border-radius: 0 12px 12px 0; padding: 14px 20px; margin: 24px 0; }
.policy-callout p { margin: 0; color: var(--text); }
.en-divider { margin: 72px 0 8px; padding: 40px 0 0; border-top: 1px solid var(--line-2); }
.en-divider .eyebrow { margin-bottom: 8px; }
.en-divider h2 { border: 0; padding: 0; margin: 12px 0 0; font-size: clamp(30px, 4vw, 40px); }

/* ---------- 表格 ---------- */
.table-scroll { max-width: 100%; overflow-x: auto; margin: 20px 0 28px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.table-scroll:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 3px; }
.guide-content table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 14.5px; line-height: 1.65; }
.guide-content th { text-align: left; background: var(--bg-2); color: var(--text); font-weight: 650; font-size: 13px; letter-spacing: .02em; }
.guide-content th, .guide-content td { padding: 12px 16px; vertical-align: top; border-bottom: 1px solid var(--line); color: var(--text-2); }
.guide-content td:first-child { color: var(--text); font-weight: 600; }
.guide-content tbody tr:last-child td { border-bottom: 0; }
.guide-content tbody tr:hover td { background: color-mix(in srgb, var(--brand) 3%, transparent); }

/* ---------- 回到顶部 ---------- */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm); display: grid; place-items: center; cursor: pointer; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--text); }
.to-top svg { width: 18px; height: 18px; }

/* ---------- 页脚 ---------- */
footer { padding: 24px 0 48px; }
.foot { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-top: 32px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-3); }
.foot nav { display: flex; gap: 24px; flex-wrap: wrap; }
.foot a:hover { color: var(--text); }
.foot span a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .policy-layout { display: block; padding-top: 0; }
  .toc { top: 64px; z-index: 30; margin: 0 -16px 28px; padding: 0 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--line); }
  .toc::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transform-origin: 0 50%; transform: scaleX(var(--p)); }
  .toc-head { padding: 13px 0; cursor: pointer; align-items: center; }
  .toc-cur { display: block; }
  .toc-pct { margin-left: 0; }
  .toc-chev { display: block; }
  .toc.open .toc-chev { transform: rotate(180deg); }
  .toc ol { max-height: 0; overflow: hidden; opacity: 0; transition: max-height .35s ease, opacity .25s, padding .35s; }
  .toc.open ol { max-height: 70vh; overflow: auto; opacity: 1; padding-bottom: 12px; }
  .toc ol::before { display: none; }
  .toc-thumb { display: none; }
  .toc a { padding-left: 12px; border-radius: 10px; }
  .toc a.on, .toc a:hover { padding-left: 16px; }
}
@media (min-width: 720px) and (max-width: 960px) { .toc { margin: 0 -32px 28px; padding: 0 32px; } }
@media (max-width: 640px) {
  .policy-hero { padding: 44px 0 28px; }
  .policy-hero p { font-size: 16.5px; }
  .policy-content h2 { margin-top: 52px; }
  .policy-content p, .policy-content li { font-size: 16px; }
  .guide-content > p:first-of-type { font-size: 17.5px; }
  .guide-content table { min-width: 560px; }
  .to-top { right: 14px; bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) { .toc-thumb, .toc a, .toc ol, .toc-chev { transition: none; } .policy-content h2.flash, .policy-content h3.flash { animation: none; } }

/* ---------- 语言切换 ---------- */
.lang { position: relative; }
.lang summary { list-style: none; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px; border-radius: 10px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; transition: background .2s, color .2s; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary svg { width: 16px; height: 16px; }
.lang summary:hover, .lang[open] summary { background: var(--bg-2); color: var(--text); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 148px; max-height: min(70vh, 32rem); overflow-y: auto; overscroll-behavior: contain; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); display: grid; gap: 2px; animation: langin .18s ease-out; z-index: 70; }
.lang-menu a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 9px; font-size: 14px; color: var(--text-2); }
.lang-menu a:hover { background: var(--bg-2); color: var(--text); }
.lang-menu a[aria-current] { color: var(--brand); font-weight: 600; }
.lang-menu a[aria-current]::after { content: "\2713"; }
html[dir="rtl"] .lang-menu { right: auto; left: 0; }
@keyframes langin { from { opacity: 0; transform: translateY(-4px); } }
html[lang="ja"] body { font-family: "Inter", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans CJK JP", "Segoe UI", sans-serif; }
html[lang="ja"] h1, html[lang="ja"] h2 { letter-spacing: -.02em; }
@media (prefers-reduced-motion: reduce) { .lang-menu { animation: none; } }

/* Logical alignment for right-to-left translated pages. */
html[dir="rtl"] .nav-right { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .toc-head { padding: 0 18px 14px 0; text-align: right; }
html[dir="rtl"] .toc-pct { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .toc ol::before, html[dir="rtl"] .toc-thumb { left: auto; right: 0; }
html[dir="rtl"] .toc a { padding: 7px 18px 7px 10px; border-radius: 10px 0 0 10px; }
html[dir="rtl"] .toc a:hover, html[dir="rtl"] .toc a.on { padding-right: 24px; }
html[dir="rtl"] .toc a.on { background: linear-gradient(270deg, var(--brand-soft), transparent); }
html[dir="rtl"] .policy-content h2 .num { margin-right: 0; margin-left: .5em; }
html[dir="rtl"] .policy-content ul, html[dir="rtl"] .policy-content ol { padding-left: 0; padding-right: 1.4em; }
html[dir="rtl"] .policy-callout { border-left: 0; border-right: 3px solid var(--brand); border-radius: 12px 0 0 12px; }
html[dir="rtl"] .guide-content th { text-align: right; }
html[dir="rtl"] .policy-content code { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .policy-hero h1, html[dir="rtl"] .policy-content h2, html[dir="rtl"] .policy-content h3 { letter-spacing: normal; }
@media (max-width: 1000px) { html[dir="rtl"] .nav-links { margin-left: 0; margin-right: auto; } html[dir="rtl"] .nav-right { margin-right: 0; } }
@media (max-width: 960px) { html[dir="rtl"] .toc-head { padding: 13px 0; } html[dir="rtl"] .toc-pct { margin-right: 0; } html[dir="rtl"] .toc a { padding: 7px 12px; border-radius: 10px; } html[dir="rtl"] .toc a.on, html[dir="rtl"] .toc a:hover { padding-right: 16px; } }

/* Keep translated navigation readable on narrow screens, including long labels. */
@media (max-width: 640px) {
  .nav .wrap { height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 0; padding-top: 10px; }
  .nav .brand { grid-column: 1; grid-row: 1; }
  .nav .nav-right { grid-column: 2; grid-row: 1; margin: 0; }
  .nav .nav-links { grid-column: 1 / -1; grid-row: 2; width: 100%; height: 38px; margin: 0; overflow-x: auto; white-space: nowrap; }
  .nav .nav-links a { flex: 0 0 auto; }
  .toc { top: 84px; }
}
