/* 实体商城：响应式商品网格 + 详情 + 下单，品牌靛蓝 + 中性灰阶。 */
:root {
  --shop-brand: #4f46e5;
  --shop-brand-deep: #4338ca;
  --shop-ink: #1f2430;
  --shop-soft: #6b7280;
  --shop-line: #e7e9f0;
  --shop-bg: #f5f6fa;
  --shop-price: #e0462f;
}
.shop-app { min-height: 100vh; background: var(--shop-bg); color: var(--shop-ink); }
.shop-browse[hidden], .shop-detail[hidden], .shop-orders[hidden] { display: none; }

/* —— 头部 —— */
.shop-hero {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  padding: 34px 24px 46px;
  text-align: center;
  color: #fff;
}
.shop-hero h1 { font-size: 28px; margin: 0; letter-spacing: .02em; }
.shop-hero p { margin: 8px 0 22px; opacity: .85; font-size: 13px; }
.shop-search {
  display: flex; align-items: center; gap: 10px;
  max-width: 560px; margin: 0 auto;
  background: #fff; border-radius: 999px;
  padding: 11px 20px;
  color: var(--shop-soft);
}
.shop-search input { flex: 1; border: 0; outline: 0; font-size: 14px; background: transparent; color: var(--shop-ink); }
.shop-myorders-link {
  position: absolute; top: 16px; right: 22px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .18); color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  padding: 7px 15px; border-radius: 999px; font-size: 13px; font-weight: 700;
  cursor: pointer; backdrop-filter: blur(4px);
}
.shop-myorders-link:hover { background: rgba(255, 255, 255, .28); }
.shop-myorders-link svg { width: 15px; height: 15px; }
.shop-hero { position: relative; }

