:root {
  --bg: #07070a;
  --bg-elev: #101014;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-2: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f3ef;
  --muted: #9b9892;
  --accent: #7dffc3;
  --accent-dim: rgba(125, 255, 195, 0.14);
  --ok: #7dffc3;
  --err: #ff8b7a;
  --warn: #ffd27a;
  --ink: #09090c;
  --radius: 22px;
  --font: "Sora", "Segoe UI", sans-serif;
  --display: "Syne", "Sora", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; }

body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  letter-spacing: -0.01em;
  position: relative;
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(125, 255, 195, 0.11), transparent 55%),
    radial-gradient(720px 480px at 100% 0%, rgba(92, 120, 255, 0.1), transparent 50%),
    radial-gradient(600px 400px at 70% 110%, rgba(255, 210, 122, 0.05), transparent 45%),
    var(--bg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #b6ffe0; }
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 0 0 10px;
  line-height: 0.95;
}
h1 { font-size: clamp(36px, 5vw, 64px); }
h2 { font-size: 26px; }
h3 { font-size: 22px; }
p { color: var(--muted); line-height: 1.6; margin: 0 0 12px; }

.kicker {
  margin: 0 0 14px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 11px;
  font-weight: 600;
}

.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  padding: 48px 7vw;
}
.gate-copy h1 {
  font-size: clamp(56px, 8vw, 108px);
  max-width: 7ch;
}
.gate-copy p { max-width: 38ch; font-size: 16px; }
.gate-card {
  width: min(420px, 100%);
  justify-self: end;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 28px;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 24px 80px rgba(0,0,0,0.35);
  padding: 32px 28px 24px;
}

