/* ============================================
   AI Roundtable - 深色科技风格样式
   ============================================ */

/* --- CSS 变量 --- */
:root {
  /* 主题色 - 极简极深科技风格 */
  --bg-primary: #050505;
  --bg-secondary: #0a0a0a;
  --bg-card: rgba(15, 15, 15, 0.45);
  --bg-card-hover: rgba(25, 25, 25, 0.6);
  --bg-glass: rgba(255, 255, 255, 0.02);
  --border-color: rgba(255, 255, 255, 0.05);
  --border-glow: rgba(99, 102, 241, 0.2);

  /* 文字 */
  --text-primary: #f3f4f6;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;

  /* 强调色 */
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* 模型品牌色 */
  --color-deepseek-pro: #6366f1;
  --color-kimi: #8b5cf6;
  --color-doubao-pro: #3b82f6;
  --color-glm: #10b981;
  --color-minimax: #f59e0b;
  --color-deepseek-flash: #a78bfa;
  --color-doubao-lite: #60a5fa;

  /* 布局 */
  --navbar-height: 64px;
  --input-bar-height: 80px;
  --panel-left-width: 240px;
  --panel-right-width: 320px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  /* 动画 */
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- 字体工具类 --- */
.font-display {
  font-family: 'Noto Serif SC', '思源宋体', 'Georgia', serif;
}
.font-mono {
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
  letter-spacing: 0.05em;
}
.italic {
  font-style: italic;
}
.font-light {
  font-weight: 300;
}
.font-bold {
  font-weight: 600;
}

/* --- 全局样式 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
  color: var(--text-primary);
  color-scheme: dark; /* 强制浏览器原生组件（如下拉菜单）使用深色模式 */
}

body {
  font-family: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 噪点纹理 Overlay */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* 自定义鼠标光标 */
.custom-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
  opacity: 0;
  transition: width 0.3s ease, height 0.3s ease;
  will-change: transform;
}
.custom-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
  opacity: 0;
  transition: border-color 0.3s ease, background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s cubic-bezier(0.16, 1, 0.3, 1), height 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.05s linear;
  will-change: transform;
}

/* 鼠标悬停到可交互元素时的状态 */
.custom-cursor-ring.hovering {
  width: 64px;
  height: 64px;
  background-color: #fff;
  border-color: transparent;
}
.custom-cursor-dot.hovering {
  width: 4px;
  height: 4px;
}

/* 背景虚化装饰 */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.06) 0%, transparent 40%),
              radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.04) 0%, transparent 45%),
              radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.02) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  transition: background var(--transition-fast);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ============================================
   导航栏
   ============================================ */
