/* 公共设计 tokens：浅色 IDE 风格，前后台共享；不使用动画或外部字体。 */
:root {
  color-scheme: light;
  --bg: #f5f5fa;
  --surface: #ffffff;
  --surface-border: #e3e3ed;
  --accent: #7050c9;
  --accent-deep: #5636ac;
  --accent-soft: #f0eafa;
  --text: #272536;
  --text-dim: #6e6b80;
  --danger: #b83c50;
  --ok: #247752;
  --warning: #956118;
  --radius: 18px;
  --shadow: 0 8px 28px rgba(40, 31, 72, .045);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { min-height: 100vh; background: var(--bg); color: var(--text); font: 14px/1.65 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid #b5a1e7; outline-offset: 3px; }
h1, h2, h3 { line-height: 1.35; font-weight: 650; }
h1 { font-size: clamp(25px, 3.2vw, 34px); letter-spacing: -.035em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p, td, th, .brand, .user { overflow-wrap: anywhere; }
small { font-size: 12px; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  min-width: 0; max-width: 100%; min-height: 44px; padding: 10px 13px;
  border: 1px solid #d9d7e4; border-radius: 9px; background: #fff; color: var(--text);
}
input::placeholder, textarea::placeholder { color: #918c9f; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; flex: 0 0 auto; }
input:disabled, select:disabled { background: #f3f2f7; color: var(--text-dim); }

/* 品牌与公共导航 */
.topbar { max-width: 1160px; margin: 0 auto; padding: 20px 28px; min-height: 84px; display: flex; align-items: center; gap: 22px; border-bottom: 1px solid var(--surface-border); }
.brand, .side-brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 750; color: var(--text); text-decoration: none; letter-spacing: .04em; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; background: var(--accent); border-radius: 11px; color: white; font-size: 21px; letter-spacing: -.08em; }
.brand small { display: block; color: var(--text-dim); font-size: 10px; font-weight: 500; letter-spacing: .12em; line-height: 1.2; }
.spacer { flex: 1; }
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-link { padding: 8px 13px; border-radius: 8px; color: var(--text-dim); font-weight: 550; }
.nav-link:hover { background: #edebf5; color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); color: var(--accent-deep); }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
.user { color: var(--text-dim); font-size: 13px; max-width: 180px; }
.app-main { width: 100%; max-width: 1160px; margin: 0 auto; padding: 34px 28px 48px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; min-width: 0; }
.page-heading h1 { margin-top: 5px; }
.lot-info { display: flex; align-items: baseline; gap: 16px; margin-top: 6px; font-weight: 650; color: var(--text-dim); }
.lot-info .lot-cd { color: var(--accent-deep); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.page-description { color: var(--text-dim); margin-top: 8px; max-width: 700px; }
.eyebrow { font-size: 11px; font-weight: 750; letter-spacing: .14em; color: var(--accent); text-transform: uppercase; }
.page-footer { color: var(--text-dim); font-size: 12px; padding: 24px 0 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* 卡片与按钮；替换原 Uiverse.io / 0x-Sarthak 按钮，去除伪元素动效。 */
.card, .panel { min-width: 0; background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.card { margin-bottom: 18px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.card-heading p { color: var(--text-dim); font-size: 12px; margin-top: 5px; }
.card-heading .btn { flex-shrink: 0; }
.btn, .draw-btn, .tab-btn { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 42px; padding: 9px 16px; border: 1px solid #dcd9e8; border-radius: 9px; color: var(--text); background: #fff; font-size: 13px; font-weight: 550; text-align: center; text-decoration: none; }
.btn:hover, .tab-btn:hover { border-color: #ae9bd8; background: #f8f6fc; color: var(--accent-deep); text-decoration: none; }
.btn.primary, .draw-btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover, .draw-btn:not(:disabled):hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.draw-btn { min-height: 50px; padding: 13px 24px; font-size: 15px; }
.btn.danger { color: var(--danger); border-color: #ebcbd2; }
.btn.danger:hover { background: #fff2f4; }
.btn.quiet { background: transparent; }
.full-width { width: 100%; }
.message { font-size: 13px; padding: 11px 14px; border: 1px solid #e3d9f6; background: #f7f3ff; border-radius: 9px; color: var(--accent-deep); margin-bottom: 16px; overflow-wrap: anywhere; }
.message.error { background: #fff3f5; border-color: #f0d4db; color: var(--danger); }
.message.success { background: #edf8f2; border-color: #cbe8d9; color: var(--ok); }
.message.warning { background: #fff8ec; border-color: #eedcba; color: #835412; }
.message:empty { display: none; }
.muted, .hint { color: var(--text-dim); font-size: 13px; }
.hint { margin-top: 14px; }
.empty-state { padding: 30px 18px; text-align: center; border: 1px dashed var(--surface-border); border-radius: 12px; color: var(--text-dim); background: #faf9fc; }

/* 登录 / 注册 */
.auth-main { max-width: 1120px; margin: 0 auto; padding: 56px 36px; display: grid; grid-template-columns: minmax(0, 420px); justify-content: center; align-items: center; min-height: calc(100vh - 84px); }
.auth-intro { min-width: 0; }
.auth-intro h1 { font-size: clamp(30px, 4vw, 46px); margin: 16px 0; line-height: 1.25; }
.accent-text { color: var(--accent); }
.auth-intro > p { color: var(--text-dim); max-width: 420px; font-size: 15px; }
.feature-list { display: grid; gap: 20px; margin: 32px 0; }
.feature { display: flex; align-items: flex-start; gap: 14px; }
.feature-index { width: 32px; height: 32px; border: 1px solid #ded5f1; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 12px; display: grid; place-items: center; flex-shrink: 0; font-weight: 700; }
.feature h2 { font-size: 14px; margin-bottom: 3px; }
.feature p { font-size: 13px; color: var(--text-dim); }
.intro-note { border-top: 1px solid var(--surface-border); padding-top: 18px; color: var(--text-dim); font-size: 12px; }
.auth-card { padding: 32px; }
.auth-card h2 { font-size: 24px; margin-bottom: 6px; }
.auth-card .form { margin-top: 24px; }
.field { margin-bottom: 17px; text-align: left; }
.field label { display: block; font-size: 13px; font-weight: 550; margin-bottom: 7px; }
.field label small { font-weight: 400; color: var(--text-dim); }
.field input, .field select, .field textarea { width: 100%; }
.field-help { color: var(--text-dim); font-size: 12px; margin-top: 5px; }
.form-error { color: var(--danger); font-size: 13px; margin-bottom: 12px; overflow-wrap: anywhere; }
.form-error:empty { display: none; }
.form-foot { padding-top: 20px; margin-top: 22px; border-top: 1px solid var(--surface-border); font-size: 13px; color: var(--text-dim); text-align: center; }
.center-screen { min-height: calc(100vh - 84px); display: grid; place-items: center; padding: 28px 16px; }
.center-screen > .panel { width: min(440px, 100%); text-align: center; }
.center-screen .eyebrow { margin-bottom: 10px; }
.entry-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* 抽取工作区：主操作与额度 / 账户两栏 */
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.workspace-grid > * { min-width: 0; }
.draw-card { padding: 30px; }
.result { min-height: 235px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; padding: 30px 20px; border: 1px solid #e5dff1; border-radius: 13px; background: #f8f6fc; text-align: center; }
.result-label { color: var(--accent); font-size: 11px; letter-spacing: .12em; font-weight: 700; }
.result-text { font-size: clamp(24px, 3vw, 36px); font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; max-width: 100%; }
.result-note { font-size: 12px; color: var(--text-dim); }
.draw-controls { margin-top: 24px; }
.draw-controls .hint { text-align: center; }
.quota-card { background: #f9f6ff; border-color: #ded4f0; }
.quota-number { font-size: 56px; line-height: 1.15; font-weight: 750; color: var(--accent); letter-spacing: -.05em; margin: 22px 0 6px; font-variant-numeric: tabular-nums; }
.quota-number small { font-size: 14px; font-weight: 500; color: var(--text-dim); letter-spacing: 0; margin-left: 10px; }
.quota-card .btn { margin-top: 20px; }
.account-details { display: grid; gap: 12px; }
.account-details > div { display: flex; gap: 14px; justify-content: space-between; }
.account-details dt { color: var(--text-dim); font-size: 13px; flex-shrink: 0; }
.account-details dd { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.invite-box { border-top: 1px solid var(--surface-border); margin-top: 18px; padding-top: 18px; }
.invite-code { display: block; background: #f5f2fa; border: 1px dashed #d9cbee; border-radius: 8px; margin: 10px 0; padding: 10px 12px; font-size: 18px; color: var(--accent-deep); font-family: ui-monospace, Consolas, monospace; letter-spacing: .1em; overflow-wrap: anywhere; }
.sub-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 16px; }
.sub-form .field { margin-bottom: 0; }
.sub-form > .btn { grid-column: 1 / -1; justify-self: start; }

/* 套餐与支付信息 */
.recharge-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.recharge-grid > * { min-width: 0; }
.pkg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.pkg { width: 100%; min-width: 0; padding: 20px; text-align: left; border: 1px solid var(--surface-border); border-radius: 12px; background: #fff; color: var(--text); }
.pkg:hover { border-color: #b5a0da; }
.pkg.active { border-color: var(--accent); background: #f8f5ff; box-shadow: 0 0 0 1px var(--accent); }
.pkg .name { display: block; font-size: 14px; font-weight: 650; margin-bottom: 12px; overflow-wrap: anywhere; }
.pkg .price { display: block; font-size: 29px; font-weight: 700; color: var(--accent); line-height: 1.35; overflow-wrap: anywhere; }
.pkg .price small { font-size: 11px; color: var(--text-dim); font-weight: 500; }
.pkg .muted { display: block; margin-top: 8px; }
.pkg-selection { color: var(--text-dim); margin: 0 0 14px; font-size: 13px; }
.pending-banner { padding: 16px; border: 1px solid #e8d7b6; border-radius: 12px; background: #fff9ef; margin-bottom: 20px; }
.pending-banner p { font-size: 13px; color: #815a20; margin: 5px 0 12px; }
.payment-alert { margin: 20px 0; padding: 16px; border: 1px solid #ead5b3; background: #fff8ec; color: #805115; border-radius: 11px; font-size: 13px; }
.payment-alert strong { display: block; font-size: 15px; margin-bottom: 5px; }
.payment-summary { border: 1px solid #e1d7f2; border-radius: 12px; padding: 20px; background: #f8f5fd; }
.payment-summary .hint { margin-top: 4px; }
.pay-amount { font-size: clamp(30px, 4vw, 42px); line-height: 1.35; font-weight: 750; color: var(--accent-deep); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pay-amount small { font-size: 15px; font-weight: 550; }
.payment-transfer { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 20px; align-items: start; margin: 22px 0; }
#qrcode { display: flex; justify-content: center; align-items: center; min-height: 184px; padding: 4px; border: 1px solid var(--surface-border); border-radius: 10px; background: white; }
#qrcode img, #qrcode canvas { max-width: 100%; height: auto; }
.qr-caption { text-align: center; color: var(--text-dim); font-size: 11px; margin-top: 8px; }
.addr { padding: 12px; background: #f7f7fa; border: 1px solid var(--surface-border); border-radius: 9px; font: 13px/1.7 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; word-break: break-all; margin: 8px 0 12px; user-select: all; }
.countdown { font-size: 21px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text); }
.payment-time { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 15px 0; border-top: 1px solid var(--surface-border); }
.payment-time p { color: var(--text-dim); font-size: 13px; }
.payment-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.guide-steps { list-style: none; display: grid; gap: 22px; counter-reset: step; }
.guide-steps li { counter-increment: step; padding-left: 38px; position: relative; }
.guide-steps li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0; color: var(--accent); background: var(--accent-soft); width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; font-size: 11px; font-weight: 700; }
.guide-steps strong { font-size: 13px; display: block; }
.guide-steps p { font-size: 12px; color: var(--text-dim); margin-top: 5px; }
.guide-divider { margin: 22px 0; border: 0; border-top: 1px solid var(--surface-border); }
.status-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 550; border: 1px solid var(--surface-border); color: var(--text-dim); background: #f5f5fa; white-space: nowrap; }
.status-badge.pending { color: #875b19; background: #fff7e9; border-color: #eedbb9; }
.status-badge.paid, .status-badge.manual { color: var(--ok); background: #edf8f2; border-color: #cde7d9; }
.status-badge.expired, .status-badge.mismatch { color: var(--danger); background: #fff2f4; border-color: #efcdd6; }

/* 前台和后台表格：滚动局限在表格容器，不扩大主区。 */
.list { min-width: 0; text-align: left; }
.list h3 { margin-bottom: 14px; }
.table-scroll { min-width: 0; width: 100%; max-width: 100%; overflow-x: auto; border: 1px solid var(--surface-border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th { padding: 12px 14px; color: var(--text-dim); background: #f8f8fb; font-weight: 550; border-bottom: 1px solid var(--surface-border); white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid #eeedf4; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #faf9fd; }
table .muted { font-size: 12px; }
.table-empty { padding: 28px 14px; text-align: center; color: var(--text-dim); }
.txid-cell { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td .btn { min-height: 32px; padding: 5px 10px; font-size: 12px; margin: 2px; }
.history-table { min-width: 340px; }
.orders-table { min-width: 560px; }
.sub-table { min-width: 460px; }

/* 管理后台新布局与旧 admin-wrap 同时兼容；侧栏保持 240px。 */
.admin-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; width: 100%; }
.admin-sidebar { width: 240px; min-width: 0; background: #fbfaff; border-right: 1px solid var(--surface-border); padding: 28px 18px 20px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; }
.side-brand { padding: 0 9px; flex-wrap: wrap; }
.side-brand small { display: block; width: 100%; color: var(--text-dim); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.admin-sidebar .side-brand { justify-content: flex-start; text-align: left; min-height: 48px; }
.side-footer strong, .side-footer > span { display: block; margin-bottom: 5px; }
.side-footer { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid var(--surface-border); font-size: 12px; color: var(--text-dim); overflow-wrap: anywhere; }
.admin-main { min-width: 0; width: 100%; max-width: 100%; padding: 28px 32px 48px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; border-bottom: 1px solid var(--surface-border); margin-bottom: 26px; padding-bottom: 20px; min-width: 0; }
.admin-wrap { width: min(1160px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 48px; }
.admin-wrap > section, .admin-main > section { min-width: 0; }
.page-intro { margin-bottom: 26px; }
h1.page-heading { display: block; margin-bottom: 0; }
.section-heading { margin-bottom: 20px; }
.section-heading .muted { margin-top: 6px; }
.admin-section > .stat-grid { margin-bottom: 20px; }
.stat-grid > .stat.card { margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 0 18px; min-width: 0; }
.toolbar > .field { margin-bottom: 0; flex: 0 1 260px; }
.form-actions { margin-top: 20px; margin-bottom: 0; }
.pagination { margin-top: 18px; margin-bottom: 0; }
.row-actions { display: flex; gap: 5px; flex-wrap: wrap; min-width: 150px; }
.table-input { width: 100%; min-width: 120px; }
.input-short { width: 100px; min-width: 80px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.admin-wrap .card, .admin-main .card { max-width: 100%; overflow-x: auto; }
.admin-wrap table, .admin-main table { min-width: 640px; }
.admin-wrap th, .admin-main th { font-size: 12px; }
.admin-wrap td, .admin-main td { color: var(--text); }
.admin-wrap table input:not([type="checkbox"]), .admin-main table input:not([type="checkbox"]) { min-height: 36px; border-radius: 6px; }
.admin-wrap table td:last-child, .admin-main table td:last-child { min-width: 100px; }
.tabs { display: flex; gap: 7px; flex-wrap: wrap; margin: 0 0 24px; }
.tab-btn.active { color: var(--accent-deep); border-color: #d8cbef; background: var(--accent-soft); }
.admin-sidebar .tabs, .admin-sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.admin-sidebar .tab-btn { justify-content: flex-start; width: 100%; background: transparent; border-color: transparent; text-align: left; padding: 11px 14px; }
.admin-sidebar .tab-btn.active { background: var(--accent-soft); color: var(--accent-deep); border-color: #e0d5f3; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(155px, 100%), 1fr)); gap: 14px; min-width: 0; }
.stat { min-width: 0; text-align: left; background: #faf9fd; border: 1px solid #eae6f3; border-radius: 12px; padding: 20px; }
.stat .num, .stat-value { font-size: 28px; font-weight: 750; color: var(--accent-deep); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat .label, .stat-label { font-size: 12px; color: var(--text-dim); margin-top: 5px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; min-width: 0; }
.toolbar input, .toolbar select { font-size: 13px; }
.chk { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.dialog { width: min(560px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); margin: auto; padding: 0; background: #fff; color: var(--text); border: 1px solid var(--surface-border); border-radius: 16px; box-shadow: 0 20px 80px rgba(40, 31, 72, .15); overflow-y: auto; }
.dialog-wide { width: min(960px, calc(100vw - 32px)); }
.dialog-body > h2 { margin-bottom: 8px; }
.dialog-body > .muted, .dialog-body > #confirmMessage { margin-bottom: 20px; }
.dialog-body .table-scroll table { min-width: 740px; }
.dialog::backdrop { background: rgba(235, 231, 246, .78); }
.dialog-overlay, .dialog-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px 16px; background: rgba(235, 231, 246, .78); z-index: 80; }
.dialog-header { padding: 22px 24px 18px; border-bottom: 1px solid var(--surface-border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-body { padding: 24px; min-width: 0; }
.dialog-actions { padding: 16px 24px; border-top: 1px solid var(--surface-border); background: #faf9fd; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); background: #fff; border: 1px solid #d4c7eb; padding: 12px 20px; border-radius: 11px; box-shadow: 0 6px 24px rgba(40, 31, 72, .12); font-size: 13px; opacity: 0; pointer-events: none; z-index: 99; overflow-wrap: anywhere; }
#toast.show { opacity: 1; }

@media (max-width: 960px) {
  .auth-main { padding: 40px 28px; grid-template-columns: minmax(0, 380px); justify-content: center; }
  .workspace-grid, .recharge-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
  .payment-transfer { grid-template-columns: 1fr; }
  .qr-block { width: 184px; justify-self: center; }
  .admin-main { padding: 24px 20px; }
}
@media (max-width: 760px) {
  .topbar { padding: 16px 20px; gap: 12px; flex-wrap: wrap; }
  .header-actions { gap: 8px; }
  .topbar .nav-links { order: 3; width: 100%; border-top: 1px solid var(--surface-border); padding-top: 12px; }
  .auth-main { grid-template-columns: minmax(0, 1fr); min-height: auto; gap: 26px; padding: 30px 20px 40px; max-width: 560px; }
  .auth-intro h1 { font-size: 30px; margin: 12px 0; }
  .feature-list, .intro-note { display: none; }
  .auth-card { padding: 26px; }
  .app-main { padding: 26px 20px 36px; }
  .workspace-grid, .recharge-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .workspace-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .card, .panel, .draw-card { padding: 22px; }
  .result { min-height: 200px; }
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-sidebar { position: static; width: 100%; height: auto; max-width: 100%; border: 0; padding: 22px 20px 12px; gap: 20px; }
  .admin-sidebar .tabs, .admin-sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .admin-sidebar .tab-btn { width: auto; padding: 9px 12px; }
  .side-footer { display: none; }
  .admin-main { padding: 20px; }
  .admin-wrap { width: calc(100% - 40px); }
}
@media (max-width: 480px) {
  .topbar { padding: 14px 16px; }
  .brand { font-size: 13px; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; font-size: 19px; }
  .topbar .user { display: none; }
  .header-actions .btn { padding: 8px 11px; }
  .nav-link { padding: 8px 12px; }
  .app-main { padding: 24px 16px 32px; }
  .page-heading { margin-bottom: 20px; }
  .page-heading h1 { font-size: 27px; }
  .page-description { font-size: 13px; }
  .auth-main { padding: 26px 16px 32px; gap: 24px; }
  .auth-intro > p { font-size: 13px; }
  .auth-intro h1 { font-size: 28px; }
  .auth-card, .card, .panel, .draw-card { padding: 20px; border-radius: 14px; }
  .auth-card h2 { font-size: 22px; }
  .workspace-aside { display: block; }
  .result { min-height: 185px; padding: 26px 16px; }
  .pkg-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pkg { padding: 17px 18px; }
  .pkg .name { margin-bottom: 8px; }
  .payment-summary { padding: 16px; }
  .payment-time { align-items: flex-start; flex-direction: column; gap: 7px; }
  .payment-actions .btn { flex: 1 1 100%; }
  .sub-form { grid-template-columns: minmax(0, 1fr); }
  .sub-form > .btn { width: 100%; }
  .card-heading { align-items: flex-start; }
  .card-heading .btn { min-height: 36px; padding: 6px 10px; }
  .quota-number { margin-top: 16px; font-size: 48px; }
  .admin-main { padding: 18px 16px; }
  .admin-wrap { width: calc(100% - 32px); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat .num { font-size: 23px; }
  .toolbar input, .toolbar select { flex: 1 1 160px; }
  .dialog-body { padding: 20px; }
  .dialog-actions { padding: 14px 20px; }
}
