@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ===== Design system v2 (clean SaaS) ===== */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f1f3f7;
  --surface-3: #e7eaf1;
  --border: #e3e6ec;
  --border-strong: #c9cfd9;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --primary-text: #ffffff;
  --success: #16a34a;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fff7ed;
  --error: #dc2626;
  --error-soft: #fef2f2;
  --info: #0284c7;
  --info-soft: #f0f9ff;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 4px 12px rgba(15, 23, 42, .06);
  --shadow-lg: 0 8px 32px rgba(15, 23, 42, .08);
  --header-bg: rgba(255, 255, 255, .85);
  --header-border: var(--border);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

:root[data-theme="dark"] {
  --bg: #0a0d14;
  --surface: #11151e;
  --surface-2: #181d29;
  --surface-3: #232a3a;
  --border: #232a3a;
  --border-strong: #3a4358;
  --text: #f1f5f9;
  --text-2: #b5bdcc;
  --text-3: #6b7388;
  --primary: #818cf8;
  --primary-hover: #a5b1ff;
  --primary-soft: #1f2342;
  --primary-text: #ffffff;
  --success: #34d399;
  --success-soft: #0f2a1f;
  --warning: #fbbf24;
  --warning-soft: #2a1f0c;
  --error: #f87171;
  --error-soft: #2a1112;
  --info: #38bdf8;
  --info-soft: #102433;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow: 0 4px 12px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .45);
  --header-bg: rgba(17, 21, 30, .85);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color .12s;
}
a:hover { color: var(--primary-hover); }

code {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-2);
}

/* ===== 主题切换按钮 ===== */
/* 主题切换按钮 + header 操作组合 — 见下方 .header-actions */

/* ===== 顶栏 ===== */
header {
  background: var(--header-bg);
  backdrop-filter: blur(8px) saturate(150%);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  border-bottom: 1px solid var(--header-border);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
  z-index: 200;
  isolation: isolate;
}
body { padding-top: 64px; }
header h1 a { position: relative; z-index: 1; }
header h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  letter-spacing: -0.01em;
}
header h1 a { color: inherit; }
header h1 a:hover { color: var(--primary); }
header h1 .brand {
  font-weight: 700;
  letter-spacing: .03em;
}
header h1 .sub {
  color: var(--text-3);
  font-weight: 500;
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
}
header h1 .divider {
  color: var(--text-3);
  font-weight: 300;
  margin: 0 2px;
}
header h1 .back-link {
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  background: var(--surface);
  transition: all .12s;
}
header h1 .back-link:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-2);
}
/* ===== Header 右侧操作组（grid 布局，hitbox 严格按列） ===== */
.header-actions {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: stretch;
  height: 36px;
  column-gap: 4px;
}
.header-user {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--text-3);
  padding: 0 10px 0 4px;
  border-right: 1px solid var(--border);
  margin-right: 4px;
  line-height: 1;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-btn {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 32px;
  padding: 0 14px;
  margin: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background .14s, color .14s, border-color .14s;
}
.header-btn:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
}
.header-btn.is-icon {
  width: 32px;
  padding: 0;
}
.header-btn.is-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}
.header-btn-danger { color: var(--text-3); }
.header-btn-danger:hover {
  color: var(--error);
  background: rgba(239, 68, 68, .08);
  border-color: rgba(239, 68, 68, .25);
}
:root[data-theme="dark"] .header-btn-danger:hover {
  background: rgba(239, 68, 68, .14);
}

/* ===== 主区域 ===== */
main {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 28px;
}
.page-toolbar {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 0 28px;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: all .12s;
}
.back-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-2);
}
.page-toolbar + main { margin-top: 14px; }

/* ===== 卡片 ===== */
section, .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
section h2, .card h2 {
  margin: 0;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  letter-spacing: -0.01em;
}
section > *:not(h2):not(table), .card > *:not(h2):not(table) {
  padding-left: 24px; padding-right: 24px;
}
section > form, .card > form { padding: 18px 24px; }

/* ===== 上传卡片 ===== */
.upload-card form {
  display: flex; flex-direction: column; gap: 14px;
}

/* ===== 模式选择 ===== */
.mode-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 24px;
}
.mode-picker input[type=radio] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.mode-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.mode-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.mode-picker input[type=radio]:checked + .mode-card {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.mode-picker input[type=radio]:checked + .mode-card::before {
  content: '';
  position: absolute;
  top: 14px; right: 14px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: inset 0 0 0 3px #fff;
}
.mode-picker input[type=radio]:not(:checked) + .mode-card::before {
  content: '';
  position: absolute;
  top: 14px; right: 14px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
}
.mode-head { display: flex; align-items: center; gap: 10px; }
.mode-icon { display: none; }
.mode-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.mode-desc {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

/* ===== 步骤标签 ===== */
.step-label {
  margin: 18px 24px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.step-hint {
  font-size: 11px;
  color: var(--warning);
  font-weight: 400;
  margin-left: 4px;
}

.mode-picker.is-disabled .mode-card {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}
.mode-picker.flash-attention .mode-card {
  animation: flash-attn .6s ease 2;
}
@keyframes flash-attn {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 3px rgba(220, 38, 38, .25); border-color: var(--error); }
}

/* ===== 拖拽上传 ===== */
.dropzone {
  margin: 4px 24px 0;
  padding: 32px 22px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  background: var(--surface);
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.dropzone-icon { display: none; }
.dropzone-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.dropzone-hint {
  font-size: 12px;
  color: var(--text-3);
}

/* ===== 上传列表 ===== */
.upload-list {
  margin: 14px 24px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.upload-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.upload-list-summary { color: var(--text-2); }
.upload-list-actions { display: flex; gap: 8px; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .12s;
  font-family: inherit;
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-2);
}
.btn-ghost:disabled, .btn-cyber:disabled, .upload-submit:disabled {
  opacity: .45; cursor: not-allowed;
}

.upload-items {
  list-style: none; margin: 0; padding: 0;
  max-height: 360px; overflow-y: auto;
}
.upload-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.upload-item:last-child { border-bottom: 0; }
.upload-item:hover { background: var(--surface-2); }
.upload-item-row {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px;
}
.upload-item-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.upload-item-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.upload-item-size {
  color: var(--text-3);
  font-size: 11px;
  font-family: var(--font-mono);
}
.upload-item-status {
  display: flex; align-items: center; gap: 8px;
}
.status-tag {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tag-pending { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.tag-active  { background: var(--info-soft); color: var(--info); border-color: rgba(2,132,199,.2); }
.tag-done    { background: var(--success-soft); color: var(--success); border-color: rgba(22,163,74,.2); }
.tag-fail    { background: var(--error-soft); color: var(--error); border-color: rgba(220,38,38,.2); }

.upload-item-link {
  font-size: 12px;
  color: var(--primary);
}
.upload-item-remove {
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all .12s;
}
.upload-item-remove:hover {
  color: var(--error);
  background: var(--error-soft);
}

/* ===== 进度条 ===== */
#upload-progress { padding: 16px 24px 20px; }
.progress-bar {
  width: 100%; height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: var(--primary);
  transition: width .15s linear;
}
.progress-status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-2);
}
.task-progress { margin: 14px 24px 18px; }
.upload-item-bar { margin-top: 6px; height: 3px; }
.upload-item.status-done .progress-fill,
.upload-item.status-done .upload-item-bar,
.upload-item.status-failed .upload-item-bar { display: none; }
.upload-item.status-queued .upload-item-bar { opacity: .35; }
#upload-progress.err-state .progress-fill { background: var(--error); }
#upload-progress.err-state .progress-status { color: var(--error); }

/* ===== 任务列表 ===== */
.tasks table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tasks th, .tasks td {
  padding: 12px 24px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.tasks tbody tr:last-child td { border-bottom: 0; }
.tasks th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text-2);
  font-size: 12px;
  letter-spacing: 0;
}
.tasks tr { transition: background .1s; }
.tasks tbody tr:hover { background: var(--surface-2); }
.tasks td a { color: var(--primary); font-weight: 500; }
.tasks td:first-child {
  font-family: var(--font-mono);
  color: var(--text-2);
  font-size: 12px;
}
.tasks td.ip-cell, .tasks td.ts-cell {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}

/* ===== 状态徽章 ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.badge.status-uploaded, .badge.status-queued {
  background: var(--surface-2); color: var(--text-2); border-color: var(--border);
}
.badge.status-processing, .badge.status-agent_chat {
  background: var(--info-soft); color: var(--info); border-color: rgba(2,132,199,.2);
}
.badge.status-ready_review, .badge.status-ready_to_post {
  background: var(--warning-soft); color: var(--warning); border-color: rgba(217,119,6,.2);
}
.badge.status-forwarded, .badge.status-done, .badge.status-posted {
  background: var(--success-soft); color: var(--success); border-color: rgba(22,163,74,.2);
}
.badge.status-failed, .badge.status-post_failed {
  background: var(--error-soft); color: var(--error); border-color: rgba(220,38,38,.2);
}
.badge.status-cancelled {
  background: var(--surface-2); color: var(--text-3); border-color: var(--border);
}

.badge.role-super {
  background: var(--primary-soft); color: var(--primary); border-color: rgba(79,70,229,.2);
}
.badge.role-admin {
  background: var(--info-soft); color: var(--info); border-color: rgba(2,132,199,.2);
}
.badge.role-member {
  background: var(--surface-2); color: var(--text-2); border-color: var(--border);
}

/* ===== 主操作按钮 ===== */
.upload-submit, .btn-cyber, .login button {
  align-self: flex-start;
  padding: 9px 18px;
  background: var(--primary);
  color: var(--primary-text);
  border: 0;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s;
}
.upload-submit:hover:not(:disabled),
.btn-cyber:hover:not(:disabled),
.login button:hover {
  background: var(--primary-hover);
}

/* 危险按钮 */
button.danger {
  padding: 7px 12px;
  background: transparent;
  color: var(--error);
  border: 1px solid var(--error);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .12s;
}
button.danger:hover {
  background: var(--error);
  color: #fff;
}

/* 普通按钮（非主、非险） */
section button:not(.danger):not([type=submit]),
.tasks button:not(.danger) {
  padding: 6px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .12s;
}
section button:not(.danger):not([type=submit]):hover,
.tasks button:not(.danger):hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

/* ===== 任务详情 ===== */
.task-view {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}
.meta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  height: fit-content;
  font-size: 13px;
  position: sticky;
  top: 80px;
  box-shadow: var(--shadow-sm);
}
.meta div {
  margin-bottom: 14px;
  line-height: 1.5;
  color: var(--text);
}
.meta div:last-child { margin-bottom: 0; }
.meta strong {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: .02em;
}
.meta .actions {
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.task-main { display: flex; flex-direction: column; gap: 16px; }

/* ===== Stepper ===== */
.stepper {
  list-style: none;
  display: flex;
  padding: 16px 24px;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: 8px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
.stepper li {
  flex: 1;
  min-width: 110px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  position: relative;
  transition: all .15s;
}
.stepper li.done {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(22, 163, 74, .25);
}
.stepper li.done::after {
  content: '';
  display: inline-block;
  width: 4px; height: 7px;
  border: solid var(--success);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translate(-1px, -2px);
  margin-left: 4px;
}
.stepper li.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}
.stepper.failed li:not(.done) {
  background: var(--error-soft);
  color: var(--error);
  border-color: rgba(220, 38, 38, .2);
}

/* ===== 成品预览 ===== */
.preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}
.preview-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.preview h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.preview video {
  width: 100%; max-height: 480px;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.preview .shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.preview .shots img {
  width: 100%; height: auto;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  transition: all .15s;
  border: 1px solid var(--border);
}
.preview .shots a:hover img {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.preview .caption {
  margin-top: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
}
.preview .caption summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  list-style: none;
}
.preview .caption summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  transition: transform .12s;
}
.preview .caption[open] summary::before { transform: rotate(90deg); }
.preview .caption pre {
  margin: 12px 0 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}
.dl-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: var(--primary);
  color: var(--primary-text);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all .12s;
}
.dl-btn:hover {
  background: var(--primary-hover);
  color: var(--primary-text);
}

