/* ===== 基础变量与布局 ===== */
:root {
  --card-bg:#fff;
  --line:#e5e7eb;
  --muted:#6b7280;
  --shadow:0 1px 2px rgba(0,0,0,.04);
}
body { background:#f7f8fa; }
.pd-container { max-width:1200px; margin:0 auto; padding:16px; }

/* 卡片与头部（去重合并版） */
.pd-card { background:var(--card-bg); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow); }
.pd-header { padding:18px; margin-bottom:16px; }
.pd-header h1 { margin:0 0 8px; font-size:26px; line-height:1.3; }
.pd-meta { display:flex; flex-wrap:wrap; gap:12px; color:var(--muted); font-size:13px; }
.breadcrumb { font-size:12px; color:#64748b; margin-bottom:10px; }
.tags { margin-top:10px; font-size:13px; }
.tags a { color:#2563eb; text-decoration:none; margin-right:6px; }

/* ===== 栅格 ===== */
.pd-grid { display:grid; grid-template-columns: 1fr 380px; gap:16px; margin-bottom:16px; }
@media (max-width: 980px) { .pd-grid { grid-template-columns:1fr; } }

/* ===== 画廊 ===== */
.pd-gallery { padding:14px; }
.pd-main { display:flex; justify-content:center; align-items:center; border:1px solid var(--line); border-radius:10px; background:#fff; }
.pd-main img { width:100%; max-width:720px; height:auto; border-radius:10px; }
.pd-thumbs { display:flex; flex-wrap:wrap; gap:10px; margin:12px 0 0; padding:0; list-style:none; }
.pd-thumbs li { margin:0; }
.pd-thumbs button { border:1px solid var(--line); background:#fff; border-radius:8px; padding:0; cursor:pointer; }
.pd-thumbs img { width:90px; height:90px; object-fit:cover; display:block; border-radius:8px; }
.pd-thumbs button[aria-current="true"] { outline:2px solid #2563eb; }

/* ===== 侧栏 ===== */
.pd-aside { padding:16px; }
.pd-desc { color:#111827; line-height:1.8; margin-bottom:12px; }
.pd-badges { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.pd-badge { background:#f1f5f9; color:#334155; font-size:12px; padding:6px 10px; border-radius:20px; border:1px solid var(--line); }
.pd-cta { display:flex; align-items:center; gap:12px; margin:10px 0 16px; }
.btn { display:inline-block; background:#111827; color:#fff; padding:10px 14px; border-radius:8px; text-decoration:none; }
.pd-tel { font-weight:600; color:#0f172a; }

/* ===== 参数表（修复选择器笔误） ===== */
.pd-params h3 { margin:12px 0; font-size:18px; }
.pd-table { width:100%; border-collapse:separate; border-spacing:0; border:1px solid var(--line); border-radius:10px; overflow:hidden; background:#fff; }
.pd-table th, .pd-table td { padding:10px 12px; border-bottom:1px solid #f1f5f9; font-size:14px; }
.pd-table th { width:32%; background:#f8fafc; font-weight:600; color:#111827; }
.pd-table tr:last-child th, .pd-table tr:last-child td { border-bottom:0; }

/* ===== 正文与目录 ===== */
.pd-body { display:grid; grid-template-columns: 1fr 280px; gap:16px; padding:16px; }
@media (max-width: 980px) { .pd-body { grid-template-columns:1fr; } }
.entry { font-size:16px; line-height:1.9; color:#222; }
.entry img { max-width:100%; height:auto; display:block; margin:12px auto; border-radius:6px; }

/* —— 正文表格：新增（仅作用 .entry，不影响 .pd-table） —— */
.entry table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  margin:16px 0;
  font-size:15px;
  border:1px solid var(--line);
  border-radius:10px;
  overflow:hidden; /* 让圆角生效 */
  background:#fff;
  box-shadow:var(--shadow);
}
.entry thead th{
  background:#f8fafc;
  color:#0f172a;
  font-weight:700;
  position:sticky;
  top:0;
  z-index:1;
}
.entry th, .entry td{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
  text-align:left;
  color:#111827;
  word-break:break-word;
}
.entry tbody tr:nth-child(even) td { background:#fafafa; }
.entry tbody tr:hover td { background:#f5f7fa; }
.entry tr:last-child th, .entry tr:last-child td { border-bottom:none; }

/* 小屏表格可横向滚动（可选但推荐） */
@media (max-width: 768px){
  .entry table{ display:block; overflow:auto; }
}

/* 兼容富文本内联表格样式（导入来稿常见） */
.entry table[style] th,
.entry table[style] td {
  border-color:#e5e7eb !important;
  padding:10px 12px !important;
}

/* 目录 TOC */
.toc { padding:12px; position:sticky; top:16px; max-height:70vh; overflow:auto; }
.toc h3 { margin:0 0 8px; font-size:16px; }
#toc a { display:block; padding:6px 8px; border-radius:6px; color:#1f2937; text-decoration:none; font-size:14px; }
#toc a:hover { background:#f3f4f6; }
#toc .lv2 { padding-left:12px; }
#toc .lv3 { padding-left:24px; }

/* ===== 推荐区 ===== */
.pd-section { padding:16px; margin-top:16px; }
.pd-relate { display:grid; grid-template-columns: repeat(4, 1fr); gap:12px; }
@media (max-width: 980px) { .pd-relate { grid-template-columns: repeat(2, 1fr); } }
.pd-item { display:block; border:1px solid var(--line); border-radius:10px; overflow:hidden; background:#fff; text-decoration:none; color:#111827; }
.pd-item img { width:100%; height:180px; object-fit:cover; display:block; }
.pd-item p { margin:8px 10px 10px; font-size:14px; line-height:1.5; }

/* =====（可选）H2 七彩色条 —— 保留一处即可，避免重复 ===== */
/* 如需彩条标题，请解开注释并确保全站只保留这份 */
/*
:root{
  --h2c1:#ff7a7a; --h2c2:#ffb86b; --h2c3:#ffe680;
  --h2c4:#a7f3d0; --h2c5:#93c5fd; --h2c6:#c4b5fd;
}
.entry h2{
  position:relative; padding-left:12px; margin:22px 0 10px; font-size:20px;
}
.entry h2::before{
  content:""; position:absolute; left:0; top:50%; transform:translateY(-50%);
  width:6px; height:1.2em; border-radius:4px;
  background:linear-gradient(180deg, var(--h2c1), var(--h2c2), var(--h2c3), var(--h2c4), var(--h2c5), var(--h2c6));
}
*/
/* === 1) 目录（TOC）跟随高亮样式 === */
#toc a.is-active {
  background: #eef2ff;
  font-weight: 600;
  border-left: 3px solid #4f46e5;
  padding-left: 10px;
}

/* 目录内的当前项自动滚入视区（配合 JS 设置 scrollIntoView） */
.toc { scroll-behavior: smooth; }

/* === 2) 标题、栏目/来源/发布/TAG/点击 居中 === */
.pd-header { text-align: center; }
.pd-header h1 { margin-bottom: 10px; }
.pd-meta { justify-content: center; }
.tags { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* === 3) 正文图片与说明：居中 + 限宽 === */
/* figure + figcaption 结构（推荐在正文里用 <figure><img><figcaption>说明</figcaption></figure>） */
.entry figure {
  margin: 16px auto;
  text-align: center;
}
.entry figure img {
  display: block;
  margin: 0 auto;
  width: min(100%, 720px);  /* 最大 720px，响应式缩放 */
  height: auto;
  border-radius: 6px;
}
.entry figure figcaption {
  margin-top: 6px;
  font-size: 13px;
  color: #64748b;
}

/* 没有 figure 包裹的普通图片也处理一下（保底） */
.entry img {
  display: block;
  margin: 12px auto;
  width: min(100%, 720px);
  height: auto;
}

/* === 4) FAQ 样式 === */
/* 推荐正文使用 <section class="faq"> 包一段 <details>... */
.entry .faq { margin: 18px 0; }
.entry .faq h2, .entry .faq h3 { margin: 10px 0 8px; }

.entry .faq details {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  margin: 10px 0;
  overflow: hidden;
}
.entry .faq summary {
  cursor: pointer;
  list-style: none; /* 去掉默认三角 */
  padding: 12px 14px;
  font-weight: 600;
  position: relative;
}
.entry .faq summary::after {
  content: "›";
  position: absolute;
  right: 12px;
  transform: rotate(90deg);
  transition: transform .2s ease;
}
.entry .faq details[open] summary::after {
  transform: rotate(270deg);
}
.entry .faq .answer {
  padding: 10px 14px 14px;
  border-top: 1px solid #f1f5f9;
  color: #374151;
  line-height: 1.8;
}

/* FAQ 的 dl/dt/dd 结构（可选） */
.entry .faq dl { margin: 10px 0; }
.entry .faq dt {
  font-weight: 700;
  margin: 10px 0 6px;
}
.entry .faq dd {
  margin: 0 0 10px 0;
  color: #374151;
}
