/* ═══════════════════════════════════════════════════════════
   聚龙钻机 独立站 v3 — 产品系统 / 后台补充样式
   沿用 global.css 的设计令牌（天蓝 + 工程橙）
   ═══════════════════════════════════════════════════════════ */

/* ── 页面头（产品中心等） ── */
.page-hero {
  padding: calc(var(--nav-height) + var(--space-3xl)) 0 var(--space-3xl);
  background: var(--gradient-hero);
  border-bottom: 1px solid var(--color-border);
}
.page-hero__title {
  font-size: var(--text-4xl);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: var(--space-lg) 0 var(--space-md);
  color: var(--color-text);
}
.page-hero__desc {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 760px;
  line-height: var(--leading-relaxed);
}

/* ── 产品卡（补充 img 支持） ── */
.product-card { display: flex; flex-direction: column; text-decoration: none; }
.product-card__img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--transition-slow);
}
.product-card:hover .product-card__img img { transform: scale(1.06); }
.product-card__img svg { width: 80%; height: 80%; }
.product-card__body { flex: 1; }
.product-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin: var(--space-sm) 0 var(--space-md);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card__title { font-size: var(--text-lg); font-weight: 800; color: var(--color-text); line-height: 1.35; }
.product-card__specs { display: flex; gap: var(--space-lg); flex-wrap: wrap; margin-top: var(--space-md); }
.product-card__spec { display: flex; flex-direction: column; }
.product-card__spec-lbl { font-size: 11px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.product-card__spec-val { font-size: var(--text-sm); font-weight: 800; color: var(--color-text); }
.product-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-sm); font-weight: 700; color: var(--color-accent-text);
}
.product-card__link-arrow { transition: transform var(--transition-fast); }
.product-card:hover .product-card__link-arrow { transform: translateX(4px); }

/* ── 产品详情 ── */
.prod-detail__grid { align-items: start; }
.prod-code {
  display: inline-block;
  font-family: ui-monospace, Consolas, monospace;
  font-size: var(--text-sm); font-weight: 800;
  color: var(--color-accent-text);
  background: var(--color-accent-subtle);
  border: 1px solid rgba(244,121,32,0.25);
  padding: 4px 12px; border-radius: var(--radius-full);
  letter-spacing: 0.06em;
  margin-bottom: var(--space-md);
}
.prod-detail__info h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900; line-height: 1.25; letter-spacing: -0.02em;
  color: var(--color-text);
}
.prod-tagline {
  font-size: var(--text-base); color: var(--color-text-secondary);
  margin: var(--space-md) 0 var(--space-lg);
  line-height: 1.7;
}
.prod-badges { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: var(--space-lg); }
.prod-badge {
  font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: var(--radius-full);
  background: rgba(26,58,92,0.06); color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.prod-badge--accent { background: var(--color-accent-subtle); color: var(--color-accent-text); border-color: rgba(244,121,32,0.25); }

/* 答案先行：AEO 用，第一段直接回答是什么/能打多深/谁生产 */
.prod-answer {
  margin: 0 0 var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  border-inline-start: 3px solid var(--color-accent);
  background: rgba(26, 58, 92, 0.04);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
html[dir='rtl'] .prod-answer { border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.prod-answer__label {
  display: block; margin-bottom: 4px;
  font-size: 12px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--color-accent-text);
}
.prod-answer p { margin: 0; font-size: var(--text-base); line-height: 1.75; color: var(--color-text-secondary); }

.prod-keyspecs {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-lg) 0 var(--space-xl);
}
.prod-keyspec {
  background: rgba(255,255,255,0.75);
  padding: var(--space-md) var(--space-lg);
  display: flex; flex-direction: column; gap: 2px;
}
.prod-keyspec__v { font-size: var(--text-lg); font-weight: 900; color: var(--color-text); line-height: 1.2; }
.prod-keyspec__l { font-size: 11px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.prod-actions { display: flex; gap: var(--space-md); flex-wrap: wrap; }

/* ── 图集 ── */
.gallery { border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--color-border); background: #fff; }
/* 主图用 contain：手机拍的和相机拍的尺寸不一样，也只保证完整显示，
   绝不裁切、绝不拉伸 —— 客户看到的就是这张照片的全貌 */
.gallery__main { aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; background: var(--color-bg-light); overflow: hidden; cursor: zoom-in; }
.gallery__main img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: var(--space-sm); padding: var(--space-md); background: #fff; }
.gallery__thumbs::-webkit-scrollbar { display: none; }
.gallery__thumb {
  width: 100%; aspect-ratio: 4/3; padding: 0;
  border: 2px solid transparent; border-radius: var(--radius-md);
  overflow: hidden; cursor: pointer; background: var(--color-bg-light);
  transition: border-color var(--transition-fast);
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb.is-active, .gallery__thumb:hover { border-color: var(--color-accent-text); }
.gallery__full {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: 700; color: var(--color-text-secondary);
  padding: 8px 12px; text-decoration: none;
}
.gallery__full:hover { color: var(--color-accent-text); }
.gallery__bartop {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 var(--space-md); background: #fff;
  border-top: 1px solid var(--color-border);
}
.gallery__bartop .gallery__hint { margin: 0; font-size: var(--text-xs); }

/* ── 原图查看：不缩放、不压缩，直接看 R2 上那张原始文件 ── */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(4, 12, 20, .95);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; overscroll-behavior: contain;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  width: auto; height: auto;
  max-width: 100%; max-height: calc(100vh - 96px);
  max-height: calc(100dvh - 96px);
  object-fit: contain; border-radius: 4px;
}
.lightbox__bar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; color: #fff; font-size: var(--text-sm);
  background: linear-gradient(180deg, rgba(0,0,0,.55), transparent);
}
.lightbox__bar a { color: #ffb27a; font-weight: 700; text-decoration: none; }
.lightbox__close {
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.14); color: #fff; font-size: 20px; line-height: 1; cursor: pointer;
}
.lightbox__close:hover { background: rgba(255,255,255,.28); }

.gallery--empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--space-xl); background: var(--color-bg-light); min-height: 340px; }
.gallery__hint { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-md); }

