/* 智惠文创生活馆 · 商城样式 */
:root {
  --bg: #FBF9F6;
  --card: #FFFFFF;
  --ink: #2B2A26;
  --muted: #7C766B;
  --line: #E7E1D6;
  --line-soft: #F0EBE2;
  --brand: #1F4D3F;
  --brand-soft: #2F6B57;
  --accent: #C4432E;
  --gold: #C9A227;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(43, 42, 38, .04), 0 8px 24px rgba(43, 42, 38, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶部 ---------- */
.topbar {
  background: #FFFDFA;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--muted);
}
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; height: 34px; gap: 12px; flex-wrap: wrap; }
.topbar span + span { margin-left: 14px; }

header.site {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
header.site .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 74px;
}
.logo { display: flex; align-items: center; gap: 10px; flex: none; }
.logo .mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--brand);
  color: #FBF9F6;
  display: grid; place-items: center;
  font-size: 19px; font-weight: 700; font-family: "Songti SC", serif;
}
.logo .txt b { display: block; font-size: 16.5px; letter-spacing: .3px; }
.logo .txt i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); letter-spacing: 1.5px; }

.searchbox { flex: 1; max-width: 460px; display: flex; }
.searchbox input {
  flex: 1; height: 40px; padding: 0 14px;
  border: 1.5px solid var(--line); border-right: 0;
  border-radius: 10px 0 0 10px;
  background: #fff; font-size: 14px; outline: none; color: var(--ink);
}
.searchbox input:focus { border-color: var(--brand); }
.searchbox button {
  width: 64px; height: 40px; border: 0;
  background: var(--brand); color: #fff;
  border-radius: 0 10px 10px 0; font-size: 14px;
}

.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.link-btn {
  height: 40px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 13.5px; color: var(--ink);
}
.link-btn:hover { border-color: var(--brand); color: var(--brand); }
.cart-dot {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 11px;
  display: inline-grid; place-items: center; line-height: 1;
}

