/* ==========================================================
   policy.css — 用户协议 / 隐私政策专用样式
   依赖：styles.css 已加载，提供 :root 变量与 .glass-panel
   ========================================================== */

:root {
  --policy-max: 760px;
  --policy-text: rgba(255, 255, 255, 0.94);
  --policy-body: rgba(232, 240, 255, 0.86);
  --policy-muted: rgba(232, 240, 255, 0.72);
  --policy-emphasis: #ffd58a;
  --policy-amber-bg: rgba(255, 213, 138, 0.08);
  --policy-amber-border: rgba(255, 213, 138, 0.32);
  --policy-divider: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.18) 50%,
    transparent
  );
}

/* —— 页面容器 —— */
body.policy-body {
  /* 文档页背景适度降饱和，减轻长文阅读疲劳 */
  background:
    radial-gradient(55% 70% at 12% 18%, rgba(172, 120, 255, 0.22) 0%, rgba(172, 120, 255, 0.05) 52%, transparent 100%),
    radial-gradient(50% 76% at 88% 10%, rgba(99, 162, 255, 0.22) 0%, rgba(99, 162, 255, 0.05) 50%, transparent 100%),
    linear-gradient(128deg, var(--bg-1) 0%, var(--bg-2) 44%, var(--bg-3) 100%);
}

body.policy-body .blob { opacity: 0.32; filter: blur(58px); }

.policy-page {
  width: min(var(--policy-max), 92vw);
  margin: 0 auto;
  padding: 28px 0 80px;
}

/* —— 顶部提示条 —— */
.policy-notice {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0 calc(50% - 50vw);
  padding: 12px 24px;
  background: rgba(8, 14, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--policy-amber-border);
  color: var(--policy-emphasis);
  font-size: 14px;
  text-align: center;
  letter-spacing: 0.02em;
}

.policy-notice strong { color: #ffe6b0; }

/* —— 主玻璃面板 —— */
.policy-panel {
  margin-top: 32px;
  padding: 56px 56px 64px;
  background:
    linear-gradient(132deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04)),
    radial-gradient(120% 120% at 0% 0%, rgba(191, 164, 255, 0.10), rgba(132, 185, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border-radius: 26px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

/* —— 页面标题与副标题 —— */
.policy-title {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  color: var(--policy-text);
}

.policy-subtitle {
  font-size: 15px;
  color: var(--policy-muted);
  margin: 0 0 36px;
  letter-spacing: 0.06em;
}

/* —— 政策摘要框 —— */
.policy-summary {
  margin: 0 0 48px;
  padding: 28px 32px;
  background: var(--policy-amber-bg);
  border: 1px solid var(--policy-amber-border);
  border-radius: 20px;
}

.policy-summary-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--policy-emphasis);
  letter-spacing: 0.16em;
  margin: 0 0 16px;
}

.policy-summary ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.policy-summary li {
  position: relative;
  padding: 6px 0 6px 20px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--policy-body);
}

.policy-summary li::before {
  content: "·";
  position: absolute;
  left: 4px;
  top: 4px;
  color: var(--policy-emphasis);
  font-size: 18px;
  font-weight: 700;
}

.policy-summary a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 213, 138, 0.4);
  transition: border-color 0.18s ease;
}

.policy-summary a:hover { border-bottom-color: var(--policy-emphasis); }

/* —— 章节 —— */
.policy-section {
  margin-top: 56px;
  scroll-margin-top: 88px; /* 顶栏遮挡补偿 */
}

.policy-section:first-of-type { margin-top: 0; }

.policy-h2 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--policy-text);
  margin: 0 0 24px;
  padding-bottom: 14px;
  background: var(--policy-divider) no-repeat left bottom / 100% 1px;
}

.policy-h3 {
  font-size: 19px;
  font-weight: 500;
  color: var(--policy-text);
  margin: 32px 0 12px;
  letter-spacing: 0.02em;
}

/* —— 正文段落 —— */
.policy-section p {
  font-size: 17px;
  line-height: 1.85;
  letter-spacing: 0.02em;
  color: var(--policy-body);
  margin: 0 0 16px;
}

.policy-section ul,
.policy-section ol {
  font-size: 17px;
  line-height: 1.85;
  color: var(--policy-body);
  padding-left: 24px;
  margin: 0 0 16px;
}

.policy-section li { margin-bottom: 6px; }

.policy-section strong { color: var(--policy-text); font-weight: 600; }

