/* ---------- 设计系统 ---------- */
:root {
  /* 清新配色：冷白底 + 天蓝主色，避免大面积深色带来的压抑感 */
  --bg: #f3f9fd;
  --bg-tint: #e8f4fb;
  --paper: #ffffff;
  --ink: #14283d;            /* 深蓝灰，比纯黑柔和 */
  --ink-soft: #3d556e;
  --muted: #7b90a5;
  --line: #e2ecf4;
  --line-strong: #c8dae8;

  --accent: #0ea5e9;         /* 天蓝，主色 */
  --accent-strong: #0284c7;
  --accent-soft: #e0f2fe;
  --accent-grad: linear-gradient(135deg, #0ea5e9 0%, #22d3ee 100%);

  --hot: #f97316;            /* 热门橙 */
  --hot-soft: #fff1e6;

  --success: #059669;
  --success-soft: #d1fae5;
  --danger: #e11d48;
  --danger-soft: #ffe4e6;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 40, 61, 0.04);
  --shadow-hover: 0 8px 24px rgba(14, 165, 233, 0.12);
  --ring: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue",
    "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 页面骨架：body 竖向 flex + 最小满屏，页脚永远贴到视口底部。
   之前内容少的时候（比如 /ai 只有两个商品）页脚会停在内容后面浮在半空，
   下面空一大片才到底部导航。现在 main 吃掉剩余空间把页脚顶下去。 */
body {
  min-height: 100vh;
  min-height: 100dvh;   /* 手机地址栏收放时比 100vh 准 */
  display: flex; flex-direction: column;
}
/* 特异性要高过 .wrap 的 padding 简写，否则 padding-bottom 会被覆盖掉 */
body > main.wrap { flex: 1 0 auto; padding-bottom: 60px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); font-size: 13px; }
.spacer { flex: 1; }
.req { color: var(--danger); margin-left: 4px; font-weight: 400; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700; font-size: 12px;
  border-radius: 9px;
  letter-spacing: -0.02em;
  box-shadow: none;
}
.brand-text strong {
  display: block; font-size: 15px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.01em;
}
.brand-text small { display: block; color: var(--muted); font-size: 12px; }

.topnav { display: flex; gap: 4px; align-items: center; }
.topnav a {
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.12s;
}
.topnav a:hover { background: var(--accent-soft); color: var(--accent-strong); }
.topnav a.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 500; }
.lang-btn {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink-soft);
  padding: 5px 11px;
  font-size: 12px;
  border-radius: 999px;
  cursor: pointer;
  margin-left: 6px;
}
.lang-btn:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }

/* 语言切换下拉。三语之后单纯 toggle 猜不出下一个是什么，改成显式菜单。
   .lang-switch 容器由 setupLangSwitcher() 运行时插入，HTML 里不需要写。 */
.lang-switch { position: relative; display: inline-flex; }
.lang-switch .lang-btn { margin-left: 6px; }
.lang-menu {
  display: none;
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 150px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(20, 40, 61, 0.14);
  padding: 4px;
  z-index: 40;
}
.lang-switch.open .lang-menu { display: block; }
.lang-menu button {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  background: transparent; border: 0;
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 13px; color: var(--ink);
  cursor: pointer; text-align: left;
}
.lang-menu button:hover { background: var(--bg-tint); }
.lang-menu button.active { color: var(--accent-strong); font-weight: 500; }
.lang-menu .lm-code {
  flex: 0 0 26px;
  font-size: 11px; font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
}
.lang-menu button.active .lm-code { color: var(--accent-strong); }
.lang-menu .lm-name { flex: 1; min-width: 0; }
.badge {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
}

