:root {
  color-scheme: light;
  --ink: #654e48;
  --muted: #8b756c;
  --line: #eddfd5;
  --surface: rgba(255, 255, 255, .92);
  --primary: #ad5d79;
  --primary-dark: #93465f;
  --success: #0b9b68;
  --danger: #d64b55;
  --shadow: 0 18px 50px rgba(120, 85, 70, .06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, #fbe3eb, transparent 32rem),
    radial-gradient(circle at 95% 30%, #fff0c8, transparent 30rem),
    #fffaf3;
}

button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.shell { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 52px 0 28px; }
.admin-shell { width: min(980px, calc(100% - 32px)); }
.hero { display: flex; gap: 18px; align-items: center; margin-bottom: 24px; }
.hero h1 { margin: 2px 0 7px; font-size: clamp(28px, 5vw, 40px); letter-spacing: -.04em; }
.hero p { margin: 0; color: var(--muted); line-height: 1.65; }
.eyebrow { color: var(--primary) !important; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.brand-mark { display: grid; place-items: center; flex: 0 0 64px; height: 64px; border: 1px solid #ecc4cf; border-radius: 23px; color: #805063; font: bold 26px Georgia, serif; text-decoration: none; background: #f9dce4; box-shadow: 0 5px 0 #edcbd533; }
.panel { background: var(--surface); border: 1px solid #eddfd5; border-radius: 24px; padding: 28px; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.panel.compact { padding: 20px 24px; }
fieldset { padding: 0; margin: 0 0 28px; border: 0; }
legend { margin-bottom: 13px; font-weight: 750; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.choice { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 14px; border: 1.5px solid var(--line); border-radius: 16px; cursor: pointer; transition: .18s ease; }
.choice:hover, .choice.selected, .amount:hover, .amount.selected { border-color: #cc90a4; background: #fff0f3; box-shadow: 0 0 0 3px #f4dce555; }
.choice:focus-within, .amount:focus-within, button:focus-visible, a:focus-visible { outline: 3px solid #ad5d79; outline-offset: 3px; }
.choice input, .amount input { position: absolute; opacity: 0; pointer-events: none; }
.choice span:last-child { display: grid; gap: 3px; }
.choice small, .amount small, .field small { color: var(--muted); }
.pay-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #fff; font-weight: 850; }
.pay-icon.alipay { background: #1677ff; }
.pay-icon.wechat { background: #19b765; }
.amount-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.amount { display: grid; gap: 4px; padding: 14px 8px; text-align: center; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; transition: .18s ease; }
.amount strong { font-size: 21px; }
.amount small { font-size: 12px; }
.field { display: grid; gap: 8px; }
.field > span { font-weight: 650; }
.field input { width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px; outline: 0; background: #fff; }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(103, 88, 232, .1); }
.primary, .secondary, .link-button { border: 0; border-radius: 12px; padding: 13px 20px; font-weight: 750; }
.primary { color: #704254; background: #f4cdd9; border: 1px solid #e9bdcd; box-shadow: 0 6px 16px #bc81921a; }
.direct-pay { display: block; margin-bottom: 10px; text-align: center; text-decoration: none; }
.direct-pay-tip { margin: -2px 0 12px; color: var(--muted); font-size: 12px; text-align: center; }
.primary:hover { background: #edbbcd; }
.primary:disabled, .secondary:disabled { cursor: wait; opacity: .58; }
.secondary { color: #80673e; background: #fff0c6; }
.link-button { color: var(--muted); background: transparent; box-shadow: none; }
.full { width: 100%; }
.order-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.order-head > div { display: grid; gap: 4px; }
.label { color: var(--muted); font-size: 12px; }
.status { white-space: nowrap; border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 750; }
.waiting-payment { color: #a66800; background: #fff3d6; }
.reviewing { color: #98613a; background: #fff1d2; }
.confirmed { color: #087b54; background: #dcf8ed; }
.rejected { color: #b23c45; background: #ffe8eb; }
.qr-wrap { padding: 24px 0; text-align: center; }
.qr-wrap p { margin: 0 0 9px; color: var(--muted); }
.qr-wrap .price { margin-bottom: 16px; font-size: 35px; font-weight: 850; }
.qr-wrap img { display: block; width: min(310px, 88%); max-height: 430px; margin: auto; object-fit: contain; border-radius: 14px; box-shadow: 0 8px 25px rgba(20, 28, 48, .12); }
.qr-wrap .warning { margin: 16px 0 0; color: #a66800; font-size: 13px; }
#cancel-button { display: block; margin: 8px auto -10px; }
.center-state { padding-top: 30px; text-align: center; }
.center-state h2 { margin: 16px 0 8px; }
.center-state > p { color: var(--muted); line-height: 1.7; }
.spinner { width: 44px; height: 44px; margin: auto; border: 4px solid #f7e2e8; border-top-color: var(--primary); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.success-icon, .error-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: auto; border-radius: 50%; color: #fff; font-size: 28px; font-weight: 800; }
.success-icon { background: var(--success); }
.error-icon { background: var(--danger); }
.summary { margin: 24px 0 0; padding: 8px 18px; border-radius: 16px; background: #f8f9fc; text-align: left; }
.summary div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.summary div:last-child { border-bottom: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 700; }
.code-box { display: flex; align-items: center; gap: 10px; margin: 24px 0 18px; padding: 12px 12px 12px 16px; border: 1.5px dashed #dba6b7; border-radius: 14px; background: #fff1f4; }
.code-box code { flex: 1; overflow-wrap: anywhere; text-align: left; font-size: 15px; }
.code-box button { border: 0; border-radius: 9px; padding: 9px 13px; color: #fff; background: var(--primary); }
.toast, .inline-error { color: var(--danger); }
.toast { margin: 14px 0; padding: 12px 15px; border: 1px solid #ffd1d6; border-radius: 12px; background: #fff0f2; }
.inline-error { font-size: 13px; text-align: center; }
footer { padding: 22px 0 0; color: #929bad; font-size: 12px; text-align: center; }
.login-row { display: flex; align-items: end; gap: 12px; }
.grow { flex: 1; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 28px 2px 14px; }
.toolbar h2 { margin: 0 0 5px; }
.toolbar p { margin: 0; color: var(--muted); font-size: 13px; }
.toolbar-actions { display: flex; align-items: center; gap: 4px; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; margin-left: 4px; border-radius: 999px; color: #fff; background: var(--primary); font-size: 13px; vertical-align: 3px; }
.order-list { display: grid; gap: 12px; }
.order-card { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 28px rgba(38, 43, 72, .06); }
.order-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.order-card h3 { margin: 0 0 5px; font-size: 18px; }
.order-card .meta { color: var(--muted); font-size: 13px; }
.order-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.order-facts div { display: grid; gap: 4px; padding: 10px 12px; border-radius: 11px; background: #f7f8fb; }
.order-facts span { color: var(--muted); font-size: 11px; }
.order-actions { display: flex; gap: 10px; justify-content: end; }
.danger-button { border: 0; border-radius: 12px; padding: 12px 18px; color: var(--danger); background: #fff0f2; font-weight: 700; }
.empty { text-align: center; color: var(--muted); }

@media (max-width: 620px) {
  .shell { width: min(100% - 22px, 760px); padding-top: 28px; }
  .hero { align-items: flex-start; }
  .brand-mark { flex-basis: 50px; height: 50px; border-radius: 15px; }
  .panel { padding: 20px; border-radius: 19px; }
  .choice-grid { grid-template-columns: 1fr; }
  .amount-grid { grid-template-columns: repeat(3, 1fr); }
  .login-row { align-items: stretch; flex-direction: column; }
  .toolbar { align-items: flex-start; }
  .order-facts { grid-template-columns: repeat(2, 1fr); }
  .order-actions { display: grid; grid-template-columns: 1fr 1fr; }
}
