/* ===================================================================
   CMS 3.0 电商模块样式（购物车 / 会员中心 / 结算 / 订单 / 支付）
   所有类名使用 shop- / account- / cart- / order- / buy- / pay- 前缀，
   不覆盖主题全局样式。品牌色 #b6f000。
   =================================================================== */

:root {
  --shop-brand: #b6f000;
  --shop-ink: #1b1d21;
  --shop-muted: #8a8f98;
  --shop-line: #e9ebee;
  --shop-bg: #f6f7f9;
  --shop-danger: #e45757;
  --shop-radius: 10px;
}

/* ---------- Header：账户 / 购物车图标 ---------- */
.shop-header-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-left: 6px;
  color: var(--shop-ink);
  font-size: 18px;
}
.shop-header-icon:hover { color: #000; }
.shop-cart-badge {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--shop-brand);
  color: #111;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.shop-cart-badge[hidden] { display: none; }

/* ---------- 产品详情：购买区 / 数量 ---------- */
.buy-box {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 10px;
  flex-wrap: wrap;
}
.qty-box {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--shop-line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.qty-box .qty-step {
  width: 38px;
  height: 42px;
  border: 0;
  background: var(--shop-bg);
  color: var(--shop-ink);
  font-size: 18px;
  cursor: pointer;
  transition: background .15s;
}
.qty-box .qty-step:hover { background: var(--shop-brand); }
.qty-box input {
  width: 56px;
  height: 42px;
  border: 0;
  text-align: center;
  font-size: 15px;
  -moz-appearance: textfield;
}
.qty-box input::-webkit-outer-spin-button,
.qty-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.attr-select.is-invalid { border-color: var(--shop-danger) !important; }

/* ---------- 通用区块 ---------- */
.shop-section { padding: 70px 0 90px; background: #fff; }
.form-alert {
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 14px;
}
.form-alert.error { background: #fdecec; color: #b43a3a; border: 1px solid #f5c6c6; }
.form-alert.success { background: #f2fbe0; color: #4d6d12; border: 1px solid #dcf0a6; }
.account-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--shop-muted);
}
.account-empty i { font-size: 46px; color: #cfd4da; margin-bottom: 16px; }
.account-empty h3, .account-empty p { margin-bottom: 18px; }

/* ---------- 登录 / 注册卡片 ---------- */
.account-section .account-box {
  max-width: 460px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--shop-line);
  border-radius: var(--shop-radius);
  padding: 34px 34px 28px;
  box-shadow: 0 10px 40px rgba(20, 30, 40, .05);
}
.account-box h3 { margin-bottom: 22px; font-size: 22px; }
.account-box .form-group { margin-bottom: 16px; }
.account-box input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--shop-line);
  border-radius: 8px;
  padding: 0 16px;
  font-size: 15px;
}
.account-box input:focus { border-color: var(--shop-brand); outline: none; }
.account-box .hp { position: absolute; left: -9999px; height: 0; opacity: 0; }
.account-switch { margin-top: 8px; font-size: 14px; color: var(--shop-muted); }
.account-switch a { color: var(--shop-ink); font-weight: 600; }

/* ---------- 会员中心布局 ---------- */
.account-layout {
  display: grid;
  grid-template-columns: 264px 1fr;
  gap: 28px;
  align-items: start;
}
.account-side {
  background: #fff;
  border: 1px solid var(--shop-line);
  border-radius: var(--shop-radius);
  overflow: hidden;
}
.account-side-name {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--shop-line);
  background: var(--shop-bg);
}
.account-side-name i { font-size: 30px; color: #b9c0c8; }
.account-side-name strong { display: block; font-size: 15px; }
.account-side-name span { font-size: 12px; color: var(--shop-muted); word-break: break-all; }
.account-menu { list-style: none; margin: 0; padding: 8px 0; }
.account-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  color: #444;
  font-size: 14.5px;
}
.account-menu li a:hover { background: var(--shop-bg); }
.account-menu li.active a { background: var(--shop-brand); color: #14150a; font-weight: 600; }
.account-menu i { width: 18px; text-align: center; }

.account-main {
  background: #fff;
  border: 1px solid var(--shop-line);
  border-radius: var(--shop-radius);
  padding: 26px 28px;
  min-width: 0;
}
.account-main-title { font-size: 20px; margin: 0 0 20px; }
.order-head { margin-bottom: 18px; }
.order-head .order-badge { margin-left: 10px; vertical-align: middle; }
.order-meta { display: flex; flex-wrap: wrap; gap: 20px; color: var(--shop-muted); font-size: 13.5px; }

/* ---------- 电商表格 ---------- */
.shop-table { width: 100%; border-collapse: collapse; }
.shop-table th, .shop-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--shop-line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}
.shop-table th { color: var(--shop-muted); font-weight: 600; background: var(--shop-bg); }
.shop-product-cell { display: flex; align-items: center; gap: 14px; min-width: 220px; }
.shop-product-cell img {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--shop-line);
  background: #fff;
}
.shop-product-cell a { color: var(--shop-ink); }
.shop-attrs { display: block; margin-top: 4px; font-size: 12.5px; color: var(--shop-muted); }
.stock-warn { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--shop-danger); }
.shop-link { color: var(--shop-ink); font-weight: 600; border-bottom: 1px solid var(--shop-brand); }

