/* ============================================================
 * 产品详情页专属样式 (product-detail.css)
 * 仅 product-detail.html 使用；公共样式见 css/style.css
 * ============================================================ */

/* 详情页主体用暖白底，突出白色卡片 */
.pd-body { padding: 30px 0 60px; background: var(--lj-section-alt); }

/* ---------- 1. 两栏布局：左主区 + 右侧栏 300px ---------- */
.detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 26px; align-items: start; }

/* ---------- 2. 顶部信息块：左图册 + 右参数 ---------- */
.info-top { background: #fff; border: 1px solid var(--lj-card-border); border-radius: 12px; padding: 26px; display: grid; grid-template-columns: 350px 1fr; gap: 30px; }

/* 图册：主图正方形（高=宽）+ 缩略图一排 3 张，控制左栏高度与右栏参数面板齐平 */
.gallery .g-main { aspect-ratio: 1 / 1; background: var(--lj-img-bg); border-radius: 10px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; cursor: zoom-in; }
.gallery .g-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery .g-main .watermark { font-size: 100px; opacity: 0.15; color: var(--lj-accent); }
.gallery .g-main .zoom-hint { position: absolute; bottom: 12px; right: 12px; background: rgba(255,255,255,0.9); color: var(--lj-accent); font-size: 12px; padding: 4px 12px; border-radius: 14px; }
.gallery .g-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.gallery .g-thumb:nth-child(n+4) { display: none; }   /* 只展示前 3 张缩略图 */
.gallery .g-thumb { height: 78px; background: var(--lj-img-bg); border-radius: 8px; border: 2px solid transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--lj-accent); font-size: 26px; opacity: 0.7; overflow: hidden; }
.gallery .g-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery .g-thumb.active { border-color: var(--lj-accent); opacity: 1; }

/* 右侧参数面板：纵向 flex，撑满与左图册同高；
   space-between 把多余高度平均分配到“标题块/参数表/按钮块”三个间隙，排版更匀称 */
