/* =========================================================
   青玉智枢 · 商品页
   承接 site.css 的新中式基调（纸墨 / 朱砂 / 宋体）
   ========================================================= */

.page-shop { background: var(--paper); }

/* ------------------------------ 页头 ------------------------------ */

.shop-head { padding: 78px 0 46px; position: relative; overflow: hidden; }
.shop-head::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 90% at 82% -10%, rgba(185, 138, 60, .13), transparent 70%),
    radial-gradient(50% 70% at 8% 0%, rgba(165, 18, 30, .07), transparent 70%);
  pointer-events: none;
}
.shop-head .wrap { position: relative; }
.shop-head h1 {
  font-size: clamp(34px, 5.2vw, 58px);
  line-height: 1.22;
  letter-spacing: .01em;
  margin: 16px 0 20px;
  font-weight: 600;
}
.shop-head .lede { max-width: 620px; margin-left: 0; text-align: left; }
.shop-head-meta {
  margin-top: 26px; display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--ink-50); letter-spacing: .04em;
}
.shop-head-meta b { color: var(--ink); font-weight: 600; }
.shop-head-meta .dot { color: var(--line-strong); }

/* ---------------------------- 商品网格 ---------------------------- */

.shop-body { padding: 0 0 92px; }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
}

.shop-loading {
  grid-column: 1 / -1; text-align: center; padding: 60px 0;
  color: var(--ink-50); letter-spacing: .1em; font-size: 14px;
}

/* 商品卡 */
.p-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 26px 24px 22px;
  display: flex; flex-direction: column;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
  overflow: hidden;
}
.p-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--crimson); transform: scaleY(0); transform-origin: top;
  transition: transform .4s var(--ease);
}
.p-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.p-card:hover::before { transform: scaleY(1); }

.p-badge {
  position: absolute; top: 0; right: 0;
  background: var(--crimson); color: #fff;
  font-size: 11.5px; letter-spacing: .16em;
  padding: 5px 13px 5px 15px;
  border-bottom-left-radius: 10px;
}
.p-badge.gold { background: var(--gold); }

/* 优惠角标（首单特惠 / 新人福利价） */
.p-promo {
  position: absolute; top: 0; left: 0;
  background: linear-gradient(135deg, var(--gold), #b8823a); color: #fff;
  font-size: 11.5px; letter-spacing: .12em;
  padding: 5px 13px 5px 15px;
  border-bottom-right-radius: 10px;
}

/* 商品图 */
.p-img {
  width: 100%; aspect-ratio: 16 / 9;
  margin: -26px -24px 18px;
  background: var(--paper-2);
  overflow: hidden;
}
.p-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.p-sub {
  font-size: 12.5px; color: var(--crimson); letter-spacing: .04em;
  margin: -4px 0 8px; line-height: 1.6;
}

/* 限购 / 资格提示 */
.p-limit {
  font-size: 12px; color: var(--ink-50);
  background: var(--crimson-wash); border: 1px solid rgba(165, 18, 30, .14);
  padding: 5px 10px; border-radius: 2px; margin-bottom: 12px;
  display: inline-block;
}

.p-model {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; letter-spacing: .1em; color: var(--crimson);
  margin-bottom: 12px;
}
.p-model::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--crimson); box-shadow: 0 0 0 3px rgba(165, 18, 30, .12);
}

.p-title {
  font-size: 21px; font-weight: 600; line-height: 1.4;
  margin: 0 0 8px; color: var(--ink);
}
.p-desc {
  font-size: 13.8px; line-height: 1.72; color: var(--ink-50);
  margin: 0 0 16px; min-height: 48px;
}

.p-spec { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.p-spec span {
  font-size: 12px; color: var(--ink-70);
  background: var(--paper-2); border: 1px solid var(--line);
  padding: 3px 10px; border-radius: 2px; letter-spacing: .04em;
}

.p-foot {
  margin-top: auto; padding-top: 16px; border-top: 1px dashed var(--line-strong);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px;
}
.p-price { line-height: 1.1; }
.p-price b {
  font-size: 30px; font-weight: 600; color: var(--crimson-deep);
  letter-spacing: -.01em;
}
.p-price b i { font-size: 17px; font-style: normal; margin-right: 2px; }
.p-price s {
  margin-left: 8px; font-size: 14px; color: var(--ink-30);
  text-decoration: line-through;
}
.p-price em {
  display: block; font-style: normal; font-size: 12px;
  color: var(--ink-30); margin-top: 5px; letter-spacing: .04em;
}

.p-buy {
  border: 1px solid var(--crimson); background: var(--crimson); color: #fff;
  padding: 11px 22px; border-radius: 2px; font-size: 14px; letter-spacing: .1em;
  transition: background .25s, transform .25s var(--ease), box-shadow .25s;
  white-space: nowrap;
}
.p-buy:hover { background: var(--crimson-deep); transform: translateY(-2px); box-shadow: 0 12px 26px -12px rgba(165, 18, 30, .6); }
.p-buy:disabled {
  background: var(--paper-2); color: var(--ink-30);
  border-color: var(--line); cursor: not-allowed; transform: none; box-shadow: none;
}

.p-card.is-off { opacity: .72; }
.p-card.is-off:hover { transform: none; box-shadow: none; }
.p-off {
  font-size: 12px; color: var(--ink-50); background: var(--paper-2);
  border: 1px solid var(--line); padding: 9px 12px; border-radius: 2px; margin-bottom: 14px;
}

/* ---------------------------- 我的订单 ---------------------------- */

.shop-orders { padding: 0 0 84px; }
.shop-orders-head {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--line);
}
.shop-orders-head h2 { font-size: 25px; font-weight: 600; margin: 0; }
.shop-orders-head .muted { font-size: 13px; color: var(--ink-50); letter-spacing: .04em; }

