/* ============================================================
 * 特写瓷砖 · H5 电脑端商城样式
 * 视觉令牌（SPEC §2）：深墨绿渐变背景 / 鎏金 / 玻璃卡片 / 大留白精致排版
 * 适配 PC 宽屏与窄屏（响应式栅格）
 * ============================================================ */

:root {
  --deep: #0a1a10;
  --deep2: #0e241a;
  --mid: #1B352E;
  --green: #2d5a4a;
  --gold: #C9A96E;
  --gold-light: #e8c87e;
  --text: #efe9db;
  --text-dim: #8fa39a;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --gold-border: rgba(201, 169, 110, 0.35);
  --gold-border-soft: rgba(201, 169, 110, 0.2);
  --radius: 16px;
  --danger: #d98a7a;
  --ok: #8fc7a8;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, #0a1a10 0%, #2d5a4a 38%, #1B352E 68%, #0a1a15 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { display: block; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 26, 16, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--gold-border-soft);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { display: flex; align-items: baseline; gap: 10px; cursor: pointer; white-space: nowrap; }
.brand-logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-slogan { font-size: 12px; color: var(--text-dim); letter-spacing: 1px; }

.topbar-search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass);
  border: 1px solid var(--gold-border-soft);
  border-radius: 999px;
  padding: 8px 16px;
}
.topbar-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
}
.topbar-search input::placeholder { color: var(--text-dim); }
.topbar-search .go { color: var(--gold); cursor: pointer; font-size: 15px; }

.topbar-actions { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.tb-item { position: relative; cursor: pointer; font-size: 14px; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tb-item .ico { font-size: 20px; }
.tb-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #1a1206;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tb-item:hover { color: var(--gold-light); }

/* 二级导航（分类快捷） */
.subnav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 12px;
  display: flex;
  gap: 20px;
  font-size: 14px;
  overflow-x: auto;
}
.subnav a { color: var(--text-dim); padding: 4px 2px; white-space: nowrap; }
.subnav a.active, .subnav a:hover { color: var(--gold-light); }

/* ---------- 主容器 ---------- */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  min-height: 60vh;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { margin-bottom: 20px; }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: 1px; }
.page-sub { color: var(--text-dim); font-size: 14px; margin-top: 6px; }

/* ---------- 玻璃卡片 / 通用 ---------- */
.card {
  background: var(--glass);
  border: 1px solid var(--gold-border-soft);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 28px; }
.dim { color: var(--text-dim); font-size: 13px; }
.right { margin-left: auto; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #1a1206;
}
.btn-gold:hover { filter: brightness(1.08); }
.btn-outline {
  background: transparent;
  border-color: var(--gold-border);
  color: var(--gold-light);
}
.btn-outline:hover { background: rgba(201, 169, 110, 0.12); }
.btn-dark {
  background: var(--glass-strong);
  border-color: var(--gold-border-soft);
  color: var(--text);
}
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- 标签 / 筛选条 ---------- */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--gold-border-soft);
  color: var(--text-dim);
  margin-right: 6px;
}
.tag-gold { color: var(--gold-light); border-color: var(--gold-border); background: rgba(201, 169, 110, 0.1); }
.tag-green { color: var(--ok); border-color: rgba(143, 199, 168, 0.35); background: rgba(143, 199, 168, 0.08); }

.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.chip {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--gold-border-soft);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.chip.active { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #1a1206; border-color: transparent; font-weight: 700; }

/* ---------- 商品卡 ---------- */
.pcard {
  background: var(--glass);
  border: 1px solid var(--gold-border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--gold-border); }
.pcard-img { position: relative; aspect-ratio: 1; overflow: hidden; }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; }
.pcard-body { padding: 14px 16px 16px; }
.pcard-name { font-size: 16px; font-weight: 700; }
.pcard-slogan { color: var(--text-dim); font-size: 12px; margin-top: 4px; min-height: 18px; }
.pcard-tags { margin: 8px 0; }
.pcard-price { color: var(--gold-light); font-weight: 700; font-size: 18px; }
.pcard-price .market { color: var(--text-dim); font-size: 12px; font-weight: 400; text-decoration: line-through; margin-left: 8px; }
.pcard-spec { color: var(--text-dim); font-size: 12px; margin-top: 4px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--gold-border-soft);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); }
.field select option { background: var(--mid); color: var(--text); }
.field textarea { resize: vertical; min-height: 80px; }

