/* Borneo Play 商城样式：TOPTOY 极简风，深绿雨林色，手机端优先 */
:root {
  --green: #14532d;
  --green-dark: #0f3d21;
  --green-light: #dcfce7;
  --green-soft: #f0fdf4;
  --bg: #f7f7f5;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --red: #dc2626;
  --amber: #b45309;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }

/* 页面容器：手机端优先，桌面居中 */
.page { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: 86px; position: relative; }
.page-wide { max-width: 720px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--green); color: #fff;
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar .logo { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.topbar .logo small { display: block; font-size: 11px; font-weight: 400; opacity: .85; letter-spacing: 2px; }
.topbar .top-link { color: #fff; font-size: 14px; opacity: .95; background: none; border: 0; }
.topbar .back { color: #fff; background: none; border: 0; font-size: 15px; padding: 4px 0; }

.content { padding: 16px; }
.section-title { font-size: 17px; font-weight: 700; margin: 20px 0 10px; }
.section-title:first-child { margin-top: 0; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 13px; }
.center { text-align: center; }

/* 搜索框 */
.search-box { display: flex; gap: 8px; margin-bottom: 14px; }
.search-box input {
  flex: 1; height: 42px; border: 1px solid var(--line); border-radius: 999px;
  padding: 0 16px; background: #fff; outline: none;
}
.search-box input:focus { border-color: var(--green); }
.search-box button {
  height: 42px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--green); color: #fff; font-size: 14px;
}

/* 分类筛选 */
.chips { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.chip {
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 14px; color: var(--text);
}
.chip.active { background: var(--green); border-color: var(--green); color: #fff; }

/* 商品卡片 */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); display: flex; flex-direction: column;
}
.card .thumb { aspect-ratio: 1 / 1; background: var(--green-soft); overflow: hidden; position: relative; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .img-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--green-light); color: var(--green); font-size: 14px; padding: 12px; text-align: center;
}
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .name { font-size: 14px; font-weight: 600; line-height: 1.45; }
.card .tagline { font-size: 12px; color: var(--muted); line-height: 1.45; }
.card .price-row { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.card .price { color: var(--green); font-weight: 700; font-size: 16px; }
.card .stock { font-size: 12px; color: var(--muted); }
.card .stock.low { color: var(--amber); }
.card .stock.out { color: var(--red); }
.card .series-badge {
  position: absolute; left: 8px; top: 8px; background: var(--green); color: #fff;
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
}

/* 按钮 */
.btn {
  display: inline-block; width: 100%; height: 46px; line-height: 46px; text-align: center;
  border-radius: 999px; border: 0; font-size: 15px; font-weight: 600;
  background: var(--green); color: #fff;
}
.btn:active { background: var(--green-dark); }
.btn.secondary { background: #fff; color: var(--green); border: 1px solid var(--green); }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #fecaca; }
.btn.small { width: auto; height: 36px; line-height: 36px; padding: 0 16px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* 表单 */
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; background: #fff; outline: none;
}
.field textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-error { color: var(--red); font-size: 13px; min-height: 20px; margin: 6px 0; }
.tabs { display: flex; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.tabs button { flex: 1; height: 38px; border: 0; border-radius: 999px; background: none; font-size: 14px; }
.tabs button.active { background: var(--green); color: #fff; }

/* 轮播 */
.carousel { position: relative; background: var(--green-soft); border-radius: var(--radius); overflow: hidden; }
.carousel .slides { display: flex; transition: transform .3s ease; }
.carousel .slide { flex: 0 0 100%; aspect-ratio: 1 / 1; }
.carousel .slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel .slide .img-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--green-light); color: var(--green); font-size: 16px; padding: 20px; text-align: center;
}
.carousel .arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.9); color: var(--green); font-size: 18px; line-height: 1;
}
.carousel .arrow.prev { left: 10px; }
.carousel .arrow.next { right: 10px; }
.dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0 2px; }
.dots span { width: 7px; height: 7px; border-radius: 50%; background: #d1d5db; }
.dots span.active { background: var(--green); }

/* 商品详情 */
.detail-name { font-size: 19px; font-weight: 700; margin: 14px 0 4px; }
.detail-price { color: var(--green); font-size: 22px; font-weight: 700; margin: 6px 0; }
.detail-price small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.option-group { margin: 14px 0; }
.option-group .label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.option-list { display: flex; flex-wrap: wrap; gap: 8px; }
.option {
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; font-size: 14px; text-align: left; line-height: 1.4;
}
.option small { display: block; color: var(--muted); font-size: 12px; }
.option.active { border-color: var(--green); background: var(--green-soft); color: var(--green); font-weight: 600; }
.option:disabled { opacity: .45; }
.qty-row { display: flex; align-items: center; gap: 14px; margin: 14px 0; }
.qty-row .label { font-size: 13px; color: var(--muted); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: #fff; overflow: hidden; }
.qty button { width: 38px; height: 38px; border: 0; background: none; font-size: 18px; color: var(--green); }
.qty span { min-width: 34px; text-align: center; font-weight: 600; }
.desc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 16px; white-space: pre-line; }
.policy { background: var(--green-soft); border-radius: var(--radius); padding: 16px; margin-top: 14px; font-size: 13px; color: #14532d; white-space: pre-line; }
.sticky-buy {
  position: fixed; bottom: 64px; left: 50%; transform: translateX(-50%);
  width: min(480px, 100%); padding: 10px 16px;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; gap: 10px; z-index: 40;
}
.sticky-buy .btn { flex: 1; }

/* 列表行 */
.list-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.list-card .row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.list-card .row + .row { margin-top: 6px; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px;
  background: var(--green-light); color: var(--green);
}
.badge.warn { background: #fef3c7; color: var(--amber); }
.badge.grey { background: #f3f4f6; color: var(--muted); }
.badge.red { background: #fee2e2; color: var(--red); }

/* 购物车 */
.cart-item { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.cart-item img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; background: var(--green-soft); }
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .name { font-size: 14px; font-weight: 600; line-height: 1.4; }
.cart-item .spec { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.cart-item .bottom { display: flex; align-items: center; justify-content: space-between; }
.cart-item .price { color: var(--green); font-weight: 700; }
.cart-total {
  position: fixed; bottom: 64px; left: 50%; transform: translateX(-50%);
  width: min(480px, 100%); padding: 12px 16px; background: #fff;
  border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; z-index: 40;
}
.cart-total .sum { flex: 1; }
.cart-total .sum b { color: var(--green); font-size: 18px; }
.cart-total .btn { width: auto; flex: 0 0 auto; padding: 0 28px; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .big { font-size: 17px; color: var(--text); font-weight: 600; margin-bottom: 6px; }

/* 订单时间线 */
.timeline { list-style: none; margin-top: 10px; }
.timeline li { position: relative; padding: 0 0 18px 26px; color: var(--muted); font-size: 14px; }
.timeline li::before {
  content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px;
  border-radius: 50%; background: #d1d5db;
}
.timeline li::after { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.done { color: var(--text); }
.timeline li.done::before { background: var(--green); }
.timeline li.current { color: var(--green); font-weight: 600; }
.timeline li.current::before { background: var(--green); box-shadow: 0 0 0 4px var(--green-light); }

/* 付款页 */
.qr-box { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 16px; margin-bottom: 14px; }
.qr-box img { width: 220px; height: 220px; object-fit: contain; margin: 0 auto 10px; }
.bank-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.bank-box .acct { font-size: 19px; font-weight: 700; letter-spacing: 1px; margin: 4px 0; }
.copy-btn { border: 1px solid var(--green); color: var(--green); background: #fff; border-radius: 999px; padding: 5px 14px; font-size: 13px; }

/* 底部导航 */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(480px, 100%); height: 64px; background: #fff;
  border-top: 1px solid var(--line); display: flex; z-index: 50;
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12px; color: var(--muted); gap: 2px;
}
.bottom-nav a .nav-label { font-size: 13px; }
.bottom-nav a.active { color: var(--green); font-weight: 700; }
.bottom-nav .cart-count {
  position: absolute; top: 6px; margin-left: 34px;
  background: var(--red); color: #fff; font-size: 10px; min-width: 16px; height: 16px;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* 客服悬浮按钮与聊天框 */
.chat-fab {
  position: fixed; right: 16px; bottom: 78px; z-index: 60;
  height: 46px; padding: 0 18px; border-radius: 999px; border: 0;
  background: var(--green); color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.chat-panel {
  position: fixed; right: 16px; bottom: 132px; z-index: 60;
  width: min(360px, calc(100vw - 32px)); max-height: 480px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18); display: none; flex-direction: column; overflow: hidden;
}
.chat-panel.open { display: flex; }
.chat-panel .chat-head { background: var(--green); color: #fff; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; }
.chat-panel .chat-head b { font-size: 15px; }
.chat-panel .chat-head button { background: none; border: 0; color: #fff; font-size: 15px; }
.chat-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 180px; }
.chat-msg { max-width: 85%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; white-space: pre-line; }
.chat-msg.user { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.ai { align-self: flex-start; background: var(--green-soft); color: var(--text); border-bottom-left-radius: 4px; }
.chat-wa { font-size: 12px; color: var(--muted); text-align: center; padding: 6px 10px 0; }
.chat-wa a { color: var(--green); font-weight: 600; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; height: 40px; border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; outline: none; }
.chat-input button { height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--green); color: #fff; }

/* 提示条 */
.toast {
  position: fixed; left: 50%; bottom: 140px; transform: translateX(-50%);
  background: #1a1a1a; color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; z-index: 100; display: none; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { display: block; }
.notice {
  background: #fef3c7; color: #92400e; font-size: 13px;
  border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
}

/* 后台 */
.admin-stat { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat-card .num { font-size: 22px; font-weight: 700; color: var(--green); }
.stat-card .label { font-size: 12px; color: var(--muted); }
.admin-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table input { width: 74px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; }
.status-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.status-btns button { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 12px; }
.status-btns button:hover { border-color: var(--green); color: var(--green); }
.link { color: var(--green); font-weight: 600; }

/* ============================================================
   新功能样式：语言切换 / 优惠券 / 包邮进度 / 弹窗 / 图鉴 / 晒单 / 到货通知
   ============================================================ */
html[data-i18n-pending] body { opacity: 0; }
body { transition: opacity .15s; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: inline-flex; background: rgba(255,255,255,.14); border-radius: 999px; padding: 2px; }
.lang-switch button { border: 0; background: none; color: #fff; font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 999px; opacity: .8; min-width: 30px; }
.lang-switch button.on { background: #fff; color: var(--green); opacity: 1; }

/* 优惠券票根 */
.coupon {
  display: flex; align-items: stretch; background: #fff7ed; border: 1px dashed #fb923c; border-radius: 12px;
  overflow: hidden; margin-bottom: 8px; cursor: pointer; position: relative;
}
.coupon.ship { background: #eff6ff; border-color: #60a5fa; }
.coupon .c-l { flex: 0 0 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 6px; border-right: 1px dashed currentColor; color: #c2410c; }
.coupon.ship .c-l { color: #1d4ed8; }
.coupon .c-l b { font-size: 20px; line-height: 1.1; }
.coupon .c-l span { font-size: 11px; }
.coupon .c-r { flex: 1; padding: 10px 12px; font-size: 12px; color: var(--muted); }
.coupon .c-r b { display: block; color: var(--text); font-size: 14px; }
.coupon .c-code { font-family: ui-monospace, Menlo, monospace; letter-spacing: 1px; }
.coupon.selected { border-style: solid; box-shadow: 0 0 0 2px #fb923c55; }
.coupon.ship.selected { box-shadow: 0 0 0 2px #60a5fa55; }
.coupon.disabled { opacity: .5; cursor: not-allowed; }
.coupon .c-tick { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--green); }
.coupon-input { display: flex; gap: 8px; margin-top: 6px; }
.coupon-input input { flex: 1; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; text-transform: uppercase; }
.coupon-input button { height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--green); background: #fff; color: var(--green); font-weight: 600; }
.coupon-msg { font-size: 12px; margin-top: 6px; min-height: 16px; }
.coupon-msg.ok { color: var(--green); }
.coupon-msg.err { color: var(--red); }

/* 首页钱包提示条 */
.wallet-bar {
  display: flex; align-items: center; gap: 10px; background: linear-gradient(90deg, #fff7ed, #fef3c7);
  border: 1px solid #fed7aa; border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; font-size: 13px;
}
.wallet-bar b { color: #c2410c; }
.wallet-bar .grow { flex: 1; }
.wallet-bar button { border: 0; background: #c2410c; color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600; }

/* 包邮进度条 */
.ship-bar { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.ship-bar .track { height: 6px; background: var(--green-light); border-radius: 999px; margin-top: 6px; overflow: hidden; }
.ship-bar .fill { height: 100%; background: var(--green); border-radius: 999px; transition: width .4s ease; }
.ship-bar b { color: var(--green); }
.ship-bar a { color: var(--green); font-weight: 600; margin-left: 4px; }

/* 价格明细行 */
.list-card .row.discount b { color: var(--red); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: min(480px, 100%); border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 90vh; overflow-y: auto; }
.modal h3 { font-size: 17px; margin-bottom: 4px; }
.modal .modal-sub { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.stars-input { display: flex; gap: 6px; margin: 6px 0 12px; }
.stars-input button { border: 0; background: none; font-size: 30px; color: #e5e7eb; padding: 0; line-height: 1; }
.stars-input button.on { color: #f59e0b; }
.photo-pick { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.photo-pick img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.photo-pick label { border: 1px dashed var(--green); color: var(--green); border-radius: 10px; padding: 10px 14px; font-size: 13px; cursor: pointer; }
.photo-pick input { display: none; }

/* 商品页：WhatsApp 询问 / 到货通知 */
.wa-ask {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px; margin: 10px 0 4px;
  border-radius: 999px; border: 1px solid #25d366; color: #128c7e; background: #f0fdf4; font-weight: 600; font-size: 14px;
}
.wa-ask svg { width: 18px; height: 18px; }
.restock-box { background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; font-size: 13px; }
.restock-box b { display: block; font-size: 14px; margin-bottom: 4px; }
.restock-box .row2 { display: flex; gap: 8px; margin-top: 8px; }
.restock-box input { flex: 1; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
.restock-box button { height: 40px; padding: 0 14px; border-radius: 10px; border: 0; background: #c2410c; color: #fff; font-weight: 600; }

/* 图鉴 */
.dex { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 16px; }
.dex-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.dex-head h3 { font-size: 15px; }
.dex-head span { font-size: 13px; color: var(--green); font-weight: 700; }
.dex-bar { height: 6px; background: var(--green-light); border-radius: 999px; overflow: hidden; margin: 6px 0 12px; }
.dex-bar div { height: 100%; background: linear-gradient(90deg, #22c55e, #f59e0b); transition: width .4s; }
.dex-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dex-item {
  aspect-ratio: 1; border-radius: 12px; border: 1px dashed #cbd5e1; background: #f8fafc; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; gap: 2px; padding: 4px; text-align: center;
}
.dex-item .ico { font-size: 22px; filter: grayscale(1); opacity: .5; }
.dex-item.on { border-style: solid; border-color: var(--green); background: var(--green-soft); color: var(--green); font-weight: 600; }
.dex-item.on .ico { filter: none; opacity: 1; }
.dex-item.secret { border-color: #f59e0b; }
.dex-item.secret.on { background: #fffbeb; color: #b45309; }
.dex-note { font-size: 12px; color: var(--muted); margin-top: 10px; }
.dex-done { background: linear-gradient(90deg, #fef3c7, #dcfce7); border-radius: 10px; padding: 8px 10px; margin-top: 10px; font-size: 13px; font-weight: 600; color: #14532d; }

/* 晒单墙 */
.reviews-wall { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.review-card { flex: 0 0 68%; scroll-snap-align: start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.review-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--green-soft); }
.review-card .rv-body { padding: 10px 12px; }
.review-card .rv-stars { color: #f59e0b; font-size: 13px; letter-spacing: 1px; }
.review-card .rv-text { font-size: 13px; line-height: 1.5; margin: 4px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.review-card .rv-meta { font-size: 11px; color: var(--muted); }
.reviews-list .review-card { flex: none; width: 100%; display: flex; margin-bottom: 10px; }
.reviews-list .review-card img { width: 96px; aspect-ratio: 1; flex: 0 0 96px; }
.reviews-empty { font-size: 13px; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px; text-align: center; }

/* 会员页 */
.member-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.member-grid a, .member-grid button { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: left; font-size: 13px; color: var(--muted); }
.member-grid b { display: block; font-size: 18px; color: var(--green); }
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pref-row .lang-pick { display: flex; gap: 6px; }
.pref-row .lang-pick button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.pref-row .lang-pick button.on { border-color: var(--green); background: var(--green); color: #fff; }

/* 后台新表格 */
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.admin-mini { font-size: 12px; color: var(--muted); }
.admin-search { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; margin-bottom: 10px; }
.tabs.scroll-tabs { overflow-x: auto; }
.tabs.scroll-tabs button { flex: 0 0 auto; padding: 0 14px; }
.wa-btn { display: inline-block; background: #25d366; color: #fff; border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600; }
.option.soldout { opacity: .6; }
.option.soldout small { color: var(--red); }
/* 顶栏放了语言切换后更紧凑 */
.topbar { gap: 8px; }
.topbar > * { min-width: 0; }
.topbar .back, .topbar .top-link { white-space: nowrap; flex: 0 0 auto; }
.topbar .logo { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }
.topbar .back + .logo { text-align: center; font-size: 16px !important; }
.topbar-right { flex: 0 0 auto; }
.lang-switch button { white-space: nowrap; padding: 4px 7px; min-width: 0; }
@media (max-width: 380px) { .topbar .back + .logo { display: none; } }
.restock-box input, .coupon-input input { min-width: 0; }
.restock-box button { flex: 0 0 auto; white-space: nowrap; }
.card .price-row { flex-wrap: wrap; row-gap: 0; }
.card .price, .card .stock { white-space: nowrap; }
#src-code { text-transform: none; }

/* 快递信息 */
.ship-info { background: var(--green-soft); border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 13px; line-height: 1.6; }
.ship-info .ship-no { font-family: ui-monospace, Menlo, monospace; letter-spacing: .5px; }
.copy-track { border: 1px solid var(--green); background: #fff; color: var(--green); border-radius: 999px; padding: 1px 10px; font-size: 12px; }
.ship-form { display: grid; gap: 8px; margin-top: 10px; padding: 10px; background: #f8fafc; border-radius: 10px; }
.ship-form select, .ship-form input { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font-size: 15px; min-width: 0; }
.notified { color: var(--green); font-size: 12px; font-weight: 600; }

/* ============================================================
   响应式：手机直屏 / 手机横屏 / 平板 / 电脑
   - < 640px：手机直屏（原样）
   - 640–1023px：手机横屏、平板直屏 → 更宽、3 列商品
   - ≥ 1024px：平板横屏、电脑 → 宽版、4–5 列、商品页左右两栏、底部导航变悬浮胶囊
   - 高度很矮的横屏：压缩底部导航和弹窗
   ============================================================ */
.detail-media, .detail-info { min-width: 0; }

@media (min-width: 640px) {
  .page { max-width: 760px; }
  .page-wide { max-width: 960px; }
  .content { padding: 20px 24px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .bottom-nav, .sticky-buy, .cart-total { width: min(760px, 100%); }
  .dex-grid { grid-template-columns: repeat(6, 1fr); }
  .review-card { flex-basis: 42%; }
  .reviews-wall { margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
  .member-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-stat { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .modal-mask { align-items: center; padding: 16px; }
  .modal { border-radius: 20px; width: min(520px, 100%); }
  .carousel .slide { aspect-ratio: 4 / 3; }
  .carousel .slide img { object-fit: contain; background: #fff; }
}

@media (min-width: 1024px) {
  body { font-size: 16px; }
  .page, .page-wide { max-width: 1200px; padding-bottom: 110px; }
  .topbar { padding: 16px 32px; }
  .content { padding: 24px 32px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .card .name { font-size: 15px; }
  .section-title, .home-head h2 { font-size: 20px; }

  /* 底部导航 → 悬浮胶囊 */
  .bottom-nav {
    width: min(520px, calc(100% - 32px)); bottom: 16px; height: 60px;
    border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
  }
  /* 电脑上购买按钮直接放在商品信息里 */
  .sticky-buy { position: static; transform: none; width: auto; padding: 0; margin: 14px 0 4px; background: none; border: 0; }
  .sticky-buy .btn { height: 52px; line-height: 52px; font-size: 16px; }
  .cart-total {
    width: min(560px, calc(100% - 32px)); bottom: 88px;
    border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.12);
  }
  .chat-fab { bottom: 24px; right: 24px; }
  .chat-panel { bottom: 80px; right: 24px; }
  .toast { bottom: 100px; }

  /* 表单类页面不拉太宽 */
  .page:not(.page-wide):not(:has(#product-grid)):not(:has(#detail-body)) .content { max-width: 760px; margin: 0 auto; }

  /* 首页 */
  .search-box { max-width: 640px; }
  .review-card { flex-basis: 30%; }
  .reviews-wall { margin: 0; padding-left: 0; padding-right: 0; }

  /* 商品页：左图右信息 */
  #detail-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .detail-media { position: sticky; top: 88px; }
  .carousel .slide { aspect-ratio: 1 / 1; }
  .detail-name { font-size: 26px; margin-top: 0; }
  .detail-price { font-size: 28px; }
  .dex-grid { grid-template-columns: repeat(5, 1fr); }

  /* 后台表格更舒服 */
  .admin-table { font-size: 14px; }
}

@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* 手机横屏：高度很矮 */
@media (orientation: landscape) and (max-height: 500px) {
  .page { padding-bottom: 64px; }
  .bottom-nav { height: 50px; }
  .bottom-nav a { flex-direction: row; gap: 4px; }
  .sticky-buy, .cart-total { bottom: 50px; padding-top: 6px; padding-bottom: 6px; }
  .page .sticky-buy { bottom: 50px; }
  .chat-fab { height: 40px; }
  .chat-body { min-height: 90px; }
  .topbar { position: static; padding-top: 10px; padding-bottom: 10px; }
  .modal { max-height: 94vh; }
  .chat-fab { bottom: 112px; }
  .chat-panel { bottom: 160px; max-height: calc(100vh - 176px); }
  /* 横屏商品页也用左右两栏 */
  #detail-body { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .detail-media { position: sticky; top: 8px; }
  .carousel .slide { aspect-ratio: 4 / 3; }
  .detail-name { margin-top: 0; }
}
@media (orientation: landscape) and (max-height: 500px) and (min-width: 1024px) {
  .bottom-nav { bottom: 8px; }
  .cart-total { bottom: 66px; }
  .chat-fab { bottom: 16px; }
}
