:root {
  color-scheme: dark;
  --bg: #101012;
  --panel: #19191c;
  --raised: #242427;
  --ink: #f8f8f9;
  --muted: #b0b0b7;
  --line: #2d2d31;
  --line-strong: #45454b;
  --accent: #fe2c55;
  --accent-text: #ff6986;
  --primary: #d91b45;
  --cyan: #25f4ee;
  --radius: 14px;
  font-family: "Instrument Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 17px; letter-spacing: -.025em; }
small { font-size: 12px; }
[hidden] { display: none !important; }
.container { width: calc(100% - 28px); margin-inline: auto; }
.customer-page .container { width: min(560px, calc(100% - 28px)); }
.topbar { background: var(--bg); border-bottom: 1px solid var(--line); }
.nav { display: flex; min-height: 59px; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: flex; align-items: center; }
.brand { gap: 7px; color: var(--ink); font-size: 15px; font-weight: 800; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-icon { display: block; flex: none; width: 29px; height: 29px; border-radius: 23%; }
main.container { flex: 1; padding-block: 15px 27px; }
main.container:has(> .topup-flow) {
  --recharge-card-gap: 12px;
  padding-top: var(--recharge-card-gap);
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
}
.hero, .card { border-radius: 15px; padding-inline: 15px; }
.hero {
  min-height: 150px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-content: center;
  padding-block: 20px;
  border: 1px solid var(--line);
  background: #0b0c0f;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, #0e0f12 0%, #0b0c0fd9 36%, transparent 73%),
    var(--hero-art) right center / cover no-repeat;
}
.hero::before { --hero-art: url("/static/hero-diamond.jpg"); }
.hero::after { --hero-art: url("/static/hero-dou-plus.jpg"); opacity: 0; }
.hero-dou-plus::before { opacity: 0; }
.hero-dou-plus::after { opacity: 1; }
.hero h1 { font-size: clamp(26px, 6.8vw, 40px); font-weight: 850; line-height: 1.12; letter-spacing: -.06em; }
.hero-tag { width: fit-content; margin-top: 12px; font-size: 11px; font-weight: 700; color: #dedee2; padding: 5px 8px; border: 1px solid #3d3d42; background: #252528; border-radius: 5px; }
.hero-tag strong { color: var(--ink); }
.notice { margin-block: 11px; padding: 11px 13px; display: flex; align-items: baseline; gap: 9px; border-radius: 8px; border: 1px solid #4f4330; background: #282319; color: #f5d39c; font-size: 11px; line-height: 1.55; }
.notice strong { white-space: nowrap; }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, 365px); gap: 18px; align-items: start; }
.stack { display: grid; gap: 11px; min-width: 0; }
.topup-flow { display: grid; gap: var(--recharge-card-gap); margin-top: var(--recharge-card-gap); min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); padding-block: 15px; min-width: 0; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-head.compact { margin-bottom: 9px; }
.step { flex: 0 0 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: #302026; color: var(--accent-text); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.help, .muted { color: var(--muted); }
.help { font-size: 12px; line-height: 1.55; }
.section-head .help { margin-top: 4px; }
.input-line { display: flex; gap: 8px; }
.field { min-width: 0; width: 100%; min-height: 42px; padding: 9px 12px; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); font-size: 16px; }
.field::placeholder { color: var(--muted); }
.field[aria-invalid="true"] { border-color: var(--accent-text); }
label.field-label { display: grid; gap: 6px; font-size: 13px; font-weight: 650; }
.button { min-height: 42px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; border-radius: 8px; padding: 9px 14px; border: 1px solid var(--line-strong); color: var(--ink); background: #303034; white-space: nowrap; font-weight: 750; font-size: 13px; text-decoration: none; }
.button:hover { background: #3a3a40; text-decoration: none; }
.button.primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.button.primary:hover { background: #c3163b; }
.button.ghost { background: var(--panel); }
.button.ghost:hover { background: var(--raised); }
.button.danger { background: #352025; color: var(--accent-text); border-color: #5e333d; }
.button.danger:hover { background: #44242c; }
.button:disabled, .button:disabled:hover { background: #28282c; color: var(--muted); border-color: var(--line); }
.button.primary:disabled, .button.primary:disabled:hover { background: #3a2028; color: #dab0bb; border-color: #532c38; }
.wide { width: 100%; }
.error { display: block; color: var(--accent-text); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.error:empty { display: none; }
.input-line + .error:not(:empty) { margin-top: 7px; }
.account-card.has-profile {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 88% 5%, #70243c8c, transparent 70%),
    radial-gradient(ellipse at 5% 100%, #125f6159, transparent 73%),
    linear-gradient(128deg, #232429, #211c23 58%, #2d202a);
}
.account-card.has-profile::before { content: ""; position: absolute; z-index: -1; pointer-events: none; left: 30%; top: -80px; width: 78%; height: 170px; border: 1px solid #ffffff18; border-radius: 50%; box-shadow: 0 0 0 16px #ffffff0a, 0 0 0 32px #ffffff09; transform: rotate(-13deg); }
.account-heading .button { align-self: flex-start; margin-inline-start: auto; min-height: 35px; padding: 6px 11px; background: #17171adc; }
.account-heading .button:hover { background: var(--raised); }
.profile-feedback { display: grid; justify-items: start; gap: 7px; margin-top: 12px; padding: 10px 11px; background: #18141780; border: 1px solid #4b3039; border-radius: 8px; }
.profile-feedback p { overflow-wrap: anywhere; }
.profile-feedback .button { min-height: 34px; padding: 6px 10px; }
.profile-text-action { margin-top: 8px; padding: 3px 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.profile-text-action:hover { color: var(--ink); text-decoration: underline; }
.profile-text-action:disabled { color: var(--muted); text-decoration: none; opacity: .75; }
.profile-refresh { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 10px; }
.profile-refresh .profile-text-action { color: var(--accent-text); }
.profile-refresh .profile-text-action:disabled { color: var(--muted); }
.profile-result { display: grid; grid-template-columns: 68px minmax(0, 1fr); align-items: center; gap: 12px; }
.profile-result.unverified { grid-template-columns: minmax(0, 1fr); }
.profile-result img, .avatar { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #23413f; color: #8efff8; display: grid; place-items: center; font-weight: 800; }
.profile-result :is(img, .avatar) { width: 68px; height: 68px; border: 3px solid var(--panel); font-size: 24px; }
.recipient-meta { min-width: 0; overflow-wrap: anywhere; }
.recipient-meta strong { display: block; font-size: 13px; }
.profile-result .recipient-meta strong { margin-bottom: 3px; font-size: 23px; line-height: 1.2; }
.product-switch { display: flex; flex: none; margin-inline-start: auto; }
.product-switch:not(:has([aria-current="page"])) { display: none; }
.product-switch a { position: relative; display: grid; place-items: center; min-width: 64px; min-height: 44px; padding: 4px 8px; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.product-switch a:hover, .product-switch a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.product-switch a[aria-current="page"]::after { content: ""; position: absolute; inset-inline: 0; bottom: 5px; width: 16px; height: 2px; margin-inline: auto; border-radius: 1px; background: var(--accent); }
.package-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.package { display: flex; position: relative; align-items: center; justify-content: center; min-height: 59px; padding: 8px 4px; background: var(--raised); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 8px; text-align: center; }
.package:hover { background: #2c2c30; }
.package-placeholder { background: var(--raised); border-color: var(--line); }
.package-placeholder:hover { background: var(--raised); }
.package[aria-pressed="true"] { background: #392027; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: #ff8aa0; }
.package strong { font-size: clamp(15px, 4.8vw, 18px); font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.package strong small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.package[aria-pressed="true"]::after { content: ""; position: absolute; top: 6px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-text); }
dl { margin: 0; }
.detail-dl { display: grid; gap: 10px; }
.detail-dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 650; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.payment-card { display: grid; gap: 12px; }
.payment-amount > div + div { border-top: 1px solid var(--line); padding-top: 10px; }
.payment-value { display: inline-flex; flex-shrink: 0; align-items: baseline; gap: 5px; white-space: nowrap; }
.payment-amount > div:first-child { min-height: 1.4em; }
#payment-price { color: var(--accent-text); font-size: clamp(21px, 6vw, 26px); line-height: 1.15; font-variant-numeric: tabular-nums; }
.payment-card .button { min-height: 44px; }
.payment-card .button.primary[aria-busy="true"] { color: #fff; background: var(--primary); border-color: var(--primary); }
.payment-card .help { text-align: center; }
.confirm { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; flex: 0 0 15px; margin: 1px 0 0; }
.center { text-align: center; }
.narrow { max-width: 620px; margin: 18px auto; }
.page-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; flex-wrap: wrap; }
.page-title h1 { font-size: clamp(24px, 4vw, 33px); letter-spacing: -.05em; }
.page-title .help { margin-top: 4px; }
.page-title > div:first-child { min-width: 0; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.status-box { display: grid; gap: 7px; justify-items: start; padding: 13px; background: var(--raised); border-radius: 9px; }
.status-box strong { font-size: 12px; color: var(--muted); }
.badge { display: inline-block; max-width: 100%; border-radius: 5px; padding: 4px 8px; white-space: nowrap; background: #333338; color: #e3e3e8; font-size: 11px; font-weight: 750; }
.badge.paid, .badge.completed { background: #1b3834; color: #83f7de; }
.badge.pending, .badge.refund_pending, .badge.exception { background: #3c2c1c; color: #ffd398; }
.badge.refunded { background: #333338; color: #c6c6cb; }
.button-row, .tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.button-row > * { flex-shrink: 0; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 15px; }
.queue-controls { display: flex; gap: 8px; }
.queue-controls .field { width: auto; }
.queue-controls input { flex: 1; }
.queue-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.queue-counts button { text-align: left; font-size: 12px; color: var(--muted); }
.queue-counts button:hover { background: var(--raised); border-color: var(--line-strong); }
.queue-counts button strong { display: block; font-size: 24px; color: var(--ink); margin-bottom: 3px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; color: var(--muted); font-weight: 650; white-space: nowrap; }
td { min-width: 80px; overflow-wrap: anywhere; }
td:last-child { white-space: nowrap; }
.audit-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.audit-list li { font-size: 13px; border-bottom: 1px solid var(--line); padding-bottom: 9px; overflow-wrap: anywhere; }
.audit-list li .help { margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
textarea.field { min-height: 78px; resize: vertical; }
.inline-result { font-size: 12px; color: #83f7de; overflow-wrap: anywhere; }
.code { overflow-wrap: anywhere; font-family: ui-monospace, monospace; }
@media (max-width: 640px) {
  .customer-page .container { width: min(560px, calc(100% - 24px)); }
  .checkout-grid { grid-template-columns: minmax(0,1fr); gap: 11px; }
  .queue-controls { flex-wrap: wrap; }
  .queue-controls select { max-width: 100%; }
  .queue-counts { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (width > 640px) {
  .ops-page h2 { font-size: 19px; }
  .ops-page .container { width: min(1120px, calc(100% - 48px)); }
  .ops-page .nav { min-height: 64px; }
  .ops-page .brand { gap: 10px; font-size: 17px; }
  .ops-page .brand-icon { width: 34px; height: 34px; }
  .ops-page main.container { padding-block: 24px 42px; }
  .ops-page .notice { margin-block: 17px; font-size: 12px; }
  .ops-page .stack { gap: 15px; }
  .ops-page .card { border-radius: var(--radius); padding: 21px 23px; }
  .ops-page .section-head { margin-bottom: 16px; }
  .ops-page .section-head.compact { margin-bottom: 9px; }
  .ops-page .page-title { flex-wrap: nowrap; }
  .ops-page .field { font-size: inherit; }
}
@media (640px < width <= 830px) {
  .checkout-grid { grid-template-columns: minmax(0, 1fr) minmax(265px, .78fr); }
  .ops-page .card { padding: 17px; }
}
@media (max-width: 380px) {
  .hero::before, .hero::after { background-position: center, calc(100% + 22px) center; }
}
@media (max-width: 350px) {
  .container { width: calc(100% - 20px); }
}
.spaced { margin-top: 18px; }