/* ---------- 订单状态徽标 ---------- */
.order-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.order-badge.status-pending  { background: #fff4e0; color: #b07416; }
.order-badge.status-paid     { background: #e8f7e8; color: #2f7d32; }
.status-shipped  { background: #e6f1ff; color: #1a5fc4; }
.status-done     { background: #eef2f6; color: #3d4650; }
.status-canceled { background: #f1f1f1; color: #8a8f98; }
.status-refunded { background: #fdecec; color: #b43a3a; }

/* ---------- 订单汇总 / 地址 ---------- */
.order-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  margin-top: 24px;
}
.order-totals .total-row,
.cart-summary .total-row,
.checkout-totals .total-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 14.5px;
  color: #555;
}
.total-row.grand {
  border-top: 1px solid var(--shop-line);
  margin-top: 8px;
  padding-top: 14px;
  font-size: 19px;
  font-weight: 700;
  color: var(--shop-ink);
}
.order-ship h4 { font-size: 15px; margin: 14px 0 8px; }
.order-ship p { color: #555; line-height: 1.8; font-size: 14px; }
.order-actions { margin-top: 24px; }

/* ---------- 地址簿 ---------- */
.address-form-box {
  background: var(--shop-bg);
  border-radius: var(--shop-radius);
  padding: 22px;
  margin-bottom: 30px;
}
.address-form .form-group { margin-bottom: 14px; }
.address-form input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--shop-line);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 14.5px;
  background: #fff;
}
.address-form-foot { display: flex; align-items: center; justify-content: space-between; }
.default-check { font-size: 14px; color: #555; display: inline-flex; align-items: center; gap: 6px; }
.address-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.address-card {
  position: relative;
  border: 1px solid var(--shop-line);
  border-radius: var(--shop-radius);
  padding: 18px 18px 14px;
}
.address-card.default { border-color: var(--shop-brand); box-shadow: 0 6px 20px rgba(182, 240, 0, .15); }
.default-tag {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--shop-brand);
  color: #14150a;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 12px;
}
.address-card strong { display: block; font-size: 15.5px; padding-right: 56px; }
.address-card .muted { color: var(--shop-muted); font-size: 13px; margin-left: 8px; }
.address-card p { color: #555; font-size: 13.5px; line-height: 1.7; margin: 8px 0 12px; }
.address-card-actions { display: flex; flex-wrap: wrap; gap: 16px; border-top: 1px dashed var(--shop-line); padding-top: 10px; }
.address-card-actions a, .address-card-actions button {
  font-size: 13px;
  color: #555;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.address-card-actions a:hover, .address-card-actions button:hover { color: var(--shop-ink); }
.address-card-actions button.danger { color: var(--shop-danger); }
.inline { display: inline; margin: 0; }

/* ---------- 购物车页 ---------- */
.cart-remove {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--shop-line);
  background: #fff;
  color: #888;
  cursor: pointer;
  transition: all .15s;
}
.cart-remove:hover { background: var(--shop-danger); border-color: var(--shop-danger); color: #fff; }
.cart-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.cart-links { display: flex; gap: 14px; flex-wrap: wrap; }
.shop-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border: 1px solid var(--shop-line);
  border-radius: 8px;
  background: #fff;
  color: var(--shop-ink);
  font-size: 14px;
  cursor: pointer;
}
.shop-btn-ghost:hover { border-color: var(--shop-brand); background: var(--shop-bg); }
.cart-summary {
  width: 340px;
  border: 1px solid var(--shop-line);
  border-radius: var(--shop-radius);
  padding: 20px 22px;
  background: var(--shop-bg);
}
.cart-summary .theme-btn { width: 100%; margin-top: 12px; text-align: center; }

/* ---------- 结算页 ---------- */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}
.checkout-card {
  border: 1px solid var(--shop-line);
  border-radius: var(--shop-radius);
  padding: 24px;
  margin-bottom: 22px;
  background: #fff;
}
.checkout-card h3 { font-size: 18px; margin: 0 0 18px; }
.checkout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.checkout-grid .full { grid-column: 1 / -1; }
.checkout-field { margin-bottom: 16px; }
.checkout-field label { display: block; font-size: 13.5px; color: #555; margin-bottom: 6px; }
.checkout-field input, .checkout-field textarea, .checkout-field select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--shop-line);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 14.5px;
  background: #fff;
}
.checkout-field textarea { height: auto; padding: 12px 14px; resize: vertical; }
.checkout-field input:focus, .checkout-field textarea:focus, .checkout-field select:focus {
  border-color: var(--shop-brand); outline: none;
}
.checkout-aside { position: sticky; top: 30px; }
.checkout-totals { border: 1px solid var(--shop-line); border-radius: var(--shop-radius); padding: 20px 22px; background: var(--shop-bg); margin-bottom: 18px; }
.checkout-mini-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--shop-line); font-size: 13.5px; }
.checkout-mini-item img { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; border: 1px solid var(--shop-line); }
.checkout-mini-item .cm-name { flex: 1; line-height: 1.4; }
.checkout-mini-item .cm-attrs { display: block; color: var(--shop-muted); font-size: 12px; }
.address-pick { margin-bottom: 14px; }
.address-pick label {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--shop-line);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 13.5px;
  margin-bottom: 10px;
}
.address-pick input { margin-top: 3px; }
.address-pick label.on { border-color: var(--shop-brand); background: #fbfef0; }

/* 支付方式 */
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-method { position: relative; }
.pay-method input { position: absolute; opacity: 0; }
.pay-method span.pay-card {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 16px;
  border: 1px solid var(--shop-line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14.5px;
  background: #fff;
}
.pay-method span.pay-card i { font-size: 18px; color: #6a7078; }
.pay-method input:checked + .pay-card {
  border-color: var(--shop-brand);
  background: #fbfef0;
  box-shadow: 0 4px 14px rgba(182, 240, 0, .18);
}
.pay-method input:checked + .pay-card i { color: var(--shop-ink); }
.pay-method input:focus-visible + .pay-card { outline: 2px solid var(--shop-brand); }
.offline-guide {
  margin-top: 18px;
  background: var(--shop-bg);
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
}
.place-order-btn { width: 100%; }

/* 成功页 */
.success-box { max-width: 640px; margin: 0 auto; text-align: center; padding: 40px 20px; }
.success-box .success-icon {
  width: 84px; height: 84px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--shop-brand);
  color: #14150a;
  font-size: 40px;
  line-height: 84px;
}
.success-box h2 { font-size: 28px; margin-bottom: 12px; }
.success-box .success-no { font-size: 16px; margin: 6px 0 4px; }
.success-box .success-actions { margin-top: 26px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.wechat-qr { text-align: center; margin: 18px 0; }
.wechat-qr img, .wechat-qr canvas { border: 1px solid var(--shop-line); border-radius: 10px; background: #fff; padding: 10px; }
.order-poll-note { font-size: 13px; color: var(--shop-muted); margin-top: 10px; }

/* 分页（主题若无覆盖） */
.styled-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; list-style: none; padding: 0; }
.styled-pagination a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 10px;
  border: 1px solid var(--shop-line); border-radius: 8px;
  color: var(--shop-ink); font-size: 14px;
}
.styled-pagination a:hover, .styled-pagination li.active a { background: var(--shop-brand); border-color: var(--shop-brand); }

/* ---------- 响应式 ---------- */
@media (max-width: 991px) {
  .account-layout, .checkout-layout { grid-template-columns: 1fr; }
  .checkout-aside { position: static; }
  .order-summary { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .shop-section { padding: 44px 0 60px; }
  .account-main, .checkout-card, .account-box { padding: 20px 16px; }
  .checkout-grid, .pay-methods { grid-template-columns: 1fr; }
  .shop-product-cell { min-width: 0; }
  .cart-summary { width: 100%; }
  .shop-product-cell img { width: 52px; height: 52px; }
  .shop-table th:nth-child(2), .shop-table td.cell-price { display: none; }
}