.navbar {
  height: var(--navbar-height);
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo-icon {
  font-size: 20px;
  animation: float 4s ease-in-out infinite;
}

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

.navbar-brand h1 {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.badge {
  font-size: 9px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 导航栏状态指示灯 */
.system-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 8px;
  border-right: 1px solid var(--border-color);
}

.pulse-dot-container {
  position: relative;
  display: inline-flex;
  width: 8px;
  height: 8px;
}

.pulse-dot-ping {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--success);
  opacity: 0.75;
  animation: ping-anim 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.pulse-dot-core {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
}

@keyframes ping-anim {
  75%, 100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

.status-label {
  font-size: 10px;
  color: var(--success);
  font-weight: 500;
}

/* ============================================
   按钮
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-primary {
  background: #fff;
  color: #000;
  border-color: #fff;
  font-weight: 600;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
}
.btn-primary:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.15);
}
.btn-primary:active {
  transform: scale(0.98);
}

.btn-start-glow {
  padding-right: 32px;
}

.btn-pulse-dot {
  position: absolute;
  right: 12px;
  top: calc(50% - 4px);
  width: 8px;
  height: 8px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-primary);
  animation: pulse-dot-glow 2s infinite ease-in-out;
}

@keyframes pulse-dot-glow {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
    box-shadow: 0 0 14px var(--accent-primary);
  }
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  font-weight: 600;
  padding: 10px 20px;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}
.btn-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.btn-icon {
  font-size: 16px;
}

/* ============================================
   主内容布局
   ============================================ */
.main-content {
  display: flex;
  height: calc(100vh - var(--navbar-height) - var(--input-bar-height));
  overflow: hidden;
}

/* --- 面板通用 --- */
.panel {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
}

.panel-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.panel-title-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.panel-header h2 {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.panel-header h2 .italic {
  color: var(--text-secondary);
}

/* Stage header styles */
.stage-header {
  border-bottom: 1px solid var(--border-color);
}

/* ============================================
   左侧: 模型面板
   ============================================ */
.panel-models {
  width: var(--panel-left-width);
  min-width: var(--panel-left-width);
  display: flex;
  flex-direction: column;
}

.model-count {
  font-size: 10px;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
}

.model-list {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.model-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  user-select: none;
  background: rgba(255, 255, 255, 0.01);
}

.model-card:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.03);
}

.model-card.active {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-color);
}

.model-card.responding {
  border-color: var(--model-color, var(--accent-primary));
  box-shadow: 0 0 16px rgba(var(--model-color-rgb, 99, 102, 241), 0.15);
  background: rgba(var(--model-color-rgb, 99, 102, 241), 0.03);
}

.model-avatar {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.model-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.model-info {
  flex: 1;
  min-width: 0;
}

.model-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-status {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}

.model-check {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.model-card.selected .model-check {
  background: var(--model-color, var(--accent-primary));
  border-color: var(--model-color, var(--accent-primary));
}
.model-card.selected .model-check::after {
  content: '✓';
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}

.panel-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background: rgba(5, 5, 5, 0.2);
}

.legend {
  display: flex;
  gap: 16px;
  font-size: 10px;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.dot-active { background: var(--success); }
.dot-bench { background: var(--text-muted); }

/* ============================================
   中间: 讨论主舞台
   ============================================ */
.panel-discussion {
  flex: 1;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

/* 欢迎界面 */
.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 40px;
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.01) 0%, transparent 60%);
}

/* 纯 CSS 智能全息球 */
.sentient-sphere-fallback {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.sphere-core {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 80%);
  box-shadow: 0 0 50px rgba(99, 102, 241, 0.5),
              0 0 100px rgba(139, 92, 246, 0.2);
  animation: pulse-core 4s infinite ease-in-out;
}

.sphere-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.ring-1 {
  width: 160px;
  height: 160px;
  animation: rotate-ring 18s linear infinite;
  border-color: rgba(99, 102, 241, 0.18);
}

.ring-2 {
  width: 220px;
  height: 220px;
  animation: rotate-ring-reverse 28s linear infinite;
  border-color: rgba(139, 92, 246, 0.12);
}

@keyframes pulse-core {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.12);
    opacity: 1;
    box-shadow: 0 0 70px rgba(99, 102, 241, 0.7),
                0 0 120px rgba(139, 92, 246, 0.3);
  }
}

@keyframes rotate-ring {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes rotate-ring-reverse {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

.welcome-screen h2 {
  font-size: 36px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.welcome-subtitle {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--accent-primary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: -4px;
}

.welcome-desc {
  color: var(--text-secondary);
  font-size: 13px;
  max-width: 480px;
  line-height: 1.7;
  margin: 12px 0 24px;
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tag {
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* 讨论流 */
.discussion-feed {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  scroll-behavior: smooth;
}

/* 轮次分隔 */
.round-container {
  margin-bottom: 24px;
}

.round-messages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

.round-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
}

.round-divider:first-child {
  margin-top: 0;
}

.round-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.round-divider-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--accent-primary);
  padding: 4px 10px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 4px;
  white-space: nowrap;
}

/* 讨论消息卡片 */
.message-card {
  background: rgba(15, 15, 15, 0.5);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-top: 2px solid var(--model-color, var(--accent-primary));
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  transition: all var(--transition-normal);
  animation: slideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.round-messages .message-card {
  margin-bottom: 0;
  height: 100%;
}

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

.message-card:hover {
  background: rgba(25, 25, 25, 0.5);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.message-card.streaming {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 25px rgba(var(--model-color-rgb, 99, 102, 241), 0.08);
}

.message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.message-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-avatar {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.message-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.message-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(245, 158, 11, 0.08);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.message-tokens {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================
   思考过程区块（模仿 DeepSeek / Claude UI）
   ============================================ */
.thinking-block {
  margin: 8px 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), rgba(99, 102, 241, 0.04));
  overflow: hidden;
  transition: all var(--transition-normal);
}

.thinking-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.thinking-header:hover {
  background: rgba(139, 92, 246, 0.08);
}

.thinking-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.thinking-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-secondary);
  flex: 1;
}

.thinking-toggle {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform var(--transition-normal);
  flex-shrink: 0;
}

/* 折叠状态 */
.thinking-block.collapsed .thinking-body {
  max-height: 0;
  opacity: 0;
  padding: 0 12px;
}

.thinking-block.collapsed .thinking-toggle {
  transform: rotate(-90deg);
}

/* 展开状态 */
.thinking-body {
  max-height: 400px;
  opacity: 1;
  overflow-y: auto;
  padding: 0 12px 10px;
  transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
}

.thinking-content {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Inter', monospace;
}

/* 思考中的动画效果 — 给 streaming 状态下的 thinking-header 加脉冲 */
.message-card.streaming .thinking-block .thinking-label::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent-secondary);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  animation: thinkingPulse 1.5s ease-in-out infinite;
}

