/* ============================================================================
   购物车（展示页访客版专用）
   —— 只在公开静态展示页（ptcg.xhja.cn）生效；后台版（p.xhja.cn）由 cart.js
      直接不初始化，这里再加一层 body.admin 兜底，防止样式漏出去。
   与 app.css 分开：app.css 带了 ?v= 版本号、两处要一起改，新东西单独放更省心。
   ========================================================================== */

/* ---- 卡片上的「加入购物车」圆钮（🔴 2026-10-08 站长已取消，样式先留着）----
   原来浮在卡图右上角：一屏几十张卡就是几十个红点，看着乱。现在加购统一走
   「点开卡图 → 弹窗里选数量 → 加入购物车」——弹窗那个按钮挂的是 .lb-add
   （样式在 app.css），**不走下面这套**。
   `.ccard` 里已经不会再渲染 .addbtn 了（见 index.html 的 cardHTML）。
   这段保留只是万一要加回来，别当成还在用的样式。 */
.ccard .addbtn{
  position:absolute; right:6px; top:6px; z-index:3;
  width:28px; height:28px; border-radius:50%; border:none; cursor:pointer;
  background:rgba(255,255,255,.94); color:var(--down);
  display:flex; align-items:center; justify-content:center; padding:0;
  box-shadow:0 2px 8px -2px rgba(20,30,50,.35);
  opacity:0; transform:scale(.86);
  transition:opacity .16s ease, transform .16s ease, background .16s ease, color .16s ease;
}
.ccard:hover .addbtn{opacity:1; transform:scale(1)}
.ccard .addbtn:hover{background:var(--down); color:#fff}
.ccard .addbtn svg{width:16px; height:16px; pointer-events:none}
.ccard .addbtn.done{background:var(--up); color:#fff; opacity:1; transform:scale(1)}
/* 触屏没有 hover：常显，且稍微小一点 */
@media (hover:none){
  .ccard .addbtn{opacity:1; transform:scale(1); width:26px; height:26px}
}

/* ---- 顶栏右上角：查单入口 + 购物车入口 ----
   两个都在 header.top 里（它是 sticky，滚动时常驻）。
   ⚠ 容器 .top-actions 写在 index.html 的 header 里、**不在** <nav class="top-nav"> 内 ——
     发布到展示页时 publish._render_html 会把 nav 内容整段清空，写进去就一起没了。
   ⚠ 布局靠 nav.top-nav 的 margin-left:auto（app.css）把这一串顶到右边；
     展示页的 nav 被清空成 0 宽但仍在，同样能顶住，这里不要再加 margin-left:auto，
     否则两块 auto 会平分空档、把导航挤到中间去。 */
.top-actions{display:flex;align-items:center;gap:8px;white-space:nowrap}
.top-order{
  display:inline-flex;align-items:center;gap:5px;
  padding:7px 12px;border-radius:9px;border:1px solid var(--line);
  background:#fff;color:var(--ink2);font-size:13.5px;font-weight:600;
  transition:border-color .16s ease,color .16s ease,background .16s ease;
}
.top-order:hover{border-color:var(--brand);color:var(--brand-ink);background:var(--brand-soft)}
.top-cart{
  position:relative;display:inline-flex;align-items:center;justify-content:center;gap:6px;
  height:38px;padding:0 12px;border-radius:10px;border:1px solid var(--line);
  background:#fff;color:var(--ink2);cursor:pointer;
  font-size:13.5px;font-weight:600;
  transition:border-color .16s ease,color .16s ease,background .16s ease;
}
/* 图标后面那三个字（2026-10-08 站长要的）。窄屏会藏掉，见下面的媒体查询 */
.top-cart .t{white-space:nowrap}
.top-cart:hover{border-color:var(--brand);color:var(--brand-ink);background:var(--brand-soft)}
.top-cart svg{width:20px;height:20px;pointer-events:none}
.top-cart .n{
  position:absolute; top:-6px; right:-6px; min-width:19px; height:19px; padding:0 5px;
  border-radius:999px; background:var(--down); color:#fff;
  font-size:11px; font-weight:800; line-height:19px; text-align:center;
  box-shadow:0 2px 6px -1px rgba(217,58,58,.7);
}
/* 窄屏（手机）：查单和购物车都只留图标，别把顶栏挤换行 */
@media (max-width:640px){
  .top-order{padding:7px 9px}
  .top-order .t{display:none}
  .top-cart{padding:0 10px}
  .top-cart .t{display:none}
}

/* 右下角那颗浮动购物车圆球（.cart-fab）已废弃 —— 2026-10-05 站长：
   入口挪到顶栏右上角，和「查询我的订单」并排（见上面 .top-actions / .top-cart）。
   留着旧类名只会让人以为还有第二个人口。 */

/* ---- 抽屉 ---- */
.cart-mask{
  position:fixed; inset:0; z-index:70; background:rgba(18,24,36,.42);
  opacity:0; pointer-events:none; transition:opacity .2s ease;
}
.cart-mask.on{opacity:1; pointer-events:auto}
.cart-drawer{
  position:fixed; top:0; right:0; bottom:0; z-index:71;
  width:min(400px,94vw); background:var(--bg);
  display:flex; flex-direction:column;
  transform:translateX(102%); transition:transform .24s cubic-bezier(.4,0,.2,1);
  box-shadow:-14px 0 40px -18px rgba(20,30,50,.4);
}
.cart-drawer.on{transform:none}
.cd-head{
  flex:none; display:flex; align-items:center; gap:10px;
  padding:14px 16px; background:#fff; border-bottom:1px solid var(--line);
}
.cd-head b{font-size:15.5px}
.cd-head .x{
  margin-left:auto; width:30px; height:30px; border-radius:8px; border:none;
  background:var(--line2); color:var(--ink2); cursor:pointer; font-size:16px; line-height:1;
}
.cd-head .x:hover{background:var(--line)}
.cd-body{flex:1; overflow-y:auto; padding:12px 14px}
.cd-foot{
  flex:none; padding:12px 16px calc(14px + env(safe-area-inset-bottom));
  background:#fff; border-top:1px solid var(--line);
}

/* 空车 */
.cd-empty{text-align:center; color:var(--ink3); padding:56px 20px; font-size:13.5px; line-height:1.9}
.cd-empty .big{font-size:34px; display:block; margin-bottom:8px; opacity:.5}

/* 条目 */
.cd-item{
  display:flex; gap:10px; padding:11px; background:#fff; border:1px solid var(--line);
  border-radius:12px; margin-bottom:9px; box-shadow:var(--shadow);
}
.cd-item .pic{
  flex:none; width:52px; aspect-ratio:63/88; border-radius:6px; overflow:hidden;
  background:#f2f5fa; box-shadow:0 1px 4px -1px rgba(20,30,50,.25);
}
.cd-item .pic img{width:100%; height:100%; object-fit:contain; display:block}
.cd-item .pic .nb{display:flex; align-items:center; justify-content:center;
  height:100%; font-size:9px; color:var(--ink3); text-align:center; padding:3px}
.cd-item .mid{flex:1; min-width:0; display:flex; flex-direction:column; gap:3px}
.cd-item .nm{font-weight:700; font-size:12.5px; line-height:1.35;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden}
.cd-item .mt{font-size:10.5px; color:var(--ink3); overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap}
.cd-item .gr{font-size:10.5px; color:var(--warn); font-weight:600}
.cd-item .row{display:flex; align-items:center; gap:8px; margin-top:auto}
.cd-item .pr{font-weight:800; color:var(--price); font-size:13.5px; font-variant-numeric:tabular-nums}
.cd-item .pr small{font-size:10.5px; color:var(--ink3); font-weight:500; margin-left:4px}
.cd-item .del{margin-left:auto; border:none; background:none; color:var(--ink3);
  cursor:pointer; font-size:11.5px; padding:2px 4px}
.cd-item .del:hover{color:var(--down)}
/* 数量步进 */
.step{display:inline-flex; align-items:center; border:1px solid var(--line); border-radius:8px; overflow:hidden; margin-left:auto; background:#fff}
.step button{width:26px; height:24px; border:none; background:#fff; color:var(--ink2);
  font-size:15px; line-height:1; cursor:pointer; padding:0}
.step button:hover{background:var(--line2)}
.step button:disabled{color:#cfd5de; cursor:not-allowed}
.step .v{min-width:26px; text-align:center; font-size:12.5px; font-weight:700; font-variant-numeric:tabular-nums}
.cd-item .warnline{font-size:10.5px; color:var(--down); font-weight:600}

/* 合计行 */
.cd-sum{display:flex; align-items:baseline; gap:8px; margin-bottom:10px}
.cd-sum .lbl{font-size:12.5px; color:var(--ink2)}
.cd-sum .amt{margin-left:auto; font-size:20px; font-weight:800; color:var(--price); font-variant-numeric:tabular-nums}
.cd-hint{font-size:11.5px; color:var(--ink3); line-height:1.6; margin-bottom:10px}

/* 按钮 */
.btn-main{
  width:100%; padding:12px; border-radius:11px; border:none; cursor:pointer;
  background:var(--brand); color:#fff; font-size:14.5px; font-weight:700;
  transition:background .16s ease, opacity .16s ease;
}
.btn-main:hover{background:var(--brand-ink)}
.btn-main:disabled{background:#c3cddd; cursor:not-allowed}
.btn-ghost{
  width:100%; padding:10px; border-radius:11px; cursor:pointer; margin-top:8px;
  background:transparent; border:1px solid var(--line); color:var(--ink2);
  font-size:13px; font-weight:600;
}
.btn-ghost:hover{background:#fff}

/* 结算表单 */
.cf label{display:block; font-size:12px; font-weight:700; color:var(--ink2); margin:11px 0 4px}
.cf label i{font-style:normal; color:var(--down)}
.cf input,.cf textarea{
  width:100%; padding:9px 11px; border:1px solid var(--line); border-radius:9px;
  font:inherit; font-size:13.5px; background:#fff; color:var(--ink);
}
.cf input:focus,.cf textarea:focus{outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft)}
.cf textarea{resize:vertical; min-height:58px}
.cf .tip{font-size:11px; color:var(--ink3); margin-top:4px; line-height:1.6}
.cf .recheck{
  display:flex; align-items:center; gap:9px; padding:10px 12px; border-radius:10px;
  background:var(--brand-soft); border:1px solid #cfe0fb; margin-bottom:4px;
  font-size:12px; color:var(--brand-ink);
}
.cf .recheck b{margin-left:auto; font-size:15px; font-variant-numeric:tabular-nums}

/* 表单里的条目回顾（紧凑版） */
.cf-mini{background:#fff; border:1px solid var(--line); border-radius:10px; padding:9px 11px; margin-bottom:6px}
.cf-mini div{display:flex; gap:8px; font-size:12px; color:var(--ink2); padding:2px 0}
.cf-mini div span:last-child{margin-left:auto; font-variant-numeric:tabular-nums; white-space:nowrap}

/* 订单点数小角标（加购成功时的 toast 沿用 app.css 的 .toast） */
