/* ============================================================================
 *  POLYMERMESH — 设计层（叠加在 Bootstrap 5 + Agency 主题之上）
 *  基底：assets/css/agency.css（Start Bootstrap Agency v7.0.12，MIT）
 *  本文件只做「我们的东西」，不重复 Bootstrap 已有的能力。
 * ========================================================================== */

:root {
  /* 主色沿用 Agency 的金黄。要换主色改这里 + 下面 .btn-primary 等覆盖 */
  --pm-accent:      #ffc800;
  --pm-accent-dark: #e6b400;
  --pm-ink:         #212529;
  --pm-ink-2:       #6c757d;
  --pm-line:        rgba(0, 0, 0, 0.12);
  --pm-line-soft:   rgba(0, 0, 0, 0.07);
  --pm-surface:     #ffffff;
  --pm-surface-2:   #f8f9fa;

  --pm-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
             "Liberation Mono", monospace;
}

/* ── 字体：等宽数字，参数表对齐的基础 ─────────────────────────────────── */
.pm-num,
.spec-table td:not(:first-child),
.stat-value,
.badge-mono {
  font-family: var(--pm-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ── 首页 hero（首屏）─────────────────────────────────────────────────────
 * ⚠️ 必须写 `header.masthead` 而不是 `.masthead`：
 *    agency.css 里是 `header.masthead { background-image: url("../assets/img/header-bg.jpg") }`，
 *    相对 assets/css/ 解析成 assets/assets/img/… → 那个文件不存在 → 404。
 *    它的选择器权重 (0,1,1) 高于 (0,1,0)，所以用 `.masthead` 盖不住，会继续白字白底。
 *    这里用同等权重 + 后加载来覆盖。
 * 压暗比 .page-header 轻（0.55→0.80），因为首页 hero 是主视觉，图要看得见；
 * 子页面页头只是背景，用 0.82→0.92 压到几乎只剩纹理。
 *
 * ⚠️ 图片路径必须写**站点绝对路径** `/assets/img/…`：
 *    本文件在 /assets/ 下，写相对路径 `../img/…` 会解析成 /img/…（站点根下一层），
 *    而图片其实在 /assets/img/…。这两个坑叠加起来，导致首页白字白底、
 *    9 个子页面页头也一直没背景图（只靠兜底深色撑着）。
 */
header.masthead {
  position: relative;
  background-color: #14161a;                    /* 图加载前的兜底色 —— 深色，白字始终可读 */
  background-image: linear-gradient(rgba(20, 22, 25, 0.55), rgba(20, 22, 25, 0.80)),
                    url(/assets/img/masthead.jpg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* ── 子页面页头（对应首页 masthead 的压缩版）──────────────────────────── */
.page-header {
  position: relative;
  padding: 9rem 0 4.5rem;
  background-color: #212529;
  background-image: linear-gradient(rgba(20, 22, 25, 0.82), rgba(20, 22, 25, 0.92)),
                    url(/assets/img/masthead.jpg);
  background-position: center;
  background-size: cover;
  color: #fff;
  text-align: center;
}
.page-header .eyebrow {
  display: block;
  font-family: var(--pm-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pm-accent);
  margin-bottom: 0.9rem;
}
.page-header h1 {
  font-family: Montserrat, Helvetica, Arial, sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 auto 1rem;
  max-width: 22ch;
}
.page-header p {
  color: rgba(255, 255, 255, 0.72);
  max-width: 62ch;
  margin: 0 auto;
  font-size: 1.02rem;
}

/* ── 参数表 ──────────────────────────────────────────────────────────── */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
  background: var(--pm-surface);
}
.spec-table th,
.spec-table td {
  padding: 0.85rem 1.05rem;
  border-bottom: 1px solid var(--pm-line-soft);
  text-align: left;
  vertical-align: top;
}
.spec-table thead th {
  font-family: var(--pm-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--pm-ink-2);
  background: var(--pm-surface-2);
  border-bottom: 1px solid var(--pm-line);
  white-space: nowrap;
}
.spec-table td:first-child { color: var(--pm-ink-2); }
.spec-table tbody tr:last-child td { border-bottom: 0; }
.spec-table-wrap {
  border: 1px solid var(--pm-line);
  border-radius: 0.5rem;
  overflow: hidden;
  overflow-x: auto;
}

/* ── 数据来源标记 ────────────────────────────────────────────────────── */
.src {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--pm-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--pm-ink-2);
  white-space: nowrap;
}
.src::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  flex: none;
}
.src-ok::before    { background: var(--pm-accent); }
.src-self::before  { background: #fd7e14; }
.src-pend::before  { background: #adb5bd; }

/* ── 页脚 ────────────────────────────────────────────────────────────── */
.pm-footer {
  background: #212529;
  color: rgba(255, 255, 255, 0.7);
  padding: 3.5rem 0 1.5rem;
  font-size: 0.9rem;
}
.pm-footer h4 {
  font-family: var(--pm-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.9rem;
}
.pm-footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  display: block;
  padding: 0.16rem 0;
}
.pm-footer a:hover { color: var(--pm-accent); }
.pm-footer-bottom {
  margin-top: 2.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

/* ── 语言切换 ────────────────────────────────────────────────────────── */
.lang-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}
.lang-switch a {
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-family: var(--pm-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  white-space: nowrap;
}
.lang-switch a:hover { color: #fff; }
.lang-switch a.active { background: var(--pm-accent); color: #212529; font-weight: 500; }

/* ── 正文小标题（等宽 + 短横）────────────────────────────────────────── */
.pm-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--pm-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--pm-accent-dark);
}
.pm-eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 2px;
  background: var(--pm-accent);
  flex: none;
}

/* ── 条款/政策类正文的编号小节 ───────────────────────────────────────── */
.pm-clause { margin-bottom: 2rem; }
.pm-clause-no {
  font-family: var(--pm-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--pm-accent-dark);
}
.pm-clause h2 {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 0.35rem 0 0.7rem;
}
.pm-clause p { color: #495057; margin-bottom: 0.85rem; }
.pm-clause p:last-child { margin-bottom: 0; }

/* ── 提示框 ──────────────────────────────────────────────────────────── */
.pm-note {
  border-left: 3px solid var(--pm-accent);
  background: #fffdf5;
  padding: 1.1rem 1.25rem;
  border-radius: 0 0.375rem 0.375rem 0;
  font-size: 0.9rem;
  color: #495057;
  line-height: 1.7;
}
.pm-note strong { color: var(--pm-ink); }

/* ── 审计模式（?audit）───────────────────────────────────────────────── */
body.audit [data-p].pm-pending {
  background: rgba(220, 53, 69, 0.13);
  box-shadow: 0 0 0 1px rgba(220, 53, 69, 0.5);
  border-radius: 2px;
}
body.audit [data-p].pm-self {
  background: rgba(253, 126, 20, 0.14);
  box-shadow: 0 0 0 1px rgba(253, 126, 20, 0.5);
  border-radius: 2px;
}
body.audit [data-p].pm-placeholder {
  background: rgba(108, 117, 125, 0.14);
  box-shadow: 0 0 0 1px rgba(108, 117, 125, 0.45);
  border-radius: 2px;
}
.pm-audit-banner { display: none; }
body.audit .pm-audit-banner {
  display: block;
  position: fixed;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  z-index: 1080;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: #212529;
  color: var(--pm-accent);
  font-family: var(--pm-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

/* ── 细节修正 ────────────────────────────────────────────────────────── */

/* 首页主标题改用 <h1> 后，压掉浏览器默认上边距 */
.masthead h1.masthead-heading { margin-top: 0; }

/* 子页面页头的 <h1> 同理 */
.page-header h1 { margin-top: 0; }

.text-muted { color: var(--pm-ink-2) !important; }
.page-section { padding: 5rem 0; }
.section-heading { letter-spacing: -0.02em; }
a { color: var(--pm-accent-dark); }
a:hover { color: #b38f00; }
.btn-primary { color: #212529; }

/* 表格在窄屏可横向滚动而不是撑破布局 */
.table-responsive-sm { overflow-x: auto; }

/* 打印时去掉装饰 */
@media print {
  .navbar, .pm-footer, .page-header { background-image: none !important; }
}
