:root {
    --admin-bg: #111111;
    --admin-surface: #1a1a1a;
    --admin-surface-raised: #1f1f1f;
    --admin-input: #151515;
    --admin-border: #2e2e2e;
    --admin-border-strong: #3d3d3d;
    --admin-text: #f8fafc;
    --admin-text-muted: #94a3b8;
    --admin-text-subtle: #64748b;
    --admin-blue: #38bdf8;
    --admin-green: #22c55e;
    --admin-red: #f87171;
    --admin-yellow: #fbbf24;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--admin-text);
    background: var(--admin-bg);
    letter-spacing: 0;
}

.async-tasks-wrap { max-width: 100%; }
#async-tasks-table { min-width: 1650px; font-variant-numeric: tabular-nums; }
#async-tasks-table td { vertical-align: top; }
#async-tasks-table small { display: block; margin-top: 6px; color: var(--admin-text-muted); }
#async-tasks-table .async-task-id { max-width: 240px; overflow-wrap: anywhere; white-space: normal; }
#async-tasks-table progress { display: block; width: 80px; height: 8px; accent-color: var(--admin-green); }
.async-task-money { white-space: nowrap; }
.async-task-state { white-space: nowrap; }
.async-task-state[data-state="completed"] { color: var(--admin-green); }
.async-task-state[data-state="failed"], .async-task-state[data-state="uncertain"] { color: var(--admin-red); }
.async-task-state[data-state="running"] { color: var(--admin-blue); }
dialog.async-task-dialog { width: min(840px, calc(100% - 32px)); }
.async-task-dialog pre { margin: 0; padding: 16px; border: 1px solid var(--admin-border); border-radius: 5px; background: var(--admin-input); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.65; }
.async-task-dialog h3 { font-size: 14px; margin: 8px 0 0; }
.async-task-dialog .page-heading { margin: 0; }
.async-task-dialog p { overflow-wrap: anywhere; }
#async-task-detail-meta { white-space: pre-line; line-height: 1.8; }

