/* ============================================================
   Let-Lab Help-Lab · 前台商城样式（Lab-to-Lab 交易市场）
   ============================================================ */

:root {
  --royal: #0F4E9B;
  --royal-dark: #0B3A75;
  --royal-deep: #072A57;
  --cyan: #0891B2;
  --cyan-light: #22D3EE;
  --gold: #F59E0B;
  --ink: #101828;
  --ink-soft: #475467;
  --gray-bg: #F8FAFC;
  --gray-line: #E4E7EC;
  --white: #FFFFFF;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(7, 42, 87, .10);
  --font-cn: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-en: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-cn); background: var(--gray-bg); color: var(--ink); line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
button { font-family: var(--font-cn); }

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-line);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky; top: 0; z-index: 100;
}
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar-logo { width: 44px; height: 44px; object-fit: contain; }
.topbar-brand strong { font-family: var(--font-en); font-size: 17px; color: var(--royal-dark); }
.topbar-brand strong em { font-style: normal; color: var(--cyan); }
.topbar-brand small { display: block; font-size: 11px; color: var(--ink-soft); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.btn-sell {
  background: var(--royal);
  color: var(--white);
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  transition: all .2s;
}
.btn-sell:hover { background: var(--royal-dark); }
.topbar-back { font-size: 14px; color: var(--ink-soft); font-weight: 600; padding: 8px 12px; border-radius: 8px; }
.topbar-back:hover { color: var(--royal); background: rgba(15,78,155,.06); }

/* ---------- Hero ---------- */
.market-hero {
  background: linear-gradient(150deg, var(--royal-deep), var(--royal) 65%, var(--card-blue, #1557A8));
  color: var(--white);
  padding: 56px 24px;
  text-align: center;
}
.market-hero-inner { max-width: 780px; margin: 0 auto; }
.mh-tag {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--cyan-light);
  display: inline-block;
  margin-bottom: 12px;
}
.market-hero h1 { font-size: clamp(30px, 4.5vw, 44px); font-weight: 800; letter-spacing: -1px; margin-bottom: 10px; }
.market-hero p { font-size: 16px; color: rgba(255,255,255,.85); }

/* ---------- 布局 ---------- */
.market-main { max-width: 1280px; margin: 0 auto; padding: 30px 24px 60px; }
.market-layout { display: grid; grid-template-columns: 230px 1fr; gap: 30px; }

/* ---------- 侧边栏 ---------- */
.sidebar { align-self: start; position: sticky; top: 90px; }
.sidebar h3 { font-size: 14px; font-weight: 700; color: var(--ink-soft); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .5px; }
.cat-list { list-style: none; background: var(--white); border: 1px solid var(--gray-line); border-radius: 12px; overflow: hidden; margin-bottom: 22px; }
.cat-list li {
  padding: 12px 16px;
  font-size: 14.5px;
  cursor: pointer;
  border-bottom: 1px solid #F0F2F5;
  transition: all .2s;
  color: var(--ink-soft);
}
.cat-list li svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 7px; color: var(--royal); }
.cat-list li:last-child { border-bottom: none; }
.cat-list li:hover { background: var(--gray-bg); color: var(--royal); }
.cat-list li.active { background: rgba(15,78,155,.08); color: var(--royal); font-weight: 700; border-left: 3px solid var(--royal); }
.side-second { margin-top: 4px; }
.side-verify {
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: 12px;
  padding: 16px;
  font-size: 13px;
  color: var(--ink-soft);
}
.side-verify p { margin-bottom: 10px; }
.side-link { color: var(--royal); font-weight: 600; font-size: 13.5px; }

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.result-count { font-size: 14px; color: var(--ink-soft); }
.search-box { flex: 1; max-width: 380px; }
.search-box input {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--gray-line);
  border-radius: 10px;
  font-size: 14.5px;
  font-family: var(--font-cn);
  background: var(--white);
}
.search-box input:focus { outline: none; border-color: var(--royal); box-shadow: 0 0 0 4px rgba(15,78,155,.08); }

