/* MUSE 注册中心 · 浅色工作台。所有资源本地加载。 */
:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --panel: #fff;
  --panel-2: #f7f8f5;
  --line: #e3e7df;
  --line-2: #d1d9d0;
  --text: #26332d;
  --text-2: #5d6b62;
  --text-3: #748076;
  --green: #2b6653;
  --green-ink: #245842;
  --green-soft: #edf5ee;
  --blue: #2b6653;
  --blue-ink: #2b6653;
  --blue-soft: #edf5ee;
  --amber: #916b2f;
  --amber-ink: #825e25;
  --amber-soft: #fbf5e9;
  --red: #b5483f;
  --red-ink: #a33c35;
  --red-soft: #fdf0ed;
  --violet-ink: #53685d;
  --violet-soft: #f1f5ef;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 6px 24px rgb(39 54 43 / 4%);
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { background: #dce9da; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 8px; background: #bfc9be; background-clip: content-box; }
a { color: var(--green); text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; color: inherit; background: none; }
button, input, textarea, summary, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
input:disabled, button:disabled { cursor: not-allowed; }
h1, h2, h3 { line-height: 1.4; font-weight: 650; letter-spacing: -.025em; }
.hide { display: none !important; }
.muted, .mini { color: var(--text-3); }
.mini { font-size: 12px; }
.mono, code { font-family: var(--mono); }
.ic { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; }

/* 品牌与通用控件 */
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 14px; background: var(--green); color: #fff; font-size: 24px; font-weight: 750; }
.brand-mark.sm { width: 38px; height: 38px; border-radius: 11px; font-size: 19px; }
.brand-name { font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.brand-text h1 { font-size: 16px; }
.brand-text p { margin-top: 2px; color: var(--text-3); font-size: 12px; }
.eyebrow, .section-kicker { display: block; color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: .13em; }
.eyebrow { letter-spacing: .17em; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 17px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.45; text-align: center; text-decoration: none; transition: background .15s, border-color .15s, opacity .15s; }
.btn:hover { border-color: #aabaaa; background: #f5f8f3; }
.btn:active { background: #eef3ec; }
.btn:disabled { opacity: .48; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: #225340; border-color: #225340; }
.btn-primary:active { background: #1c4736; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { border-color: var(--line); background: #f1f4ee; color: var(--text); }
.btn-danger { color: var(--red-ink); background: #fff; border-color: #ebcec7; }
.btn-danger:hover { color: var(--red-ink); background: var(--red-soft); border-color: #d9aaa1; }
.btn-xs { padding: 9px 12px; font-size: 12px; border-radius: 9px; gap: 6px; }
.btn-lg { min-height: 52px; padding: 13px 21px; font-size: 14px; }
.btn-block { width: 100%; }
.ghost-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; color: var(--text-2); font-size: 13px; }
.ghost-link:hover { color: var(--green); }
.field { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.field-label { color: #47574c; font-size: 12px; font-weight: 650; }
.input, .textarea, .select { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; outline: 0; background: #fff; color: var(--text); font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.input::placeholder, .textarea::placeholder { color: #99a397; opacity: 1; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(43 102 83 / 11%); }
.input:disabled { background: #f1f3ef; color: var(--text-3); }
.textarea { min-height: 120px; resize: vertical; font: 12px/1.8 var(--mono); }
.textarea-lg { min-height: 190px; }
.input-code { min-height: 54px; padding-left: 44px; font: 600 14px/1.6 var(--mono); letter-spacing: .055em; text-transform: uppercase; }
.code-input-wrap { position: relative; }
.code-input-wrap > .ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.input-otp { min-height: 58px; padding: 12px 12px 12px 22px; font: 600 24px/1.3 var(--mono); letter-spacing: .32em; text-align: center; text-transform: uppercase; }
.hint, .card-description { color: var(--text-3); font-size: 12px; line-height: 1.8; }
.card-description { margin-top: 8px; color: var(--text-2); font-size: 13px; }
.notice { padding: 12px 14px; border: 1px solid #e7d8b8; border-radius: 10px; background: var(--amber-soft); color: var(--amber-ink); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.notice:empty { display: none; }
.helper-box { display: flex; align-items: flex-start; gap: 12px; padding: 17px 18px; border-radius: 11px; background: var(--panel-2); color: var(--text-2); font-size: 12px; line-height: 1.8; }
.helper-box .ic { margin-top: 2px; color: var(--green); }

/* 首页 */
.page-landing { display: flex; flex-direction: column; min-height: 100vh; }
.public-topbar, .public-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: calc(100% - 80px); max-width: 1160px; margin: 0 auto; }
.public-topbar { min-height: 104px; }
.landing { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .85fr); grid-template-areas: "intro entry" "guide entry"; align-items: center; column-gap: 100px; row-gap: 0; width: calc(100% - 80px); max-width: 1080px; margin: auto; padding: 52px 0 72px; flex: 1; }
.landing-copy { grid-area: intro; align-self: end; }
.landing-guide { grid-area: guide; align-self: start; }
.landing-copy h1 { margin: 20px 0 22px; font-size: clamp(38px, 4.1vw, 54px); line-height: 1.28; letter-spacing: -.055em; }
.lead { max-width: 450px; color: var(--text-2); font-size: 15px; line-height: 1.95; }
.landing-steps { display: flex; flex-direction: column; gap: 23px; margin: 36px 0 32px; list-style: none; }
.landing-steps li { display: flex; align-items: flex-start; gap: 17px; }
.step-index { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border: 1px solid #d7dfd2; border-radius: 10px; color: var(--green); background: #f0f3eb; font: 600 12px var(--mono); }
.landing-steps b { font-size: 14px; font-weight: 650; }
.landing-steps p { margin-top: 3px; color: var(--text-3); font-size: 12px; }
.landing-assurance { display: flex; align-items: flex-start; gap: 12px; padding-top: 23px; border-top: 1px solid var(--line); }
.landing-assurance > .ic { margin-top: 2px; color: var(--green); }
.landing-assurance b { font-size: 13px; font-weight: 600; }
.landing-assurance p { margin-top: 3px; color: var(--text-3); font-size: 12px; }
.entry-pane { grid-area: entry; width: 100%; max-width: 420px; justify-self: end; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.redeem-card { display: flex; flex-direction: column; gap: 20px; padding: 34px 32px 28px; box-shadow: 0 12px 38px rgb(42 58 46 / 6%); }
.redeem-card h2 { margin-top: -8px; font-size: 26px; }
.redeem-card > .card-description { margin-top: -15px; margin-bottom: 6px; }
.redeem-card .hint { font-size: 11px; }
.entry-divider { height: 1px; margin-top: 4px; background: var(--line); }
.entry-note { display: flex; align-items: flex-start; gap: 11px; font-size: 12px; color: var(--text-3); }
.entry-note .ic { margin-top: 2px; width: 17px; height: 17px; color: var(--green); }
.entry-note b { display: block; margin-bottom: 3px; color: var(--text-2); font-weight: 600; }
.entry-note span { display: block; }
.entry-help { margin-top: 20px; color: var(--text-3); font-size: 12px; text-align: center; }
.public-footer { min-height: 76px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 11px; }

/* 工作台布局 */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 82px; padding: 15px max(24px, calc((100vw - 1132px) / 2)); border-bottom: 1px solid var(--line); background: #fff; }
.top-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 33px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--text-2); background: var(--panel-2); font-size: 12px; }
.chip b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.chip-key { background: #fff; }
.chip-key b { color: var(--text-2); font-family: var(--mono); font-size: 11px; }
.workspace-intro { max-width: 1180px; margin: 0 auto; padding: 37px 24px 23px; }
.workspace-intro h2 { margin-top: 7px; font-size: 26px; }
.workspace-intro > p:last-child { margin-top: 8px; color: var(--text-3); font-size: 13px; }
.shell { display: grid; grid-template-columns: minmax(0, 1fr) 286px; align-items: start; gap: 24px; max-width: 1180px; margin: 0 auto; padding: 0 24px 48px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 21px 26px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 16px; }
.panel-sub { margin-top: 5px; color: var(--text-3); font-size: 12px; }
.panel-body { display: flex; flex-direction: column; gap: 22px; padding: 28px; }
.panel-main { min-height: 510px; }
.start-view { display: flex; flex-direction: column; gap: 23px; padding: 6px 0 3px; }
.start-view h3 { margin-top: 9px; font-size: 23px; }
.start-actions { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.start-actions > .btn-primary { min-width: 220px; }
.start-actions > .hint { width: 100%; }
.start-actions > #recent-result-btn { padding-left: 0; }
.side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.side-card { padding: 23px; }
.side-title { display: flex; align-items: center; gap: 9px; margin-bottom: 17px; font-size: 13px; font-weight: 650; color: var(--text-2); }
.side-title .ic { color: var(--green); }
.quota { display: flex; flex-direction: column; gap: 6px; }
.quota-number-row { display: flex; align-items: baseline; gap: 9px; }
.quota-number-row > span { color: var(--text-3); font-size: 12px; }
.quota-num { color: var(--green); font-size: 39px; font-weight: 650; letter-spacing: -.06em; line-height: 1.3; font-variant-numeric: tabular-nums; }
.quota-label, .quota-sub { font-size: 12px; color: var(--text-3); }
.quota-bar { height: 5px; margin: 12px 0 5px; border-radius: 8px; background: #edf0e9; overflow: hidden; }
.quota-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: #92ae98; transition: width .25s; }
.quota-sub b { color: var(--text-2); font-weight: 600; }
.quota-message { margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 12px; line-height: 1.8; }
.mini-flow { display: flex; flex-direction: column; gap: 19px; list-style: none; counter-reset: mini; }
.mini-flow li { position: relative; padding-left: 30px; counter-increment: mini; }
.mini-flow li::before { content: counter(mini); position: absolute; left: 0; top: 1px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 7px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 650; }
.mini-flow b { display: block; font-size: 12px; font-weight: 600; }
.mini-flow span { display: block; margin-top: 3px; color: var(--text-3); font-size: 11px; }
.tip { display: flex; align-items: flex-start; gap: 8px; margin-top: 21px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 11px; line-height: 1.85; }
.tip .ic { width: 15px; height: 15px; margin-top: 3px; color: var(--green); }

/* 状态与任务进度 */
.badge, .pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 7px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge { min-height: 30px; padding: 4px 10px; }
.pill { min-height: 25px; padding: 3px 8px; }
.badge::before, .pill::before { content: ""; width: 5px; height: 5px; flex: none; border-radius: 50%; background: currentColor; }
.badge-idle, .pill-off { color: var(--text-3); background: #f1f3ef; }
.badge-running, .pill-run, .badge-done, .pill-ok { color: var(--green-ink); background: var(--green-soft); border-color: #d9e7d9; }
.badge-waiting, .pill-wait, .badge-queued, .pill-queue { color: var(--amber-ink); background: var(--amber-soft); border-color: #eee0bf; }
.badge-failed, .pill-fail { color: var(--red-ink); background: var(--red-soft); border-color: #efd8d1; }
/* 成功终态直接交付结果，减少重复介绍和摘要。 */
.has-result .workspace-intro, .has-result .current-stage, .has-result .run-head { display: none; }
.has-result .shell { padding-top: 28px; }
.run-view { display: flex; flex-direction: column; gap: 24px; }
.run-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.run-head > .btn { flex: none; }
.run-email { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 11px; }
.run-email b { font-family: var(--mono); font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.stage-title-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.stage-title-row > .section-kicker { flex: none; }
.current-stage h3 { min-width: 0; margin-top: 8px; font-size: 23px; overflow-wrap: anywhere; }
.current-stage > p { min-height: 22px; margin-top: 7px; color: var(--text-2); font-size: 12px; overflow-wrap: anywhere; }
.progress-caption { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; margin-bottom: 8px; color: var(--text-3); font-size: 11px; }
.progress-caption > span:first-child { color: var(--text-2); }
.task-progress { height: 5px; border-radius: 6px; background: #edf0e9; overflow: hidden; }
.task-progress i { display: block; width: 0; height: 100%; background: var(--green); border-radius: inherit; transition: width .2s; }
.queue-pill { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; color: var(--amber-ink); font-size: 11px; overflow-wrap: anywhere; }
.queue-pill .dot { width: 5px; height: 5px; flex: none; border-radius: 50%; background: currentColor; }
#queue-summary { overflow-wrap: anywhere; }
.progress-details { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
summary { display: flex; align-items: center; gap: 9px; min-height: 54px; padding: 14px 17px; cursor: pointer; list-style: none; color: var(--text-2); font-size: 12px; font-weight: 600; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; margin-left: 4px; color: var(--text-3); font-size: 18px; line-height: 1; font-weight: 400; }
summary > span:first-child { display: flex; align-items: center; gap: 9px; }
summary .ic { width: 16px; height: 16px; }
.details-note { margin-left: auto; color: var(--text-3); font-size: 11px; font-weight: 400; }
details[open] > summary::after { content: "−"; }
details[open] > summary { border-bottom: 1px solid var(--line); }
.steps { padding: 14px 20px 18px; list-style: none; counter-reset: steps; }
.steps li { position: relative; display: grid; grid-template-columns: 25px minmax(0, 1fr); gap: 13px; padding: 9px 0; counter-increment: steps; }
.steps li::before { content: counter(steps); display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--line-2); border-radius: 50%; background: #fff; color: var(--text-3); font-size: 11px; font-weight: 600; z-index: 1; }
.steps li::after { content: ""; position: absolute; left: 12px; top: 34px; bottom: -9px; width: 1px; background: var(--line); }
.steps li:last-child::after { display: none; }
.st-title { min-width: 0; color: var(--text-2); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.st-detail { margin-top: 3px; color: var(--text-3); font-size: 11px; overflow-wrap: anywhere; }
.steps li[data-state="active"]::before { background: var(--green); border-color: var(--green); color: #fff; }
.steps li[data-state="active"] .st-title { color: var(--green-ink); }
.steps li[data-state="done"]::before { content: "✓"; color: var(--green); background: var(--green-soft); border-color: #d7e5d4; }
.steps li[data-state="skip"]::before { content: "−"; background: #f4f5f1; color: var(--text-3); }
.steps li[data-state="failed"]::before { content: "!"; color: var(--red-ink); background: var(--red-soft); border-color: #e9cfc8; }
.steps li[data-state="failed"] .st-title, .steps li[data-state="failed"] .st-detail { color: var(--red-ink); }
.side-log summary { padding: 17px 20px; }
.log-list { display: flex; flex-direction: column; gap: 9px; max-height: 260px; padding: 16px 20px 20px; overflow: auto; }
.log-row { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 9px; color: var(--text-2); font-size: 11px; line-height: 1.75; }
.log-row time { color: var(--text-3); font-family: var(--mono); font-size: 10px; }
.log-row span { overflow-wrap: anywhere; }
.log-row.ok span { color: var(--green-ink); }
.log-row.warn span { color: var(--amber-ink); }
.log-row.error span { color: var(--red-ink); }
.empty-line { padding: 4px 0; color: var(--text-3); font-size: 12px; }

/* 需要用户操作的验证码，以及最终结果 */
.code-box { display: flex; flex-direction: column; gap: 17px; padding: 23px; border: 1px solid #ccdcca; border-radius: 14px; background: #f5f9f2; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.code-head h3 { margin-top: 5px; font-size: 20px; }
.code-head .hint { margin-top: 6px; overflow-wrap: anywhere; }
.countdown { --p: 100; position: relative; display: grid; place-items: center; width: 62px; height: 62px; flex: none; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--p) * 1%), #dde7d8 0); color: var(--green); font: 600 13px var(--mono); }
.countdown::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #f5f9f2; }
.countdown span { position: relative; font-variant-numeric: tabular-nums; }
.countdown.low { color: var(--red-ink); background: conic-gradient(var(--red) calc(var(--p) * 1%), #eadfd6 0); }
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: stretch; }
.code-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.code-actions .btn-ghost { padding-left: 0; color: var(--green); }
.result-box { display: flex; flex-direction: column; gap: 20px; padding: 25px; border: 1px solid #c8dcc7; border-radius: 14px; background: #f8fbf5; }
.result-head { display: flex; align-items: center; gap: 13px; }
.success-mark { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%; color: var(--green); background: #e4f0df; }
.success-mark .ic { width: 21px; height: 21px; }
.result-head .section-kicker { font-size: 10px; }
.result-box h3 { margin-top: 2px; color: var(--green-ink); font-size: 22px; }
.result-box > p { color: var(--text-2); font-size: 12px; }
.result-key { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 19px 12px 13px; border: 1px solid #dce7d6; border-radius: 11px; background: #fff; }
.result-key > span { color: var(--text-3); font-size: 11px; }
.result-invite { max-width: 100%; color: var(--green-ink); font: 650 30px/1.4 var(--mono); letter-spacing: .08em; overflow-wrap: anywhere; text-align: center; }
.kv { display: grid; grid-template-columns: 65px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid #e1e9dd; font-size: 12px; }
.kv .k { color: var(--text-3); }
.kv code { color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
.success-text { color: var(--green-ink); font-weight: 600; }
.row-actions, .fail-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.result-box .row-actions > .btn-primary { flex: 1; min-width: 180px; }
.fail-box { display: flex; flex-direction: column; gap: 16px; padding: 23px; border: 1px solid #ebd6cc; border-radius: 14px; background: #fdf8f5; }
.fail-box h3 { display: flex; align-items: center; gap: 9px; color: var(--red-ink); font-size: 19px; }
.fail-box p { color: var(--text-2); font-size: 12px; line-height: 1.9; overflow-wrap: anywhere; }

/* 管理后台 */
.login-wrap { display: grid; place-items: center; min-height: 100vh; padding: 32px 20px; }
.login-card { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 400px; padding: 34px; text-align: center; }
.login-card .brand-mark { margin: 0 auto 4px; }
.login-card h1 { font-size: 24px; }
.lead-sm { color: var(--text-3); font-size: 12px; line-height: 1.8; }
.login-card .field-label, .login-card .hint { text-align: left; }
.admin-shell { display: grid; grid-template-columns: 185px minmax(0, 1fr); align-items: start; gap: 26px; max-width: 1500px; margin: 0 auto; padding: 28px 28px 48px; }
.admin-shell .panel-body { padding: 24px; }
.nav { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 5px; padding: 8px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 11px 13px; border: 1px solid transparent; border-radius: 9px; color: var(--text-2); font-size: 13px; text-align: left; }
.nav-item:hover { color: var(--text); background: #f5f7f2; }
.nav-item.active { color: var(--green-ink); border-color: #dce7d8; background: var(--green-soft); font-weight: 650; }
.nav-item .ic { width: 17px; height: 17px; }
.admin-main, .tab-panel { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 13px; }
.stat { position: relative; padding: 19px 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.stat-k { color: var(--text-2); font-size: 12px; font-weight: 600; }
.stat-v { margin-top: 7px; color: var(--tone, var(--green)); font-size: 29px; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-s { margin-top: 5px; color: var(--text-3); font-size: 11px; line-height: 1.8; }
.stat-s b { color: var(--text-2); font-weight: 600; }
.table-wrap, .admin-shell .panel-body.table-wrap { max-width: 100%; max-height: 540px; padding: 0; overflow: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; text-align: left; }
.table th { position: sticky; top: 0; z-index: 2; padding: 13px 17px; border-bottom: 1px solid var(--line); background: #f7f8f4; color: var(--text-3); font-size: 11px; font-weight: 600; white-space: nowrap; }
.table td { padding: 13px 17px; border-bottom: 1px solid #edf0e9; vertical-align: middle; }
.table tbody tr:hover td { background: #fafbf8; }
.table tbody tr:last-child td { border-bottom: 0; }
.table code { font-size: 11px; }
.table .nowrap { white-space: nowrap; }
.t-actions { display: flex; gap: 5px; flex-wrap: nowrap; }
.table .btn { min-width: 44px; white-space: nowrap; }
.t-actions > .btn { flex: none; }
.table-empty td { padding: 36px 20px; color: var(--text-3); text-align: center; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 17px; }
.code-sheet { max-height: 260px; padding: 18px; overflow: auto; border: 1px solid #d6e2d1; border-radius: 11px; background: #f7faf3; color: var(--green-ink); font: 12px/2 var(--mono); white-space: pre-wrap; word-break: break-all; }
.switch-row { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 11px; min-height: 44px; font-size: 12px; cursor: pointer; }
.switch-row input { position: absolute; left: 0; width: 40px; height: 24px; opacity: 0; }
.switch-row .track { position: relative; width: 39px; height: 23px; flex: none; border: 1px solid #c8d2c4; border-radius: 30px; background: #e5e9e1; }
.switch-row .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(40 60 40 / 12%); transition: left .15s; }
.switch-row input:checked + .track { background: var(--green); border-color: var(--green); }
.switch-row input:checked + .track::after { left: 19px; }
.switch-row input:focus-visible + .track { outline: 3px solid var(--green); outline-offset: 3px; }

/* 浏览器与住宅 IP 配置 */
.runtime-note { display: flex; align-items: flex-start; gap: 11px; padding: 14px 16px; border: 1px solid #dce5d7; border-radius: 10px; background: #f6f9f2; color: var(--text-2); font-size: 12px; line-height: 1.9; }
.runtime-note .ic { margin-top: 3px; color: var(--green); width: 17px; height: 17px; }
.runtime-provider-field { max-width: 360px; }
.provider-fields { display: flex; flex-direction: column; gap: 19px; padding: 23px; border: 1px solid var(--line); border-radius: 12px; }
#current-body .provider-fields { min-width: 0; overflow-wrap: anywhere; }
#current-body .row-actions > * { min-width: 0; max-width: 100%; }
#current-body .pill { white-space: normal; }
.config-group-title { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.config-group-title b { font-size: 13px; font-weight: 650; }
.config-group-title span { color: var(--text-3); font-size: 11px; }
.config-save-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; }
.config-feedback { flex: 1; min-width: 180px; overflow-wrap: anywhere; }
.config-feedback:empty { display: none; }
.proxy-controls { display: grid; grid-template-columns: 1fr minmax(140px, 240px); align-items: end; gap: 20px; }
.proxy-controls .switch-row { margin-bottom: 2px; }
.upstream-settings { display: flex; flex-direction: column; gap: 17px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf8; }
.upstream-settings .input { max-width: 500px; font-family: var(--mono); font-size: 12px; }

.select { appearance: auto; }
.browser-test-results { display: flex; flex-direction: column; gap: 11px; padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf8; }
.browser-test-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; }
.browser-test-results > p { color: var(--text-2); font-size: 12px; line-height: 1.85; overflow-wrap: anywhere; }
.browser-test-results > .browser-test-error { color: var(--red-ink); }
.proxy-test-results { display: flex; flex-direction: column; gap: 13px; padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf8; }
.proxy-test-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 13px; }
.proxy-test-summary > b { font-size: 13px; font-weight: 600; }
.proxy-test-results ol { display: grid; gap: 10px; list-style: none; }
.proxy-test-row { display: grid; gap: 5px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.proxy-test-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.proxy-test-row-head > b { font-size: 12px; font-weight: 600; }
.proxy-test-row > p { color: var(--text-2); font-size: 12px; overflow-wrap: anywhere; }
.proxy-test-row.is-ok { border-color: #d5e3ce; }
.proxy-test-row.is-failed { border-color: #ead6cb; }
.proxy-test-error { color: var(--red-ink); font-size: 12px; overflow-wrap: anywhere; }


/* 即时反馈 */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; max-width: 360px; padding: 14px 17px; border: 1px solid var(--line-2); border-radius: 11px; background: #fff; color: var(--text); box-shadow: 0 8px 28px rgb(34 49 35 / 12%); font-size: 12px; line-height: 1.8; animation: toast-in .18s ease-out; }
.toast.out { opacity: 0; transition: opacity .25s; }
.t-ico { display: grid; place-items: center; width: 19px; height: 19px; flex: none; margin-top: 2px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 650; }
.toast-err .t-ico { background: var(--red-soft); color: var(--red-ink); }
.toast-warn .t-ico { background: var(--amber-soft); color: var(--amber-ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

@media (max-width: 1080px) {
  .input:not(.input-otp), .textarea, .select, .upstream-settings .input { font-size: 16px; }
  .landing { column-gap: 55px; }
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .nav { position: static; flex-direction: row; overflow: auto; }
  .nav-item { flex: none; white-space: nowrap; }
}
@media (max-width: 940px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: grid; grid-template-columns: 1fr 1fr; }
  .side-log { grid-column: 1 / -1; }
  .panel-main { min-height: 0; }
}
@media (max-width: 720px) {
  .public-topbar, .public-footer { width: calc(100% - 40px); }
  .public-topbar { min-height: 76px; }
  .brand-name { font-size: 14px; }
  .landing { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "entry" "guide"; width: calc(100% - 48px); max-width: 480px; gap: 23px; padding: 17px 0 36px; }
  .landing-copy h1 { margin: 11px 0 13px; font-size: clamp(32px, 8.6vw, 36px); }
  .lead { font-size: 13px; line-height: 1.8; }
  .landing-steps { gap: 20px; margin: 6px 0 24px; }
  .landing-assurance { padding-top: 19px; }
  .entry-pane { max-width: none; }
  .redeem-card { gap: 17px; padding: 25px 24px 22px; }
  .public-footer { flex-wrap: wrap; align-content: center; gap: 3px 15px; padding: 19px 0; font-size: 10px; }
  .topbar { position: static; flex-wrap: wrap; align-items: flex-start; gap: 12px; padding: 18px 18px 13px; }
  .brand-text h1 { font-size: 15px; }
  .brand-text p { font-size: 11px; }
  .top-meta { width: 100%; gap: 7px; }
  .top-meta > .btn:last-child { margin-left: auto; }
  .chip { padding: 5px 9px; font-size: 11px; }
  .chip-key b { font-size: 10px; }
  .workspace-intro { padding: 26px 18px 21px; }
  .workspace-intro h2 { font-size: 23px; }
  .workspace-intro > p:last-child { font-size: 12px; }
  .shell { gap: 18px; padding: 0 16px 32px; }
  .panel-head { gap: 10px; padding: 19px 20px; }
  .panel-head h2 { font-size: 15px; }
  .panel-sub { font-size: 11px; }
  .panel-body { padding: 22px 20px; gap: 20px; }
  .start-view { gap: 20px; padding: 0; }
  .start-view h3 { font-size: 21px; }
  .start-actions { gap: 10px; }
  .start-actions > .btn-primary { width: 100%; }
  .helper-box { padding: 14px; }
  .run-view { gap: 21px; }
  .run-head { align-items: flex-start; gap: 8px; }
  .run-email b { font-size: 12px; }
  .current-stage h3 { font-size: 21px; }
  .current-stage > p { font-size: 11px; }
  .progress-caption { font-size: 10px; }
  .code-box, .result-box, .fail-box { padding: 18px 16px; }
  .code-head { align-items: flex-start; gap: 10px; }
  .code-head h3 { font-size: 18px; }
  .code-head .hint { font-size: 11px; }
  .countdown { width: 54px; height: 54px; font-size: 11px; }
  .code-row { grid-template-columns: minmax(0, 1fr); }
  .input-otp { font-size: 23px; }
  .code-actions { flex-direction: column; align-items: flex-start; gap: 3px; }
  .result-box h3 { font-size: 20px; }
  .result-invite { font-size: 26px; }
  .kv { grid-template-columns: 54px minmax(0, 1fr) auto; gap: 8px; font-size: 11px; }
  .kv code { font-size: 11px; }
  .result-box .row-actions > .btn { width: 100%; }
  .details-note { font-size: 10px; }
  .side { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .side-card { padding: 22px; }
  /* 有任务时优先显示需要填写或保存的内容，保留模拟状态标记。 */
  .has-task .workspace-intro { display: none; }
  .has-task .topbar { padding: 12px 16px 10px; gap: 5px; }
  .has-task .brand-text p { display: none; }
  .has-task .shell { padding-top: 15px; }
  .has-task .panel-head { padding: 13px 17px; gap: 8px; }
  .has-task .panel-head .panel-sub { display: none; }
  .has-task .panel-body { padding: 16px; }
  .has-task .run-view { gap: 15px; }
  .has-task #mock-label { padding: 8px 10px; font-size: 10px; line-height: 1.65; }
  .has-task .run-email #run-email-label { display: none; }
  .has-task .current-stage h3 { margin-top: 4px; font-size: 19px; }
  .has-task .current-stage > p { display: none; }
  .has-task .current-stage .section-kicker { font-size: 10px; }
  .has-task .progress-caption { margin-top: 11px; margin-bottom: 6px; }
  .has-task .code-box { padding: 16px 14px; gap: 12px; }
  .has-task .code-head .section-kicker { display: none; }
  .has-task .code-head h3 { margin-top: 0; }
  .has-task .code-head .hint { margin-top: 4px; }
  .has-task.has-result .result-box { gap: 16px; }
  .admin-shell { padding: 19px 16px 35px; gap: 19px; }
  .admin-shell .panel-body { padding: 20px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 16px 14px; }
  .stat-v { font-size: 25px; }
  .stat-s { font-size: 10px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .provider-fields { padding: 18px 16px; }
  .proxy-controls { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .config-save-row > .btn { width: 100%; }
  .config-group-title { align-items: flex-start; flex-direction: column; gap: 3px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .toast { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Browser account authorization */
.authorization-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: authorization-step; }
.authorization-steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 3px 9px; counter-increment: authorization-step; }
.authorization-steps li::before { content: counter(authorization-step); grid-row: span 2; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); font-size: 12px; }
.authorization-steps b { font-size: 12px; }
.authorization-steps span { font-size: 11px; color: var(--text-3); line-height: 1.6; }
.authorization-link { min-width: 0; }
.authorization-link-controls { display: flex; align-items: center; gap: 10px; }
.authorization-link-controls .input { min-width: 0; flex: 1; font-size: 12px; }
.authorization-link-controls .btn { flex-shrink: 0; }
.authorization-link > .hint { margin: 7px 0 0; overflow-wrap: anywhere; }
.authorization-dialog { box-sizing: border-box; width: min(1360px, calc(100vw - 32px)); height: min(940px, calc(100dvh - 32px)); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: inherit; overflow: hidden; }
.authorization-dialog[open] { display: flex; flex-direction: column; }
.authorization-dialog::backdrop { background: rgba(20, 26, 30, .6); }
.authorization-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.authorization-dialog-head h3 { margin: 0 0 6px; font-size: 17px; }
.authorization-dialog-head p { margin: 0; }
.authorization-dialog-head > .btn { flex-shrink: 0; }
.authorization-dialog iframe { width: 100%; flex: 1; min-height: 0; border: 0; background: #283239; }
@media (max-width: 720px) {
  .authorization-steps { grid-template-columns: 1fr; gap: 12px; }
  .authorization-link-controls { align-items: stretch; flex-direction: column; }
  .authorization-dialog { width: calc(100vw - 12px); height: calc(100dvh - 12px); border-radius: 10px; }
  .authorization-dialog-head { padding: 13px; gap: 10px; }
  .authorization-dialog-head h3 { font-size: 15px; }
}
