/*
 * [INPUT]: 复用 styles.css 的背景、文字、边框和字体变量。
 * [OUTPUT]: 定义隐私政策 / 用户协议的阅读布局、中英切换，以及首页页脚的协议入口样式。
 * [POS]: 由首页、隐私政策页、用户协议页加载。选择器限定在政策区域和首页页脚。
 * [PROTOCOL]: 变更时更新此头部，然后检查 CLAUDE.md
 */

/* 中英双语：<html data-lang> 决定显示哪一份 */
html:not([data-lang="en"]) .l-en,
html[data-lang="en"] .l-zh { display: none !important; }

.policy-tools {
  display: flex;
  align-items: center;
  gap: 20px;
}

.policy-lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}

.policy-lang button {
  padding: 2px 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.policy-lang button[aria-pressed="true"] {
  color: #5346a8;
  font-weight: 600;
}

.policy-page .l-en :is(h1, h2, h3) {
  font-family: "Inter", -apple-system, "Segoe UI", sans-serif !important;
}

.site-privacy-footer .legal-sep { margin: 0 8px; color: var(--muted); }

.site-privacy-footer {
  position: relative;
  z-index: 2;
  padding: 24px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.site-privacy-footer p { margin: 0 0 6px; }

.site-privacy-footer a,
.policy-page a {
  color: #5346a8;
  text-underline-offset: .25em;
}

.site-privacy-footer a:focus-visible,
.policy-page a:focus-visible {
  outline: 2px solid #5346a8;
  outline-offset: 4px;
}

.policy-page {
  background: radial-gradient(ellipse at 65% 0, #ece8ff, transparent 420px), var(--bg);
}

.policy-bar,
.policy-main {
  width: min(1060px, calc(100% - 48px));
  margin-inline: auto;
}

.policy-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 22px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.policy-bar img {
  display: block;
  width: 148px;
  height: auto;
}

.policy-heading { padding-block: clamp(36px, 7vw, 84px) 36px; }
.policy-heading p { margin: 10px 0 0; color: var(--muted); }

.policy-page :is(h1, h2, h3) {
  font-family: var(--font-zh) !important;
  letter-spacing: normal !important;
}

.policy-heading h1 {
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1.15;
}

.policy-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: clamp(24px, 4vw, 56px);
  padding-bottom: 64px;
}

.policy-toc {
  display: block;
  position: sticky;
  top: 24px;
  padding-top: 12px;
  font-size: 14px;
}

.policy-toc strong { display: block; margin-bottom: 8px; }
.policy-toc ul { margin: 0; padding: 0; list-style: none; }

.policy-toc a {
  display: block;
  padding-block: 5px;
  font-size: inherit;
  font-weight: 500;
}

.policy-toc a:hover { text-decoration: underline; }

.policy-copy {
  padding: clamp(20px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.policy-copy section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 20px;
}

.policy-copy h2 { margin: 0 0 12px; font-size: clamp(19px, 3vw, 24px); line-height: 1.4; }
.policy-copy p { margin: 0 0 12px; }
.policy-copy > :last-child > :last-child { margin-bottom: 0; }

.policy-google {
  margin: 24px 0 0;
  padding: 16px 20px;
  border-radius: 12px;
  background: #f5f3ff;
  scroll-margin-top: 20px;
}

.policy-google h3 { margin: 0 0 8px; font-size: 18px; }
.policy-google p:last-child { margin-bottom: 0; }

@media (max-width: 760px) {
  .policy-bar,
  .policy-main { width: calc(100% - 32px); }

  .policy-layout { grid-template-columns: minmax(0, 1fr); }
  .policy-toc { position: static; padding-top: 0; }
  .policy-toc ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 10px; }
  .policy-toc a { padding-block: 7px; }
  .policy-google { padding-inline: 12px; }
}