/* ---------- 产品网格 ---------- */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.product-card {
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all .25s;
  cursor: pointer;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(15,78,155,.3); }
.pc-top { display: flex; justify-content: space-between; align-items: center; }
.pc-cat svg, .pd-cat svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 5px; }
.pc-cat { font-size: 12px; font-weight: 600; color: var(--cyan); background: rgba(8,145,178,.08); padding: 3px 10px; border-radius: 100px; }
.pc-coa { font-size: 11px; font-weight: 700; color: var(--gold); background: rgba(245,158,11,.12); padding: 3px 10px; border-radius: 100px; }
.pc-name { font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.pc-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.55; flex: 1; }
.pc-seller { font-size: 12.5px; color: var(--ink-soft); }
.seller-link { color: var(--royal); font-weight: 600; }
.seller-link:hover { color: var(--cyan); text-decoration: underline; }
.pc-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px dashed var(--gray-line); }
.pc-price { font-family: var(--font-en); font-size: 17px; font-weight: 800; color: var(--royal); }
.pc-btn {
  background: var(--royal);
  color: var(--white);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.pc-btn:hover { background: var(--royal-dark); }

.loading, .empty { text-align: center; padding: 60px 20px; color: var(--ink-soft); grid-column: 1 / -1; }
.empty .sub { font-size: 13px; color: #98A2B3; margin-top: 6px; }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 28px; }
.pager button {
  min-width: 36px; height: 36px;
  border: 1px solid var(--gray-line);
  background: var(--white);
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .2s;
}
.pager button:hover { border-color: var(--royal); color: var(--royal); }
.pager button.on { background: var(--royal); color: var(--white); border-color: var(--royal); }

/* ---------- 详情弹层 ---------- */
.modal { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(7,42,87,.55); backdrop-filter: blur(6px); }
.modal-box {
  position: relative;
  background: var(--white);
  border-radius: 20px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 36px;
  box-shadow: 0 30px 80px rgba(7,42,87,.35);
  animation: popIn .3s ease;
}
@keyframes popIn { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  border: none;
  background: var(--gray-bg);
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all .2s;
}
.modal-close:hover { background: var(--gray-line); color: var(--ink); }
.modal-loading { text-align: center; padding: 40px; color: var(--ink-soft); }

.pd-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pd-cat { font-size: 12.5px; font-weight: 600; color: var(--cyan); background: rgba(8,145,178,.08); padding: 4px 12px; border-radius: 100px; }
.pd-name { font-size: 24px; font-weight: 800; color: var(--ink); margin-bottom: 10px; line-height: 1.3; }
.pd-seller { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--gray-line); }
.pd-seller strong { font-size: 15px; color: var(--royal); }
.pd-seller span { font-size: 13px; color: var(--ink-soft); }
.pd-price-row { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; }
.pd-price { font-family: var(--font-en); font-size: 28px; font-weight: 800; color: var(--royal); }
.pd-unit { font-size: 13.5px; color: var(--ink-soft); }
.pd-section { margin-bottom: 16px; }
.pd-section h4 { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; }
.pd-section p { font-size: 14.5px; color: var(--ink); white-space: pre-wrap; }
.pd-actions { margin-top: 22px; }
.btn-inquire {
  display: block;
  text-align: center;
  background: var(--royal);
  color: var(--white);
  padding: 13px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  transition: all .2s;
}
.btn-inquire:hover { background: var(--royal-dark); }
.pd-revenue {
  margin-top: 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: rgba(15,78,155,.05);
  border-radius: 8px;
  padding: 7px 10px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 992px) {
  .market-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .cat-list { display: flex; flex-wrap: wrap; gap: 6px; border: none; background: none; }
  .cat-list li { border: 1px solid var(--gray-line); border-radius: 100px; padding: 7px 14px; background: var(--white); }
  .cat-list li.active { border-left: 1px solid var(--royal); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .product-grid { grid-template-columns: 1fr; }
  .topbar { padding: 10px 14px; }
  .btn-sell { padding: 8px 12px; font-size: 13px; }
  .modal-box { padding: 26px 22px; }
}
