/* ============================================================
   AIDC 产品页 —— /products 与 /products/*（public/products.html、public/products/*.html）。
   由 scripts/build-products.mjs 生成；这里只写 pd- 开头的样式。
   外层 .hd.pd：标题、段落、FAQ、收尾沿用 home.css 的 .hd-*；
   子导航、分格流程、编号步骤、代码块复用 developer.css 的 dv-*（页面同时加载 developer.css）。
   首屏尺寸与 semantic.css 的 .sm-hero 保持一致；颜色一律用 site.css 的令牌。
   ============================================================ */
.pd p a, .pd li a { border-bottom: 0; }
/* 顶栏 + 子导航约 112px；.hd-sec 自带 104–176px 的上边距，锚点跳转只需再补一点 */
.pd .hd-sec[id] { scroll-margin-top: 16px; }
.pd code { background: none; border: 0; padding: 0; font-family: var(--font-mono); }

/* ---------- 首屏 ---------- */
.pd-hero { padding-top: clamp(48px, 7vw, 96px); text-align: center; }
.pd .pd-hero-icon { width: 72px; height: 72px; margin: 0 auto 20px; }
.pd-hero h1 { font-size: clamp(2.75rem, 5.6vw, 5rem); font-weight: 600; line-height: 1.05; letter-spacing: -0.05em; }
.pd .pd-tag { margin-top: 10px; font-size: clamp(1.35rem, 2.5vw, 2.1rem); font-weight: 500; line-height: 1.3; letter-spacing: -0.03em; color: var(--mut); }
.pd .pd-hero-sub { margin: 20px auto 0; max-width: 36em; font-size: clamp(1.02rem, 1.4vw, 1.15rem); line-height: 1.7; color: var(--mut); }
.pd-hero .btn-row { margin-top: 32px; justify-content: center; }
.pd-hero-art { margin: clamp(28px, 4vw, 48px) auto 0; max-width: 1040px; }
.pd-hero-art img, .pd-art img { width: 100%; height: auto; }
.pd-stats-wrap { margin-top: clamp(40px, 5vw, 64px); }

/* ---------- 通用块 ---------- */
.pd-art { margin: 0; }
.pd-art--wide { max-width: 980px; margin: 0 auto clamp(28px, 4vw, 48px); }
.pd-split { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--hd-gap); align-items: center; }
.pd-split--rev .pd-split-copy { order: 2; }
.pd-split-copy .dv-steps { margin-top: 0; }
.pd-split + .pd-cons, .pd-art--wide + .pd-cons, .pd-art--wide + .dv-flow, .pd-cons + .dv-flow, .dv-flow + .pd-cons, .pd-cons + .pd-cons { margin-top: clamp(24px, 3vw, 36px); }
.pd-more { margin-top: clamp(24px, 3vw, 36px); }
.pd-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--hd-gap); margin-top: clamp(28px, 4vw, 44px); }
.pd-facts > div { padding-top: 16px; border-top: 1.5px solid var(--ink-strong); }
.pd-facts b { display: block; font-size: 1.0625rem; font-weight: 600; color: var(--ink-strong); }
.pd-facts span { display: block; margin-top: 4px; line-height: 1.65; color: var(--mut); }

/* ---------- 构件卡：官方英文原名 + 一句话 + 状态 ---------- */
.pd-cons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pd-cons--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pd-cons--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pd-con { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 20px 22px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.pd-con-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.pd-con-top code { min-width: 0; font-size: 0.75rem; letter-spacing: 0.03em; color: var(--mut-2); overflow-wrap: anywhere; }
.pd-con h3 { margin: 4px 0 0; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.015em; color: var(--ink-strong); }
.pd-con p { margin: 0; font-size: 0.9375rem; line-height: 1.7; color: var(--mut); }
.pd-chip { flex: none; padding: 1px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.6875rem; font-weight: 500; line-height: 1.7; white-space: nowrap; color: var(--mut); }
.pd-chip--live { color: var(--hd-leaf); border-color: color-mix(in srgb, var(--hd-leaf) 45%, transparent); }
.pd-chip--beta { color: var(--signal); border-color: color-mix(in srgb, var(--signal) 45%, transparent); }
.pd-chip--partial { color: var(--signal); border-color: color-mix(in srgb, var(--signal) 45%, transparent); background: var(--signal-soft); }
.pd-chip--planned { color: var(--mut-2); border-style: dashed; }
.pd-con--planned { background: var(--bg-2); }

.pd .dv-flow.pd-flow4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pd-cta { grid-template-columns: minmax(0, 1fr); text-align: center; justify-items: center; }
.pd-cta .hd-sub { margin-left: auto; margin-right: auto; }
.pd-cta .btn-row { justify-content: center; }

/* ---------- 对照表：左边是官方名字的构件，右边是 AIDC 里它是什么 ---------- */
.pd-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.pd-table { width: 100%; min-width: 560px; margin: 0; table-layout: fixed; border-collapse: collapse; font-size: 0.9375rem; }
.pd-table th:first-child { width: 27%; }
.pd-table th:last-child { width: 112px; }
.pd-table th { padding: 12px 18px; text-align: left; font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mut-2); background: var(--bg-2); border-bottom: 1px solid var(--line); }
.pd-table td { padding: 13px 18px; vertical-align: top; line-height: 1.6; color: var(--mut); border-top: 1px solid var(--line-soft); }
.pd-table tr:first-child td { border-top: 0; }
.pd-table td:first-child { overflow-wrap: anywhere; }
.pd-table td:first-child code { font-size: 0.8125rem; color: var(--ink-strong); }
.pd-table td b { color: var(--ink-strong); font-weight: 600; }
.pd .pd-table-h { margin: clamp(36px, 4.5vw, 52px) 0 14px; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.015em; color: var(--ink-strong); }
.pd .hd-note + .pd-table-h { margin-top: 20px; }
.pd .hd-note + .pd-table-wrap { margin-top: 20px; }