@keyframes thinkingPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* 思考块 inside grid 卡片的 scrollbar */
.thinking-body::-webkit-scrollbar {
  width: 4px;
}
.thinking-body::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 2px;
}

.message-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.message-content p { margin-bottom: 8px; }
.message-content p:last-child { margin-bottom: 0; }

/* 打字动画 */
.typing-indicator {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--model-color, var(--accent-primary));
  animation: typing 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* 系统消息 */
.system-message {
  text-align: center;
  padding: 8px 16px;
  margin: 8px 0;
  font-size: 12px;
  color: var(--text-muted);
  animation: fadeIn 0.3s ease;
}

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

.system-message.substitute {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.08);
  border-radius: var(--radius-sm);
}

.system-message.error {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  border-radius: var(--radius-sm);
}

.system-message.consensus {
  color: var(--info);
  background: rgba(59, 130, 246, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

/* 结论卡片 */
.conclusion-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(99, 102, 241, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 20px;
  animation: slideIn 0.6s ease-out;
}

.conclusion-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.conclusion-card .conclusion-text {
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
}

/* ============================================
   右侧: 状态面板
   ============================================ */
.panel-status {
  width: var(--panel-right-width);
  min-width: var(--panel-right-width);
  border-right: none;
  border-left: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.status-section {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.section-title-tag {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* 状态指示器 */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.idle { background: var(--text-muted); }
.status-dot.running {
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}
.status-dot.completed { background: var(--success); }
.status-dot.error { background: var(--danger); }
.status-dot.stopped { background: var(--warning); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.status-text {
  font-size: 12px;
  font-weight: 500;
}

.round-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.round-display {
  font-weight: 600;
  color: var(--accent-primary);
  font-size: 13px;
}

/* 共识进度条 */
.consensus-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.consensus-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.consensus-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent-gradient);
  transition: width 0.8s ease;
  position: relative;
}

.consensus-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.consensus-score {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-primary);
  min-width: 36px;
  text-align: right;
}

.consensus-details {
  margin-top: 12px;
}

.consensus-points, .consensus-disagreements {
  margin-bottom: 8px;
}

.consensus-points h4, .consensus-disagreements h4 {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
}

.consensus-points h4 { color: var(--success); }
.consensus-disagreements h4 { color: var(--warning); }

.consensus-points ul, .consensus-disagreements ul {
  list-style: none;
  font-size: 12px;
  color: var(--text-secondary);
}

.consensus-points li::before { content: '✓ '; color: var(--success); }
.consensus-disagreements li::before { content: '✗ '; color: var(--warning); }

/* Token 计数器 */
.token-counter {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.token-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
}

.token-label {
  color: var(--text-muted);
}

.token-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.token-total {
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  margin-top: 2px;
}

.token-total .token-value {
  color: var(--accent-primary);
  font-size: 15px;
}

.model-tokens {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.model-token-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 11px;
}

.model-token-name {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.model-token-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.model-token-value {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* 结论区域 */
.conclusion-section {
  background: rgba(16, 185, 129, 0.05);
}

.conclusion-content {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ============================================
   底部输入栏
   ============================================ */
.input-bar {
  height: var(--input-bar-height);
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 28px;
  z-index: 100;
}

.input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
}

.mode-select, .rounds-select {
  appearance: none;
  background: rgba(255, 255, 255, 0.05); /* 更亮一点的底色 */
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15); /* 更明显的边框 */
  border-radius: var(--radius); /* 更大的圆角 */
  padding: 12px 16px;
  font-size: 12px;
  letter-spacing: 0.05em;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
}

/* 针对部分浏览器强制下拉选项使用深底白字 */
select option {
  background-color: #111;
  color: #fff;
}

.mode-select:hover, .rounds-select:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.mode-select:focus, .rounds-select:focus {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

.mode-select {
  min-width: 150px;
}

.rounds-select {
  min-width: 90px;
}

.question-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06); /* 更明显的背景 */
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.2); /* 更高对比度的边框 */
  border-radius: var(--radius); /* 圆角加大 */
  padding: 14px 20px; /* 增加内边距使输入框更高大 */
  font-size: 14px; /* 增大字号 */
  outline: none;
  transition: all var(--transition-fast);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); /* 增加内阴影产生深度感 */
}

.question-input::placeholder {
  color: var(--text-muted);
}

.question-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.15), inset 0 2px 4px rgba(0,0,0,0.2);
  background: rgba(255, 255, 255, 0.08);
}