/* ---------- 空态 / 加载 / Toast / 弹窗 ---------- */
.empty {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 20px;
  font-size: 14px;
}
.empty .big { font-size: 40px; margin-bottom: 12px; }
.loading { text-align: center; color: var(--text-dim); padding: 40px; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: rgba(20, 36, 28, 0.95);
  border: 1px solid var(--gold-border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  max-width: 80vw;
}
#toast.show { opacity: 1; }

.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal {
  width: 100%; max-width: 460px;
  background: var(--deep2);
  border: 1px solid var(--gold-border);
  border-radius: 18px;
  padding: 24px;
  max-height: 85vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 16px; color: var(--gold-light); }

/* ---------- 购物车 ---------- */
.cart-row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px; background: var(--glass);
  border: 1px solid var(--gold-border-soft); border-radius: 14px; margin-bottom: 12px;
}
.cart-check { width: 20px; height: 20px; accent-color: var(--gold); cursor: pointer; }
.cart-thumb { width: 84px; height: 84px; border-radius: 12px; overflow: hidden; flex: 0 0 auto; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-info { flex: 1; }
.qty-stepper { display: inline-flex; align-items: center; gap: 12px; border: 1px solid var(--gold-border-soft); border-radius: 999px; padding: 4px 6px; }
.qty-stepper button { background: transparent; border: none; color: var(--gold-light); font-size: 18px; width: 28px; cursor: pointer; }
.qty-stepper span { min-width: 28px; text-align: center; }
.cart-foot {
  position: sticky; bottom: 0;
  display: flex; align-items: center; gap: 20px;
  background: rgba(14, 36, 26, 0.95);
  border: 1px solid var(--gold-border-soft);
  border-radius: 16px; padding: 16px 20px; margin-top: 16px;
  backdrop-filter: blur(10px);
}

/* ---------- 订单 ---------- */
.order-card { background: var(--glass); border: 1px solid var(--gold-border-soft); border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.order-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px dashed var(--gold-border-soft); margin-bottom: 12px; font-size: 13px; color: var(--text-dim); }
.order-status { color: var(--gold-light); font-weight: 700; }
.order-item { display: flex; gap: 14px; align-items: center; padding: 8px 0; }
.order-item .thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; flex: 0 0 auto; }
.order-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.amount-line { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; }
.amount-line.total { color: var(--gold-light); font-weight: 700; font-size: 17px; border-top: 1px dashed var(--gold-border-soft); margin-top: 8px; padding-top: 12px; }

/* ---------- 我的 / 会员中心 ---------- */
.member-card {
  background: linear-gradient(135deg, rgba(201, 169, 110, 0.18), rgba(45, 90, 74, 0.4));
  border: 1px solid var(--gold-border);
  border-radius: 18px;
  padding: 26px;
  display: flex; align-items: center; gap: 22px;
}
.avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(201, 169, 110, 0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--gold-light);
  border: 1px solid var(--gold-border);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.menu-cell {
  background: var(--glass); border: 1px solid var(--gold-border-soft);
  border-radius: 14px; padding: 18px 12px; text-align: center; cursor: pointer;
  transition: all 0.2s;
}
.menu-cell:hover { border-color: var(--gold); transform: translateY(-2px); }
.menu-cell .ico { font-size: 26px; }
.menu-cell .label { font-size: 13px; margin-top: 8px; }

