/* 画作小店 - 买家前端样式（手机优先） */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --primary: #c96f4a;
  --primary-dark: #a85537;
  --bg: #faf6f2;
  --card: #ffffff;
  --text: #3b3230;
  --text-soft: #8a7d78;
  --danger: #d0453e;
  --warn-bg: #fff4e6;
  --warn-text: #9a6a1f;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(90, 60, 40, .10);
}
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
  max-width: 720px; margin: 0 auto;
  padding-bottom: 90px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  background: linear-gradient(135deg, #f6e7dc, #fdf3ec);
  padding: 14px 16px 12px;
  border-radius: 0 0 20px 20px;
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.topbar h1 { font-size: 20px; letter-spacing: 2px; }
.topbar-actions { display: flex; gap: 8px; }
.chip {
  border: 1px solid #e2c4b0; background: #fff; color: var(--primary-dark);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.chip:active { background: #f7e9e0; }
.topbar-tip { margin-top: 8px; font-size: 12px; color: var(--text-soft); }

/* ---------- 搜索 ---------- */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 14px 0; padding: 0 12px; height: 38px;
  background: #fff; border: 1px solid #e2c4b0; border-radius: 999px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(198, 124, 78, .12);
}
.search-icon { flex: 0 0 auto; color: var(--text-soft); }
.search-input {
  flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 14px; color: var(--text); font-family: inherit;
}
.search-input::placeholder { color: #b9a79b; }
.search-clear {
  flex: 0 0 auto; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%;
  background: #f1e5dc; color: var(--primary-dark); font-size: 11px; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.search-tip { padding: 8px 16px 0; font-size: 12px; color: var(--text-soft); }
.search-tip b { color: var(--primary-dark); }

/* ---------- 完成度筛选 ---------- */
.filter-bar {
  display: flex; gap: 8px; padding: 12px 14px 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-bar:empty { display: none; }
.filter-chip {
  flex: 0 0 auto; border: 1px solid #e2c4b0; background: #fff; color: var(--primary-dark);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.filter-chip:active { background: #f7e9e0; }
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.filter-chip.zero { opacity: .5; }
/* 「18+」是独立筛选开关：红色描边与完成度分类区分，可置灰不可用状态由 JS 控制显隐 */
.filter-chip.mature-chip {
  border: 1.5px dashed #d98b80; color: #c0392b; background: #fff8f6; font-weight: 600;
  padding: 5px 11px;
}
.filter-chip.mature-chip .filter-count { background: #fdecea; color: #c0392b; }
.filter-chip.mature-chip:active { background: #fdecea; }
.filter-chip.mature-chip.active {
  background: #c0392b; color: #fff; border-color: #c0392b; border-style: solid;
}
.filter-chip.mature-chip.active .filter-count { background: rgba(255,255,255,.25); color: #fff; }
.filter-chip.mature-chip:disabled { cursor: default; }
.filter-chip.mature-chip:disabled .filter-count { background: #f1e5dc; color: #b08b7d; }
.filter-sep { flex: 0 0 auto; align-self: center; width: 1px; height: 16px; background: #e9d8cd; margin: 0 1px; }
.filter-count {
  font-size: 11px; background: #f3e9e2; color: var(--primary-dark);
  border-radius: 999px; min-width: 18px; padding: 0 5px; line-height: 18px; text-align: center;
}
.filter-chip.active .filter-count { background: rgba(255,255,255,.25); color: #fff; }

/* ---------- 排序 ---------- */
.sort-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 14px 0;
}
.sort-label { font-size: 12px; color: var(--text-soft); margin-right: 2px; }
.sort-chip {
  border: 1px solid #e2c4b0; background: #fff; color: var(--primary-dark);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.sort-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.sort-chip.sold-toggle { margin-left: 4px; border-style: dashed; }
.sort-chip.sold-toggle b { margin-left: 2px; font-weight: 700; }
.sort-chip.sold-toggle.active { border-style: solid; }
.sort-chip.sold-toggle.active b { color: #fff; }
/* 未售出优先：反色描边，和「售出优先」的实心态一眼区分 */
.sort-chip.sold-toggle.is-unsold {
  background: #fff; color: var(--primary-dark);
  border-style: solid; border-color: var(--primary);
}
.sort-chip.sold-toggle.is-unsold b { color: var(--primary-dark); }
.sort-chip.sold-toggle .sold-arrow { font-size: 11px; opacity: .9; }
/* 当前分类/搜索范围内没有已售作品：置灰不可点，但按钮位置保留 */
.sort-chip.sold-toggle.zero,
.sort-chip.sold-toggle.zero.active,
.sort-chip.sold-toggle.zero.is-unsold {
  background: #fff; color: var(--text-soft); border-color: #ddd;
  border-style: dashed; opacity: .55; cursor: not-allowed;
}
.sort-chip.sold-toggle.zero b { color: var(--text-soft); }

/* ---------- 作品网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 16px 14px; }
.filter-bar + .grid,
.sort-bar + .grid { padding-top: 10px; }
/* 懒加载哨兵：占满整行，进入视口后自动追加下一批 */
.grid-sentinel {
  grid-column: 1 / -1; text-align: center; color: var(--text-soft);
  font-size: 12px; padding: 8px 0 22px;
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.work-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer; position: relative;
  transition: transform .15s ease;
}
.work-card:active { transform: scale(.98); }
.work-imgbox { position: relative; aspect-ratio: 1 / 1; background: #f1e8e1; }
.work-imgbox img { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-lock-mask {
  position: absolute; inset: 0; background: rgba(50, 35, 28, .55);
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; font-size: 12px; text-align: center; padding: 6px;
}
.work-lock-timer { font-size: 15px; font-weight: 700; letter-spacing: 1px; }
.work-sold-mask {
  position: absolute; inset: 0; background: rgba(40, 40, 40, .5);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 15px; letter-spacing: 4px;
}
/* 有买家名时改为上下两行：已售出 / 买家：天****（小字、取消字距） */
.work-sold-mask.has-buyer { flex-direction: column; gap: 4px; }
.work-sold-mask .sold-buyer {
  font-size: 11px; line-height: 1.2; letter-spacing: 0;
  opacity: .92; padding: 0 6px; text-align: center;
}
/* 已加入购物车的作品：边框高亮 + 图片角标 */
.work-card.in-cart { box-shadow: 0 0 0 2px var(--primary), var(--shadow); }
.work-cart-tag {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  background: var(--primary); color: #fff; border-radius: 999px;
  padding: 3px 9px; font-size: 11px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(120, 60, 30, .3);
}
.work-info { padding: 8px 10px 10px; }
.work-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-meta { margin-top: 4px; display: flex; align-items: center; justify-content: space-between; }
.tag {
  display: inline-block; background: #f3e9e2; color: var(--primary-dark);
  border-radius: 6px; padding: 2px 8px; font-size: 11px;
}
.tag-danger { background: #fdeceb; color: var(--danger); }
.tag-warn { background: var(--warn-bg); color: var(--warn-text); }
.tag-star { background: #fff6e3; color: #a76a00; }
.tag-level { background: #eef4fb; color: #2b5f95; }
.detail-levels { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.work-price { color: var(--primary); font-weight: 700; font-size: 15px; }
/* 列表卡片角标：难度星级（图片左上）与建议等级（信息区） */
.work-badge-star {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  background: rgba(255, 246, 227, .95); color: #a76a00;
  border-radius: 999px; padding: 2px 7px; font-size: 11px; line-height: 1.4;
  box-shadow: 0 2px 6px rgba(80, 50, 20, .16);
}
.work-badge-star span { color: #c9b28a; }
.work-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.work-tags .tag { font-size: 10px; padding: 1px 6px; }
.empty-tip { grid-column: 1 / -1; text-align: center; color: var(--text-soft); padding: 40px 0; font-size: 14px; }
.empty-sub { font-size: 12px; color: #b9a79b; }

/* ---------- 成人向（18+）标记与年龄确认 ---------- */
.tag-mature { background: #fdecea; color: #c0392b; border: 1px solid #f5c6c0; }
.work-badge-mature {
  position: absolute; left: 8px; bottom: 8px; z-index: 4;
  background: rgba(192, 57, 43, .92); color: #fff;
  border-radius: 999px; padding: 1px 7px; font-size: 10px; font-weight: 700;
  letter-spacing: .5px; line-height: 1.6;
}
.mature-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 10px 14px 0; padding: 10px 12px; border-radius: 12px;
  background: #fff3f0; border: 1px solid #f1c9bd; color: #8a3b23;
  font-size: 12px; line-height: 1.6;
}
.mature-banner .mb-text { flex: 1 1 60%; min-width: 0; }
.mature-banner b { color: #c0392b; }
.mature-banner .mb-btn {
  flex: 0 0 auto; border: 1px solid #d9584a; background: #c0392b; color: #fff;
  border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer;
}
.mature-sheet { text-align: center; }
.mature-badge {
  width: 62px; height: 62px; margin: 2px auto 10px; border-radius: 50%;
  background: #fdecea; border: 2px solid #f2b8b0; color: #c0392b;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 800; letter-spacing: -1px;
}
.mature-text { font-size: 13px; color: var(--text); line-height: 1.75; margin: 6px 0 4px; text-align: left; }
.mature-sub { font-size: 11px; color: var(--text-soft); line-height: 1.6; margin-bottom: 14px; }
.mature-no { margin-top: 8px; font-size: 12px; }
#ovMature { z-index: 180; }

/* ---------- 购物车悬浮按钮 ---------- */
.cart-fab {
  position: fixed; right: 16px; bottom: 18px; z-index: 60;
  border: none; border-radius: 999px; background: var(--primary); color: #fff;
  padding: 12px 18px; font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 20px rgba(180, 90, 50, .4);
  display: flex; align-items: center; gap: 8px;
}
.cart-fab:active { background: var(--primary-dark); }
.cart-fab-icon { display: inline-flex; align-items: center; justify-content: center; }
.cart-fab-icon svg { display: block; }
.cart-badge {
  background: #fff; color: var(--primary); border-radius: 999px;
  min-width: 20px; height: 20px; line-height: 20px; text-align: center; font-size: 12px; font-weight: 700;
}
.cart-fab-total { font-size: 14px; }
.cart-fab.bump { animation: cart-fab-bump .4s ease-out; }
@keyframes cart-fab-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); }
  70% { transform: scale(.94); }
  100% { transform: scale(1); }
}
/* 加入购物车：沿弧线飞向购物车的小图 */
.fly-to-cart {
  position: fixed; z-index: 300; width: 60px; height: 60px;
  border-radius: 10px; overflow: hidden; pointer-events: none;
  border: 2px solid #fff; object-fit: cover;
  box-shadow: 0 6px 18px rgba(120, 60, 30, .35);
}

/* ---------- 弹层 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30, 20, 15, .45);
  display: flex; align-items: flex-end; justify-content: center;
}
/* 登录弹层常由详情弹窗内触发（如点加购），层级需高于普通弹层 */
#ovAuth { z-index: 160; }
#ovMyOrders { z-index: 160; }
/* 订单详情由「我的订单」内打开，必须盖在其之上 */
#ovOrderDetail { z-index: 170; }
@media (min-width: 560px) { .overlay { align-items: center; } }
.sheet {
  background: var(--card); width: 100%; max-width: 720px;
  border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto; position: relative;
}
@media (min-width: 560px) { .sheet { border-radius: 20px; max-width: 460px; } }
.sheet-lg { max-height: 92vh; }
.sheet-head { font-size: 17px; font-weight: 700; text-align: center; margin-bottom: 10px; }
.sheet-tip { font-size: 12px; color: var(--text-soft); text-align: center; margin-bottom: 12px; }
.sheet-close {
  position: absolute; top: 12px; right: 12px; border: none; background: #f3ebe4;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 14px; color: var(--text-soft);
}

/* ---------- 表单 ---------- */
.input {
  width: 100%; border: 1px solid #e5d5c9; border-radius: 10px;
  padding: 11px 12px; font-size: 15px; background: #fffdfb; color: var(--text);
  outline: none; margin-bottom: 4px;
}
.input:focus { border-color: var(--primary); }
.textarea { resize: vertical; }
.form { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.form-label { font-size: 13px; color: var(--text-soft); }
.btn {
  border: none; border-radius: 12px; padding: 13px 16px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity .15s;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:active { background: var(--primary-dark); }
.btn.primary:disabled { background: #d8c7bc; cursor: not-allowed; }
.btn.ghost { background: #f3ebe4; color: var(--text); }
.btn-block { width: 100%; margin-top: 10px; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1; }

/* ---------- 详情 ---------- */
.detail-imgbox { border-radius: 14px; overflow: hidden; background: #f1e8e1; }
/* 详情图禁止点击/长按放大，避免误触 */
.detail-imgbox img {
  width: 100%; max-height: 46vh; object-fit: contain; display: block;
  cursor: default; pointer-events: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.detail-body { padding-top: 12px; }
.detail-name { font-size: 18px; margin-bottom: 8px; }
.detail-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.detail-desc { font-size: 14px; color: var(--text-soft); margin: 10px 0; white-space: pre-wrap; line-height: 1.6; }
/* 作画说明：详情页描述下方的一条浅色说明，用于说明成品与展示图的差异 */
.studio-note {
  position: relative; margin: 0 0 12px; padding: 9px 12px 9px 34px;
  background: #fdf6ef; border: 1px solid #f0e0d0; border-radius: 10px;
  font-size: 12.5px; line-height: 1.6; color: #8a6a4e; word-break: break-word;
}
.studio-note::before {
  content: '✎'; position: absolute; left: 11px; top: 8px;
  font-size: 13px; color: var(--primary); opacity: .85;
}
.checkout-note {
  margin: 0 0 10px; padding: 9px 12px; border-radius: 10px;
  background: #fdf6ef; border: 1px dashed #e8d3bf;
  font-size: 12px; line-height: 1.6; color: #8a6a4e;
}
.checkout-note::before { content: '✎ 请确认知悉：'; font-weight: 700; color: var(--primary-dark); }
/* 参考图：仅展示，不可点击放大 */
.detail-reference { margin: 12px 0; }
.ref-title { font-size: 13px; color: var(--text-soft); margin-bottom: 6px; }
.detail-reference img {
  display: block; width: 100%; max-width: 72%; max-height: 24vh; object-fit: contain;
  margin: 0 auto; border-radius: 10px; background: #f7f3ef; cursor: default;
  -webkit-touch-callout: none; user-select: none;
}
.lockbox {
  background: var(--warn-bg); border-radius: 10px; padding: 10px 12px;
  margin: 10px 0; font-size: 13px; color: var(--warn-text); line-height: 1.6;
}
.lock-timer b { color: var(--danger); font-variant-numeric: tabular-nums; }

.option-list { margin: 8px 0; }
.option-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.option-notice {
  display: flex; align-items: flex-start; gap: 7px;
  background: var(--warn-bg); border: 1px solid #ffd7a8; border-left: 3px solid var(--primary);
  border-radius: 8px; padding: 7px 10px; margin: 0 0 10px;
  color: var(--warn-text); font-size: 13px; font-weight: 600; line-height: 1.5;
}
.option-notice::before {
  content: '说明'; flex: none; background: var(--primary); color: #fff;
  border-radius: 4px; padding: 1px 5px; font-size: 11px; font-weight: 700; line-height: 1.6;
}
.option-item {
  display: flex; align-items: center; gap: 8px;
  background: #fbf5f0; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
  cursor: pointer; font-size: 14px;
}
.option-item input { width: 18px; height: 18px; accent-color: var(--primary); }
.option-item .opt-name[data-opt-info] { cursor: help; }
.option-item .opt-info { cursor: help; color: var(--primary-dark); font-size: 14px; }
.option-item .opt-price { margin-left: auto; color: var(--primary); font-weight: 600; }
.option-item.checked { background: #f7e8de; }
.sheet-sm { max-width: 400px; }
.opt-info-desc { white-space: pre-wrap; line-height: 1.7; font-size: 14px; color: var(--text-soft); margin: 8px 0 4px; }
.detail-price-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-top: 1px dashed #e8d9cd; margin-top: 6px; font-size: 14px;
}
.price-big { color: var(--primary); font-size: 20px; font-weight: 800; }

/* 详情弹窗重设计：宽屏双栏压缩纵向长度，窄屏紧凑单栏 */
#ovDetail .sheet-lg { padding: 16px; }
.detail-layout { display: block; }
@media (min-width: 720px) {
  #ovDetail .sheet-lg { max-width: 860px; max-height: 90vh; overflow: hidden; }
  #ovDetail .detail-layout {
    display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    gap: 20px; align-items: center;
  }
  #ovDetail .detail-imgbox img { max-height: 58vh; }
  #ovDetail .detail-body { padding-top: 4px; max-height: 74vh; overflow-y: auto; padding-right: 8px; }
  #ovDetail .detail-foot {
    position: sticky; bottom: -16px; background: #fff; padding-top: 6px;
  }
}
@media (max-width: 719px) {
  /* 顶部按钮增多（积分商城）后改为换行，避免店名被挤成竖排 */
  .topbar-inner { flex-wrap: wrap; row-gap: 8px; }
  .topbar h1 { white-space: nowrap; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
  .auth-name { display: none; }
  .points-badge { white-space: nowrap; }
  #ovDetail .detail-imgbox img { max-height: 30vh; }
  #ovDetail .detail-body { padding-top: 8px; }
  #ovDetail .detail-desc { margin: 6px 0; font-size: 13px; }
  #ovDetail .option-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 8px; margin: 6px 0;
  }
  #ovDetail .option-title { grid-column: 1 / -1; margin-bottom: 2px; }
  #ovDetail .option-notice { grid-column: 1 / -1; margin-bottom: 6px; }
  /* 窄屏两列：每格内部改为「复选框 + 名称 + ⓘ」在上、价格独占一行右对齐。
     原 flex 单行在 ~160px 宽度里会把名称挤成两行、把「+¥15」拆成两截 */
  #ovDetail .option-item {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center; column-gap: 6px; row-gap: 2px;
    margin-bottom: 0; padding: 8px 10px; font-size: 13px;
  }
  #ovDetail .option-item input { grid-column: 1; grid-row: 1 / 3; }
  #ovDetail .option-item .opt-name {
    grid-column: 2; grid-row: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  #ovDetail .option-item .opt-info { grid-column: 3; grid-row: 1; justify-self: end; font-size: 12px; }
  #ovDetail .option-item .opt-price {
    grid-column: 2 / 4; grid-row: 2; justify-self: end;
    margin-left: 0; font-size: 12px; white-space: nowrap;
  }
  #ovDetail .detail-price-row { padding: 8px 0; margin-top: 2px; }
  #ovDetail .btn-block { margin-top: 6px; }
}

/* ---------- 购物车 ---------- */
.cart-list { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.cart-item {
  display: flex; gap: 10px; background: #fbf5f0; border-radius: 12px; padding: 10px;
}
.cart-item img { width: 62px; height: 62px; border-radius: 8px; object-fit: cover; }
.cart-item-main { flex: 1; min-width: 0; }
.cart-item-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-opts { font-size: 12px; color: var(--text-soft); margin-top: 3px; line-height: 1.5; }
.cart-item-price { color: var(--primary); font-weight: 700; margin-top: 3px; }
.cart-item-del {
  border: none; background: none; color: var(--text-soft); font-size: 13px;
  align-self: flex-start; cursor: pointer; padding: 2px 4px;
}
.cart-empty { text-align: center; color: var(--text-soft); padding: 30px 0; font-size: 14px; }
.cart-total-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 4px; font-size: 14px;
}
.checkout-summary {
  background: #fbf5f0; border-radius: 10px; padding: 10px 12px;
  font-size: 13px; color: var(--text-soft); line-height: 1.7; margin-bottom: 8px;
}

/* ---------- 支付 ---------- */
.pay-sheet { text-align: center; }
.pay-amount { margin: 6px 0 12px; font-size: 15px; }
.pay-qrcode {
  background: #fff; border: 1px solid #eee0d5; border-radius: 14px;
  padding: 12px; margin: 0 auto 12px; width: min(260px, 72vw);
}
.pay-qrcode img { width: 100%; display: block; }
.pay-code-box {
  margin: 0 auto 12px; max-width: 320px; padding: 10px 12px;
  background: #fff6e8; border: 1.5px solid #e8893f; border-radius: 12px;
}
.pay-code-label { font-size: 13px; font-weight: 700; color: #9a4b00; }
.pay-code-num {
  margin: 4px 0 2px; font-size: 30px; font-weight: 800; letter-spacing: 6px;
  color: #d1441f; font-variant-numeric: tabular-nums;
}
.pay-code-warn { font-size: 12px; color: #8a3b00; line-height: 1.5; text-align: left; }
.pay-code-box .btn { margin-top: 8px; }
.pay-notice { font-size: 13px; color: var(--warn-text); background: var(--warn-bg); border-radius: 10px; padding: 9px 12px; line-height: 1.6; }
.pay-meta { margin: 12px 0 4px; font-size: 12px; color: var(--text-soft); line-height: 1.8; }
.pay-meta span { color: var(--text); word-break: break-all; }

/* ---------- 查询结果 ---------- */
.query-result { margin-top: 12px; font-size: 13px; line-height: 1.8; background: #fbf5f0; border-radius: 10px; padding: 12px; }
.query-status { font-size: 15px; font-weight: 700; }
.query-pay-code { color: #c0441f; font-weight: 700; }

/* ---------- 登录 / 注册 ---------- */
.auth-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.auth-tab {
  flex: 1; border: none; background: #f3ebe4; color: var(--text-soft);
  padding: 10px 0; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.auth-tab.active { background: var(--primary); color: #fff; }
.auth-area { display: inline-flex; align-items: center; gap: 8px; }
.auth-name { font-size: 12px; color: var(--primary-dark); font-weight: 600; }

/* ---------- 下单门槛 ---------- */
.gate-tip {
  background: var(--warn-bg); color: var(--warn-text);
  border-radius: 10px; padding: 9px 12px; font-size: 12px; line-height: 1.6; margin-top: 8px;
}

/* ---------- 我的订单 ---------- */
.my-order { align-items: stretch; }
.my-order-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.my-order-total { color: var(--primary); font-weight: 700; font-size: 16px; }
.my-order-actions { margin-top: 6px; display: flex; gap: 8px; justify-content: flex-end; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.ship-info {
  background: #e9f3e9; color: #476647; border-radius: 8px;
  padding: 7px 10px; font-size: 12px; margin-top: 6px; line-height: 1.6; word-break: break-all;
}
.my-order-card { cursor: pointer; transition: background .15s, box-shadow .15s; }
.my-order-card:hover, .my-order-card:focus-visible { background: #f7e8de; box-shadow: inset 0 0 0 1px rgba(201,111,74,.35); outline: none; }
.order-hint { font-size: 12px; color: var(--warn-text); background: var(--warn-bg); border-radius: 6px; padding: 5px 8px; margin-top: 6px; line-height: 1.5; }

/* 订单详情弹层 */
.order-detail-sheet { max-height: 90vh; overflow-y: auto; }
.od-status { background: #fbf5f0; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.od-status-head { display: flex; align-items: center; justify-content: space-between; }
.od-status-head b { color: var(--primary); font-size: 18px; }
.od-status p { font-size: 12px; color: var(--text-soft); line-height: 1.6; margin-top: 6px; }
.od-steps { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.od-step {
  flex: 1; text-align: center; font-size: 11px; color: var(--text-soft);
  background: #f3ede8; border-radius: 20px; padding: 5px 2px; white-space: nowrap;
}
.od-step.done { background: #f7e8de; color: var(--primary-dark); }
.od-step.active { background: var(--primary); color: #fff; font-weight: 700; }
.od-items { margin-bottom: 10px; }
.od-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #e8d9cd; font-size: 13px; }
.od-item img { width: 46px; height: 46px; border-radius: 6px; object-fit: cover; background: #f3ede8; }
.od-item span { font-size: 12px; color: var(--text-soft); }
.od-meta { font-size: 12px; color: var(--text-soft); line-height: 1.9; word-break: break-all; }
.od-meta b { color: var(--text); }
.od-code b { color: var(--danger); font-size: 16px; font-variant-numeric: tabular-nums; }
.od-claimed { color: var(--primary-dark); font-weight: 600; }
.link-btn { border: none; background: none; color: var(--primary); font-size: 12px; cursor: pointer; padding: 0 4px; }
.od-actions { margin-top: 12px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%);
  background: rgba(50, 35, 28, .92); color: #fff; font-size: 14px;
  border-radius: 10px; padding: 10px 18px; z-index: 200; max-width: 86vw;
  line-height: 1.5; text-align: center;
}
/* 价格与购物车：仅登录后可见 */
body:not(.is-authed) .auth-only { display: none !important; }
.hidden { display: none !important; }

/* ---------- 18+ 未登录：模糊显示 + 登录引导 ---------- */
.work-imgbox { overflow: hidden; }
.work-imgbox.is-blurred img { filter: blur(11px); transform: scale(1.12); }
.work-blur-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 2; border: 0; border-radius: 999px; padding: 5px 12px;
  background: rgba(28, 20, 18, .74); color: #fff; font-size: 12px; font-weight: 600;
  line-height: 1.5; white-space: nowrap; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.work-blur-hint:active { background: rgba(28, 20, 18, .9); }

/* 详情页大图：未登录时模糊 + 居中登录卡 */
.detail-imgbox { position: relative; }
.detail-imgbox.is-blurred > img { filter: blur(14px); transform: scale(1.06); }
.detail-img-lock {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; padding: 14px;
  text-align: center; background: rgba(28, 20, 18, .4); color: #fff;
}
.detail-img-lock .dil-badge {
  background: rgba(192, 57, 43, .95); border-radius: 999px; padding: 2px 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
}
.detail-img-lock .dil-text { font-size: 13px; line-height: 1.6; }
.detail-img-lock .dil-btn { padding: 8px 18px; font-size: 13px; border-radius: 999px; margin-top: 2px; }
.detail-img-lock .dil-sub { font-size: 11px; opacity: .82; }
/* 已售作品的大图遮罩：与列表卡片同款，覆盖在 18+ 模糊/登录卡之上但不挡操作 */
.detail-img-sold {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: rgba(40, 40, 40, .5); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; letter-spacing: 4px; text-align: center;
}
.detail-img-sold.has-buyer { flex-direction: column; gap: 5px; }
.detail-img-sold .sold-buyer {
  font-size: 13px; line-height: 1.2; letter-spacing: 0;
  opacity: .92; padding: 0 8px;
}
/* 已售作品的加价项为只读快照：保留勾选高亮，去掉可点手感 */
.option-item.is-sold { cursor: default; }
.option-item.is-sold input { cursor: default; opacity: .9; }
.detail-reference.is-blurred img { filter: blur(10px); }

/* ---------- 积分商城 ---------- */
.points-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #f7e8de; color: var(--primary-dark);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600;
}
.points-badge b { font-size: 14px; }
.redeem-sheet .sheet-head { margin-bottom: 8px; }
.redeem-balance {
  background: #f7e8de; border-radius: 10px; padding: 10px 12px;
  font-size: 14px; color: var(--primary-dark); margin-bottom: 12px;
}
.redeem-balance b { font-size: 20px; margin: 0 4px; }
.redeem-balance span { font-size: 12px; opacity: .85; }
.redeem-shop-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px; margin: 10px 0 14px;
}
.redeem-card {
  background: #fbf5f0; border: 1px solid #eadfd3; border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; gap: 6px;
}
.redeem-card-name { font-weight: 700; font-size: 15px; }
.redeem-card-desc { font-size: 12px; color: var(--text-soft); line-height: 1.5; flex: 1; }
.redeem-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.redeem-card-cost { color: var(--primary); font-weight: 700; font-size: 13px; }
.my-redeem-list { display: flex; flex-direction: column; gap: 10px; }
.my-redeem-item { background: #fbf5f0; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.mri-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mri-points { color: var(--primary); font-weight: 700; }
.mri-time { font-size: 11px; color: var(--text-soft); margin-top: 4px; }
.mri-note { font-size: 12px; color: var(--text-soft); line-height: 1.5; margin-top: 5px; word-break: break-all; }
.mri-img { display: block; width: 100%; max-width: 260px; border-radius: 8px; margin-top: 8px; }
.mri-ref { display: inline-block; font-size: 12px; color: var(--primary); margin-top: 6px; }
.mri-addr {
  font-size: 12px; color: var(--text-soft); line-height: 1.6; margin-top: 6px;
  background: #f5ede4; border-radius: 8px; padding: 8px 10px; word-break: break-all;
}
/* 兑换表单 */
.rf-item { background: #f7e8de; border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 10px; }
.rf-required { color: #c0483f; }
.rf-upload { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rf-upload-tip { font-size: 11px; color: var(--text-soft); }
.rf-preview { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.rf-preview img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid #eadfd3; }
.rf-address-title {
  font-weight: 700; font-size: 14px; margin: 14px 0 6px;
  padding-top: 12px; border-top: 1px solid #eadfd3;
}
