:root {
  color-scheme: light;
  --shell: #111827;
  --shell-soft: #1f2937;
  --canvas: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --border: #e5e7eb;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #16a34a;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --radius-sm: 7px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-float: 0 18px 50px rgba(15, 23, 42, .16), 0 4px 14px rgba(15, 23, 42, .08);
  --motion: 180ms cubic-bezier(.2, .8, .2, 1);
  font-family: Inter, "SF Pro Text", "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; min-width: 1040px; height: 100%; margin: 0; }
body { overflow: hidden; color: var(--text); background: var(--canvas); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, iframe:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 440px;
  align-items: center;
  gap: 72px;
  padding: 72px clamp(56px, 8vw, 140px);
  background: var(--canvas);
}
.auth-intro { max-width: 660px; display: grid; gap: 54px; }
.auth-brand, .brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto;
  color: white; background: var(--primary); border-radius: 9px; font-size: 18px; font-weight: 750;
}
.auth-brand div, .brand div { display: grid; gap: 2px; }
.auth-brand strong { font-size: 18px; }
.auth-brand span, .brand p { margin: 0; color: var(--muted); font-size: 12px; }
.auth-copy h1 { max-width: 580px; margin: 0; font-size: clamp(36px, 5vw, 58px); line-height: 1.08; letter-spacing: -.035em; }
.auth-copy p { max-width: 520px; margin: 20px 0 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.auth-intro ul { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; color: var(--text-soft); }
.auth-intro li { position: relative; padding-left: 26px; }
.auth-intro li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 800; }
.auth-card { padding: 30px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 14px 36px rgba(15, 23, 42, .09); }
.auth-heading h2 { margin: 0 0 6px; font-size: 24px; }
.auth-heading p { margin: 0; color: var(--muted); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 24px 0; padding: 4px; background: var(--surface-soft); border-radius: 9px; }
.auth-tabs button { height: 36px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.auth-tabs button.active { color: var(--text); background: var(--surface); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); font-weight: 650; }
.auth-card form, .api-settings { display: grid; gap: 15px; }
.auth-card label { display: grid; gap: 7px; color: var(--text-soft); font-size: 12px; font-weight: 650; }
.auth-card input { width: 100%; height: 42px; padding: 0 12px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; }
.auth-card input:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); outline: 0; }
.phone-input { display: grid; grid-template-columns: 58px 1fr; }
.phone-input b { display: grid; place-items: center; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--border-strong); border-right: 0; border-radius: 8px 0 0 8px; font-size: 12px; }
.phone-input input { border-radius: 0 8px 8px 0; }
.auth-submit, .primary-action { min-height: 42px; border: 1px solid var(--primary); border-radius: 8px; color: white; background: var(--primary); font-weight: 700; cursor: pointer; transition: background var(--motion), transform var(--motion); }
.auth-submit:hover, .primary-action:hover { background: var(--primary-dark); }
.auth-submit:active, .primary-action:active { transform: translateY(1px); }
.auth-error { min-height: 18px; margin: 0; color: var(--danger); font-size: 12px; }
.api-settings-button { width: 100%; margin-top: 12px; border: 0; color: var(--primary); background: transparent; cursor: pointer; }
.api-settings { margin-top: 12px; padding-top: 18px; border-top: 1px solid var(--border); }
.api-settings button { height: 36px; border: 1px solid var(--border-strong); border-radius: 8px; background: white; cursor: pointer; }
.auth-service-state { margin: 16px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.auth-service-state.ok { color: var(--success); }
.auth-service-state.warning { color: #b45309; }
.auth-service-state.error { color: var(--danger); }

.workspace-app { width: 100%; height: 100%; background: var(--canvas); }
.command-bar {
  position: relative; z-index: 30; height: 54px; display: grid; grid-template-columns: 280px minmax(280px, 520px) 1fr; align-items: center; gap: 22px;
  padding: 0 16px 0 18px; color: white; background: var(--shell); border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand.compact .brand-mark { width: 30px; height: 30px; border-radius: 7px; font-size: 14px; }
.brand h1 { margin: 0; font-size: 14px; letter-spacing: -.01em; }
.brand.compact p { color: #94a3b8; font-size: 10px; }
.command-search { height: 34px; display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 8px; padding: 0 10px; background: var(--shell-soft); border: 1px solid #334155; border-radius: 8px; transition: border var(--motion), box-shadow var(--motion); }
.command-search:focus-within { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.command-search svg { width: 17px; height: 17px; fill: none; stroke: #94a3b8; stroke-width: 1.8; }
.command-search input { min-width: 0; height: 30px; padding: 0; border: 0; outline: 0; color: white; background: transparent; font-size: 12px; }
.command-search input::placeholder { color: #94a3b8; }
.command-search kbd { padding: 2px 6px; color: #94a3b8; background: #0f172a; border: 1px solid #475569; border-radius: 5px; font-size: 10px; font-family: inherit; }
.command-actions { min-width: 0; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.continue-button { height: 32px; padding: 0 14px; border: 1px solid #3b82f6; border-radius: 7px; color: white; background: var(--primary); font-size: 12px; font-weight: 650; cursor: pointer; }
.continue-button:hover { background: #3b82f6; }
.service-state { height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 9px; color: #cbd5e1; background: transparent; border: 1px solid transparent; border-radius: 7px; font: inherit; font-size: 11px; white-space: nowrap; cursor: pointer; transition: background var(--motion), border-color var(--motion); }
.service-state:hover, .service-state[aria-expanded="true"] { background: var(--shell-soft); border-color: #334155; }
.service-state i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 0 3px rgba(148, 163, 184, .12); }
.service-state.ok i { background: var(--success); box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }
.service-state.error i { background: var(--danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
.service-state.checking i { animation: session-pulse 1.2s ease-in-out infinite; }
.session-popover { position: absolute; z-index: 80; top: 48px; right: 112px; width: 328px; padding: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-float); }
.session-popover header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.session-popover header small { display: block; margin-bottom: 3px; color: var(--primary); font-size: 10px; font-weight: 700; }
.session-popover h2 { margin: 0; font-size: 14px; }
.session-popover > p { margin: 10px 0 13px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.session-popover-badge { padding: 4px 8px; color: #475569; background: #f1f5f9; border-radius: 999px; font-size: 10px; font-weight: 700; }
.session-popover-badge.ok { color: #166534; background: #dcfce7; }
.session-popover-badge.error { color: #b91c1c; background: #fee2e2; }
.session-popover dl { display: grid; gap: 0; margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.session-popover dl div { min-height: 35px; display: grid; grid-template-columns: 80px 1fr; align-items: center; padding: 0 10px; border-bottom: 1px solid var(--border); font-size: 10px; }
.session-popover dl div:last-child { border-bottom: 0; }
.session-popover dt { color: var(--muted); }
.session-popover dd { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; text-align: right; font-weight: 650; white-space: nowrap; }
.session-popover footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.session-popover footer button { min-height: 34px; padding: 0 12px; color: var(--text-soft); background: white; border: 1px solid var(--border-strong); border-radius: 7px; font: inherit; font-size: 10px; font-weight: 650; cursor: pointer; }
.session-popover footer button.primary { color: white; background: var(--primary); border-color: var(--primary); }
.session-popover footer button:disabled { opacity: .55; cursor: wait; }
@keyframes session-pulse { 50% { opacity: .35; transform: scale(.8); } }
.account-button { height: 34px; display: inline-flex; align-items: center; gap: 8px; padding: 0 7px 0 4px; color: white; background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.account-button:hover { background: var(--shell-soft); border-color: #334155; }
.account-button > span { display: grid; place-items: center; width: 26px; height: 26px; color: #1e3a8a; background: #dbeafe; border-radius: 7px; font-size: 12px; font-weight: 800; }
.account-button b { max-width: 90px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.account-button svg { width: 14px; fill: none; stroke: #94a3b8; stroke-width: 1.6; }

.workspace-body { height: calc(100vh - 54px); display: grid; grid-template-columns: 176px minmax(0, 1fr); }
.utility-rail { position: relative; z-index: 10; display: flex; flex-direction: column; gap: 20px; padding: 14px; background: var(--surface); border-right: 1px solid var(--border); transition: width var(--motion), padding var(--motion); overflow: hidden; }
.batch-selector { width: 148px; min-height: 90px; display: grid; gap: 6px; padding: 12px; text-align: left; background: var(--canvas); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: border var(--motion), background var(--motion); }
.batch-selector:hover { background: var(--primary-soft); border-color: #bfdbfe; }
.batch-selector > span { color: var(--muted); font-size: 10px; }
.batch-selector > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.batch-selector small { display: grid; grid-template-columns: 7px auto 1fr; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.batch-selector small i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.batch-selector small b { justify-self: end; color: var(--primary); font-weight: 650; }
.utility-nav { display: grid; gap: 6px; }
.utility-button { position: relative; width: 148px; height: 40px; display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 9px; padding: 0 11px; color: var(--text-soft); background: transparent; border: 1px solid transparent; border-radius: 7px; text-align: left; cursor: pointer; transition: color var(--motion), background var(--motion), border var(--motion); }
.utility-button:hover { color: var(--text); background: var(--surface-soft); }
.utility-button.active { color: var(--primary-dark); background: var(--primary-soft); border-color: #bfdbfe; font-weight: 650; }
.utility-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.utility-button b { min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; color: #c2410c; background: #ffedd5; border-radius: 10px; font-size: 9px; }
.collapse-rail { width: 148px; height: 34px; margin-top: auto; border: 0; border-radius: 7px; color: var(--muted); background: transparent; text-align: left; cursor: pointer; }
.collapse-rail:hover { color: var(--text); background: var(--surface-soft); }
.collapse-rail span { margin-left: 12px; font-size: 11px; }
.workspace-app.rail-collapsed .workspace-body { grid-template-columns: 60px minmax(0, 1fr); }
.workspace-app.rail-collapsed .utility-rail { padding-inline: 9px; }
.workspace-app.rail-collapsed .batch-selector { width: 42px; min-height: 42px; padding: 0; place-items: center; }
.workspace-app.rail-collapsed .batch-selector::before { content: "批"; font-size: 12px; font-weight: 750; }
.workspace-app.rail-collapsed .batch-selector > *, .workspace-app.rail-collapsed .utility-button span, .workspace-app.rail-collapsed .utility-button b, .workspace-app.rail-collapsed .collapse-rail span { display: none; }
.workspace-app.rail-collapsed .utility-button, .workspace-app.rail-collapsed .collapse-rail { width: 42px; place-items: center; text-align: center; }
.workspace-app.rail-collapsed .utility-button { grid-template-columns: 1fr; padding: 0; }

.workspace-content { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.workflow-shell { position: relative; z-index: 8; padding: 12px 22px 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
.workflow-steps { display: grid; grid-template-columns: minmax(124px, .82fr) 18px minmax(124px, .82fr) 18px minmax(124px, .82fr) 18px minmax(164px, 1.08fr) 18px minmax(112px, .72fr) 18px minmax(164px, 1.08fr) 18px minmax(120px, .78fr); align-items: center; }
.workflow-step { position: relative; min-width: 0; height: 62px; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 9px; padding: 8px 10px; color: var(--text-soft); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; text-align: left; cursor: pointer; transition: border var(--motion), background var(--motion), transform var(--motion), box-shadow var(--motion); }
.workflow-step:hover { border-color: #bfdbfe; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(15, 23, 42, .07); }
.workflow-step.active { color: var(--primary-dark); background: var(--primary-soft); border-color: #93c5fd; box-shadow: inset 0 -2px 0 var(--primary); }
.workflow-step.completed .step-index { background: var(--success); }
.workflow-step.partial .step-index, .workflow-step.failed .step-index { background: var(--warning); }
.workflow-step.running .step-index { background: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.step-index { width: 26px; height: 26px; display: grid; place-items: center; color: white; background: #cbd5e1; border-radius: 50%; font-size: 11px; font-weight: 750; }
.workflow-step.active .step-index { background: var(--primary); }
.workflow-step.preparation-step:not(.active) { background: #f8fafc; border-style: dashed; }
.workflow-step.preparation-step .step-index { background: #475569; }
.workflow-step.preparation-step.active .step-index { background: var(--primary); }
.step-copy { min-width: 0; display: grid; gap: 3px; }
.step-copy strong, .step-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-copy strong { font-size: 11px; font-weight: 680; }
.step-copy small { color: var(--muted); font-size: 9px; }
.workflow-step.active .step-copy small { color: var(--primary); }
.step-connector { height: 1px; background: var(--border-strong); }
.workflow-context { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 7px; padding: 0 3px; }
.workflow-context p { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 10px; }
.workflow-context p i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.workflow-context button { border: 0; color: var(--primary); background: transparent; font-size: 10px; cursor: pointer; }
.dependency-banner { min-height: 38px; display: grid; grid-template-columns: 18px 1fr 24px; align-items: center; gap: 8px; margin-top: 5px; padding: 7px 10px; color: #92400e; background: var(--warning-soft); border: 1px solid #fde68a; border-radius: 8px; font-size: 11px; }
.dependency-banner svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dependency-banner button { border: 0; color: inherit; background: transparent; cursor: pointer; font-size: 17px; }
.workspace-main { min-height: 0; overflow: hidden; background: var(--canvas); }
.mode-panel { width: 100%; height: 100%; padding: 0; animation: panel-in var(--motion); }
.mode-panel iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--canvas); }
@keyframes panel-in { from { opacity: .55; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.utility-drawer, .account-panel { position: fixed; z-index: 80; top: 54px; right: 0; bottom: 0; width: min(430px, 88vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-float); animation: drawer-in var(--motion); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: .5; } to { transform: none; opacity: 1; } }
.utility-drawer > header, .account-panel-head { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.utility-drawer header small { color: var(--primary); font-size: 10px; font-weight: 700; }
.utility-drawer header h2 { margin: 4px 0 0; font-size: 18px; }
.utility-drawer header button, .account-panel-head button { width: 32px; height: 32px; border: 0; border-radius: 7px; background: var(--surface-soft); cursor: pointer; font-size: 20px; }
.utility-drawer-body { height: calc(100% - 76px); padding: 18px 20px; overflow: auto; }
.drawer-backdrop { position: fixed; z-index: 70; inset: 54px 0 0; background: rgba(15, 23, 42, .22); backdrop-filter: blur(1px); }
.drawer-section { display: grid; gap: 10px; margin-bottom: 24px; }
.drawer-section h3 { margin: 0; font-size: 13px; }
.drawer-section > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.drawer-list { display: grid; gap: 7px; }
.drawer-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 11px 12px; background: var(--canvas); border: 1px solid var(--border); border-radius: 8px; }
.drawer-row strong { display: block; margin-bottom: 3px; font-size: 11px; }
.drawer-row span { color: var(--muted); font-size: 10px; }
.drawer-row button { height: 28px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 7px; background: white; cursor: pointer; font-size: 10px; }
.drawer-row button.primary { color: white; background: var(--primary); border-color: var(--primary); }
.failure-row { border-left: 3px solid var(--warning); }
.empty-state { display: grid; place-items: center; min-height: 220px; color: var(--muted); text-align: center; }
.empty-state b { display: block; margin-bottom: 8px; color: var(--text-soft); }

.dependency-dialog { width: min(460px, calc(100vw - 40px)); padding: 0; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-float); }
.dependency-dialog::backdrop { background: rgba(15, 23, 42, .34); }
.dependency-dialog form { display: grid; grid-template-columns: 38px 1fr; gap: 14px; padding: 22px; }
.dialog-icon { width: 36px; height: 36px; display: grid; place-items: center; color: #92400e; background: #fef3c7; border-radius: 9px; font-weight: 800; }
.dependency-dialog h2 { margin: 3px 0 7px; font-size: 17px; }
.dependency-dialog p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.dependency-dialog label, .dependency-dialog footer { grid-column: 2; }
.dependency-dialog label { color: var(--muted); font-size: 11px; }
.dependency-dialog footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 6px; }
.secondary-action, .logout-button { min-height: 36px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: white; cursor: pointer; }
.account-panel { padding: 0 20px 20px; }
.account-panel-head { margin-inline: -20px; }
.account-panel-head div { display: grid; gap: 3px; }
.account-panel-head span { color: var(--muted); font-size: 11px; }
.device-capacity { display: flex; justify-content: space-between; padding: 18px 0 12px; color: var(--muted); }
.device-list { display: grid; gap: 8px; margin-bottom: 14px; }
.device-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 12px; background: var(--canvas); border: 1px solid var(--border); border-radius: 8px; }
.device-item div { display: grid; gap: 4px; }
.device-item span { color: var(--muted); font-size: 10px; }
.device-item button { border: 0; color: var(--danger); background: transparent; cursor: pointer; }
.logout-button { width: 100%; margin-top: 10px; color: var(--danger); border-color: #fecaca; }
.workspace-toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: 380px; padding: 12px 16px; color: var(--text-soft); background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--success); border-radius: 8px; box-shadow: var(--shadow-float); font-size: 11px; animation: toast-in var(--motion); }
.workspace-toast.warning { border-left-color: var(--warning); }
.workspace-toast.error { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.device-recovery { margin: 12px 0; padding: 12px; border: 1px solid #d8dfe8; border-radius: 10px; background: #f8fafc; font-size: 12px; line-height: 1.6; color: #536277; }
.device-recovery summary { cursor: pointer; color: #334155; font-weight: 600; }
.device-recovery p { margin: 8px 0; }
.device-recovery input[type="file"] { width: 100%; min-width: 0; padding: 6px 0; font-size: 12px; }
.device-recovery select { width: 100%; min-width: 0; padding: 10px; border: 1px solid #cbd5e1; border-radius: 7px; background: white; color: #334155; }

/* Unified presentation. Navigation IDs, order and business state remain unchanged. */
:root { --canvas: #f5f8fc; --border: #e2e8f0; --primary: #1764ff; --primary-dark: #1454d8; --primary-soft: #eaf1ff; --text: #10213c; --radius: 8px; }
html, body { min-width: 0; }
body { overflow: auto; line-height: 1.5; }
a { color: var(--primary); text-underline-offset: 3px; }
.entry-header { position: absolute; inset: 0 0 auto; height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 40px; background: #fff; border-bottom: 1px solid var(--border); }
.entry-header > a:last-child { color: var(--text-soft); text-decoration: none; font-size: 14px; }
.entry-brand { color: var(--text); font-size: 22px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.entry-brand > span, .brand-word { color: #f97316; font-weight: 800; letter-spacing: -.04em; }
.entry-brand > span { margin-right: 8px; }
.entry-account { display: flex; align-items: center; gap: 20px; color: var(--text-soft); }
.entry-account button { color: var(--muted); border: 0; background: transparent; cursor: pointer; }
.auth-gate { position: relative; width: 100%; min-height: 100dvh; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); gap: clamp(40px, 6vw, 100px); padding: 144px clamp(32px, 8vw, 144px) 64px; }
.auth-intro { gap: 32px; }
.auth-copy h1 { font-size: clamp(28px, 3.1vw, 46px); line-height: 1.35; letter-spacing: -.025em; }
.auth-copy p { margin-top: 16px; font-size: 18px; line-height: 1.7; }
.entry-flow { display: grid; gap: 28px; margin: 8px 0 0; padding: 0; list-style: none; }
.entry-flow li { display: flex; align-items: center; gap: 20px; color: var(--text); font-size: 19px; font-weight: 650; }
.auth-intro .entry-flow li { padding-left: 0; }
.auth-intro .entry-flow li::before { content: none; }
.entry-flow li span { display: grid; place-items: center; width: 36px; height: 36px; color: var(--primary); background: #e0edff; border-radius: 50%; font-size: 17px; }
.entry-note { max-width: 480px; margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.auth-card { padding: 36px; border: 1px solid var(--border); border-radius: 10px; box-shadow: none; }
.auth-heading h2 { font-size: 28px; }
.auth-heading p { margin: 10px 0 22px; font-size: 14px; }
.auth-tabs { margin-bottom: 24px; }
.auth-tabs button { min-height: 40px; font-size: 14px; }
#authForm { gap: 20px; }
.auth-card label > span, .connector-account label > span { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.auth-card input, .connector-account input:not([type="file"]), .connector-account select { min-height: 46px; font-size: 14px; }
.auth-submit { min-height: 46px; font-size: 16px; }
.auth-service-state { margin-top: 18px; font-size: 12px; }
.auth-error { line-height: 1.6; }
.auth-password-actions { display: flex; justify-content: flex-end; margin-top: -8px; }
.auth-password-actions button { padding: 0; border: 0; background: transparent; color: var(--primary); font-size: 13px; cursor: pointer; }
.reset-password-help { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
#resetPasswordFields { display: grid; gap: 16px; }
.auth-copy { padding-bottom: 24px; }
.connector-gate { position: relative; min-height: 100dvh; padding: 112px 32px 48px; }
.connector-content { max-width: 1200px; margin: 0 auto; }
.connection-progress { display: flex; justify-content: center; gap: 56px; list-style: none; margin: 0 0 36px; padding: 0; }
.connection-progress li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.connection-progress li span { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #cbd5e1; border-radius: 50%; }
.connection-progress .active { color: var(--primary); font-weight: 650; }
.connection-progress .active span, .connection-progress .complete span { color: #fff; background: var(--primary); border-color: var(--primary); }
.connector-heading { margin-bottom: 24px; }
.connector-heading h1 { margin: 0 0 8px; font-size: 34px; letter-spacing: -.025em; }
.connector-heading p { margin: 0; font-size: 17px; color: var(--muted); }
.connector-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.connector-install, .connector-account { min-width: 0; padding: 28px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.connector-grid h2 { margin: 0 0 16px; font-size: 21px; }
.connector-grid p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.browser-support { padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.install-steps { list-style: none; counter-reset: install-step; padding: 0; margin: 24px 0; display: grid; gap: 22px; }
.install-steps li { position: relative; padding-left: 46px; counter-increment: install-step; }
.install-steps li::before { content: counter(install-step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-soft); color: var(--text); }
.install-steps strong { font-size: 15px; }
.install-steps p { margin: 6px 0 0; }
.install-steps code { font-size: 12px; background: var(--surface-soft); border-radius: 4px; padding: 2px 4px; overflow-wrap: anywhere; }
.connector-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.connector-actions a { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 0 20px; text-decoration: none; border-radius: 8px; }
.connector-actions .primary-action { color: #fff; background: var(--primary); }
.connector-actions .secondary-action { color: var(--text-soft); }
.connector-detection { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.connector-detection p { margin: 4px 0 0; font-size: 12px; }
.connector-detection button { flex-shrink: 0; }
.connector-account > label { display: block; margin: 20px 0; }
.connector-account input:not([type="file"]) { width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 12px; }
#connectBrowserButton { width: 100%; min-height: 44px; margin: 16px 0; border: 1px solid var(--primary); border-radius: 8px; color: #fff; background: var(--primary); font-weight: 650; cursor: pointer; }
#connectBrowserButton:disabled { color: #8491a6; background: #e9edf3; border-color: #e9edf3; cursor: not-allowed; }
.connector-note { padding: 14px; background: var(--primary-soft); border-radius: 8px; }
.connector-technical { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; font-size: 13px; }
.connector-technical summary { cursor: pointer; color: var(--muted); }
.connector-technical .api-settings-button { margin-top: 16px; }
.workspace-app { height: 100dvh; min-height: 480px; grid-template-rows: 64px minmax(0, 1fr); }
.command-bar { height: 64px; grid-template-columns: auto minmax(160px, 340px) auto; gap: 24px; padding: 0 24px; color: var(--text); background: #fff; border-bottom: 1px solid var(--border); }
.brand.compact { gap: 9px; }
.brand-word { font-size: 27px; }
.brand.compact h1 { font-size: 18px; color: var(--text); }
.brand.compact p { display: none; }
.command-search { border: 1px solid var(--border); background: var(--canvas); }
.command-search input { color: var(--text); font-size: 13px; }
.command-search kbd { background: #fff; border-color: var(--border); color: var(--muted); }
.service-state { color: var(--text-soft); font-size: 12px; }
.service-state:hover, .service-state[aria-expanded="true"] { background: var(--canvas); border-color: var(--border); }
.account-button { color: var(--text); }
.account-button > span { color: #3162a9; background: #e5edfa; }
.account-button:hover { background: var(--canvas); }
.account-button b { font-size: 13px; }
.session-popover { top: 58px; }
.workspace-body { height: calc(100dvh - 64px); grid-template-columns: 184px minmax(0, 1fr); }
.workspace-content { grid-template-columns: minmax(0, 1fr); }
.utility-rail { padding: 16px 12px; background: #fff; }
.batch-selector, .utility-button, .collapse-rail { width: 100%; }
.batch-selector { padding: 14px; border-color: transparent; background: var(--primary-soft); }
.batch-selector strong { font-size: 14px; }
.batch-selector > span, .batch-selector small { font-size: 12px; }
.utility-nav { gap: 8px; }
.utility-button { min-height: 44px; font-size: 14px; border-color: transparent; }
.utility-button.active { border-color: transparent; }
.utility-button svg { width: 20px; height: 20px; }
.workflow-shell { min-width: 0; padding: 16px 24px 12px; }
.workflow-steps { grid-template-columns: minmax(84px, 1fr) 12px minmax(84px, 1fr) 12px minmax(84px, 1fr) 12px minmax(118px, 1.25fr) 12px minmax(84px, 1fr) 12px minmax(128px, 1.35fr) 12px minmax(84px, 1fr); }
.workflow-step { height: 92px; display: flex; flex-direction: column; justify-content: flex-start; gap: 7px; padding: 8px 4px; border-color: transparent; text-align: center; background: transparent; box-shadow: none; }
.workflow-step.active { border-color: transparent; box-shadow: none; }
.workflow-step:hover { box-shadow: none; transform: none; border-color: transparent; background: var(--canvas); }
.workflow-step.preparation-step:not(.active) { border-style: solid; background: transparent; }
.step-index { flex-shrink: 0; width: 30px; height: 30px; font-size: 14px; background: #e3e8f0; color: #64748b; }
.workflow-step.active .step-index, .workflow-step.completed .step-index, .workflow-step.running .step-index, .workflow-step.partial .step-index, .workflow-step.failed .step-index { color: #fff; }
.workflow-step.preparation-step .step-index { background: #e3e8f0; color: #64748b; }
.workflow-step.preparation-step.active .step-index { color: #fff; }
.step-copy { gap: 2px; }
.step-copy strong { font-size: 13px; line-height: 1.4; }
.step-copy small { font-size: 11px; }
.step-connector { align-self: start; margin-top: 23px; height: 2px; }
.workflow-context { margin-top: 12px; padding: 9px 14px; min-height: 38px; border-radius: 6px; background: #f0f5fc; }
.workflow-context p, .workflow-context button { font-size: 12px; }
.dependency-banner { font-size: 12px; }
.utility-drawer, .account-panel { top: 64px; overflow-y: auto; }
.drawer-backdrop { top: 64px; }
.drawer-section > p, .drawer-row strong, .drawer-row button, .device-item span, .account-panel-head span, .workspace-toast { font-size: 13px; }
.drawer-row span { font-size: 12px; }
.device-recovery { font-size: 13px; }
@media (max-width: 1200px) {
  .workspace-body { grid-template-columns: 150px minmax(0, 1fr); }
  .workflow-shell { padding-inline: 16px; }
  .command-bar { gap: 16px; padding-inline: 16px; grid-template-columns: auto minmax(120px, 240px) auto; }
  .command-search kbd { display: none; }
  .brand.compact h1 { font-size: 16px; }
  .brand-word { font-size: 24px; }
  .workflow-steps { display: flex; gap: 0; overflow-x: auto; padding-bottom: 4px; }
  .workflow-step { min-width: 104px; flex: 1 0 104px; }
  .step-connector { min-width: 12px; }
}
@media (max-width: 900px) {
  .auth-gate { padding: 112px 24px 40px; gap: 32px; grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); }
  .auth-card { padding: 24px; }
  .entry-header { height: 72px; padding-inline: 24px; }
  .entry-brand { font-size: 18px; }
  .auth-copy h1 { font-size: 30px; }
  .entry-flow li { font-size: 16px; }
  .connector-grid { grid-template-columns: 1fr; }
  .workspace-body { grid-template-columns: 64px minmax(0, 1fr); }
  .utility-rail { padding: 12px 8px; }
  .utility-button { grid-template-columns: 1fr; justify-items: center; padding: 0; }
  .utility-button span, .utility-button b, .batch-selector > *, .collapse-rail span { display: none; }
  .batch-selector { min-height: 44px; padding: 0; place-items: center; }
  .batch-selector::before { content: "批次"; font-size: 12px; }
  .command-search { display: none; }
  .command-bar { display: flex; justify-content: space-between; }
}
@media (max-width: 640px) {
  .auth-gate { display: flex; flex-direction: column; align-items: stretch; padding: 104px 20px 32px; gap: 24px; }
  .auth-intro { gap: 16px; }
  .auth-copy h1 { font-size: 27px; }
  .auth-copy p { font-size: 15px; margin-top: 8px; }
  .entry-flow { display: flex; gap: 12px; margin: 0; }
  .entry-flow li { gap: 6px; font-size: 12px; }
  .entry-flow li span { width: 24px; height: 24px; font-size: 12px; }
  .entry-note { font-size: 12px; }
  .auth-heading h2 { font-size: 24px; }
  .entry-header { padding-inline: 20px; }
  .entry-header > a:last-child { font-size: 12px; }
  .entry-account { gap: 10px; font-size: 12px; }
  .connector-gate { padding: 104px 16px 32px; }
  .connection-progress { gap: 16px; margin-bottom: 24px; }
  .connection-progress li { flex-direction: column; font-size: 12px; gap: 6px; }
  .connector-heading h1 { font-size: 27px; }
  .connector-install, .connector-account { padding: 20px; }
  .connector-detection { align-items: start; }
  .workspace-body { grid-template-columns: minmax(0, 1fr); }
  .utility-rail { display: none; }
  .command-actions { gap: 4px; }
  .command-bar { padding-inline: 12px; gap: 8px; }
  .brand.compact h1 { font-size: 14px; }
  .brand-word { font-size: 22px; }
  .continue-button, .service-state, .account-button b { display: none; }
  .workflow-context { gap: 8px; padding: 8px; }
  .workflow-context p { font-size: 11px; }
  .workflow-context button { font-size: 11px; flex-shrink: 0; }
  .session-popover { right: 12px; width: min(328px, calc(100vw - 24px)); }
}