.info-panel { display: flex; flex-direction: column; justify-content: space-between; }
/* 产品名 + CAS 号同一排 */
.p-title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.info-panel .p-name { font-size: 26px; color: var(--lj-heading); font-weight: 800; letter-spacing: 1px; margin: 0; }
.info-panel .p-en { font-size: 14px; color: #b0a49e; margin: 0; }
.cas-highlight { display: inline-flex; align-items: center; gap: 8px; background: #FFF0EB; color: var(--lj-accent); font-size: 15px; font-weight: 600; padding: 7px 16px; border-radius: 8px; }
/* 参数表：上下各留 16px 基础间距（与 space-between 叠加后两块间隙仍相等） */
.spec-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
/* 格子高度稍微加高一点（上下内边距 12px），文字仍比原来小一号 */
.spec-table td { border: 1px solid #f2ece9; padding: 12px 10px; font-size: 13px; line-height: 1.5; }
/* 参数名列（分子式/纯度等）尽量窄且不换行，把宽度让给值列 */
.spec-table td.k { background: #FBF7F5; color: #8a7268; width: 52px; padding: 12px 6px; white-space: nowrap; }
.spec-table td.v { color: #333; }
/* 按钮块：两个按钮各占一半宽度、恒定同一排（英文文案较长也不会换行） */
.action-btns { display: flex; gap: 14px; align-items: center; flex-wrap: nowrap; margin-top: 0; padding-top: 0; }
.action-btns .btn-qq, .action-btns .wechat-wrap { flex: 1 1 0; min-width: 0; }
.action-btns .wechat-wrap { display: flex; }
.action-btns .btn-qq, .action-btns .btn-wechat { width: 100%; height: 46px; padding: 0 10px; justify-content: center; text-align: center; box-sizing: border-box; }
/* QQ 咨询：主色实心胶囊按钮（带图标） */
.btn-qq { background: var(--lj-accent); color: #fff; font-size: 15px; padding: 12px 30px; border-radius: 26px; box-shadow: 0 6px 18px rgba(232,98,43,0.3); transition: all .3s; display: inline-flex; align-items: center; gap: 8px; }
.btn-qq:hover { background: var(--lj-accent-dark); transform: translateY(-2px); }
/* 微信咨询：浅橙描边胶囊按钮（带图标） */
.btn-wechat { background: #FFF0EB; color: var(--lj-accent); border: 1.5px solid #f4c9b2; font-size: 15px; padding: 11px 28px; border-radius: 26px; transition: all .2s; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.btn-wechat:hover { background: #ffe4d6; border-color: var(--lj-accent); }
/* 按钮内图标 */
.action-btns .bi { font-size: 17px; line-height: 1; }
/* 微信 SVG 小图标：固定尺寸并垂直居中 */
.action-btns .bi-svg { width: 22px; height: 18px; flex-shrink: 0; }
/* 微信浮层：相对按钮定位，默认隐藏，点按钮加 .open 显示 */
.wechat-wrap { position: relative; display: inline-block; }
.wechat-pop { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid var(--lj-card-border); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,0.12); padding: 14px 16px; text-align: center; width: 160px; display: none; z-index: 20; }
.wechat-pop.open { display: block; }
.wechat-pop::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 7px solid transparent; border-top-color: #fff; }
.wechat-pop .qr { width: 148px; height: 148px; margin: 0 auto 10px; background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.wechat-pop .qr img { width: 100%; height: 100%; display: block; border-radius: 8px; }
.wechat-pop .wid { font-size: 13px; color: var(--lj-heading); font-weight: 600; margin-bottom: 4px; }
.wechat-pop .tip { font-size: 12px; color: var(--lj-text-mute); }
/* 服务承诺紧跟按钮下方：三项保持一排（英文较长时缩小字号间距也不折行） */
.service-note { display: flex; gap: 12px; margin-top: 16px; font-size: 12px; color: var(--lj-text-mute); flex-wrap: nowrap; }
.service-note > span { white-space: nowrap; }
.service-note span .dot { color: var(--lj-accent); margin-right: 4px; }

/* ---------- 3. 详情选项卡 ---------- */
.detail-wrap { background: #fff; border: 1px solid var(--lj-card-border); border-radius: 12px; margin-top: 26px; overflow: hidden; }
.d-tabs { display: flex; border-bottom: 1px solid #f2ece9; overflow-x: auto; }
.d-tabs span { padding: 16px 30px; font-size: 15px; color: #777; cursor: pointer; position: relative; white-space: nowrap; }
.d-tabs span.active { color: var(--lj-accent); font-weight: 600; }
.d-tabs span.active::after { content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 40px; height: 3px; background: var(--lj-accent); border-radius: 2px; }
.d-content { padding: 28px; }
.d-pane { display: none; }          /* 选项卡面板默认隐藏 */
.d-pane.active { display: block; }  /* 当前面板显示 */

/* 富文本内容（后台编辑器产出的 HTML 会套用这些样式） */
.rich-content h4 { font-size: 17px; color: var(--lj-heading); margin-bottom: 12px; padding-left: 12px; border-left: 4px solid var(--lj-accent); }
.rich-content p { font-size: 14px; color: #6b625d; line-height: 2; margin-bottom: 18px; }
.quality-table { width: 100%; border-collapse: collapse; margin: 10px 0 26px; }
.quality-table th, .quality-table td { border: 1px solid var(--lj-card-border); padding: 10px 14px; font-size: 14px; text-align: left; }
.quality-table th { background: #FBF7F5; color: #8a7268; font-weight: 600; }
.apply-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.apply-list li { list-style: none; font-size: 14px; color: #6b625d; background: var(--lj-section-alt); padding: 12px 16px; border-radius: 8px; }
.apply-list li::before { content: "✔"; color: var(--lj-accent); margin-right: 8px; }

/* ---------- 4. 右侧栏 ---------- */
.side-box { background: #fff; border: 1px solid var(--lj-card-border); border-radius: 12px; padding: 22px; margin-bottom: 22px; }
.side-box .sb-title { font-size: 16px; color: var(--lj-heading); font-weight: 700; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #f2ece9; }
.help-box { background: var(--lj-img-bg); border: none; }
.help-box .sb-title { border-bottom: none; color: var(--lj-heading); padding-bottom: 0; }
.help-box .tel { font-size: 22px; font-weight: 800; color: var(--lj-accent); margin: 6px 0; display: block; text-decoration: none; background: none; padding: 0; border-radius: 0; }
.help-box p { font-size: 13px; color: #8a7268; margin-bottom: 14px; }
.help-box a { display: inline-block; background: var(--lj-accent); color: #fff; font-size: 14px; padding: 9px 26px; border-radius: 20px; }
.pack-list li { list-style: none; font-size: 14px; color: #6b625d; padding: 9px 0; border-bottom: 1px dashed #f2ece9; display: flex; justify-content: space-between; }
.pack-list li:last-child { border-bottom: none; }
.pack-list li span { color: var(--lj-accent); font-weight: 600; }
.rel-mini { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed #f2ece9; cursor: pointer; }
.rel-mini:last-child { border-bottom: none; }
.rel-mini .rm-img { width: 54px; height: 54px; background: var(--lj-img-bg); border-radius: 8px; flex-shrink: 0; overflow: hidden; }
.rel-mini .rm-img img { width: 100%; height: 100%; object-fit: cover; }
.rel-mini .rm-info h6 { font-size: 14px; color: var(--lj-heading); font-weight: 600; margin-bottom: 3px; }
.rel-mini .rm-info p { font-size: 12px; color: var(--lj-accent); }

/* ---------- 5. 底部相关产品 ---------- */
.related { margin-top: 30px; }
.related .rel-head { font-size: 22px; color: var(--lj-heading); font-weight: 700; margin-bottom: 6px; }
.related .rel-head .en { font-size: 14px; color: #c4b8b1; font-weight: 400; margin-left: 10px; }
.related .divider { width: 44px; height: 3px; background: var(--lj-accent); border-radius: 2px; margin-bottom: 22px; }
.rel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.rel-card { background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid var(--lj-card-border); transition: all .3s; cursor: pointer; display: block; }
.rel-card:hover { box-shadow: 0 10px 26px rgba(0,0,0,0.08); transform: translateY(-3px); }
.rel-card .card-img { height: 160px; background: var(--lj-img-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.rel-card .card-img img { width: 100%; height: 100%; object-fit: cover; }
.rel-card .card-img .watermark { font-size: 50px; opacity: 0.15; color: var(--lj-accent); }
.rel-card .card-body { padding: 16px; }
.rel-card .card-body h5 { font-size: 15px; color: var(--lj-heading); margin-bottom: 6px; font-weight: 600; }
.rel-card .card-body .cas { font-size: 13px; color: var(--lj-accent); }

/* ---------- 6. 响应式 ---------- */
@media (max-width: 1199px) {
  .info-top { grid-template-columns: 1fr; }        /* 图册与参数上下排 */
  .gallery .g-main { height: 300px; }
  .rel-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .detail-layout { grid-template-columns: 1fr; }   /* 侧栏移到下方 */
  .info-top { padding: 16px; }
  .gallery .g-main { height: 240px; }
  .gallery .g-thumbs { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .gallery .g-thumb { height: 56px; }
  .info-panel .p-name { font-size: 21px; }
  .spec-table td { padding: 8px 8px; font-size: 12px; }
  .spec-table td.k { width: 46px; padding: 8px 4px; white-space: nowrap; }
  .d-content { padding: 18px; }
  .apply-list { grid-template-columns: 1fr; }
  .rel-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  /* 移动端：QQ / 微信 两个按钮等宽等高（各占一半） */
  .action-btns { flex-wrap: nowrap; }
  .action-btns .btn-qq, .action-btns .wechat-wrap { flex: 1; min-width: 0; }
  .action-btns .wechat-wrap { display: flex; }          /* 让内部按钮撑满wrapper */
  .action-btns .btn-qq, .action-btns .btn-wechat {
    width: 100%; height: 46px; padding: 0;              /* 固定高度，避免边框造成高差 */
    justify-content: center; text-align: center;
  }
}