/* ===== 聊天 ===== */
.chat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  min-height: 240px;
  box-shadow: var(--shadow-sm);
}
.msg {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border);
  background: var(--surface-2);
}
.msg .who {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 6px;
  letter-spacing: .02em;
}
.msg pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
}
.agent-system .who { color: var(--text-3); }
.agent-system pre { color: var(--text-2); }
.agent-writer {
  border-left-color: var(--primary);
  background: var(--primary-soft);
}
.agent-writer .who { color: var(--primary); }
.agent-reviewer {
  border-left-color: var(--success);
  background: var(--success-soft);
}
.agent-reviewer .who { color: var(--success); }
.agent-reviewer pre {
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ===== 提示 ===== */
.err {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--error-soft);
  border: 1px solid rgba(220, 38, 38, .2);
  border-left: 3px solid var(--error);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 13px;
}
.ok {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--success-soft);
  border: 1px solid rgba(22, 163, 74, .2);
  border-left: 3px solid var(--success);
  border-radius: var(--radius-sm);
  color: var(--success);
  font-size: 13px;
}
.hint {
  color: var(--text-3);
  font-size: 12px;
  margin-top: 8px;
  line-height: 1.55;
}
.dim { color: var(--text-3); }

/* ===== 登录页（双栏：左卡片 + 右流水线动画） ===== */
body.login-body {
  margin: 0 !important;
  padding: 0 !important;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  /* 全屏沉浸式深色背景 */
  background:
    radial-gradient(at 30% 30%, rgba(99,102,241,.18), transparent 55%),
    radial-gradient(at 75% 70%, rgba(67,56,202,.25), transparent 55%),
    linear-gradient(135deg, #0a0d14 0%, #1a1f2e 60%, #1e1b4b 100%);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.login-brand-mark {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.login-brand-text { display: flex; flex-direction: column; gap: 2px; }
.login-brand-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg,
    #a5b4fc 0%,
    #c084fc 25%,
    #67e8f9 50%,
    #fbbf24 75%,
    #a5b4fc 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: neonShift 4.5s linear infinite;
  filter: drop-shadow(0 0 6px rgba(165, 180, 252, .55))
          drop-shadow(0 0 12px rgba(192, 132, 252, .35));
}
.login-brand-sub {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: .02em;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field-label {
  font-size: 12px;
  font-weight: 500;
  color: #cbd5e1;
  letter-spacing: .02em;
}
.login-field input {
  appearance: none;
  width: 100%;
  height: 42px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: #f8fafc;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  transition: border-color .14s, box-shadow .14s, background .14s;
  box-sizing: border-box;
}
.login-field input::placeholder { color: #64748b; }
.login-field input:focus {
  outline: none;
  border-color: #818cf8;
  background: rgba(255, 255, 255, .1);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, .2);
}
.login-err {
  padding: 9px 12px;
  font-size: 12px;
  color: var(--error);
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: 6px;
}
.login-submit {
  appearance: none;
  font: inherit;
  height: 44px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: filter .14s, transform .08s, box-shadow .14s;
  box-shadow: 0 4px 12px rgba(67,56,202,.25);
}
.login-submit:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(67,56,202,.32); }
.login-submit:active { transform: translateY(1px); }
.login-foot-text {
  margin: 0;
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  letter-spacing: .04em;
}

/* ── 全屏动画舞台 ── */
.login-stage {
  position: relative;
  overflow: hidden;
  background: transparent;
  color: #fff;
  width: 100vw;
  height: 100vh;
}

/* ── 代码雨背景（极轻，做氛围） ── */
.code-rain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  opacity: .25;
}
.rain-col {
  position: absolute;
  top: -20%;
  width: 90px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: #a5b4fc;
  white-space: pre;
  text-align: left;
  animation: rainFall linear infinite;
  text-shadow: 0 0 6px #6366f1;
}
@keyframes rainFall {
  0%   { transform: translateY(-20%); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(120vh); opacity: 0; }
}

/* ── 左上：网络雷达 ── */
.radar-card {
  position: absolute;
  top: 70px;
  left: 28px;
  z-index: 4;
  padding: 12px;
  background: rgba(15, 23, 42, .55);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
  width: 150px;
}
.radar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.radar-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  color: #94a3b8;
}
.radar-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: badgePulse 2s ease-in-out infinite;
}
.radar {
  position: relative;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.1) 0%, rgba(15,23,42,.6) 70%);
  border: 1px solid rgba(99,102,241,.3);
  overflow: hidden;
}
.radar-sweep {
  position: absolute;
  top: 50%; left: 50%;
  width: 50%; height: 50%;
  transform-origin: 0% 0%;
  background: conic-gradient(from 0deg, rgba(165,180,252,.4), transparent 30%);
  animation: radarSweep 3s linear infinite;
}
@keyframes radarSweep {
  0%   { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}
.radar-rings { position: absolute; inset: 0; }
.rr {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(165,180,252,.25);
  border-radius: 50%;
}
.rr-1 { width: 30%; height: 30%; }
.rr-2 { width: 60%; height: 60%; }
.rr-3 { width: 90%; height: 90%; }
.radar-center {
  position: absolute;
  top: 50%; left: 50%;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #a5b4fc;
  box-shadow: 0 0 8px #a5b4fc;
}
.radar-blip {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: blipPulse 2s ease-in-out infinite;
}
.rb-1 { top: 25%; left: 70%; animation-delay: .2s; }
.rb-2 { top: 65%; left: 30%; animation-delay: .9s; }
.rb-3 { top: 75%; left: 70%; animation-delay: 1.4s; }
@keyframes blipPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(.6); opacity: .4; }
}
.radar-foot {
  margin-top: 6px;
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
  letter-spacing: .04em;
}