/* ============================================
   弹窗
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal {
  background: #0a0a0a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-large {
  max-width: 900px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

/* 历史列表 */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.history-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
}

.history-question {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-meta {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--text-muted);
}

.history-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 14px;
}

/* 历史详情 */
.detail-round {
  margin-bottom: 24px;
}

.detail-round-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.detail-response {
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-primary);
  margin-bottom: 8px;
}

.detail-response-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.detail-response-content {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.detail-conclusion {
  padding: 20px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius);
  margin-top: 16px;
}

.detail-conclusion h3 {
  color: var(--success);
  font-size: 15px;
  margin-bottom: 10px;
}

.detail-conclusion-content {
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* 继续讨论区域 */
.continue-discussion-section {
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.06));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius);
}

.continue-discussion-section h3 {
  color: var(--accent-primary);
  font-size: 15px;
  margin-bottom: 6px;
}

.continue-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.continue-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.continue-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.continue-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.continue-input::placeholder {
  color: var(--text-muted);
}

.continue-rounds-select {
  padding: 10px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.continue-btn {
  white-space: nowrap;
  padding: 10px 20px;
  font-size: 14px;
}

/* ============================================
   响应式布局
   ============================================ */
@media (max-width: 1200px) {
  .panel-status {
    width: 260px;
    min-width: 260px;
  }
}

@media (max-width: 900px) {
  .panel-models {
    width: 180px;
    min-width: 180px;
  }
  .panel-status {
    width: 220px;
    min-width: 220px;
  }
}

@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }
  .panel-models, .panel-status {
    width: 100%;
    min-width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .panel-status {
    border-left: none;
    border-top: 1px solid var(--border-color);
  }
  .model-list {
    flex-direction: row;
    overflow-x: auto;
  }
  .input-wrapper {
    flex-wrap: wrap;
  }
  .btn-text {
    display: none;
  }
}

/* ============================================
   设置弹窗
   ============================================ */
.modal-settings {
  max-width: 480px;
}

.settings-group {
  margin-bottom: 20px;
}

.settings-group:last-child {
  margin-bottom: 0;
}

.settings-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 8px;
}

.settings-item:last-child {
  margin-bottom: 0;
}

.settings-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
}

.settings-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-item-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.settings-item-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Toggle 开关 */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #fff;
}

/* ============================================
   全局：隐藏思考过程
   ============================================ */
body.hide-thinking .thinking-block {
  display: none !important;
}

/* ============================================
   主页视图 (Homepage)
   ============================================ */
.homepage-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  background: #050505;
  overflow: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.homepage-view.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.webgl-canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.webgl-canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* 主页顶部导航 */
.hp-navbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
}

.hp-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-secondary);
}

.hp-logo-text {
  font-size: 12px;
  letter-spacing: 0.2em;
}

.hp-logo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  transition: transform 0.3s ease;
}

.hp-logo:hover .hp-logo-dot {
  transform: scale(1.8);
}

.hp-nav {
  display: flex;
  gap: 32px;
}

