/* ==========================================================================
   pages.css —— 合规页面 / 广告位 / 作者卡 / Cookie 横幅
   与 style.css 共用同一套设计令牌（--primary / --surface / --text 等），
   深浅色主题自动跟随，无需重复定义颜色。
   ========================================================================== */

/* 语言分块切换用（中英整段互斥显示） */
[hidden] { display: none !important; }

/* ==========================================================================
   1. 静态页面通用外壳
   ========================================================================== */
.page-hero {
  background: linear-gradient(180deg, var(--primary-soft), transparent);
  border-bottom: 1px solid var(--border);
  padding: 40px 0 32px;
  margin-bottom: var(--gap);
}
.page-hero .breadcrumb { margin-bottom: 14px; }
.page-hero h1 {
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.28;
  margin: 0 0 10px;
  letter-spacing: -.01em;
}
.page-hero .page-sub {
  color: var(--text-2);
  max-width: 68ch;
  line-height: 1.75;
  margin: 0;
}
.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-3);
}
.page-meta span { display: inline-flex; align-items: center; gap: 6px; }
.page-meta strong { color: var(--text-2); font-weight: 600; }

/* 法律/说明类正文排版 —— 行距略大，长文更好读 */
.legal-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: calc(var(--gap) * 1.4);
  align-items: start;
  padding-bottom: 56px;
}
.legal-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: clamp(22px, 3.4vw, 42px);
  min-width: 0;
}
.legal-body > *:first-child { margin-top: 0; }
.legal-body > *:last-child { margin-bottom: 0; }
.legal-body h2 {
  font-size: 20px;
  line-height: 1.4;
  margin: 38px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.legal-body > h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.legal-body h3 {
  font-size: 16px;
  margin: 24px 0 10px;
  color: var(--text);
}
.legal-body p,
.legal-body li {
  color: var(--text-2);
  line-height: 1.85;
  font-size: 15px;
}
.legal-body p { margin: 0 0 14px; }
.legal-body ul,
.legal-body ol { margin: 0 0 16px; padding-left: 22px; }
.legal-body li { margin-bottom: 8px; }
.legal-body li::marker { color: var(--primary); }
.legal-body strong { color: var(--text); font-weight: 650; }
.legal-body a { color: var(--primary); text-decoration: none; border-bottom: 1px solid transparent; }
.legal-body a:hover { border-bottom-color: currentColor; }
.legal-body .table-wrap { margin: 18px 0 22px; }

/* 重点提示块 */
.legal-note {
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 20px 0;
}
.legal-note p { margin: 0; color: var(--text-2); }
.legal-note p + p { margin-top: 10px; }

/* 侧栏目录 */
.legal-toc {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-xs);
}
.legal-toc h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin: 0 0 12px;
}
.legal-toc ol { margin: 0; padding-left: 18px; }
.legal-toc li { margin-bottom: 9px; font-size: 14px; line-height: 1.5; }
.legal-toc li::marker { color: var(--text-3); font-variant-numeric: tabular-nums; }
.legal-toc a { color: var(--text-2); text-decoration: none; }
.legal-toc a:hover { color: var(--primary); }

@media (max-width: 900px) {
  .legal-wrap { grid-template-columns: 1fr; }
  .legal-toc { position: static; order: -1; }
}

/* ==========================================================================
   2. 联系页
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap);
  margin: 4px 0 8px;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-xs);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.contact-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}
.contact-card .cc-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 14px;
}
.contact-card .cc-icon svg { width: 20px; height: 20px; }
.contact-card h3 { font-size: 16px; margin: 0 0 6px; }
.contact-card p { color: var(--text-2); font-size: 14px; line-height: 1.7; margin: 0 0 12px; }
.contact-card a.cc-mail {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--primary); font-weight: 600; font-size: 14px;
  text-decoration: none; word-break: break-all;
}
.contact-card a.cc-mail:hover { text-decoration: underline; }

/* ==========================================================================
   3. 文章页新增：导语 / 署名 / 披露 / 作者卡 / 纠错
   ========================================================================== */
.article-lede {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-2);
  margin: 0 0 18px;
  max-width: 70ch;
}

.byline {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 0 4px;
  margin-bottom: 4px;
}
.byline-avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: block; }
.byline-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.byline-name { font-weight: 650; font-size: 14px; color: var(--text); }
.byline-role { font-size: 12.5px; color: var(--text-3); }
.meta-row.is-updated { color: var(--success); }

.disclosure {
  display: block;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 15px 18px;
  margin: 22px 0 26px;
}
.disclosure h4 {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; margin: 0 0 8px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.disclosure h4 svg { width: 15px; height: 15px; color: var(--primary); flex: none; }
.disclosure p {
  margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--text-3);
}
.disclosure p + p { margin-top: 8px; }