/* ---------- 横向流程条（环境、通道、层级） ---------- */
.pd-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg-2); }
.pd-rail > div { position: relative; padding: 20px 22px 22px; background: var(--bg); }
.pd-rail > div + div { border-left: 1px solid var(--line); }
.pd-rail > div + div::before { content: ""; position: absolute; left: -6px; top: 26px; width: 11px; height: 11px; box-sizing: border-box; border-top: 2px solid var(--signal); border-right: 2px solid var(--signal); background: var(--bg); transform: rotate(45deg); }
.pd-rail .pd-rail-n { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--signal); }
.pd-rail h3 { margin: 8px 0 4px; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.015em; }
.pd-rail p { margin: 0; font-size: 0.9375rem; line-height: 1.65; color: var(--mut); }

/* ---------- Adis：各系统下载行（assets/js/adis.js 填链接与版本） ---------- */
.pd-dl { max-width: 780px; margin: 0 auto; text-align: left; }
.pd-dl-box, .pd-install-box { border: 1px solid var(--line); border-radius: 16px; background: var(--bg); overflow: hidden; }
.ad-os { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: 0.9rem 1.1rem; border-top: 1px solid var(--line-soft); }
.ad-os:first-child { border-top: 0; }
.ad-os .n { font-weight: 600; color: var(--ink-strong); }
.ad-os .m { margin-top: 0.15rem; font-family: var(--font-mono); font-size: 0.74rem; color: var(--mut-2); }
.ad-os .btn { height: 36px; padding: 0 0.9rem; font-size: 0.86rem; white-space: nowrap; }
.ad-os .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.pd-dl-foot, .pd-install-foot { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; align-items: center; padding: 0.7rem 1.1rem; border-top: 1px solid var(--line); background: var(--bg-2); font-family: var(--font-mono); font-size: 0.74rem; color: var(--mut); }
.pd-dl-foot b, .pd-install-foot b { color: var(--ink-strong); font-weight: 600; }
.pd-dl-foot a, .pd-install-foot a { color: var(--mut); text-decoration: underline; text-underline-offset: 3px; border: 0; }
.pd-dl-foot a:hover, .pd-install-foot a:hover { color: var(--ink-strong); }
.pd-dl .hd-note, .pd-install .hd-note { margin-top: 14px; }

/* ---------- Harness：一行命令安装框（assets/js/aidh-release.js 填版本行） ---------- */
.pd-install { max-width: 880px; margin: 0 auto; text-align: left; }
.pd-install-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto; gap: 0.9rem; align-items: center; padding: 0.95rem 1.1rem; border-top: 1px solid var(--line-soft); }
.pd-install-row:first-child { border-top: 0; }
.pd-install-os { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; color: var(--mut-2); }
.pd-install-row code { min-width: 0; font-size: 0.84rem; line-height: 1.65; color: var(--ink-strong); overflow-wrap: anywhere; }
.pd-install-row code b { color: var(--signal); font-weight: 600; }

