:root {
  color-scheme: dark;
  --bg: #14111e;
  --panel: #201a2d;
  --line: #3a304a;
  --text: #f8f3ff;
  --muted: #c0b1d1;
  --accent: #e6fd83;
  --lavender: #cdb4ff;
  font: 16px/1.5 system-ui, "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); background: #191422; }
.bar, .wallet, .section-head, .pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bar { min-height: 70px; }
.brand { font-weight: 750; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.logo { display: grid; place-items: center; background: var(--accent); color: #201a2d; border-radius: 10px; width: 34px; height: 34px; font-size: 23px; }
.network { color: var(--muted); font-size: .875rem; }
.hero { display: flex; justify-content: space-between; align-items: center; min-height: 230px; gap: 30px; margin-block: 20px 8px; }
.eyebrow, .hero-ticket > span:first-child { letter-spacing: .15em; font-weight: 700; font-size: .8rem; }
.eyebrow { color: var(--lavender); margin: 0 0 8px; }
h1 { font-size: clamp(2.75rem, 6vw, 4.25rem); line-height: 1.12; margin: 0; letter-spacing: -.05em; }
.subtitle { color: var(--muted); margin: 16px 0 0; }
.hero-ticket { width: 285px; color: #261943; background: #cbb0ff; border-radius: 15px; padding: 22px; border: 2px solid #e6d7ff; box-shadow: 8px 8px 0 #38284f; transform: rotate(-6deg); margin-right: 18px; }
.hero-ticket div { display: flex; justify-content: space-between; font: 750 1.65rem/1.5 ui-monospace, monospace; border-top: 1px dashed #7050a4; margin: 10px 0; padding-top: 7px; }
.barcode { display: block; width: 105px; height: 11px; background: repeating-linear-gradient(90deg, #4c3370 0 2px, transparent 2px 4px, #4c3370 4px 5px, transparent 5px 8px); }
.round { display: grid; grid-template-columns: repeat(4, 1fr) auto; align-items: center; gap: 14px; padding: 15px 20px; margin-bottom: 22px; border: 1px solid var(--line); background: #1b1627; border-radius: 14px; }
.round span, label, .hint, .total span, dt, footer { color: var(--muted); font-size: .875rem; }
.round strong, .round span, label { display: block; }
.round strong { margin-top: 3px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; gap: 18px; }
.stack { display: grid; gap: 18px; min-width: 0; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
h2 { font-size: 1.25rem; margin: 0; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: #171320; padding: 4px; border-radius: 11px; margin: 18px 0; }
.tabs button, .presets button { color: var(--muted); border: 1px solid transparent; border-radius: 8px; padding: 8px 4px; background: transparent; font-size: .875rem; }
.tabs button[aria-pressed="true"] { background: #3c2e51; color: var(--text); border-color: #584471; }
label { margin-bottom: 7px; }
input, textarea, select { width: 100%; color: var(--text); background: #171320; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
textarea { resize: vertical; }
.range-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.presets button { border-color: var(--line); padding: 3px 9px; }
.primary, .outline { border-radius: 9px; padding: 8px 13px; font-size: .875rem; font-weight: 700; min-height: 38px; }
.primary { background: var(--accent); color: #252817; border: 1px solid transparent; }
.outline { background: transparent; color: var(--text); border: 1px solid #5c4b70; }
button:not(:disabled):hover { filter: brightness(1.17); }
#add { margin-top: 16px; width: 100%; }
.hint { margin: 6px 0 0; }
.empty { padding: 18px 0 5px; color: var(--muted); font-size: .875rem; }
.ticket-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); gap: 8px; margin-top: 14px; }
.ticket { background: #171320; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.ticket code { font-size: .95rem; letter-spacing: .11em; color: var(--lavender); }
.ticket button { border: 0; background: none; color: var(--muted); width: 32px; height: 32px; padding: 0; }
.pill { color: var(--lavender); background: #3a2b50; border-radius: 999px; padding: 3px 10px; font-size: .875rem; white-space: nowrap; }
.total { margin-top: 16px; padding: 13px 14px; background: #171320; border-radius: 10px; overflow-wrap: anywhere; }
.total strong { display: block; font-size: 1.42rem; color: var(--accent); }
.details { display: grid; gap: 6px; margin: 14px 0; }
.details div, .batch, .tx { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
dd { margin: 0; font-size: .875rem; text-align: right; overflow-wrap: anywhere; }
#approve { width: 100%; margin-top: 12px; }
.batch, .tx { padding-block: 10px; border-top: 1px solid var(--line); }
.batch:first-child, .tx:first-child { margin-top: 14px; }
.batch small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.batch button { flex-shrink: 0; }
.pager { margin-top: 14px; color: var(--muted); font-size: .875rem; }
#notice { border: 1px solid #5c4b70; border-radius: 9px; background: var(--panel); padding: 9px 12px; margin: 0 0 16px; overflow-wrap: anywhere; }
#notice.error { border-color: #af647e; color: #ffbfcd; }
footer { padding: 22px 0 30px; }
@media (max-width: 780px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .hero-ticket { width: 220px; }
}
@media (max-width: 540px) {
  .shell { width: calc(100% - 28px); }
  .hero { min-height: 180px; margin-block: 8px 0; }
  .hero-ticket, .network { display: none; }
  .round { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .round button { grid-column: span 2; }
  .panel { padding: 16px; }
}
