:root {
  --bg: #0b0f14;
  --panel: #151b23;
  --panel-2: #1b232e;
  --field: #111820;
  --border: #2a3543;
  --text: #e8edf4;
  --muted: #94a0ad;
  --accent: #4c8dff;
  --accent-strong: #2f6fe8;
  --green: #35b978;
  --amber: #d7a33f;
  --red: #f05b63;
  --radius: 7px;
  --shadow: 0 18px 48px rgba(0,0,0,.24);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 1px, transparent 1px 96px), var(--bg); font: 14px/1.55 "Segoe UI", "Microsoft YaHei", sans-serif; }
a { color: var(--accent); text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, .button { min-height: 36px; border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 13px; color: var(--text); background: var(--panel-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button:hover, .button:hover { border-color: var(--accent); }
button:disabled { opacity: .48; cursor: not-allowed; }
.primary { color: #fff; border-color: var(--accent); background: var(--accent); font-weight: 650; }
.primary:hover { background: var(--accent-strong); }
.danger { color: #fff; border-color: var(--red); background: #a6363c; }
.quiet { min-height: 32px; padding: 5px 9px; background: transparent; }
.topbar { min-height: 64px; display: flex; align-items: center; gap: 24px; padding: 12px 28px; position: sticky; top: 0; z-index: 20; background: rgba(16,21,29,.95); border-bottom: 1px solid var(--border); backdrop-filter: blur(14px); }
.brand { color: var(--text); display: flex; align-items: center; gap: 10px; font-size: 17px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px rgba(76,141,255,.8); }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { color: var(--muted); padding: 7px 10px; border-radius: 5px; }
.nav a:hover { color: var(--text); background: var(--panel-2); }
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); }
.account form { margin: 0; }
.page { width: min(100%, 1680px); margin: 0 auto; padding: 24px 28px 64px; }
.panel { background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 140px), var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.panel-title { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.panel-title h1, .panel-title h2 { margin: 0; font-size: 16px; }
.summary-band { display: flex; align-items: center; gap: 1px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.summary-band > div { min-width: 160px; padding: 11px 18px; display: flex; align-items: baseline; justify-content: space-between; gap: 18px; border-right: 1px solid var(--border); }
.summary-band span, .balance-pair span { color: var(--muted); font-size: 12px; }
.summary-band strong { font-size: 20px; }
.summary-band .button { margin-left: auto; margin-right: 8px; }
.workspace { display: grid; grid-template-columns: minmax(360px, 460px) minmax(0,1fr); gap: 22px; align-items: start; }
.stack { display: grid; gap: 13px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
input, textarea, select { width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); background: var(--field); padding: 10px 12px; outline: none; }
textarea { resize: vertical; min-height: 128px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(76,141,255,.14); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--field); }
.segment { border: 0; color: var(--muted); background: transparent; }
.segment.active { color: #fff; background: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.quote { padding: 3px 9px; border-radius: 999px; color: var(--amber); background: rgba(215,163,63,.14); font-size: 12px; font-weight: 700; }
.submit-task { width: 100%; }
.form-message { min-height: 20px; color: var(--muted); font-size: 12px; }
.form-message.error { color: var(--red); }
.form-message.success { color: var(--green); }
.hidden { display: none !important; }
.reference-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.reference-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(78px,1fr)); gap: 8px; margin-top: 8px; }
.reference-tile, .add-reference { aspect-ratio: 1; position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--field); }
.reference-tile img { width: 100%; height: 100%; object-fit: cover; }
.reference-tile button { min-height: 22px; width: 22px; padding: 0; position: absolute; right: 4px; top: 4px; color: #fff; border: 0; border-radius: 50%; background: rgba(0,0,0,.65); }
.add-reference { color: var(--muted); display: grid; place-items: center; align-content: center; gap: 2px; border-style: dashed; }
.add-reference span { color: var(--accent); font-size: 22px; }
.task-toolbar { align-items: flex-start; }
.toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.toolbar-actions select { width: 132px; min-height: 36px; padding: 7px 10px; }
.inline-check { display: flex; grid-auto-flow: column; align-items: center; gap: 6px; white-space: nowrap; }
.inline-check input { width: auto; accent-color: var(--accent); }
.selection-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--field); }
.task-list { display: grid; gap: 9px; max-height: 72vh; overflow: auto; }
.task-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); cursor: pointer; }
.task-row.selecting { grid-template-columns: 22px auto minmax(0,1fr) auto; }
.task-row.selected { border-color: var(--accent); background: rgba(76,141,255,.10); }
.task-row:hover { border-color: rgba(76,141,255,.65); }
.task-check { width: 18px; height: 18px; accent-color: var(--accent); }
.badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge.queued { color: var(--muted); background: rgba(148,160,173,.12); }
.badge.pending, .badge.running { color: #8ab5ff; background: rgba(76,141,255,.15); }
.badge.succeeded { color: var(--green); background: rgba(53,185,120,.14); }
.badge.paid { color: var(--green); background: rgba(53,185,120,.14); }
.badge.failed, .badge.canceled { color: var(--red); background: rgba(240,91,99,.13); }
.task-meta { min-width: 0; }
.task-id { font: 12px ui-monospace,Consolas,monospace; overflow: hidden; text-overflow: ellipsis; }
.task-sub { color: var(--muted); font-size: 12px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-result { display: flex; align-items: center; gap: 8px; }
.task-result img { width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 5px; object-fit: cover; background: var(--field); }
.empty { padding: 40px 16px; color: var(--muted); text-align: center; }
.dialog { width: min(760px,calc(100vw - 28px)); max-height: 86vh; overflow: auto; padding: 18px; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(0,0,0,.68); }
.small-dialog { width: min(440px,calc(100vw - 28px)); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dialog-head h2 { margin: 0; font-size: 17px; }
.icon-button { width: 34px; padding: 0; font-size: 20px; }
.detail-grid { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin-bottom: 16px; }
.detail-grid .key { color: var(--muted); }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 12px; }
.result-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--field); }
.result-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.result-card .button { width: calc(100% - 16px); margin: 8px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-heading h1 { margin: 0 0 4px; font-size: 22px; }
.page-heading p { margin: 0; color: var(--muted); }
.balance-pair { display: flex; gap: 8px; }
.balance-pair > div { min-width: 120px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); display: flex; justify-content: space-between; align-items: baseline; }
.balance-pair strong { font-size: 19px; }
.table-panel { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 11px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; font-weight: 600; }
.number { font-family: ui-monospace,Consolas,monospace; text-align: right; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.ledger-type { padding: 2px 7px; border-radius: 999px; background: var(--field); font-size: 11px; }
.spaced-panel { margin-top: 18px; }
.mono { font-family: ui-monospace,Consolas,monospace; }
.package-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 12px; }
.package { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); }
.package > strong { font-size: 15px; }
.package > span { color: var(--muted); }
.package-points { color: var(--green); font: 700 24px ui-monospace,Consolas,monospace; }
.wechat-payment { display: grid; justify-items: center; gap: 12px; text-align: center; }
.wechat-payment img { width: 250px; height: 250px; max-width: 100%; object-fit: contain; border: 8px solid #fff; border-radius: var(--radius); background: #fff; }
.wechat-payment strong { font-size: 20px; }
.wechat-payment p { margin: 0; color: var(--muted); }
.admin-grid { display: grid; gap: 18px; }
.table-scroll { overflow-x: auto; }
.admin-user { min-width: 220px; }
.admin-user strong, .admin-user span { display: block; }
.admin-user span { color: var(--muted); font-size: 12px; }
.price-input { width: 90px; }
.target-user { padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--field); }
.auth-page { min-height: calc(100vh - 64px); display: grid; place-items: center; }
.auth-panel { width: min(420px,100%); padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.auth-panel h1 { margin: 0 0 5px; }
.auth-panel > p { color: var(--muted); }
.auth-switch { text-align: center; margin: 16px 0 0; }
.install-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px 14px; }
.install-panel { width: min(720px,100%); padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.install-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.install-heading .brand-dot { flex: 0 0 auto; margin-top: 7px; }
.install-heading h1 { margin: 0 0 4px; font-size: 22px; }
.install-heading p, .install-note { margin: 0; color: var(--muted); }
.install-section { display: grid; gap: 12px; margin: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.install-section legend { padding: 0 6px; color: var(--text); font-weight: 700; }
.install-submit { width: 100%; }
.install-note { font-size: 12px; }
.alert { padding: 9px 11px; margin: 12px 0; border: 1px solid var(--border); border-radius: var(--radius); }
.alert.error { color: #ff9ba0; border-color: rgba(240,91,99,.45); background: rgba(240,91,99,.08); }
.error-code { color: var(--red); font: 700 42px ui-monospace,monospace; }
.toast { position: fixed; right: 18px; bottom: 18px; width: min(360px,calc(100vw - 36px)); padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .18s; }
.toast.show { opacity: 1; transform: none; }
.toast.error { border-color: var(--red); }
@media (max-width: 1000px) { .workspace { grid-template-columns: 1fr; } .task-list { max-height: none; } }
@media (max-width: 720px) { .topbar { padding: 10px 14px; flex-wrap: wrap; gap: 8px 14px; } .nav { order: 3; width: 100%; overflow-x: auto; } .account { margin-left: auto; } .page { padding: 16px 14px 48px; } .summary-band { align-items: stretch; flex-wrap: wrap; } .summary-band > div { flex: 1; min-width: 140px; } .summary-band .button { width: 100%; margin: 6px; } .form-grid { grid-template-columns: 1fr; } .task-toolbar { display: block; } .toolbar-actions { justify-content: flex-start; margin-top: 10px; } .task-row, .task-row.selecting { grid-template-columns: auto minmax(0,1fr); } .task-result { grid-column: 2; justify-content: flex-end; } .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; } .balance-pair { width: 100%; } .balance-pair > div { flex: 1; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