/* ── 参数表（三列版，2026-10-30 改版）──
   原来是两列大表，20 项参数要滚 3 屏；现在宽屏三列排开，一屏看完。
   小屏退回两列 / 一列，长参数值自己换行，不横向滚动。 */
.spec-grid-wrap {
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-bg-card); overflow: hidden;
}
.spec-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0; padding: 0;
}
.spec-grid__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-md);
  min-width: 0; padding: 12px 18px;
  border-bottom: 1px solid var(--color-border);
  border-inline-end: 1px solid var(--color-border);
}
.spec-grid__row dt {
  color: var(--color-text-secondary); font-size: var(--text-sm); min-width: 0;
}
.spec-grid__row dd {
  margin: 0; font-size: var(--text-sm); font-weight: 600; color: var(--color-text);
  font-variant-numeric: tabular-nums; text-align: end; min-width: 0; overflow-wrap: anywhere;
}
@media (max-width: 1100px) { .spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .spec-grid { grid-template-columns: 1fr; }
  .spec-grid__row { padding: 10px 14px; }
  .spec-grid-wrap { border-radius: var(--radius-md); }
}

/* ── 产品列表侧栏筛选（2026-10-30 新增）──
   逻辑属性写死：阿语 RTL 下侧栏自动落到右边，不用另写一套 */
.plist { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--space-xl); align-items: start; }
.plist__side {
  position: sticky; top: calc(var(--nav-height, 72px) + 16px);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-bg-card); padding: var(--space-lg);
}
.plist__blk { margin-bottom: var(--space-lg); }
.plist__h { font-size: var(--text-sm); font-weight: 800; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--color-text-secondary); margin-bottom: var(--space-sm); }
.plist__opt { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); padding: 5px 0; cursor: pointer; }
.plist__opt input { inline-size: 16px; block-size: 16px; accent-color: var(--color-accent); }
.plist__q { inline-size: 100%; padding: 9px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); font-size: var(--text-sm); }
.plist__q:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.plist__reset { inline-size: 100%; justify-content: center; }
.plist__count { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-md); }
.product-card.is-filtered-out { display: none !important; }

@media (max-width: 900px) {
  .plist { grid-template-columns: 1fr; }
  .plist__side { position: static; }
  .plist__blk { margin-bottom: var(--space-md); }
  .plist__opt { display: inline-flex; margin-inline-end: var(--space-md); }
}

