
:root {
  color-scheme: light;
  --ink: #1d2129;
  --ink-strong: #111827;
  --muted: #6b778c;
  --muted-2: #8b95a7;
  --blue: #165dff;
  --blue-2: #4080ff;
  --blue-3: #0e42d2;
  --blue-soft: #e8f3ff;
  --orange: #ff7d00;
  --red: #f53f3f;
  --green: #00b42a;
  --bg: #ffffff;
  --bg-soft: #f7faff;
  --card: #ffffff;
  --line: #e8eef7;
  --line-strong: #d9e3f2;
  --shadow: 0 18px 48px rgba(17, 36, 76, .10);
  --shadow-soft: 0 10px 30px rgba(22, 93, 255, .10);
  --radius: 16px;
  --radius-lg: 28px;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 14px/1.5715 var(--sans);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body::before {
  content: "";
  position: fixed;
  inset: 64px 0 auto 0;
  z-index: 0;
  height: 560px;
  pointer-events: none;
  background:
    radial-gradient(620px 320px at 72% 18%, rgba(22, 93, 255, .17), transparent 62%),
    radial-gradient(480px 280px at 20% 56%, rgba(64, 128, 255, .10), transparent 66%),
    linear-gradient(116deg, transparent 0 43%, rgba(232, 243, 255, .94) 43.2% 74%, transparent 74.2%);
}

body::after {
  content: "";
  position: fixed;
  z-index: 0;
  left: -180px;
  top: 120px;
  width: 820px;
  height: 520px;
  border-radius: 50%;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(232, 243, 255, .92), rgba(255,255,255,.15));
  filter: blur(.2px);
}

button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }

.shell {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 18px 0 72px;
}

