/* AgentCraft Academy — modern workshop UI */
:root {
  --bg: #f4f6fb;
  --bg-soft: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-soft: #eef2ff;
  --accent: #8b5cf6;
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --danger: #ef4444;
  --header: #ffffff;
  --header-soft: #f8fafc;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(99, 102, 241, 0.08);
  --shadow-lg: 0 12px 40px rgba(99, 102, 241, 0.12);
  --font-display: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --max: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

/* ── Header ── */
.app-header,
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

.brand-text strong {
  display: block;
  color: #f8fafc;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-text small,
.brand small {
  color: #94a3b8;
  font-size: 11px;
}

.main-nav,
.nav {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-link,
.nav a {
  padding: 8px 16px;
  border-radius: 999px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  transition: 0.2s ease;
}

.nav-link:hover,
.nav a:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active,
.nav-link.active {
  color: #fff;
  background: rgba(13, 148, 136, 0.35);
}

.auth-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-bar input {
  width: 120px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 13px;
}

.sync-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sync-badge.synced { color: #5eead4; border-color: rgba(94, 234, 212, 0.3); }
.sync-badge.local { color: #fde68a; border-color: rgba(253, 230, 138, 0.25); }
.sync-badge.guest { color: #93c5fd; }

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 16px;
}

.icon-button:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }

/* ── Stats strip ── */
.stats-strip,
.dash-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-pill,
.dash-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow);
}

.stat-label,
.dash-item > span:first-child {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-pill strong,
.dash-item strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.progress-track {
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), #2dd4bf);
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* ── Layout ── */
.app-main,
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px;
}

.section-block { scroll-margin-top: 100px; margin-bottom: 24px; }

/* ── Hero ── */
.hero-banner,
.hero-shell {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items: stretch;
}

.hero-content,
.hero-copy {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 55%, #0f766e 100%);
  color: #f8fafc;
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 280px;
}

.hero-map,
.hero-visual {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  min-height: 280px;
}

.hero-map img,
.hero-visual img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.kicker,
.eyebrow,
.section-title span,
.card-header .kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

.hero-content .kicker { color: #5eead4; }

h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.hero-desc,
.lead {
  margin: 0 0 24px;
  color: #cbd5e1;
  font-size: 15px;
  line-height: 1.7;
  max-width: 480px;
}

.hero-actions,
.button-row,
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn-row-stretch .btn { flex: 1; }

/* ── Buttons ── */
.btn,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: 0.2s ease;
  border: none;
}

.btn-primary,
.primary-action {
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  color: #fff;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

.btn-primary:hover,
.primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
}

.btn-soft,
.secondary-action {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-soft:hover,
.secondary-action:hover {
  background: var(--bg);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.18); }

.btn-danger,
.secondary-action.danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-sm,
.primary-action.compact,
.secondary-action.compact {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.wide { width: 100%; }

/* ── Cards ── */
.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card-header,
.section-title {
  margin-bottom: 20px;
}

.card-header h2,
.section-title h2,
.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.layout-split,
.workspace-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
}

.layout-duo,
.library-grid,
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.card-sidebar { align-self: start; position: sticky; top: 88px; }

/* ── Forms ── */
.form-stack { display: flex; flex-direction: column; gap: 4px; }

.field,
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field > span,
label > span:first-child,
.field span:first-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

input, textarea, select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text);
  outline: none;
  transition: border 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
  background: #fff;
}

textarea { resize: vertical; line-height: 1.55; min-height: 80px; }

.form-grid,
.coach-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.field-full,
.coach-form label:nth-child(4) { grid-column: 1 / -1; }

/* ── Metrics ── */
.metric-row,
.project-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.metric,
.project-stats div {
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}

.metric strong,
.project-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-dark);
}

.metric span,
.project-stats span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Steps ── */
.step-scroll { overflow-x: auto; margin-bottom: 12px; padding-bottom: 4px; }

.step-strip {
  display: flex;
  gap: 8px;
  min-width: min-content;
}

.step-button {
  flex: 0 0 auto;
  min-width: 108px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  text-align: left;
  transition: 0.2s;
}

