/* ============================================================
   多店铺商城 · 通用样式
   所有颜色通过 :root 变量控制，切换店铺时可整体换肤
   ============================================================ */

:root {
  --brand: #2C5FE0;
  --brand-dark: #1E44AD;
  --accent: #FF6B2C;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --text: #1F2937;
  --text-sub: #6B7280;
  --text-mute: #9CA3AF;
  --border: #EEF1F6;
  --radius: 12px;
  --maxw: 1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ---------------- 头部 ---------------- */

.hd {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.hd-in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.hd-logo {
  font-size: 17px;
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.hd-nav {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: var(--text-sub);
  overflow-x: auto;
  scrollbar-width: none;
}
.hd-nav::-webkit-scrollbar { display: none; }
.hd-nav a { white-space: nowrap; padding: 4px 0; border-bottom: 2px solid transparent; }
.hd-nav a.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------------- 主体 ---------------- */

.mn {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 0 40px;
}

/* ---------------- 首页 Hero ---------------- */

.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 36px 20px 32px;
  margin-bottom: 8px;
}

.hero h1 { font-size: 26px; font-weight: 800; letter-spacing: 0.5px; }
.hero-sub { margin-top: 6px; font-size: 14px; opacity: 0.92; }
.hero-notice {
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.7;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 10px 12px;
  opacity: 0.96;
}

/* ---------------- 区块 ---------------- */

.sec { padding: 18px 16px 4px; }

.sec-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.sec-hd h2 { font-size: 17px; font-weight: 700; }
.sec-hd .more { font-size: 13px; color: var(--text-sub); }

/* ---------------- 商品卡片 ---------------- */

.goods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 720px) {
  .goods { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
@media (min-width: 1040px) {
  .goods { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(31, 41, 55, 0.06);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:active { transform: scale(0.985); }

.card-img {
  aspect-ratio: 1 / 1;
  background: #F0F3F8;
  overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }

.card-bd { padding: 10px 10px 12px; display: flex; flex-direction: column; flex: 1; }
.card-bd h3 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}
.card-spec {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-price {
  color: var(--accent);
  font-size: 17px;
  font-weight: 700;
  margin: 8px 0 10px;
}
.card-price::first-letter { font-size: 13px; }
.card-btn {
  display: block;
  text-align: center;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  margin-top: auto;
}

/* ---------------- 分类 ---------------- */

.cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cat {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--card);
  color: var(--text-sub);
  border: 1px solid var(--border);
}
.cat.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------------- 服务承诺 ---------------- */

.promise { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 720px) { .promise { grid-template-columns: repeat(3, 1fr); } }

.promise-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border);
}
.promise-item h4 { font-size: 14px; color: var(--brand); margin-bottom: 4px; }
.promise-item p { font-size: 13px; color: var(--text-sub); line-height: 1.6; }

/* ---------------- 面包屑 ---------------- */

.crumb {
  padding: 12px 16px 0;
  font-size: 13px;
  color: var(--text-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crumb a { color: var(--text-sub); }

/* ---------------- 商品详情 ---------------- */

.detail {
  background: var(--card);
  margin: 12px 16px 0;
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .detail { grid-template-columns: 420px 1fr; }
  .detail-img { border-right: 1px solid var(--border); }
}

.detail-img { aspect-ratio: 1 / 1; background: #F0F3F8; }
.detail-img img { width: 100%; height: 100%; object-fit: cover; }

.detail-info { padding: 16px 16px 20px; }
.detail-info h1 { font-size: 19px; font-weight: 700; line-height: 1.45; }
.detail-price { color: var(--accent); font-size: 26px; font-weight: 800; margin: 10px 0 16px; }
.detail-price::first-letter { font-size: 16px; }

.detail-meta {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px 12px;
  font-size: 13.5px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.detail-meta dt { color: var(--text-mute); }
.detail-meta dd { color: var(--text-sub); word-break: break-all; }

.buy-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.buy-bar label { font-size: 13px; color: var(--text-mute); }
.buy-bar input[type="number"] {
  width: 74px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  text-align: center;
  background: var(--bg);
}
.btn-lg {
  flex: 1;
  min-width: 140px;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
}
.btn-lg:active { background: var(--brand-dark); }

.pay-tip {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-mute);
  background: #FFF9E8;
  border-radius: 8px;
  padding: 9px 12px;
}

/* ---------------- 正文块 ---------------- */

.prose {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 18px 24px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text-sub);
}
.prose h3 {
  font-size: 15px;
  color: var(--text);
  font-weight: 700;
  margin: 22px 0 8px;
}
.prose h3:first-child { margin-top: 0; }
.prose p { margin-bottom: 10px; }
.prose-lead { font-size: 16px; color: var(--text); font-weight: 600; }
.prose .big { font-size: 22px; font-weight: 700; color: var(--brand); }
.prose a { color: var(--brand); }

/* ---------------- 信息表 ---------------- */

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 10px 0 6px;
}
.info-table th,
.info-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.info-table th {
  width: 130px;
  color: var(--text-mute);
  font-weight: 400;
  background: #FAFBFD;
  white-space: nowrap;
}
.info-table tr:last-child th,
.info-table tr:last-child td { border-bottom: 0; }

/* ---------------- 下单 ---------------- */

.checkout {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
}
.co-goods {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.co-goods img {
  width: 84px; height: 84px;
  border-radius: 10px;
  object-fit: cover;
  background: #F0F3F8;
  flex-shrink: 0;
}
.co-goods h3 { font-size: 14.5px; font-weight: 600; }
.co-total { color: var(--accent); font-size: 19px; font-weight: 800; }

.pay-off {
  margin-top: 16px;
  background: #FFF9E8;
  border: 1px solid #FBE7B0;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: #8A6D1F;
  line-height: 1.8;
}
.pay-off strong { color: #7A5E12; }
.pay-off a { color: var(--brand); text-decoration: underline; }

.co-back { margin-top: 16px; font-size: 13.5px; }
.co-back a { color: var(--text-sub); }

/* ---------------- 空态 ---------------- */

.empty {
  background: var(--card);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-mute);
  font-size: 14px;
}
.empty a { color: var(--brand); }

/* ---------------- 页脚 ---------------- */

.ft {
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.ft-in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 20px 36px;
  text-align: center;
  font-size: 12.5px;
  line-height: 2;
  color: var(--text-sub);
}

.ft-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.ft .sep { margin: 0 6px; color: var(--text-mute); }
.ft a { color: var(--text-sub); }
.ft a:hover { color: var(--brand); }

.ft-icp { margin-top: 4px; }
.ft-icp a { color: var(--text-mute); }

.ft-links { margin-top: 10px; }
.ft-links a { color: var(--brand); }

.ft-copy {
  margin-top: 10px;
  color: var(--text-mute);
  font-size: 12px;
}

/* ---------------- 下单表单 ---------------- */

.co-form { margin-top: 6px; }

.co-form h3 {
  font-size: 15px;
  color: var(--text);
  margin: 20px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.field label {
  width: 74px;
  flex-shrink: 0;
  font-size: 13.5px;
  color: var(--text-mute);
  padding-top: 11px;
  line-height: 1.3;
}

.field .opt { font-size: 11.5px; color: var(--text-mute); }

.field input,
.field textarea {
  flex: 1;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14.5px;
  font-family: inherit;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}

.field input::placeholder,
.field textarea::placeholder { color: #BCC4D2; }

.form-err {
  background: #FFF1F0;
  border: 1px solid #FFCCC7;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: #A8071A;
  margin: 14px 0 4px;
  line-height: 1.7;
}
.form-err ul { margin: 6px 0 0 18px; }
.form-err li { line-height: 1.9; }

/* ---------------- 支付页 ---------------- */

.pay-panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 18px 24px;
}

.pay-ok {
  font-size: 17px;
  font-weight: 700;
  color: #07A65A;
  margin-bottom: 14px;
}

.pay-no { font-size: 13.5px; color: var(--text-sub); }
.pay-no b { color: var(--text); letter-spacing: 0.5px; }

.pay-amount { font-size: 14px; color: var(--text-sub); margin-top: 8px; }
.pay-amount b {
  color: var(--accent);
  font-size: 25px;
  font-weight: 800;
  margin-left: 4px;
}

.pay-methods { margin-top: 24px; }

.pay-methods h3 {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.pay-method {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.pm-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.pm-icon.alipay { background: #1677FF; }

.pm-body { flex: 1; min-width: 0; }
.pm-name { font-size: 14.5px; font-weight: 600; color: var(--text); }
.pm-desc { font-size: 12.5px; color: var(--text-mute); margin-top: 3px; }

.pm-tag {
  font-size: 11.5px;
  color: #8A6D1F;
  background: #FFF9E8;
  border: 1px solid #FBE7B0;
  border-radius: 4px;
  padding: 2px 7px;
  flex-shrink: 0;
  white-space: nowrap;
}

.pay-off {
  margin-top: 16px;
  background: #FFF9E8;
  border: 1px solid #FBE7B0;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: #8A6D1F;
  line-height: 1.9;
}
.pay-off p + p { margin-top: 4px; }
.pay-off strong { color: #7A5E12; }
.pay-off a { color: var(--brand); text-decoration: underline; }
.pay-tip-small { font-size: 12.5px; opacity: 0.88; }

.pay-info {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.95;
}
.pay-info h4 {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 6px;
}
.pay-note { color: var(--text-mute); }

/* ---------------- 打印时也保留主体信息 ---------------- */

@media print {
  .hd-nav, .card-btn, .btn-lg, .buy-bar { display: none; }
  body { background: #fff; }
}

/* ---------------- 协议勾选说明 & 订单查询 ---------------- */

.co-agree {
  margin: 14px 0 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-sub);
}
.co-agree a { color: var(--brand); text-decoration: underline; }

.ord-search {
  display: flex;
  flex-wrap: wrap;
  margin-top: 14px;
}
.ord-search input {
  flex: 1;
  min-width: 210px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #D1D5DB;
  border-radius: 10px;
  font-size: 14.5px;
  background: #fff;
  color: var(--text);
  margin: 0 10px 10px 0;
}
.ord-search .btn-lg {
  flex: none;
  min-width: 112px;
  height: 44px;
  padding: 0 20px;
  margin-bottom: 10px;
}

.ord-list { margin-top: 16px; }
.ord-card {
  display: block;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
}
.ord-top, .ord-mid, .ord-ft {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ord-no { font-size: 12.5px; color: var(--text-sub); font-family: monospace; }
.ord-st {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #FEF3C7;
  color: #B45309;
}
.ord-st.ok { background: #DCFCE7; color: #15803D; }
.ord-mid { margin: 10px 0 8px; font-size: 15px; }
.ord-mid span { color: var(--text-sub); font-size: 13.5px; }
.ord-ft { font-size: 13px; color: var(--text-sub); }
.ord-amt { font-size: 16px; color: var(--accent); }