label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 7px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}
.field { margin-bottom: 14px; }
input, select, textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
textarea { min-height: 140px; resize: vertical; font-family: var(--mono); font-size: 13px; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(125, 255, 195, 0.55);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600;
  font-family: inherit;
  transition: transform .18s ease, background .18s ease, opacity .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-gold {
  width: auto;
  min-width: 0;
  padding: 9px 18px;
  background: #f4f3ef;
  color: var(--ink);
}
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-ok { background: var(--accent-dim); color: var(--ok); }
.btn-err { background: rgba(255, 139, 122, 0.12); color: var(--err); }
.btn-sm { padding: 8px 13px; font-size: 13px; width: auto; }
.btn-pay {
  padding: 11px 26px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.shell { max-width: 1220px; margin: 0 auto; padding: 18px 18px 80px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 34px;
  padding: 10px 12px 10px 18px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  position: sticky;
  top: 12px;
  z-index: 10;
}
.topbar .logo {
  font-family: var(--display);
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.05em;
}
.nav { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }
.nav-drop { position: relative; }
.nav-drop-btn {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 13px;
  font-family: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nav-drop-btn.active, .nav-drop-btn:hover, .nav-drop.is-open .nav-drop-btn {
  color: var(--ink);
  background: #f4f3ef;
}
.nav-drop-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 176px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #101014;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  z-index: 30;
}
.nav-drop-menu[hidden] { display: none; }
.nav-drop-menu a {
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
}
.nav-drop-menu a.active, .nav-drop-menu a:hover {
  color: var(--ink);
  background: #f4f3ef;
}
.nav a {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 13px;
}
.nav a.active, .nav a:hover {
  color: var(--ink);
  background: #f4f3ef;
}
.nav-count[hidden] { display: none !important; }
.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.nav a.active .nav-count,
.nav a:hover .nav-count {
  background: var(--ink);
  color: #f4f3ef;
}
.intake-reset {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.intake-reset input {
  width: 72px;
  padding: 7px 8px;
  border-radius: 999px;
  text-align: center;
  letter-spacing: 0.12em;
  font-family: var(--mono);
  font-size: 12px;
}
.userbox { display: flex; align-items: center; gap: 10px; }
.balance {
  font-family: var(--mono);
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(125, 255, 195, 0.22);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.grid { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.bento > .span-2 { grid-column: span 2; }
.bento > .span-4 { grid-column: span 4; }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 18px 40px rgba(0,0,0,0.18);
  transition: transform .2s ease, border-color .2s ease;
}
.product:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}
.card h3 { font-size: 24px; }
.muted { color: var(--muted); }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
}
.badge.ok { color: var(--ok); border-color: rgba(125, 255, 195, 0.28); background: var(--accent-dim); }
.badge.err { color: var(--err); border-color: rgba(255, 139, 122, 0.28); }
.delta-plus { color: var(--ok); font-weight: 600; }
.delta-minus { color: var(--err); font-weight: 600; }

.user-create {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.users-table td { vertical-align: middle; }
.users-status {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.users-status form { margin: 0; }
.user-ops {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 430px;
}
.user-ops-row {
  display: grid;
  grid-template-columns: 96px 128px 76px 88px;
  gap: 8px;
  align-items: center;
  margin: 0;
}
.user-ops-row input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
}
.user-ops-row .btn { width: 100%; }
.user-ops-pct {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.user-ops-pct input { width: 100%; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }

.flash {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  transition: opacity .35s ease, transform .35s ease, margin .35s ease, padding .35s ease, max-height .35s ease;
  max-height: 80px;
  overflow: hidden;
}
.flash.is-gone {
  opacity: 0;
  transform: translateY(-6px);
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  max-height: 0;
  border-width: 0;
}
.flash.ok { background: var(--accent-dim); color: var(--ok); }
.flash.error { background: rgba(255, 139, 122, 0.1); color: var(--err); }
.flash.info { background: var(--glass); color: var(--text); }

.stat {
  font-size: clamp(32px, 4vw, 48px);
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--text);
}
.stat-card .muted { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }
.hidden { display: none; }
.page-head { margin-bottom: 26px; max-width: 46rem; }
.page-head p { margin: 0; font-size: 16px; }
.split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 14px; }
.address {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}
.copy {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
}
.strings {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.strings pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-all;
}
.qty { width: 84px; border-radius: 999px; text-align: center; }
.footer-note { margin-top: 18px; font-size: 12px; color: var(--muted); }
.price { font-family: var(--display); font-size: 28px; letter-spacing: -0.04em; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.chips a {
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
}
.chips a.active, .chips a:hover {
  background: #f4f3ef;
  color: var(--ink);
  border-color: #f4f3ef;
}
.pay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.pay-actions .btn-sm { width: auto; }
.wallet-topup {
  max-width: 380px;
  padding: 16px 18px 18px;
  margin-bottom: 22px;
}
.wallet-topup h2 {
  font-size: 18px;
  margin: 0 0 12px;
}
.wallet-topup .field { margin-bottom: 10px; }
.topup-amount {
  width: 100%;
  max-width: none;
  padding: 8px 12px;
  border-radius: 12px;
}
.wallet-topup .coin-pick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  align-items: start;
}
.wallet-topup .coin-opt { min-width: 0; }
.topup-conv {
  margin: 0 0 12px;
  min-height: 1.4em;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}
.topup-actions {
  display: flex;
  justify-content: center;
}
.wallet-tabs { margin: 0 0 12px; }
.coin-pick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  align-items: start;
}
.coin-opt {
  margin: 0;
  min-width: 0;
  cursor: pointer;
}
.coin-opt input { position: absolute; opacity: 0; pointer-events: none; }
.coin-opt span,
.coin-badge {
  display: block;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: transparent;
  overflow: hidden;
  line-height: 0;
}
.coin-opt img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 966 / 346;
  object-fit: contain;
  object-position: center;
}
.coin-opt input:checked + span {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
  background: transparent;
}
.coin-opt input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.coin-head {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}
.network-sub {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.warn-note {
  margin: 16px auto 0;
  max-width: 36ch;
  font-size: 13px;
  color: var(--muted);
}
.checkout { max-width: 560px; margin: 0 auto; text-align: center; }
.checkout-card { padding: 28px 24px; }
.checkout-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  color: var(--muted);
}
.checkout-row strong { color: var(--text); }
.exact {
  margin: 18px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--muted);
}
.exact-amount {
  font-family: var(--display);
  font-size: clamp(28px, 6vw, 44px);
  letter-spacing: -0.05em;
  color: var(--accent);
}
.checkout-address { margin: 0 auto 12px; max-width: 100%; }
.qr {
  margin: 18px auto;
  width: min(240px, 100%);
  aspect-ratio: 1 / 1;
  padding: 10px;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.qr-img,
.qr img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.wait-box {
  margin-top: 8px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.pay-timer {
  margin: 18px 0 4px;
  font-family: var(--display);
  font-size: clamp(28px, 6vw, 40px);
  letter-spacing: -0.04em;
  color: var(--accent);
}
.pay-timer[hidden],
.wait-hint[hidden],
.wait-box[hidden],
#pay-txid[hidden] { display: none; }
.wait-hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}
.checkout.is-expired .qr,
.checkout.is-expired .address,
.checkout.is-expired .exact-amount {
  opacity: 0.35;
  filter: grayscale(0.4);
}
.settings-sub { font-size: 18px; margin: 18px 0 8px; }
.qr-upload {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 12px 0 18px;
}
.qr-upload figure {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,0.22);
}
.qr-upload img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
}
.qr-upload figcaption {
  margin: 8px 0 6px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.qr-upload input[type=file] {
  padding: 8px;
  font-size: 12px;
  border-radius: 10px;
}
.totp-card { margin-bottom: 16px; }
.totp-setup {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 12px;
}
.totp-qr {
  width: 220px;
  aspect-ratio: 1 / 1;
  padding: 10px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.totp-qr svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}
.totp-form { margin-top: 12px; }
.totp-code-field { max-width: 180px; }
.totp-code-field input { letter-spacing: 0.2em; font-family: var(--mono); text-align: center; }
@media (max-width: 720px) {
  .qr-upload, .totp-setup { grid-template-columns: 1fr; }
}
.status-waiting {
  color: var(--warn);
  animation: pulse 1.6s ease-in-out infinite;
}
.status-confirming { color: var(--accent); }
.status-paid { color: var(--ok); }
.status-expired { color: var(--err); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.goods-card {
  background: #fff;
  color: #1b1b1b;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e6e6e6;
}
.goods-wrap { overflow-x: auto; }
.goods-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  color: #1b1b1b;
  background: #fff;
}
.goods-table th,
.goods-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid #ececec;
  vertical-align: middle;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.goods-table th {
  background: #f3f3f3;
  color: #4a4a4a;
  font-weight: 700;
  font-size: 14px;
}
.goods-table td { color: #111; }
.goods-table tbody tr:last-child td { border-bottom: 0; }
.goods-table .goods-check {
  width: 44px;
  text-align: center;
}
.goods-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #444;
  cursor: pointer;
}
.goods-table tr.is-sold td { color: #9a9a9a; }
.goods-table a { color: #2563eb; }
.goods-table th a {
  color: #4a4a4a;
  font-weight: 700;
}
.goods-table th a:hover { color: #111; }
.goods-empty {
  margin: 0;
  padding: 24px 16px;
  color: #666;
}
.goods-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: flex-end;
  margin: 0 0 16px;
  padding: 16px 18px;
  background: #fff;
  color: #222;
  border-radius: 14px;
  border: 1px solid #e6e6e6;
}
.goods-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
  margin: 0;
}
.goods-filter span {
  color: #444;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.goods-filter select {
  width: 180px;
  background: #fff;
  color: #111;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  padding: 6px 8px;
}
.goods-dob { min-width: 280px; flex: 1; }
.goods-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  background: #fff;
  color: #222;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  align-self: flex-end;
  margin-bottom: 1px;
}
.goods-reset:hover { color: #111; background: #f4f4f4; }
.dob-slider {
  position: relative;
  height: 28px;
  padding: 0 8px;
  box-sizing: border-box;
}
.dob-slider::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 6px;
  margin-top: -3px;
  background: #d9d9d9;
  border-radius: 999px;
}
.dob-slider input[type="range"] {
  position: absolute;
  left: 8px;
  width: calc(100% - 16px);
  background: transparent;
  padding: 0;
  margin: 0;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
  height: 28px;
}
.dob-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
  border: none;
}
.dob-slider input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border-radius: 3px;
  background: #8d8d8d;
  border: 0;
  cursor: pointer;
  position: relative;
  z-index: 2;
}
.dob-slider input[type="range"]::-moz-range-track {
  height: 6px;
  background: transparent;
  border: none;
}
.dob-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 3px;
  background: #8d8d8d;
  cursor: pointer;
}
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  width: fit-content;
  max-width: 100%;
  margin: 22px auto 0;
  padding: 10px 12px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  color: var(--muted);
  font-size: 14px;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #f4f3ef;
  color: var(--ink);
  font-weight: 600;
  border: 0;
  transition: transform .18s ease, opacity .18s ease, background .18s ease;
}
.pager-btn:hover {
  color: var(--ink);
  transform: translateY(-1px);
}
.pager-next {
  background: var(--accent);
}
.pager-btn.is-disabled {
  opacity: 0.38;
  pointer-events: none;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.pager-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 150px;
  text-align: center;
}
.pager-meta strong { color: var(--text); font-weight: 700; }
.pager-dot { opacity: 0.55; }
.goods-buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding: 16px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.goods-sum {
  margin-right: auto;
  color: var(--text);
  font-size: 14px;
}
.page-tabs { margin-bottom: 18px; }
.link-edit {
  background: none;
  border: 0;
  padding: 0;
  color: #2563eb;
  cursor: pointer;
  font: inherit;
  width: auto;
}
.link-edit:hover { text-decoration: underline; }
.edit-dialog {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--bg-elev);
  color: var(--text);
  padding: 0;
  box-shadow: 0 24px 80px rgba(0,0,0,0.45);
}
.edit-dialog::backdrop { background: rgba(0, 0, 0, 0.62); }
.edit-dialog form { padding: 22px; }
.edit-dialog h2 { margin: 0 0 8px; }
.edit-dialog h3 {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.edit-dialog textarea { min-height: 90px; }
.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 16px;
}
.edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
.edit-actions .btn-err { margin-right: auto; }
#stock-edit-error { color: var(--err); margin: 0 0 8px; }
.upload-preview {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--glass);
}
.upload-preview-status { margin: 0; }
.upload-preview ul {
  margin: 10px 0 0;
  padding-left: 18px;
}
.upload-preview li { margin: 4px 0; }
.upload-preview.is-warn .upload-preview-status { color: var(--err); }
.tg {
  display: flex;
  min-height: 620px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,0.18);
}
.tg-app { min-height: 680px; }
.tg-side {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #0c0c10;
}
.tg-side-head {
  padding: 16px 18px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.tg-chats { flex: 1; overflow: auto; }
.tg-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tg-chat-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.tg-chat-item:hover { background: var(--glass); color: var(--text); }
.tg-chat-item.active { background: var(--accent-dim); color: var(--text); }
.tg-chat-meta { min-width: 0; flex: 1; }
.tg-chat-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.tg-chat-top strong { font-size: 14px; }
.tg-chat-top time, .tg-preview { color: var(--muted); font-size: 12px; }
.tg-preview {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}
.tg-new { padding: 12px; border-top: 1px solid var(--line); }
.tg-new select { border-radius: 12px; padding: 10px 12px; }
.tg-chat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(700px 280px at 10% 0%, rgba(125, 255, 195, 0.05), transparent 50%),
    radial-gradient(600px 260px at 100% 100%, rgba(92, 120, 255, 0.06), transparent 46%),
    #0a0a0e;
}
.tg-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(16, 16, 20, 0.92);
  border-bottom: 1px solid var(--line);
}
.tg-head-text { display: flex; flex-direction: column; gap: 2px; }
.tg-head-text strong { font-size: 15px; }
.tg-head-text span { color: var(--muted); font-size: 12px; }
.tg-ava {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}
.tg-thread {
  flex: 1;
  overflow: auto;
  padding: 18px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tg-empty, .tg-placeholder {
  margin: auto;
  color: var(--muted);
  text-align: center;
}
.tg-row { display: flex; }
.tg-row.is-mine { justify-content: flex-end; }
.tg-bubble {
  position: relative;
  max-width: min(72%, 460px);
  padding: 8px 10px 6px 12px;
  border-radius: 16px 16px 16px 6px;
  background: #1a1a22;
  border: 1px solid var(--line);
  color: var(--text);
}
.tg-row.is-mine .tg-bubble {
  background: var(--accent-dim);
  border-color: rgba(125, 255, 195, 0.22);
  border-radius: 16px 16px 6px 16px;
}
.tg-text { white-space: pre-wrap; word-break: break-word; line-height: 1.4; padding-right: 42px; }
.tg-bubble time {
  float: right;
  margin: 4px 0 0 8px;
  color: var(--muted);
  font-size: 11px;
}
.tg-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 12px 12px;
  background: #101014;
  border-top: 1px solid var(--line);
}
.tg-composer textarea {
  min-height: 44px;
  max-height: 140px;
  margin: 0;
  border-radius: 18px;
  padding: 11px 14px;
  resize: none;
  background: #18181f;
}
.tg-send {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.tg-send:hover { transform: translateY(-1px); }

@media (max-width: 980px) {
  .gate { grid-template-columns: 1fr; padding: 36px 20px 48px; }
  .gate-card { justify-self: stretch; }
  .bento { grid-template-columns: 1fr 1fr; }
  .bento > .span-2, .bento > .span-4 { grid-column: span 2; }
}
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .edit-grid { grid-template-columns: 1fr; }
  .pager {
    flex-wrap: wrap;
    border-radius: 22px;
    padding: 12px;
  }
  .pager-btn { min-width: 96px; }
  .topbar { position: static; flex-wrap: wrap; border-radius: 24px; }
  .userbox { width: 100%; justify-content: space-between; }
  .bento { grid-template-columns: 1fr; }
  .bento > .span-2, .bento > .span-4 { grid-column: span 1; }
  .tg-app { flex-direction: column; }
  .tg-side {
    width: 100%;
    max-height: 240px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .tg { min-height: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