/* ── 活动 ticker ── */
.activity-ticker {
  position: absolute;
  top: 56px;
  left: 200px;
  right: 200px;
  z-index: 4;
  overflow: hidden;
  padding: 6px 0;
  border-top: 1px solid rgba(99,102,241,.15);
  border-bottom: 1px solid rgba(99,102,241,.15);
  background: rgba(15, 23, 42, .35);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.ticker-track {
  display: inline-flex;
  gap: 36px;
  white-space: nowrap;
  animation: tickerScroll 42s linear infinite;
  padding-left: 100%;
}
.ticker-track span {
  font-size: 12px;
  color: #cbd5e1;
  letter-spacing: .03em;
}
@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ── 进行中任务卡片 ── */
.task-cards {
  position: absolute;
  left: 28px;
  bottom: 110px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 200px;
}
.task-card {
  padding: 10px 14px;
  background: rgba(15, 23, 42, .55);
  border: 1px solid rgba(99,102,241,.22);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.tc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 11px;
}
.tc-name {
  color: #cbd5e1;
  font-weight: 500;
  font-family: var(--font-mono);
}
.tc-pct {
  color: #a5b4fc;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tc-bar {
  height: 4px;
  background: rgba(255,255,255,.08);
  border-radius: 2px;
  overflow: hidden;
}
.tc-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #a5b4fc);
  border-radius: 2px;
  transition: width .3s ease;
  box-shadow: 0 0 8px rgba(165,180,252,.5);
}

/* ── 点击交互系统 ── */
.stage-ripples {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  overflow: hidden;
}
.ripple {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c, rgba(129,140,248,.4));
  border: 1px solid var(--c, rgba(129,140,248,.4));
  transform: translate(-50%, -50%);
  animation: rippleOut .9s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleOut {
  0%   { width: 8px; height: 8px; opacity: 1; }
  100% { width: 220px; height: 220px; opacity: 0; }
}
.burst {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: burstFly .7s ease-out forwards;
  pointer-events: none;
}
@keyframes burstFly {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2); opacity: 0; }
}
.confetti {
  position: absolute;
  width: 8px; height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 2px;
  animation: confettiFall 1.1s ease-out forwards;
  pointer-events: none;
}
@keyframes confettiFall {
  0%   { transform: translate(-50%, -50%) rotate(0); opacity: 1; }
  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 80px)) rotate(540deg);
    opacity: 0;
  }
}

/* 元素互动反馈：让传送带物品和成品可点击 */
.item, .out-item, .machine, .worker, .model-badge, .stat-block, .ft {
  pointer-events: auto;
}
.item, .out-item, .machine, .worker {
  cursor: pointer;
}
.item-tapped {
  animation: itemTap .3s ease-out;
}
@keyframes itemTap {
  0%   { transform: scale(1); filter: brightness(1); }
  50%  { transform: scale(1.4); filter: brightness(1.5); }
  100% { transform: scale(1); filter: brightness(1); }
}
.out-item-tapped {
  animation: outTap .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes outTap {
  0%   { transform: scale(1) rotate(0); }
  50%  { transform: scale(1.5) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}
.machine-zap {
  animation: machineShake .7s ease-in-out;
}
@keyframes machineShake {
  0%, 100% { transform: translate(-50%, -50%); }
  10%      { transform: translate(calc(-50% - 4px), -50%) rotate(-1deg); }
  20%      { transform: translate(calc(-50% + 5px), -50%) rotate(1deg); }
  30%      { transform: translate(calc(-50% - 3px), calc(-50% + 2px)); }
  40%      { transform: translate(calc(-50% + 3px), calc(-50% - 2px)); }
  60%      { transform: translate(-50%, -50%); }
}
.machine-zap .machine-glow {
  filter: brightness(2);
}
.worker-wave .arm-right {
  animation: armWave .35s ease-in-out infinite alternate !important;
}
@keyframes armWave {
  0%   { transform: rotate(0); }
  100% { transform: rotate(-65deg); }
}
.worker-speech {
  position: absolute;
  left: 38%;
  top: calc(50% - 80px);
  transform: translate(-50%, 0) scale(.7);
  z-index: 8;
  padding: 8px 14px;
  background: #fff;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity .25s, transform .25s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.worker-speech::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border: 6px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
}
.worker-speech.show {
  opacity: 1;
  transform: translate(-50%, -8px) scale(1);
}
.mb-tapped {
  animation: mbTap .5s ease-out;
}
@keyframes mbTap {
  0%   { transform: scale(1); border-color: rgba(129,140,248,.25); }
  40%  { transform: scale(1.15); border-color: #10b981; box-shadow: 0 0 0 6px rgba(16,185,129,.25); }
  100% { transform: scale(1); border-color: rgba(129,140,248,.25); }
}
.stat-bump {
  animation: statBump .45s cubic-bezier(.34,1.56,.64,1);
}
@keyframes statBump {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
.ft-tapped {
  animation: ftTap .6s ease-in-out;
}
@keyframes ftTap {
  0%, 100% { transform: scale(1) rotate(0); }
  50%      { transform: scale(1.15) rotate(-3deg); background: rgba(99,102,241,.3); }
}

/* Toast 提示 */
.stage-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translate(-50%, -8px);
  z-index: 100;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(15, 23, 42, .85);
  border: 1px solid #a5b4fc;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity .22s, transform .22s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.stage-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── 背景粒子 ── */
.stage-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.particle {
  position: absolute;
  background: #818cf8;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor, 0 0 12px currentColor;
  color: #a5b4fc;
  animation: drift 14s linear infinite;
}
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1);   opacity: 0; }
  10%  {                                          opacity: var(--op, .7); }
  50%  { transform: translate(40px, -60px) scale(1.2); }
  90%  {                                          opacity: var(--op, .7); }
  100% { transform: translate(80px, -120px) scale(.6); opacity: 0; }
}

/* ── AI 模型徽章浮动 ── */
.model-badges {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.model-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #e0e7ff;
  background: rgba(30, 27, 75, .55);
  border: 1px solid rgba(129, 140, 248, .25);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,.3), 0 0 0 1px rgba(99,102,241,.15);
  animation: badgeFloat 7s ease-in-out infinite;
}
.mb-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { opacity: 1;  transform: scale(1); }
  50%      { opacity: .6; transform: scale(1.3); }
}
@keyframes badgeFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
.mb-1 { top: 22%; left: 6%;   animation-delay: 0s; }
.mb-2 { top: 38%; left: 11%;  animation-delay: .9s; }
.mb-3 { top: 30%; right: 8%;  animation-delay: 1.6s; }
.mb-4 { top: 48%; right: 5%;  animation-delay: 2.4s; }
.mb-5 { top: 64%; left: 8%;   animation-delay: 3.1s; }

/* ── 实时计数器面板 ── */
.stage-stats {
  position: absolute;
  bottom: 110px;
  right: 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 4;
}
.stat-block {
  min-width: 160px;
  padding: 12px 16px;
  background: rgba(15, 23, 42, .55);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.stat-label {
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #fff, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── 打字机光标 ── */
.typed-caret {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: #a5b4fc;
  margin-left: 4px;
  vertical-align: -3px;
  animation: caretBlink 0.85s steps(2, end) infinite;
}
@keyframes caretBlink {
  0%, 49%  { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ── 机器能量环 ── */
.machine-ring {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(129, 140, 248, .5);
  pointer-events: none;
}
.ring-1 {
  width: 180px; height: 180px;
  margin: -90px 0 0 -90px;
  animation: ringPulse 3.2s ease-out infinite;
}
.ring-2 {
  width: 220px; height: 220px;
  margin: -110px 0 0 -110px;
  animation: ringPulse 3.2s ease-out infinite 1.1s;
}
@keyframes ringPulse {
  0%   { transform: scale(.7); opacity: .8; border-width: 2px; }
  100% { transform: scale(1.3); opacity: 0;  border-width: 1px; }
}

/* ── 进入按钮脉冲提示 ── */
.stage-enter-btn.pulse {
  animation: btnPulse 1.4s ease-out;
}
@keyframes btnPulse {
  0%   { box-shadow: 0 4px 16px rgba(67,56,202,.4), 0 0 0 0 rgba(129,140,248,.55); }
  100% { box-shadow: 0 4px 16px rgba(67,56,202,.4), 0 0 0 20px rgba(129,140,248,0); }
}

/* 顶部品牌 + 进入按钮（顶端超长光晕，280px 渐变到 0，0 边界感） */
.stage-top {
  position: absolute !important;   /* 覆盖全局 header position: sticky */
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  z-index: 5;
  isolation: isolate;
  /* 覆盖全局 header 的「银灰」干扰 */
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  width: auto !important;           /* 全局 header 有 width:100% */
  box-sizing: border-box;
}
.stage-top::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 280px;            /* 比 banner 高 5 倍多，渐变足够缓 */
  pointer-events: none;
  z-index: -1;
  /* 用 body 主色 #0a0d14（深蓝黑），加深顶部一点点，色调完全跟 body 一致 */
  background: linear-gradient(180deg,
    rgba(10, 13, 20, .55) 0%,
    rgba(10, 13, 20, .30) 30%,
    rgba(10, 13, 20, .12) 60%,
    transparent            100%);
}
.stage-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.stage-brand svg {
  width: 28px; height: 28px;
}
.stage-brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg,
    #a5b4fc 0%,
    #c084fc 25%,
    #67e8f9 50%,
    #fbbf24 75%,
    #a5b4fc 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: neonShift 4.5s linear infinite;
  filter: drop-shadow(0 0 6px rgba(165, 180, 252, .55))
          drop-shadow(0 0 12px rgba(192, 132, 252, .35));
}
@keyframes neonShift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.stage-enter-btn {
  appearance: none;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  border: 1px solid rgba(165, 180, 252, .4);
  border-radius: 999px;
  cursor: pointer;
  transition: transform .14s, box-shadow .14s, filter .14s;
  box-shadow:
    0 4px 14px rgba(67, 56, 202, .4),
    0 0 0 1px rgba(99, 102, 241, .3),
    inset 0 1px 0 rgba(255, 255, 255, .15);
}
.stage-enter-btn svg { width: 14px; height: 14px; }
.stage-enter-btn:hover {
  filter: brightness(1.1);
  box-shadow:
    0 6px 24px rgba(67, 56, 202, .55),
    0 0 0 1px rgba(99, 102, 241, .5),
    inset 0 1px 0 rgba(255, 255, 255, .2);
  transform: translateY(-1px);
}
.stage-enter-btn:active { transform: translateY(1px); }

/* 调整动画在全屏下的位置 */
.stage-headline { top: 14% !important; }
.stage-line { top: 50% !important; }
.stage-features { bottom: 40px !important; }
.stage-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 50% 50%, rgba(99,102,241,.08), transparent 70%);
  pointer-events: none;
}
.stage-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,.06) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  opacity: .6;
}

.stage-headline {
  position: absolute;
  top: 48px; left: 0; right: 0;
  text-align: center;
  z-index: 2;
}
.stage-headline h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stage-headline p {
  margin: 8px 0 0;
  font-size: 13px;
  color: #94a3b8;
  letter-spacing: .04em;
}

/* 流水线核心 */
.stage-line {
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 200px;
  transform: translateY(-50%);
  z-index: 1;
}

/* 传送带：贯穿到中段（机器）之前 */
.belt {
  position: absolute;
  left: 4%;
  right: 42%;
  top: 50%;
  height: 28px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, #1e293b, #0f172a);
  border-radius: 6px;
  border: 1px solid #334155;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  overflow: visible;
}
/* 传送带表面：移动的斜纹（模拟运动）*/
.belt-surface {
  position: absolute;
  inset: 2px;
  border-radius: 4px;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(99,102,241,.12) 0 6px,
    transparent 6px 14px
  );
  animation: beltMove 1.5s linear infinite;
}
@keyframes beltMove {
  0%   { background-position: 0 0; }
  100% { background-position: 28px 0; }
}

/* 传送带支腿 */
.belt::before, .belt::after {
  content: ""; position: absolute; bottom: -16px;
  width: 6px; height: 18px;
  background: linear-gradient(180deg, #334155, #1e293b);
  border-radius: 0 0 3px 3px;
}
.belt::before { left: 8%; }
.belt::after  { right: 8%; }

/* 传送带上的素材 */
.item {
  position: absolute;
  top: -22px;
  left: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: linear-gradient(135deg, #fff, #e0e7ff);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,.4), 0 0 0 2px rgba(99,102,241,.4);
  animation: itemTravel 9s linear infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}
@keyframes itemTravel {
  0%   { transform: translateX(0)     scale(.8); opacity: 0; }
  4%   {                                          opacity: 1; }
  60%  { transform: translateX(640%)  scale(1);  opacity: 1; }
  72%  { transform: translateX(720%)  scale(.6); opacity: 0; }  /* 进入机器消失 */
  100% { transform: translateX(720%)  scale(0);  opacity: 0; }
}

/* 机器（中段：处理装置）*/
.machine {
  position: absolute;
  left: 52%;
  top: 50%;
  width: 130px;
  height: 130px;
  transform: translate(-50%, -50%);
  z-index: 3;
}
.machine-body {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border: 2px solid #4338ca;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 1px rgba(99,102,241,.4),
    0 12px 40px rgba(67,56,202,.5),
    inset 0 0 30px rgba(99,102,241,.2);
}
.machine-glow {
  position: absolute;
  inset: -8px;
  border-radius: 22px;
  background: radial-gradient(circle, rgba(99,102,241,.6), transparent 70%);
  filter: blur(12px);
  animation: machineGlow 2s ease-in-out infinite alternate;
  z-index: -1;
}
@keyframes machineGlow {
  0%   { opacity: .5; transform: scale(.95); }
  100% { opacity: 1;  transform: scale(1.1);  }
}
.machine-gears {
  display: flex;
  gap: 4px;
  font-size: 28px;
  filter: drop-shadow(0 0 6px rgba(165,180,252,.6));
}
.gear-1 { animation: spinFwd 3s linear infinite; }
.gear-2 { animation: spinRev 4s linear infinite; }
@keyframes spinFwd { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes spinRev { from { transform: rotate(360deg); } to { transform: rotate(0); } }
.machine-label {
  margin-top: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .2em;
  color: #a5b4fc;
}
/* 火花 */
.spark {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 12px #fbbf24;
}
.spark-1 { top: -8px; left: 20%; animation: spark 1.2s ease-out infinite .0s; }
.spark-2 { top: -4px; left: 50%; animation: spark 1.2s ease-out infinite .4s; }
.spark-3 { top: -6px; left: 78%; animation: spark 1.2s ease-out infinite .8s; }
@keyframes spark {
  0%   { transform: translateY(0) scale(.5); opacity: 0; }
  30%  { transform: translateY(-12px) scale(1); opacity: 1; }
  100% { transform: translateY(-36px) scale(.4); opacity: 0; }
}

/* 出料区：成品 */
.output-zone {
  position: absolute;
  left: 60%;
  right: 4%;
  top: 50%;
  height: 60px;
  transform: translateY(-50%);
}
.out-item {
  position: absolute;
  top: 50%;
  left: 0;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 10px;
  box-shadow:
    0 4px 14px rgba(0,0,0,.4),
    0 0 0 2px rgba(251,191,36,.5),
    0 0 24px rgba(251,191,36,.4);
  animation: outEmerge 9s linear infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}
@keyframes outEmerge {
  0%   { transform: translateX(0)    scale(0)  rotate(-20deg); opacity: 0; }
  8%   { transform: translateX(40%)  scale(1.4) rotate(10deg); opacity: 1; }
  18%  { transform: translateX(80%)  scale(1)   rotate(0);    opacity: 1; }
  85%  { transform: translateX(700%) scale(1);                 opacity: 1; }
  100% { transform: translateX(800%) scale(.7);                opacity: 0; }
}

/* 工人 Agent */
.worker {
  position: absolute;
  left: 38%;
  top: 50%;
  transform: translate(-50%, 8%);
  z-index: 4;
}
.worker-body {
  animation: workerBob 2.4s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.4));
}
@keyframes workerBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
.arm-left  { animation: armLeft  1.6s ease-in-out infinite; transform-origin: 12px 36px; }
.arm-right { animation: armRight 1.6s ease-in-out infinite; transform-origin: 48px 36px; }
@keyframes armLeft {
  0%, 100% { transform: rotate(0); }
  50%      { transform: rotate(-15deg); }
}
@keyframes armRight {
  0%, 100% { transform: rotate(0); }
  50%      { transform: rotate(15deg); }
}

/* 底部 features */
.stage-features {
  position: absolute;
  bottom: 40px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 24px;
  z-index: 2;
  flex-wrap: wrap;
  padding: 0 20px;
}
.ft {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 12px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, .6);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.ft-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}
.ft-dot-a { background: #c4b5fd; box-shadow: 0 0 8px #c4b5fd; }
.ft-dot-b { background: #6ee7b7; box-shadow: 0 0 8px #6ee7b7; }
.ft-dot-c { background: #a5b4fc; box-shadow: 0 0 8px #a5b4fc; }
.ft-dot-d { background: #fcd34d; box-shadow: 0 0 8px #fcd34d; }

/* ── 维护页（沿用 stage 框架 + 中央卡） ── */
.maint-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #fbbf24;
  background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .35);
  border-radius: 999px;
  letter-spacing: .02em;
}
.maint-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
  animation: badgePulse 1.6s ease-in-out infinite;
}

/* 维护期间流水线动画放慢一半 */
.maint-line .item, .maint-line .out-item { animation-duration: 18s !important; }
.maint-line .belt-surface { animation-duration: 2.4s !important; }
.maint-machine .machine-glow { animation-duration: 3.6s !important; }
.maint-machine .gear-1 { animation-duration: 6s !important; }
.maint-machine .gear-2 { animation-duration: 8s !important; }

/* 中央维护卡 */
.maint-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: 100%;
  max-width: 420px;
  padding: 0 20px;
}
.maint-card {
  padding: 36px 32px;
  background: linear-gradient(135deg, rgba(30, 27, 75, .92), rgba(15, 23, 42, .94));
  border: 1px solid rgba(99, 102, 241, .35);
  border-radius: 18px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, .5),
    0 0 0 1px rgba(99, 102, 241, .25),
    inset 0 1px 0 rgba(255, 255, 255, .08);
  text-align: center;
}
.maint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .35);
  margin-bottom: 18px;
  animation: maintIconSpin 4s linear infinite;
}
@keyframes maintIconSpin {
  0%   { transform: rotate(0); }
  20%  { transform: rotate(0); }
  40%  { transform: rotate(15deg); }
  60%  { transform: rotate(-15deg); }
  80%  { transform: rotate(8deg); }
  100% { transform: rotate(0); }
}
.maint-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.01em;
}
.maint-sub {
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.7;
  color: #94a3b8;
}
.maint-progress {
  margin-bottom: 20px;
}
.maint-progress-bar {
  height: 4px;
  background: rgba(255,255,255,.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}
.maint-progress-fill {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, #6366f1, #fbbf24);
  border-radius: 2px;
  animation: maintProgressSlide 2.4s ease-in-out infinite;
}
@keyframes maintProgressSlide {
  0%   { transform: translateX(-120%); width: 30%; }
  50%  { transform: translateX(180%);  width: 40%; }
  100% { transform: translateX(420%);  width: 30%; }
}
.maint-progress-label {
  font-size: 11px;
  color: #64748b;
  letter-spacing: .04em;
}
.maint-foot {
  font-size: 11px;
  color: #64748b;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 16px;
  margin-top: 8px;
}
.maint-foot a {
  color: #a5b4fc;
}
.maint-login-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #fff !important;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  border-radius: 999px;
  text-decoration: none;
  transition: filter .14s, transform .08s;
  box-shadow: 0 4px 14px rgba(67,56,202,.35);
}
.maint-login-link:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ── 登录弹窗 ── */
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-modal[hidden] { display: none; }
.login-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 13, 20, .7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .22s ease;
}
.login-modal.is-open .login-modal-backdrop { opacity: 1; }
.login-modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  padding: 36px 32px;
  background: linear-gradient(135deg, rgba(30, 27, 75, .9), rgba(15, 23, 42, .92));
  border: 1px solid rgba(99, 102, 241, .35);
  border-radius: 18px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, .5),
    0 0 0 1px rgba(99, 102, 241, .25),
    inset 0 1px 0 rgba(255, 255, 255, .08);
  display: flex;
  flex-direction: column;
  gap: 24px;
  transform: translateY(16px) scale(.96);
  opacity: 0;
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), opacity .18s ease;
}
.login-modal.is-open .login-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.login-modal-close {
  appearance: none;
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 22px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.login-modal-close:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, .08);
}