.payment-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 24px; overflow: auto; border: 1px solid var(--admin-border-strong); border-radius: 8px; background: var(--admin-surface); color: var(--admin-text); }
.payment-dialog::backdrop { background: rgb(0 0 0 / .7); }
.account-action-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; overflow: auto; border: 1px solid var(--admin-border-strong); border-radius: 8px; background: var(--admin-surface); color: var(--admin-text); }
.account-action-dialog::backdrop { background: rgb(0 0 0 / .7); }
.account-action-content { display: grid; gap: 14px; padding: 24px; }
.account-action-content h2, .account-action-content p { margin: 0; }
#account-action-message { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.8; }
.account-action-content label { display: grid; gap: 7px; }
.account-action-content textarea { width: 100%; min-height: 88px; padding: 10px; border: 1px solid var(--admin-border); border-radius: 5px; background: var(--admin-input); color: var(--admin-text); resize: vertical; }
.account-action-error { color: var(--admin-red); }
.account-action-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.payment-dialog h2 { margin: 0; }
.payment-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#purchase-close { width: 44px; height: 44px; padding: 0; flex: 0 0 auto; font-size: 24px; }
.payment-product { margin: 24px 0 8px; overflow-wrap: anywhere; }
.payment-amount { display: block; margin-bottom: 24px; font-size: 30px; font-variant-numeric: tabular-nums; }
.payment-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; padding: 0; border: 0; }
.payment-methods legend { padding: 0 0 12px; color: var(--admin-text-muted); }
.payment-methods label { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 12px; border: 1px solid var(--admin-border-strong); border-radius: 6px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.payment-methods input { width: 18px; height: 18px; flex: 0 0 auto; }
.payment-wechat:has(input:checked) { border-color: var(--admin-green); background: rgb(34 197 94 / .08); }
.payment-alipay:has(input:checked) { border-color: var(--admin-blue); background: rgb(56 189 248 / .08); }
.payment-channel-label { display: flex; justify-content: center; align-items: baseline; gap: 8px; margin: 0 0 16px; color: var(--admin-text-muted); font-size: 13px; }
.payment-channel-label strong { color: var(--admin-text); font-size: 15px; }
.payment-qr-area { display: grid; place-items: center; min-height: 240px; }
.payment-qr-area:has(img[hidden]) { min-height: 0; }
.payment-qr-area img { display: block; width: 240px; height: 240px; max-width: 100%; padding: 8px; border-radius: 6px; background: white; box-shadow: 0 8px 24px rgb(0 0 0 / .24); }
#purchase-status { margin: 16px 0; min-height: 24px; line-height: 1.6; text-align: center; overflow-wrap: anywhere; }
.payment-return-countdown { margin: -4px 0 16px; color: var(--admin-green); font-size: 13px; text-align: center; }
.payment-error { color: var(--admin-red); }
.payment-order { margin: 16px 0 24px; color: var(--admin-text-muted); font-size: 12px; overflow-wrap: anywhere; }
.payment-actions { display: grid; gap: 12px; }
.payment-dialog button { min-height: 44px; white-space: normal; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; overflow-x: hidden; background: var(--admin-bg); color: var(--admin-text); font-size: 14px; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { min-height: 38px; padding: 8px 14px; border: 1px solid var(--admin-border); border-radius: 5px; background: var(--admin-surface-raised); color: var(--admin-text); cursor: pointer; white-space: nowrap; transition: border-color .15s ease, background .15s ease, color .15s ease; }
button:hover { border-color: var(--admin-border-strong); background: #172842; }
button:disabled { cursor: default; opacity: .5; }
button.primary { border-color: var(--admin-green); background: var(--admin-green); color: #03120a; font-weight: 700; }
button.primary:hover { background: #4ade80; border-color: #4ade80; }
input, select { width: 100%; min-width: 0; height: 40px; padding: 8px 10px; border: 1px solid var(--admin-border); border-radius: 5px; background: var(--admin-input); color: var(--admin-text); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--admin-blue); outline-offset: 2px; }
input::placeholder { color: var(--admin-text-subtle); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--admin-green); cursor: pointer; }
label { display: grid; gap: 7px; color: var(--admin-text-muted); }
a { color: var(--admin-blue); }
.usage-returned { color: var(--admin-blue); }
h1 { margin: 0 0 24px; color: var(--admin-text); font-size: 24px; font-weight: 700; }
h2 { margin: 0 0 18px; color: var(--admin-text); font-size: 17px; font-weight: 700; }
h3 { color: var(--admin-text); font-size: 15px; }
.muted, dt { color: var(--admin-text-muted); }
.task-filters { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(2, minmax(140px, 1fr)) auto; align-items: end; gap: 16px; margin-bottom: 24px; }
.task-filter-actions { display: flex; gap: 8px; }
.task-table { min-width: 1000px; font-variant-numeric: tabular-nums; }
.task-table td { max-width: 250px; overflow-wrap: anywhere; }
.task-table td small { display: block; margin-top: 6px; color: var(--admin-text-muted); font: 12px/1.5 ui-monospace, Consolas, monospace; }
.task-state-running { color: var(--admin-blue); }
.task-state-done { color: var(--admin-green); }
.task-state-failed, .task-state-error, .task-state-interrupted, #admin-tasks-warning { color: var(--admin-red); }
@media (max-width: 1100px) { .task-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
    .task-filters { grid-template-columns: minmax(0, 1fr); }
    .task-filters input, .task-filters select, .task-filter-actions button { min-height: 44px; }
}

.admin-console { min-height: 100vh; background: var(--admin-bg); }
.admin-topbar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; min-height: 70px; padding: 12px 28px; border-bottom: 1px solid var(--admin-border); background: rgba(17, 17, 17, .96); }
.brand { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 132px; color: var(--admin-text); font-size: 24px; line-height: 1.15; font-weight: 700; text-decoration: none; text-align: center; }
.brand img { width: 36px; height: 36px; border: 1px solid var(--admin-border); border-radius: 6px; object-fit: cover; }
.brand [data-brand-name] { max-width: 220px; overflow-wrap: anywhere; }
.admin-page-title { color: var(--admin-text-muted); font-size: 13px; }
.admin-topbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-left: auto; }
.admin-system-status { display: inline-flex; align-items: center; gap: 7px; color: var(--admin-text-muted); font-size: 12px; }
.admin-system-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--admin-green); box-shadow: 0 0 0 3px rgba(34, 197, 94, .12); }
.admin-account { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 0; color: #cbd5e1; font-size: 14px; }
#admin-account-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-coins { color: #f59e0b; }
.account-summary-divider { color: #64748b; }
.admin-account-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border: 1px solid rgba(56, 189, 248, .3); border-radius: 50%; background: #222222; color: var(--admin-blue); font-size: 11px; font-weight: 750; }
.admin-account-copy { display: grid; gap: 2px; min-width: 0; }
.admin-account-copy strong { overflow-wrap: anywhere; color: var(--admin-text); font-size: 12px; }
.admin-account-copy small { color: var(--admin-text-muted); font-size: 11px; }
#session-controls { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--admin-text-muted); font-size: 12px; }
#session-controls button, #session-controls a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px; border: 0; border-radius: 5px; text-decoration: none; white-space: nowrap; font-size: 14px; background: transparent; }
#session-controls a { color: #cbd5e1; }
#session-controls a:hover, #session-controls button:hover { background: #292929; }
#session-controls #logout { color: var(--admin-red); }

.account-layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: calc(100vh - 70px); }
body[data-page="login"] .account-layout { display: block; grid-template-columns: minmax(0, 1fr); }
.admin-sidebar { display: flex; flex-direction: column; min-width: 0; padding: 22px 14px 16px; border-right: 1px solid var(--admin-border); background: #141414; }
.admin-sidebar nav { display: grid; gap: 18px; }
.admin-nav-group { display: grid; gap: 4px; }
.admin-nav-label { padding: 0 11px 7px; color: var(--admin-text-subtle); font-size: 10px; font-weight: 700; }
.admin-sidebar a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 9px 11px; border: 1px solid transparent; border-radius: 6px; color: var(--admin-text-muted); text-decoration: none; overflow-wrap: anywhere; }
.admin-sidebar a:hover { background: rgba(148, 163, 184, .08); color: var(--admin-text); }
.admin-sidebar a[aria-current="page"] { border-color: rgba(56, 189, 248, .28); background: rgba(56, 189, 248, .12); color: var(--admin-text); font-weight: 650; }
.admin-nav-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--admin-text-subtle); }
.admin-sidebar a[aria-current="page"] .admin-nav-dot { background: var(--admin-blue); box-shadow: 0 0 0 3px rgba(56, 189, 248, .12); }
.admin-sidebar-footer { display: grid; gap: 4px; margin-top: auto; padding: 14px 11px 0; border-top: 1px solid var(--admin-border); color: var(--admin-text-muted); font-size: 11px; }
.admin-sidebar-footer small { color: var(--admin-text-subtle); }
.admin-sidebar-footer > span { min-width: 0; overflow-wrap: anywhere; line-height: 1.6; }