/* ---------- 分类导航 ---------- */
nav.cats { background: var(--card); border-bottom: 1px solid var(--line-soft); }
nav.cats .wrap { display: flex; gap: 4px; overflow-x: auto; height: 46px; align-items: center; }
nav.cats a {
  padding: 6px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); white-space: nowrap;
}
nav.cats a.on { background: var(--brand); color: #fff; }
nav.cats a:not(.on):hover { background: var(--line-soft); color: var(--ink); }

/* ---------- 首屏 ---------- */
.hero {
  background: linear-gradient(120deg, #1F4D3F 0%, #2F6B57 58%, #3E7F68 100%);
  color: #F7F4EE;
  padding: 46px 0 40px;
}
.hero .wrap { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.hero .copy { flex: 1 1 340px; }
.hero h1 { margin: 0 0 12px; font-size: 30px; line-height: 1.35; letter-spacing: .5px; }
.hero p { margin: 0 0 22px; opacity: .88; max-width: 44em; font-size: 14.5px; }
.hero .keys { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .keys span {
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px;
}
.hero .cardno { flex: 0 0 240px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); border-radius: 16px; padding: 18px; }
.hero .cardno b { display: block; font-size: 15px; margin-bottom: 8px; }
.hero .cardno div { font-size: 12.5px; opacity: .85; }

/* ---------- 信任条 ---------- */
.trust { background: #fff; border-bottom: 1px solid var(--line-soft); }
.trust .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px 20px; }
.trust div { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; justify-content: center; }
.trust b { color: var(--ink); font-weight: 600; }

/* ---------- 区块 ---------- */
section.block { padding: 34px 0 6px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; font-size: 19px; letter-spacing: .5px; }
.sec-head p { margin: 0; font-size: 13px; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(214px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius);
  overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line); }
.card .thumb { position: relative; aspect-ratio: 1/1; background: #F4EFE8; }
.card .thumb svg { width: 100%; height: 100%; }
.card .flag {
  position: absolute; left: 10px; top: 10px;
  background: var(--accent); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px;
}
.card .body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card .name {
  font-size: 14px; line-height: 1.5; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 42px;
}
.card .sub { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card .price { display: flex; align-items: baseline; gap: 7px; margin-top: auto; }
.card .price b { color: var(--accent); font-size: 19px; font-weight: 700; }
.card .price b i { font-size: 12.5px; font-style: normal; font-weight: 600; }
.card .price s { color: #B4AEA2; font-size: 12px; }
.card .meta { font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; }

/* ---------- 详情页 ---------- */
.crumb { font-size: 12.5px; color: var(--muted); padding: 16px 0 4px; }
.crumb a:hover { color: var(--brand); }
.detail { display: grid; grid-template-columns: 420px 1fr; gap: 34px; padding: 12px 0 8px; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; gap: 20px; } }
.detail .gallery { border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; background: #F4EFE8; }
.detail .thumbs { display: flex; gap: 8px; margin-top: 10px; }
.detail .thumbs div { width: 66px; height: 66px; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: #F4EFE8; cursor: pointer; }
.detail .thumbs div.on { border-color: var(--brand); }
.detail h1 { font-size: 22px; margin: 0 0 8px; line-height: 1.45; }
.detail .sub { color: var(--muted); margin: 0 0 16px; font-size: 14px; }
.price-panel { background: #FFF8F0; border: 1px solid #F1E3CE; border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.price-panel .now { color: var(--accent); font-size: 28px; font-weight: 700; }
.price-panel .now i { font-size: 15px; font-style: normal; }
.price-panel .was { color: #B4AEA2; margin-left: 10px; font-size: 13px; }
.price-panel .row { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: flex; gap: 18px; flex-wrap: wrap; }

.opt-row { display: flex; align-items: center; gap: 12px; margin: 14px 0; }
.opt-row .lab { width: 56px; font-size: 13px; color: var(--muted); flex: none; }
.stepper { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 36px; height: 36px; border: 0; background: #fff; font-size: 17px; color: var(--ink); }
.stepper button:hover { background: var(--line-soft); }
.stepper input { width: 52px; height: 36px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font-size: 14px; outline: none; }

.buy-row { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.btn {
  height: 48px; padding: 0 30px; border-radius: 12px; border: 1.5px solid transparent;
  font-size: 15.5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #B03A27; }
.btn-ghost { background: #fff; border-color: var(--brand); color: var(--brand); }
.btn-ghost:hover { background: #F2F7F5; }
.btn-dark { background: var(--brand); color: #fff; }
.btn-dark:hover { background: #173B31; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.spec-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13.5px; }
.spec-table th, .spec-table td { border: 1px solid var(--line-soft); padding: 9px 12px; text-align: left; }
.spec-table th { background: #FAF7F1; width: 128px; color: var(--muted); font-weight: 500; }

.info-block { margin-top: 30px; }
.info-block h3 { font-size: 16px; margin: 0 0 10px; padding-left: 10px; border-left: 3px solid var(--brand); }
.info-block p { margin: 0 0 10px; color: #4A463F; }
.info-block ul { margin: 0; padding-left: 20px; color: #4A463F; }
.info-block li { margin-bottom: 5px; }

/* ---------- 购物车 / 结算 ---------- */
.panel { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px; }
table.cart { width: 100%; border-collapse: collapse; }
table.cart th { font-size: 13px; color: var(--muted); font-weight: 500; text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.cart td { padding: 14px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.cart .p { display: flex; align-items: center; gap: 12px; }
table.cart .p .pic { width: 62px; height: 62px; border-radius: 10px; overflow: hidden; background: #F4EFE8; flex: none; }
table.cart .p .n { font-size: 14px; flex: 1; min-width: 0; display: block; color: var(--ink); }
table.cart .p .n small { display: block; color: var(--muted); font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

.summary { width: 320px; flex: none; }
.summary .line { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 10px; color: #4A463F; }
.summary .line.total { font-size: 17px; color: var(--accent); font-weight: 700; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.checkout { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.checkout .main { flex: 1 1 420px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; height: 42px; padding: 0 12px; border: 1.5px solid var(--line);
  border-radius: 10px; background: #fff; font-size: 14px; outline: none; color: var(--ink); font-family: inherit;
}
.field textarea { height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.pay-methods { display: grid; gap: 10px; }
.pay-opt {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff;
}
.pay-opt.on { border-color: var(--brand); background: #F4F9F7; }
.pay-opt .ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; color: #fff; flex: none; }
.pay-opt .ic.wx { background: #22A05B; }
.pay-opt .ic.ali { background: #1678FF; }
.pay-opt b { font-size: 14.5px; font-weight: 600; }
.pay-opt small { display: block; color: var(--muted); font-size: 12px; }

.qr-box { text-align: center; padding: 18px 0 6px; }
.qr-box .qr { width: 210px; height: 210px; margin: 0 auto 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; overflow: hidden; }
.qr-box .qr img { width: 190px; height: 190px; }
.qr-box .tip { font-size: 13.5px; color: var(--muted); }
.qr-box .amt { font-size: 26px; color: var(--accent); font-weight: 700; margin: 4px 0 2px; }

.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty h3 { font-size: 17px; color: var(--ink); margin: 0 0 8px; }

/* ---------- 订单 ---------- */
.order-card { border: 1px solid var(--line-soft); border-radius: var(--radius); background: #fff; padding: 16px; margin-bottom: 12px; }
.order-card .hd { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.badge { padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.badge.pending { background: #FFF3E0; color: #B5721A; }
.badge.paid { background: #E8F4EC; color: #1F7A46; }
.badge.shipped { background: #E9F1FB; color: #1D5FA8; }

/* ---------- 页脚 ---------- */
footer.site { margin-top: 46px; background: #2B2A26; color: #CFC9BE; font-size: 13px; }
footer.site .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 26px; padding: 34px 0 24px; }
@media (max-width: 820px) { footer.site .cols { grid-template-columns: 1fr 1fr; } }
footer.site h4 { color: #F7F4EE; font-size: 14px; margin: 0 0 12px; font-weight: 600; }
footer.site ul { list-style: none; margin: 0; padding: 0; }
footer.site li { margin-bottom: 7px; }
footer.site a:hover { color: #fff; }
footer.site .co { line-height: 1.9; }
footer.site .legal { border-top: 1px solid #413F3A; padding: 16px 0 26px; font-size: 12.5px; color: #9A948A; line-height: 1.9; }

/* ---------- 通用 ---------- */
.note { background: #FFFDF7; border: 1px solid #EFE4CB; border-left: 3px solid var(--gold); border-radius: 8px; padding: 12px 14px; font-size: 13px; color: #6B6250; }
.prose { max-width: 860px; }
.prose h2 { font-size: 18px; margin: 26px 0 10px; }
.prose h3 { font-size: 15.5px; margin: 20px 0 8px; }
.prose p, .prose li { color: #4A463F; }
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: rgba(43, 42, 38, .94); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .22s ease; z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 720px) {
  .hero h1 { font-size: 23px; }
  .hero .cardno { flex: 1 1 100%; }
  .trust .wrap { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  header.site .wrap { height: auto; padding: 12px 20px; flex-wrap: wrap; gap: 10px; }
  .searchbox { order: 3; max-width: none; width: 100%; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card .name { font-size: 13.5px; min-height: 40px; }
  table.cart th:nth-child(2), table.cart td:nth-child(2),
  table.cart th:nth-child(5), table.cart td:nth-child(5) { display: none; }
  table.cart th:first-child, table.cart td:first-child { width: 56%; }
  table.cart .p { flex-direction: column; align-items: flex-start; gap: 6px; }
  table.cart .p .pic { margin-bottom: 4px; }
  .detail .gallery, .detail .thumbs { width: 100%; }
}