/* 旧的两列表格样式保留：后台预览、其他页面可能还在用 */
.spec-table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-bg-card); }
.spec-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.spec-table th {
  text-align: left; font-weight: 600; color: var(--color-text-secondary);
  padding: 12px 20px; width: 42%;
  border-bottom: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  background: rgba(232,244,254,0.5);
  vertical-align: top;
}
.spec-table td {
  padding: 12px 20px; border-bottom: 1px solid var(--color-border);
  color: var(--color-text); font-weight: 600; vertical-align: top;
  font-variant-numeric: tabular-nums;
}
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: none; }
.spec-note { font-size: 12px; color: var(--color-text-muted); margin-top: var(--space-md); line-height: 1.7; }

.prod-summary { font-size: var(--text-base); color: var(--color-text-secondary); line-height: 1.9; margin-bottom: var(--space-md); }

/* ── 视频 ── */
#videos { scroll-margin-top: 92px; }
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: var(--space-xl);
  align-items: start;
}
.video-box {
  position: relative; background: #08131f;
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--color-border);
}
/* 上传的原始视频：宽高都按源文件比例，不裁切、不拉伸；桌面 / 平板 / 手机同一套规则 */
.video-box--file { display: flex; align-items: center; justify-content: center; }
.video-box--file video {
  display: block; width: 100%; height: auto;
  max-width: 100%; max-height: 80vh;
  margin-inline: auto; object-fit: contain; background: #08131f;
}
/* 外链播放器（YouTube / Bilibili / Vimeo）统一 16:9 自适应 */
.video-box--embed { aspect-ratio: 16/9; }
.video-box--embed iframe { width: 100%; height: 100%; display: block; border: 0; }

/* ── 询盘成功提示 ── */
.form__msg {
  padding: 14px 18px; border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 600; margin-top: var(--space-md);
}
.form__msg--ok { background: rgba(34,197,94,0.1); color: #15803d; border: 1px solid rgba(34,197,94,0.3); }
.form__msg--err { background: rgba(239,68,68,0.08); color: #b91c1c; border: 1px solid rgba(239,68,68,0.25); }

/* ── 移动端 ── */
@media (max-width: 767px) {
  .page-hero__title { font-size: var(--text-3xl); }
  .prod-keyspecs { grid-template-columns: 1fr; }
  .prod-actions .btn { flex: 1 1 100%; text-align: center; }
  .gallery__main { aspect-ratio: 1/1; }
  .spec-table th { width: 45%; padding: 10px 12px; }
  .spec-table td { padding: 10px 12px; }
  .video-grid { grid-template-columns: 1fr; }
  /* 缩略图按 4:3 算，52px 宽只有 39px 高，手指点不准；改成 64px 宽起，高度自然到 48 */
  .gallery__thumbs { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
}

/* ── 后台入口（站内不显示，仅防误点） ── */
.admin-shell { display: none; }

/* ── 工厂实拍（电子画册·实力展示） ── */
.factory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.factory-grid__item {
  position: relative;
  display: block;
  aspect-ratio: 4/3;
  border-radius: 10px;
  overflow: hidden;
  background: #e8eef5;
  box-shadow: 0 1px 2px rgba(16,40,64,.06), 0 8px 24px rgba(16,40,64,.06);
}
.factory-grid__item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s cubic-bezier(.2,.7,.3,1);
}
.factory-grid__item:hover img { transform: scale(1.06); }
.factory-grid__item:nth-child(1),
.factory-grid__item:nth-child(6) { grid-column: span 2; aspect-ratio: 2/1.5; }
.factory-head { margin-bottom: 22px; }
.factory-head__kicker {
  font-size: 12px; font-weight: 800; letter-spacing: .16em;
  /* 2026-10-30 对比度修正：原 #f47920 在 #b8dff5 上实测 1.96:1，违反铁律⑧ */
  text-transform: uppercase; color: var(--color-accent-text); margin-bottom: 8px;
}
.factory-head__title { font-size: 26px; letter-spacing: -.02em; margin-bottom: 8px; }
/* 2026-10-30 对比度修正：原 #5f7f9d 实测 2.98:1，改用统一令牌 */
.factory-head__desc { color: var(--color-text-secondary); font-size: 15px; max-width: 720px; }
@media (max-width: 900px) {
  .factory-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .factory-grid__item:nth-child(1),
  .factory-grid__item:nth-child(6) { grid-column: span 2; }
  .factory-head__title { font-size: 21px; }
}
