:root {
  color-scheme: light;
  --canvas: #f5f6fa;
  --white: #fff;
  --ink: #181a2a;
  --muted: #525b70;
  --line: #dce0ea;
  --brand: #402f9d;
  --brand-deep: #302170;
  --brand-lite: #eeebfb;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
button, input { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #644dcb; outline-offset: 3px; }
.shell { width: min(100% - 2rem, 68rem); margin-inline: auto; }

.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 4.25rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.brand { display: inline-flex; flex: none; gap: .65rem; align-items: center; font-size: 1rem; font-weight: 750; text-decoration: none; }
.brand-icon { position: relative; display: inline-block; width: 2rem; height: 2rem; border-radius: .55rem; background: var(--brand); }
.brand-icon::before { content: ""; position: absolute; inset: .67rem .36rem .41rem; border: 1.5px solid #fff; border-radius: .15rem; }
.brand-icon::after { content: ""; position: absolute; inset: .34rem .63rem .67rem; border: 1.5px solid #fff; background: var(--brand); border-radius: .12rem; }
.device { color: var(--muted); font-size: .875rem; text-align: right; overflow-wrap: anywhere; }

.intro { margin: 2.65rem 0 1.35rem; display: flex; justify-content: space-between; align-items: end; gap: .9rem; }
.eyebrow { margin: 0 0 .3rem; color: var(--brand-deep); font-size: .875rem; font-weight: 680; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.1; letter-spacing: -.045em; }
h2 { font-size: 1.2rem; line-height: 1.4; margin: 0 0 .4rem; }
.unit-price { margin: 0; padding: .45rem .9rem .6rem; border-radius: .75rem; background: var(--brand-lite); color: var(--brand-deep); display: flex; align-items: baseline; gap: .5rem; white-space: nowrap; }
.unit-price b { font-size: 1.2rem; }
.unit-price span { font-size: .875rem; }
.mode-banner, .notice { padding: .7rem .95rem; border-radius: .65rem; font-size: .9rem; }
.mode-banner { background: #fff4da; color: #634006; border: 1px solid #f0d69b; margin-bottom: 1.1rem; }
.mode-banner span { margin-right: .45rem; font-weight: 750; }
.notice { background: #fff0ef; color: #8c2423; border: 1px solid #f3c3bf; }

.steps { margin: 0 0 1.15rem; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; list-style: none; }
.steps li { background: var(--white); color: var(--muted); padding: .57rem .65rem; border: 1px solid var(--line); border-radius: .55rem; text-align: center; font-size: .88rem; font-weight: 600; }
.steps li.current { color: var(--brand-deep); background: var(--brand-lite); border-color: #c8bfec; }
.layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; gap: 1.1rem; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: .95rem; padding: clamp(1rem, 3vw, 1.6rem); box-shadow: 0 .2rem .6rem #20254808; }
.summary { grid-column: 2; }
.muted { color: var(--muted); margin: .15rem 0 0; font-size: .9rem; }
.empty { margin: 1.25rem 0 1rem; }
.access-card { max-width: 31rem; }
.access-card form { display: grid; gap: .6rem; margin-top: 1rem; }
.access-card input { padding: .65rem .8rem; border: 1px solid var(--line); border-radius: .6rem; }

.dropzone { margin: 1rem 0; width: 100%; text-align: center; padding: 2.1rem 1rem 1.8rem; border: 1.5px dashed #b5acd8; border-radius: .75rem; background: #f9f8ff; display: grid; justify-items: center; gap: .7rem; }
.dropzone.dragging { background: #eeebfb; border-color: var(--brand); }
.file-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .55rem; }
.paper-icon { width: 2.2rem; height: 2.6rem; border: 2px solid var(--brand); border-radius: .35rem; background: var(--brand-lite); position: relative; }
.paper-icon::after { content: ""; position: absolute; width: .9rem; top: .88rem; left: .54rem; height: 2px; background: var(--brand); box-shadow: 0 .36rem var(--brand), 0 .72rem var(--brand); }
.file-name, .document-name { max-width: 100%; overflow-wrap: anywhere; }
.file-name { font-weight: 660; }
.upload-submit { width: 100%; }
.upload-progress { margin-top: .75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.primary, .secondary, .payment-button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; border: 1px solid transparent; border-radius: .55rem; padding: .62rem .9rem; text-align: center; text-decoration: none; font-weight: 690; cursor: pointer; }
.primary { color: #fff; background: var(--brand); }
.primary:hover { background: var(--brand-deep); }
.secondary { color: var(--brand-deep); background: var(--white); border-color: var(--line); }
.secondary:hover { border-color: var(--brand); }
.payment-button { border-color: #aacabe; color: #126147; background: #f1faf6; }
.payment-button.alipay { border-color: #bfd0f3; color: #194885; background: #f0f6ff; }
.payment-button:hover { border-color: currentColor; }
.compact { font-size: .875rem; padding: .45rem .65rem; flex: none; }
.wide, .actions button { width: 100%; }
button:disabled { opacity: .54; cursor: default; }

.card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: .65rem; margin-bottom: 1rem; }
.preview-choice { display: block; margin-bottom: .35rem; color: var(--muted); }
#document-picker { margin-bottom: .75rem; }
.field { display: block; width: 100%; min-height: 2.75rem; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: .5rem; background: white; color: var(--ink); }
.print-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-bottom: .7rem; }
.print-fields label, .rate-row label { font-size: .875rem; color: var(--muted); }
.print-fields .field, .rate-row .field { margin-top: .3rem; }
.details-link { display: inline-block; margin-bottom: .6rem; color: var(--brand-deep); font-weight: 650; }
.rate-row { display: grid; grid-template-columns: 1fr auto; gap: .9rem; align-items: end; }
.rate-row label:last-child { padding-bottom: .65rem; }
.notice.success { color: #166347; background: #edf8f0; border-color: #b8deca; }
.receipt-lines { padding: 0; list-style: none; }
.receipt-lines li { padding: .7rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.receipt-lines p { margin: .25rem 0; }
.work-area { min-width: 0; display: grid; gap: 1rem; }
.top-price { max-width: 23rem; display: grid; gap: .5rem; justify-items: end; }
.coupon-inline { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.coupon-inline .field { width: min(9rem, 100%); }
.coupon-state { text-align: right; }
.conversion-list { margin: .65rem 0 0; padding-left: 1.2rem; max-height: 15rem; overflow: auto; color: var(--muted); overflow-wrap: anywhere; }
.conversion-list li { padding: .23rem 0; }
.admin-section { margin-bottom: 1rem; }
.admin-stats { display: flex; flex-wrap: wrap; gap: .55rem; margin: .7rem 0; }
.admin-stats span { padding: .45rem .65rem; border-radius: .45rem; background: var(--brand-lite); }
.admin-coupons { margin: .8rem 0; }
.link-row { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.section-nav, .pager { margin: 1rem 0; }
.section-nav [aria-current="page"] { background: var(--brand-lite); border-color: #c8bfec; }
.pager { justify-content: flex-end; margin-bottom: 0; }
.batch-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; align-items: end; gap: .65rem; margin-top: 1rem; }
.batch-form label { color: var(--muted); font-size: .9rem; }
.batch-form .field { margin-top: .3rem; }
.redeem-form { grid-template-columns: minmax(0, 26rem) auto; justify-content: start; }
.wallet-amount { color: var(--brand-deep); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.danger { color: #8c2423; }
.danger:hover { border-color: currentColor; }
.highlight-row { background: var(--brand-lite); }
.scroll-table { overflow-x: auto; }
.scroll-table table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.scroll-table td, .scroll-table th { text-align: left; padding: .55rem .65rem; border-bottom: 1px solid var(--line); }
.scroll-table th { white-space: nowrap; }
.account-card { margin: 0 0 1.1rem; }
.account-card .card-heading { margin-bottom: .4rem; }
.account-card h2 b { color: var(--brand-deep); }
.wallet-details { margin-top: .55rem; color: var(--brand-deep); }
#recharge-recipient { grid-column: 1 / -1; margin: 0; font-weight: 650; }
.wrap-cell { min-width: 9rem; max-width: 22rem; overflow-wrap: anywhere; }
#redeem, #orders { scroll-margin-top: .75rem; }
.paper-frame { display: grid; place-items: center; background: #e9ebf2; border: 1px solid var(--line); border-radius: .6rem; padding: .65rem; min-height: 15rem; }
.paper-frame img { display: block; max-width: 100%; max-height: 30rem; height: auto; background: #fff; box-shadow: 0 0 .35rem #252a4440; }
.page-controls { margin-top: .65rem; display: flex; justify-content: space-between; align-items: center; gap: .35rem; color: var(--muted); font-size: .875rem; }
fieldset { border: 0; padding: 0; margin: 1.2rem 0 0; }
legend { font-size: .9rem; font-weight: 700; margin-bottom: .35rem; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.options label { display: flex; align-items: center; gap: .45rem; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: .5rem; min-height: 2.75rem; }
.options label:has(input:checked) { background: var(--brand-lite); color: var(--brand-deep); border-color: #c8bfec; }
.options input { accent-color: var(--brand); }

.facts { margin: 1rem 0 .8rem; }
.facts div { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 620; text-align: right; }
.total { border-top: 1px solid var(--line); padding: .8rem 0; display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.total strong { font-size: 1.7rem; color: var(--brand-deep); font-variant-numeric: tabular-nums; }
.order-status { margin: .18rem 0 .8rem; padding: .55rem .7rem; background: var(--canvas); border-radius: .5rem; color: var(--muted); font-size: .9rem; }
.actions { display: grid; gap: .55rem; }
.order-number { margin: .8rem 0 0; font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }

@media (max-width: 44rem) {
  .intro { margin-top: 1.6rem; }
  .layout { grid-template-columns: 1fr; gap: .8rem; }
  .summary { grid-column: 1; }
  .dropzone { padding-block: 1.65rem; }
  .batch-form:not(.redeem-form) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-form:not(.redeem-form) button { grid-column: 1 / -1; }
}
