:root {
  --ink: #0d1117;
  --ink-2: #1c2430;
  --muted: #6b7280;
  --muted-2: #98a2b3;
  --line: #e8eaef;
  --bg: #f6f7f9;
  --card: #ffffff;
  --brand: #00b578;
  --brand-2: #0a9d69;
  --brand-soft: #e7f8f1;
  --warn: #f59e0b;
  --danger: #e5484d;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
  --shadow-sm: 0 2px 8px rgba(16, 24, 40, 0.06);
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.wrap { width: min(1200px, calc(100% - 48px)); margin: 0 auto; }

/* ---------------- header ---------------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; gap: 26px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(11, 26, 74, .18)); }
.brand-mark { display: none; }
.brand b { display: block; font-size: 15px; letter-spacing: 1.2px; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: 2px; }
.nav { display: flex; gap: 22px; font-size: 14px; color: #475467; }
.nav a { padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.active { color: var(--ink); border-color: var(--brand); }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search { position: relative; }
.search input {
  width: 230px; height: 38px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; padding: 0 40px 0 16px; font-size: 13px; outline: none;
  transition: box-shadow .2s, border-color .2s;
}
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(0, 181, 120, .12); }
.search .s-icon { position: absolute; right: 14px; top: 9px; color: var(--muted-2); font-size: 14px; }
.icon-btn {
  position: relative; width: 40px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 17px; display: grid; place-items: center;
}
.icon-btn:hover { border-color: #cfd4dc; }
.badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--brand); color: #fff; border-radius: 999px; font-size: 11px;
  display: grid; place-items: center; font-weight: 600;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .18s; white-space: nowrap;
  background: #fff; color: var(--ink);
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #1f2937; }
.btn.brand { background: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(0, 181, 120, .22); }
.btn.brand:hover { background: var(--brand-2); }
.btn.ghost { border-color: var(--line); }
.btn.ghost:hover { border-color: #cfd4dc; background: #fafbfc; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { height: 48px; padding: 0 26px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ---------------- hero ---------------- */
.hero {
  position: relative; overflow: hidden; color: #e8f5ef;
  background: radial-gradient(1200px 500px at 78% -10%, rgba(0, 200, 138, .28), transparent 60%),
              radial-gradient(800px 400px at 8% 110%, rgba(59, 130, 246, .18), transparent 60%),
              linear-gradient(160deg, #0a1017 0%, #0d1621 55%, #0a141a 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 65%);
}
.hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 64px 0 70px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px;
  border-radius: 999px; border: 1px solid rgba(0, 200, 138, .35); background: rgba(0, 200, 138, .1);
  color: #4ade9d; font-size: 12px; letter-spacing: .6px; font-weight: 600;
}
.hero h1 { font-size: 46px; line-height: 1.18; margin: 18px 0 14px; letter-spacing: -1px; color: #fff; }
.hero h1 em { font-style: normal; color: #45e0a6; }
.hero p.lead { color: #9db3ab; font-size: 15px; max-width: 460px; margin: 0 0 26px; }
.hero-actions { display: flex; gap: 12px; align-items: center; }
.hero-stats { display: flex; gap: 36px; margin-top: 40px; }
.hero-stats b { display: block; font-size: 22px; color: #fff; letter-spacing: -.5px; }
.hero-stats span { color: #7f948d; font-size: 12px; }

.paycard {
  position: relative; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 18px; padding: 22px; backdrop-filter: blur(16px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
}
.paycard .pc-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #9fb3ac; }
.paycard .pc-amount { font-size: 38px; font-weight: 700; color: #fff; letter-spacing: -1px; margin: 10px 0 2px; }
.paycard .pc-amount small { font-size: 14px; color: #45e0a6; font-weight: 600; margin-left: 6px; }
.paycard .pc-row { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px dashed rgba(255,255,255,.12); font-size: 12.5px; color: #b9c9c2; }
.paycard .pc-row span:last-child { color: #e6f4ee; font-family: var(--mono); }
.pc-status { display: inline-flex; align-items: center; gap: 6px; color: #4ade9d; font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade9d; box-shadow: 0 0 0 4px rgba(74, 222, 157, .18); }

/* ---------------- sections ---------------- */
.section { padding: 54px 0 10px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.section-head h2 { font-size: 24px; margin: 0; letter-spacing: -.4px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px;
}
.chip:hover { border-color: #cfd4dc; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #dfe3ea; }
.pcard .thumb { display: block; position: relative; aspect-ratio: 1/1; background: #f2f4f7; }
.pcard .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard .tags { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.tag {
  padding: 3px 8px; border-radius: 6px; background: rgba(13, 17, 23, .78); color: #fff;
  font-size: 11px; letter-spacing: .3px; backdrop-filter: blur(4px);
}
.tag.sale { background: rgba(229, 72, 77, .92); }
.pcard .body { padding: 14px 14px 16px; }
.pcard h3 { margin: 0 0 4px; font-size: 15px; letter-spacing: -.2px; }
.pcard .sub { color: var(--muted); font-size: 12.5px; height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-row { display: flex; align-items: baseline; gap: 6px; margin: 10px 0 12px; }
.price { color: var(--brand-2); font-weight: 700; font-size: 20px; letter-spacing: -.4px; }
.price small { font-size: 11.5px; font-weight: 600; color: var(--brand-2); margin-left: 2px; }
.price-cny { color: var(--muted-2); font-size: 12px; }
.price-old { color: var(--muted-2); text-decoration: line-through; font-size: 12px; }
.pcard .foot { display: flex; gap: 8px; align-items: center; }
.pcard .foot .btn { flex: 1; }

/* features */
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 8px 0 20px; }
.feat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feat .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-2); display: grid; place-items: center; font-size: 19px; }
.feat h4 { margin: 14px 0 6px; font-size: 15px; }
.feat p { margin: 0; color: var(--muted); font-size: 13px; }

/* ---------------- product detail ---------------- */
.crumbs { color: var(--muted); font-size: 12.5px; padding: 22px 0 18px; }
.crumbs a:hover { color: var(--ink); }
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
.detail .hero-img { border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.detail .hero-img img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.d-info h1 { font-size: 30px; line-height: 1.25; margin: 6px 0 8px; letter-spacing: -.6px; }
.d-info .sub { color: var(--muted); font-size: 14px; }
.price-box { background: linear-gradient(180deg, #f7fdfa, #ffffff); border: 1px solid #d9f2e7; border-radius: 16px; padding: 18px 20px; margin: 22px 0; }
.price-box .big { font-size: 34px; font-weight: 700; color: var(--brand-2); letter-spacing: -1px; }
.price-box .big small { font-size: 13px; margin-left: 4px; }
.price-box .note { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; height: 42px; background:#fff; }
.qty button { width: 40px; height: 100%; border: 0; background: transparent; cursor: pointer; font-size: 16px; color: var(--muted); }
.qty button:hover { background: #f6f7f9; color: var(--ink); }
.qty input { width: 52px; height: 100%; border: 0; text-align: center; font-size: 14px; font-family: var(--mono); border-left: 1px solid var(--line); border-right: 1px solid var(--line); outline: none; }
.d-actions { display: flex; gap: 12px; margin: 18px 0 8px; }
.d-actions .btn { flex: 1; }
.meta-list { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.meta-list b { color: var(--ink); font-weight: 600; margin-right: 6px; }
.desc { margin-top: 26px; color: #374151; font-size: 14px; line-height: 1.9; }

/* ---------------- table / list ---------------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; background: #fafbfc; padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid #f1f3f6; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .mono { font-family: var(--mono); font-size: 12.5px; }
.empty { padding: 60px 0; text-align: center; color: var(--muted); }
.empty .ico { font-size: 34px; opacity: .5; display: block; margin-bottom: 10px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat b { display: block; font-size: 26px; letter-spacing: -.8px; margin-top: 4px; }
.stat b small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 4px; }

/* ---------------- cart / checkout ---------------- */
.cart-wrap { display: grid; grid-template-columns: 1.5fr .9fr; gap: 24px; align-items: start; }
.cart-line { display: grid; grid-template-columns: 88px 1fr auto auto; gap: 16px; align-items: center; padding: 16px 20px; border-bottom: 1px solid #f1f3f6; }
.cart-line:last-child { border-bottom: 0; }
.cart-line img { width: 88px; height: 88px; border-radius: 10px; object-fit: cover; background: #f2f4f7; }
.cart-line h4 { margin: 0 0 2px; font-size: 14px; }
.cart-line .sku { color: var(--muted-2); font-size: 12px; font-family: var(--mono); }
.line-amount { font-weight: 700; color: var(--brand-2); min-width: 90px; text-align: right; }
.link-danger { color: var(--danger); font-size: 12.5px; cursor: pointer; background: none; border: 0; padding: 0; }
.summary { position: sticky; top: 88px; }
.sum-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13.5px; color: #475467; }
.sum-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; font-size: 15px; color: var(--ink); font-weight: 600; }
.sum-row.total b { color: var(--brand-2); font-size: 24px; letter-spacing: -.6px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12.5px; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13.5px;
  outline: none; background: #fff; font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(0, 181, 120, .1); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { color: var(--muted-2); font-size: 12px; }

/* ---------------- pay page ---------------- */
.pay-shell { max-width: 520px; margin: 36px auto 60px; }
.pay-head { text-align: center; margin-bottom: 18px; }
.pay-head h1 { font-size: 22px; margin: 0 0 6px; }
.pay-head p { color: var(--muted); font-size: 13px; margin: 0; }
.pay-body { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: var(--shadow-sm); }
.amount-hero { text-align: center; padding: 6px 0 18px; }
.amount-hero .amt { font-size: 44px; font-weight: 800; letter-spacing: -1.6px; color: var(--ink); }
.amount-hero .amt small { font-size: 15px; color: var(--brand-2); margin-left: 8px; letter-spacing: 0; }
.amount-hero .cny { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.countdown { margin: 8px auto 0; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); background: #f6f7f9; border-radius: 999px; padding: 5px 12px; }
.countdown b { font-family: var(--mono); color: var(--danger); font-weight: 600; }
.qr-box { text-align: center; padding: 8px 0 4px; }
.qr-box img { width: 190px; height: 190px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 8px; }
.qr-box .net { margin-top: 8px; font-size: 12px; color: var(--muted); }
.addr { display: flex; gap: 8px; align-items: center; background: #f8faf9; border: 1px dashed #cfe8de; border-radius: 10px; padding: 10px 12px; margin-top: 14px; }
.addr code { flex: 1; font-family: var(--mono); font-size: 12.5px; word-break: break-all; color: #1f2a37; }
.copy-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; height: 30px; padding: 0 12px; font-size: 12px; cursor: pointer; }
.copy-btn:hover { border-color: var(--brand); color: var(--brand-2); }
.pay-actions { display: flex; gap: 10px; margin-top: 18px; }
.pay-actions .btn { flex: 1; }
.steps { display: grid; gap: 2px; margin-top: 20px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; opacity: .55; }
.step.on { opacity: 1; }
.step .bullet { width: 22px; height: 22px; border-radius: 50%; background: #eef1f5; color: var(--muted); display: grid; place-items: center; font-size: 12px; flex: none; margin-top: 3px; }
.step.on .bullet { background: var(--brand); color: #fff; }
.step b { font-size: 13.5px; display: block; }
.step span { font-size: 12px; color: var(--muted); }
.warn-band { background: #fff8ec; border: 1px solid #fde3b8; color: #8a5a00; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 14px; }
.info-band { background: #f4f8ff; border: 1px solid #dbe7ff; color: #1e40af; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 14px; }

/* status chips */
.st { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 600; background: #f2f4f7; color: #475467; white-space: nowrap; }
.st.green { background: #e7f8f1; color: #067a52; }
.st.amber { background: #fff5e6; color: #a15c00; }
.st.red { background: #fdecec; color: #b42318; }
.st.blue { background: #eef4ff; color: #1d4ed8; }
.st.gray { background: #f2f4f7; color: #667085; }

/* orders */
.order-card { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 18px 22px; border-bottom: 1px solid #f1f3f6; }
.order-card:last-child { border-bottom: 0; }
.order-card .oc-head { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.order-card .oc-head b { font-family: var(--mono); color: var(--ink); font-size: 13px; }
.oc-items { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.oc-items img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.oc-total { text-align: right; }
.oc-total b { display: block; font-size: 18px; color: var(--brand-2); letter-spacing: -.4px; }
.oc-total .btn { margin-top: 8px; }

/* admin */
.admin-nav { display: flex; gap: 8px; margin: 20px 0; flex-wrap: wrap; }
.admin-nav button { height: 36px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; }
.admin-nav button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.pager button { height: 30px; min-width: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; padding: 0 10px; }
.pager button[disabled] { opacity: .4; cursor: not-allowed; }
.pager button.cur { background: var(--ink); color: #fff; border-color: var(--ink); }

/* modal */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(10, 15, 20, .5); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal { width: min(520px, 100%); background: #fff; border-radius: 18px; box-shadow: 0 40px 80px rgba(0,0,0,.3); overflow: hidden; max-height: 88vh; display: flex; flex-direction: column; }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: #fafbfc; }
.close-x { border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; }
.tabs { display: flex; gap: 24px; margin-bottom: 18px; }
.tabs button { background: none; border: 0; padding: 0 0 8px; font-size: 15px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--ink); font-weight: 600; border-color: var(--brand); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translate(-50%, 20px); z-index: 100;
  background: rgba(13, 17, 23, .92); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .25s; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: rgba(180, 35, 24, .95); }
.toast.ok { background: rgba(6, 95, 70, .95); }

/* footer */
.site-foot { margin-top: 70px; border-top: 1px solid var(--line); background: #fff; padding: 36px 0; color: var(--muted); font-size: 12.5px; }
.foot-inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.foot-inner b { color: var(--ink); font-size: 14px; letter-spacing: 1px; }

@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 38px; }
  .detail { gap: 26px; }
}
@media (max-width: 860px) {
  .head-inner { height: 58px; gap: 10px; }
  .nav { display: none; }
  .search { display: none; }
  .head-actions { gap: 10px; }
  .head-actions .btn { height: 38px; padding: 0 14px; font-size: 13px; }
  .hero-inner { grid-template-columns: 1fr; padding: 40px 0 46px; }
  .hero h1 { font-size: 34px; }
  .hero-stats { gap: 22px; margin-top: 26px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .detail { grid-template-columns: 1fr; }
  .cart-wrap { grid-template-columns: 1fr; }
  .summary { position: static; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .feats { grid-template-columns: 1fr; }
  .wrap { width: calc(100% - 28px); }
  .table th:nth-child(3), .table td:nth-child(3) { display: none; }
  .pay-shell { margin-top: 20px; }
}

/* language switch */
.lang-btn { height: 38px; min-width: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.22);
  background: transparent; color: #d9e7e1; font-size: 12.5px; letter-spacing: .04em; cursor: pointer; transition: .18s; }
.lang-btn:hover { background: rgba(255,255,255,.12); color: #fff; }

/* HD sub-address admin block */
.hd-box { border: 1px solid #dff1e8; background: #f6fbf9; border-radius: 14px; padding: 18px 18px 16px; margin-bottom: 8px; }
.hd-box-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.hd-box-head b { color: var(--ink); font-size: 14px; }
.hd-preview { display: grid; gap: 6px; margin-top: 14px; }
.hd-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #e6efe9; border-radius: 9px;
  padding: 8px 10px; font-size: 12px; overflow: hidden; }
.hd-row code { font-family: var(--mono); font-size: 11.5px; color: #0f6b4b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-idx { flex: 0 0 auto; font-family: var(--mono); color: #667085; }
.hd-row .hint { margin-left: auto; flex: 0 0 auto; }

/* 登录弹窗分隔线 */
.divider { display:flex; align-items:center; gap:10px; margin:16px 0 10px; color:#8a93a3; font-size:12px; }
.divider::before, .divider::after { content:""; flex:1; height:1px; background:#e6e9ef; }

/* =================================================================
   Mobile adaptation (<= 860px)  ·  bottom tab bar + touch layout
   ================================================================= */
.search-m { display: none; }
.tabbar { display: none; }

@media (max-width: 860px) {
  body {
    font-size: 14px;
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    /* clip 不建滚动容器，避免 WebKit 把 position:fixed 的底栏顶出视口 */
    overflow-x: hidden;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
  }
  .wrap { width: calc(100% - 24px); }

  /* ---- header: two rows, search full width ---- */
  .site-head { padding-top: env(safe-area-inset-top, 0px); }
  .head-inner {
    height: auto; min-height: 56px; flex-wrap: wrap; row-gap: 8px;
    padding: 8px 0 10px; gap: 10px;
  }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-logo { width: 32px; height: 32px; }
  .brand b { font-size: 14px; }
  .brand small { font-size: 10px; letter-spacing: 1.4px; }
  .head-actions { margin-left: auto; gap: 8px; }
  .head-actions .btn { height: 36px; padding: 0 12px; font-size: 13px; }
  .icon-btn { width: 38px; height: 36px; }
  .search-m { display: block; flex: 1 1 100%; order: 9; }
  .search-m input { width: 100%; height: 38px; font-size: 16px; }

  /* ---- bottom tab bar ---- */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
    width: 100%; max-width: 100vw; box-sizing: border-box; overflow: hidden;
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 20px rgba(11, 26, 74, .07);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateZ(0);
  }
  .tabbar a {
    position: relative; flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    height: 58px; color: #7c8798; font-size: 10.5px; letter-spacing: .2px;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar a.active { color: var(--brand-2); }
  .tabbar .ti { font-size: 19px; line-height: 1; display: block; }
  .tabbar .ti svg {
    width: 21px; height: 21px; display: block;
    fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
  }
  .tabbar a.active .ti { transform: translateY(-1px); }
  .tabbar a.active .ti svg { stroke-width: 2.1; }
  .tab-badge {
    position: absolute; top: 6px; left: 50%; margin-left: 6px;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
    background: var(--brand); color: #fff; font-size: 10px; font-weight: 700;
    display: none; place-items: center;
  }
  .tab-badge.show { display: grid; }

  /* ---- hero ---- */
  .hero-inner { padding: 30px 0 34px; gap: 24px; }
  .hero h1 { font-size: 27px; letter-spacing: -.4px; margin: 14px 0 10px; }
  .hero p.lead { font-size: 13.5px; margin-bottom: 20px; }
  .hero-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero-actions .btn { width: 100%; }
  .hero-stats { gap: 18px; margin-top: 22px; flex-wrap: wrap; }
  .hero-stats b { font-size: 18px; }
  .paycard { padding: 16px; }
  .paycard .pc-amount { font-size: 30px; }

  /* ---- sections ---- */
  .section { padding: 32px 0 6px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
  .section-head h2 { font-size: 19px; }
  .chips {
    flex-wrap: nowrap; overflow-x: auto; gap: 8px;
    /* 作为 column flex 的子项会被撑成 max-content，必须限宽，否则整页横向溢出，
       底部固定栏也会跟着变宽、最右侧的 Account 被切掉 */
    width: 100%; max-width: 100%; align-self: stretch;
    padding-bottom: 6px; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; height: 34px; font-size: 12.5px; padding: 0 14px; }

  /* ---- product grid ---- */
  .grid { gap: 12px; }
  .pcard .body { padding: 10px 10px 12px; }
  .pcard h3 { font-size: 13.5px; line-height: 1.35; }
  .pcard .sub { font-size: 11.5px; height: 18px; }
  .price { font-size: 17px; }
  .price-row { margin: 8px 0 10px; gap: 4px; flex-wrap: wrap; }
  .price-cny { font-size: 11px; }
  .tag { font-size: 10px; padding: 2px 6px; }
  .pcard .foot .btn { height: 34px; font-size: 12.5px; padding: 0 10px; }

  /* ---- product detail ---- */
  .crumbs { padding: 14px 0 12px; font-size: 12px; }
  .detail { gap: 18px; }
  .d-info h1 { font-size: 21px; }
  .d-info .sub { font-size: 13px; }
  .price-box { padding: 14px 16px; margin: 16px 0; }
  .price-box .big { font-size: 28px; }
  .d-actions { flex-direction: column; gap: 10px; }
  .d-actions .btn { width: 100%; }
  .qty-row { flex-wrap: wrap; gap: 10px; }
  .qty-row #stockHint { margin-left: auto; }
  .qty { height: 44px; }
  .qty button { width: 40px; }
  .qty input { flex: 1; }
  .desc { font-size: 13.5px; line-height: 1.8; }

  /* ---- cart ---- */
  .cart-line {
    grid-template-columns: 64px 1fr auto;
    grid-template-areas: "img info amount" "img qty qty";
    gap: 8px 12px; padding: 14px;
  }
  .cart-line > img { grid-area: img; width: 64px; height: 64px; }
  .cart-line > div:not(.qty):not(.line-amount) { grid-area: info; min-width: 0; }
  .cart-line .qty { grid-area: qty; justify-self: start; width: auto; height: 36px; }
  .cart-line .qty button { width: 34px; }
  .cart-line .qty input { width: 42px; flex: none; }
  .cart-line .line-amount { grid-area: amount; text-align: right; min-width: 0; font-size: 14px; }
  .cart-line h4 { font-size: 13.5px; }
  .panel-head { padding: 13px 14px; }
  .panel-head h3 { font-size: 14.5px; }
  .summary { position: static; margin-top: 14px; }
  .sum-row { font-size: 13px; }

  /* ---- forms: keep 16px to stop iOS zoom ---- */
  .field input, .field textarea, .field select { font-size: 16px; padding: 11px 12px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }

  /* ---- tables: horizontal scroll instead of squeeze ---- */
  .panel.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 560px; font-size: 12.5px; }
  .table th, .table td { padding: 10px 12px; }

  /* ---- stat cards ---- */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
  .stat { padding: 12px 14px; }
  .stat b { font-size: 19px; }
  .stat span { font-size: 11.5px; }

  /* ---- orders ---- */
  .order-card { grid-template-columns: 1fr; padding: 14px; gap: 10px; }
  .oc-total { text-align: left; display: flex; align-items: center; justify-content: space-between; }
  .oc-items { overflow-x: auto; }

  /* ---- pay page ---- */
  .pay-shell { margin: 16px auto 26px; }
  .pay-head h1 { font-size: 19px; }
  .pay-body { padding: 18px 16px; border-radius: 16px; }
  .amount-hero .amt { font-size: 34px; letter-spacing: -1px; }
  .amount-hero .amt small { font-size: 13px; }
  .qr-box img { width: min(200px, 62vw); height: auto; }
  .addr { flex-wrap: wrap; }
  .addr code { flex: 1 1 100%; order: 2; font-size: 12px; }
  .addr .copy-btn { order: 1; margin-left: auto; height: 28px; }
  .pay-actions { flex-direction: column; gap: 8px; }
  .pay-actions .btn { width: 100%; height: 46px; }
  .steps { margin-top: 14px; }

  /* ---- admin ---- */
  .admin-nav {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    gap: 6px; margin: 14px 0; padding-bottom: 4px; scrollbar-width: none;
  }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav button { flex: 0 0 auto; height: 34px; padding: 0 12px; font-size: 12.5px; }
  .hd-box { padding: 14px; }
  .hd-box-head { gap: 8px; }

  /* ---- modal: bottom sheet ---- */
  .overlay { padding: 0; align-items: flex-end; }
  .modal, .modal.wide {
    width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0;
  }
  .modal-head { padding: 16px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    flex-direction: column-reverse;
  }
  .modal-foot .btn { width: 100%; height: 46px; }
  .tabs { gap: 18px; }

  /* ---- toast & footer ---- */
  .toast { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); max-width: 88vw; font-size: 13px; }
  .site-foot { margin-top: 36px; padding: 24px 0 calc(24px + env(safe-area-inset-bottom, 0px)); }
  .foot-inner { gap: 18px; flex-direction: column; }
  .pager { justify-content: center; }
}

/* small phones */
@media (max-width: 420px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hero h1 { font-size: 24px; }
  .section-head h2 { font-size: 18px; }
  .amount-hero .amt { font-size: 30px; }
  .pcard .foot { gap: 6px; }
  .pcard .foot .btn { padding: 0 8px; font-size: 12px; }
  .brand small { display: none; }
  .head-actions .btn { padding: 0 10px; }
}

/* very small */
@media (max-height: 760px) {
  .boot-chain { display: none; }
}
@media (max-height: 680px) {
  .boot-copy p { display: none; }
}
@media (max-width: 340px) {
  .grid { grid-template-columns: 1fr; }
}

/* ---------------- boot / 开机页 ---------------- */
.boot {
  position: fixed; inset: 0; z-index: 10000; color: #e8f5ef;
  background:
    radial-gradient(900px 420px at 82% -12%, rgba(0, 200, 138, .30), transparent 62%),
    radial-gradient(700px 380px at 0% 108%, rgba(59, 130, 246, .16), transparent 60%),
    linear-gradient(160deg, #080d13 0%, #0c1520 55%, #08121a 100%);
  opacity: 0; transition: opacity .22s ease;
}
.boot.on { opacity: 1; }
.boot.off { opacity: 0; pointer-events: none; }
.boot-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: .28;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(circle at 72% 24%, #000 0%, transparent 68%);
  mask-image: radial-gradient(circle at 72% 24%, #000 0%, transparent 68%);
}
.boot-inner {
  position: relative; z-index: 2; width: 100%; max-width: 440px; margin: 0 auto; min-height: 100%;
  display: flex; flex-direction: column; gap: 16px;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px calc(env(safe-area-inset-bottom, 0px) + 16px);
}

.boot-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.boot-brand { display: flex; align-items: center; gap: 10px; }
.boot-brand img { width: 34px; height: 34px; border-radius: 9px; background: #fff; padding: 3px; object-fit: contain; }
.boot-brand b { display: block; font-size: 14px; line-height: 1.2; color: #fff; letter-spacing: .2px; }
.boot-brand small { display: block; margin-top: 2px; font-size: 9.5px; letter-spacing: .22em; color: #4ade9d; }
.boot-net {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; white-space: nowrap;
  border-radius: 999px; border: 1px solid rgba(0, 200, 138, .32); background: rgba(0, 200, 138, .1);
  font-size: 10.5px; letter-spacing: .1em; font-weight: 600; color: #9fe9c9;
}
.boot-net .dot { width: 6px; height: 6px; box-shadow: 0 0 0 3px rgba(74, 222, 157, .16); }

.boot-copy h1 { margin: 8px 0 8px; font-size: 26px; line-height: 1.22; letter-spacing: -.7px; color: #fff; font-weight: 800; }
.boot-copy h1 em { font-style: normal; color: #45e0a6; }
.boot-copy p { margin: 0; max-width: 330px; font-size: 12.5px; line-height: 1.55; color: #93a8a0; }

/* 收款回执卡：把 USDT 链上结算这件事直接摆到开机页上 */
.boot-receipt {
  margin: auto 0; padding: 13px 15px 11px; border-radius: 16px;
  background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .3);
}
.br-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; letter-spacing: .04em; color: #9fb3ac; }
.br-top .pc-status { font-size: 10px; }
.br-amt { margin: 6px 0 4px; font-size: 27px; font-weight: 800; letter-spacing: -1px; color: #fff; }
.br-amt small { margin-left: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; color: #45e0a6; }
.br-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 0; border-top: 1px dashed rgba(255, 255, 255, .12); margin-top: 5px; font-size: 10.5px; color: #93a8a0; }
.br-row b { font-weight: 600; color: #e6f4ee; font-family: var(--mono); font-size: 10.5px; }
.br-row b.ok { color: #45e0a6; }
.boot-rec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.boot-rec-head b { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #fff; letter-spacing: .2px; }
.boot-rec-head b::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: #00c88a; }
.boot-rec-head span { font-size: 10.5px; color: #7f948d; }
.boot-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.bc {
  display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 9px; border-radius: 14px;
  background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .09);
  transition: transform .15s ease, border-color .15s ease;
}
.bc:active { transform: scale(.975); border-color: rgba(0, 200, 138, .45); }
.bc-img { display: block; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, .06); }
.bc-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bc-name {
  font-size: 10.5px; line-height: 1.34; color: #d7e5df; min-height: 42px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.bc-price { font-size: 12.5px; font-weight: 700; letter-spacing: -.2px; color: #45e0a6; }
.bc-price small { margin-left: 2px; font-size: 9px; font-weight: 600; letter-spacing: .04em; opacity: .85; }
.bc.sk { pointer-events: none; }
.sk-line { display: block; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .1); }
.sk-line.short { width: 55%; }
.bc.sk .bc-img {
  background: linear-gradient(100deg, rgba(255,255,255,.05) 20%, rgba(255,255,255,.13) 40%, rgba(255,255,255,.05) 60%);
  background-size: 220% 100%; animation: shimmer 1.15s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }

.boot-chain {
  display: flex; align-items: center; gap: 6px; padding: 11px 10px; border-radius: 14px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08);
}
.bstep { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.bstep i {
  width: 18px; height: 18px; flex: 0 0 auto; border-radius: 50%; font-style: normal;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
  color: #4ade9d; background: rgba(0, 200, 138, .16); border: 1px solid rgba(0, 200, 138, .38);
}
.bstep span { font-size: 9.5px; line-height: 1.32; color: #a8bdb5; }
.bline { flex: 1 1 auto; min-width: 6px; height: 0; border-top: 1px dashed rgba(74, 222, 157, .38); }

.boot-foot { padding-top: 2px; display: flex; flex-direction: column; gap: 10px; }
.boot-go { width: 100%; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.boot-meta { display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; color: #7f948d; }
.boot-skip { color: #9fb3ac; border-bottom: 1px solid rgba(159, 179, 172, .45); padding-bottom: 1px; cursor: pointer; }
.boot-bar { height: 2px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, .1); }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #00c88a, #45e0a6); animation: bootbar 2.6s linear forwards; }
@keyframes bootbar { to { width: 100%; } }

@media (max-height: 760px) {
  .boot-chain { display: none; }
}
@media (max-height: 680px) {
  .boot-copy p { display: none; }
}
@media (max-width: 340px) {
  .boot-inner { padding-left: 16px; padding-right: 16px; gap: 14px; }
  .boot-copy h1 { font-size: 23px; }
  .bc-name { font-size: 10px; }
}


/* =================================================================
   Native shell (in-app) · 顶栏与底部导航由 APP 原生绘制
   ================================================================= */
html.inapp .site-head,
html.inapp .tabbar { display: none !important; }
html.inapp body { padding-bottom: 0 !important; }
html.inapp .toast { bottom: 20px !important; }