/* 窄屏：缩小动画文字 */
@media (max-width: 700px) {
  .stage-headline h2 { font-size: 22px; }
  .stage-headline p { font-size: 12px; }
  .stage-top { padding: 16px 20px; }
  .stage-enter-btn { padding: 9px 16px; font-size: 13px; }
}

/* ===== 管理面板 ===== */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  max-width: 1000px;
  margin: 28px auto;
}
.admin-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  transition: all .15s;
  box-shadow: var(--shadow-sm);
}
.admin-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  color: var(--text);
}
.admin-card h2 {
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  font-size: 15px;
  font-weight: 600;
  background: transparent;
  color: var(--text);
}
.admin-card p {
  margin: 0;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.5;
}
.admin-card-toggle {
  cursor: default;
}
.admin-card-toggle:hover { transform: none; }
.admin-card-toggle button {
  margin-top: 14px;
  width: 100%;
}
.admin-card-toggle.is-on {
  border-color: #d97706;
  background: linear-gradient(135deg, rgba(245,158,11,.08), var(--surface));
}
.maint-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-3);
  vertical-align: middle;
}
.admin-card-toggle.is-on .maint-badge {
  background: #f59e0b;
  color: #fff;
}

/* ===== 通用 input ===== */
.upload-card form input[type=text],
.upload-card form input[type=password],
.member-form input,
input[type=text],
input[type=password],
input[type=number],
select,
textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: all .12s;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
textarea {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
}

::selection { background: var(--primary); color: #fff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ===== 操作日志 ===== */
.logtable {
  display: flex; flex-direction: column;
}
.logrow {
  display: grid;
  grid-template-columns: 130px 70px 110px 120px 60px 1fr;
  gap: 12px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  align-items: center;
}
.logrow.no-ip {
  grid-template-columns: 130px 70px 110px 60px 1fr;
}
.logrow:last-child { border-bottom: 0; }
.logrow:hover { background: var(--surface-2); }
.logrow .ts { color: var(--text-3); }
.logrow .kind {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  text-align: center; border: 1px solid;
  text-transform: uppercase;
}
.log-audit .kind { color: var(--info); border-color: rgba(2,132,199,.25); background: var(--info-soft); }
.log-agent .kind { color: var(--primary); border-color: rgba(79,70,229,.25); background: var(--primary-soft); }
.log-system .kind { color: var(--text-3); border-color: var(--border); background: var(--surface-2); }
.logrow .actor { color: var(--text-2); }
.log-agent .actor { color: var(--primary); font-weight: 600; }
.logrow .task a { color: var(--primary); }
.logrow .text {
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--font-sans);
}
.logrow .ip { color: var(--text-2); font-size: 11px; }