/* ---------- 详情页 ---------- */
.detail-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; }
.gallery-main { width: 100%; aspect-ratio: 1; border-radius: 16px; overflow: hidden; position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.gallery-thumbs .thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; cursor: pointer; border: 2px solid transparent; }
.gallery-thumbs .thumb.active { border-color: var(--gold); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.sku-opt { display: inline-block; padding: 9px 18px; border-radius: 10px; border: 1px solid var(--gold-border-soft); background: var(--glass); cursor: pointer; margin: 0 10px 10px 0; font-size: 14px; }
.sku-opt.active { border-color: var(--gold); color: var(--gold-light); background: rgba(201, 169, 110, 0.12); }
.params-table { width: 100%; border-collapse: collapse; }
.params-table td { padding: 10px 12px; border-bottom: 1px solid var(--gold-border-soft); font-size: 14px; }
.params-table td:first-child { color: var(--text-dim); width: 140px; }
.buy-bar { position: sticky; bottom: 0; display: flex; gap: 14px; margin-top: 24px; padding: 16px; background: rgba(14, 36, 26, 0.95); border: 1px solid var(--gold-border-soft); border-radius: 16px; backdrop-filter: blur(10px); }

/* ---------- 评价 ---------- */
.comment { padding: 14px 0; border-bottom: 1px dashed var(--gold-border-soft); }
.comment-head { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-dim); }
.stars { color: var(--gold-light); letter-spacing: 2px; }
.comment-body { margin-top: 8px; font-size: 14px; }

/* ---------- 底部 ---------- */
.footer { text-align: center; color: var(--text-dim); font-size: 12px; padding: 40px 20px 24px; }

/* ============================================================
 * TXR 渲染引擎（renderer.js）挂载的 txr-* 基础样式（不改动 renderer.js）
 * ============================================================ */
.txr-section, .txr-sec-head { margin: 18px 0; }
.txr-sec-title { font-size: 22px; font-weight: 700; color: var(--gold-light); letter-spacing: 1px; }
.txr-sec-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.txr-grid { margin: 12px 0; }
.txr-pcard {
  background: var(--glass); border: 1px solid var(--gold-border-soft);
  border-radius: 16px; overflow: hidden; transition: transform 0.25s ease;
}
.txr-pcard:hover { transform: translateY(-3px); }
.txr-pcard-list { display: flex; gap: 14px; padding: 12px; }
.txr-pcard-list .txr-pcard-img { width: 120px; flex: 0 0 auto; aspect-ratio: 1; }
.txr-pcard-info { padding: 12px 14px 14px; }
.txr-pcard-list .txr-pcard-info { padding: 4px 0; }
.txr-pcard-name { font-size: 15px; font-weight: 700; }
.txr-pcard-slogan { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.txr-pcard-tags { margin: 6px 0; }
.txr-price-num { color: var(--gold-light); font-weight: 700; font-size: 18px; }
.txr-price-symbol { color: var(--gold-light); font-size: 13px; }
.txr-price-market { color: var(--text-dim); font-size: 12px; text-decoration: line-through; margin-left: 8px; }
.txr-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; border: 1px solid var(--gold-border-soft); color: var(--text-dim); margin-right: 5px; }
.txr-tag-gold { color: var(--gold-light); border-color: var(--gold-border); background: rgba(201, 169, 110, 0.1); }
.txr-tag-green { color: var(--ok); border-color: rgba(143, 199, 168, 0.35); }
.txr-tag-matte { color: #c9b89a; }
.txr-pcard-spec { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.txr-scard-slogan { font-size: 13px; color: var(--text); }
.txr-scard-meta { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.txr-btn { margin: 6px 0; }
.txr-grad { width: 100%; height: 100%; }
.txr-swiper { margin: 12px 0; }
.txr-container, .txr-form, .txr-topic, .txr-notice, .txr-measure { margin: 12px 0; }

/* ---------- 响应式：窄屏 ---------- */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .menu-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .topbar-inner { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .topbar-search { order: 3; max-width: none; flex-basis: 100%; }
  .page { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
  .cart-row { flex-wrap: wrap; }
  .brand-slogan { display: none; }
}
