/* ==========================================================================
   PHOTIST · 产品详情（二级） / 产品资料（三级） 共用视觉框架
   --------------------------------------------------------------------------
   暖白 / 浅米底 + 深暖灰文字，鹅黄 #FFE58F 仅作小面积强调。
   二级与三级共用同一套顶部条、字体层级、细分隔线与淡入动效，
   仅内容区按资料类型套用不同模板。只作用于 .ph-page，不改全站其他页面。
   ========================================================================== */

.ph-page { --ph-ink: #3E332A; --ph-muted: #81776D; --ph-line: #EDE7DD; --ph-accent: #FFE58F; }

/* ---------------------------- 顶部条（二级/三级统一） ---------------------------- */
.ph-topbar {
  background: linear-gradient(180deg, #FFFDF9 0%, #FBF7F0 100%);
  border-bottom: 1px solid var(--ph-line);
}
.ph-topbar-inner {
  display: flex; align-items: center; gap: 18px;
  min-height: 96px; padding: 22px 0;
}
.ph-back {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  font-size: 14px; font-weight: 600; color: #6E6153; text-decoration: none;
  padding: 9px 15px 9px 11px; border: 1px solid #E4DACC; border-radius: 999px;
  background: rgba(255,255,255,.7); transition: background .2s, border-color .2s, color .2s;
}
.ph-back svg { width: 15px; height: 15px; }
.ph-back:hover { background: #FFF6DB; border-color: #E8CE7A; color: #5A4A16; }
.ph-back:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid #C9A227; outline-offset: 2px; }
.ph-ident { display: flex; align-items: baseline; gap: 14px; min-width: 0; flex-wrap: wrap; }
.ph-model {
  font-family: var(--font-sans); font-size: 20px; font-weight: 700;
  letter-spacing: .04em; color: var(--ph-ink);
}
.ph-model::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ph-accent); margin-right: 10px; vertical-align: 3px;
}
.ph-name { font-size: 15px; color: var(--ph-muted); }
/* 三级页面：在型号后显示资料分类名 */
.ph-crumb-sep { color: #C4B7A6; font-size: 18px; }
.ph-type-name { font-size: 16px; font-weight: 650; color: #6B5220; }

/* ---------------------------- 页面淡入 ---------------------------- */
.ph-main { animation: phFade .45s ease both; }
@keyframes phFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================ 二级：产品详情页 ============================ */
/* 图组：一张主图 + 三张辅图（缺失视角用克制空位，不虚构图片） */
.pd-section { padding: 46px 0 24px; }
.pd-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 1120px; margin: 0 auto;
}
.pd-figure {
  position: relative; display: block; margin: 0; padding: 0; border: 0; overflow: hidden;
  border-radius: 18px; background: #F4EFE6; cursor: zoom-in;
  transition: box-shadow .25s ease, transform .25s ease;
}
.pd-figure:hover { box-shadow: 0 14px 34px -18px rgba(74,52,32,.4); }
.pd-figure img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pd-figure--main { grid-row: 1 / 4; min-height: 0; background: #F7F3EC; }
.pd-figure--main img { padding: 10px; }
.pd-figure:not(.pd-figure--main) { aspect-ratio: 3 / 2; }
.pd-figure--empty {
  cursor: default; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: #B7A995; background: repeating-linear-gradient(135deg,#FBF8F2,#FBF8F2 12px,#F7F2E9 12px,#F7F2E9 24px);
  border: 1px dashed #E4DACA;
}
.pd-figure--empty:hover { box-shadow: none; }
.pd-figure--empty b { font-size: 13px; font-weight: 650; color: #9D8F7E; letter-spacing: .04em; }
.pd-figure--empty small { font-size: 11px; }
.pd-fig-label {
  position: absolute; left: 14px; bottom: 12px; z-index: 2;
  font-size: 11px; font-weight: 650; letter-spacing: .12em;
  color: #5C5145; background: rgba(255,255,255,.86); backdrop-filter: blur(4px);
  padding: 6px 12px; border-radius: 999px; pointer-events: none;
}

/* 七项资料目录：纵向编号式，整行可点击，细分隔线 */
.pd-res-wrap { padding: 26px 0 84px; }
.pd-res-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  max-width: 900px; margin: 0 auto 18px;
}
.pd-res-head h2 { margin: 0; font-size: clamp(20px, 2.2vw, 26px); font-weight: 650; color: var(--ph-ink); }
.pd-res-head span { font-size: 13px; color: var(--ph-muted); }
.pd-res-list {
  max-width: 900px; margin: 0 auto; list-style: none; padding: 0;
  border-top: 1px solid var(--ph-line);
}
.pd-res-row {
  display: flex; align-items: center; gap: clamp(18px, 3vw, 40px);
  min-height: 76px; padding: 16px 14px;
  border-bottom: 1px solid var(--ph-line); text-decoration: none; color: inherit;
  transition: background .2s ease, padding-left .2s ease;
}
.pd-res-row:hover { background: rgba(255,229,143,.13); padding-left: 20px; }
.pd-res-no {
  flex: 0 0 auto; width: 42px; font-family: var(--font-serif, Georgia, serif);
  font-size: 17px; font-weight: 600; color: #AB9B84; letter-spacing: .05em;
}
.pd-res-name { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; color: var(--ph-ink); }
.pd-res-arrow {
  flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 50%; color: #705744; background: #F6F2EB; transition: transform .2s ease, background .2s ease;
}
.pd-res-arrow svg { width: 16px; height: 16px; }
.pd-res-row:hover .pd-res-arrow { transform: translateX(4px); background: var(--ph-accent); color: #5A4415; }

/* ============================ 三级：资料页内容模板 ============================ */
.md-section { padding: 44px 0 92px; }
.md-note {
  max-width: 1120px; margin: 0 auto 26px; font-size: 14px; color: var(--ph-muted); line-height: 1.7;
}

/* 图片画廊（01 外观 / 02 外包装 / 04 彩页共用） */
.md-gallery {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px; max-width: 1120px; margin: 0 auto;
}
.md-tile {
  display: block; margin: 0; padding: 0; border: 0; overflow: hidden; cursor: zoom-in;
  border-radius: 14px; background: #F5F1E9; transition: box-shadow .25s ease, transform .25s ease;
}
.md-tile:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -20px rgba(74,52,32,.42); }
.md-tile img { display: block; width: 100%; height: 260px; object-fit: contain; padding: 8px; }
.md-tile figcaption {
  padding: 10px 14px 13px; font-size: 12.5px; color: var(--ph-muted);
  border-top: 1px solid var(--ph-line); line-height: 1.5;
}

/* 电商彩页：真实素材为纵向长图，按自然比例整幅展示，不裁切不压缩 */
.md-brochures { max-width: 1120px; margin: 0 auto; }
.md-brochure {
  margin: 0 0 30px; padding: 18px; border: 1px solid var(--ph-line);
  border-radius: 16px; background: #FFFEFC; text-align: center;
}
.md-brochure img {
  display: block; width: auto; max-width: 100%; height: auto; margin: 0 auto;
  cursor: zoom-in; box-shadow: 0 10px 30px -22px rgba(74,52,32,.45);
}
.md-brochure figcaption { margin-top: 14px; font-size: 13px; color: var(--ph-muted); }

/* 文件行（04 彩页下载 / 05 规格书 / 06 固件共用） */
.md-files { max-width: 900px; margin: 0 auto; border-top: 1px solid var(--ph-line); }
.md-file {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 20px 10px; border-bottom: 1px solid var(--ph-line);
}
.md-file-main { flex: 1; min-width: 220px; }
.md-file-name { display: block; font-size: 16px; font-weight: 600; color: var(--ph-ink); line-height: 1.5; }
.md-file-meta { display: block; margin-top: 6px; font-size: 13px; color: var(--ph-muted); line-height: 1.7; }
.md-lang {
  display: inline-block; flex: 0 0 auto; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; color: #6B5220; background: #FFF2C5;
}
.md-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.md-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 16px; border-radius: 999px; text-decoration: none;
  font-size: 13px; font-weight: 650; cursor: pointer; transition: background .2s, border-color .2s, transform .2s;
}
.md-btn svg { width: 14px; height: 14px; }
.md-btn--ghost { border: 1px solid #DCCFBC; background: #fff; color: #6E6153; }
.md-btn--ghost:hover { border-color: #B9A88F; color: #4A3E33; }
.md-btn--dl { border: 1px solid var(--ph-accent); background: var(--ph-accent); color: #3B3024; }
.md-btn--dl:hover { background: #FFDB70; border-color: #FFDB70; transform: translateY(-1px); }

/* 视频：沿用原生播放器，只做尺寸与容器规范 */
.md-video { max-width: 900px; margin: 0 auto; }
.md-video video {
  display: block; width: 100%; max-height: 560px; border-radius: 14px;
  background: #1E1D20; object-fit: contain;
}

/* 外箱包装规格：轻量参数表 */
.md-table-wrap { max-width: 900px; margin: 0 auto; overflow-x: auto; border: 1px solid var(--ph-line); border-radius: 14px; background: #FFFEFC; }
.md-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.md-table th, .md-table td { padding: 17px 22px; border-bottom: 1px solid var(--ph-line); text-align: left; vertical-align: top; line-height: 1.7; }
.md-table tr:last-child th, .md-table tr:last-child td { border-bottom: 0; }
.md-table th { width: 34%; color: #7A6C5E; font-weight: 600; background: #FCFAF6; }
.md-table td { color: var(--ph-ink); font-variant-numeric: tabular-nums; }
.md-table-actions { max-width: 900px; margin: 22px auto 0; }

/* 空状态：真实资料缺失时克制提示，不虚构、不跨型号借用 */
.md-empty {
  max-width: 640px; margin: 26px auto; padding: 56px 28px; text-align: center;
  border: 1px dashed #E3D9CA; border-radius: 18px;
  background: linear-gradient(180deg,#FFFEFC,#FBF8F2);
}
.md-empty-mark {
  display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 18px;
  border-radius: 50%; background: #FFF2C5; color: #8A6B1E;
}
.md-empty-mark svg { width: 24px; height: 24px; }
.md-empty h3 { margin: 0 0 10px; font-size: 18px; font-weight: 650; color: var(--ph-ink); }
.md-empty p { margin: 0; font-size: 14px; color: var(--ph-muted); line-height: 1.8; }
.md-empty a { color: #8A6B1E; font-weight: 650; }

/* ---------------------------- 灯箱 ---------------------------- */
.ph-lightbox {
  position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; padding: 5vh 5vw;
  background: rgba(30,25,20,.9); animation: phFade .18s ease both;
}
.ph-lightbox[hidden] { display: none !important; }
.ph-lightbox-stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 0; overflow: auto; }
.ph-lightbox-stage img { display: block; width: auto; height: auto; max-width: 76%; max-height: 78vh; object-fit: contain; border-radius: 8px; margin: 0 auto; }
/* 纵向长图（电商彩页）不缩成细线：保持宽度，在灯箱内纵向滚动查看 */
.ph-lightbox-stage img.ph-lb-tall { max-width: min(560px, 76%); max-height: none; }
.ph-lightbox-btn {
  appearance: none; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.1);
  color: #fff; width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  font-size: 22px; line-height: 1; display: grid; place-items: center; transition: background .2s;
}
.ph-lightbox-btn:hover { background: rgba(255,229,143,.28); }
.ph-lightbox-prev, .ph-lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); }
.ph-lightbox-prev { left: 0; }
.ph-lightbox-next { right: 0; }
.ph-lightbox-bar { display: flex; align-items: center; gap: 18px; color: #F4EDE2; font-size: 14px; }
.ph-lightbox-close { position: absolute; top: 22px; right: 26px; }

/* ---------------------------- 响应式 ---------------------------- */
@media (max-width: 900px) {
  .ph-topbar-inner { min-height: 78px; gap: 12px; padding: 16px 0; }
  .ph-model { font-size: 17px; }
  .pd-gallery { grid-template-columns: 1fr; grid-template-rows: none; }
  .pd-figure--main { grid-row: auto; min-height: 0; aspect-ratio: 4 / 3; }
  .pd-figure:not(.pd-figure--main) { aspect-ratio: 4 / 3; }
  .md-gallery { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
  .md-tile img { height: 220px; }
}
@media (max-width: 560px) {
  .ph-topbar-inner { flex-wrap: wrap; }
  .ph-ident { gap: 8px; }
  .ph-model { font-size: 16px; }
  .ph-name { font-size: 13px; }
  .pd-section { padding: 28px 0 16px; }
  .pd-gallery { gap: 10px; }
  .pd-res-row { min-height: 66px; gap: 14px; padding: 14px 8px; }
  .pd-res-no { width: 30px; font-size: 15px; }
  .pd-res-name { font-size: 15px; }
  .pd-res-wrap { padding: 18px 0 60px; }
  .md-gallery { grid-template-columns: 1fr; }
  .md-tile img { height: 250px; }
  .md-file { padding: 16px 4px; gap: 12px; }
  .md-actions { width: 100%; }
  .md-btn { flex: 1; padding: 0 10px; }
  .md-table th, .md-table td { padding: 13px 14px; font-size: 14px; }
  .md-table th { width: 40%; }
  .ph-lightbox-prev { left: 6px; } .ph-lightbox-next { right: 6px; }
  .ph-lightbox-btn { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .ph-main, .ph-lightbox { animation: none; }
  .pd-figure, .md-tile, .pd-res-row, .ph-back, .md-btn { transition: none; }
}