.pager {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 14px 18px 18px;
  align-items: center;
}
.pager-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.pager-btn:hover { background: var(--surface-2); border-color: var(--primary); color: var(--primary); }
.pager-btn.current { background: var(--primary); border-color: var(--primary); color: #fff; cursor: default; }
.pager-btn.disabled { color: var(--text-3); background: var(--surface-2); cursor: not-allowed; pointer-events: none; }

/* ===== 添加成员表单 ===== */
.add-member { padding: 18px 24px 22px; }
.member-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.member-form .field {
  display: flex; flex-direction: column; gap: 6px;
  padding: 0 24px;
}
.add-member .member-form .field { padding: 0; }
.member-form .field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.member-form .field .hint { margin-top: 0; margin-bottom: 4px; }
.user-cell .user-name {
  font-weight: 500;
}
.actions-cell {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.inline { display: inline; }

/* ===== X cookie 上传按钮 ===== */
.upload-cookie-btn {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all .12s;
  text-decoration: none;
}
.upload-cookie-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

/* ===== 居中表单 ===== */
main.centered-form {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: 24px;
}
.form-card {
  width: 100%;
  max-width: 420px;
  margin: 0 !important;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form-card h2 {
  margin: 0;
  padding: 18px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.form-card .card-body {
  padding: 20px 24px 24px;
  display: flex; flex-direction: column; gap: 12px;
}

@media (max-width: 720px) {
  main, .page-toolbar { padding: 0 16px; margin: 16px auto; }
  header { padding: 12px 16px; }
  header h1 { font-size: 13px; gap: 6px; }
  .task-view { grid-template-columns: 1fr; }
  .meta { position: static; }
  .preview .shots { grid-template-columns: 1fr 1fr; }
  .mode-picker { grid-template-columns: 1fr; }
  .member-form-grid { grid-template-columns: 1fr; }
}

/* ===== Dashboard (hero + KPI + 4-card + recent) ===== */
.dashboard {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 28px 28px 40px;
  box-sizing: border-box;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, var(--primary-soft) 0%, var(--surface) 60%);
  padding: 26px 28px;
  margin-bottom: 22px;
}
:root[data-theme="dark"] .hero {
  background:
    linear-gradient(135deg, rgba(79,70,229,.18) 0%, var(--surface) 65%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-text { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.hero-text .hero-tokens { margin-top: 10px; }
.hero-greet {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .2px;
}
.hero-user {
  color: var(--primary);
}
.hero-sub {
  font-size: 13px;
  color: var(--text-2);
}
.hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.scope-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.scope-toggle-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border-radius: 5px;
  text-decoration: none;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.scope-toggle-btn:hover { color: var(--text); }
.scope-toggle-btn.is-active {
  background: var(--primary);
  color: #fff;
}
:root[data-theme="dark"] .scope-toggle-btn.is-active {
  background: var(--primary);
  color: #fff;
}

.hero-tokens {
  appearance: none;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .14s, background .14s;
}
.hero-tokens:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.hero-tokens-icon { font-size: 14px; }
.hero-tokens-label { color: var(--text-3); }
.hero-tokens-value {
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.hero-tokens-mine {
  font-size: 11px;
  color: var(--text-3);
  padding-left: 8px;
  border-left: 1px solid var(--border);
  margin-left: 2px;
  font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] .hero-tokens-value { color: #a5b4fc; }

/* Token breakdown modal */
.tokens-modal-box { max-width: 540px; width: 100%; }
.tokens-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tokens-table th,
.tokens-table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.tokens-table th { color: var(--text-3); font-weight: 500; font-size: 12px; }
.tokens-table td.num,
.tokens-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tokens-table td.num.strong { font-weight: 700; color: var(--primary); }
.tokens-table tr.is-me { background: var(--primary-soft); }
:root[data-theme="dark"] .tokens-table tr.is-me { background: rgba(79,70,229,.16); }
.tokens-table tfoot td { font-weight: 600; color: var(--text); border-bottom: 0; }
.tokens-me-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  padding: 1px 6px;
  background: var(--primary);
  color: #fff;
  border-radius: 4px;
}
.tokens-user { color: var(--text); font-weight: 500; }

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
}
.hero-status .status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success, #10b981);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .18);
  animation: pulseDot 2.4s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.30); }
  50%      { box-shadow: 0 0 0 6px rgba(16,185,129,.05); }
}
.hero-glow {
  position: absolute;
  inset: -40% -10% auto auto;
  width: 360px; height: 360px;
  background: radial-gradient(closest-side, rgba(79,70,229,.18), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}

/* KPI strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 980px) {
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .kpi-strip { grid-template-columns: 1fr; }
}
.kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  transition: border-color .15s, transform .15s;
}
.kpi:hover { border-color: var(--primary); transform: translateY(-1px); }
.kpi-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}
.kpi-icon svg { width: 20px; height: 20px; }
.kpi-icon[data-tone="violet"]  { background: #ede9fe; color: #7c3aed; }
.kpi-icon[data-tone="emerald"] { background: #d1fae5; color: #047857; }
.kpi-icon[data-tone="indigo"]  { background: #e0e7ff; color: #4338ca; }
.kpi-icon[data-tone="amber"]   { background: #fef3c7; color: #b45309; }
:root[data-theme="dark"] .kpi-icon[data-tone="violet"]  { background: rgba(124,58,237,.18); color: #c4b5fd; }
:root[data-theme="dark"] .kpi-icon[data-tone="emerald"] { background: rgba(4,120,87,.18);  color: #6ee7b7; }
:root[data-theme="dark"] .kpi-icon[data-tone="indigo"]  { background: rgba(67,56,202,.22); color: #a5b4fc; }
:root[data-theme="dark"] .kpi-icon[data-tone="amber"]   { background: rgba(180,83,9,.18);  color: #fcd34d; }
.kpi-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-label {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: .3px;
}
.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kpi-value.is-warn { color: var(--error); }

.scope-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  margin-left: 6px;
}

/* Section head shared */
.dash-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 4px 2px 14px;
}
.dash-section-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  border: none;
  padding: 0;
}
.dash-section-head span {
  font-size: 12px;
  color: var(--text-3);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1100px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .card-grid { grid-template-columns: 1fr; }
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: all .18s ease;
  cursor: pointer;
  position: relative;
  min-height: 180px;
  overflow: hidden;
}
.dash-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  opacity: 0;
  transition: opacity .2s;
}
.dash-card[data-tone="violet"]::before  { background: #7c3aed; }
.dash-card[data-tone="emerald"]::before { background: #10b981; }
.dash-card[data-tone="indigo"]::before  { background: #4338ca; }
.dash-card[data-tone="amber"]::before   { background: #d97706; }
.dash-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.dash-card:hover::before { opacity: 1; }
.dash-card:hover .dash-card-arrow { opacity: 1; transform: translate(2px, -2px); }

.dash-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-card-arrow {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-3);
  opacity: 0;
  transition: opacity .18s, transform .18s, color .18s;
}
.dash-card-arrow svg { width: 14px; height: 14px; }
.dash-card:hover .dash-card-arrow { color: var(--primary); }

/* Agent 聊天 (super admin private view) */
.dash-chat { margin-top: 32px; }
.agent-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  align-items: center;
}
.agent-tab {
  appearance: none;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  transition: background .14s, color .14s, border-color .14s;
}
.agent-tab:hover { color: var(--text); border-color: var(--border-strong); }
.agent-tab.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.agent-tab-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  color: inherit;
  opacity: .55;
  transition: opacity .14s, background .14s;
}
.agent-tab-del:hover {
  opacity: 1;
  background: rgba(239, 68, 68, .25);
}
.agent-add-btn {
  appearance: none;
  font: inherit;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: color .14s, border-color .14s, background .14s;
}
.agent-add-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}
.agent-memorian {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #b45309;
  background: #fef3c7;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(180,83,9,.25);
  user-select: none;
}
.memorian-status {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(255,255,255,.6);
  color: #92400e;
}
:root[data-theme="dark"] .agent-memorian {
  background: rgba(180,83,9,.2);
  color: #fcd34d;
  border-color: rgba(180,83,9,.35);
}
:root[data-theme="dark"] .memorian-status {
  background: rgba(0,0,0,.25);
  color: #fcd34d;
}
.agent-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 4px;
}
.memorian-cog {
  appearance: none;
  font: inherit;
  background: transparent;
  border: none;
  margin-left: 4px;
  width: 22px;
  height: 22px;
  font-size: 13px;
  color: inherit;
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: .7;
  transition: opacity .14s, background .14s;
}
.memorian-cog:hover {
  opacity: 1;
  background: rgba(0,0,0,.08);
}
:root[data-theme="dark"] .memorian-cog:hover { background: rgba(255,255,255,.12); }

.memorian-current {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: 6px;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
}

.chat-bubble-agent {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 4px;
  padding: 0 4px;
}
.chat-user .chat-bubble-agent { display: none; }

/* Agent 配置弹窗 */
.agent-modal-box {
  max-width: 480px;
  width: 100%;
}
.agent-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.agent-field { display: flex; flex-direction: column; gap: 4px; }
.agent-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.agent-field input,
.agent-field select,
.agent-field textarea {
  width: 100%;
  font-size: 13px;
  font-family: inherit;
  padding: 8px 12px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-sizing: border-box;
  transition: border-color .14s, box-shadow .14s;
}
.agent-field input:focus,
.agent-field select:focus,
.agent-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.agent-field textarea { resize: vertical; min-height: 60px; }
.agent-modal-err {
  font-size: 12px;
  color: var(--error);
  background: rgba(239,68,68,.08);
  padding: 8px 10px;
  border-radius: 6px;
}

