:root {
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-soft: #f5f0ff;
  --primary-border: #ddd6fe;
  --bg-page: #f3f4f6;
  --bg-marketing: #ffffff;
  --sidebar: #ffffff;
  --text: #111827;
  --text-secondary: #4b5563;
  --muted: #9ca3af;
  --line: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.05);
  --shadow-md: 0 4px 14px rgba(17, 24, 39, 0.06);
  --radius: 10px;
  --radius-lg: 14px;
  --sidebar-w: 248px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-page);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  display: none;
}

.page.show {
  display: block;
}

/* —— 营销首页 —— */
.marketing {
  min-height: 100vh;
  background-color: var(--bg-marketing);
  background-image: radial-gradient(circle at 1px 1px, #e5e7eb 1px, transparent 0);
  background-size: 24px 24px;
  position: relative;
}

.marketing::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 140px;
  transform: translateX(-50%);
  width: min(900px, 90vw);
  height: 320px;
  background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.14) 0%, transparent 70%);
  pointer-events: none;
}

.m-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.m-wrap {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.nav-row {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, #a78bfa 100%);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.brand-mark.sm {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.m-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.m-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
}

.m-nav a:hover {
  color: var(--text);
}

.has-chevron::after {
  content: " ▾";
  font-size: 10px;
  opacity: 0.6;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero {
  position: relative;
  text-align: center;
  padding: 56px 16px 100px;
  z-index: 1;
}

.tag {
  display: inline-block;
  margin: 0 0 20px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 999px;
}

.hero-kicker {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.hero-title {
  margin: 0 0 16px;
  font-size: clamp(36px, 6vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}

.hero-sub {
  margin: 0 auto;
  max-width: 640px;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.trust-row {
  margin-top: 56px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px 48px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.trust-ic {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--primary);
}

/* —— 按钮 —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-light {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-light:hover {
  background: #f9fafb;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: #f3f4f6;
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.btn-outline:hover {
  background: var(--primary-soft);
}

.btn-pill {
  border-radius: 999px;
}

.btn-lg {
  padding: 12px 22px;
  font-size: 15px;
}

.btn-lang {
  border: 1px solid var(--line) !important;
  background: #fff !important;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 16px;
}

.btn-danger-ghost {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.full {
  width: 100%;
}

.subtle {
  font-size: 13px;
  color: var(--muted);
}

.play-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent var(--primary);
}

/* 悬浮客服 */
.fab-chat {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
}

/* —— 控制台布局 —— */
.console {
  display: none;
  min-height: 100vh;
}

.console.show {
  display: flex;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 20px;
  font-weight: 700;
  font-size: 16px;
  color: var(--primary);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  transition: background 0.12s, color 0.12s;
}

.side-item:hover {
  background: #f9fafb;
  color: var(--text);
}

.side-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.side-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}

.si-ic {
  width: 20px;
  height: 20px;
  opacity: 0.85;
  flex-shrink: 0;
  background: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.si-dash {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath d='M4 6h16M4 12h16M4 18h7'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath d='M4 6h16M4 12h16M4 18h7'/%3E%3C/svg%3E");
}

.si-folder {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath d='M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-7l-2-2H5a2 2 0 00-2 2z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath d='M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-7l-2-2H5a2 2 0 00-2 2z'/%3E%3C/svg%3E");
}

.si-robot {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Crect x='4' y='8' width='16' height='12' rx='2'/%3E%3Cpath d='M9 8V6a3 3 0 016 0v2M9 15h.01M15 15h.01'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Crect x='4' y='8' width='16' height='12' rx='2'/%3E%3Cpath d='M9 8V6a3 3 0 016 0v2M9 15h.01M15 15h.01'/%3E%3C/svg%3E");
}

.si-spark {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l1.8 5.5L19 9l-5.2 1.5L12 16l-1.8-5.5L5 9l5.2-1.5L12 2z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l1.8 5.5L19 9l-5.2 1.5L12 16l-1.8-5.5L5 9l5.2-1.5L12 2z'/%3E%3C/svg%3E");
}

.si-tiktok {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M16.6 5.82s.51.5 1.3.5c.8 0 1.47-.67 1.47-1.5 0-.83-.67-1.5-1.5-1.5v3.5c-1.1 0-2.08-.45-2.8-1.17V14a3.5 3.5 0 11-3.5-3.5c.12 0 .24.01.35.02V9.4a5.5 5.5 0 105.5 5.5V5.82h-.32z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M16.6 5.82s.51.5 1.3.5c.8 0 1.47-.67 1.47-1.5 0-.83-.67-1.5-1.5-1.5v3.5c-1.1 0-2.08-.45-2.8-1.17V14a3.5 3.5 0 11-3.5-3.5c.12 0 .24.01.35.02V9.4a5.5 5.5 0 105.5 5.5V5.82h-.32z'/%3E%3C/svg%3E");
}

.si-subtitle {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M7 10h10M7 14h6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M7 10h10M7 14h6'/%3E%3C/svg%3E");
}

.si-faceswap {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8 7h12m0 0l-4-4m4 4l-4 4M16 17H4m0 0l4 4m-4-4l4-4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8 7h12m0 0l-4-4m4 4l-4 4M16 17H4m0 0l4 4m-4-4l4-4'/%3E%3C/svg%3E");
}

.side-footer {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 8px;
}

.side-links a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.side-links a:hover {
  color: var(--primary);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafafa;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}

.user-avatar.lg {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-points {
  font-size: 12px;
  color: var(--muted);
}

.user-points em {
  font-style: normal;
  color: var(--primary);
  font-weight: 600;
}

.workspace {
  flex: 1;
  padding: 20px 24px 32px;
  min-width: 0;
  overflow-x: hidden;
}

.panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.panel.show {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.card-elevated {
  box-shadow: var(--shadow-sm);
}

.card.flat {
  box-shadow: none;
}

.card-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.card-title.tight {
  margin-bottom: 0;
}

.card-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.link-muted {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.link-muted:hover {
  color: var(--primary);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.flex-spacer {
  flex: 1;
}

/* Dashboard */
.dash-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.banner-tiktok {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  background: linear-gradient(90deg, #faf5ff 0%, #fff 100%);
  border-color: var(--primary-border);
}

.banner-tiktok p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 520px;
}

.chart-card {
  margin-bottom: 14px;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.seg {
  display: flex;
  gap: 4px;
  background: #f3f4f6;
  padding: 4px;
  border-radius: 8px;
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
}

.seg-btn.active {
  background: #fff;
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.chart-placeholder {
  height: 220px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
  border: 1px dashed var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-ic {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.kpi-purple {
  background: #ede9fe;
}
.kpi-blue {
  background: #dbeafe;
}
.kpi-green {
  background: #d1fae5;
}
.kpi-orange {
  background: #ffedd5;
}
.kpi-red {
  background: #fee2e2;
}
.kpi-violet {
  background: #f3e8ff;
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
}

.kpi-val {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-leader {
  margin-top: 4px;
}

/* Assets */
.assets-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 12px 16px;
}

.tabs-pill {
  display: flex;
  gap: 6px;
}

.tab-pill {
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  background: #f3f4f6;
  color: var(--text-secondary);
  font-family: inherit;
}

.tab-pill.active {
  background: var(--primary);
  color: #fff;
}

.select-inline {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 13px;
  background: #fff;
  color: var(--text-secondary);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 12px 16px;
}

.toolbar .grow {
  flex: 1;
  min-width: 160px;
}

/* Agent 三栏 */
.agent-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 16px;
  align-items: start;
}

.agent-config .field-block,
.left-config .field-block {
  margin-bottom: 16px;
}

.field-block label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.req {
  color: #ef4444;
}

.field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.dashed-add {
  width: 100%;
  padding: 28px 16px;
  border: 1px dashed #c4b5fd;
  border-radius: var(--radius);
  background: #faf5ff;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.dashed-add:hover {
  background: var(--primary-soft);
}

.cost-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  margin-bottom: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.warn-points {
  color: #dc2626;
  font-size: 13px;
}

.warn-points strong {
  font-weight: 700;
}

.agent-tasks {
  min-height: 480px;
}

/* Studio */
.studio-prompt {
  margin-bottom: 16px;
  position: relative;
}

.prompt-toolbar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.prompt-area {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
}

.prompt-area:focus {
  outline: none;
  border-color: #c4b5fd;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.prompt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 10px;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.scenario {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.panel-page-intro {
  margin-bottom: 14px;
  padding: 18px 20px;
}

.page-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-desc {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.tool-page-card {
  max-width: 720px;
}

.tool-page-card > .btn-primary {
  margin-top: 8px;
}

.tool-page-card label,
.tool-page-card .label-row {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 4px;
}

.label-row {
  margin-bottom: 6px !important;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
}

.mini-field label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.upload-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.upload-inline input[type="file"] {
  flex: 1;
  min-width: 200px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.job-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 10px;
}

.result-box {
  margin-top: 12px;
  min-height: 100px;
  padding: 12px;
  background: #f9fafb;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, monospace;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #c4b5fd;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Publish */
.subtabs {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.subtab {
  border: none;
  background: none;
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.subtab.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

.publish-layout {
  display: grid;
  grid-template-columns: minmax(300px, 400px) 1fr;
  gap: 16px;
  align-items: start;
}

.auth-box {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-zone {
  border: 1px dashed #c4b5fd;
  border-radius: var(--radius);
  padding: 32px 16px;
  text-align: center;
  background: #fafafa;
}

.upload-ic {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
}

.toggle-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle {
  flex: 1;
  min-width: 90px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-secondary);
}

.toggle.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.counter {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.publish-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Empty */
.empty-state {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  padding: 32px;
}

.empty-state.sm {
  min-height: 160px;
}

.empty-ic {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #f3f4f6;
  display: grid;
  place-items: center;
  font-size: 22px;
  margin-bottom: 12px;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.empty-hint {
  margin-top: 6px !important;
  font-size: 13px !important;
  color: var(--muted) !important;
}

.right-list {
  min-height: 520px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(17, 24, 39, 0.45);
  padding: 40px 16px;
  overflow-y: auto;
}

.modal.show {
  display: block;
}

.modal-card {
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 24px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.profile-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
}

.profile-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-nav {
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
}

.profile-nav:hover {
  background: #f3f4f6;
}

.profile-nav.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.profile-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inner-card {
  padding: 16px 18px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-phone {
  margin: 0;
  font-weight: 600;
  font-size: 16px;
}

.profile-row-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 1200px) {
  .kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .m-nav {
    display: none;
  }

  .agent-layout,
  .publish-layout,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .scenario-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .console.show {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
    flex: 1 1 auto;
  }

  .side-footer {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }
}