/* —— 分类芯片 —— */
.shop-cat-bar {
  display: flex; gap: 9px; flex-wrap: wrap;
  max-width: 1240px; margin: -22px auto 0; padding: 0 24px;
  position: relative;
}
.shop-cat {
  border: 1px solid var(--shop-line); background: #fff;
  padding: 8px 18px; border-radius: 999px; cursor: pointer;
  font-size: 13px; color: var(--shop-soft);
  box-shadow: 0 4px 14px rgba(20, 24, 40, .06);
  transition: all .15s ease;
}
.shop-cat.is-active { background: var(--shop-brand); border-color: var(--shop-brand); color: #fff; font-weight: 700; }

/* —— 网格 —— */
.shop-section-head { max-width: 1240px; margin: 24px auto 14px; padding: 0 24px; }
.shop-section-head span { font-size: 16px; font-weight: 800; }
.shop-grid {
  max-width: 1240px; margin: 0 auto; padding: 0 24px 40px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.shop-card {
  border: 0; background: #fff; border-radius: 14px; overflow: hidden;
  text-align: left; cursor: pointer; padding: 0;
  display: flex; flex-direction: column;
  box-shadow: 0 2px 10px rgba(20, 24, 40, .05);
  transition: transform .16s ease, box-shadow .16s ease;
}
.shop-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(20, 24, 40, .12); }
.shop-card-img { aspect-ratio: 1 / 1; background: #f0f1f5; overflow: hidden; }
.shop-card-img img { width: 100%; height: 100%; object-fit: cover; }
.shop-card-body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 7px; }
.shop-card-body h3 {
  font-size: 13.5px; line-height: 1.4; margin: 0; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 38px;
}
.shop-card-tags { display: flex; gap: 6px; }
.shop-tag {
  font-size: 11px; color: var(--shop-brand);
  background: rgba(79, 70, 229, .1); border-radius: 5px; padding: 2px 7px;
}
.shop-card-price { display: flex; align-items: baseline; gap: 7px; margin-top: auto; }
.shop-card-price b { color: var(--shop-price); font-size: 17px; }
.shop-card-price s { color: #b6bcc9; font-size: 12px; }
.shop-noimg {
  width: 100%; height: 100%; min-height: 120px; display: flex;
  align-items: center; justify-content: center; color: #c4c9d4;
}
.shop-empty { text-align: center; color: var(--shop-soft); padding: 50px 0; }

/* —— 详情 —— */
.shop-detail { min-height: 100vh; background: var(--shop-bg); padding-bottom: 78px; }
.shop-detail-scroll { max-width: 900px; margin: 0 auto; }
.shop-back {
  display: flex; align-items: center; gap: 3px;
  background: transparent; border: 0; color: var(--shop-soft);
  font-size: 14px; cursor: pointer; padding: 18px 24px 6px;
}
.shop-detail-gallery { background: #fff; }
.shop-main-img { display: block; width: 100%; max-height: 520px; object-fit: contain; background: #fff; }
.shop-thumbs { display: flex; gap: 10px; padding: 14px 24px; overflow-x: auto; }
.shop-thumb {
  width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent; padding: 0; cursor: pointer; background: #f0f1f5;
}
.shop-thumb.is-active { border-color: var(--shop-brand); }
.shop-thumb img { width: 100%; height: 100%; object-fit: cover; }
.shop-noimg.big { min-height: 320px; }
.shop-noimg.big svg { width: 56px; height: 56px; }

.shop-info { background: #fff; margin-top: 10px; padding: 20px 24px; }
.shop-price-row { display: flex; align-items: baseline; gap: 10px; }
.shop-now { color: var(--shop-price); font-size: 26px; font-weight: 800; }
.shop-price-row s { color: #b6bcc9; }
.shop-sales { margin-left: auto; color: var(--shop-soft); font-size: 12px; }
.shop-info h2 { font-size: 18px; margin: 12px 0 14px; line-height: 1.45; }
.shop-ship {
  display: flex; align-items: center; gap: 7px;
  color: var(--shop-soft); font-size: 13px; padding: 10px 0;
  border-top: 1px solid var(--shop-line);
}
.shop-spec-row, .shop-qty-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 12px 0; border-top: 1px solid var(--shop-line);
}
.shop-spec-row dt, .shop-qty-row dt { color: var(--shop-soft); font-size: 13px; width: 40px; padding-top: 7px; }
.shop-specs { display: flex; gap: 10px; flex-wrap: wrap; }
.shop-spec {
  border: 1px solid var(--shop-line); background: #fff;
  border-radius: 9px; padding: 8px 18px; cursor: pointer; font-size: 13px;
}
.shop-spec.is-active { border-color: var(--shop-brand); color: var(--shop-brand); font-weight: 700; background: rgba(79, 70, 229, .06); }
.shop-qty { display: flex; align-items: center; border: 1px solid var(--shop-line); border-radius: 9px; overflow: hidden; }
.shop-qty button { width: 38px; height: 36px; border: 0; background: #fff; font-size: 17px; cursor: pointer; color: var(--shop-ink); }
.shop-qty span { width: 48px; text-align: center; font-size: 14px; }

.shop-desc { background: #fff; margin-top: 10px; padding: 22px 24px 30px; }
.shop-desc h3 { margin: 0 0 14px; font-size: 16px; }
.shop-desc p { color: #3c4350; font-size: 14px; line-height: 1.8; margin: 0 0 10px; }
.shop-detail-img { display: block; width: 100%; border-radius: 10px; margin: 12px 0; }

/* —— 底部购买栏 —— */
.shop-buybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: #fff; border-top: 1px solid var(--shop-line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; gap: 16px;
  box-shadow: 0 -4px 18px rgba(20, 24, 40, .08);
}
.shop-buybar-price { color: var(--shop-price); font-size: 20px; font-weight: 800; }
.shop-buy-btn {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff; border: 0; border-radius: 999px;
  padding: 13px 46px; font-size: 15px; font-weight: 800; cursor: pointer;
}

/* —— 下单弹层 —— */
.shop-checkout {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(17, 20, 30, .5);
  display: flex; align-items: flex-end; justify-content: center;
}
.shop-checkout[hidden] { display: none; }
.shop-checkout-card {
  background: #fff; width: 100%; max-width: 560px;
  border-radius: 18px 18px 0 0; padding: 24px;
  max-height: 88vh; overflow-y: auto;
}
.shop-checkout-card h3 { margin: 0 0 18px; }
.shop-co-product { display: flex; gap: 12px; background: var(--shop-bg); border-radius: 12px; padding: 12px; margin-bottom: 16px; }
.shop-co-product img { width: 56px; height: 56px; border-radius: 9px; object-fit: cover; }
.shop-co-product p { margin: 5px 0 0; color: var(--shop-soft); font-size: 13px; }
.shop-checkout label { display: block; font-size: 13px; color: var(--shop-soft); margin-bottom: 14px; }
.shop-checkout input, .shop-checkout textarea {
  width: 100%; box-sizing: border-box; margin-top: 6px;
  border: 1px solid var(--shop-line); border-radius: 10px;
  padding: 11px 13px; font-size: 14px; outline: none; resize: vertical;
  font-family: inherit; color: var(--shop-ink);
}
.shop-checkout input:focus, .shop-checkout textarea:focus { border-color: var(--shop-brand); }
.shop-co-summary {
  display: grid; grid-template-columns: 1fr auto; gap: 9px 16px;
  padding: 16px 0; border-top: 1px solid var(--shop-line); font-size: 14px;
}
.shop-co-total { color: var(--shop-price); font-weight: 800; font-size: 16px; }
.shop-co-actions { display: flex; gap: 12px; }
.shop-co-actions button { flex: 1; border-radius: 999px; padding: 13px; font-size: 15px; font-weight: 800; cursor: pointer; }
.shop-co-cancel { background: var(--shop-bg); border: 1px solid var(--shop-line); color: var(--shop-soft); }
.shop-co-submit { background: var(--shop-brand); border: 0; color: #fff; }
.shop-form-err { color: var(--shop-price); font-size: 13px; margin-bottom: 10px; }
.shop-success { text-align: center; padding: 20px 0 10px; }
.shop-success svg { width: 60px; height: 60px; color: #16a34a; }
.shop-success h3 { margin: 14px 0 8px; }
.shop-success p { color: var(--shop-soft); font-size: 13px; margin: 4px 0; }
.shop-success-note { margin-bottom: 18px; }
.shop-success .shop-co-submit { width: 100%; }

/* —— 收货地址表单 —— */
.shop-checkout select {
  width: 100%; box-sizing: border-box; margin-top: 6px;
  border: 1px solid var(--shop-line); border-radius: 10px;
  padding: 11px 13px; font-size: 14px; outline: none;
  font-family: inherit; color: var(--shop-ink); background: #fff;
}
.shop-checkout select:disabled { background: var(--shop-bg); color: var(--shop-soft); }
.shop-checkout select:focus { border-color: var(--shop-brand); }
.addr-paste { display: flex; gap: 10px; align-items: stretch; margin-bottom: 16px; }
.addr-paste textarea { flex: 1; margin-top: 0; resize: none; }
.addr-paste-btn {
  flex: 0 0 auto; align-self: stretch; border: 0; border-radius: 10px;
  padding: 0 16px; background: var(--shop-brand); color: #fff;
  font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.addr-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.addr-form-grid label { margin-bottom: 12px; }
.addr-form-grid .addr-detail, .addr-remark { grid-column: 1 / -1; }
.addr-remark { margin-top: 2px; }
.addr-confirm-box { border: 1px solid var(--shop-line); border-radius: 12px; padding: 6px 16px; margin-bottom: 16px; }
.addr-confirm-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; font-size: 14px; }
.addr-confirm-row + .addr-confirm-row { border-top: 1px solid var(--shop-line); }
.addr-confirm-row span { color: var(--shop-soft); flex: 0 0 auto; }
.addr-confirm-row b { text-align: right; font-weight: 700; color: var(--shop-ink); }
.addr-change { background: #fff; border: 1px solid var(--shop-brand); color: var(--shop-brand); }
@media (max-width: 480px) {
  .addr-form-grid { grid-template-columns: 1fr; }
  .addr-paste { flex-direction: column; }
  .addr-paste-btn { padding: 11px; }
}

/* ================= 我的订单 ================= */
.orders-head {
  display: flex; align-items: center; gap: 14px;
  max-width: 860px; margin: 0 auto; padding: 22px 20px 10px;
}
.orders-head h2 { margin: 0; font-size: 20px; }
.orders-back {
  display: inline-flex; align-items: center; gap: 2px;
  background: #fff; border: 1px solid var(--shop-line);
  padding: 8px 14px; border-radius: 999px; font-size: 13px; cursor: pointer; color: var(--shop-ink);
}
.orders-back svg { width: 16px; height: 16px; }
.orders-list { max-width: 860px; margin: 0 auto; padding: 6px 20px 50px; display: grid; gap: 16px; }
.orders-loading { text-align: center; padding: 70px 0; color: var(--shop-soft); }
.orders-loading .shop-spinner, .shop-spinner {
  width: 30px; height: 30px; border: 3px solid var(--shop-line);
  border-top-color: var(--shop-brand); border-radius: 50%; margin: 0 auto 12px;
  animation: shop-spin .8s linear infinite;
}
@keyframes shop-spin { to { transform: rotate(360deg); } }

.order-card {
  background: #fff; border: 1px solid var(--shop-line);
  border-radius: 16px; padding: 16px 18px;
}
.order-card-top {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px; border-bottom: 1px solid var(--shop-line);
}
.order-no { font-size: 12px; color: var(--shop-soft); word-break: break-all; }
.order-status {
  font-size: 13px; font-weight: 800; padding: 4px 12px; border-radius: 999px;
}
.order-status.pending { background: #fef3e2; color: #b45309; }
.order-status.shipped { background: #e8edff; color: #3f46d6; }
.order-status.delivered { background: #e6f7ec; color: #15803d; }

.order-product { display: flex; gap: 14px; align-items: center; padding: 14px 0; }
.order-product img { width: 62px; height: 62px; border-radius: 10px; object-fit: cover; }
.order-noimg {
  width: 62px; height: 62px; border-radius: 10px; background: var(--shop-bg);
  display: flex; align-items: center; justify-content: center; color: var(--shop-soft);
}
.order-noimg svg { width: 22px; }
.order-product-info { flex: 1; min-width: 0; display: grid; gap: 5px; }
.order-product-info b { font-size: 14px; font-weight: 700; }
.order-product-info span { font-size: 13px; color: var(--shop-soft); }
.order-amount { font-size: 16px; font-weight: 800; color: var(--shop-ink); white-space: nowrap; }

.order-ship-meta {
  display: flex; align-items: center; gap: 8px;
  background: var(--shop-bg); border-radius: 10px; padding: 9px 12px;
  font-size: 13px; color: var(--shop-soft);
}
.order-ship-meta svg { width: 16px; height: 16px; flex: none; }
.order-ship-meta em { margin-left: auto; font-style: normal; font-weight: 700; color: #3f46d6; }

/* 物流时间线 */
.order-logistics { padding: 14px 2px 4px; }
.ol-pending { color: var(--shop-soft); font-size: 13px; }
.ol-no-trace { font-size: 13px; color: var(--shop-soft); display: grid; gap: 8px; }
.ol-web-link, .order-web { color: var(--shop-brand); font-size: 13px; font-weight: 700; }
.ol-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.ol-node { position: relative; padding: 0 0 18px 24px; }
.ol-node::before {
  content: ""; position: absolute; left: 5px; top: 12px; bottom: -2px;
  width: 2px; background: var(--shop-line);
}
.ol-node:last-child::before { display: none; }
.ol-dot {
  position: absolute; left: 0; top: 5px; width: 12px; height: 12px;
  border-radius: 50%; background: #c3c8d6; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--shop-line);
}
.ol-node.is-latest .ol-dot { background: var(--shop-brand); box-shadow: 0 0 0 1px var(--shop-brand); }
.ol-content p { margin: 0 0 4px; font-size: 13.5px; line-height: 1.55; color: var(--shop-ink); }
.ol-node:not(.is-latest) .ol-content p { color: var(--shop-soft); }
.ol-content time { font-size: 12px; color: var(--shop-soft); }

.order-card-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 12px; border-top: 1px solid var(--shop-line);
}
.order-refresh {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--shop-line); color: var(--shop-ink);
  padding: 8px 16px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.order-refresh svg { width: 14px; height: 14px; }
.order-refresh:disabled { opacity: .5; cursor: not-allowed; }
.order-refresh .is-spinning { animation: shop-spin .8s linear infinite; }
.order-web {
  display: inline-flex; align-items: center;
  border: 1px solid var(--shop-line); padding: 8px 16px; border-radius: 999px; text-decoration: none;
}

.orders-empty {
  text-align: center; padding: 60px 20px; color: var(--shop-soft);
}
.orders-empty svg { width: 52px; height: 52px; margin-bottom: 12px; }
.orders-empty p { margin: 0 0 18px; }
.shop-orders-go {
  background: var(--shop-brand); color: #fff; border: 0;
  padding: 11px 30px; border-radius: 999px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.orders-err { color: var(--shop-price); }
.shop-success-actions { display: flex; gap: 12px; }
.shop-success-actions button { flex: 1; }
.shop-success-orders {
  background: #fff; color: var(--shop-brand); border: 1px solid var(--shop-brand);
  border-radius: 999px; padding: 13px; font-size: 15px; font-weight: 800; cursor: pointer;
}

/* —— 响应式 —— */
@media (max-width: 640px) {
  .shop-hero { padding: 26px 18px 40px; }
  .shop-hero h1 { font-size: 23px; }
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 0 14px 30px; }
  .shop-cat-bar, .shop-section-head { padding: 0 14px; }
  .shop-info, .shop-desc { padding-left: 16px; padding-right: 16px; }
  .shop-buy-btn { padding: 12px 34px; }
  .shop-myorders-link { top: 12px; right: 14px; padding: 6px 12px; }
  .orders-list { padding: 6px 14px 40px; }
  .order-ship-meta { flex-wrap: wrap; }
  .order-ship-meta em { margin-left: 0; width: 100%; }
}

/* —— 多 SKU 详情 —— */
.shop-spec em { font-style: normal; color: var(--shop-price); font-weight: 700; margin-left: 4px; }
.shop-spec.is-soldout { color: var(--shop-soft); cursor: not-allowed; background: #f6f7fb; }
.shop-spec.is-soldout em { color: var(--shop-soft); }
.shop-sku-stock { margin: 0; font-size: 12.5px; color: var(--shop-soft); }
.shop-sku-stock.is-low { color: #d97706; font-weight: 700; }
.shop-pay-link {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff; text-decoration: none; border-radius: 999px;
  padding: 12px 30px; font-size: 15px; font-weight: 800; margin: 6px 0 16px;
}
.shop-pay-link svg { width: 19px; height: 19px; }

/* —— 后台 SKU 编辑器 —— */
.shop-sku-edit { display: block; }
.shop-sku-edit > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.shop-sku-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.shop-sku-row { display: grid; grid-template-columns: 1fr 130px 110px 38px; gap: 8px; align-items: center; }
.shop-sku-row input {
  width: 100%; border: 1px solid var(--shop-line); border-radius: 8px;
  padding: 8px 10px; font-size: 13px; background: #fff;
}
.shop-sku-del {
  border: 0; background: #fef2f2; color: #dc2626; border-radius: 8px;
  height: 36px; font-size: 16px; cursor: pointer;
}
.shop-sku-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.shop-sku-tools input {
  flex: 1; min-width: 180px; border: 1px solid var(--shop-line); border-radius: 8px; padding: 8px 10px; font-size: 13px;
}