/* —— 重要条款加粗高亮 —— */
.policy-emphasis-block {
  margin: 24px 0;
  padding: 20px 24px;
  background: var(--policy-amber-bg);
  border-left: 3px solid var(--policy-amber-border);
  border-radius: 6px;
  color: var(--policy-text);
}

.policy-emphasis-block strong { color: var(--policy-emphasis); }

/* —— 委托处理 / 服务商表格 —— */
.policy-table-wrap {
  margin: 16px 0 24px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.policy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  color: var(--policy-body);
}

.policy-table thead {
  background: rgba(255, 255, 255, 0.06);
  color: var(--policy-text);
  font-weight: 500;
}

.policy-table th,
.policy-table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1.6;
}

.policy-table tbody tr:last-child td { border-bottom: none; }

.policy-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

/* —— 内嵌 footer-meta（如联系章节内）减小顶部间距 —— */
.policy-section .policy-footer-meta {
  margin-top: 16px;
}

/* —— 仅屏幕阅读器可见（用于 <caption> 等无障碍辅助文本） —— */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— 脚注 / 法条引用小字 —— */
.policy-fineprint {
  font-size: 14px;
  color: var(--policy-muted);
  line-height: 1.7;
  margin: 8px 0 16px;
}

/* —— 页脚 meta —— */
.policy-footer-meta {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 14px;
  color: var(--policy-muted);
  line-height: 1.85;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 24px;
}

.policy-footer-meta dt {
  font-weight: 500;
  color: var(--policy-body);
  margin-bottom: 4px;
}

.policy-footer-meta dd {
  margin: 0 0 8px;
  color: var(--policy-muted);
}

.policy-back-link {
  display: inline-block;
  margin-top: 32px;
  padding: 10px 22px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  color: var(--policy-text);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.04em;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.policy-back-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.5);
}

/* —— 响应式 —— */
@media (max-width: 1024px) {
  .policy-panel { padding: 44px 36px 52px; }
}

@media (max-width: 640px) {
  .policy-page { padding: 18px 0 60px; }
  .policy-panel { padding: 28px 20px 40px; border-radius: 18px; }
  .policy-title { font-size: 28px; }
  .policy-h2 { font-size: 22px; margin-bottom: 18px; }
  .policy-h3 { font-size: 17px; margin-top: 24px; }
  .policy-section p,
  .policy-section ul,
  .policy-section ol { font-size: 16px; line-height: 1.8; }
  .policy-summary { padding: 20px 18px; }
  .policy-summary li { font-size: 14px; }
  .policy-notice { padding: 10px 16px; font-size: 13px; }

  /* 表格转卡片堆叠 */
  .policy-table-wrap { border: none; }
  .policy-table,
  .policy-table thead,
  .policy-table tbody,
  .policy-table tr,
  .policy-table th,
  .policy-table td { display: block; width: 100%; }
  .policy-table thead { display: none; }
  .policy-table tbody tr {
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    padding: 8px 4px;
  }
  .policy-table td {
    border: none;
    padding: 6px 12px;
    position: relative;
    padding-left: 96px;
  }
  .policy-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 12px;
    top: 6px;
    width: 80px;
    color: var(--policy-muted);
    font-size: 13px;
  }
}

/* —— 打印样式 —— */
@media print {
  body.policy-body {
    background: #fff !important;
    color: #000 !important;
  }
  body.policy-body .bg-aurora,
  body.policy-body .blob,
  .policy-notice,
  .policy-back-link { display: none !important; }
  .policy-panel {
    background: #fff !important;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    backdrop-filter: none !important;
    padding: 24px !important;
  }
  .policy-title,
  .policy-h2,
  .policy-h3,
  .policy-section p,
  .policy-section li,
  .policy-summary li,
  .policy-footer-meta dt,
  .policy-footer-meta dd { color: #000 !important; }
  .policy-summary { background: #fff7e6 !important; border: 1px solid #b78900 !important; }
  .policy-emphasis-block { background: #fff7e6 !important; border-left-color: #b78900 !important; }
  .policy-emphasis-block strong { color: #b78900 !important; }
  .policy-table th,
  .policy-table td { border-bottom: 1px solid #888 !important; }
  /* 仅正文与页脚的链接展示 URL；摘要中的锚点链接不输出，避免噪音 */
  .policy-section a::after,
  .policy-footer-meta a::after { content: " (" attr(href) ")"; font-size: 12px; color: #555; }
}