/* top navigation */
.site-nav,
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 54px;
  margin-bottom: 42px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 172px;
  color: var(--ink-strong);
  font-weight: 800;
  letter-spacing: -.02em;
}
.brand-mark {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 30px;
  color: #fff;
  border-radius: 12px 5px 12px 5px;
  background: linear-gradient(135deg, #ff7d00, #f53f3f);
  box-shadow: 0 8px 18px rgba(245, 63, 63, .18);
  font: 900 14px/1 var(--sans);
  transform: skewX(-12deg);
}
.brand-mark span { transform: skewX(12deg); }
.brand small {
  display: block;
  margin-top: 2px;
  color: #ff7d00;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vw, 42px);
  flex: 1;
  color: #4e5969;
  font-size: 14px;
}
.nav-links a { transition: color .16s ease; }
.nav-links a:hover { color: var(--blue); }
.nav-cta,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 24px;
  color: #fff;
  background: linear-gradient(180deg, #2878ff, #165dff);
  box-shadow: 0 10px 22px rgba(22, 93, 255, .24);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
}
.nav-cta:hover,
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(22, 93, 255, .28); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.secondary { color: var(--blue); background: #fff; border-color: #bedaff; box-shadow: 0 6px 18px rgba(22, 93, 255, .08); }
.btn.secondary:hover { background: var(--blue-soft); }
.btn.dark { color: #344054; background: #f7f9fc; border-color: #e4eaf3; box-shadow: 0 6px 18px rgba(17, 36, 76, .05); }
.btn.dark:hover { background: #fff; border-color: #cbd5e1; box-shadow: 0 10px 24px rgba(17, 36, 76, .08); }
.btn.bad { color: #d92d20; background: #fff7f6; border-color: #ffd8d4; box-shadow: none; }
.btn.bad:hover { background: #fff1ef; border-color: #ffb4ac; }

/* reference-style hero */
.top-strip { display: none; }
.panel {
  border: 1px solid rgba(226, 234, 247, .92);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 560px;
  gap: 28px;
  min-height: 430px;
  margin-bottom: 38px;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.hero-main {
  position: relative;
  z-index: 2;
  padding: 102px 8px 54px 8px;
}
.hero-main::before { display: none; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  color: #fff;
  background: linear-gradient(90deg, #ff7d00, #f53f3f);
  box-shadow: 0 8px 18px rgba(245, 63, 63, .16);
  font: 800 12px/1 var(--sans);
}
.hero h1,
.topnav h1 {
  margin: 0;
  color: var(--ink-strong);
  font-weight: 800;
  letter-spacing: -.04em;
}
.hero h1 {
  max-width: 620px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.28;
}
.hero h1 .blue { color: var(--blue); }
.hero p {
  margin: 22px 0 0;
  max-width: 610px;
  color: #86909c;
  font-size: 16px;
  line-height: 1.95;
}
.hero-actions { display: flex; align-items: center; gap: 14px; margin-top: 32px; }
.hero-actions .btn { min-width: 140px; }
.badge { display: none; }

.hero-visual {
  position: relative;
  min-height: 430px;
}
.float-card,
.hero-card {
  position: absolute;
  border: 1px solid rgba(232, 238, 247, .95);
  border-radius: 10px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 24px 58px rgba(22, 93, 255, .12);
  backdrop-filter: blur(10px);
}
.chart-card {
  top: 30px;
  left: 68px;
  width: 218px;
  height: 168px;
  padding: 22px;
}
.chart-title { color: #1d2129; font-weight: 700; }
.chart-sub { margin-left: 8px; color: #c9d2e3; font-size: 12px; }
.bars { display: flex; align-items: end; gap: 14px; height: 98px; margin-top: 16px; }
.bars span { width: 14px; border-radius: 999px; background: linear-gradient(180deg, #ff4d6d, #ffd166); box-shadow: 0 8px 18px rgba(255, 125, 0, .18); }
.bars span:nth-child(1) { height: 38px; opacity: .55; }
.bars span:nth-child(2) { height: 58px; opacity: .62; }
.bars span:nth-child(3) { height: 72px; opacity: .7; }
.bars span:nth-child(4) { height: 88px; opacity: .86; }
.bars span:nth-child(5) { height: 108px; }

.shop-card {
  top: 82px;
  right: 20px;
  width: 220px;
  height: 108px;
  display: grid;
  place-items: center;
  text-align: center;
}
.shop-icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-top: -30px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #ff9a2e, #ff6a00);
  box-shadow: 0 12px 24px rgba(255, 125, 0, .22);
  font-size: 24px;
}
.shop-card strong { display: block; margin-top: -8px; color: #1d2129; font-size: 18px; }
.stars { color: #ffcf33; letter-spacing: 4px; font-size: 13px; }

.balance-card {
  left: 0;
  top: 226px;
  width: 330px;
  height: 112px;
  padding: 22px;
  color: #fff;
  border: 0;
  border-radius: 4px;
  background: linear-gradient(135deg, #165dff, #0e42d2);
  box-shadow: 0 18px 36px rgba(22, 93, 255, .22);
}
.balance-card span { display: block; font-size: 13px; opacity: .88; }
.balance-card b { display: block; margin-top: 8px; font: 900 30px/1 var(--mono); letter-spacing: -.03em; }
.balance-card i { display: block; width: 72px; height: 26px; margin-top: 12px; border-radius: 99px; background: rgba(255,255,255,.16); }
.balance-card i::before { content: ""; display: block; width: 44px; height: 6px; margin: 10px 0 0 14px; border-radius: 99px; background: rgba(255,255,255,.68); }

.goods-card {
  right: 0;
  top: 214px;
  width: 414px;
  min-height: 210px;
  padding: 22px 28px;
}
.goods-title { display: flex; gap: 8px; color: #1d2129; font-weight: 700; }
.goods-title span { color: #c9d2e3; font-size: 12px; font-weight: 500; }
.goods-row { display: grid; grid-template-columns: 54px 1fr 70px; gap: 14px; align-items: center; padding: 17px 0; border-bottom: 1px solid #eef2f8; }
.goods-row:last-child { border-bottom: 0; }
.goods-avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #ff7d00, #f53f3f); font-weight: 900; }
.goods-line, .goods-line::after { display: block; height: 8px; border-radius: 99px; background: #dbe3f2; }
.goods-line::after { content: ""; width: 72%; margin-top: 12px; opacity: .62; }
.goods-state { display: flex; align-items: center; gap: 9px; }
.goods-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.goods-state i { display: block; width: 28px; height: 7px; border-radius: 999px; background: linear-gradient(90deg, #1d7cff, #70b5ff); }
.note-card {
  left: 86px;
  bottom: 0;
  width: 238px;
  height: 98px;
  padding: 24px;
}
.note-line { height: 9px; border-radius: 99px; background: #dbe3f2; }
.note-line + .note-line { margin-top: 14px; width: 70%; }

.section-title {
  margin: 28px 0 20px;
  text-align: center;
}
.section-title h2 { margin: 0; color: #1d2129; font-size: 30px; line-height: 1.2; letter-spacing: -.04em; }
.section-title p { margin: 12px 0 0; color: #86909c; font-size: 15px; }

.grid {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 22px;
}
.card {
  position: relative;
  padding: 26px;
}
.card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--ink-strong);
  font: 800 24px/1.25 var(--sans);
  letter-spacing: -.035em;
}
.card h2::before {
  content: "";
  width: 8px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #57a9ff, #165dff);
  box-shadow: 0 8px 16px rgba(22, 93, 255, .18);
}

label {
  display: block;
  margin: 14px 0 8px;
  color: #4e5969;
  font-weight: 700;
}
input, textarea, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #dfe7f2;
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  background: rgba(255,255,255,.94);
  padding: 12px 15px;
  font-family: var(--mono);
  font-size: 14px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
textarea {
  min-height: 178px;
  resize: vertical;
  line-height: 1.65;
}
input::placeholder, textarea::placeholder { color: #aab4c3; }
input:focus, textarea:focus, select:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(22, 93, 255, .10);
}

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wide { grid-column: 1 / -1; }
.hidden { display: none !important; }

.radios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #dfe7f2;
  border-radius: 16px;
  background: #f8fbff;
  overflow: hidden;
}
.radio {
  margin: 0;
  padding: 15px 18px;
  color: #1d2129;
  cursor: pointer;
  border-right: 1px solid #dfe7f2;
  font-weight: 700;
}
.radio:last-child { border-right: 0; }
.radio input { width: auto; min-height: auto; margin-right: 8px; accent-color: var(--blue); }

.notice,
.codebox {
  position: relative;
  border: 1px solid #e4ebf5;
  border-radius: 16px;
  background: #f8fbff;
  padding: 16px 16px 16px 18px;
  color: #52627a;
  line-height: 1.75;
  white-space: pre-wrap;
}
.notice::before,
.codebox::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 99px;
  background: #bedaff;
}
.notice.ok { border-color: rgba(0,180,42,.22); background: #f3fff7; color: #126b39; }
.notice.ok::before { background: var(--green); }
.notice.bad { border-color: rgba(245,63,63,.25); background: #fff6f5; color: #c93535; }
.notice.bad::before { background: var(--red); }

.receipt { display: grid; gap: 12px; }
.receipt-title { color: var(--ink-strong); font: 900 20px/1.2 var(--sans); }
.receipt-line { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; border-top: 1px dashed #dfe7f2; padding-top: 11px; }
.receipt-line span:first-child { color: var(--muted); }
.receipt-note { border: 1px solid #bfdbfe; background: #eff6ff; color: #1d4ed8; border-radius: 14px; padding: 10px 12px; font-weight: 800; }
.mono { font-family: var(--mono); word-break: break-all; }

.mail-panel { margin-top: 8px; min-width: 0; max-height: min(68vh, 640px); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; }
.mail-panel > .receipt-title { position: sticky; top: -1px; z-index: 2; margin: -2px -4px 0; padding: 2px 4px 10px; background: #f3fff7; }
.mail-meta { display: grid; gap: 8px; min-width: 0; margin: 8px 0 12px; color: var(--muted); font: 12px/1.6 var(--mono); }
.mail-meta-email { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: start; }
.mail-meta-email span { color: #7a879c; }
.mail-meta-email b { min-width: 0; overflow-wrap: anywhere; }
.mail-meta-tags { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.mail-meta-tag { border: 1px solid #dce7f5; border-radius: 999px; background: #f8fbff; padding: 3px 9px; color: #64748b; white-space: nowrap; }
.mailbox { display: grid; gap: 10px; min-width: 0; margin-top: 12px; padding-right: 2px; }
.mail-item { min-width: 0; overflow: hidden; border: 1px solid #e4ebf6; border-radius: 16px; background: #fff; padding: 14px; box-shadow: 0 6px 18px rgba(17,36,76,.05); }
.mail-item.has-code { border-color: rgba(22,93,255,.34); background: #f8fbff; }
.mail-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; color: var(--muted); font: 11px/1.5 var(--mono); text-transform: uppercase; }
.mail-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-from { text-align: right; }
.mail-subject { margin-top: 8px; color: var(--ink-strong); font: 800 14px/1.35 var(--sans); overflow-wrap: anywhere; }
.otp-code { display: inline-flex; margin-top: 10px; border: 1px solid #bedaff; border-radius: 12px; background: #e8f3ff; padding: 8px 12px; color: var(--blue); font: 900 24px/1 var(--mono); letter-spacing: .18em; }
.mail-snippet, .mail-empty { margin-top: 10px; color: #6b778c; font-size: 12px; line-height: 1.65; }
.mail-snippet { overflow: hidden; overflow-wrap: anywhere; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; }
.mail-errors { margin-top: 12px; border-top: 1px dashed rgba(245,63,63,.25); padding-top: 10px; color: #d92d20; font: 12px/1.6 var(--mono); }

/* public page: single exchange entry, no public admin/query nav */
.page-redeem .site-nav {
  justify-content: flex-start;
  margin-bottom: 18px;
}
.page-redeem .hero {
  display: block;
  width: min(820px, 100%);
  min-height: auto;
  margin: 0 auto 28px;
  text-align: center;
}
.page-redeem .hero-main {
  padding: 72px 8px 38px;
}
.page-redeem .hero h1,
.page-redeem .hero p {
  margin-left: auto;
  margin-right: auto;
}
.page-redeem .hero-actions {
  justify-content: center;
  margin-top: 28px;
}
.page-redeem .section-title {
  margin-top: 4px;
}

/* admin */
.page-admin .topnav { align-items: end; margin-bottom: 24px; }
.topnav h1 { font-size: clamp(36px, 5vw, 58px); line-height: 1.02; }
.page-admin .eyebrow { margin-bottom: 14px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { border: 1px solid #e6edf7; border-radius: 16px; background: rgba(255,255,255,.92); padding: 22px; box-shadow: var(--shadow-soft); }
.stat .k { color: #667085; font-weight: 700; }
.stat .v { margin-top: 10px; color: var(--blue); font: 900 42px/.95 var(--sans); letter-spacing: -.05em; }

.table-actions { margin: 0 0 12px; border: 1px solid #e6edf7; border-radius: 16px; background: #f8fbff; padding: 10px; }
.admin-check { width: 18px; height: 18px; min-height: auto; accent-color: var(--blue); padding: 0; }
.scroll { max-height: 420px; overflow: auto; border: 1px solid #e5edf8; border-radius: 18px; background: #fff; }
table { width: 100%; border-collapse: collapse; background: #fff; font: 13px/1.45 var(--mono); }
th, td { padding: 14px 13px; border-bottom: 1px solid #edf2f8; text-align: left; vertical-align: top; }
th { position: sticky; top: 0; z-index: 1; color: #667085; background: #f8fbff; font: 700 12px/1.45 var(--sans); }
.pill { display: inline-flex; border: 1px solid #d8e1f0; border-radius: 999px; padding: 5px 10px; color: #52627a; background: #fff; font-size: 12px; font-family: var(--mono); }
.pill.ok { color: #00875f; border-color: #b7efd8; background: #effcf7; }
.pill.bad { color: #d92d20; border-color: #ffd0d0; background: #fff4f4; }
.codebox { max-height: 260px; overflow: auto; font: 12px/1.65 var(--mono); word-break: break-all; }
.form-note { color: var(--muted); font-size: 13px; line-height: 1.7; }

.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 22px; background: rgba(15,23,42,.34); backdrop-filter: blur(8px); }
.modal-card { width: min(560px, 100%); box-shadow: 0 30px 90px rgba(17,36,76,.22); }

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-main { padding-top: 54px; }
  .hero-visual { min-height: 360px; }
  .grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topnav { align-items: start; flex-direction: column; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 1200px); padding-top: 12px; }
  .site-nav { margin-bottom: 24px; }
  .brand { min-width: auto; }
  .nav-cta { padding: 0 16px; }
  .hero-main { padding: 34px 0 24px; }
  .hero h1 { font-size: 36px; }
  .hero-visual { display: none; }
  .card { padding: 20px; }
  .stats { grid-template-columns: 1fr; }
  .radios { grid-template-columns: 1fr; }
  .radio { border-right: 0; border-bottom: 1px solid #dfe7f2; }
  .radio:last-child { border-bottom: 0; }
  .receipt-line { grid-template-columns: 1fr; }
  th, td { padding: 12px 10px; }
}