/* ---------- 总览：产品线分层图 ---------- */
.pd-stack { display: grid; grid-template-columns: minmax(0, 1fr) clamp(104px, 13vw, 168px); gap: 12px; padding: clamp(16px, 2.4vw, 28px); border: 1px solid var(--line); border-radius: 20px; background: var(--bg-2); }
.pd-layers { display: grid; gap: 10px; min-width: 0; }
.pd-layer { display: grid; grid-template-columns: clamp(88px, 11vw, 140px) minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.pd-layer-n { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mut-2); }
.pd-layer-n b { display: block; margin-top: 2px; font-family: var(--hd-font); font-size: 0.9375rem; letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--ink-strong); }
.pd-layer-items { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.pd-layer--base { background: color-mix(in srgb, var(--signal) 6%, var(--bg)); border-color: color-mix(in srgb, var(--signal) 40%, transparent); }
.pd-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: inherit; text-decoration: none; transition: border-color 0.2s ease; }
.pd-pill:hover { border-color: var(--ink-strong); }
.pd-pill img { flex: none; width: 30px; height: 30px; }
.pd-pill b { font-size: 0.9375rem; font-weight: 600; color: var(--ink-strong); }
.pd-pill small { font-size: 0.8125rem; color: var(--mut); }
.pd-gov { display: grid; align-content: center; justify-items: center; gap: 12px; padding: 16px 10px; border: 1px dashed color-mix(in srgb, var(--ink-strong) 35%, transparent); border-radius: 14px; text-align: center; }
.pd-gov img { width: 40px; height: 40px; }
.pd-gov b { font-size: 0.9375rem; font-weight: 600; color: var(--ink-strong); }
.pd-gov span { font-size: 0.8125rem; line-height: 1.5; color: var(--mut); }

/* ---------- 总览：产品卡 ---------- */
.pd-pcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--hd-gap) 14px; }
.pd-pcard { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--bg); color: inherit; text-decoration: none; transition: border-color 0.2s ease, box-shadow 0.3s ease; }
.pd-pcard:hover { border-color: var(--ink-strong); box-shadow: var(--hd-shadow); }
.pd-pcard figure { margin: 0; padding: 10px 10px 0; background: var(--bg-2); }
.pd-pcard figure img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; }
.pd-pcard-body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 18px 22px 22px; }
.pd-pcard-head { display: flex; align-items: center; gap: 12px; }
.pd-pcard-head img { flex: none; width: 36px; height: 36px; }
.pd-pcard h3 { margin: 0; font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; }
.pd-pcard-role { margin-left: auto; font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mut-2); }
.pd-pcard p { margin: 0; line-height: 1.65; color: var(--mut); }
.pd-pcard-more { margin-top: auto; padding-top: 10px; font-size: 0.875rem; font-weight: 500; color: var(--ink-strong); }

/* ---------- 每页底部：产品线 ---------- */
.pd-line { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pd-line a { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: inherit; text-decoration: none; transition: border-color 0.2s ease; }
.pd-line a:hover { border-color: var(--ink-strong); }
.pd-line a.cur { border-color: color-mix(in srgb, var(--signal) 60%, transparent); box-shadow: 0 0 0 3px var(--signal-soft); }
.pd-line img { flex: none; width: 40px; height: 40px; }
.pd-line span { min-width: 0; }
.pd-line b { display: block; font-size: 1rem; font-weight: 600; color: var(--ink-strong); }
.pd-line small { display: block; margin-top: 1px; font-size: 0.8125rem; line-height: 1.4; color: var(--mut); }

@media (max-width: 1000px) {
  .pd .dv-flow.pd-flow4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-cons, .pd-cons--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-pcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .pd-split { grid-template-columns: minmax(0, 1fr); }
  .pd-split--rev .pd-split-copy { order: 0; }
  .pd-facts { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .pd-stack { grid-template-columns: minmax(0, 1fr); }
  .pd-gov { grid-auto-flow: column; justify-content: start; text-align: left; padding: 12px 16px; }
  .pd-rail { grid-auto-flow: row; }
  .pd-rail > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .pd-rail > div + div::before { left: 26px; top: -6px; transform: rotate(135deg); }
}
@media (max-width: 720px) {
  .pd-install-row { grid-template-columns: minmax(0, 1fr) auto; }
  .pd-install-os { grid-column: 1 / -1; }
  .pd-layer { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  /* 对照表在手机上改成一行一张小卡：官方名 + 状态在上，说明在下，不用横向滑动才看得到状态 */
  .pd-table { min-width: 0; table-layout: auto; }
  .pd-table thead { display: none; }
  .pd-table, .pd-table tbody { display: block; }
  .pd-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 16px; border-top: 1px solid var(--line-soft); }
  .pd-table tr:first-child { border-top: 0; }
  .pd-table td, .pd-table tr:first-child td { display: block; padding: 0; border: 0; }
  .pd-table td:first-child { grid-column: 1; grid-row: 1; }
  .pd-table td:last-child { grid-column: 2; grid-row: 1; }
  .pd-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 640px) {
  .pd .dv-flow.pd-flow4 { grid-template-columns: minmax(0, 1fr); }
  .pd-cons, .pd-cons--2, .pd-cons--4 { grid-template-columns: minmax(0, 1fr); }
  .pd-pcards { grid-template-columns: minmax(0, 1fr); }
  .pd-line { grid-template-columns: minmax(0, 1fr); }
}