.shop-orders-list { display: flex; flex-direction: column; gap: 12px; }

.o-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px; align-items: center;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 3px; padding: 16px 20px;
  transition: border-color .3s, box-shadow .3s;
}
.o-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.o-main { min-width: 0; }
.o-title { font-size: 15.5px; font-weight: 600; margin-bottom: 5px; }
.o-sub {
  font-size: 12.5px; color: var(--ink-50); letter-spacing: .03em;
  display: flex; flex-wrap: wrap; gap: 6px 14px;
}
.o-sub code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; color: var(--ink-70);
  background: var(--paper-2); padding: 1px 7px; border-radius: 2px;
}
.o-amt { font-size: 17px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.o-amt-wrap { text-align: right; white-space: nowrap; }
.o-amt-wrap .o-origin {
  display: block; font-size: 12px; color: var(--ink-30);
  text-decoration: line-through; margin-top: 3px;
}
.o-pay-hint {
  font-size: 11.5px; color: var(--warn); margin-top: 4px; letter-spacing: .02em;
}
.o-promo {
  color: var(--crimson); background: var(--crimson-wash);
  border: 1px solid rgba(165, 18, 30, .16);
  padding: 1px 8px; border-radius: 2px;
}

.o-tag {
  font-size: 12px; letter-spacing: .08em; padding: 5px 13px; border-radius: 2px;
  white-space: nowrap; border: 1px solid transparent;
}
.o-tag.pending { background: #fdf3e3; color: #a2700f; border-color: rgba(162, 112, 15, .2); }
.o-tag.paid { background: var(--crimson-wash); color: var(--crimson); border-color: rgba(165, 18, 30, .18); }
.o-tag.granted { background: #eaf3ec; color: #2f7a48; border-color: rgba(47, 122, 72, .2); }
.o-tag.closed { background: var(--paper-2); color: var(--ink-50); border-color: var(--line); }

.o-empty {
  text-align: center; padding: 40px 0; color: var(--ink-50); font-size: 14px;
  background: var(--white); border: 1px dashed var(--line-strong); border-radius: 3px;
}

/* ---------------------------- 发货规则 ---------------------------- */

.shop-rules { padding: 0 0 96px; }
.rule-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px;
}
.rule {
  background: var(--white); border: 1px solid var(--line); border-radius: 3px;
  padding: 24px 22px; position: relative;
}
.rule-no {
  font-size: 13px; letter-spacing: .2em; color: var(--crimson);
  display: block; margin-bottom: 8px;
}
.rule h3 { font-size: 17.5px; font-weight: 600; margin: 0 0 8px; }
.rule p { font-size: 13.6px; line-height: 1.75; color: var(--ink-50); margin: 0; }

/* ---------------------------- 提示条 ---------------------------- */

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: rgba(23, 19, 15, .93); color: #fff;
  padding: 12px 24px; border-radius: 2px; font-size: 14px; letter-spacing: .04em;
  z-index: 90; box-shadow: var(--shadow-md); max-width: 88vw; text-align: center;
}
.toast.err { background: var(--crimson-deep); }
.toast[hidden] { display: none; }

/* ---------------------------- 响应式 ---------------------------- */

@media (max-width: 780px) {
  .shop-head { padding: 46px 0 30px; }
  .shop-grid { grid-template-columns: 1fr; gap: 16px; }
  .p-desc { min-height: 0; }
  .p-foot { flex-direction: column; align-items: stretch; gap: 14px; }
  .p-buy { width: 100%; }
  .o-item { grid-template-columns: 1fr; gap: 10px; }
  .o-tag { justify-self: start; }
  .shop-rules { padding-bottom: 64px; }
}