/* ---------- Hero ---------- */
/* 顶部用一层很淡的青蓝光晕，替代原来的纯色平铺，视觉上更透气 */
.hero {
  padding: 56px 0 32px;
  text-align: center;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute; inset: -60px 0 0;
  /* 只留一层极淡的冷色光，把视线引向搜索框即可，不做抢眼的大面积渐变 */
  background: radial-gradient(55% 60% at 50% 0%,
    rgba(14, 165, 233, 0.07) 0%, rgba(14, 165, 233, 0) 72%);
  pointer-events: none;
  z-index: -1;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hero .hi { color: var(--accent-strong); font-weight: 650; }

/* ---------- 热门标记 ---------- */
/* 低调处理：淡底 + 深字，不用渐变和阴影，避免"贴标签"的廉价感 */
.hot-badge {
  position: absolute; top: 10px; right: 10px;
  display: inline-block;
  background: var(--hot-soft);
  color: #c2410c;
  border: 1px solid #fed7aa;
  font-size: 10.5px; font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  z-index: 1;
}
.card.is-hot:hover { border-color: var(--accent); }
.tip {
  margin: 0 auto 24px;
  max-width: 560px;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- 搜索栏 ---------- */
.hero-search {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}
.search-input-wrap {
  display: flex; align-items: center; gap: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 3px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.country-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 14px;
  max-width: 200px;
}
.country-chip:hover { background: rgba(14, 165, 233, 0.08); color: var(--ink); }
.country-chip.open { background: rgba(14, 165, 233, 0.12); color: var(--ink); }
.chip-flag { font-size: 16px; line-height: 1; }
.chip-name {
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip-caret { font-size: 10px; color: var(--muted); }
.search-divider {
  width: 1px; height: 20px; background: var(--line); margin: 0 2px;
}
.search-icon { font-size: 15px; color: var(--muted); padding-left: 8px; opacity: 0.7; }
.search-input-wrap input#q-service {
  flex: 1;
  border: 0; outline: 0;
  padding: 10px 8px;
  font-size: 15px;
  background: transparent;
  color: var(--ink);
  min-width: 0;
}
.search-input-wrap button#btn-search {
  padding: 9px 22px;
  border: 0; border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  box-shadow: none;
  transition: filter .15s, transform .1s;
}
.search-input-wrap button#btn-search:hover { filter: brightness(1.06); }
.search-input-wrap button#btn-search:active { transform: translateY(1px); }

/* ---------- 联想 ---------- */
.suggest-box, .country-panel {
  position: absolute;
  top: 54px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(14, 165, 233, 0.14);
  z-index: 25;
  max-height: 380px;
  overflow-y: auto;
}
.suggest-box { left: 0; right: 0; padding: 6px; }
.suggest-head {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 10px;
}
.suggest-item {
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  color: var(--ink);
  font-size: 14px;
}
.suggest-item:hover { background: var(--bg); }

.country-panel {
  left: 0;
  width: min(360px, 100%);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.country-search-row {
  padding: 10px; border-bottom: 1px solid var(--line);
}
.country-search-row input {
  width: 100%; border: 0; outline: 0;
  padding: 6px 8px;
  background: var(--bg);
  border-radius: 6px;
  font-size: 13px;
}
.country-search-row input:focus { background: var(--paper); box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.14); }
.country-list { overflow-y: auto; padding: 6px; }
.country-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: 6px; cursor: pointer;
  color: var(--ink); font-size: 14px;
}
.country-item:hover { background: var(--bg); }
.country-item.selected { background: var(--bg); font-weight: 500; }
.country-item .ci-flag { font-size: 16px; }
.country-item .ci-name { flex: 1; }
.country-item .ci-code {
  font-size: 11px; color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}
.ci-empty { padding: 16px; color: var(--muted); text-align: center; font-size: 13px; }

/* ---------- 通用 section / cards ---------- */
.section { margin: 40px 0; }
.section-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 16px;
}
.section-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.link-btn {
  border: 0; background: transparent;
  color: var(--ink-soft); cursor: pointer;
  font-size: 13px; padding: 4px 8px;
  border-radius: 6px;
}
.link-btn:hover { background: var(--accent-soft); color: var(--accent-strong); }
.link-btn.danger { color: var(--danger); }
.link-btn.danger:hover { background: var(--danger-soft); }

/* Icon square */
.ic {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--bg);
}
.ic-img { width: 60%; height: 60%; }
.ic-emoji { font-size: 20px; line-height: 1; }

/* Featured grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  display: flex; flex-direction: column; gap: 4px;
}
.card.clickable { cursor: pointer; position: relative; }
.card.clickable:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.card.card-disabled { opacity: 0.55; }
.card .name {
  font-weight: 600; color: var(--ink); font-size: 15px;
  margin-top: 8px;
}
.card .desc {
  color: var(--muted); font-size: 12px; margin: 2px 0 12px;
  min-height: 32px; line-height: 1.4;
}
.card .price-row {
  display: flex; align-items: baseline; justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 10px; margin-top: auto;
}
.card .price {
  font-size: 18px; font-weight: 700;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}
.card .country { font-size: 12px; color: var(--muted); }
.card .unavail-row { margin-top: auto; padding-top: 10px; }
.badge-unavail {
  display: inline-block; padding: 2px 8px;
  font-size: 11px; border-radius: 4px;
  background: var(--bg); color: var(--muted);
  border: 1px solid var(--line);
}

/* Offer list */
.offers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}
.offer {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.offer:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); }
.offer .offer-main { flex: 1; min-width: 0; }
.offer .service { font-weight: 500; color: var(--ink); font-size: 14px; }
.offer .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.offer .price {
  font-size: 16px; font-weight: 700; color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}
.offer button {
  background: var(--accent); color: #fff; border: 0;
  padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: none;
  transition: filter .15s;
  flex-shrink: 0;
}
.offer button:hover { filter: brightness(1.06); }
.loading { color: var(--muted); padding: 16px 0; font-size: 14px; }

/* ---------- 模态 ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(20, 40, 61, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-inner {
  background: var(--paper);
  border-radius: var(--radius-lg);
  width: min(460px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(20, 40, 61, 0.18);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.modal-head strong { font-size: 15px; font-weight: 600; }
.modal-head .close {
  background: transparent; border: 0;
  font-size: 22px; color: var(--muted); cursor: pointer;
  line-height: 1;
}
.modal-head .close:hover { color: var(--ink); }

.pay-methods { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.pay-methods label {
  flex: 1; min-width: 130px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  font-size: 14px;
  transition: border-color 0.15s;
}
.pay-methods label:hover { border-color: var(--ink); }
.pay-methods input { accent-color: var(--ink); }
.summary {
  background: var(--bg);
  padding: 12px; border-radius: var(--radius);
  margin: 12px 0;
}
.summary div {
  display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px;
}
.summary .big {
  font-size: 18px; color: var(--ink); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.btn-primary {
  width: 100%; padding: 10px;
  border: 0; border-radius: var(--radius);
  background: var(--accent); color: #fff;
  font-weight: 600; cursor: pointer; font-size: 14px;
  box-shadow: none;
  transition: filter .15s;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { background: var(--line-strong); cursor: not-allowed; }

/* ---------- 订单 ---------- */
.orders-list { display: flex; flex-direction: column; gap: 8px; }
.order-row {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: border-color 0.12s;
}
.order-row:hover { border-color: var(--line-strong); }
.order-row.active {
  border-color: var(--ink);
  background: var(--paper);
}
.order-row .order-main { flex: 1; min-width: 0; }
.order-row .order-title { font-weight: 500; color: var(--ink); font-size: 14px; }
.order-row .order-sub {
  color: var(--muted); font-size: 12px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* flex-shrink:0 —— 价格/时间/按钮这一列不该被压变形，
   要让的是左边 .order-main（它有 min-width:0 可以收缩） */
.order-row .order-right { text-align: right; flex-shrink: 0; }
.order-row .order-price {
  font-weight: 600; color: var(--ink); font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.order-row .order-time { color: var(--muted); font-size: 11px; margin-top: 2px; }
.order-row .row-x {
  background: transparent; border: 0;
  color: var(--muted); font-size: 16px;
  cursor: pointer; padding: 4px 8px; border-radius: 4px;
  line-height: 1;
}
.order-row .row-x:hover { background: var(--danger-soft); color: var(--danger); }

/* Order detail */
#order-detail { padding: 20px; }
.detail-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
/* min-width:0 是必须的：flex item 默认 min-width:auto，会把最小宽度
   撑到最长不可断词那么宽。副标题里有订单号这种无空格长串，
   少了这一行整张详情卡会被顶出屏幕（手机上表现为右侧被裁掉）。 */
.detail-title { flex: 1; min-width: 0; }
.detail-title > div:first-child { font-weight: 600; font-size: 16px; color: var(--ink); }
/* 订单号 / 交易号是无空格长串，必须允许在任意位置断行 */
.detail-title .muted { overflow-wrap: anywhere; }
.detail-price {
  font-size: 20px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.qr-block {
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.qr-block img {
  width: 200px; height: 200px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.qr-info { flex: 1; min-width: 200px; }
.qr-info .amount {
  font-size: 28px; font-weight: 600; color: var(--ink);
  margin: 6px 0; font-variant-numeric: tabular-nums;
}
.steps { display: flex; gap: 24px; margin: 16px 0; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
/* flex-shrink:0 否则窄屏下 8px 的圆点会被压成椭圆 */
.dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--line-strong); }
.dot.active {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}
.number-block {
  background: var(--bg);
  padding: 14px; border-radius: var(--radius);
  margin: 12px 0;
}
/* AI 订单会把账号（可能是很长的邮箱或 token）渲染进 .number-text，
   .sms-code 也可能是长密钥，两者都要允许任意位置断行 */
.number-text {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 20px; font-weight: 600; margin: 4px 0;
  color: var(--ink); letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}
.sms-code {
  font-size: 28px; font-weight: 700;
  color: var(--success); letter-spacing: 3px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.error-msg {
  color: var(--danger); font-size: 13px; margin-top: 10px;
  padding: 10px 12px;
  background: var(--danger-soft);
  border-radius: var(--radius);
}
.actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.actions button {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-soft);
}
.actions button:hover { border-color: var(--ink); color: var(--ink); }
.actions button.danger {
  border-color: var(--danger-soft);
  color: var(--danger);
}
.actions button.danger:hover { background: var(--danger-soft); }

/* ---------- 联系区（/support 页面继续复用） ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.contact-info, .contact-form { padding: 20px; }
.contact-form h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.contact-notice {
  padding: 10px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
}
.contact-list { display: flex; flex-direction: column; gap: 6px; }
.contact-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 14px;
}
.contact-icon { font-size: 16px; }
.contact-label { color: var(--muted); min-width: 56px; font-size: 13px; }
.contact-value {
  color: var(--ink); font-weight: 500; flex: 1;
  word-break: break-all; text-decoration: none;
}
.contact-value:hover { color: var(--accent); }
.form-row { margin: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.form-row label { font-size: 13px; color: var(--ink-soft); }
.form-row input, .form-row textarea {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  outline: 0;
  background: var(--paper);
  font-family: inherit;
  color: var(--ink);
}
.form-row input:focus, .form-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.08);
}

/* Ticket list */
.ticket-list { display: flex; flex-direction: column; gap: 8px; }
.ticket-row {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.ticket-title {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 500; color: var(--ink); font-size: 14px;
}
.ticket-reply {
  margin: 8px 0; font-size: 13px; color: var(--ink-soft);
  padding: 10px 12px;
  background: var(--bg);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}
.ticket-status {
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 500;
}
.ticket-status.open { background: #fef3c7; color: #a16207; }
.ticket-status.replied { background: var(--success-soft); color: var(--success); }
.ticket-status.closed { background: var(--bg); color: var(--muted); }

/* ---------- 租号（新增） ---------- */
.rent-regions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.rent-region {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s;
  display: flex; align-items: center; gap: 12px;
}
.rent-region:hover { border-color: var(--ink); }
.rent-region .flag { font-size: 22px; }
.rent-region .region-name { flex: 1; font-weight: 500; color: var(--ink); font-size: 14px; }
.rent-region .region-count { font-size: 12px; color: var(--muted); }

.rent-plans {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.rent-plan {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
}
.rent-plan:hover { border-color: var(--ink); }
.rent-plan.selected {
  border-color: var(--ink);
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.rent-plan .plan-name { font-size: 13px; color: var(--muted); }
.rent-plan .plan-price {
  font-size: 22px; font-weight: 600; color: var(--ink);
  margin: 6px 0; font-variant-numeric: tabular-nums;
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  margin-top: auto;      /* 内容不满一屏时把页脚推到底部 */
  padding: 20px 0;
  color: var(--muted); font-size: 13px;
  flex-shrink: 0;
}
.footer .wrap {
  display: flex; justify-content: space-between; align-items: center;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 999px;
  font-size: 14px;
  opacity: 0; transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(20, 40, 61, 0.18);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- CAPTCHA (通用弹窗) ---------- */
.captcha-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(17,24,39,0.42);
  display: flex; align-items: center; justify-content: center;
}
.captcha-card {
  background: var(--paper); border-radius: var(--radius-lg);
  width: min(360px, 92vw); padding: 20px;
  box-shadow: 0 20px 60px rgba(17,24,39,0.25);
}
.captcha-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.captcha-close {
  background: transparent; border: 0; font-size: 22px; color: var(--muted); cursor: pointer;
}
.captcha-tip { color: var(--ink-soft); font-size: 14px; margin: 4px 0 12px; }
.captcha-input {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 14px; outline: 0;
}
.captcha-btn {
  width: 100%; padding: 10px 12px; margin-top: 10px;
  border: 0; border-radius: var(--radius);
  background: var(--accent); color: #fff; cursor: pointer; font-weight: 600;
}
.captcha-err { color: var(--danger); font-size: 12px; margin-top: 6px; }
.cap-slider { position: relative; height: 40px; margin-top: 10px; user-select: none; }
.cap-track {
  position: absolute; inset: 0;
  background: #f3f4f6; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden;
}
.cap-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, #ddd6fe, var(--accent));
}
.cap-handle {
  position: absolute; top: 3px; left: 3px;
  width: 34px; height: 34px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: grab; font-size: 18px; color: var(--muted);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08); z-index: 2;
}
.cap-slider.ok .cap-handle { background: var(--success); color: transparent; border-color: var(--success); }
.cap-slider.ok .cap-handle::before { content: '✓'; color: #fff; font-size: 16px; font-weight: bold; }

/* ---------- AI 商品页 ---------- */
.ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.ai-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column;
}
.ai-card:hover { border-color: var(--ink); box-shadow: var(--shadow-hover); }
.ai-card .cover {
  width: 100%; aspect-ratio: 4/3;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px;
  overflow: hidden;
}
.ai-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-card .content { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ai-card .cat {
  font-size: 11px; color: var(--muted);
  letter-spacing: 0.05em; text-transform: uppercase;
}
.ai-card .name {
  font-size: 15px; font-weight: 600; color: var(--ink);
}
.ai-card .desc {
  color: var(--muted); font-size: 12px; margin: 4px 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ai-card .price-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 8px; margin-top: auto;
  border-top: 1px solid var(--line);
}
.ai-card .price {
  color: var(--ink); font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums;
}
.ai-card .price small { font-size: 12px; color: var(--muted); font-weight: 400; margin-right: 4px; }
.ai-card .stock { font-size: 11px; color: var(--muted); }
.ai-card .stock.oos { color: var(--danger); }

.ai-detail img.cover-lg {
  width: 100%; max-height: 260px; object-fit: cover;
  border-radius: var(--radius); margin-bottom: 16px;
}
/* 商品详情富文本：内容由后台富文本编辑器产出，服务端已白名单净化 */
.ai-detail .prose {
  font-size: 14px; line-height: 1.8;
  color: var(--ink-soft); word-break: break-word;
}
.ai-detail .prose > :first-child { margin-top: 0; }
.ai-detail .prose > :last-child { margin-bottom: 0; }
.ai-detail .prose h1,
.ai-detail .prose h2 {
  font-size: 16px; font-weight: 600; color: var(--ink);
  margin: 18px 0 8px;
}
.ai-detail .prose h3,
.ai-detail .prose h4 {
  font-size: 14px; font-weight: 600; color: var(--ink);
  margin: 14px 0 6px;
}
.ai-detail .prose p { margin: 0 0 10px; }
.ai-detail .prose ul,
.ai-detail .prose ol { margin: 0 0 10px; padding-left: 20px; }
.ai-detail .prose li { margin: 3px 0; }
.ai-detail .prose a { color: var(--accent, #4f46e5); text-decoration: underline; }
.ai-detail .prose img {
  max-width: 100%; height: auto;
  border-radius: var(--radius); margin: 8px 0;
}
.ai-detail .prose blockquote {
  margin: 0 0 10px; padding: 8px 12px;
  border-left: 3px solid var(--line); background: var(--paper);
  color: var(--muted);
}
.ai-detail .prose pre {
  margin: 0 0 10px; padding: 10px 12px;
  background: #111827; color: #e5e7eb;
  border-radius: var(--radius); overflow-x: auto;
  font-size: 12.5px; line-height: 1.6;
}
.ai-detail .prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
}
.ai-detail .prose pre code { background: none; padding: 0; }
.ai-detail .prose hr {
  border: 0; border-top: 1px solid var(--line); margin: 14px 0;
}
.ai-detail .prose table {
  width: 100%; border-collapse: collapse; margin: 0 0 10px; font-size: 13px;
}
.ai-detail .prose th,
.ai-detail .prose td {
  border: 1px solid var(--line); padding: 6px 8px; text-align: left;
}
.ai-detail .prose th { background: var(--paper); font-weight: 600; }
.ai-skus {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0;
}
.ai-sku {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; font-size: 13px;
}
.ai-sku.selected { border-color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
.ai-sku .stock { color: var(--muted); font-size: 11px; margin-left: 6px; }
.ai-sku.oos { opacity: 0.5; cursor: not-allowed; }
.discount-row { display: flex; gap: 8px; margin: 10px 0; }
.discount-row input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.discount-hint { color: var(--success); font-size: 12px; margin-top: -6px; }

.wechat-hint {
  background: #fef3c7; color: #92400e;
  padding: 10px 12px; border-radius: 8px;
  font-size: 13px; margin: 10px 0;
}

/* ---------- 响应式 ---------- */

/* 平板 / 窄桌面：收紧栅格 */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .offers { grid-template-columns: 1fr; }
}

/* 手机 */
@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  /* 手机上收紧内容与页脚之间的留白，60px 在小屏上太空 */
  body > main.wrap { padding-bottom: 24px; }

  /* 顶栏：手机上把导航链接整体隐藏，交给底部导航栏。
     之前没隐藏，6 个中文链接被挤在 60px 高的栏里，文字被压成竖排。 */
  .topbar .wrap { height: 54px; }
  .topnav a { display: none; }
  .topnav { gap: 0; }
  .lang-btn { margin-left: 0; }
  .lang-switch .lang-btn { margin-left: 0; }
  /* 菜单右对齐到按钮，别顶出屏幕 */
  .lang-menu { right: 0; min-width: 160px; }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 14px; max-width: 52vw; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }
  .brand-mark { width: 27px; height: 27px; font-size: 11px; }

  .hero { padding: 26px 0 18px; }
  .hero h1 { font-size: 21px; line-height: 1.35; }
  .tip { font-size: 13.5px; margin-bottom: 18px; }

  /* 搜索栏：三个元素在一行放不下，改成两行布局 */
  .search-input-wrap { flex-wrap: wrap; padding: 6px; gap: 4px; }
  .country-chip { order: 1; flex: 0 0 auto; max-width: 46%; padding: 7px 9px; }
  .search-divider { display: none; }
  .search-icon { display: none; }
  .search-input-wrap input#q-service {
    order: 2; flex: 1 1 40%; font-size: 15px; padding: 7px 4px; min-width: 0;
  }
  .search-input-wrap button#btn-search {
    order: 3; flex: 1 0 100%; padding: 10px; margin-top: 2px;
  }
  .chip-name { max-width: 84px; }
  .suggest-box, .country-panel { top: 100%; margin-top: 6px; }
  .country-panel { width: 100%; }

  .section { margin: 26px 0; }
  .section-head { flex-wrap: wrap; gap: 6px; }
  .section-head h2 { font-size: 15px; }

  /* 卡片：手机两列，信息密度合适且不会太窄 */
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card { padding: 12px; border-radius: 12px; }
  .card .name { font-size: 13.5px; margin-top: 6px; }
  .card .desc { font-size: 11.5px; min-height: 0; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .card .price { font-size: 16px; }
  .card .country { font-size: 11px; }
  .hot-badge { top: 7px; right: 7px; font-size: 9.5px; padding: 2px 6px; }

  /* AI 商品：手机上改成横向列表行。
     原来是单列铺满 + 4:3 封面，一张卡片就有 400px 高，一屏只能看一个半。
     现在封面收成左侧 96px 缩略图，文字在右，单行约 115px。 */
  .ai-grid { grid-template-columns: 1fr; gap: 10px; }
  .ai-card { flex-direction: row; border-radius: 12px; }
  .ai-card .cover {
    flex: 0 0 96px; width: 96px;
    aspect-ratio: auto;          /* 去掉 4/3，改为跟随卡片高度 */
    align-self: stretch;
    border-right: 1px solid var(--line);
    font-size: 12px;
  }
  .ai-card .content { padding: 10px 12px; gap: 2px; min-width: 0; }
  .ai-card .cat { font-size: 10.5px; }
  .ai-card .name {
    font-size: 14px; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .ai-card .desc { font-size: 11.5px; margin: 2px 0; line-height: 1.45; }
  .ai-card .price-row { padding-top: 7px; }
  .ai-card .price { font-size: 16px; }
  .ai-card .price small { font-size: 11px; margin-right: 3px; }
  .clear-badge { top: 6px; left: 6px; font-size: 9.5px; padding: 2px 6px; }
  .ai-detail img.cover-lg { max-height: 170px; margin-bottom: 12px; }
  /* 骨架屏跟着变矮，别在加载时先撑出一大片 */
  .skl-rect { height: 88px; }

  /* 报价行：手机上保持单行紧凑排布。
     之前用 flex-wrap 把价格和按钮挤到第二行，单张卡片就要吃掉 150px 高，
     弹窗里只能露出两条半。现在压成一行约 56px，一屏能看七八条。 */
  .offers { gap: 8px; }
  .offer { padding: 9px 10px; gap: 9px; border-radius: 10px; }
  /* iconEl 把尺寸写在行内 style 上，只能用 important 压小 */
  .offer > .ic {
    width: 32px !important; height: 32px !important; font-size: 13px !important;
    border-radius: 7px;
  }
  .offer .offer-main { flex: 1 1 auto; min-width: 0; }
  .offer .service {
    font-size: 13.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .offer .sub {
    font-size: 11.5px; margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .offer .price { font-size: 15px; flex-shrink: 0; }
  /* 比下面那条通用 button 规则特异性高，不会被 40px 撑起来 */
  .offer button {
    padding: 6px 11px; font-size: 12.5px; border-radius: 7px;
    min-height: 32px; line-height: 1.2;
  }

  /* ---- 订单列表行 ---- */
  .order-row { padding: 9px 10px; gap: 9px; border-radius: 10px; }
  /* iconEl 把尺寸写在行内 style 上，只能用 important 压小 */
  .order-row > .ic {
    width: 32px !important; height: 32px !important; font-size: 13px !important;
    border-radius: 7px;
  }
  .order-row .order-title {
    font-size: 13.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .order-row .order-sub { font-size: 11.5px; }
  .order-row .order-price { font-size: 13.5px; }
  .order-row .order-time { font-size: 10.5px; }
  /* 比通用 button{min-height:40px} 特异性高，别把删除叉撑成 40px 高 */
  .order-row .row-x { min-height: 28px; padding: 2px 5px; font-size: 15px; }
  .row-pay, .row-detail { font-size: 11px; padding: 3px 8px; }

  /* ---- 订单详情 ---- */
  /* #order-detail 用了 id 特异性（padding:20px），.card 的手机 padding 压不过它 */
  #order-detail { padding: 14px; }
  .detail-head { gap: 10px; margin-bottom: 12px; padding-bottom: 12px; }
  .detail-head > .ic {
    width: 36px !important; height: 36px !important; font-size: 15px !important;
  }
  .detail-title > div:first-child { font-size: 15px; }
  .detail-price { font-size: 17px; flex-shrink: 0; align-self: flex-start; }

  /* 支付区：二维码 200px + 文案 min-width 200px + gap 20px = 需要 420px，
     而手机上这个容器只有约 280px，硬并排就会横向溢出、把卡片顶出屏幕
     （截图里二维码右边的金额和提示被裁掉就是这个原因）。
     改成上下排：二维码居中，文案占满整行。 */
  .qr-block {
    flex-direction: column; align-items: stretch;
    gap: 12px; padding: 14px;
  }
  .qr-block img {
    width: 100%; max-width: 190px; height: auto;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
  }
  .qr-info { flex: 1 1 100%; min-width: 0; text-align: center; }
  .qr-info .amount { font-size: 24px; margin: 4px 0; }

  /* 三个步骤在 390px 上 24px 间距会折行，收紧一点 */
  .steps { gap: 10px 14px; margin: 12px 0; }
  .step { font-size: 12px; gap: 6px; }

  .number-block { padding: 12px; }
  .number-text { font-size: 17px; }
  .sms-code { font-size: 24px; letter-spacing: 2px; }

  .actions { gap: 6px; }
  .actions button { min-height: 36px; padding: 6px 12px; font-size: 12.5px; }

  .contact-grid { grid-template-columns: 1fr; }
  .modal-inner { width: 94vw; max-height: 88vh; }

  /* 触控目标至少 40px 高 */
  .link-btn { padding: 8px 10px; }
  button, .btn-primary { min-height: 40px; }
}

/* 超窄屏（iPhone SE 等） */
@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 19px; }
  .offer { gap: 7px; padding: 8px 9px; }
  .offer > .ic { width: 28px !important; height: 28px !important; }
  .offer .price { font-size: 14px; }
  .offer button { padding: 6px 9px; font-size: 12px; }
  .ai-card .cover { flex: 0 0 82px; width: 82px; }
  .ai-card .content { padding: 9px 10px; }
  /* 订单页再收一档 */
  .order-row > .ic { width: 28px !important; height: 28px !important; }
  .order-row { gap: 8px; padding: 8px 9px; }
  .qr-block img { max-width: 168px; }
  .qr-info .amount { font-size: 21px; }
  .steps { gap: 8px 12px; }
  .step { font-size: 11.5px; }
  .number-text { font-size: 15.5px; }
  .sms-code { font-size: 21px; letter-spacing: 1.5px; }
  .detail-price { font-size: 16px; }
}

/* ---------- Skeleton ---------- */
@keyframes skl-shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skl {
  background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 800px 100%;
  animation: skl-shimmer 1.4s infinite linear;
  border-radius: 6px;
}
.skl-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.skl-line { height: 12px; }
.skl-line.w60 { width: 60%; }
.skl-line.w80 { width: 80%; }
.skl-line.w40 { width: 40%; }
.skl-square { width: 44px; height: 44px; border-radius: 10px; }
.skl-rect { height: 140px; border-radius: 8px; }

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--muted);
}
.empty-state .es-emoji { font-size: 42px; opacity: 0.6; }
.empty-state .es-title { color: var(--ink); font-size: 15px; font-weight: 500; margin-top: 10px; }
.empty-state .es-hint { font-size: 13px; margin-top: 6px; }

/* ---------- 移动端底部导航 ---------- */
.mobile-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.mobile-nav-inner {
  display: flex; align-items: stretch; justify-content: space-around;
  padding: 4px 2px;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}
.mobile-nav .mn-item {
  position: relative;
  flex: 1 1 0;
  color: var(--muted); text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  padding: 7px 2px 6px;
  border-radius: 10px;
  min-height: 48px;              /* 保证触控目标足够大 */
  transition: color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav .mn-ico {
  width: 22px; height: 22px;
  display: block;
}
.mobile-nav .mn-label {
  font-size: 10.5px; line-height: 1;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.mobile-nav .mn-item.active { color: var(--accent-strong); }
.mobile-nav .mn-item.active .mn-ico { stroke-width: 2.1; }
.mobile-nav .mn-item:active { background: var(--accent-soft); }
/* 订单有未完成时的小红点 */
.mobile-nav .mn-dot {
  position: absolute; top: 6px; right: 50%;
  transform: translateX(16px);
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px #fff;
}

@media (max-width: 640px) {
  .mobile-nav { display: block; }
  /* 给底栏留出空间，避免内容被遮住。
     配合 body 的 flex 布局，页脚会稳定停在底部导航正上方。 */
  .footer { margin-bottom: 60px; }
  body { padding-bottom: env(safe-area-inset-bottom); }
  .topnav .badge { display: none !important; }

  /* 页脚两段文字在 375px 上一行放不下，会被裁掉右半截，改成上下两行 */
  .footer { padding: 14px 0; font-size: 12px; }
  .footer .wrap {
    flex-direction: column; align-items: flex-start; gap: 3px;
  }
  .footer .muted { font-size: 11.5px; }
}

/* ---------- Hero 分类快捷 ---------- */
.quick-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 12px auto 0;
  max-width: 640px;
}
.quick-tile {
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  display: flex; align-items: center; gap: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.quick-tile:hover { border-color: var(--ink); box-shadow: var(--shadow-hover); }
.quick-tile .qt-ico {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.quick-tile .qt-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.quick-tile .qt-desc { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ---------- 图标 / 占位 ---------- */
.ui-ico { display: block; }
.ic-fallback {
  background: var(--bg-tint);
  color: var(--ink-soft);
  font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.empty-state .es-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px;
  margin: 0 auto;
  border-radius: 14px;
  background: var(--bg-tint);
  color: var(--muted);
}
.contact-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  color: var(--ink-soft);
  flex-shrink: 0;
}

/* 扁平化按钮的 hover：用加深而不是提亮，视觉更稳 */
.btn-primary:hover,
.search-input-wrap button#btn-search:hover,
.offer button:hover { background: var(--accent-strong); filter: none; }

/* ---------- 清仓商品 ---------- */
.ai-card { position: relative; }
.ai-card.clearance { border-color: #fdba74; }
.ai-card.clearance:hover { border-color: var(--hot); }
.clear-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--hot); color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 4px;
  letter-spacing: .02em;
}
.ai-card.clearance .price { color: var(--hot); }

/* ==================== 独立支付页 ==================== */
.pay-page { max-width: 720px; margin: 28px auto 48px; }

.pay-head {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 14px;
}
.pay-status-badge {
  display: inline-block;
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  margin-bottom: 10px;
}
.pay-status-badge.wait { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.pay-status-badge.ok   { background: var(--success-soft); color: var(--success); border: 1px solid #a7f3d0; }
.pay-status-badge.bad  { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecdd3; }
.pay-status-badge.gray { background: var(--bg-tint); color: var(--muted); border: 1px solid var(--line); }
.pay-title {
  margin: 0 0 6px; font-size: 19px; font-weight: 650;
  color: var(--ink); line-height: 1.4; word-break: break-word;
}
.pay-meta { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pay-meta .sep { opacity: .5; }
.pay-amount {
  margin-top: 12px;
  font-size: 30px; font-weight: 700; color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.pay-body { display: flex; flex-direction: column; gap: 14px; }
.pay-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.pay-card.warn { background: #fffbeb; border-color: #fde68a; }

.pay-qr-card { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.pay-qr {
  width: 190px; height: 190px; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.pay-qr-side { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; }
.pay-qr-tip { font-size: 14px; color: var(--ink-soft); }
.pay-qr-amount {
  font-size: 26px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pay-waiting {
  display: flex; align-items: center; gap: 9px;
  color: var(--muted); font-size: 13px;
  padding: 2px 4px;
}
.spinner {
  width: 14px; height: 14px; flex-shrink: 0;
  border: 2px solid var(--line-strong); border-top-color: var(--accent);
  border-radius: 50%;
  animation: pay-spin .8s linear infinite;
}
@keyframes pay-spin { to { transform: rotate(360deg); } }

.pay-result { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius-lg); }
.pay-result .pr-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 22px; font-weight: 700;
}
.pay-result .pr-title { font-size: 17px; font-weight: 650; }
.pay-result.ok { background: var(--success-soft); }
.pay-result.ok .pr-icon { background: var(--success); color: #fff; }
.pay-result.ok .pr-title { color: var(--success); }
.pay-result.bad { background: var(--danger-soft); }
.pay-result.bad .pr-icon { background: var(--danger); color: #fff; }
.pay-result.bad .pr-title { color: var(--danger); }
.pay-result.gray { background: var(--bg-tint); }
.pay-result.gray .pr-icon { background: var(--muted); color: #fff; }

.kv-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px dashed var(--line);
  flex-wrap: wrap;
}
.kv-row:last-child { border-bottom: 0; }
.kv-label { color: var(--muted); font-size: 13px; min-width: 62px; }
.kv-value {
  flex: 1; min-width: 0;
  font-size: 14px; word-break: break-all;
  background: var(--bg-tint); padding: 5px 9px; border-radius: 6px;
}

/* ---------- USDT ---------- */
.usdt-head { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.usdt-head strong { font-size: 15px; }
.usdt-net {
  font-size: 11.5px; font-weight: 600;
  background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0;
  padding: 2px 8px; border-radius: 999px;
}
.usdt-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.usdt-row .lbl { color: var(--muted); font-size: 12.5px; min-width: 58px; }
.usdt-amount { font-size: 20px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.usdt-addr {
  flex: 1; min-width: 0; word-break: break-all;
  font-size: 12.5px; background: var(--bg-tint); padding: 5px 8px; border-radius: 6px;
}
.usdt-warn {
  margin-top: 16px; padding: 12px 14px;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius);
  font-size: 13px; color: #78350f;
}
.usdt-warn ul { margin: 6px 0 0; padding-left: 20px; }
.usdt-warn li { margin: 3px 0; }
.usdt-tx { margin-top: 16px; }
.usdt-tx-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.usdt-tx-row input {
  flex: 1; min-width: 200px;
  padding: 9px 11px; font-size: 13px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  outline: 0; font-family: ui-monospace, Menlo, monospace;
}
.usdt-tx-row input:focus { border-color: var(--accent); box-shadow: var(--ring); }

.pay-actions {
  display: flex; align-items: center; gap: 10px;
  margin-top: 18px; flex-wrap: wrap;
}
.pay-actions .spacer { flex: 1 1 auto; }

@media (max-width: 640px) {
  .pay-page { margin: 16px auto 32px; }
  .pay-head { padding: 16px; }
  .pay-title { font-size: 16.5px; }
  .pay-amount { font-size: 26px; }
  .pay-card { padding: 14px; }
  .pay-qr-card { gap: 14px; justify-content: center; }
  .pay-qr { width: 170px; height: 170px; }
  .pay-qr-side { min-width: 100%; }
  .usdt-tx-row input { min-width: 100%; }
  .usdt-tx-row button { width: 100%; }
}

/* 订单行上的支付/详情入口 */
.row-pay, .row-detail {
  display: inline-block; margin-top: 4px;
  font-size: 12px; text-decoration: none;
  padding: 3px 9px; border-radius: 999px;
}
.row-pay {
  background: var(--accent); color: #fff; font-weight: 600;
}
.row-pay:hover { background: var(--accent-strong); color: #fff; }
.row-detail { color: var(--muted); border: 1px solid var(--line); }
.row-detail:hover { color: var(--accent-strong); border-color: var(--accent); }