.author-box {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 26px;
  box-shadow: var(--shadow-xs);
}
.author-avatar { width: 72px; height: 72px; border-radius: 50%; flex: none; display: block; }
.author-info { min-width: 0; }
.author-eyebrow {
  display: block; font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 4px;
}
.author-info h4 { font-size: 17px; margin: 0 0 3px; }
.author-role { font-size: 13px; color: var(--primary); font-weight: 600; margin: 0 0 10px; }
.author-bio { font-size: 14px; line-height: 1.8; color: var(--text-2); margin: 0 0 12px; }
.author-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.chip {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  border: 1px solid var(--primary-border);
}
.author-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13.5px; font-weight: 600; color: var(--primary); text-decoration: none;
}
.author-link svg { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.author-link:hover svg { transform: translateX(3px); }

.correction-note {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 14px 17px;
  margin-top: 18px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-2);
}
.correction-note svg { width: 17px; height: 17px; color: var(--primary); flex: none; margin-top: 2px; }
.correction-note a { color: var(--primary); font-weight: 600; word-break: break-all; }

@media (max-width: 560px) {
  .author-box { flex-direction: column; gap: 14px; }
  .author-avatar { width: 60px; height: 60px; }
}

/* ==========================================================================
   4. 广告位
   规范要求：必须与内容有清晰区隔、必须有"广告"标识、不得诱导误点
   ========================================================================== */
.ad-slot {
  display: block;
  position: relative;
  clear: both;               /* 与浮动图片/元素彻底隔离，避免广告紧贴图片 */
  margin: 30px 0;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;          /* 防止广告内容撑破布局 */
  text-align: center;
}
.ad-slot .ad-label {
  display: block;
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
  text-align: left;
  user-select: none;
}
.ad-slot ins.adsbygoogle { display: block; width: 100%; }
.ad-slot.ad-sidebar { margin: 0 0 var(--gap); }
.ad-slot.ad-listTop { margin: 0 0 var(--gap); }
.ad-slot.ad-inArticle { margin: 34px 0; }

/* 预览占位（只有自己加 ?adpreview=1 才会出现） */
.ad-preview { border-style: dashed; border-color: var(--primary-border); background: var(--primary-soft); }
.ad-preview-tip {
  display: grid; place-items: center;
  min-height: 92px;
  font-size: 13px; color: var(--primary);
  border: 1px dashed var(--primary-border);
  border-radius: 6px;
  padding: 10px;
}

/* 广告被拦截时收起边框，避免留下空盒子 */
[data-ads-blocked="1"] .ad-slot:not(.ad-preview) { display: none; }

/* ==========================================================================
   5. Cookie 同意横幅
   ========================================================================== */
.consent-bar {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 300;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .26s var(--ease), transform .26s var(--ease);
}
.consent-bar.is-in { opacity: 1; transform: none; }
.consent-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 16px 20px;
  max-width: var(--container);
  margin: 0 auto;
}
.consent-text { min-width: 0; }
.consent-text strong { display: block; font-size: 15px; margin-bottom: 4px; }
.consent-text p {
  margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--text-2);
}
.consent-text a { color: var(--primary); }
.consent-actions { display: flex; gap: 10px; flex: none; }
.btn-sm { padding: 9px 16px; font-size: 13.5px; }

@media (max-width: 720px) {
  .consent-inner { flex-direction: column; align-items: stretch; gap: 14px; }
  .consent-actions { justify-content: stretch; }
  .consent-actions .btn { flex: 1; justify-content: center; }
}

/* ==========================================================================
   6. 页脚新增区块
   ========================================================================== */
.footer-contact {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 14px; font-size: 14px;
}
.footer-contact svg { width: 16px; height: 16px; flex: none; opacity: .75; }
.footer-contact a { color: inherit; text-decoration: none; word-break: break-all; }
.footer-contact a:hover { color: var(--primary); }

.footer-friends {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, .09);
  font-size: 13.5px;
}
.footer-friends .ff-label { font-weight: 650; opacity: .85; flex: none; }
.footer-friends .ff-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-friends a { opacity: .72; text-decoration: none; color: inherit; }
.footer-friends a:hover { opacity: 1; text-decoration: underline; }

.footer-filing { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.footer-filing a { color: inherit; text-decoration: none; opacity: .78; }
.footer-filing a:hover { opacity: 1; text-decoration: underline; }
.footer-note { opacity: .62; }
.footer-amazon { flex-basis: 100%; margin-top: 4px; opacity: .85; color: #c9d4e3; font-style: italic; }

@media (max-width: 720px) {
  .footer-friends { flex-direction: column; gap: 8px; }
}

/* ==========================================================================
   6b. 编辑团队（editorial.html）
   ========================================================================== */
.editor-team {
  display: grid;
  gap: 16px;
  margin: 18px 0 8px;
}
.editor-item {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.editor-avatar {
  width: 54px; height: 54px;
  border-radius: 50%;
  flex: none;
  display: block;
}
.editor-item h4 { font-size: 15.5px; margin: 2px 0 5px; }
.editor-item p { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--text-2); }

/* ==========================================================================
   7. 404 页
   ========================================================================== */
.error-page {
  text-align: center;
  padding: clamp(48px, 9vw, 96px) 20px;
  max-width: 640px;
  margin: 0 auto;
}
.error-code {
  font-size: clamp(72px, 15vw, 132px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--primary), #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}
.error-page h1 { font-size: clamp(21px, 3.2vw, 28px); margin: 0 0 12px; }
.error-page p { color: var(--text-2); line-height: 1.8; margin: 0 0 26px; }
.error-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ==========================================================================
   8. 打印：隐藏广告与同意条
   ========================================================================== */
@media print {
  .ad-slot, .consent-bar, .to-top, .progress-bar { display: none !important; }
}