.admin-workspace { width: min(1440px, 100%); min-width: 0; margin: 0 auto; padding: 28px clamp(20px, 4vw, 48px) 64px; }
#notice { position: fixed; z-index: 100; top: 50%; left: 50%; width: min(560px, calc(100vw - 32px)); max-height: min(70vh, 420px); min-height: 0; margin: 0; padding: 14px 18px; transform: translate(-50%, calc(-50% - 8px)); border: 1px solid var(--admin-border-strong); border-radius: 8px; background: var(--admin-surface-raised); color: var(--admin-text-muted); box-shadow: 0 12px 30px rgb(0 0 0 / .28); line-height: 1.55; overflow: auto; overflow-wrap: anywhere; text-align: center; opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s; }
#notice:not(:empty) { transform: translate(-50%, -50%); opacity: 1; visibility: visible; transition-delay: 0s; }
#notice.error { border-color: color-mix(in srgb, var(--admin-red) 55%, var(--admin-border)); color: #fca5a5; }
#notice.success { border-color: color-mix(in srgb, var(--admin-green) 55%, var(--admin-border)); color: #86efac; }
@media (prefers-reduced-motion: reduce) { #notice { transition: none; } }
#credentials { max-width: 390px; margin: 42px auto; padding: 28px; border: 1px solid var(--admin-border); border-radius: 8px; background: var(--admin-surface); }
.tabs { display: flex; gap: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--admin-border); }
.tabs button { min-height: 40px; padding: 9px 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--admin-text-muted); }
.tabs button[aria-selected="true"] { border-color: var(--admin-blue); color: var(--admin-text); font-weight: 700; }
form { display: grid; gap: 16px; }
.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; }
.registration-qr-trigger { justify-self: start; border: 0; padding: 0; color: var(--admin-blue); background: transparent; }
.registration-invite { display: grid; gap: 8px; min-width: 0; }
#registration-invite-hint { margin: 0; padding: 12px; border: 1px dashed var(--admin-border); border-radius: 4px; color: var(--admin-muted); overflow-wrap: anywhere; }
.registration-invite-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.registration-invite-actions button { min-height: 44px; }
.registration-qr-settings { max-width: 960px; }
.registration-qr-settings fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.registration-qr-settings legend { margin-bottom: 24px; font-size: 17px; font-weight: 600; }
.registration-qr-upload { max-width: 420px; }
.registration-qr-upload input { height: auto; min-height: 44px; }
.registration-qr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 16px; margin: 24px 0; }
.registration-qr-item { display: grid; justify-items: start; gap: 16px; padding: 16px; border: 1px solid var(--admin-border); border-radius: 6px; }
.registration-qr-item img { display: block; width: 160px; height: 160px; max-width: 100%; object-fit: contain; background: #fff; }
.registration-qr-item button { min-height: 44px; color: var(--admin-red); }
#registration-qr-dialog { width: min(400px, calc(100% - 32px)); }
#registration-qr-dialog .page-heading { align-items: center; }
#registration-qr-dialog h2 { margin: 0; }
#registration-qr-dialog p { line-height: 1.7; overflow-wrap: anywhere; }
#registration-qr-message { text-align: center; }
#retry-registration-qr { display: block; margin-inline: auto; }
.registration-qr-viewport { display: grid; place-items: center; min-height: 256px; }
.registration-qr-viewport img { display: block; width: 256px; height: 256px; max-width: 100%; object-fit: contain; background: #fff; }
.profile { display: flex; flex-wrap: wrap; gap: 18px 42px; margin: 0; }
.profile div { min-width: 120px; }
dd { margin: 7px 0 0; color: var(--admin-text); font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
.section { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--admin-border); }
.section.page { margin-top: 0; padding-top: 0; border-top: 0; }
#administration > [data-page-section] { margin-top: 0; padding-top: 0; border-top: 0; }
#issued-cards-panel { display: grid; gap: 12px; margin: 24px 0; }
#issued-cards-panel p { margin: 0; }
#issued-cards-panel button { justify-self: start; }
#issued-cards { width: 100%; min-height: 140px; resize: vertical; padding: 12px; border: 1px solid var(--admin-border); border-radius: 5px; background: var(--admin-input); color: var(--admin-text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.7; }
#card-batch-form { margin-bottom: 24px; }
.page-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-heading h1 { margin: 0 0 7px; }
.page-heading p { max-width: 760px; margin: 0; color: var(--admin-text-muted); line-height: 1.65; }
.page-heading > button, .page-heading > .section-actions { flex: 0 0 auto; }
.overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 6px; }
.overview-card { display: grid; align-content: start; gap: 8px; min-height: 118px; padding: 16px; border: 1px solid var(--admin-border); border-radius: 7px; background: var(--admin-surface); }
.overview-card span { color: var(--admin-text-muted); font-size: 12px; }
.overview-card strong { color: var(--admin-text); font-size: 20px; overflow-wrap: anywhere; }
.overview-card small { color: var(--admin-text-subtle); line-height: 1.5; overflow-wrap: anywhere; }
.overview-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px; }
.overview-summary dd { overflow-wrap: anywhere; line-height: 1.6; }
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-links a { padding: 9px 12px; border: 1px solid var(--admin-border); border-radius: 5px; background: var(--admin-surface); text-decoration: none; }
.quick-links a:hover { border-color: var(--admin-border-strong); background: var(--admin-surface-raised); }
.empty-state { margin: 18px 0 0; padding: 18px; border: 1px dashed var(--admin-border-strong); border-radius: 6px; color: var(--admin-text-muted); text-align: center; }
.platform-task-selects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
#platform-task-fields { min-width: 0; padding: 0; margin: 0; border: 0; display: grid; gap: 16px; }
#platform-library-description { margin: 0; line-height: 1.7; overflow-wrap: anywhere; }
#platform-task { display: block; width: 100%; min-height: 180px; resize: vertical; padding: 12px; border: 1px solid var(--admin-border); border-radius: 5px; background: var(--admin-input); color: var(--admin-text); line-height: 1.7; }
.platform-task-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.platform-task-output { min-width: 0; }
#platform-task-result { min-height: 80px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
#platform-task-state, #platform-task-reference, #platform-catalog-state { overflow-wrap: anywhere; line-height: 1.7; }
#platform-task-state[data-state="completed"] { color: var(--admin-green); }
#platform-task-state[data-state="unknown"], #platform-task-state[data-state="blocked"], #platform-task-state[data-state="revoked"] { color: var(--admin-yellow); }
#platform-task-state[data-state="failed"], #platform-task-state[data-state="rejected"] { color: var(--admin-red); }
[data-page-section="platform_knowledge"] button { min-width: 44px; min-height: 44px; }
@media (max-width: 600px) { .platform-task-selects { grid-template-columns: minmax(0, 1fr); } }
.table-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.product-dialog { width: min(680px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--admin-border-strong); border-radius: 8px; background: var(--admin-surface); color: var(--admin-text); overflow-y: auto; }
.product-dialog::backdrop { background: rgba(0, 0, 0, .72); }
.product-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.product-form > * { min-width: 0; }
.product-form-wide { grid-column: 1 / -1; }
.product-form textarea { width: 100%; resize: vertical; min-height: 104px; padding: 10px; border: 1px solid var(--admin-border); border-radius: 5px; background: var(--admin-input); color: var(--admin-text); line-height: 1.7; }
.product-form .check-label { display: flex; align-items: center; gap: 9px; min-height: 40px; }
.product-form .pricing-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: 18px; border-top: 1px solid var(--admin-border); }
.product-dialog button { min-height: 44px; }
.product-error { color: var(--admin-red); margin: 0; line-height: 1.7; overflow-wrap: anywhere; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px; margin-top: 28px; }
.product-card { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 24px; border: 1px solid var(--admin-border-strong); border-radius: 8px; background: var(--admin-surface); overflow-wrap: anywhere; }
.product-card h2 { margin: 0; padding-right: 42px; font-size: 18px; line-height: 1.5; }
.product-card p { margin: 0; color: var(--admin-text-muted); line-height: 1.65; }
.product-card .product-price { font-size: 28px; line-height: 1.4; }
.product-card.is-recommended { border-color: var(--admin-green); }
.product-badge { position: absolute; top: 0; right: 16px; padding: 4px 9px; background: var(--admin-green); color: #03120a; font-size: 12px; font-weight: 700; }
.product-benefits { margin: 0 0 8px; padding-left: 20px; line-height: 1.9; color: var(--admin-text-muted); }
.badge-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.info-badge { display: inline-flex; align-items: center; max-width: 100%; padding: 4px 9px; border: 1px solid color-mix(in srgb, var(--admin-blue) 45%, var(--admin-border)); border-radius: 999px; background: color-mix(in srgb, var(--admin-blue) 9%, transparent); color: #c7ddff; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.membership-badges .info-badge { border-color: color-mix(in srgb, var(--admin-green) 40%, var(--admin-border)); background: color-mix(in srgb, var(--admin-green) 8%, transparent); color: #b8f5cb; }
.profile dd .badge-list { justify-content: flex-end; }
.promotion-commission-section { margin-top: 0; padding-top: 0; border-top: 0; }
#promotions-section > .overview-grid { margin-bottom: 18px; }
#wallet-section .profile, #membership-section .profile, #storage-section .profile { margin-bottom: 28px; }
#wallet-section > .table-wrap { margin-top: 24px; }
#storage-section > .table-wrap { margin-top: 24px; }
.membership-plans-table { margin-top: 24px; }
.membership-plans-table td { vertical-align: top; }
.membership-plans-table td:nth-child(6) { min-width: 230px; }
.membership-plans-table td:nth-child(9) .table-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.product-card > button { width: 100%; min-height: 44px; margin-top: auto; }
#point-package-total { color: var(--admin-green); padding: 12px 0; border-block: 1px solid var(--admin-border); line-height: 1.7; }
@media (max-width: 540px) {
    .product-form { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .product-dialog { padding: 20px; }
    .product-card { padding: 20px; }
}
.refund-records-heading { margin-top: 32px; }
#manual-refund-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--admin-border-strong); border-radius: 8px; background: var(--admin-surface); color: var(--admin-text); overflow-y: auto; }
#manual-refund-dialog::backdrop { background: rgba(0, 0, 0, .7); }
#manual-refund-dialog p { line-height: 1.7; overflow-wrap: anywhere; }
#manual-refund-error { color: var(--admin-red); }
#manual-refund-dialog button { min-height: 44px; }
#manual-refund-dialog .check-label { display: flex; align-items: center; gap: 8px; }
.commission-adjustment { display: block; margin-top: 6px; color: var(--admin-text-muted); font-size: 12px; }
.text-link { color: var(--admin-blue); font-size: 13px; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.compact { max-width: 380px; }
.compact button { justify-self: start; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; }
.inline-form label { flex: 1 1 170px; max-width: 270px; }
#storage-settings-form .check-label { display: flex; align-items: center; gap: 8px; min-height: 40px; }
#storage-settings-form .check-label input { width: 18px; margin: 0; flex: 0 0 18px; }
.team-block { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--admin-border); min-width: 0; }
.team-rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 28px; }
.team-rule-grid > div { min-width: 0; }
#team-commission-settings-fields { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; margin: 0; padding: 0; border: 0; min-width: 0; }
#team-commission-settings-fields label { flex: 1 1 170px; max-width: 270px; }
[id$="team-commission-rows"] details { min-width: 135px; }
[id$="team-commission-rows"] summary { cursor: pointer; }
[id$="team-commission-rows"] details p { font-size: 12px; }
#issued-code { display: block; margin-top: 14px; color: #7dd3fc; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.8; overflow-wrap: anywhere; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading h2, .section-heading h3 { margin: 0; }
.section-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-eyebrow { display: block; margin-bottom: 6px; color: var(--admin-blue); font: 10px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; }
.admin-section-note { margin: 6px 0 0; color: var(--admin-text-muted); font-size: 12px; line-height: 1.55; }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--admin-border); border-radius: 6px; background: var(--admin-surface); }
table { width: 100%; min-width: 720px; border-collapse: collapse; text-align: left; font-size: 13px; }
th { padding: 11px 12px; border-bottom: 1px solid var(--admin-border); background: rgba(255, 255, 255, .025); color: var(--admin-text-muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
th, td { max-width: 240px; overflow-wrap: anywhere; }
td { padding: 11px 12px; border-bottom: 1px solid var(--admin-border); color: #cbd5e1; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(148, 163, 184, .035); }
td button { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.pagination { display: flex; align-items: center; justify-content: end; gap: 12px; margin-top: 14px; color: var(--admin-text-muted); font-size: 12px; }
.invitation-actions { white-space: nowrap; }
.invitation-actions button { min-height: 44px; }
.invitation-actions button + button { margin-left: 8px; }
#withdrawal-settings-form { margin-bottom: 24px; }
#commission-rule-form, #commission-filter { margin-bottom: 20px; }
#commission-rule-form .check-label { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; min-height: 40px; }
#commission-rule-form .check-label input { width: 18px; margin: 0; }
[data-page-section="admin_commissions"] table { min-width: 1100px; }
#admin-commissions td:nth-child(5),
#admin-commissions td:nth-child(7),
#admin-commissions td:nth-child(8),
#commissions td:nth-child(3),
#commissions td:nth-child(5),
#commissions td:nth-child(6) { white-space: nowrap; font-variant-numeric: tabular-nums; }
[data-page-section="admin_withdrawals"] table { min-width: 1200px; }
#admin-withdrawals td:nth-child(3),
#admin-withdrawals td:nth-child(4),
#admin-withdrawals td:nth-child(5),
#admin-withdrawals td:nth-child(8),
#withdrawals td:nth-child(2),
#withdrawals td:nth-child(3),
#withdrawals td:nth-child(4) { white-space: nowrap; font-variant-numeric: tabular-nums; }
#issued-code, #admin-issued-code { display: block; overflow-wrap: anywhere; margin-top: 12px; }
#invitation-copy-fallback { margin-top: 16px; }
.quota-control { min-width: 165px; gap: 7px; }
#users-filter { margin-bottom: 16px; }
#users td:last-child { white-space: nowrap; }
#users td:last-child button { min-height: 44px; }
.quota-control .quota-unlimited { display: flex; align-items: center; gap: 6px; }
.pricing-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; gap: 13px; margin-bottom: 18px; padding: 18px; border: 1px solid var(--admin-border); border-radius: 7px; background: var(--admin-surface); }
.pricing-form .check-label { display: flex; align-items: center; gap: 8px; min-height: 40px; color: var(--admin-text); }
.pricing-form .check-label input { width: 18px; }
#redeem-card-form { margin-bottom: 24px; }
.pricing-accounting-note { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--admin-border); border-left: 3px solid var(--admin-accent, #78a9ff); background: var(--admin-surface); color: var(--admin-muted); font-size: 13px; line-height: 1.55; }
.pricing-accounting-note strong { color: var(--admin-text); }
.pricing-preview { grid-column: 1 / -1; min-height: 20px; margin: 0; padding: 10px 12px; border-radius: 5px; background: var(--admin-bg, #111); color: var(--admin-muted); font-size: 13px; line-height: 1.55; }
.pricing-preview:empty { display: none; }
.pricing-actions { display: flex; align-items: end; gap: 8px; }
.pricing-model-directory { display: grid; gap: 24px; margin: 20px 0 28px; }
.pricing-model-list { min-width: 0; }
.pricing-model-list .section-heading { align-items: end; margin-bottom: 10px; }
.pricing-model-list .section-heading h2 { margin-bottom: 0; }
.pricing-model-list .table-wrap { margin-top: 0; }
.pricing-model-list table { min-width: 560px; }
.pricing-detail-section,
.pricing-form-section {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--admin-border);
}
.pricing-detail-section .section-heading,
.pricing-form-section .section-heading { margin-bottom: 12px; }
.pricing-detail-section .table-wrap { margin-top: 0; }
.pricing-detail-section table { min-width: 1180px; }
.section-subtitle { margin: 30px 0 14px; }
#point-packages-section, #admin-orders-section, #admin-refunds-section { margin-top: 28px; }
[data-page-section="admin_refunds"] table { min-width: 1180px; }
#admin-refunds td:nth-child(4), #admin-refunds td:nth-child(5),
#admin-refunds td:nth-child(6), #admin-refunds td:nth-child(9) { white-space: nowrap; }
#admin-refunds td:nth-child(4) { min-width: 72px; font-variant-numeric: tabular-nums; }
#admin-refunds td:nth-child(2) { min-width: 200px; }
#admin-refunds td:nth-child(3), #admin-refunds td:nth-child(7) { min-width: 160px; }
#admin-refunds td:nth-child(9) button + button { margin-left: 8px; }
#reconciliation-section > .table-wrap { margin-top: 28px; }
#reservation-review { margin-top: 24px; padding: 18px; border: 1px solid var(--admin-border); border-radius: 7px; background: var(--admin-surface); }
#reservation-review > summary { cursor: pointer; color: var(--admin-text); font-weight: 700; }
.review-toolbar { display: grid; grid-template-columns: minmax(150px, auto) auto minmax(90px, 1fr) auto auto; align-items: end; gap: 12px; margin: 18px 0; }
.review-note-field { grid-column: 1 / -1; max-width: 620px; }
.review-note-field textarea { width: 100%; min-height: 70px; resize: vertical; }
.review-batch-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.review-table-wrap { margin-top: 8px; }
#review-reservations td:first-child, #review-reservations th:first-child { width: 42px; text-align: center; }
#review-reservations td:last-child { min-width: 170px; vertical-align: top; }
.review-row-actions { display: grid; gap: 7px; justify-items: start; }
.review-row-actions button { white-space: normal; text-align: left; }

@media (max-width: 900px) {
    .account-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-sidebar { border-right: 0; border-bottom: 1px solid var(--admin-border); padding: 12px; }
    .admin-sidebar-footer { display: none; }
    .admin-sidebar nav { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 2px; }
    .admin-nav-group { display: flex; flex: 0 0 auto; gap: 4px; }
    .review-toolbar { grid-template-columns: 1fr; align-items: stretch; }
    .review-note-field { max-width: none; }
    .admin-nav-label { display: none; }
    .admin-sidebar a { min-height: 36px; padding: 7px 10px; white-space: nowrap; }
    .admin-workspace { padding: 22px 18px 48px; }
}

@media (max-width: 600px) {
    .admin-topbar { padding: 10px 14px; gap: 9px; }
    .brand { min-width: 108px; font-size: 24px; }
    .brand img { width: 34px; height: 34px; }
    .admin-system-status { display: none; }
    .admin-page-title { font-size: 12px; }
    .admin-topbar-actions { width: 100%; flex-wrap: wrap; gap: 7px; }
    .admin-account { flex: 1; }
    #admin-account-name { max-width: 80px; }
    #admin-account-credits, .account-summary-divider, #account-header-membership { display: none; }
    .admin-account { padding-left: 0; border-left: 0; }
    .admin-account-copy { display: none; }
    #session-controls { justify-content: flex-end; gap: 7px; }
    #session-controls button, #session-controls a { padding-inline: 8px; }
    .admin-workspace { padding: 20px 14px 44px; }
    #credentials { margin-top: 20px; padding: 20px; }
    .profile { gap: 15px 24px; }
    .overview-grid { grid-template-columns: minmax(0, 1fr); }
    .page-heading { align-items: flex-start; }
    .section-heading { flex-direction: column; }
    .inline-form label { max-width: none; }
    .pricing-form { grid-template-columns: 1fr; padding: 15px; }
    th, td { min-width: 90px; padding: 9px 8px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
 .storage-policy-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 20px;
    border: 0;
    padding: 0;
    margin: 0 0 24px;
    min-width: 0;
 }
 .storage-policy-fields label {
    flex: 1 1 220px;
    min-width: 0;
    max-width: 360px;
 }

.membership-model-field { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.membership-model-picker { border: 1px solid var(--admin-border-strong); border-radius: 6px; background: var(--admin-surface); }
.membership-model-picker summary { cursor: pointer; padding: 11px 12px; min-height: 22px; overflow-wrap: anywhere; }
.membership-model-picker summary:focus-visible { outline: 2px solid var(--admin-text); outline-offset: 2px; }
.membership-model-options { max-height: 240px; overflow-y: auto; border-top: 1px solid var(--admin-border); padding: 6px; }
.membership-model-options label { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 10px 6px; margin: 0; cursor: pointer; overflow-wrap: anywhere; }
.membership-model-options input[type="checkbox"] { flex: 0 0 16px; width: 16px; height: 16px; min-height: 0; margin: 0; }
.membership-model-group { border: 0; border-bottom: 1px solid var(--admin-border); margin: 0; padding: 4px 0; min-width: 0; }
.membership-model-group:last-child { border-bottom: 0; }
.membership-model-group legend { padding: 6px; font-size: 12px; font-weight: 600; color: var(--admin-text-muted); overflow-wrap: anywhere; }
.membership-model-options label { min-height: 44px; }
.membership-model-options label:hover { background: var(--admin-surface-raised); }
.membership-model-options label:focus-within { outline: 2px solid var(--admin-blue); outline-offset: -2px; }
.membership-knowledge-options { border: 1px solid var(--admin-border); border-radius: 4px; min-height: 44px; }
.membership-model-field p { margin: 0; font-size: 12px; }
.membership-model-field p:empty { display: none; }

.users-table { min-width: 780px; width: 100%; }
.users-table td { vertical-align: middle; }
.users-table td:nth-child(2) { max-width: 230px; overflow-wrap: anywhere; font-family: monospace; }
.users-table td:nth-child(5) { font-variant-numeric: tabular-nums; }
.user-actions { min-width: 170px; }
.user-actions button { min-height: 40px; min-width: 60px; margin-right: 8px; }
.user-actions span { display: inline-block; color: var(--admin-text-muted); font-size: 12px; }
.user-status { display: inline-block; padding: 3px 9px; border-radius: 4px; font-size: 12px; }
.user-status.active { color: var(--admin-green); background: color-mix(in srgb, var(--admin-green) 10%, transparent); }
.user-status.inactive, .user-disable { color: var(--admin-red); }
.user-enable { color: var(--admin-green); }
.user-edit-dialog { width: min(920px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); box-sizing: border-box; padding: 24px; border: 1px solid var(--admin-border-strong); border-radius: 8px; background: var(--admin-surface); color: var(--admin-text); overflow-y: auto; }
.user-edit-dialog::backdrop { background: rgb(0 0 0 / 70%); }
.user-edit-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.user-edit-header h2 { margin: 0 0 8px; font-size: 20px; overflow-wrap: anywhere; }
.user-edit-header p { margin: 0; overflow-wrap: anywhere; font-family: monospace; font-size: 12px; }
.user-edit-header button { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; font-size: 24px; }
.user-edit-balances { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 24px; padding: 20px 0; margin: 0; border-bottom: 1px solid var(--admin-border); }
.user-edit-balances dt { color: var(--admin-text-muted); font-size: 13px; margin-bottom: 6px; }
.user-edit-balances dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.user-adjustment { padding: 20px 0; margin: 0; border-bottom: 1px solid var(--admin-border); }
.user-adjustment h3, .user-adjustment-history h3 { font-size: 16px; margin: 0 0 16px; }
.user-adjustment fieldset { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; min-width: 0; border: 0; padding: 0; margin: 0; }
.user-adjustment label { flex: 1 1 145px; min-width: 0; margin: 0; }
.user-adjustment label:has([name="reason"]) { flex: 2 1 190px; }
.user-adjustment input, .user-adjustment select { width: 100%; min-width: 0; min-height: 44px; box-sizing: border-box; }
.user-adjustment button { min-height: 44px; }
.user-adjustment .muted { font-size: 12px; margin-bottom: 0; }
.adjustment-result { margin: 8px 0 0; font-size: 13px; }
.adjustment-result:empty { display: none; }
.user-edit-dialog .error { color: var(--admin-red); }
.user-edit-dialog .success { color: var(--admin-green); }
.user-edit-dialog details { padding: 20px 0; border-bottom: 1px solid var(--admin-border); }
.user-edit-dialog summary { cursor: pointer; min-height: 32px; }
.user-adjustment-history { padding-top: 20px; }
.user-adjustment-history table { min-width: 640px; }
.user-adjustment-history td { overflow-wrap: anywhere; max-width: 220px; }
@media (max-width: 600px) {
    .user-edit-dialog { width: calc(100% - 16px); padding: 16px; max-height: calc(100dvh - 16px); }
    .user-edit-balances { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .user-adjustment label { flex-basis: calc(50% - 12px); }
    .user-adjustment label:has([name="reason"]) { flex-basis: 100%; }
    .user-adjustment button { width: 100%; }
}
/* Skill catalog shares the console's table and form controls. */
.skill-catalog-table { min-width: 740px; width: 100%; }
.skill-catalog-table td:first-child { white-space: nowrap; width: 126px; }
.skill-catalog-table td:first-child button { width: 32px; height: 32px; padding: 0; margin-right: 3px; }
.skill-catalog-table [draggable="true"] { cursor: grab; }
.skill-catalog-table td:nth-child(2) { overflow-wrap: anywhere; max-width: 220px; }
.skill-catalog-table td:nth-child(4) { width: 45%; min-width: 200px; }
.skill-catalog-table textarea { width: 100%; min-height: 62px; resize: vertical; box-sizing: border-box; padding: 8px; border: 1px solid var(--admin-border-strong); border-radius: 4px; background: var(--admin-surface); color: var(--admin-text); font: inherit; line-height: 1.5; }
.skill-catalog-table td:last-child { white-space: nowrap; }
.skill-catalog-table td:last-child label { display: flex; align-items: center; gap: 8px; }
.skill-catalog-table input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }
.lifecycle-band { border-top: 1px solid var(--admin-border); margin-top: 28px; padding-top: 22px; min-width: 0; }
.storage-metrics, .storage-categories { display: grid; gap: 12px; margin: 20px 0; padding: 0; }
.storage-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.storage-categories { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.storage-metrics > div, .storage-categories > div { min-width: 0; padding: 16px; border: 1px solid var(--admin-border); border-radius: 8px; background: var(--admin-surface); }
.storage-metrics dt, .storage-categories dt { display: flex; align-items: center; gap: 8px; color: var(--admin-text-muted); font-size: 13px; line-height: 1.6; }
.storage-metrics dt i, .storage-categories dt i { width: 16px; flex: 0 0 16px; text-align: center; }
.storage-metrics dd, .storage-categories dd { margin: 12px 0 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; color: var(--admin-text); line-height: 1.5; }
.storage-metrics dd { font-size: 20px; font-weight: 600; }
.storage-categories dd { font-size: 16px; font-weight: 600; }
.storage-categories dd span { display: block; margin-top: 4px; color: var(--admin-text-muted); font-size: 12px; font-weight: 400; }
@media (max-width: 1100px) { .storage-categories { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) {
    .storage-metrics, .storage-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .storage-metrics > div, .storage-categories > div { padding: 12px; }
    .storage-metrics dd { font-size: 18px; }
    .storage-categories > div:last-child { grid-column: 1 / -1; }
}
.lifecycle-band h2 { font-size: 17px; margin: 0 0 18px; }
.lifecycle-table td { max-width: 320px; overflow-wrap: anywhere; vertical-align: top; }
.lifecycle-table td:last-child { min-width: 110px; }
.lifecycle-table td button, .lifecycle-table td a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-right: 8px; padding: 0; }
.notification-list article { border-top: 1px solid var(--admin-border); padding: 22px 0; min-width: 0; }
.notification-list h2 { font-size: 17px; margin: 0 0 8px; overflow-wrap: anywhere; }
.notification-list p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.notification-list time { color: var(--admin-text-muted); font-size: 12px; }
.notification-list .is-unread h2 { color: var(--admin-green); }
.announcement-form { display: grid; gap: 16px; max-width: 720px; }
.announcement-form label { display: grid; gap: 8px; min-width: 0; }
.announcement-form textarea { font: inherit; resize: vertical; padding: 12px; color: var(--admin-text); background: var(--admin-surface); border: 1px solid var(--admin-border-strong); border-radius: 4px; width: 100%; box-sizing: border-box; }
.announcement-form button { justify-self: start; }
#notification-badge:not(:empty) { margin-left: auto; color: var(--admin-green); font-variant-numeric: tabular-nums; }
#storage-categories td:nth-child(4) { min-width: 210px; max-width: 380px; white-space: normal; }
@media (max-width: 600px) {
    #storage-section .storage-category-table, #storage-section .storage-media-table { min-width: 0; width: 100%; }
    #storage-section .storage-category-table thead, #storage-section .storage-media-table thead { display: none; }
    #storage-section .storage-category-table tbody, #storage-section .storage-media-table tbody { display: block; }
    #storage-section .storage-category-table tr, #storage-section .storage-media-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 12px; border-bottom: 1px solid var(--admin-border); }
    #storage-section .storage-category-table td, #storage-section .storage-media-table td { min-width: 0; max-width: none; border: 0; padding: 5px 0; white-space: normal; overflow-wrap: anywhere; }
    .storage-category-table td:first-child { grid-column: 1 / -1; font-weight: 600; }
    .storage-category-table td:nth-child(2)::before { content: '空间：'; color: var(--admin-text-muted); }
    .storage-category-table td:nth-child(3)::after { content: ' 个文件'; color: var(--admin-text-muted); }
    .storage-category-table td:nth-child(4), .storage-category-table td:nth-child(5) { grid-column: 1 / -1; }
    .storage-media-table td:first-child { grid-column: 1 / -1; }
    .storage-media-table td:last-child { text-align: right; }
}
