:root { color-scheme: light; --bg: #f3f6f5; --surface: #fff; --ink: #172b2b; --muted: #536c69; --line: #d5e1de; --accent: #086b59; --tint: #e5f2ed; --warn: #854820; --warn-bg: #fff2df; --danger: #b43a44; }
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.65 "Microsoft YaHei", "PingFang SC", sans-serif; }
body.vip { color-scheme: dark; --bg: #101b20; --surface: #19292c; --ink: #eff8f5; --muted: #b0c9c1; --line: #38534f; --accent: #91e5c8; --tint: #244a42; --warn: #f8d6b0; --warn-bg: #3b2e20; --danger: #ffafb8; }
a { color: var(--accent); text-decoration: none; transition: color .18s, background .18s; }
a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { min-height: 42px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); cursor: pointer; transition: background .18s, transform .12s; }
button:hover { background: var(--tint); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .58; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.vip button.primary { color: #12362d; }
button.danger { color: var(--danger); }
button.subtle { background: transparent; border: 0; color: var(--accent); padding-left: 0; text-align: left; }
button.icon-button { width: 42px; height: 42px; flex: 0 0 42px; padding: 0; font-size: 24px; }
button.busy::before { content: ""; display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; margin-right: 8px; vertical-align: -2px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
input, select, textarea { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; min-width: 0; width: 100%; padding: 10px 12px; min-height: 44px; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
label { display: grid; gap: 5px; font-size: 14px; font-weight: 600; }
label small { color: var(--muted); font-weight: 400; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.4; }
h2 { font-size: 20px; line-height: 1.5; }
h3 { font-size: 17px; }
p { margin-top: 9px; }
.muted { color: var(--muted); font-size: 13px; }
.redeem-header { border-bottom: 1px solid var(--line); background: var(--surface); padding: 18px max(24px, calc((100% - 1160px) / 2)); display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.redeem-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--ink); }
.redeem-brand .brand-logo { width: 28px; height: 24px; }
.redeem-brand span { font-size: 12px; color: var(--muted); margin-left: 8px; }
.redeem-header nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; font-size: 14px; }
#account-label { color: var(--muted); max-width: 260px; overflow-wrap: anywhere; }
.redeem-shell { max-width: 1208px; margin: auto; padding: 32px 24px 70px; }
.redeem-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 25px; gap: 20px; }
.redeem-heading p { color: var(--muted); }
.redeem-heading .kicker, .step-label { font-size: 12px; color: var(--accent); font-weight: 700; }
#dragon-mark { width: 80px; height: 80px; object-fit: contain; }
.notice { padding: 12px 16px; background: var(--warn-bg); color: var(--warn); border-left: 3px solid var(--warn); margin: 0 0 20px; overflow-wrap: anywhere; }
.redeem-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.redeem-input-section { padding: 34px; }
.redeem-input-section h2 { margin-bottom: 20px; }
#redeem-form { display: grid; gap: 12px; max-width: 610px; }
#redeem-code { font-family: ui-monospace, monospace; font-size: 16px; padding: 14px; }
#redeem-form button { justify-self: start; min-width: 180px; }
.account-summary { padding: 34px 28px; border-left: 1px solid var(--line); background: var(--tint); overflow-wrap: anywhere; }
.account-summary h2 { margin-top: 12px; }
.account-summary p { color: var(--muted); }
.account-summary a { display: block; margin-top: 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.history-section { margin-top: 32px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.history-section > .row { margin-bottom: 14px; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; border-bottom: 1px solid var(--line); }
.record { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.record p, .record small { color: var(--muted); }
.record small { display: block; overflow-wrap: anywhere; font-size: 12px; }
.record-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 9px; font-size: 12px; color: var(--accent); background: var(--tint); border-radius: 4px; white-space: nowrap; }
.badge.warning { color: var(--warn); background: var(--warn-bg); }
.record-status { text-align: right; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: flex-end; margin-top: 18px; color: var(--muted); font-size: 13px; }
.pager button { min-width: 42px; }
.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tab-bar button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; padding: 12px 18px; }
.tab-bar [aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.generate-section { border-block: 1px solid var(--line); background: var(--surface); margin-bottom: 24px; }
summary { cursor: pointer; padding: 18px 22px; font-weight: 700; }
summary span { float: right; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 0 22px 24px; }
.input-row, .password-line { display: flex; gap: 8px; align-items: center; }
.input-row input, .password-line input { flex: 1; }
.input-row button, .password-line button { flex-shrink: 0; }
.generation-total { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.generation-total span { color: var(--muted); }
.generated-result { border-left: 3px solid var(--accent); padding: 20px; background: var(--surface); margin-bottom: 24px; }
.generated-result .row, .generated-result textarea { margin-top: 12px; }
.generated-result textarea { font: 13px/1.8 ui-monospace, monospace; }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 22px 0; }
.filters label { flex: 1 1 145px; }
.filters button { flex: 0 0 auto; }
.batch-list { display: grid; gap: 14px; }
.batch { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.batch .row h3 { overflow-wrap: anywhere; }
.batch-stats { display: flex; gap: 28px; flex-wrap: wrap; margin: 14px 0; }
.batch-stats span { color: var(--muted); font-size: 13px; }
.batch-stats strong { color: var(--ink); font-size: 20px; margin-left: 8px; }
.batch small { color: var(--muted); overflow-wrap: anywhere; display: block; }
.batch .row:last-child { margin-top: 16px; }
.login-form { max-width: 430px; margin: 8px auto; display: grid; gap: 18px; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.check { display: flex; gap: 7px; align-items: center; }
.check input { width: 18px; min-height: 18px; height: 18px; accent-color: var(--accent); }
dialog { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 28px; max-width: min(560px, calc(100% - 32px)); width: 100%; max-height: calc(100dvh - 40px); overflow: auto; box-shadow: 0 24px 70px #0003; }
dialog::backdrop { background: #071b25b3; }
dialog h2 { margin-bottom: 14px; }
.dialog-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }
#confirm-copy { overflow-wrap: anywhere; white-space: pre-line; }
#verify-note-label { margin-top: 18px; }
#support-copy { margin-top: 12px; }
.code-row { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.code-row small { display: block; color: var(--muted); }
@media (max-width: 800px) {
  .redeem-header { flex-direction: column; align-items: flex-start; padding: 16px 20px; gap: 8px; }
  .redeem-header nav { gap: 14px; }
  .redeem-layout { grid-template-columns: 1fr; }
  .account-summary { border-left: 0; border-top: 1px solid var(--line); padding: 22px; }
  .redeem-input-section { padding: 24px; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 26px; }
}
@media (max-width: 500px) {
  .redeem-shell { padding: 24px 16px 50px; }
  .redeem-brand span { display: none; }
  .redeem-header nav { font-size: 13px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); padding-inline: 16px; }
  .generation-total { align-items: stretch; flex-direction: column; }
  .record { grid-template-columns: minmax(0, 1fr); }
  .record-status { text-align: left; }
  .batch-stats { gap: 14px; }
  .batch-stats strong { font-size: 18px; }
  .tab-bar button { flex: 1; padding: 10px 6px; font-size: 13px; }
  .dialog-actions button { flex: 1; padding-inline: 10px; }
  #dragon-mark { width: 56px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }
