/* ==========================================================================
   简易商城 · 基于 Bootstrap 5.3 的主题定制
   ========================================================================== */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --bs-primary-rgb: 79, 70, 229;
  --bs-link-color: #4f46e5;
  --bs-link-hover-color: #4338ca;
  --bs-font-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bs-body-color: #111827;
  --bs-border-radius: .8rem;
  --bs-border-color: #e5e7eb;
  --ink: #111827;
  --muted: #6b7280;
  --soft: #f6f7fb;
}

/* 隐藏滚动条（保留滚动能力） */
html, body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar { width: 0; height: 0; display: none; }

body {
  background: var(--soft);
  font-family: var(--bs-font-sans-serif);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.card { border-radius: .9rem; border-color: var(--bs-border-color); box-shadow: 0 1px 2px rgba(17, 24, 39, .04); }

.btn-primary { --bs-btn-bg: #4f46e5; --bs-btn-border-color: #4f46e5; --bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca; }
.btn-outline-primary { --bs-btn-color: #4f46e5; --bs-btn-border-color: #c7d2fe; --bs-btn-hover-bg: #eef2ff; --bs-btn-hover-color: #4338ca; }
.form-control:focus, .form-select:focus { border-color: #a5b4fc; box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .15); }
.nav-pills .nav-link.active { background: var(--primary); }

/* ---------- 导航 ---------- */
.site-nav {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  box-shadow: 0 1px 0 rgba(17, 24, 39, .06);
}
.site-nav .navbar-brand { font-weight: 700; letter-spacing: -.02em; }
.brand-logo { width: 28px; height: 28px; border-radius: 8px; object-fit: contain; display: block; }
.site-nav .nav-link { font-size: 14.5px; color: var(--muted); }
.site-nav .nav-link:hover, .site-nav .nav-link.active { color: var(--ink); }
.site-nav .nav-link.active { font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 50%, #0e7490 110%);
  color: #fff;
  padding: 60px 0 66px;
  margin-bottom: 34px;
}
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero::before { width: 460px; height: 460px; background: rgba(255, 255, 255, .1); top: -200px; right: -60px; }
.hero::after { width: 320px; height: 320px; background: rgba(255, 255, 255, .07); bottom: -180px; left: -40px; }
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin: 0 0 10px; }
.hero p { margin: 0; opacity: .92; max-width: 640px; }
.hero .stat {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 14px;
  padding: 14px 18px;
  backdrop-filter: blur(6px);
}
.hero .stat strong { display: block; font-size: 24px; font-weight: 700; }
.hero .stat span { font-size: 13px; opacity: .85; }

/* ---------- 商品 ---------- */
.cat-bar .nav-link {
  border-radius: 999px; padding: 6px 16px; font-size: 14px;
  color: var(--muted); background: #fff; border: 1px solid var(--bs-border-color);
}
.cat-bar .nav-link.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }

.product-card {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  transition: transform .18s, box-shadow .18s;
  overflow: hidden;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(17, 24, 39, .1); }
/* 商品图完整显示，不做任何裁剪 */
.product-card .thumb {
  min-height: 120px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef2ff, #faf5ff); color: var(--primary); font-size: 30px;
  position: relative; overflow: hidden;
}
.product-card .thumb img { width: 100%; height: auto; max-width: 100%; object-fit: contain; display: block; }
.product-card .badge-type {
  position: absolute; left: 12px; top: 12px;
  background: rgba(17, 24, 39, .78); color: #fff;
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
}
.product-card .title { font-size: 15.5px; font-weight: 600; }
.product-card .sub { color: var(--muted); font-size: 13px; min-height: 38px; }
.price { font-size: 22px; font-weight: 700; color: #dc2626; letter-spacing: -.02em; }
.price small { font-size: 13px; font-weight: 600; }

/* ---------- 详情 ---------- */
.thumb-lg {
  min-height: 200px; border-radius: var(--bs-border-radius); overflow: hidden;
  background: linear-gradient(135deg, #eef2ff, #faf5ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 58px; color: var(--primary); border: 1px solid var(--bs-border-color);
}
.thumb-lg img { width: 100%; height: auto; max-width: 100%; object-fit: contain; display: block; }
.detail-doc { font-size: 14.5px; color: #374151; }
.detail-doc h1, .detail-doc h2, .detail-doc h3 { font-size: 16px; margin: 18px 0 8px; }
.detail-doc img { max-width: 100%; border-radius: 10px; margin: 8px 0; }

/* ---------- 官方品牌支付方式（横条） ---------- */
.pay-row {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--bs-border-color); border-radius: 12px;
  padding: 12px 14px; cursor: pointer; background: #fff;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.pay-row:hover { border-color: #c7d2fe; }
.pay-row.active {
  border-color: var(--brand, var(--primary));
  background: rgba(var(--brand-rgb, 79, 70, 229), .05);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 79, 70, 229), .12);
}
.pay-row .pay-logo { width: 26px; height: 26px; object-fit: contain; flex: 0 0 auto; }
.pay-row .pay-name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.pay-row .pay-desc { font-size: 12px; color: var(--muted); }
.pay-row .pay-check {
  margin-left: auto; flex: 0 0 auto;
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #d1d5db; color: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: .15s;
}
.pay-row.active .pay-check { background: var(--brand, var(--primary)); border-color: var(--brand, var(--primary)); color: #fff; }

/* ---------- 数量步进器 ---------- */
.qty-stepper {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--bs-border-color); border-radius: 10px; overflow: hidden; background: #fff;
}
.qty-stepper button {
  width: 38px; height: 40px; border: 0; background: #f9fafb;
  font-size: 16px; color: var(--ink); cursor: pointer; transition: .15s;
}
.qty-stepper button:hover { background: #eef2ff; color: var(--primary); }
.qty-stepper input {
  width: 54px; height: 40px; border: 0; text-align: center;
  font-weight: 600; color: var(--ink); box-shadow: none !important; background: #fff;
}
.qty-stepper input:focus { outline: none; }
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stepper input[type='number'] { -moz-appearance: textfield; appearance: textfield; }

/* ---------- 渐变主按钮 ---------- */
.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #6d28d9);
  border: 0; color: #fff;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background: linear-gradient(135deg, #4338ca, #5b21b6);
  color: #fff;
}
.btn-primary:disabled { background: linear-gradient(135deg, #4f46e5, #6d28d9); opacity: .6; }

/* ---------- 订单摘要 ---------- */
.order-summary {
  background: linear-gradient(135deg, #eef2ff, #faf5ff);
  border: 1px solid #e0e7ff; border-radius: 12px;
  padding: 12px 14px;
}

/* ---------- 发货内容 ---------- */
.deliver-url {
  font-size: 12px; color: var(--muted); margin-top: 6px; word-break: break-all;
  background: #f9fafb; border: 1px solid var(--bs-border-color); border-radius: 8px; padding: 7px 10px;
}
.deliver-code {
  background: #0f172a; color: #a5f3fc; font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 12px 14px; border-radius: 10px; margin-bottom: 10px; word-break: break-all;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.deliver-code .copy { font-size: 12px; color: #94a3b8; cursor: pointer; white-space: nowrap; }
.deliver-text {
  background: #f9fafb; border: 1px solid var(--bs-border-color);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
}

/* ---------- 弹窗（PC 居中） / 底部抽屉（移动端） ---------- */
.modal-header { border-bottom: 1px solid var(--bs-border-color); }
.modal-title { font-size: 16px; font-weight: 600; }
.sheet-grab { display: none; }
.pay-amount { text-align: center; margin-bottom: 14px; }
.pay-amount .num { font-size: 30px; font-weight: 700; color: #dc2626; letter-spacing: -.02em; }
.pay-amount .lbl { color: var(--muted); font-size: 13px; }
.pay-qr {
  display: flex; justify-content: center; padding: 14px;
  background: #f9fafb; border: 1px solid var(--bs-border-color); border-radius: 14px; margin-bottom: 14px;
}
.pay-qr img, .pay-qr canvas { width: 190px; height: 190px; display: block; }
.sheet-loading { text-align: center; padding: 26px 0; color: var(--muted); }
.spinner {
  width: 26px; height: 26px; margin: 0 auto 12px;
  border: 3px solid #e5e7eb; border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .modal-dialog {
    position: fixed; left: 0; right: 0; bottom: 0; margin: 0;
    width: 100%; max-width: 100%;
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.32, .72, 0, 1);
  }
  .modal.show .modal-dialog { transform: translateY(0); }
  .modal-content { border-radius: 20px 20px 0 0; border-bottom: 0; }
  .modal-dialog-scrollable { max-height: 86vh; }
  .modal-body { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
  .sheet-grab { display: block; width: 42px; height: 4px; border-radius: 99px; background: #d1d5db; margin: 8px auto 2px; }
  .modal-header { padding-top: 6px; border-radius: 20px 20px 0 0; }
}

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--bs-border-color);
  background: #fff; padding: 26px 0; color: var(--muted); font-size: 13px;
}

/* ---------- 其他 ---------- */
.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-state .bi { font-size: 40px; }
.auth-card { max-width: 420px; margin: 8vh auto; }
