/* ============================================================
   ChemSigma — 类别目录 / 试剂页 / 搜索（在 site.css 设计系统之上）
   ============================================================ */

/* ─── Header: 类别下拉 + 搜索 ─────────────────────────────── */
.cat-dropdown {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: .4rem 0;
  max-height: 70vh;
  overflow-y: auto;
  min-width: 240px;
}
.cat-dropdown .dropdown-item { font-size: .9rem; padding: .45rem 1.1rem; }
.cat-dropdown .dropdown-item:hover,
.cat-dropdown .dropdown-item:focus { background: var(--g-50); color: var(--brand-primary); }

.nav-search {
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0 .25rem 0 .9rem;
  margin-right: 1rem;
  background: var(--bg-white);
}
.nav-search .form-control { border: 0; box-shadow: none; padding-left: 0; width: 160px; font-size: .85rem; }
.nav-search .btn { color: var(--brand-primary); }

/* ─── Hero 搜索 ───────────────────────────────────────────── */
.hero-search {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #fff;
  border-radius: 999px;
  padding: .35rem .35rem .35rem 1.1rem;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
}
.hero-search > i { color: var(--n-400); }
.hero-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  font-size: .95rem;
  background: transparent;
  color: var(--text-primary);
}
.hero-search .btn { border-radius: 999px; padding: .5rem 1.4rem; }

/* ─── 页内搜索框 ──────────────────────────────────────────── */
.cs-search {
  display: flex;
  align-items: center;
  gap: .5rem;
  position: relative;
  max-width: 560px;
  flex: 1 1 320px;
}
.cs-search > i {
  position: absolute;
  left: .9rem;
  color: var(--n-400);
  pointer-events: none;
}
.cs-search .form-control { padding-left: 2.4rem; }

/* ─── 首页类别卡片 ────────────────────────────────────────── */
.cat-card {
  height: 100%;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.25rem 1rem;
  transition: var(--trans);
  display: flex;
  flex-direction: column;
}
.cat-card:hover { border-color: rgba(0,171,141,.35); box-shadow: var(--shadow-brand); }
.cat-card-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--text-primary);
  margin-bottom: .9rem;
}
.cat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--g-100);
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.cat-card-title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; line-height: 1.25; }
.cat-card-count {
  margin-left: auto;
  font-size: .75rem;
  font-weight: 600;
  color: var(--brand-primary);
  background: var(--g-50);
  border-radius: 999px;
  padding: .1rem .6rem;
}
.cat-card-subs { list-style: none; margin: 0 0 .5rem; padding: 0; }
.cat-card-subs li a {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .35rem 0;
  font-size: .88rem;
  color: var(--text-secondary);
  border-bottom: 1px dashed var(--n-200);
}
.cat-card-subs li:last-child a { border-bottom: 0; }
.cat-card-subs li a:hover { color: var(--brand-primary); }
.cat-card-subs small { color: var(--text-muted); }
.cat-card-more { margin-top: auto; font-size: .82rem; font-weight: 600; }

/* ─── 类别侧栏 / 区块 ─────────────────────────────────────── */
.cat-toc {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: .75rem 0;
  background: var(--bg-white);
}
.cat-toc + .cat-toc { position: static; }
.cat-toc-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: .25rem 1.1rem .5rem;
}
.cat-toc-title a { color: inherit; }
.cat-toc > a {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding: .4rem 1.1rem;
  font-size: .9rem;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
}
.cat-toc > a:hover { color: var(--brand-primary); background: var(--g-50); }
.cat-toc > a.active { color: var(--brand-primary); border-left-color: var(--brand-secondary); background: var(--g-50); font-weight: 600; }
.cat-toc small { color: var(--text-muted); }

.cat-block { padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--border-color); scroll-margin-top: calc(var(--header-h) + 1rem); }
.cat-block:last-child { border-bottom: 0; margin-bottom: 0; }
.cat-block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: 1.25rem; }
.cat-block-head h2 { font-size: 1.4rem; margin: 0; }
.cat-block-head h2 a { color: var(--text-primary); }
.cat-block-head h2 a:hover { color: var(--brand-primary); }

.cat-sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.cat-sub-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: .92rem;
  background: var(--bg-white);
}
.cat-sub-item:hover { border-color: var(--brand-secondary); color: var(--brand-primary); background: var(--g-50); }
.cat-sub-item small { color: var(--text-muted); font-weight: 600; }

