/* ==========================================================================
   云端卡片商城 · 前台样式
   ========================================================================== */
:root {
  --ink:        #0b1020;
  --ink-2:      #1c2440;
  --muted:      #667091;
  --line:       #e6e9f2;
  --bg:         #f5f6fb;
  --card:       #ffffff;
  --primary:    #4a5cf5;
  --primary-2:  #7b5cff;
  --primary-dk: #3243d8;
  --ok:         #12b981;
  --warn:       #f59e0b;
  --bad:        #ef4444;
  --info:       #3b82f6;
  --radius:     18px;
  --radius-lg:  26px;
  --shadow-sm:  0 2px 8px rgba(16, 24, 64, .06);
  --shadow:     0 12px 32px rgba(16, 24, 64, .10);
  --shadow-lg:  0 28px 70px rgba(16, 24, 64, .18);
  --ring:       0 0 0 3px rgba(74, 92, 245, .16);
  --grad:       linear-gradient(135deg, #4a5cf5 0%, #7b5cff 55%, #a45cff 100%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* 背景光斑 */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.bg-orbs span:nth-child(1) { width: 520px; height: 520px; top: -180px; right: -120px; background: #b8c2ff; }
.bg-orbs span:nth-child(2) { width: 420px; height: 420px; top: 340px; left: -160px; background: #d6c6ff; opacity: .45; }
.bg-orbs span:nth-child(3) { width: 380px; height: 380px; bottom: -140px; right: 20%; background: #c3f0ff; opacity: .35; }
main, section, header, footer { position: relative; z-index: 1; }

/* ------------------------------------------------------------------ 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 12px;
  border: 1px solid transparent; background: #fff; color: var(--ink);
  font-weight: 600; font-size: 14px; letter-spacing: .01em;
  transition: transform .16s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn-lg { height: 52px; padding: 0 28px; border-radius: 14px; font-size: 15px; }
.btn-sm { height: 34px; padding: 0 14px; border-radius: 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px rgba(74, 92, 245, .32); }
.btn-primary:hover { box-shadow: 0 14px 30px rgba(74, 92, 245, .42); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .6; box-shadow: none; cursor: not-allowed; transform: none; }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink-2); box-shadow: var(--shadow-sm); }
.btn-outline:hover { border-color: #c9d0ea; transform: translateY(-1px); }
.btn-soft { background: #eef1ff; color: var(--primary-dk); }
.btn-soft:hover { background: #e3e8ff; }
.btn-ghost { background: rgba(255, 255, 255, .7); border-color: var(--line); color: var(--ink-2); }
.btn-ghost b { color: var(--primary-dk); }
.btn-text { background: transparent; color: var(--muted); padding: 0 8px; }
.btn-text:hover { color: var(--ink); }

/* ------------------------------------------------------------------ 顶栏 */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(245, 246, 251, .78);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(230, 233, 242, .8);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: var(--grad); color: #fff; box-shadow: 0 8px 18px rgba(74, 92, 245, .35);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; letter-spacing: .01em; }
.brand-text em { font-size: 11px; color: var(--muted); font-style: normal; letter-spacing: .18em; text-transform: uppercase; }
.site-nav { display: flex; gap: 26px; margin-left: 12px; }
.site-nav a { font-size: 14px; color: var(--ink-2); font-weight: 500; position: relative; padding: 6px 0; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px;
  background: var(--grad); border-radius: 2px; transition: right .24s ease;
}
.site-nav a:hover::after { right: 0; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ------------------------------------------------------------------ 页头 */
.page-head { padding: 48px 0 4px; }
.page-head h1 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 800; letter-spacing: -.03em; }
.page-head p { color: var(--muted); font-size: 15px; margin-top: 8px; }

/* ------------------------------------------------------------- 商品预览 */
.product-cta { display: flex; gap: 8px; }
.modal-xl { max-width: min(94vw, 1180px); }
.modal-preview .modal-card { width: auto; padding: 26px 26px 22px; }
.preview-title { font-size: 17px; margin-bottom: 14px; padding-right: 32px; }
.preview-body {
  display: grid; place-items: center; min-height: 0;
  background: transparent; border-radius: 14px; overflow: hidden;
  margin: 0 auto;
}
.preview-media {
  display: block; width: 100%; height: 100%; object-fit: contain;
  border-radius: 12px; background: #0b1020;
}
.preview-err { color: var(--bad); font-size: 13.5px; padding: 18px; }

/* ----------------------------------------------------------- 素材库 */
.material-title { font-size: 17px; margin-bottom: 6px; padding-right: 32px; }
.material-tip { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.material-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-height: 58vh; overflow-y: auto; padding-right: 2px; }
.material-item {
  position: relative; padding: 0; border: 2px solid transparent; border-radius: 12px;
  overflow: hidden; background: #f7f8fd; cursor: pointer; aspect-ratio: 1 / 1;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.material-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.material-item:hover { transform: translateY(-2px); border-color: #c9d0ea; box-shadow: var(--shadow-sm); }
.material-item:active { border-color: var(--primary); }
.material-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 13px; padding: 24px 0; }

/* ----------------------------------------------------------- 发货内容图文 */
.delivery-figure { margin: 10px 0; }
.delivery-figure img { display: block; max-width: 100%; border-radius: 10px; }
.delivery-extra p { margin: 4px 0; }

/* ------------------------------------------------------------------ 区块 */
.section { padding: 46px 0; }

/* ------------------------------------------------------------------ 商品 */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 22px; }
.product-card {
  background: var(--card); border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid rgba(230, 233, 242, .9); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: #dfe3f3; }
.product-media { position: relative; height: 172px; display: grid; place-items: center; overflow: hidden; }
.product-media.has-img img { width: 100%; height: 100%; object-fit: cover; }
.product-media.grad-1 { background: linear-gradient(135deg, #4a5cf5, #8f6bff); }
.product-media.grad-2 { background: linear-gradient(135deg, #0ea5e9, #22d3ee); }
.product-media.grad-3 { background: linear-gradient(135deg, #12b981, #5eead4); }
.product-media.grad-4 { background: linear-gradient(135deg, #f97316, #fbbf24); }
.media-mock { text-align: center; color: #fff; }
.mock-card {
  width: 128px; height: 78px; margin: 0 auto 12px; border-radius: 14px;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35);
  display: flex; align-items: center; gap: 10px; padding: 0 12px; backdrop-filter: blur(4px);
}
.mock-avatar { width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .75); }
.mock-text { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.mock-text i { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .8); }
.mock-text i:last-child { width: 60%; opacity: .7; }
.media-mock em { font-size: 12.5px; letter-spacing: .16em; font-style: normal; opacity: .92; }
.product-tag {
  position: absolute; top: 12px; left: 12px; height: 26px; padding: 0 10px; border-radius: 999px;
  background: rgba(11, 16, 32, .34); color: #fff; font-size: 11.5px; display: inline-flex; align-items: center;
  backdrop-filter: blur(6px);
}
.product-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product-body h3 { font-size: 17px; font-weight: 700; }
.product-sub { font-size: 13px; color: var(--muted); min-height: 38px; }
.product-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.product-fields li {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2);
  background: #f2f4fb; border-radius: 8px; padding: 4px 9px;
}
.product-fields svg { width: 13px; height: 13px; color: var(--ok); }
.product-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line); }
.price { font-size: 26px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.price em { font-size: 15px; font-style: normal; margin-right: 2px; color: var(--primary-dk); }
.btn-buy { height: 40px; padding: 0 18px; }
.product-meta { font-size: 12px; color: #98a1bd; }

/* ------------------------------------------------------------------ 查单 */
.query-panel {
  display: grid; grid-template-columns: .9fr 1.1fr; gap: 0;
  background: #fff; border-radius: var(--radius-lg); border: 1px solid rgba(230, 233, 242, .9);
  box-shadow: var(--shadow); overflow: hidden;
}
.query-copy { padding: 34px; background: linear-gradient(160deg, #0b1020, #1a2350 70%, #2a2f6b); color: #fff; }
.query-copy h2 { font-size: 24px; }
.query-copy p { color: #aab3d4; font-size: 14px; margin-top: 10px; max-width: 330px; }
.query-form { display: flex; gap: 12px; align-items: flex-end; margin-top: 26px; flex-wrap: wrap; }
.query-form .field { flex: 1; min-width: 190px; margin: 0; }
.query-copy .field label { color: #9fa8cd; }
.query-copy input { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #fff; }
.query-copy input::placeholder { color: #7d87ad; }
.query-result { padding: 26px 30px; max-height: 560px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.query-empty { display: grid; place-items: center; gap: 10px; padding: 40px 10px; color: #9aa3c0; text-align: center; }
.query-empty svg { width: 46px; height: 46px; color: #c7cee4; }
.query-empty small { font-size: 12px; }

/* ------------------------------------------------------------------ 订单卡片 */
.order-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: #fff; }
.order-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.order-card header b { font-size: 15px; }
.order-card header div { display: flex; flex-direction: column; }
.order-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; color: var(--muted); margin: 10px 0 12px; }
.order-meta i { font-style: normal; color: var(--ink-2); font-weight: 600; }
.order-err { font-size: 13px; color: var(--bad); }

.badge { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ok { background: rgba(18, 185, 129, .12); color: #0a8f66; }
.badge.warn { background: rgba(245, 158, 11, .14); color: #b26a00; }
.badge.bad { background: rgba(239, 68, 68, .12); color: #c92a2a; }
.badge.info { background: rgba(59, 130, 246, .12); color: #1e5edb; }
.badge.mute { background: #eef0f6; color: #6a7392; }

.code-box {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(120deg, #0b1020, #1b2450); color: #fff;
  border-radius: 14px; padding: 14px 18px; margin: 4px 0 12px;
}
.code-label { font-size: 11px; letter-spacing: .22em; color: #8e9ac4; }
.code-val { font-size: 21px; letter-spacing: .18em; font-weight: 700; }
.code-box .btn { margin-left: auto; background: rgba(255, 255, 255, .12); color: #fff; }
.code-box .btn:hover { background: rgba(255, 255, 255, .2); }

.delivery-extra { font-size: 13.5px; color: var(--ink-2); border-left: 3px solid #dfe3f3; padding: 4px 0 4px 14px; margin: 6px 0 4px; }
.delivery-extra img { border-radius: 10px; margin: 8px 0; max-width: 100%; }
.delivery-extra p { margin: 4px 0; }
.delivery-extra strong { color: var(--ink); }

/* ------------------------------------------------------------------ 表单 */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--bad); }
.field .opt { color: var(--muted); font-weight: 400; font-size: 11.5px; }
input[type="text"], input[type="password"], input[type="email"], input[type="url"],
input[type="number"], input[type="file"], select, textarea {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease;
  outline: none;
}
textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: #b9c2f0; box-shadow: var(--ring); }
input::placeholder { color: #a7aec7; }
input[readonly] { background: #f7f8fd; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ------------------------------------------------------------------ 模态 */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; visibility: hidden; }
.modal.open { visibility: visible; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(9, 13, 28, .42);
  backdrop-filter: blur(6px); opacity: 0; transition: opacity .24s ease;
}
.modal.open .modal-backdrop { opacity: 1; }
.modal-card {
  position: relative; width: 100%; background: #fff; border-radius: 24px;
  box-shadow: var(--shadow-lg); padding: 28px;
  transform: translateY(16px) scale(.985); opacity: 0;
  transition: transform .26s cubic-bezier(.2, .8, .3, 1), opacity .26s ease;
  max-height: calc(100vh - 48px); overflow-y: auto;
}
.modal.open .modal-card { transform: none; opacity: 1; }
.modal-sm { max-width: 430px; }
.modal-md { max-width: 520px; }
.modal-lg { max-width: 760px; }
.modal-x {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 10px;
  border: none; background: #f3f4fa; color: var(--muted); font-size: 20px; line-height: 1;
  display: grid; place-items: center; transition: background .2s ease, color .2s ease;
}
.modal-x:hover { background: #e9ebf6; color: var(--ink); }
.modal-card h3 { font-size: 20px; margin-bottom: 6px; }

/* 登录注册 */
.auth-tabs { display: flex; gap: 8px; background: #f3f4fa; padding: 5px; border-radius: 13px; margin-bottom: 20px; }
.auth-tab {
  flex: 1; height: 38px; border: none; border-radius: 10px; background: transparent;
  font-weight: 600; font-size: 14px; color: var(--muted); transition: all .2s ease;
}
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-form .btn { margin-top: 6px; }
.form-tip { font-size: 13px; color: var(--muted); text-align: center; margin-top: 14px; }
.form-tip a { color: var(--primary-dk); font-weight: 600; }

/* 下单 */
.order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-right: 34px; margin-bottom: 20px; }
.eyebrow { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.order-head h3 { font-size: 22px; margin-top: 4px; }
.order-price { font-size: 26px; font-weight: 800; letter-spacing: -.03em; color: var(--primary-dk); }
.order-price em { font-size: 15px; font-style: normal; margin-right: 2px; }
.order-section { border-top: 1px solid var(--line); padding: 18px 0 4px; }
.order-section:first-of-type { border-top: none; padding-top: 0; }
.order-section h4 { font-size: 14px; margin-bottom: 14px; color: var(--ink); }
.order-section h4 .req { color: var(--bad); }

.cover-row { display: grid; grid-template-columns: 178px 1fr; gap: 20px; align-items: start; }
.cover-preview {
  width: 178px; height: 178px; border-radius: 16px; border: 1px dashed #cdd4ea;
  background: #f7f8fd; display: grid; place-items: center; color: #a7aec7; font-size: 13px; overflow: hidden;
}
.cover-preview.has { border-style: solid; border-color: var(--line); }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-actions { display: flex; flex-direction: column; gap: 12px; }
.cover-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.cover-hint { font-size: 12.5px; color: var(--muted); }
.cover-url input { height: 42px; font-size: 12.5px; }
.seg { display: inline-flex; background: #f3f4fa; border-radius: 11px; padding: 4px; gap: 4px; width: fit-content; }
.seg-btn { border: none; background: transparent; height: 32px; padding: 0 16px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg-btn.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.pay-item {
  display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-radius: 13px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; transition: all .18s ease;
}
.pay-item:hover { border-color: #c9d0ea; }
.pay-item input { accent-color: var(--primary); width: 16px; height: 16px; }
.pay-item:has(input:checked) { border-color: var(--primary); box-shadow: var(--ring); background: #fbfbff; }
.pay-body { display: flex; flex-direction: column; line-height: 1.35; }
.pay-body b { font-size: 14px; }
.pay-body em { font-style: normal; font-size: 12px; color: var(--muted); }

.order-submit { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); padding-top: 18px; flex-wrap: wrap; }
.agree { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.agree input { accent-color: var(--primary); }

.order-result { padding-top: 4px; }
.result-head { margin-bottom: 16px; }
.result-head h3 { font-size: 20px; margin: 10px 0 6px; }
.result-head p { font-size: 13.5px; color: var(--muted); }
.result-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

/* 裁切 */
.crop-title { font-size: 19px; }
.crop-tip { font-size: 13px; color: var(--muted); margin: 6px 0 16px; }
.crop-stage { position: relative; width: 320px; max-width: 100%; aspect-ratio: 1 / 1; margin: 0 auto; border-radius: 16px; overflow: hidden; background: #0b1020; touch-action: none; cursor: grab; }
.crop-stage canvas { display: block; width: 100%; height: 100%; }
.crop-frame { position: absolute; inset: 18px; border: 2px solid rgba(255, 255, 255, .85); border-radius: 12px; box-shadow: 0 0 0 9999px rgba(11, 16, 32, .38); pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 12px; margin: 18px 0; font-size: 13px; color: var(--muted); }
.crop-zoom input[type="range"] { flex: 1; accent-color: var(--primary); }
.crop-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* 账户 */
.account-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; padding-right: 34px; }
.account-head h3 { font-size: 21px; margin-top: 4px; }
.account-balance { display: flex; align-items: center; gap: 12px; background: #f7f8fd; border-radius: 14px; padding: 10px 16px; }
.account-balance span { font-size: 12px; color: var(--muted); }
.account-balance b { font-size: 19px; color: var(--primary-dk); }
.account-balance b i { font-style: normal; }
.order-list { display: flex; flex-direction: column; gap: 14px; max-height: 58vh; overflow-y: auto; }

.amount-chips { display: flex; gap: 10px; flex-wrap: wrap; margin: -4px 0 14px; }
.chip { height: 34px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-2); transition: all .18s ease; }
.chip:hover { border-color: #c9d0ea; }
.chip.active { border-color: var(--primary); color: var(--primary-dk); background: #f5f6ff; }

/* ------------------------------------------------------------------ 反馈 */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 420px;
  background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 11px 16px;
  box-shadow: var(--shadow); font-size: 13.5px; color: var(--ink-2);
  opacity: 0; transform: translateY(-8px); transition: all .24s ease;
}
.toast.in { opacity: 1; transform: none; }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--info); flex: none; }
.toast.success .dot { background: var(--ok); }
.toast.error .dot { background: var(--bad); }
.toast.warn .dot { background: var(--warn); }

.loading { position: fixed; inset: 0; z-index: 200; display: none; place-items: center; background: rgba(245, 246, 251, .5); backdrop-filter: blur(2px); }
.loading.show { display: grid; }
.loading span {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(74, 92, 245, .2); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ 页脚 */
.site-footer { margin-top: 40px; border-top: 1px solid var(--line); background: #fff; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 0; flex-wrap: wrap; }
.footer-inner strong { font-size: 15px; }
.footer-inner p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.footer-links { display: flex; gap: 22px; font-size: 13px; color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

/* ---------------------------------------------------------------- 游客/提示 */
.guest-tip {
  display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px;
  background: #f1f4ff; border: 1px solid #e0e6ff; border-radius: 14px; padding: 12px 14px;
}
.guest-tip b { font-size: 13.5px; color: #2b3a8f; }
.guest-tip span { font-size: 12.5px; color: #5d6893; line-height: 1.6; }
.pay-tip { font-size: 12.5px; color: #b26a00; margin-top: 10px; }
.link-login {
  display: inline-block; background: none; border: none; padding: 8px 0 0; margin: 0;
  color: var(--primary-dk); font-size: 12.5px; font-weight: 600; text-align: left;
}
.link-login:hover { text-decoration: underline; }
.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-row input { flex: 1; min-width: 0; }
.btn-code { flex: none; height: 46px; padding: 0 14px; font-size: 13px; border-radius: 12px; }
.btn-code:disabled { opacity: .65; cursor: not-allowed; }
.mt-8 { margin-top: 8px; }
.only-sm { display: none !important; }
.tabbar { display: none; }

/* ------------------------------------------------------------------ 响应式 */
@media (max-width: 980px) {
  .page-head { padding: 36px 0 2px; }
  .query-panel { grid-template-columns: 1fr; }
  .cover-row { grid-template-columns: 140px 1fr; }
  .cover-preview { width: 140px; height: 140px; }
  .panel-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------- 手机端（≤720） */
@media (max-width: 720px) {
  .hide-sm { display: none !important; }
  .only-sm { display: inline-flex !important; }
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .wrap { width: calc(100% - 32px); }
  .site-nav { display: none; }
  .header-inner { height: 60px; gap: 10px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .brand-mark svg { width: 21px; height: 21px; }
  .brand-text strong { font-size: 15px; }
  .brand-text em { display: none; }
  .header-actions { gap: 8px; }
  .header-actions .btn { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }

  .page-head { padding: 26px 0 2px; }
  .page-head h1 { font-size: 23px; }
  .page-head p { font-size: 13px; margin-top: 6px; }

  .section { padding: 22px 0; }

  .product-grid { grid-template-columns: 1fr; gap: 14px; }
  .product-card { flex-direction: row; align-items: stretch; }
  .product-media { width: 124px; flex: none; height: auto; min-height: 132px; }
  .product-media .media-mock { transform: scale(.68); }
  .media-mock em { display: none; }
  .product-tag { top: 8px; left: 8px; height: 22px; font-size: 10.5px; padding: 0 8px; }
  .product-body { padding: 13px 14px; gap: 6px; }
  .product-body h3 { font-size: 15.5px; }
  .product-sub {
    font-size: 12.5px; min-height: 0; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .product-fields, .product-meta { display: none; }
  .product-foot { padding-top: 10px; }
  .price { font-size: 21px; }
  .price em { font-size: 13px; }
  .btn-buy { height: 36px; padding: 0 12px; font-size: 13px; }
  .product-cta { gap: 6px; }
  .product-cta .btn { flex: 1; }

  .query-copy { padding: 22px; }
  .query-copy h2 { font-size: 20px; }
  .query-copy p { font-size: 13px; }
  .query-form { margin-top: 16px; gap: 10px; }
  .query-form .btn { width: 100%; }
  .query-result { padding: 16px; max-height: none; }
  .order-card { padding: 14px; }

  .modal { padding: 0; place-items: end center; }
  .modal-card {
    border-radius: 22px 22px 0 0; max-height: 94dvh;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  }
  .modal.open .modal-card { animation: sheetIn .26s cubic-bezier(.2, .8, .3, 1); }
  @keyframes sheetIn { from { transform: translateY(32px); opacity: .55; } to { transform: none; opacity: 1; } }
  .modal-x { top: 10px; right: 10px; }
  .modal-sm, .modal-md, .modal-lg { max-width: none; }
  .modal-preview .modal-card { max-width: 96vw; padding: 16px 14px 14px; }
  .material-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 52vh; }
  .material-title { font-size: 15px; }
  .preview-title { font-size: 15px; margin-bottom: 10px; }
  .preview-body { min-height: 0; }

  .auth-tabs { margin-bottom: 16px; }
  .order-head { padding-right: 28px; gap: 10px; }
  .order-head h3 { font-size: 18px; }
  .order-price { font-size: 22px; }
  .order-section { padding: 16px 0 2px; }
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
  .cover-row { grid-template-columns: 1fr; gap: 14px; }
  .cover-preview { width: 100%; height: 176px; }
  .seg { width: 100%; }
  .seg-btn { flex: 1; }
  .cover-btns .btn { flex: 1; }
  .cover-hint { font-size: 12px; }
  .pay-methods { grid-template-columns: 1fr; gap: 10px; }

  .order-submit {
    position: sticky; bottom: 0; background: #fff;
    border-top: 1px solid var(--line); margin-top: 8px;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    flex-direction: column; align-items: stretch; gap: 10px;
  }
  .order-submit .btn { width: 100%; }
  .agree { font-size: 12px; }

  .crop-stage { width: 100%; }
  .crop-zoom { margin: 14px 0; }
  .crop-actions .btn { flex: 1; }

  .code-box { gap: 8px; padding: 12px 14px; }
  .code-label { font-size: 10.5px; }
  .code-val { font-size: 18px; letter-spacing: .12em; }
  .code-box .btn { margin-left: 0; width: 100%; }
  .result-actions { flex-direction: column; gap: 10px; }
  .result-actions .btn { width: 100%; }

  .account-head { padding-right: 28px; }
  .account-balance { width: 100%; justify-content: space-between; }
  .order-list { max-height: none; }

  .toast-wrap { top: auto; bottom: calc(74px + env(safe-area-inset-bottom)); width: calc(100% - 28px); }
  .toast { max-width: none; width: 100%; }

  .site-footer { margin-top: 24px; }
  .footer-inner { padding: 20px 0; gap: 12px; }
  .footer-links { gap: 16px; font-size: 12.5px; }

  /* 底部快捷导航 */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid rgba(230, 233, 242, .9);
  }
  .tab-item {
    flex: 1; height: 58px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    border: none; background: none; color: #98a1bd;
    font-size: 11px; font-weight: 600; text-decoration: none; font-family: inherit;
  }
  .tab-item svg { width: 21px; height: 21px; }
  .tab-item:active { color: var(--primary-dk); }
  .tabbar .tab-item:nth-child(1) svg { color: var(--primary); }
}

@media (max-width: 380px) {
  .product-media { width: 104px; min-height: 120px; }
  .product-body h3 { font-size: 14.5px; }
  .page-head h1 { font-size: 21px; }
}
