/* 容大生物包材库 - 按设计稿风格 */
:root {
  --blue: #3d6bfa;
  --blue-dark: #2f57d6;
  --navy: #16265c;
  --text: #333;
  --text-2: #666;
  --text-3: #999;
  --line: #eceef2;
  --card-img-bg: #f6f8fb;
  --card-border: #eef0f4;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: #fff;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; }
button { font-family: inherit; cursor: pointer; }

/* ---------- header（蓝色渐变导航栏） ---------- */
.site-header {
  position: relative;
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 28px;
  gap: 28px;
  background: linear-gradient(90deg, #1a4fc3 0%, #2465d8 45%, #2f7fe8 100%);
  box-shadow: 0 2px 8px rgba(20, 50, 120, .18);
}
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand-logo { height: 38px; width: auto; display: block; filter: brightness(0) invert(1); }
.header-left { font-size: 14px; color: #fff; position: relative; }
.about-toggle { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; color: rgba(255,255,255,.95); }
.about-toggle:hover { color: #fff; }
.about-toggle .caret { font-size: 10px; color: rgba(255,255,255,.75); transition: transform .2s; }
.about-menu {
  display: none;
  position: absolute;
  top: 34px; left: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20, 40, 90, .16);
  padding: 6px 0;
  min-width: 168px;
  z-index: 50;
}
.about-menu.open { display: block; }
.about-menu a { display: block; padding: 9px 16px; font-size: 13px; color: #444; white-space: nowrap; }
.about-menu a:hover { background: #f5f7ff; color: var(--blue); }

.search-box { display: flex; align-items: center; margin-left: auto; }
.search-box input {
  width: 230px; height: 34px;
  border: none;
  border-radius: 4px 0 0 4px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  background: #fff;
}
.search-box input::placeholder { color: #b9c0cc; }
.search-box button {
  height: 34px; width: 44px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  border: none; border-left: 1px solid rgba(255,255,255,.25);
  border-radius: 0 4px 4px 0;
  display: flex; align-items: center; justify-content: center;
}
.search-box button:hover { background: rgba(255, 255, 255, .3); }

/* ---------- page title ---------- */
.page-title { text-align: center; margin: 30px 0 6px; font-size: 24px; font-weight: 700; color: #222; }
.page-title-bar { width: 40px; height: 3px; background: var(--blue); border-radius: 2px; margin: 10px auto 0; }

/* ---------- filters ---------- */
.filter-tabs {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 6px; margin: 22px auto 0; padding: 0 16px;
  max-width: 900px;
}
.filter-tabs .tab {
  padding: 8px 22px;
  font-size: 14px;
  color: #333;
  border-radius: 6px;
  background: transparent;
  border: none;
  transition: all .15s;
  white-space: nowrap;
}
.filter-tabs .tab:hover { color: var(--blue); }
.filter-tabs .tab.active { background: var(--blue); color: #fff; font-weight: 500; box-shadow: 0 4px 10px rgba(61, 107, 250, .3); }

.filter-row {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap;
  margin-top: 14px; padding: 0 16px;
}
.filter-row .sep { color: #d8dce4; margin: 0 14px; font-size: 12px; }
.filter-chip {
  background: none; border: none;
  font-size: 14px; color: #555;
  padding: 4px 2px;
  transition: color .15s;
  white-space: nowrap;
}
.filter-chip:hover { color: var(--blue); }
.filter-chip.active { color: var(--blue); font-weight: 600; }
.filter-row.cap-row { margin-top: 10px; }
.filter-row.cap-row .filter-chip { font-size: 13px; color: #8b93a3; }
.filter-row.cap-row .filter-chip.active { color: var(--blue); font-weight: 600; }

.result-info { text-align: center; margin-top: 14px; font-size: 12px; color: #b3b9c6; }

/* ---------- 分类小节（全部产品视图） ---------- */
.cat-section { margin-top: 34px; }
.cat-section:first-child { margin-top: 10px; }
.sec-title {
  font-size: 17px;
  font-weight: 700;
  color: #1d2b4f;
  display: inline-block;
  padding-bottom: 8px;
  border-bottom: 2px solid #22355e;
  margin-bottom: 4px;
}
.sec-count { font-size: 12px; font-weight: 400; color: #9aa3b5; margin-left: 10px; }

/* ---------- product grid ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px 60px; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin-top: 20px;
}
.product-card {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .2s;
  display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: 0 10px 26px rgba(30, 50, 100, .13); }
.card-img {
  height: 220px;
  background: #f7f8fa;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.card-img .noimg { color: #c3c9d4; font-size: 12px; }
.card-cap {
  position: relative;
  background: #eaf4fd;
  text-align: center;
  padding: 13px 10px 14px;
}
/* 悬停横线：出现在图片与文字说明交界处 */
.card-cap::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: #22355e;
  opacity: 0;
  transition: opacity .15s;
}
.product-card:hover .card-cap::before { opacity: 1; }
.card-name { font-size: 15px; font-weight: 600; color: #222; }
.card-sub { font-size: 12px; color: #8b96a8; margin-top: 5px; }
.card-sub .mat { margin-right: 8px; }

.empty-tip { text-align: center; color: #b3b9c6; font-size: 14px; padding: 80px 0; }

/* ---------- detail page ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14px; color: #555;
  margin: 26px 0 18px;
  cursor: pointer;
}
.back-link:hover { color: var(--blue); }
.detail-wrap {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}
.gallery {
  flex: 1.15;
  background: #f7f9fc;
  border-radius: 8px;
  padding: 26px;
  display: flex;
  gap: 18px;
  position: relative;
}
.thumb-col { display: flex; flex-direction: column; gap: 16px; width: 96px; flex-shrink: 0; }
.thumb {
  position: relative;
  width: 96px; height: 110px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 8px 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s;
}
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb.active { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.thumb-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  color: #6b7688;
  background: rgba(240, 245, 250, .92);
  border-radius: 0 0 3px 3px;
  pointer-events: none;
}
/* 画廊缩略图分组标题（主展示图 / 尺寸图 / 细节图） */
.thumb-group-label {
  width: 96px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #1d2b4f;
  margin: 6px 0 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.thumb-group-label:first-child { margin-top: 0; }
.thumb-group-label span {
  font-size: 10px;
  font-weight: 400;
  color: #9aa3b5;
  background: #eef2f8;
  border-radius: 8px;
  padding: 0 6px;
}
.thumb.empty { border-style: dashed; color: #b9c0cc; }
.gallery-empty {
  font-size: 14px;
  color: #b3b9c6;
  align-self: center;
}
.gallery-main {
  flex: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 480px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  padding: 24px;
}
.gallery-main img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gal-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px;
  border: none; background: transparent;
  font-size: 30px; color: #444; line-height: 1;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.gal-arrow:hover { background: rgba(61, 107, 250, .08); color: var(--blue); }
.gal-arrow.prev { left: 6px; }
.gal-arrow.next { right: 6px; }
.gal-arrow:disabled { opacity: .2; cursor: default; }

.detail-info { flex: 1; padding-top: 12px; }
.detail-title { font-size: 22px; font-weight: 700; color: #1a1a1a; margin-bottom: 26px; }
.spec-list { display: flex; flex-direction: column; gap: 15px; }
.spec-row { display: flex; font-size: 14px; line-height: 1.55; }
.spec-label { width: 96px; flex-shrink: 0; color: #8b93a3; }
.spec-value { color: #333; flex: 1; white-space: pre-wrap; word-break: break-all; }
.spec-row.dims .spec-value { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; }
.spec-row.dims .dim-item { display: flex; gap: 8px; }
.spec-row.dims .dim-label { color: #8b93a3; min-width: 34px; }
.spec-subhead { font-size: 13px; font-weight: 600; color: #8b93a3; letter-spacing: .04em; margin-top: 6px; padding-top: 14px; border-top: 1px dashed var(--line); }
.detail-divider { border: none; border-top: 1px solid var(--line); margin: 26px 0; }
.pdf-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blue); color: #fff;
  border: none; border-radius: 4px;
  padding: 10px 22px; font-size: 14px;
}
.pdf-btn:hover { background: var(--blue-dark); }
.pdf-btn.disabled { background: #c4cbd9; cursor: not-allowed; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}
@media (max-width: 640px) {
  .site-header { height: 52px; padding: 0 14px; gap: 14px; }
  .brand-logo { height: 30px; max-width: 170px; object-fit: contain; }
  .header-left { font-size: 13px; }
  .search-box input { width: 130px; }
  .page-title { font-size: 19px; margin-top: 20px; }
  .filter-tabs { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding: 0 14px; margin-top: 16px; -webkit-overflow-scrolling: touch; }
  .filter-tabs .tab { padding: 7px 14px; font-size: 13px; }
  .filter-row { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding: 0 14px; -webkit-overflow-scrolling: touch; }
  .filter-row .sep { margin: 0 10px; }
  .container { padding: 0 14px 40px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-img { height: 160px; padding: 12px; }
  .card-name { font-size: 13px; }
  .card-sub { font-size: 11px; margin-top: 3px; }
  .card-cap { padding: 10px 8px 11px; }
  .detail-wrap { flex-direction: column; gap: 20px; }
  .gallery { flex-direction: column-reverse; padding: 14px; }
  .thumb-col { flex-direction: row; width: 100%; overflow-x: auto; align-items: flex-start; }
  .thumb-group-label { width: auto; flex-shrink: 0; white-space: nowrap; margin: 0 8px 0 0; align-self: center; }
  .thumb { width: 72px; height: 84px; flex-shrink: 0; }
  .gallery-main { height: 300px; }
  .detail-title { font-size: 18px; }
}