/* ─── 产品卡片（链接到试剂页）────────────────────────────── */
.cs-product-card { color: inherit; }
.cs-product-card .product-card-img { height: 160px; background: #fff; border-bottom: 1px solid var(--border-color); }
.cs-product-card .product-card-body { padding: 1rem 1.1rem; }
.cs-product-card .product-card-title { font-size: .95rem; min-height: 2.6rem; color: var(--text-primary); word-break: break-word; }
.cs-card-facts { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; font-size: .8rem; margin: .25rem 0 .75rem; }
.cs-card-facts dt { color: var(--text-muted); font-weight: 500; }
.cs-card-facts dd { margin: 0; color: var(--text-secondary); word-break: break-all; }
.cs-card-link { margin-top: auto; font-size: .82rem; font-weight: 600; color: var(--brand-secondary); }
.cs-product-card:hover .cs-card-link { color: var(--brand-primary); }

/* ─── 子类别产品表 ────────────────────────────────────────── */
.cs-product-table-wrap { border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.cs-product-table { margin: 0; font-size: .92rem; }
.cs-product-table thead th {
  background: var(--n-50);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom-width: 1px;
}
.cs-product-table td { vertical-align: middle; }
.cs-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 60px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}
.cs-thumb img { max-width: 100%; max-height: 100%; }

/* ─── 试剂页 ──────────────────────────────────────────────── */
.rg-side { position: sticky; top: calc(var(--header-h) + 1rem); }
.rg-structure {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--brand-secondary);
  padding: 1rem;
}
.rg-structure img { max-width: 100%; max-height: 100%; }
.rg-profile-link {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--g-50);
  color: var(--brand-primary);
}
.rg-profile-link > i:first-child { font-size: 1.6rem; }
.rg-profile-link strong { display: block; color: var(--text-primary); }
.rg-profile-link small { color: var(--text-muted); }
.rg-profile-link:hover { border-color: var(--brand-secondary); }

.rg-toc { display: flex; flex-direction: column; border-left: 2px solid var(--border-color); }
.rg-toc a { padding: .3rem 0 .3rem 1rem; font-size: .88rem; color: var(--text-secondary); margin-left: -2px; border-left: 2px solid transparent; }
.rg-toc a:hover { color: var(--brand-primary); border-left-color: var(--brand-secondary); }

.rg-section { margin-bottom: 3rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.rg-section h2 {
  font-size: 1.35rem;
  padding-bottom: .6rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--g-100);
}

.rg-facts { margin: 0; font-size: .93rem; }
.rg-facts th { width: 34%; color: var(--text-muted); font-weight: 500; background: transparent; }
.rg-facts td { word-break: break-word; }
.rg-facts code { color: var(--text-secondary); font-size: .82rem; word-break: break-all; }

.rg-coa-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.rg-coa-meta > div { background: var(--n-50); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: .6rem .8rem; }
.rg-coa-meta dt { font-size: .72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.rg-coa-meta dd { margin: 0; font-weight: 600; color: var(--text-primary); }

.rg-coa-table { font-size: .9rem; border: 1px solid var(--border-color); }
.rg-coa-table thead th { background: var(--g-50); color: var(--brand-primary); font-weight: 600; }
.rg-coa-conclusion {
  margin: 1rem 0 .5rem;
  padding: .75rem 1rem;
  background: var(--g-50);
  border-left: 3px solid var(--brand-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--brand-primary);
  font-weight: 500;
}

.rg-packs { display: flex; flex-wrap: wrap; gap: .75rem; }
.rg-pack {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-weight: 600;
  background: #fff;
}
.rg-pack i { color: var(--brand-secondary); }
.rg-pack small { font-weight: 500; color: var(--text-muted); font-size: .75rem; }
.rg-pack:hover { border-color: var(--brand-secondary); background: var(--g-50); }
.rg-pack:hover small { color: var(--brand-primary); }

.rg-empty {
  border: 1px dashed var(--n-300);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-secondary);
}
.rg-empty > i { font-size: 2rem; color: var(--n-400); display: block; margin-bottom: .5rem; }

.rg-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .85rem;
  border-radius: 999px;
  background: var(--g-50);
  border: 1px solid var(--g-100);
  font-size: .85rem;
  color: var(--brand-primary);
}
.rg-chip i { font-size: .7rem; opacity: .6; }
.rg-chip:hover { border-color: var(--brand-secondary); }

@media (max-width: 991.98px) {
  .rg-side, .cat-toc { position: static; }
  .nav-search { margin: .75rem 0; }
}
