* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #f1f5f9 0%, #e0e7ff 100%);
  color: #0f172a;
  min-height: 100vh;
  padding: 32px 16px;
}

.wizard {
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px -20px rgba(15, 23, 42, .25);
  overflow: hidden;
}

.wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid #e2e8f0;
  background: #fafbff;
}
.brand { font-size: 18px; font-weight: 700; color: #0f172a; }
.muted { color: #64748b; font-size: 13px; }

/* 后台切换按钮 */
.panel-switch {
  padding: 5px 14px; border-radius: 6px; font-size: 12px;
  font-weight: 600; text-decoration: none;
}
.panel-switch-admin { background: #fee2e2; color: #991b1b; }
.panel-switch-admin:hover { background: #fecaca; }
.panel-switch-agent { background: #fef3c7; color: #92400e; }
.panel-switch-agent:hover { background: #fde68a; }
.panel-switch-user  { background: #dcfce7; color: #166534; }
.panel-switch-user:hover  { background: #bbf7d0; }

/* 步骤指示器 */
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 8px;
}
.stepper-item { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 0 auto; }
.stepper-item .dot {
  width: 32px; height: 32px; border-radius: 50%;
  background: #e2e8f0; color: #64748b;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; transition: all .25s;
}
.stepper-item .label { font-size: 12px; color: #94a3b8; }
.stepper-item.active .dot { background: #6366f1; color: #fff; box-shadow: 0 0 0 5px rgba(99, 102, 241, .15); }
.stepper-item.active .label { color: #0f172a; font-weight: 600; }
.stepper-item.done .dot { background: #10b981; color: #fff; }
.stepper-item.done .label { color: #475569; }
.bar { flex: 1; height: 2px; background: #e2e8f0; margin: 0 6px; margin-bottom: 18px; }

/* 步骤面板 */
.step {
  padding: 24px 28px 8px;
  min-height: 320px;
}
.step.hidden { display: none; }
.step h2 { margin: 0 0 6px; font-size: 20px; }
.step p { margin: 0 0 18px; }

/* 二维码区域 */
.qr-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 30px 0;
}
.qr-area img.qr {
  width: 240px; height: 240px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 8px;
}
.qr-area .auth-link {
  font-size: 12px; color: #6366f1; word-break: break-all; max-width: 360px; text-align: center;
}
.status { margin-top: 12px; text-align: center; }

/* 卡片列表 */
.card-list { display: flex; flex-direction: column; gap: 10px; max-height: 380px; overflow-y: auto; }
.list-item {
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  background: #fff;
  display: flex; align-items: center; gap: 12px;
  transition: all .15s;
}
.list-item:hover { border-color: #6366f1; background: #eef2ff; }
.list-item .li-avatar {
  width: 48px; height: 48px; border-radius: 10px;
  background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  overflow: hidden;
}
.list-item .li-avatar img { width: 100%; height: 100%; object-fit: cover; }
.list-item .li-body { flex: 1; min-width: 0; }
.list-item .li-name { font-weight: 600; color: #0f172a; margin-bottom: 4px; word-break: break-all; }
.list-item .li-meta { font-size: 12px; color: #64748b; }
.list-item .li-go { font-size: 18px; color: #94a3b8; }
.list-item:hover .li-go { color: #6366f1; }

.empty {
  padding: 50px 20px; text-align: center; color: #94a3b8;
  border: 1px dashed #e2e8f0; border-radius: 12px;
}

/* 模式卡 */
.mode-cards { display: flex; gap: 14px; }
.mode-card {
  flex: 1;
  padding: 20px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
}
.mode-card:hover { border-color: #6366f1; background: #f8faff; }
.mode-card.selected { border-color: #6366f1; background: #eef2ff; box-shadow: 0 0 0 4px rgba(99, 102, 241, .12); }
.mode-card .mc-icon { font-size: 28px; }
.mode-card .mc-title { font-weight: 600; font-size: 16px; color: #0f172a; text-align: center; }
.mode-card .mc-desc { color: #64748b; font-size: 13px; text-align: center; line-height: 1.5; }
.mode-card .mc-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e2e8f0;
  color: transparent;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.mode-card.selected .mc-check { background: #6366f1; color: #fff; }

/* 概要 */
.summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
  font-size: 14px; line-height: 1.8;
}
.summary div strong { color: #475569; margin-right: 6px; }

.run-area { text-align: center; padding: 8px 0 4px; }
.log {
  background: #0f172a; color: #cbd5e1;
  padding: 14px 16px; border-radius: 10px;
  max-height: 220px; overflow-y: auto;
  font-size: 12px; line-height: 1.7;
  margin-top: 14px;
  white-space: pre-wrap; word-break: break-all;
}
.log:empty { display: none; }

/* 底部 */
.wizard-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  border-top: 1px solid #e2e8f0;
  background: #fafbff;
}

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 10px;
  padding: 8px 18px; font-size: 14px;
  cursor: pointer; transition: all .15s;
  font-weight: 500;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.big { padding: 12px 28px; font-size: 15px; }
.btn-primary { background: #6366f1; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #4f46e5; }
.btn-outline { background: #fff; color: #475569; border: 1px solid #e2e8f0; }
.btn-outline:hover { border-color: #6366f1; color: #6366f1; }
.btn-ghost { background: transparent; color: #475569; }
.btn-ghost:hover { color: #6366f1; }

/* Toast */
.toast-container {
  position: fixed; top: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: #0f172a; color: #fff;
  padding: 10px 16px; border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.3);
  animation: toastIn .25s ease-out;
}
.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === 过审总览模板 === */
.bot-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 14px;
}
.bot-banner .bb-avatar {
  width: 56px; height: 56px; border-radius: 12px;
  background: #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  overflow: hidden;
  flex: 0 0 56px;
}
.bot-banner .bb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bot-banner .bb-body { min-width: 0; flex: 1; }
.bot-banner .bb-name { font-weight: 700; font-size: 16px; color: #0f172a; }
.bot-banner .bb-meta { color: #64748b; font-size: 13px; margin-top: 4px; word-break: break-all; }

/* 子步骤横向滚动 */
.substeps {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 4px;
  margin-bottom: 12px;
  overflow-x: auto;
  white-space: nowrap;
}
.substeps::-webkit-scrollbar { height: 6px; }
.substeps::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.substep {
  display: inline-flex; align-items: center; gap: 6px;
  flex: 0 0 auto;
  font-size: 13px;
  color: #64748b;
}
.substep .ss-dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: #e2e8f0; color: #64748b;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex: 0 0 24px;
}
.substep.done .ss-dot { background: #10b981; color: #fff; }
.substep.done { color: #10b981; }
.substep.active .ss-dot { background: #6366f1; color: #fff; box-shadow: 0 0 0 4px rgba(99,102,241,.18); animation: pulse 1.4s infinite; }
.substep.active { color: #0f172a; font-weight: 600; }
.substep.failed .ss-dot { background: #ef4444; color: #fff; }
.substep.failed { color: #ef4444; }
.substep.skipped .ss-dot { background: #cbd5e1; color: #64748b; }
.substep.skipped { color: #94a3b8; text-decoration: line-through; }
.substep-bar { width: 18px; height: 2px; background: #e2e8f0; flex: 0 0 18px; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(99,102,241,.18); }
  50% { box-shadow: 0 0 0 7px rgba(99,102,241,.08); }
}

/* 总状态横幅 */
.overview-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  margin-bottom: 14px;
}
.overview-banner .ob-icon { font-size: 28px; flex: 0 0 auto; }
.overview-banner .ob-title { font-weight: 700; color: #065f46; }
.overview-banner .ob-desc { color: #047857; font-size: 13px; margin-top: 2px; }
.overview-banner.failed { background: #fef2f2; border-color: #fecaca; }
.overview-banner.failed .ob-title { color: #991b1b; }
.overview-banner.failed .ob-desc { color: #b91c1c; }

/* 状态卡片网格 */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  min-height: 60px;
}
.stat-card .sc-label { font-size: 12px; color: #64748b; margin-bottom: 4px; }
.stat-card .sc-value { font-size: 14px; color: #0f172a; word-break: break-all; }
.stat-card.success { background: #f0fdf4; border-color: #bbf7d0; }
.stat-card.success .sc-value { color: #15803d; }
.stat-card.warning { background: #fffbeb; border-color: #fde68a; }
.stat-card.warning .sc-value { color: #b45309; }
.stat-card.error { background: #fef2f2; border-color: #fecaca; }
.stat-card.error .sc-value { color: #b91c1c; }

/* 日志区 */
.log-section { margin-top: 8px; }
.log-title { font-size: 13px; color: #475569; margin: 0 0 6px; }

/* 动作二维码弹窗 */
.action-qr-modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.action-qr-card {
  background: #fff; border-radius: 16px; padding: 28px 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  max-width: 360px; width: 90%; text-align: center;
}
.action-qr-title { font-size: 18px; font-weight: 600; color: #0f172a; margin-bottom: 8px; }
.action-qr-desc { font-size: 13px; color: #64748b; margin-bottom: 20px; line-height: 1.6; }
.action-qr-image { display: flex; justify-content: center; margin-bottom: 16px; }
.action-qr-image img { width: 220px; height: 220px; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px; background: #fff; }
.action-qr-status { font-size: 13px; color: #6366f1; margin-bottom: 16px; min-height: 18px; }
.action-qr-status.success { color: #15803d; }
.action-qr-status.error { color: #b91c1c; }
.action-qr-actions { display: flex; justify-content: center; gap: 8px; }

@media (max-width: 600px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* 响应式：手机（≤ 600px） */
@media (max-width: 600px) {
  body { padding: 0; }
  .wizard { border-radius: 0; min-height: 100vh; }
  .stepper { padding: 16px 12px 4px; }
  .stepper-item .label { font-size: 10px; }
  .step { padding: 20px 16px; min-height: auto; }
  .wizard-footer { padding: 14px 16px; }
  /* 横向滚动条更紧凑 */
  .substeps { padding: 8px 12px; }
  .substep { font-size: 12px; padding: 6px 10px; }
  /* 卡片列表更紧凑 */
  .card-list { gap: 8px; }
  .bot-card { padding: 10px 12px; }
  .bot-card .name { font-size: 14px; }
  .bot-card .meta { font-size: 11px; }
  /* 顶部用户栏不挤 */
  .topbar { padding: 10px 12px !important; flex-wrap: wrap; gap: 8px; }
  /* 按钮全宽更好点 */
  .btn.big { width: 100%; }
  /* 状态卡片更紧凑 */
  .stat-card { padding: 10px; }
  .stat-card .num { font-size: 18px; }
  /* 操作日志框 */
  #logBox { font-size: 11px; padding: 10px; }
}

/* 平板（≤ 900px） */
@media (max-width: 900px) {
  .wizard { max-width: 100%; margin: 0; }
}

:root {
  --ui-primary: #7c3aed;
  --ui-primary-2: #2563eb;
  --ui-cyan: #06b6d4;
  --ui-ink: #0f172a;
  --ui-card: rgba(255, 255, 255, .88);
  --ui-border: rgba(148, 163, 184, .22);
  --ui-shadow: 0 28px 80px -34px rgba(15, 23, 42, .65);
}

body {
  background:
    radial-gradient(circle at 12% 10%, rgba(124, 58, 237, .22), transparent 28%),
    radial-gradient(circle at 86% 8%, rgba(6, 182, 212, .18), transparent 30%),
    radial-gradient(circle at 50% 92%, rgba(37, 99, 235, .18), transparent 34%),
    linear-gradient(135deg, #f8fafc 0%, #eef2ff 42%, #f0f9ff 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  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: 42px 42px;
  mask-image: radial-gradient(circle at 50% 12%, #000, transparent 72%);
}

.wizard {
  max-width: 920px;
  background: var(--ui-card);
  border: 1px solid rgba(255, 255, 255, .78);
  box-shadow: var(--ui-shadow), inset 0 1px 0 rgba(255,255,255,.7);
  backdrop-filter: blur(18px);
  animation: shellIn .55s cubic-bezier(.2,.8,.2,1);
}

.wizard-header,
.wizard-footer {
  background: rgba(255, 255, 255, .62);
  backdrop-filter: blur(14px);
}

.wizard-header {
  border-bottom-color: rgba(148, 163, 184, .2);
}

.wizard-footer {
  border-top-color: rgba(148, 163, 184, .2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  letter-spacing: -.02em;
}

.brand::after {
  content: "AUTO REVIEW";
  font-size: 10px;
  letter-spacing: .14em;
  color: #6366f1;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.18);
  padding: 3px 8px;
  border-radius: 999px;
}

.step:not(.hidden) {
  animation: panelIn .32s ease-out;
}

.step h2 {
  font-size: 24px;
  letter-spacing: -.03em;
}

.stepper {
  position: relative;
}

.stepper-item .dot,
.substep .ss-dot {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.42);
}

.stepper-item.active .dot {
  background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-2));
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 26px -16px rgba(99,102,241,.9), 0 0 0 7px rgba(99, 102, 241, .14);
}

.stepper-item.done .dot {
  background: linear-gradient(135deg, #10b981, #22c55e);
}

.bar {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(226,232,240,.55), rgba(148,163,184,.4));
}

.qr-area {
  border: 1px dashed rgba(99,102,241,.24);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(248,250,252,.72));
}

.qr-area img.qr,
.action-qr-image img {
  border: 1px solid rgba(99,102,241,.18);
  box-shadow: 0 18px 38px -24px rgba(15, 23, 42, .55);
  animation: qrFloat 3.8s ease-in-out infinite;
}

.list-item,
.mode-card,
.summary,
.bot-banner,
.stat-card,
.overview-banner {
  background: rgba(255,255,255,.72);
  border-color: var(--ui-border);
  box-shadow: 0 16px 38px -30px rgba(15, 23, 42, .7);
  backdrop-filter: blur(10px);
}

.list-item,
.mode-card,
.stat-card {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

.list-item:hover,
.mode-card:hover,
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 52px -34px rgba(79, 70, 229, .72);
}

.list-item:hover {
  background: linear-gradient(135deg, rgba(238,242,255,.86), rgba(240,249,255,.86));
}

.list-item .li-avatar,
.bot-banner .bb-avatar {
  background: linear-gradient(135deg, #eef2ff, #e0f2fe);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.mode-card.selected {
  background: linear-gradient(135deg, rgba(238,242,255,.95), rgba(224,242,254,.86));
  box-shadow: 0 22px 48px -32px rgba(99,102,241,.9), 0 0 0 5px rgba(99, 102, 241, .12);
}

.substeps {
  padding: 12px;
  border-radius: 16px;
  background: rgba(248,250,252,.76);
  border: 1px solid rgba(226,232,240,.7);
}

.substep.active .ss-dot {
  background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-2));
}

.substep.done .ss-dot {
  background: linear-gradient(135deg, #10b981, #22c55e);
}

.overview-banner {
  animation: panelIn .32s ease-out;
}

.overview-banner:not(.failed) {
  background: linear-gradient(135deg, rgba(236,253,245,.92), rgba(240,253,250,.78));
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--ui-primary), var(--ui-cyan));
  opacity: .42;
}

.stat-card.success::before { background: linear-gradient(90deg, #10b981, #22c55e); opacity: .75; }
.stat-card.warning::before { background: linear-gradient(90deg, #f59e0b, #f97316); opacity: .75; }
.stat-card.error::before { background: linear-gradient(90deg, #ef4444, #f43f5e); opacity: .75; }

.log {
  background:
    linear-gradient(180deg, rgba(15,23,42,.98), rgba(15,23,42,.94)),
    radial-gradient(circle at 12% 0%, rgba(99,102,241,.22), transparent 40%);
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 20px 50px -38px rgba(15,23,42,.9);
}

.btn {
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 22px -18px rgba(15,23,42,.9);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-2));
  box-shadow: 0 18px 32px -22px rgba(79,70,229,.95);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #6d28d9, #1d4ed8);
  box-shadow: 0 22px 42px -24px rgba(79,70,229,1);
}

.btn-outline {
  background: rgba(255,255,255,.78);
}

.panel-switch,
#creditsBadge {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

.action-qr-modal {
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(8px);
  animation: fadeIn .18s ease-out;
}

.action-qr-card {
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: 0 30px 90px -36px rgba(15,23,42,.9);
  animation: modalIn .28s cubic-bezier(.2,.8,.2,1);
}

.toast {
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 18px 42px -24px rgba(15,23,42,.9);
}

@keyframes shellIn {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes qrFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