.step-button span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.step-button strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.step-button.active {
  background: var(--header);
  border-color: var(--header);
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.step-button.active span { color: #5eead4; }

.step-button.done {
  border-color: var(--primary);
  background: #f0fdfa;
}

.step-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.step-workspace,
.step-detail {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 20px;
  border: 1px solid var(--border);
}

.step-badge,
#stepKicker {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-intro h3,
.step-meta h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.step-intro p,
.step-meta p {
  margin: 0 0 16px;
  color: var(--text-secondary);
}

.info-grid,
.step-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.info-box,
.step-columns div {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.info-box h4,
.step-columns h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

ul { margin: 0; padding-left: 18px; }
li { margin: 6px 0; font-size: 14px; color: var(--text-secondary); }

/* ── AI sections ── */
.card-ai { padding: 28px; }

.segmented,
.tab-bar {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.segmented-item,
.tab {
  padding: 10px 20px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: 0.2s;
}

.segmented-item.active,
.tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.ai-result,
.output-box {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow: auto;
  max-height: 360px;
  border: 1px solid #1e293b;
}

.ai-result-light { background: var(--bg-soft); color: var(--text); border-color: var(--border); }

.ai-result.loading,
.output-box.loading { color: var(--text-muted); font-style: italic; }

.result-box,
.router-result {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f0fdfa, #ecfdf5);
  border: 1px solid #99f6e4;
}

.result-box strong,
.router-result strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.text-muted,
.muted { color: var(--text-secondary); }

/* ── Chat ── */
.chat-log {
  max-height: 320px;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.chat-bubble {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  max-width: 88%;
}

.chat-bubble span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.chat-bubble.user {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble.user span { color: rgba(255, 255, 255, 0.7); }

.chat-bubble.assistant {
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-empty { margin: 0; color: var(--text-muted); text-align: center; padding: 24px; }

/* ── Library ── */
.template-list, .case-list { display: flex; flex-direction: column; gap: 10px; }

.template-item, .case-item {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  transition: 0.2s;
}

.template-item:hover, .case-item:hover {
  border-color: var(--primary);
  background: #fff;
}

.template-item h3, .case-item h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
}

.template-item p, .case-item p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.copy-template {
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}

.copy-template:hover { border-color: var(--primary); color: var(--primary-dark); }

/* ── Support ── */
.support-grid,
.service-panel {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
}

.ticket-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  margin-bottom: 16px;
}

.ticket-item, .admin-ticket {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  margin-bottom: 8px;
}

.ticket-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.ticket-status { font-size: 11px; font-weight: 700; }
.status-open { color: var(--danger); }
.status-in_progress { color: #3b82f6; }
.status-closed { color: var(--primary-dark); }

.support-local-notice {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  font-size: 13px;
  color: var(--primary-dark);
}

/* ── Projects ── */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.project-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  text-align: left;
  transition: 0.15s;
}

.project-chip.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.project-chip strong { font-size: 14px; }
.project-chip span { font-size: 12px; color: var(--text-muted); }

.compact-row { gap: 8px; }

/* ── Notice & footer ── */
.mode-notice {
  max-width: var(--max);
  margin: 12px auto 0;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
}

.mode-notice.hidden { display: none; }
.mode-notice a { color: var(--primary-dark); font-weight: 600; }

.app-footer,
.footer {
  max-width: var(--max);
  margin: 32px auto;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-links { display: flex; gap: 16px; }
.footer-links a:hover { color: var(--primary); }

/* ── Toast ── */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--header);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  transition: 0.25s ease;
  pointer-events: none;
  z-index: 200;
}

.toast.show { opacity: 1; transform: translateY(0); }

/* ── Manage / admin pages ── */
.manage-body { background: var(--bg); }
.manage-main, .admin-shell, .legal-shell {
  max-width: 800px;
  margin: 24px auto 48px;
  padding: 0 20px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.stat-card span { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.stat-card strong { display: block; margin-top: 4px; font-size: 20px; font-family: var(--font-display); }

.panel-inset {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px dashed var(--border);
}

.coming-soon-panel { text-align: center; padding: 48px 24px; }

.output-box.compact { max-height: 140px; font-size: 12px; }
.mentor-note-input { width: 100%; margin-top: 8px; }

.ai-reply { line-height: 1.65; }

/* ── Playbook (always-visible workflow) ── */
.hero-compact {
  grid-template-columns: 1fr;
}

.hero-content-full {
  min-height: auto;
  padding: 28px 32px;
}

.card-playbook {
  border: 2px solid rgba(13, 148, 136, 0.25);
  box-shadow: var(--shadow-lg);
}

.playbook-phases {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.phase-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  min-width: 140px;
}

.phase-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.phase-steps {
  font-size: 11px;
  color: var(--text-muted);
}

.playbook-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.playbook-item {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

.playbook-item.done {
  border-color: rgba(13, 148, 136, 0.45);
  background: linear-gradient(180deg, rgba(13, 148, 136, 0.06), var(--surface));
}

.playbook-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.playbook-item-head h3 {
  margin: 4px 0 0;
  font-size: 18px;
}

.playbook-step-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.playbook-action {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.playbook-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.playbook-meta h4 {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.playbook-meta ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
}

.playbook-guide,
.default-guide {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-x: auto;
}

.step-action-line {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.default-guide-box {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.default-guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.default-guide-head h4 {
  margin: 0;
  font-size: 13px;
}

.app-header-light {
  background: var(--header);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.app-header-light .nav-link { color: var(--text-secondary); }
.app-header-light .nav-link.active,
.app-header-light .nav-link:hover { color: var(--primary); }

.brand-text-dark strong { color: var(--text); }
.brand-text-dark small { color: var(--text-muted); }

.brand-mark-purple {
  background: var(--gradient) !important;
}

.kicker-purple { color: var(--primary); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.hero-portal {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  padding: 32px;
  border-radius: var(--radius);
  background: var(--gradient);
  color: #fff;
}

.hero-portal h1 { color: #fff; margin: 0 0 12px; font-size: clamp(28px, 4vw, 40px); }
.hero-desc-dark { color: rgba(255,255,255,0.9) !important; max-width: none !important; }

.hero-preview-card {
  background: rgba(255,255,255,0.95);
  color: var(--text);
  align-self: center;
}

.capability-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cap-tag {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.2);
  font-size: 12px;
  font-weight: 600;
}

.section-head { margin-bottom: 16px; }
.section-head h2 { margin: 0 0 6px; }

.route-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.route-card-lg {
  padding: 20px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.route-card-lg.active { border-color: var(--primary); background: var(--primary-soft); }
.route-card-lg h3 { margin: 0 0 10px; color: var(--primary-dark); font-size: 16px; }
.route-card-lg p { margin: 0 0 6px; font-size: 13px; color: var(--text-secondary); }

.playbook-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  min-height: 400px;
}

.playbook-timeline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 520px;
  overflow-y: auto;
}

.timeline-step {
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--bg-soft);
  cursor: pointer;
}

.timeline-step.active { border-color: var(--primary); background: var(--primary-soft); }
.timeline-step.done strong { color: var(--primary-dark); }
.timeline-step span { font-size: 11px; font-weight: 700; color: var(--primary); min-width: 24px; }
.timeline-step strong { font-size: 12px; font-weight: 600; line-height: 1.3; }

.playbook-detail-panel { padding: 20px; max-height: 520px; overflow-y: auto; }

.workspace-triple {
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  gap: 16px;
  align-items: start;
}

.workspace-left .step-strip-vertical {
  flex-direction: column;
  max-height: 240px;
  overflow-y: auto;
}

.route-label { font-size: 12px; margin: 8px 0; color: var(--text-muted); }

.coach-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.deploy-section { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.deploy-section h3 { margin: 0 0 8px; font-size: 16px; }

.btn-primary { background: var(--gradient) !important; box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35) !important; }

.chat-log-compact { max-height: 160px; }
.ai-result-compact { max-height: 140px; font-size: 12px; }

@media (max-width: 1024px) {
  .hero-portal, .playbook-layout, .workspace-triple, .route-grid {
    grid-template-columns: 1fr;
  }
}


.btn-xs {
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
}

.tool-timeline {
  flex: 1 1 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(13, 148, 136, 0.45);
  background: rgba(13, 148, 136, 0.06);
}

.tool-timeline h4 {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tool-timeline ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.7;
}

.playbook-ops-wrap {
  margin-bottom: 14px;
}

.playbook-ops-wrap h4,
.default-guide-head h4 {
  margin: 0 0 10px;
  font-size: 13px;
}

.op-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.op-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.op-tag {
  flex-shrink: 0;
  min-width: 36px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border);
}

.op-command .op-tag { color: #b45309; border-color: #fcd34d; background: #fffbeb; }
.op-download .op-tag { color: #0369a1; border-color: #7dd3fc; background: #f0f9ff; }
.op-note .op-tag { color: #64748b; }

.op-body {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.55;
}

.op-body strong {
  display: block;
  margin-bottom: 4px;
}

.op-body p {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.op-body a {
  color: var(--primary);
  word-break: break-all;
}

.op-cmd {
  display: block;
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

.op-copy {
  margin-top: 4px;
}

.route-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 1 1 100%;
  margin-bottom: 12px;
}

.route-card {
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: 0.2s ease;
}

.route-card.active {
  border-color: var(--primary);
  background: rgba(13, 148, 136, 0.08);
}

.route-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.route-card span {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.share-main { max-width: 900px; }
.share-step { margin-bottom: 20px; }
.share-content {
  margin: 0;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.65;
}

.admin-main { max-width: 960px; }
.admin-tabs { margin-bottom: 20px; }
.admin-editor {
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.field.inline-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.ai-result.compact, .ai-result-light.compact {
  max-height: 120px;
  font-size: 12px;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .hero-banner, .hero-shell,
  .layout-split, .workspace-grid,
  .layout-duo, .library-grid,
  .support-grid, .service-panel {
    grid-template-columns: 1fr;
  }

  .card-sidebar { position: static; }

  .stats-strip, .dash-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-inner { flex-wrap: wrap; padding-bottom: 10px; }

  .main-nav, .nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .nav-link, .nav a { flex-shrink: 0; white-space: nowrap; }

  .route-picker {
    grid-template-columns: 1fr;
  }

  .playbook-meta {
    grid-template-columns: 1fr;
  }

  .playbook-item-head {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .app-main, main { padding: 12px; }
  .stats-strip, .dash-bar { grid-template-columns: 1fr; padding: 0 12px; }
  .form-grid, .coach-form, .info-grid, .step-columns { grid-template-columns: 1fr; }
  .ticket-form { grid-template-columns: 1fr; }
  .segmented, .tab-bar { width: 100%; flex-wrap: wrap; }
  .hero-content, .hero-copy { padding: 24px 20px; min-height: auto; }
  h1 { font-size: 24px; }
}

/* ── 简化版：介绍 + 20 步卡片 ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }

.site-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.intro-block {
  text-align: center;
  margin-bottom: 40px;
}

.intro-block h1 {
  margin: 0 0 12px;
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.25;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro-block > p {
  margin: 0 auto 24px;
  max-width: 640px;
  color: var(--text-secondary);
}

.intro-project {
  text-align: left;
  margin-bottom: 20px;
}

.intro-project h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

.intro-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.intro-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.intro-fields input,
.intro-fields select,
.step-record,
.step-ask,
.step-error,
.support-form input,
.support-form select,
.support-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.intro-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 14px;
}

.btn-lg { min-height: 48px; padding: 0 28px; font-size: 15px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-xs { min-height: 28px; padding: 0 8px; font-size: 12px; }

.steps-block { margin-top: 8px; }

.steps-heading {
  margin: 0 0 8px;
  font-size: 22px;
}

.steps-rule {
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

.step-card {
  margin-bottom: 28px;
  padding: 22px;
  border: 1px solid var(--border);
  scroll-margin-top: 80px;
}

.step-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.step-num {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.step-card-head h3 {
  margin: 0;
  flex: 1;
  font-size: 18px;
}

.step-done-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 600;
}

.step-section {
  margin-bottom: 18px;
}

.step-section:last-child { margin-bottom: 0; }

.step-section h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--primary-dark);
}

.step-section p,
.step-section ul {
  margin: 0 0 8px;
  font-size: 14px;
}

.muted { color: var(--text-muted); font-size: 13px; }

.warn-title {
  margin: 10px 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: #b45309;
}

.warn-list { color: #92400e; }

.op-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.op-item {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 14px;
}

.op-item code {
  display: block;
  margin: 6px 0;
  padding: 8px;
  border-radius: 6px;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.op-item a {
  color: var(--primary-dark);
  word-break: break-all;
}

.op-note { background: #fffbeb; border-color: #fde68a; }

.software-list {
  margin: 0;
  padding-left: 18px;
}

.software-list a {
  color: var(--primary-dark);
  font-weight: 600;
}

.template-pre {
  margin: 0 0 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 200px;
  overflow: auto;
}

.step-ai-box textarea { margin-bottom: 8px; }

.file-label {
  display: block;
  margin: 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.screenshot-preview img {
  max-width: 100%;
  max-height: 180px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.ai-result {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  max-height: 320px;
  overflow: auto;
}

.support-block { scroll-margin-top: 80px; }

.support-block h2 { margin-top: 0; }

.support-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  padding: 24px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.site-footer a { color: var(--primary-dark); }

@media (max-width: 640px) {
  .intro-fields { grid-template-columns: 1fr; }
  .site-header { flex-wrap: wrap; padding-bottom: 10px; }
  .site-header nav { order: 3; width: 100%; }
}

/* ── layout.js 共享顶栏（poster-generator 风格） ── */
.site-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.site-header .logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--gradient);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
}

.site-header .logo-text { display: flex; flex-direction: column; gap: 2px; }
.site-header .logo-title { font-size: 14px; font-weight: 800; line-height: 1.2; }
.site-header .logo-tagline { font-size: 11px; color: var(--text-muted); max-width: 280px; line-height: 1.3; }

.site-header .nav-links {
  flex: 1;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.site-header .nav-links a {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: 0.2s;
}

.site-header .nav-links a:hover,
.site-header .nav-links a.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.site-header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-header .btn.ghost {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
}

.site-header .btn.primary {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--gradient);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.site-header .usage-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
}

.site-header .nav-toggle {
  display: none;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.site-footer .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.site-footer .footer-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
}

.site-footer .footer-tip {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-muted);
  max-width: 520px;
}

.site-footer .footer-meta a { color: var(--primary-dark); margin: 0 4px; }

@media (max-width: 860px) {
  .site-header .nav-toggle { display: inline-flex; }
  .site-header .nav-links {
    display: none;
    width: 100%;
    order: 4;
    flex-direction: column;
  }
  .site-header .nav-links.open { display: flex; }
  .site-header .logo-tagline { display: none; }
}