.chat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.chat-messages {
  min-height: 200px;
  max-height: 460px;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-2);
}
.chat-empty {
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
  padding: 32px 8px;
}
.chat-bubble {
  display: flex;
  max-width: 80%;
}
.chat-bubble.chat-user { align-self: flex-end; justify-content: flex-end; }
.chat-bubble.chat-assistant { align-self: flex-start; }
.chat-bubble-body {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
  white-space: normal;
}
.chat-user .chat-bubble-body {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-assistant .chat-bubble-body {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-typing .chat-bubble-body {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chat-typing .dot {
  width: 6px; height: 6px;
  background: var(--text-3);
  border-radius: 50%;
  animation: chatDot 1.2s ease-in-out infinite;
}
.chat-typing .dot:nth-child(2) { animation-delay: .2s; }
.chat-typing .dot:nth-child(3) { animation-delay: .4s; }
@keyframes chatDot {
  0%, 80%, 100% { opacity: .3; transform: translateY(0); }
  40%           { opacity: 1;  transform: translateY(-2px); }
}
.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.chat-input-row input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color .14s, box-shadow .14s;
}
.chat-input-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.chat-input-row button {
  height: 38px;
  padding: 0 18px;
  font-size: 13px;
}

/* Todo / 备忘录 (super admin private view) */
.dash-todo-wrap {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 980px) {
  .dash-todo-wrap { grid-template-columns: 1fr; }
}
.todo-col { display: flex; flex-direction: column; min-width: 0; }
.todo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.todo-add {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.todo-add input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color .14s, box-shadow .14s;
}
.todo-add input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.todo-add button {
  height: 38px;
  padding: 0 18px;
  font-size: 13px;
}
.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  transition: opacity .14s;
}
.todo-item:last-child { border-bottom: 0; }
.todo-check {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
  user-select: none;
  min-width: 0;
}
.todo-check input[type=checkbox] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background .14s, border-color .14s;
}
.todo-check input[type=checkbox]:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.todo-check input[type=checkbox]:checked::after {
  content: "";
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.todo-text {
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
  flex: 1;
  min-width: 0;
}
.todo-item.is-done .todo-text {
  color: var(--text-3);
  text-decoration: line-through;
}
.todo-due {
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.todo-date {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  margin-left: 6px;
}
.todo-del {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 18px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.todo-del:hover {
  color: var(--error);
  background: rgba(239, 68, 68, .08);
}
.todo-empty {
  padding: 24px 6px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.muted-hint { color: var(--text-3); font-size: 12px; }

/* Recent activity */
.dash-recent { margin-top: 32px; }
.recent-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.recent-row {
  display: grid;
  grid-template-columns: 64px 110px 1fr 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  transition: background .12s;
}
.recent-row:last-child { border-bottom: 0; }
.recent-row:hover { background: var(--surface-2); }
.recent-id {
  color: var(--text-3);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.recent-mode {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  text-align: center;
}
.recent-mode.mode-watermark { color: #047857; background: #d1fae5; border-color: rgba(4,120,87,.2); }
.recent-mode.mode-xmode { color: #4338ca; background: #e0e7ff; border-color: rgba(67,56,202,.2); }
.recent-mode.mode-cover, .recent-mode.mode-clip { color: #7c3aed; background: #ede9fe; border-color: rgba(124,58,237,.2); }
:root[data-theme="dark"] .recent-mode.mode-watermark { color: #6ee7b7; background: rgba(4,120,87,.18); }
:root[data-theme="dark"] .recent-mode.mode-xmode    { color: #a5b4fc; background: rgba(67,56,202,.22); }
:root[data-theme="dark"] .recent-mode.mode-cover,
:root[data-theme="dark"] .recent-mode.mode-clip     { color: #c4b5fd; background: rgba(124,58,237,.18); }

.recent-status {
  font-size: 11px;
  color: var(--text-2);
}
.recent-user { color: var(--text-2); }
.recent-time {
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .recent-row { grid-template-columns: 50px 1fr auto; }
  .recent-row .recent-status, .recent-row .recent-user { display: none; }
  .hero { padding: 20px; }
  .hero-greet { font-size: 18px; }
}
.dash-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.dash-card-icon svg {
  width: 24px;
  height: 24px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dash-card-icon[data-tone="violet"]  { background: #ede9fe; color: #7c3aed; }
.dash-card-icon[data-tone="emerald"] { background: #d1fae5; color: #047857; }
.dash-card-icon[data-tone="indigo"]  { background: #e0e7ff; color: #4338ca; }
.dash-card-icon[data-tone="amber"]   { background: #fef3c7; color: #b45309; }

:root[data-theme="dark"] .dash-card-icon[data-tone="violet"]  { background: rgba(124, 58, 237, .18); color: #c4b5fd; }
:root[data-theme="dark"] .dash-card-icon[data-tone="emerald"] { background: rgba(4, 120, 87, .18); color: #6ee7b7; }
:root[data-theme="dark"] .dash-card-icon[data-tone="indigo"]  { background: rgba(67, 56, 202, .22); color: #a5b4fc; }
:root[data-theme="dark"] .dash-card-icon[data-tone="amber"]   { background: rgba(180, 83, 9, .18); color: #fcd34d; }

.dash-card-body h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.dash-card-body p {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}
.dash-card-body .locked {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  background: var(--surface-2);
  color: var(--text-3);
  padding: 1px 6px;
  border-radius: 4px;
}
.dash-card-stats {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
}
.dash-card-stats span strong {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  margin-right: 3px;
}
.dash-card-stats .warn strong { color: var(--error); }
.dash-card-stats .muted { color: var(--text-3); font-style: italic; }

/* ===== Page header sub-title (breadcrumb) ===== */
.brand-link {
  text-decoration: none;
  color: inherit;
}
.page-sep {
  color: var(--text-3);
  margin: 0 8px;
  font-weight: 400;
}
.page-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
}
.upload-card-desc {
  margin: -8px 0 16px;
  font-size: 13px;
  color: var(--text-2);
}
.empty-state {
  padding: 32px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  background: var(--surface-2);
  border-radius: var(--radius);
}

/* ===== HTML hidden attribute must win over display: flex/grid below ===== */
[hidden] {
  display: none !important;
}

/* ===== Modal (invite code) ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  width: 100%;
  max-width: 420px;
}
.modal-box h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
}
.modal-box p {
  margin: 0 0 16px;
  color: var(--text-2);
  font-size: 13px;
}
.modal-box input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  background: var(--surface);
  color: var(--text);
  box-sizing: border-box;
}
.modal-box input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.modal-error {
  margin-top: 10px;
  color: var(--error);
  font-size: 12px;
}
.modal-actions {
  margin-top: 18px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ===== 封面图制作 ===== */
.cover-status {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text-2);
}
.cover-status.status-ok { background: var(--success-soft); color: var(--success); }
.cover-status.status-error { background: var(--error-soft); color: var(--error); }

.cover-result {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  align-items: start;
}
.cover-preview img {
  width: 100%;
  max-width: 720px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}
.cover-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cover-controls input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  box-sizing: border-box;
}
.cover-controls input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.cover-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

/* 重新抽帧进度条 */
.reshoot-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
  vertical-align: middle;
}
.reshoot-progress {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.reshoot-progress-bar {
  display: inline-block;
  width: 120px;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.reshoot-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  transition: width .25s ease;
}
.reshoot-progress-label {
  font-size: 11px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  text-align: right;
}

/* 批量上传面板 */
.batch-panel {
  margin: 12px 24px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.batch-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
}
.batch-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.batch-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.batch-item:last-child { border-bottom: 0; }
.batch-row-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.batch-name {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.batch-size {
  color: var(--text-3);
  font-size: 11px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.batch-row-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.batch-status-text {
  color: var(--text-2);
  font-size: 12px;
}
.batch-link {
  color: var(--primary);
  font-size: 11px;
  font-weight: 500;
}
.batch-bar { height: 4px; margin: 0; border-radius: 2px; }
.batch-bar .progress-fill { background: var(--primary); }
.batch-item.batch-done .progress-fill { background: var(--success, #10b981); }
.batch-item.batch-failed .progress-fill { background: var(--error); }
.batch-item.batch-failed .batch-status-text { color: var(--error); }
.cover-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s;
}
.cover-tile:hover { border-color: var(--primary); }
.cover-tile img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }
.cover-tile-empty {
  aspect-ratio: 16/9;
  background: var(--surface-2);
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.cover-tile-meta {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}
.cover-tile-title {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cover-tile-date {
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cover-tile-id {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(15, 23, 42, .72);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  z-index: 1;
  pointer-events: none;
}
/* 管理员 hover 时显示删除按钮，遮住任务编号即可，无需额外样式 */

@media (max-width: 720px) {
  .cover-result { grid-template-columns: 1fr; }
}

/* ===== 封面风格选择器 ===== */
.style-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 6px 0 8px;
}
.style-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
  transition: all .15s;
}
.style-card:hover { border-color: var(--primary); }
.style-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.style-card.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.style-thumb {
  width: 80px;
  height: 45px;          /* 16:9 缩略图比例 */
  border-radius: 4px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
/* 各风格小预览（CSS 模拟封面构图） */
.style-thumb[data-style="classic"] {
  background: linear-gradient(180deg, #5b6477 0%, #1c2030 70%, #0f1219 100%);
  position: relative;
}
.style-thumb[data-style="classic"]::after {
  content: ""; position: absolute; bottom: 5px; left: 4px;
  width: 50px; height: 6px; background: #fff; border-radius: 1px;
}
.style-thumb[data-style="banner"] {
  background: linear-gradient(180deg, #ec4899 0%, #ec4899 22%, #5b6477 22%, #2d3340 100%);
  position: relative;
}
.style-thumb[data-style="banner"]::after {
  content: ""; position: absolute; top: 1px; left: 16px;
  width: 48px; height: 6px; background: #fff; border-radius: 1px;
}
.style-thumb[data-style="sidebar"] {
  background: linear-gradient(90deg, #181230 0%, #181230 38%, #5b6477 38%, #2d3340 100%);
  position: relative;
}
.style-thumb[data-style="sidebar"]::after {
  content: ""; position: absolute; top: 12px; left: 3px;
  width: 22px; height: 6px; background: #ffe678; border-radius: 1px;
  box-shadow: 0 10px 0 #ffe678;
}
.style-thumb[data-style="center"] {
  background: radial-gradient(circle, #5b6477 35%, #0a0c13 100%);
  position: relative;
}
.style-thumb[data-style="center"]::after {
  content: ""; position: absolute; top: 19px; left: 18px;
  width: 44px; height: 7px; background: #fff; border-radius: 1px;
}
.style-thumb[data-style="diagonal"] {
  background: linear-gradient(135deg, #5b6477 50%, #14182f 50%);
  position: relative;
}
.style-thumb[data-style="diagonal"]::after {
  content: ""; position: absolute; bottom: 6px; left: 4px;
  width: 36px; height: 5px; background: #fff; border-radius: 1px;
}
.style-thumb[data-style="random"] {
  background: var(--surface-2);
}
.style-label {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.style-card.is-active .style-label {
  color: var(--primary);
  font-weight: 600;
}

/* 新增风格的缩略图 */
.style-thumb[data-style="magazine"] {
  background: linear-gradient(180deg, #fff 0%, #fff 28%, #5b6477 28%, #2d3340 100%);
  position: relative;
}
.style-thumb[data-style="magazine"]::after {
  content: ""; position: absolute; top: 3px; left: 4px;
  width: 50px; height: 6px; background: #1a1a1f; border-radius: 1px;
}
.style-thumb[data-style="tabloid"] {
  background: linear-gradient(180deg, #5b6477 0%, #5b6477 60%, #fcd714 60%, #fcd714 100%);
  position: relative;
}
.style-thumb[data-style="tabloid"]::after {
  content: ""; position: absolute; bottom: 5px; left: 5px;
  width: 56px; height: 7px; background: #dc1e1e; border-radius: 1px;
}
.style-thumb[data-style="cinema"] {
  background: linear-gradient(180deg, #000 0%, #000 18%, #5b6477 18%, #2d3340 82%, #000 82%, #000 100%);
  position: relative;
}
.style-thumb[data-style="cinema"]::after {
  content: ""; position: absolute; bottom: 1px; left: 13px;
  width: 50px; height: 4px; background: #e6c89a; border-radius: 1px;
}
.style-thumb[data-style="neon"] {
  background: linear-gradient(135deg, #00c4d9 0%, #b32585 60%, #ff45a8 100%);
  position: relative;
}
.style-thumb[data-style="neon"]::after {
  content: ""; position: absolute; top: 17px; left: 16px;
  width: 48px; height: 7px; background: #fff;
  box-shadow: -3px 2px 0 rgba(255, 0, 200, .7), 3px -2px 0 rgba(0, 220, 255, .7);
}
.style-thumb[data-style="polaroid"] {
  background: #f0eddc;
  position: relative;
}
.style-thumb[data-style="polaroid"]::before {
  content: ""; position: absolute; top: 4px; left: 6px; right: 6px; bottom: 13px;
  background: linear-gradient(135deg, #aab1c0, #4a4f5e);
}
.style-thumb[data-style="polaroid"]::after {
  content: ""; position: absolute; bottom: 2px; left: 14px;
  width: 48px; height: 4px; background: #3a302a; border-radius: 1px;
}
.style-thumb[data-style="minimal"] {
  background: linear-gradient(180deg, #5b6477 0%, #5b6477 68%, #fcfaf7 68%, #fcfaf7 100%);
  position: relative;
}
.style-thumb[data-style="minimal"]::before {
  content: ""; position: absolute; bottom: 8px; left: 5px;
  width: 8px; height: 2px; background: #c81e32;
}
.style-thumb[data-style="minimal"]::after {
  content: ""; position: absolute; bottom: 2px; left: 5px;
  width: 40px; height: 4px; background: #14182f; border-radius: 1px;
}
.style-thumb[data-style="tiktok"] {
  background: linear-gradient(165deg, #5b6477 0%, #5b6477 55%, #ff3c5a 55%, #ff3c5a 100%);
  position: relative;
}
.style-thumb[data-style="tiktok"]::after {
  content: ""; position: absolute; bottom: 4px; left: 14px;
  width: 50px; height: 7px; background: #fff; border-radius: 1px;
}

/* 封面图上传取消按钮 */
.cover-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cover-cancel {
  flex-shrink: 0;
  padding: 4px 10px !important;
  font-size: 12px !important;
}

.cover-status-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* 封面历史 tile 删除按钮（管理员） */
.cover-tile { position: relative; }
.cover-tile-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font-size: 18px;
  line-height: 24px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s;
  z-index: 2;
}
.cover-tile:hover .cover-tile-del { opacity: 1; }
.cover-tile-del:hover { background: var(--error); }

/* ===== 多张封面网格 ===== */
.count-input {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  margin: 0 8px;
}
.count-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.cover-result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 14px;
  flex-wrap: wrap;
}
.cover-result-header input[type="text"] {
  flex: 1;
  min-width: 220px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  box-sizing: border-box;
}
.cover-result-header input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.cover-variants {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.variant-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.variant-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.variant-meta {
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.variant-label {
  color: var(--text);
  font-weight: 500;
}
.variant-dl {
  padding: 4px 10px !important;
  font-size: 11px !important;
}

/* ===== 剪辑模式预览区 ===== */
.clip-result h3 {
  margin: 12px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.clip-result h3 .step-hint {
  font-weight: 400;
  color: var(--text-3);
}
.clip-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}
.clip-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.clip-col video {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
  aspect-ratio: 16/9;
  object-fit: contain;
}
.clip-col img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  aspect-ratio: 16/9;
  object-fit: cover;
}
.clip-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.clip-shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.clip-shot {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.caption-edit {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-sans);
  line-height: 1.5;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  box-sizing: border-box;
}
.caption-edit:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

@media (max-width: 720px) {
  .clip-row { grid-template-columns: 1fr; }
}

/* ===== 剪辑管理：模式 tabs ===== */
.mode-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 4px;
  border-bottom: 1px solid var(--border);
}
.mode-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: all .15s;
  margin-bottom: -1px;
}
.mode-tab:hover { color: var(--text-2); }
.mode-tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.mode-tab-desc {
  margin: 4px 0 14px;
  font-size: 12px;
  color: var(--text-3);
}

.clip-base-img {
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
  margin: 6px 0 10px;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* 封面历史卡：状态徽章 */
.cover-tile { cursor: pointer; position: relative; }
.cover-tile:hover { transform: translateY(-2px); transition: transform .15s; }
.cover-tile-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(15, 23, 42, .12);
  overflow: hidden;
  z-index: 1;
}
.cover-tile-progress-fill {
  height: 100%;
  background: var(--info, #0284c7);
  transition: width .3s ease;
}
.cover-tile-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  background: rgba(15, 23, 42, .7);
  z-index: 1;
}
.tile-badge-ready_review,
.tile-badge-done,
.tile-badge-posted { background: var(--success); }
.tile-badge-queued { background: var(--warning); }
.tile-badge-staged {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  animation: stagedPulse 1.8s ease-in-out infinite;
  cursor: pointer;
}
@keyframes stagedPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .55); }
  50%      { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}
.tile-badge-processing,
.tile-badge-agent_chat { background: var(--info); }
.tile-badge-failed,
.tile-badge-post_failed { background: var(--error); }

/* ===== Dashboard 卡片：被禁用状态 ===== */
.dash-card.is-disabled {
  opacity: 0.45;
  filter: grayscale(80%);
  cursor: not-allowed;
  pointer-events: auto;
}
.dash-card.is-disabled:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

/* ===== 用户卡片权限编辑（legacy table，保留兼容） ===== */
.cards-cell { min-width: 240px; }
.card-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.card-perm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-2);
  user-select: none;
}
.card-perm input { margin: 0; }
.card-perms-save {
  padding: 4px 10px !important;
  font-size: 11px !important;
}
.card-perms-status {
  font-size: 11px;
  margin-left: 6px;
}

/* ===== 团队成员列表（uniform row layout, 取代 table） ===== */
.member-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  --member-cols: minmax(220px, 1.2fr) minmax(280px, 2fr) minmax(180px, 0.8fr);
}
.member-list.is-super {
  --member-cols: minmax(220px, 1.2fr) minmax(280px, 2fr) 180px minmax(180px, 0.8fr);
}
.member-row {
  display: grid;
  grid-template-columns: var(--member-cols);
  gap: 20px;
  align-items: center;
  min-height: 82px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.member-row:last-child { border-bottom: 0; }
.member-row:hover { background: var(--surface-2); }

/* 第 1 列：头像 + 用户名 + 角色 pill */
.member-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.member-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.member-id-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.member-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-you {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  letter-spacing: .03em;
}
.member-role { display: flex; }
.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--text-2);
}
.role-pill.role-super  { color: #b45309; background: #fef3c7; border-color: rgba(180,83,9,.22); }
.role-pill.role-admin  { color: #4338ca; background: #e0e7ff; border-color: rgba(67,56,202,.22); }
:root[data-theme="dark"] .role-pill.role-super { color: #fcd34d; background: rgba(180,83,9,.18); }
:root[data-theme="dark"] .role-pill.role-admin { color: #a5b4fc; background: rgba(67,56,202,.22); }

/* 第 2 列：权限 chips */
.member-perms { min-width: 0; }
.perm-allall {
  font-size: 12px;
  color: var(--text-3);
  font-style: italic;
  letter-spacing: .02em;
}
.perm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.perm-chip {
  appearance: none;
  font: inherit;
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  font-size: 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-soft);
  cursor: pointer;
  transition: background .14s, color .14s, border-color .14s, transform .08s;
  user-select: none;
  font-weight: 500;
}
.perm-chip:hover { filter: brightness(.96); }
.perm-chip:active { transform: scale(.96); }

:root[data-theme="dark"] .perm-chip {
  background: rgba(79,70,229,.18);
  color: #a5b4fc;
  border-color: rgba(79,70,229,.18);
}

/* ON 状态：橙色实心填充，放最后 + !important 确保任何主题/任何顺序下都生效 */
.perm-chip.is-on,
:root[data-theme="dark"] .perm-chip.is-on,
:root[data-theme="light"] .perm-chip.is-on {
  background: #f59e0b !important;
  color: #fff !important;
  border-color: #f59e0b !important;
  filter: none !important;
}
.perm-chip.is-on:hover {
  background: #d97706 !important;
  border-color: #d97706 !important;
}
.perm-status {
  font-size: 11px;
  color: var(--text-3);
  margin-left: 4px;
  min-width: 64px;
}
.perm-status.saving { color: var(--text-2); }
.perm-status.ok     { color: var(--success, #10b981); }
.perm-status.err    { color: var(--error); }

/* 第 3 列（仅 super）：登录信息 */
.member-login {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.login-ip {
  font-size: 12px;
  color: var(--text-2);
  font-family: var(--font-mono);
}
.login-ts {
  font-size: 11px;
  color: var(--text-3);
}

/* 末列：操作 */
.member-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}
.member-actions .dim {
  color: var(--text-3);
  font-size: 12px;
  font-style: italic;
}
.btn-sm {
  padding: 5px 10px !important;
  font-size: 11px !important;
}

@media (max-width: 980px) {
  .member-list,
  .member-list.is-super {
    --member-cols: 1fr;
  }
  .member-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 18px;
  }
  .member-actions { justify-content: flex-start; }
}
