:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --primary: #0071e3;
  --primary-dark: #0062c4;
  --green: #1a8f3c;
  --red: #d70015;
  --orange: #c35a00;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #ff5f6d, #845ef7 55%, #0a84ff); flex: none; display: flex; align-items: center; justify-content: center; color: #fff; }
.brand-logo svg { width: 18px; height: 18px; }
.hero-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.hero-brand .brand-logo { width: 24px; height: 24px; border-radius: 7px; }
.hero-brand .brand-logo svg { width: 15px; height: 15px; }
.nav { display: flex; gap: 18px; }
.nav a { color: var(--text); font-size: 14px; }
.main { padding-top: 24px; padding-bottom: 40px; min-height: calc(100vh - 140px); }

/* 首页 */
.hero { text-align: center; padding: 28px 8px 32px; }
.hero h1 { font-size: 34px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.5px; }
.hero p { color: var(--muted); margin: 0 auto 16px; max-width: 640px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hero-points li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; display: block; }
.card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 14px 32px rgba(0,0,0,.09); }
.card.disabled { opacity: .6; }
.card-body { padding: 14px 16px 16px; }
.card-body h3 { margin: 0 0 6px; font-size: 16px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; }
.price { font-size: 20px; font-weight: 600; }
.stock { font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.stock.ok { background: #e8f6ec; color: var(--green); }
.stock.low { background: #fff3e0; color: var(--orange); }
.stock.out { background: #f2f2f2; color: var(--muted); }

/* 礼品卡视觉 */
.gift { position: relative; aspect-ratio: 1.6 / 1; background: linear-gradient(135deg, #ff5f6d 0%, #ffc371 30%, #845ef7 65%, #0a84ff 100%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gift-logo { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.9); margin-bottom: 6px; -webkit-mask: radial-gradient(circle at 70% 30%, transparent 7px, #000 7.5px); mask: radial-gradient(circle at 70% 30%, transparent 7px, #000 7.5px); }
.gift-value { font-size: 40px; font-weight: 700; letter-spacing: -1px; text-shadow: 0 2px 10px rgba(0,0,0,.15); }
.gift-region { font-size: 12px; opacity: .9; letter-spacing: 1px; text-transform: uppercase; }
.gift-lg { border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.gift-lg .gift-value { font-size: 56px; }

/* 面板与表单 */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.panel h2 { margin: 0 0 8px; font-size: 20px; }
.narrow { max-width: 460px; margin: 0 auto; }
.buy { display: grid; grid-template-columns: 1fr 1.1fr; gap: 22px; align-items: start; }
.price-lg { font-size: 30px; font-weight: 700; margin: 8px 0 0; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=number], input[type=password], select, textarea {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid #d2d2d7; border-radius: 10px; font: inherit; font-size: 16px; background: #fff; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,113,227,.18); }
.qty { display: flex; width: 150px; }
.qty button { width: 44px; height: 44px; border: 1px solid #d2d2d7; background: #fafafa; font-size: 20px; cursor: pointer; color: var(--text); }
.qty button:first-child { border-radius: 10px 0 0 10px; }
.qty button:last-child { border-radius: 0 10px 10px 0; }
.qty input { border-radius: 0; text-align: center; border-left: 0; border-right: 0; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pay-types { display: flex; gap: 10px; flex-wrap: wrap; }
.pay-type { flex: 1 1 140px; display: flex; align-items: center; gap: 8px; border: 1px solid #d2d2d7; border-radius: 10px; padding: 10px 14px; cursor: pointer; }
.pay-type:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,113,227,.12); }
.pay-alipay span::before, .pay-wxpay span::before { content: ""; display: inline-block; width: 18px; height: 18px; border-radius: 4px; vertical-align: -3px; margin-right: 6px; }
.pay-alipay span::before { background: #1677ff; }
.pay-wxpay span::before { background: #07c160; }
.captcha-row { display: flex; gap: 10px; }
.captcha { height: 44px; width: 120px; border-radius: 10px; cursor: pointer; flex: none; border: 1px solid #d2d2d7; }
.notice { background: #f9f9fb; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.notice summary { cursor: pointer; color: var(--text); font-weight: 500; }
.notice div { margin-top: 6px; }
.agree { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 14px; }
.total { font-size: 15px; margin-bottom: 14px; }
.total b { font-size: 24px; color: var(--red); }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 20px; border-radius: 10px; border: 1px solid #d2d2d7; background: #fff; color: var(--text); font: inherit; font-size: 15px; cursor: pointer; }
.btn:hover { text-decoration: none; background: #f5f5f7; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.btn-primary:hover { background: var(--primary-dark); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }

/* 提示 */
.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.alert-error { background: #fdecee; color: var(--red); }
.alert-success { background: #e8f6ec; color: var(--green); }
.alert-info { background: #eaf3ff; color: #0b4f9c; }
.empty { text-align: center; padding: 60px 16px; color: var(--muted); }

/* 结果页 */
.result { max-width: 620px; margin: 0 auto; }
.result-head { text-align: center; margin-bottom: 18px; }
.result-head h2 { margin: 10px 0 4px; }
.result-icon { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 28px; color: #fff; }
.result-icon.ok { background: var(--green); }
.result-icon.warn { background: var(--orange); }
.result-icon.wait { background: #aeaeb2; }
.codes { background: #f9f9fb; border-radius: 12px; padding: 14px; margin-bottom: 18px; }
.code-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.code-idx { color: var(--muted); font-size: 13px; width: 18px; flex: none; }
.code { flex: 1; font: 600 17px/1.4 "SF Mono", Menlo, Consolas, monospace; letter-spacing: 1px; word-break: break-all; -webkit-user-select: all; user-select: all; }
.code-row.is-target { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,113,227,.18); scroll-margin-top: 90px; }
.info { display: grid; grid-template-columns: 90px 1fr; gap: 6px 10px; margin: 0 0 18px; font-size: 14px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; word-break: break-all; }

/* 站内付款 */
.checkout { max-width: 460px; margin: 0 auto; text-align: center; }
.checkout-head { margin-bottom: 18px; }
.pay-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
.pay-badge::before { content: ""; width: 20px; height: 20px; border-radius: 5px; background: #1677ff; }
.pay-badge.pay-wxpay::before { background: #07c160; }
.checkout-amount { font-size: 18px; margin: 10px 0 2px; }
.checkout-amount b { font-size: 40px; letter-spacing: -1px; }
.checkout-head p { margin: 2px 0; }
.countdown { font-size: 13px; color: var(--muted); }
.countdown b { color: var(--orange); font-variant-numeric: tabular-nums; }
.qr { width: 220px; height: 220px; margin: 0 auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.qr svg { display: block; width: 100%; height: 100%; }
.qr-tip { margin: 12px 0 0; font-size: 14px; }
.btn-alipay { background: #1677ff; border-color: #1677ff; color: #fff; font-weight: 500; height: 50px; font-size: 17px; }
.btn-alipay:hover { background: #0e62d9; }
.qr-alt { margin-top: 14px; font-size: 13px; color: var(--muted); }
.qr-alt summary { cursor: pointer; }
.qr-alt .qr { margin-top: 12px; width: 180px; height: 180px; }
.pay-mobile { display: none; }
.checkout-wait { margin: 18px 0 14px; font-size: 14px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 8px; }
.spinner { width: 14px; height: 14px; border: 2px solid #d2d2d7; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.checkout .info { text-align: left; }
@media (max-width: 760px), (pointer: coarse) {
  .pay-desktop { display: none; }
  .pay-mobile { display: block; }
}

/* 语言切换 */
.lang-switch { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12px !important; font-weight: 600; }
.lang-switch:hover { text-decoration: none; background: #f5f5f7; }

/* 联系客服 */
.contact { max-width: 900px; margin: 0 auto; }
.contact-head { text-align: center; margin: 8px 0 22px; }
.contact-head h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -.3px; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 16px; }
.contact-card { text-align: center; display: flex; flex-direction: column; }
.contact-card h3 { margin: 10px 0 2px; font-size: 16px; }
.contact-card .btn { margin-top: auto; }
.contact-value { font-size: 20px; font-weight: 600; margin: 2px 0; word-break: break-all; }
.contact-card .muted { margin: 0 0 14px; }
.contact-icon { width: 48px; height: 48px; border-radius: 14px; margin: 0 auto; display: flex; align-items: center; justify-content: center; color: #fff; }
.contact-icon svg { width: 26px; height: 26px; }
.ic-phone { background: #0071e3; }
.ic-wechat { background: #07c160; }
.ic-whatsapp { background: #25d366; }
.contact-hours { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px; margin-bottom: 16px; }
.contact-hours span { color: var(--muted); }
.contact-hours b { font-size: 18px; }
.contact-tip { text-align: center; }
.contact .guide { max-width: none; }

/* 悬浮客服按钮 */
.help-fab { position: fixed; right: 18px; bottom: 22px; z-index: 20; display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 16px 0 14px; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 500; box-shadow: 0 6px 20px rgba(0,113,227,.35); }
.help-fab:hover { text-decoration: none; background: var(--primary-dark); }
.help-fab svg { width: 20px; height: 20px; }

/* 教程 */
.guide { max-width: 760px; margin: 0 auto; }
.guide h3 { margin: 22px 0 8px; font-size: 16px; }
.guide ol { padding-left: 20px; }
.faq dt { font-weight: 600; margin-top: 12px; }
.faq dd { margin: 4px 0 0; color: var(--muted); }

.footer { border-top: 1px solid var(--line); padding: 20px 0; text-align: center; color: var(--muted); font-size: 13px; }
.footer p { margin: 4px 0; }

.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: rgba(0,0,0,.8); color: #fff; padding: 8px 18px; border-radius: 999px; font-size: 14px; z-index: 99; }

@media (max-width: 760px) {
  .buy { grid-template-columns: 1fr; gap: 14px; }
  .hero h1 { font-size: 26px; }
  .hero { padding: 12px 0 22px; }
  .nav { gap: 10px; }
  .nav a { font-size: 13px; white-space: nowrap; }
  .nav-hide-sm { display: none; }
  .help-fab { right: 12px; bottom: 16px; height: 42px; padding: 0 14px 0 12px; font-size: 14px; }
  .contact-head h1 { font-size: 24px; }
  .footer { padding-bottom: 76px; }
  .brand { font-size: 15px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .gift-value { font-size: 30px; line-height: 1.2; }
  .gift-logo { width: 24px; height: 24px; margin-bottom: 2px; -webkit-mask: radial-gradient(circle at 70% 30%, transparent 5px, #000 5.5px); mask: radial-gradient(circle at 70% 30%, transparent 5px, #000 5.5px); }
  .gift-region { font-size: 10px; }
  .gift-lg .gift-value { font-size: 46px; }
  .card-body { padding: 10px 12px 12px; }
  .card-body h3 { font-size: 14px; }
  .price { font-size: 17px; }
  .panel { padding: 18px 16px; }
  .code { font-size: 15px; letter-spacing: .3px; }
  .code-row { gap: 8px; padding: 10px; }
}
@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr; }
  .brand-logo { display: none; }
}
