/* ==========================================================
   My Global Mall — 商城前台样式
   主色：蓝 #1a6df0 / 强调 #ff6b35
   ========================================================== */
:root {
  --primary: #1a6df0;
  --primary-dark: #1356c4;
  --accent: #ff6b35;
  --text: #22262e;
  --muted: #6b7280;
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e5e8ee;
  --danger: #dc3545;
  --success: #16a34a;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(17, 24, 39, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶部公告 ---------- */
.topbar { background: var(--primary-dark); color: #fff; font-size: 13px; text-align: center; padding: 6px 16px; }

/* ---------- 头部 ---------- */
.header { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 18px; padding: 14px 0; }
.logo { font-size: 22px; font-weight: 800; color: var(--primary); white-space: nowrap; }
.logo span { color: var(--accent); }
.search-box { flex: 1; display: flex; }
.search-box input {
  flex: 1; padding: 10px 14px; border: 2px solid var(--border); border-right: none;
  border-radius: 8px 0 0 8px; font-size: 14px; outline: none; min-width: 0;
}
.search-box input:focus { border-color: var(--primary); }
.search-box button {
  padding: 10px 20px; background: var(--primary); color: #fff; border: 2px solid var(--primary);
  border-radius: 0 8px 8px 0; cursor: pointer; font-size: 14px;
}
.header-actions { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.header-actions a { color: var(--text); font-size: 14px; display: flex; align-items: center; gap: 5px; }
.cart-badge { background: var(--accent); color: #fff; border-radius: 20px; font-size: 12px; padding: 1px 7px; }

/* 语言切换 */
.lang-switch select {
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; background: #fff; color: var(--text); cursor: pointer;
}

/* ---------- 导航 ---------- */
.nav { background: var(--card); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; gap: 4px; overflow-x: auto; }
.nav-inner a {
  padding: 11px 16px; font-size: 14px; color: var(--text); white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.nav-inner a:hover, .nav-inner a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- 轮播 ---------- */
.banner { position: relative; overflow: hidden; border-radius: var(--radius); margin: 20px 0; height: 320px; background: linear-gradient(120deg, #eef4ff, #fdf0ea); }
.banner-track { display: flex; height: 100%; transition: transform .5s ease; }
.banner-slide { min-width: 100%; display: flex; align-items: center; justify-content: center; padding: 40px; text-align: center; background-size: cover; background-position: center; background-repeat: no-repeat; }
.banner-slide h2 { font-size: 30px; margin-bottom: 10px; color: var(--text); }
.banner-slide p { color: var(--muted); margin-bottom: 18px; }
.banner-dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.banner-dots button { width: 9px; height: 9px; border-radius: 50%; border: none; background: #cbd5e1; cursor: pointer; }
.banner-dots button.active { background: var(--primary); }

/* ---------- 区块标题 ---------- */
.section { margin: 28px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-size: 20px; font-weight: 700; }

/* ---------- 商品网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(17,24,39,.12); }
.card-img { aspect-ratio: 1/1; background: #f1f4f9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img .no-img { color: #9aa4b2; font-size: 13px; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-size: 14px; font-weight: 600; line-height: 1.4; height: 2.8em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-title a { color: var(--text); }
.card-price { display: flex; align-items: baseline; gap: 8px; }
.price { color: var(--accent); font-size: 18px; font-weight: 700; }
.price-old { color: var(--muted); font-size: 13px; text-decoration: line-through; }

/* 限时特惠（flash sale） */
.flash-card { position: relative; }
.flash-tag {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; box-shadow: 0 2px 6px rgba(255,107,53,.35);
}
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.stock-tag { font-size: 12px; color: var(--muted); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; padding: 9px 18px; border-radius: 8px; border: none;
  font-size: 14px; cursor: pointer; text-align: center; transition: background .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #e55a24; color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: #f0f5ff; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-danger { background: var(--danger); color: #fff; }

/* ---------- 商品详情 ---------- */
.detail-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin: 24px 0; }
.detail-gallery img { border-radius: var(--radius); width: 100%; }
.detail-info h1 { font-size: 26px; margin-bottom: 10px; }
.detail-meta { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.qty-row { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.qty-row input { width: 70px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; text-align: center; font-size: 15px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 20px; }
.detail-desc { background: var(--card); border-radius: var(--radius); padding: 22px; margin-bottom: 26px; box-shadow: var(--shadow); }
.detail-desc h2 { font-size: 17px; margin-bottom: 12px; }

/* ---------- 表格 / 列表 ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 12px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--border); }
.table th { background: #f8fafc; font-weight: 600; color: var(--muted); }
.table tr:last-child td { border-bottom: none; }

/* ---------- 购物车 ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; margin: 24px 0; }
.aff-2col { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; margin: 24px 0; }
.cart-item { display: flex; gap: 14px; align-items: center; padding: 14px; background: var(--card); border-radius: var(--radius); margin-bottom: 10px; box-shadow: var(--shadow); }
.cart-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.cart-item .ci-info { flex: 1; min-width: 0; }
.cart-item .ci-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.cart-item .ci-price { color: var(--muted); font-size: 13px; }
.cart-item .ci-qty input { width: 60px; padding: 6px; border: 1px solid var(--border); border-radius: 6px; text-align: center; }
.summary-card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); align-self: start; position: sticky; top: 90px; }
.summary-card .row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.summary-card .total-row { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; font-size: 17px; font-weight: 700; }

/* ---------- 物流轨迹 ---------- */
.logistics-box { font-size: 14px; }
.logistics-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.logistics-carrier { font-weight: 700; }
.logistics-state { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.logi-signed { background: #e6f7ec; color: #16a34a; }
.logi-delivering { background: #e0f2fe; color: #0284c7; }
.logi-transit { background: #fef3c7; color: #b45309; }
.logi-muted { background: #f1f4f9; color: #6b7280; }
.logistics-timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 2px solid var(--border); }
.logistics-item { position: relative; padding: 0 0 18px 0; }
.logistics-item:last-child { padding-bottom: 4px; }
.logistics-dot { position: absolute; left: -27px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; border: 2px solid #fff; box-shadow: 0 0 0 1px #cbd5e1; }
.logistics-item.current .logistics-dot { background: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.logistics-context { color: #1f2937; line-height: 1.5; }
.logistics-item.current .logistics-context { font-weight: 600; }
.logistics-time { color: var(--muted); font-size: 12px; margin-top: 3px; }
.logistics-empty { color: var(--muted); font-size: 13px; }

/* ---------- 表单 ---------- */
.form-card { background: var(--card); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); max-width: 560px; margin: 26px auto; }
.form-card h1 { font-size: 20px; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { min-height: 90px; resize: vertical; }
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; margin: 24px 0; }
.pay-option { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 8px; margin-bottom: 10px; cursor: pointer; }
.pay-option.selected { border-color: var(--primary); background: #f4f8ff; }
.pay-option input { accent-color: var(--primary); }

/* ---------- 提示 ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.alert-success { background: #ecfdf3; color: #166534; border: 1px solid #b8f0c9; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #c7dcff; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ---------- 订单状态 ---------- */
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.status-pending { background: #fff7ed; color: #c2410c; }
.status-paid { background: #eff6ff; color: #1d4ed8; }
.status-shipped { background: #ecfdf5; color: #047857; }
.status-completed { background: #f0fdf4; color: #15803d; }
.status-cancelled { background: #f3f4f6; color: #6b7280; }
.pay-pending { background: #fff7ed; color: #c2410c; }
.pay-paid { background: #f0fdf4; color: #15803d; }
.pay-failed { background: #fef2f2; color: #b91c1c; }
.pay-refunded { background: #f3f4f6; color: #6b7280; }

/* ---------- 空状态 ---------- */
.empty-state { text-align: center; padding: 60px 20px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty-state .icon { font-size: 46px; margin-bottom: 12px; }
.empty-state p { color: var(--muted); margin-bottom: 16px; }

/* ---------- 分页 ---------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; margin: 22px 0; }
.pagination ul { display: flex; gap: 6px; list-style: none; align-items: center; }
.pagination a, .pagination li span.page-btn {
  display: inline-block; min-width: 36px; padding: 7px 12px; border-radius: 7px; background: var(--card);
  border: 1px solid var(--border); font-size: 14px; color: var(--primary); text-align: center;
  transition: border-color .15s, background .15s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination li.active a { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.pagination li .disabled { opacity: .35; cursor: not-allowed; pointer-events: none; color: var(--muted); }
.pagination li.ellipsis { color: var(--muted); padding: 0 2px; }
.pagination .pagination-info { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ---------- 列表顶部信息（共 N 件商品） ---------- */
.list-meta { color: var(--muted); font-size: 13px; margin: 4px 0 18px; }

/* ---------- 页脚 ---------- */
.footer { background: #1c2331; color: #aab3c2; margin-top: 50px; font-size: 14px; }
.footer-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 30px; padding: 36px 0; }
.footer h4 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.footer a { color: #aab3c2; display: block; margin-bottom: 8px; }
.footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #2c3446; padding: 16px 0; text-align: center; font-size: 13px; }
.footer-bottom .footer-langs { margin-top: 8px; }
.footer-bottom .footer-langs a { display: inline; margin: 0 6px; font-size: 13px; }

/* ---------- 在线客服悬浮球（可拖动） ---------- */
.cs-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 9999;
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.cs-float:active { cursor: grabbing; }
.cs-wa { background: #25D366; }
.cs-link { background: #ff6b35; }

/* ---------- 响应式 ---------- */
/* 平板竖屏 / 窄窗口：单列化 */
@media (max-width: 860px) {
  .header-inner { flex-wrap: wrap; }
  .header-actions { flex-wrap: wrap; row-gap: 6px; }
  .search-box { order: 3; flex-basis: 100%; }
  .detail-wrap { grid-template-columns: 1fr; }
  .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .aff-2col { grid-template-columns: minmax(0,1fr); }
  .banner { height: 220px; }
  .banner-slide h2 { font-size: 22px; }
  .table th, .table td { padding: 10px 8px; font-size: 13px; }
}

/* 移动端底部 Tab 默认隐藏，仅 ≤600px 显示 */
.mobile-tabbar { display: none; }

/* 移动端布局（≤600px：手机）——两行头部 + 双列商品卡 + 底部 Tab + 大点击区 */
@media (max-width: 600px) {
  body { padding-bottom: 58px; } /* 底部 Tab 栏占位 */
  .container { padding: 0 12px; }

  /* 客服悬浮球：默认右上角（拖动后由 JS 记忆位置覆盖） */
  .cs-float { right: 14px; bottom: auto; top: 78px; width: 52px; height: 52px; font-size: 26px; }

  /* 头部两行：第一行 logo+搜索，第二行 语言/购物车/账户 */
  .header-inner { gap: 8px 10px; padding: 10px 0; }
  .logo { font-size: 20px; }
  .search-box { order: 2; flex: 1; flex-basis: auto; min-width: 0; }
  .search-box input { padding: 9px 12px; font-size: 14px; }
  .search-box button { padding: 9px 14px; font-size: 14px; }
  .header-actions { order: 3; flex-basis: 100%; justify-content: space-between; gap: 8px; }
  .header-actions a { font-size: 14px; }
  .lang-switch select { padding: 6px 8px; font-size: 13px; }
  .nav-inner a { padding: 12px 14px; font-size: 14px; }

  /* 横幅 */
  .banner { height: auto; margin: 14px 0; }
  .banner-slide { padding: 0; aspect-ratio: 3.04 / 1; background-size: contain; background-position: center; background-repeat: no-repeat; background-color: #ffffff; }
  .banner-slide h2 { font-size: 16px; margin: 0 0 4px; text-shadow: 0 1px 3px rgba(255,255,255,.85); }
  .banner-slide p { font-size: 12px; margin: 0 0 6px; text-shadow: 0 1px 3px rgba(255,255,255,.85); }
  .banner-slide h2 { font-size: 21px; }
  .banner-slide p { font-size: 13px; }

  /* 商品网格：双列大图卡片 */
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-body { padding: 10px; gap: 5px; }
  .card-title { font-size: 13.5px; }
  .card-footer .btn { display: none; } /* 整卡可点，隐藏按钮更清爽 */
  .price { font-size: 16px; }
  .price-old { font-size: 12px; }

  /* 商品详情 */
  .detail-info h1 { font-size: 20px; }
  .detail-info .price { font-size: 24px; }
  .detail-desc { padding: 16px; }
  .detail-desc h2 { font-size: 16px; }
  .btn-row { flex-direction: column; }
  .btn-row .btn { width: 100%; padding: 13px; font-size: 15px; }
  .qty-row input { width: 64px; padding: 10px; font-size: 16px; }

  /* 购物车 / 结算 */
  .cart-item { gap: 10px; padding: 12px; }
  .cart-item img { width: 76px; height: 76px; }
  .cart-item .ci-name { font-size: 14px; }
  .cart-item .ci-price { font-size: 14px; }
  .cart-item .ci-qty input { width: 56px; padding: 8px; font-size: 15px; }
  .summary-card { padding: 16px; position: static; }
  .summary-card .btn { padding: 13px; font-size: 15px; }
  .pay-option { padding: 12px; font-size: 14px; }

  /* 表单：大点击区 + 16px 输入防 iOS 自动缩放 */
  .form-card { padding: 20px 16px; margin: 16px auto; }
  .form-card h1 { font-size: 19px; }
  .form-group label { font-size: 14px; }
  .form-group input, .form-group select, .form-group textarea { padding: 12px; font-size: 16px; }
  .btn { padding: 12px 16px; font-size: 15px; }
  .btn-sm { padding: 6px 12px; font-size: 13px; }

  /* 表格 */
  .table th, .table td { padding: 10px 8px; font-size: 13.5px; }

  /* 页脚 */
  .footer-top { grid-template-columns: 1fr 1fr; gap: 18px; padding: 26px 0; }
  .footer h4 { font-size: 14px; }
  .footer-bottom { font-size: 12.5px; padding: 12px 0; }

  /* 移动端底部 Tab 导航 - 极简风格 */
  .mobile-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 999;
    background: #fff; border-top: 1px solid #f0f0f0;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .mobile-tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 0 8px; color: #9aa4b2; text-align: center;
    -webkit-tap-highlight-color: transparent; transition: color .15s;
  }
  .mobile-tabbar a.active { color: var(--primary); }
  .mobile-tabbar .mt-icon { font-size: 22px; line-height: 1; position: relative; }
  .mobile-tabbar a.active .mt-icon::after {
    content: ''; position: absolute; top: -5px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 4px; border-radius: 50%; background: var(--primary);
  }
  .mobile-tabbar .mt-label { font-size: 10px; line-height: 1; font-weight: 500; }
  .mobile-tabbar .cart-badge {
    position: absolute; top: -6px; right: -14px; min-width: 16px; height: 16px;
    background: #ff3b30; color: #fff; border-radius: 8px; font-size: 10px;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
    font-weight: 600;
  }
}

/* 小屏微调（≤480px） */
@media (max-width: 480px) {
  .container { padding: 0 10px; }
  .header-inner { gap: 6px 8px; }
  .logo { font-size: 18px; }
  .search-box button { padding: 9px 10px; font-size: 13px; }
  .banner { height: auto; }
  .banner-slide h2 { font-size: 18px; }
  .banner-slide p { font-size: 12.5px; }
  .section { margin: 18px 0; }
  .section-head h2 { font-size: 17px; }
  .cart-item img { width: 64px; height: 64px; }
  .empty-state { padding: 36px 14px; }
  .pagination a, .pagination li.active { padding: 8px 12px; font-size: 13.5px; }
  .footer-top { grid-template-columns: 1fr; }
}

/* ---------- 前台「我的订单」：移动端卡片化（消除横向滚动） ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-orders .oc-act { white-space: nowrap; }
.table-orders .oc-act .btn + .btn { margin-left: 6px; }

@media (max-width: 600px) {
  /* 表格不再横向滚动，每条订单变成一张卡片 */
  .table-wrap { overflow-x: visible; }
  .table-orders { display: block; background: transparent; box-shadow: none; border-radius: 0; }
  .table-orders thead { display: none; }
  .table-orders tbody { display: block; }
  .table-orders tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 10px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    margin-bottom: 12px;
  }
  .table-orders tr:last-child { margin-bottom: 0; }
  .table-orders td {
    display: block; padding: 0; border-bottom: none;
    font-size: 14px; white-space: normal; word-break: break-word;
  }

  /* 第 1 行：订单号独占整行；第 2 行：时间 + 状态徽标 */
  .table-orders .oc-no       { grid-column: 1 / -1; grid-row: 1; font-weight: 700; font-size: 13.5px; letter-spacing: .2px; word-break: break-all; }
  .table-orders .oc-time     { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 12.5px; }
  .table-orders .oc-status   { grid-column: 2; grid-row: 2; justify-self: end; }
  .table-orders .oc-amount   { grid-column: 1 / -1; grid-row: 3; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
  .table-orders .oc-pay      { grid-column: 1 / -1; grid-row: 4; }

  /* 金额 / 支付状态：左字段名、右取值 */
  .table-orders .oc-amount,
  .table-orders .oc-pay {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
  }
  .table-orders .oc-amount::before,
  .table-orders .oc-pay::before {
    content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 400; flex: 0 0 auto;
  }
  .table-orders .oc-amount { font-weight: 700; font-size: 16px; }

  /* 操作区：并排等宽大按钮，不再需要横向拖动 */
  .table-orders .oc-act {
    grid-column: 1 / -1; grid-row: 5;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 8px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border);
    white-space: normal;
  }
  .table-orders .oc-act .btn {
    width: 100%; margin: 0; text-align: center; padding: 11px 10px; font-size: 14px;
  }
  .table-orders .oc-act .btn + .btn { margin-left: 0; }
}
/* 前台「购物车」：移动端卡片化 + 触控优化 */
.cart-form { margin: 0; }
.cart-actions { margin-top: 10px; }
.cart-item .ci-thumb { flex: none; line-height: 0; }
.cart-item .ci-noimg { display: block; width: 72px; height: 72px; background: #f1f4f9; border-radius: 8px; }
.cart-item .ci-subtotal { min-width: 90px; text-align: right; font-weight: 700; }
.cart-item .ci-act { flex: none; }
.cart-item .ci-lbl { display: none; }

@media (max-width: 600px) {
  .cart-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas: "thumb info" "qty sub" "act act";
    gap: 10px 12px;
    align-items: start;
    padding: 12px;
  }
  .cart-item .ci-thumb { grid-area: thumb; }
  .cart-item .ci-info { grid-area: info; min-width: 0; }
  .cart-item .ci-name { font-size: 14px; line-height: 1.45; }
  .cart-item .ci-name a { display: block; word-break: break-word; }
  .cart-item .ci-qty { grid-area: qty; display: flex; align-items: center; gap: 8px; }
  .cart-item .ci-lbl { display: inline; font-size: 12.5px; color: #6b7280; white-space: nowrap; }
  .cart-item .ci-qty input { width: 68px; padding: 8px 4px; font-size: 15px; text-align: center; }
  .cart-item .ci-subtotal { grid-area: sub; min-width: 0; align-self: center; font-size: 15.5px; }
  .cart-item .ci-act { grid-area: act; }
  .cart-item .ci-act .btn { width: 100%; padding: 10px 12px; font-size: 14px; }
  .cart-actions .btn { width: 100%; padding: 13px; font-size: 15px; }
}
/* 前台「购物车」：网格子项允许收缩，消除 min-width:auto 造成的横向溢出 */
.cart-layout > * { min-width: 0; }

@media (max-width: 380px) {
  .cart-item { grid-template-columns: 60px minmax(0, 1fr); }
  .cart-item .ci-thumb img, .cart-item .ci-noimg { width: 60px; height: 60px; }
  .cart-item .ci-name { font-size: 13.5px; }
}
/* 前台「购物车」：优惠券输入行 flex 子项允许收缩，避免撑破摘要卡片 */
.summary-card form { min-width: 0; }
.summary-card input[name="coupon_code"] { min-width: 0; }

@media (max-width: 600px) {
  .cart-item .ci-name a {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
  }
}
/* 前台「购物车」：数量步进器（点击 +/- 就地改数量与金额，无需「更新购物车」） */
.cart-item .ci-buy { display: flex; align-items: center; gap: 14px; flex: none; }
.cart-item .ci-lbl { display: none; }
.cart-item .qty-stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.cart-item .qty-stepper input { width: 52px; min-width: 0; padding: 8px 2px; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); border-radius: 0; text-align: center; font-size: 15px; background: #fff; box-sizing: border-box; }
.cart-item .qty-stepper input:focus { outline: none; box-shadow: none; border-color: var(--border); }
.cart-item .qty-stepper input::-webkit-outer-spin-button,
.cart-item .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-item .qty-btn { width: 38px; min-width: 38px; border: 0; padding: 0; background: #f4f7fc; color: #1a6df0; font-size: 19px; font-weight: 700; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; user-select: none; }
.cart-item .qty-btn:hover:not(:disabled) { background: #e6eefb; }
.cart-item .qty-btn:active:not(:disabled) { background: #d8e6fa; }
.cart-item .qty-btn:disabled { color: #c3cbd8; background: #f7f9fc; cursor: not-allowed; }

@media (max-width: 600px) {
  /* 步进器与行小计合成一行，整行占满两列，彻底避免横向挤压 */
  .cart-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas: "thumb info" "buy buy" "act act";
    gap: 10px 12px;
    align-items: start;
    padding: 12px;
  }
  .cart-item .ci-buy { grid-area: buy; justify-content: space-between; gap: 10px; }
  .cart-item .ci-subtotal { grid-area: auto; min-width: 0; text-align: right; font-size: 15.5px; }
  .cart-item .qty-btn { width: 44px; min-width: 44px; height: 44px; font-size: 22px; }
  .cart-item .qty-stepper input { width: 48px; min-width: 30px; height: 44px; padding: 0 2px; font-size: 16px; }
  .cart-item .ci-act .btn { width: 100%; padding: 10px 12px; font-size: 14px; }
}

@media (max-width: 380px) {
  .cart-item { grid-template-columns: 60px minmax(0, 1fr); }
}


/* 前台「购物车」：ci-buy 超窄屏兜底（小计换行，保住 44px 触控尺寸） */
@media (max-width: 300px) {
  .cart-item .ci-buy { flex-wrap: wrap; row-gap: 6px; }
  .cart-item .ci-subtotal { width: 100%; text-align: right; }
}
/* 前台「结算页」：网格子项允许收缩，消除 min-width:auto 造成的横向溢出 */
.checkout-layout > * { min-width: 0; }
.summary-card .row { min-width: 0; gap: 10px; }
.summary-card .row > span { min-width: 0; }
.summary-card .ck-item-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-card .ck-item-amt { flex: none; white-space: nowrap; }

@media (max-width: 600px) {
  .checkout-layout { gap: 16px; margin: 16px 0; }
  .summary-card { position: static; padding: 16px 14px; }
  .summary-card .row { font-size: 13.5px; }
  .summary-card .total-row { font-size: 16px; }
  .checkout-layout .pay-option { min-height: 48px; }
  .checkout-layout .btn-block { padding: 14px; font-size: 15.5px; }
}
/* ===== 管理员推送消息：前台弹窗（右上角 × 关闭） ===== */
.push-mask{position:fixed;left:0;top:0;right:0;bottom:0;background:rgba(15,18,24,.55);z-index:10060;display:flex;align-items:center;justify-content:center;padding:18px}
.push-card{position:relative;background:#fff;border-radius:14px;width:100%;max-width:440px;max-height:80vh;overflow:auto;padding:22px 20px 18px;box-shadow:0 20px 60px rgba(0,0,0,.28);box-sizing:border-box}
.push-close{position:absolute;top:8px;right:10px;width:36px;height:36px;border:0;border-radius:50%;background:#f2f4f8;color:#5b6472;font-size:20px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s,color .15s}
.push-close:hover{background:#e6e9ef;color:#1f2430}
.push-head{font-size:16px;font-weight:700;margin-bottom:12px;padding-right:34px}
.push-item{border-top:1px solid #eef1f5;padding:12px 0;font-size:14px;line-height:1.75;color:#374151;word-break:break-word}
.push-item:first-of-type{border-top:0}
.push-time{font-size:12px;color:#9aa4b2;margin-top:4px}
.push-foot{margin-top:14px;text-align:right;font-size:13px}
.push-foot a{color:#2563eb;text-decoration:none}
.push-foot a:hover{text-decoration:underline}
@media (max-width:600px){.push-mask{padding:12px}.push-card{max-width:none;border-radius:12px;padding:20px 16px 16px}.push-close{top:6px;right:6px;width:40px;height:40px}}