.hp-nav-link {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  cursor: default;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hp-nav-num {
  color: var(--accent-primary);
  margin-right: 2px;
}

.hp-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

.hp-status-dot-wrap {
  position: relative;
  display: inline-flex;
  width: 8px;
  height: 8px;
}

.hp-status-dot-wrap .pulse-dot-ping {
  background-color: var(--accent-primary);
}

.hp-status-dot-wrap .pulse-dot-core {
  background-color: var(--accent-primary);
}

/* 主页大标题 */
.hp-title-top-left {
  position: absolute;
  top: 100px;
  left: 40px;
  z-index: 10;
  animation: hp-fade-in-up 1s 0.2s both cubic-bezier(0.16, 1, 0.3, 1);
}

.hp-title-bottom-right {
  position: absolute;
  bottom: 100px;
  right: 40px;
  z-index: 10;
  text-align: right;
  animation: hp-fade-in-up 1s 0.4s both cubic-bezier(0.16, 1, 0.3, 1);
}

.hp-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.hp-title {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 300;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

@keyframes hp-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 中心按钮 */
.hp-center-btn-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  animation: hp-fade-in-scale 0.8s 0.6s both cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hp-fade-in-scale {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.hp-login-trigger {
  position: relative;
  padding: 14px 36px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  color: var(--text-primary);
  font-size: 13px;
  letter-spacing: 0.3em;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.5s ease;
}

.hp-login-trigger:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.hp-btn-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulse-dot-glow 2s infinite;
}

/* 底部滚动指示 */
.hp-scroll-indicator {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: hp-bounce 1.5s infinite ease-in-out;
}

.hp-scroll-indicator span {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.hp-scroll-line {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
}

@keyframes hp-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ============================================
   登录弹窗
   ============================================ */
.login-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.login-modal {
  position: relative;
  width: 380px;
  padding: 48px 40px 40px;
  background: rgba(12, 12, 12, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  backdrop-filter: blur(40px);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: modalIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}

.login-modal-close:hover {
  color: var(--text-primary);
}

.login-modal-title {
  font-size: 28px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.login-input {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.3s ease;
}

.login-input:focus {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.08);
}

.login-input::placeholder {
  color: var(--text-muted);
}

.login-error {
  font-size: 12px;
  color: var(--danger);
  text-align: center;
  padding: 8px;
  background: rgba(239, 68, 68, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.login-submit {
  padding: 14px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 4px;
}

.login-submit:hover {
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.login-submit:active {
  transform: translateY(0) scale(0.98);
}

/* ============================================
   工作台视图过渡
   ============================================ */
.workbench-view {
  animation: workbench-enter 0.6s ease;
}

@keyframes workbench-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 退出登录按钮 */
.btn-logout {
  border-left: 1px solid var(--border-color);
  padding-left: 16px;
  margin-left: 4px;
}

.btn-logout:hover {
  color: var(--danger) !important;
}

/* ============================================
   超时操作浮层（跳过 / 切换模型）
   ============================================ */
.timeout-overlay {
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  animation: fadeIn 0.3s ease;
}

.timeout-msg {
  font-size: 12px;
  color: var(--warning);
  margin: 0 0 10px 0;
  letter-spacing: 0.04em;
}

.timeout-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.timeout-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.2s;
  white-space: nowrap;
}

.skip-btn {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}
.skip-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}

.switch-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timeout-select {
  padding: 6px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
.timeout-select:focus {
  border-color: var(--accent-primary);
}
.timeout-select option {
  background: #1a1a1a;
  color: var(--text-primary);
}

.switch-btn {
  background: transparent;
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--accent-primary);
}
.switch-btn:hover {
  background: rgba(99, 102, 241, 0.1);
}

/* ============================================
   Markdown 渲染样式 (.md-body)
   ============================================ */
.md-body {
  line-height: 1.75;
  color: var(--text-primary);
  word-break: break-word;
}
.md-body p { margin: 0 0 0.75em 0; }
.md-body p:last-child { margin-bottom: 0; }

.md-body h1, .md-body h2, .md-body h3,
.md-body h4, .md-body h5, .md-body h6 {
  font-family: 'Noto Serif SC', serif;
  font-weight: 600;
  line-height: 1.4;
  margin: 1em 0 0.4em 0;
  color: var(--text-primary);
}
.md-body h1 { font-size: 1.2em; border-bottom: 1px solid var(--border-color); padding-bottom: 4px; }
.md-body h2 { font-size: 1.05em; border-bottom: 1px solid var(--border-color); padding-bottom: 3px; }
.md-body h3 { font-size: 1em; }
.md-body h4, .md-body h5, .md-body h6 { font-size: 0.93em; color: var(--text-secondary); }

.md-body ul, .md-body ol {
  margin: 0.4em 0 0.7em 0;
  padding-left: 1.4em;
}
.md-body li { margin-bottom: 0.25em; }
.md-body ul li { list-style-type: disc; }
.md-body ol li { list-style-type: decimal; }
.md-body li > p { margin: 0; }
.md-body ul ul, .md-body ol ol,
.md-body ul ol, .md-body ol ul { margin: 0.15em 0; }

.md-body strong { font-weight: 600; color: var(--text-primary); }
.md-body em { font-style: italic; color: var(--text-secondary); }

.md-body code {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.84em;
  color: #a5b4fc;
}

.md-body pre {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 0.7em 0;
  overflow-x: auto;
}
.md-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82em;
  color: #e2e8f0;
  line-height: 1.6;
}

.md-body blockquote {
  margin: 0.7em 0;
  padding: 9px 14px;
  border-left: 3px solid var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
  font-style: italic;
}
.md-body blockquote p { margin: 0; }

.md-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.7em 0;
  font-size: 0.87em;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.md-body th {
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-primary);
  font-weight: 600;
  text-align: left;
  padding: 7px 12px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}
.md-body td {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: top;
}
.md-body tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.md-body tr:hover td { background: rgba(99,102,241,0.05); }

.md-body hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 1em 0;
}

.md-body a { color: var(--accent-primary); text-decoration: none; }
.md-body a:hover { text-decoration: underline; color: var(--accent-secondary); }
