/* ===== TCAD Simulation Manager - Bundled CSS ===== */

/* ===== renderer/css/tokens.css ===== */
/* ============================================
   Design Tokens - 设计令牌
   ============================================ */

/* ===== 1. 主色调 - Primary Colors ===== */
:root {
  --color-primary: #0ea5e9;
  --color-primary-dark: #0284c7;
  --color-primary-light: #38bdf8;
  --color-primary-alpha-8: rgba(14, 165, 233, 0.08);
  --color-primary-alpha-10: rgba(14, 165, 233, 0.1);
  --color-primary-alpha-15: rgba(14, 165, 233, 0.15);
  --color-primary-alpha-20: rgba(14, 165, 233, 0.2);
  --color-primary-alpha-40: rgba(14, 165, 233, 0.4);
  --color-primary-alpha-5: rgba(14, 165, 233, 0.05);
  --color-primary-alpha-50: rgba(14, 165, 233, 0.5);
  --primary-rgb: 14, 165, 233;

  /* ===== 2. 功能色 - Semantic Colors ===== */
  --color-success: #10b981;
  --color-success-dark: #059669;
  --color-success-alpha-8: rgba(16, 185, 129, 0.08);
  --color-success-alpha-10: rgba(16, 185, 129, 0.1);
  --color-success-alpha-15: rgba(16, 185, 129, 0.15);
  --color-success-alpha-30: rgba(16, 185, 129, 0.3);
  --color-success-alpha-40: rgba(16, 185, 129, 0.4);

  --color-warning: #f59e0b;
  --color-warning-dark: #d97706;
  --color-warning-alpha-8: rgba(245, 158, 11, 0.08);
  --color-warning-alpha-10: rgba(245, 158, 11, 0.1);
  --color-warning-alpha-15: rgba(245, 158, 11, 0.15);
  --color-warning-alpha-20: rgba(245, 158, 11, 0.2);

  --color-danger: #ef4444;
  --color-danger-dark: #dc2626;
  --color-danger-alpha-8: rgba(239, 68, 68, 0.08);
  --color-danger-alpha-10: rgba(239, 68, 68, 0.1);
  --color-danger-alpha-15: rgba(239, 68, 68, 0.15);
  --color-danger-alpha-20: rgba(239, 68, 68, 0.2);
  --color-danger-alpha-30: rgba(239, 68, 68, 0.3);
  --color-danger-alpha-40: rgba(239, 68, 68, 0.4);

  --color-neutral: #64748b;
  --color-neutral-dark: #475569;
  --color-neutral-alpha-8: rgba(100, 116, 139, 0.08);
  --color-neutral-alpha-10: rgba(100, 116, 139, 0.1);
  --color-neutral-alpha-15: rgba(100, 116, 139, 0.15);

  --color-cyan: #06b6d4;
  --color-cyan-dark: #0891b2;
  --color-cyan-alpha-8: rgba(6, 182, 212, 0.08);
  --color-cyan-alpha-10: rgba(6, 182, 212, 0.1);
  --color-cyan-alpha-15: rgba(6, 182, 212, 0.15);

  --color-indigo: #6366f1;
  --color-indigo-dark: #4f46e5;
  --color-indigo-alpha-8: rgba(99, 102, 241, 0.08);
  --color-indigo-alpha-10: rgba(99, 102, 241, 0.1);
  --color-indigo-alpha-15: rgba(99, 102, 241, 0.15);

  /* ===== 3. 圆角系统 - Border Radius ===== */
  --radius-none: 0;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ===== 4. 间距系统 - Spacing (4px base) ===== */
  --spacing-0: 0;
  --spacing-1: 4px;
  --spacing-2: 8px;
  --spacing-3: 12px;
  --spacing-4: 16px;
  --spacing-5: 20px;
  --spacing-6: 24px;
  --spacing-8: 32px;
  --spacing-10: 40px;
  --spacing-12: 48px;
  --spacing-16: 64px;

  /* ===== 5. 字体系统 - Typography ===== */
  --font-xs: 11px;
  --font-sm: 13px;
  --font-base: 14px;
  --font-lg: 15px;
  --font-xl: 16px;
  --font-2xl: 18px;
  --font-3xl: 24px;
  --font-4xl: 32px;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.6;

  /* ===== 6. 阴影系统 - Box Shadow ===== */
  --shadow-none: none;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.20), 0 4px 6px rgba(0, 0, 0, 0.10);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.25), 0 8px 10px rgba(0, 0, 0, 0.12);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.3);

  /* ===== 7. 过渡动画 - Transitions ===== */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ===== 8. 组件尺寸 - Component Sizes ===== */
  --height-input: 36px;
  --height-btn: 36px;
  --height-btn-sm: 30px;
  --height-btn-lg: 42px;

  /* ===== 9. 侧边栏 - Sidebar ===== */
  --sidebar-width: 240px;
  --sidebar-width-collapsed: 64px;
  --sidebar-top: 49px;

  /* ===== 10. Z-Index 层级 ===== */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-notification: 800;

  /* ===== 11. 边框悬停色 ===== */
  --color-border-hover: rgba(14, 165, 233, 0.5);
  --color-bg-secondary-alpha-50: rgba(33, 33, 39, 0.5);
}

/* ===== 预设动画类 - Animation Classes ===== */
.animate-fade-in {
  animation: fadeIn var(--transition-normal);
}

.animate-slide-up {
  animation: slideUp var(--transition-normal);
}

.animate-slide-down {
  animation: slideDown var(--transition-normal);
}

.animate-scale-in {
  animation: scaleIn var(--transition-normal);
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ===== renderer/css/animations.css ===== */
/* ============================================
   animations.css - 统一动画关键帧定义
   所有 @keyframes 在此文件集中定义
   子文件引用时自动拥有，无需重复定义
   ============================================ */

/* ===== 基础动画 ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== 状态动画 ===== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes statusPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(var(--primary-rgb), 0);
  }
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes bg-pulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* ===== 加载动画 ===== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

@keyframes streamingDotPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ===== 交互反馈 ===== */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

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

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

/* ===== 模块动画 ===== */
@keyframes moduleFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== renderer/css/styles.css ===== */
/* ============================================
   仿真任务管理系统 - 主样式文件
   ============================================ */

/* ========== 全局文本选择样式 ========== */
*::selection {
  -webkit-text-fill-color: white;
  background: var(--color-primary);
  color: white;
}

*::-moz-selection {
  -webkit-text-fill-color: white;
  background: var(--color-primary);
  color: white;
}

/* 文本元素默认使用 text 光标 */
p, span, h1, h2, h3, h4, h5, h6, td, th,
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="search"], textarea {
  cursor: text;
}

/* 按钮和可点击元素使用 pointer 光标 */
button, .btn, [class*="btn-"], input[type="button"],
input[type="submit"], input[type="checkbox"],
input[type="radio"], select, label[for] {
  cursor: pointer;
}

/* 调整列大小的手柄 */
th .resize-handle {
  cursor: col-resize;
  pointer-events: none;
  z-index: 100;
}

th:hover .resize-handle {
  pointer-events: auto;
}

/* ========== 应用容器 ========== */
.app-container {
  min-height: 100vh;
  min-width: 0;
  max-width: 100vw;
  overflow-x: hidden;
}

.main-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* 内容行容器 - 侧边栏和主内容在同一行 */
.main-content-row {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.main-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  margin-left: var(--sidebar-width, 240px);
  left: 0;
  right: 0;
  z-index: 5;
  pointer-events: auto;
  overflow: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary-alpha-20) transparent;
  padding-bottom: 0;
}

/* 仿真引导页面紧贴主侧边栏（由父元素 main-content 提供 left margin） */
.simulation-guide-root {
  position: relative;
  z-index: 10;
  margin-left: 0;
  width: auto;
}

/* 当 main-content 包含仿真引导页面时，添加完整布局样式 */
.main-content:has(.simulation-guide-root) {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: calc(100vh - 49px) !important;
  display: block !important;
  flex-direction: initial !important;
  z-index: 20 !important;
}

.main-content::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.main-content::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}

.main-content::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.2s ease;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
  background-clip: padding-box;
}

/* ========== 左侧边栏 ========== */
.left-sidebar {
  width: var(--sidebar-width, 240px);
  background: var(--color-bg-sidebar);
  color: var(--color-sidebar-text);
  display: flex;
  flex-direction: column;
  height: calc(100% - 49px);
  position: fixed;
  left: 0;
  top: 49px;
  bottom: 0;
  z-index: 100;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.12);
  transition: width 0.15s ease, transform 0.15s ease;
  will-change: width;
  pointer-events: auto;
  overflow: hidden;
}

.left-sidebar.collapsed {
  width: 0;
  padding: 0;
  box-shadow: none;
}

.left-sidebar-container {
  position: relative;
  width: 0;
  flex: 0 0 auto;
  z-index: 100;
  pointer-events: auto;
}

/* 侧边栏头部 */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  padding-right: 12px;
  border-bottom: 1px solid var(--color-border-light);
  flex: 0 0 auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  color: var(--color-primary);
  opacity: 0.9;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.collapse-btn:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
}

/* 可拖拽分隔条 */
.sidebar-resizer {
  position: fixed;
  left: calc(var(--sidebar-width, 240px) - 10px);
  top: 49px;
  bottom: 0;
  width: 20px;
  background: transparent;
  cursor: col-resize;
  z-index: 101;
  pointer-events: auto;
}

.sidebar-resizer::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: all 0.15s ease;
}

.sidebar-resizer:hover::before,
.sidebar-resizer.resizing::before {
  width: 4px;
  background: var(--color-primary);
  box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.4);
}

/* 内容包装器 */
.sidebar-content-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* 主导航 */
.sidebar-main-nav {
  flex: 1;
  padding: 8px 4px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary-alpha-20) transparent;
}

/* 侧边栏底部（仅折叠按钮）- 靠右对齐 */
.sidebar-footer-only {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 12px;
}

/* 折叠状态下的展开按钮 - 在侧边栏外侧底部贴边 */
.sidebar-expand-fab {
  position: fixed;
  left: 8px;
  bottom: 8px;
  z-index: 102;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-expand-fab:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
}

.sidebar-main-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-main-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-main-nav::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.sidebar-main-nav::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  justify-content: flex-start;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 10px 2px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--color-sidebar-text-muted);
  font: inherit;
  position: relative;
  box-sizing: border-box;
  text-align: center;
}

.nav-item:hover {
  background-color: var(--color-bg-module-hover);
  color: var(--color-sidebar-text);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: white;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-icon-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

.nav-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* 纯文字导航项样式 - 与带图标的项文本对齐 */
.nav-item-text-only {
  box-sizing: border-box;
  text-align: center;
  display: block;
  width: 100%;
  margin: 0 auto;
}

.nav-item-text-only .nav-name {
  display: block;
  text-align: center;
  width: 100%;
}

/* 最近任务区 */
.sidebar-recent-tasks {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 12px;
  padding-right: 20px;
  margin-top: 8px;
  position: relative;
  z-index: 102;
}

.recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.recent-header:hover {
  background-color: var(--color-bg-module-hover);
}

.recent-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--color-sidebar-text-muted);
  letter-spacing: 0.08em;
  font-weight: 600;
}

.toggle-icon {
  font-size: 10px;
  color: var(--color-sidebar-text-muted);
}

.recent-list {
  flex: 1 1 auto;
  min-height: 100px;
  height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(136, 136, 136, 0.5) transparent;
}

.recent-list::-webkit-scrollbar {
  width: 10px;
}

.recent-list::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 5px;
  margin: 4px 0;
}

.recent-list::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 5px;
  transition: background 0.2s;
  border: 1px solid transparent;
}

.recent-list::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

.recent-empty {
  padding: 1rem 0.75rem;
  font-size: 0.9rem;
  color: var(--color-sidebar-text-muted);
  font-style: italic;
}

.recent-task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.recent-task-item:hover {
  background-color: var(--color-bg-module-hover);
  border-color: var(--color-border-light);
}

.recent-task-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.recent-task-name {
  font-size: 13px;
  color: var(--color-sidebar-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.recent-task-time {
  font-size: 11px;
  color: var(--color-sidebar-text-muted);
}

.recent-task-time .sim-type {
  display: inline-block;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 4px;
  font-size: 10px;
  background: var(--color-primary);
  color: white;
  line-height: 1.4;
  font-weight: 500;
}

.recent-task-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.recent-task-status.status-pending {
  background-color: var(--color-warning);
}

.recent-task-status.status-running {
  background-color: var(--color-primary);
  animation: statusPulse 2s ease-in-out infinite;
}

.recent-task-status.status-completed {
  background-color: var(--color-success);
}

.recent-task-status.status-failed {
  background-color: var(--color-danger);
}

.recent-task-status.status-cancelled {
  background-color: var(--color-neutral);
}

.recent-task-status.status-unknown {
  background-color: #8b5cf6;
}

/* 右键菜单 */
.context-menu {
  position: fixed;
  min-width: 150px;
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  overflow: hidden;
  animation: scaleIn 0.12s ease-out;
  transform-origin: top left;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.875rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--color-text-primary);
  transition: background-color 0.12s ease;
  line-height: 1;
}

.context-menu-item svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.context-menu-item:hover {
  background-color: var(--color-bg-module-hover);
}

.context-menu-item.delete-item {
  color: var(--color-danger);
}

.context-menu-item.delete-item:hover {
  background-color: rgba(239, 68, 68, 0.12);
}

/* 侧边栏底部 */
.sidebar-footer {
  flex: 0 0 auto;
  padding: 12px 8px;
  border-top: 1px solid var(--color-sidebar-border);
  margin-top: auto;
  position: relative;
  z-index: 10;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.sidebar-action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  color: var(--color-sidebar-text-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  background: transparent;
  transition: all var(--transition-fast);
  position: relative;
}

.sidebar-action-item:hover {
  background: var(--color-bg-module-hover);
  border-color: var(--color-border-light);
  color: var(--color-sidebar-text);
}

.sidebar-action-item:active {
  transform: scale(0.98);
}

.action-icon {
  flex-shrink: 0;
  opacity: 0.8;
}

/* ========== 顶部导航栏 ========== */
.navbar {
  background: transparent;
  color: var(--color-text-primary);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
  z-index: 100;
  height: 56px;
  box-sizing: border-box;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

.navbar-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 面包屑导航 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.breadcrumb-separator {
  opacity: 0.5;
}

.breadcrumb-item {
  color: var(--color-text-secondary);
  font-weight: 500;
}

.module-badge {
  padding: 4px 10px;
  background: var(--color-primary-alpha-10);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
}

.navbar-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border-right: 1px solid var(--color-border-light);
  border-left: 1px solid var(--color-border-light);
}

/* 导航按钮 */
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px;
  padding: 0 8px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--color-text-secondary);
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-sizing: border-box;
  width: auto;
  min-width: unset;
}

.nav-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary-alpha-20);
  background: var(--color-primary-alpha-10);
}

.nav-btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.nav-btn-icon svg {
  display: block;
}

.nav-btn-text {
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* 用户菜单触发器 */
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: transparent;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.user-menu-trigger:hover {
  background: var(--color-bg-input);
  border-color: var(--color-primary-alpha-20);
  box-shadow: var(--shadow-sm);
}

.user-avatar {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.user-status {
  font-size: 11px;
  color: var(--color-success);
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--color-success);
  border-radius: 50%;
}

/* 欢迎按钮 */
.welcome-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  padding-top: 0;
  padding-bottom: 0;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.2);
  margin-left: 8px;
  vertical-align: middle;
}

.welcome-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.welcome-btn:active {
  transform: translateY(0);
}

/* ========== 认证页面 ========== */
.lang-toggle-wrapper {
  text-align: right;
  margin-bottom: 1rem;
}

.btn-lang-toggle,
.btn-guest-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-family: inherit;
}

.btn-lang-toggle:hover:not(:disabled),
.btn-guest-inline:hover:not(:disabled) {
  background: var(--color-bg-secondary);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-lang-toggle:disabled,
.btn-guest-inline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-view {
  position: relative;
  z-index: 200;
  width: 100%;
  min-height: 100vh;
  box-sizing: border-box;
}

.auth-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}

.auth-header-bar .spacer {
  flex: 1;
}


.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem 1rem;
  box-sizing: border-box;
  overflow-x: hidden;
}

.auth-card {
  background: var(--color-bg-card);
  padding: 2.5rem 2rem;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 440px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--color-border-light);
}

.auth-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.auth-card .auth-title-main {
  margin-bottom: 0.5rem;
  text-align: center;
  color: var(--color-text-primary);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.4;
}

.auth-card .auth-title-sub {
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--color-text-secondary);
  font-weight: 500;
  font-size: 1.1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border-light);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: 10px;
  font-size: 1rem;
  background-color: var(--color-bg-input);
  color: var(--color-text-primary);
  transition: all 0.2s ease;
}

.form-group input:hover,
.form-group textarea:hover {
  border-color: var(--color-primary);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-alpha-10);
  background-color: var(--color-bg-card);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  text-align: center;
}

.btn-block {
  margin-top: 1rem;
}

.switch-link {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.switch-link a {
  color: var(--color-primary);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}

.switch-link a:hover {
  text-decoration: underline;
}

.auth-card .btn {
  height: 44px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
}

.field-optional {
  color: var(--color-text-muted);
  font-weight: normal;
  font-size: 0.9rem;
}

/* ========== 通用组件样式 ========== */
.empty-state {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--color-text-muted);
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--color-border-light);
  box-shadow: var(--shadow-xs);
}

.module-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.module-coming-soon__icon {
  width: 64px;
  height: 64px;
  margin-bottom: 1.25rem;
  opacity: 0.5;
}

.module-coming-soon__title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.module-coming-soon__subtitle {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.loading {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--color-text-muted);
}

/* ========== 加载容器 ========== */
.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.loading-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========== 任务列表容器 ========== */
.task-list-container {
  margin-top: var(--spacing-6);
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.task-list-header {
  flex: 0 0 auto;
}

.task-list-header h3 {
  display: flex;
  align-items: center;
  margin-bottom: var(--spacing-5);
  color: var(--color-text-primary);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.task-count-badge {
  background: var(--color-bg-secondary);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  margin-left: var(--spacing-3);
  border: 1px solid var(--color-border-light);
}

/* ========== 响应式调整 ========== */
@media (max-width: 768px) {
  /* 默认隐藏侧边栏，由 .collapsed 类控制显示状态 */
  .left-sidebar {
    transform: translateX(-100%);
    visibility: hidden;
  }

  /* 非折叠状态时显示侧边栏 */
  .left-sidebar:not(.collapsed) {
    transform: translateX(0);
    visibility: visible;
  }

  /* 侧边栏显示时，main-content 保持 margin-left 避免被遮挡 */
  .main-content {
    margin-left: var(--sidebar-width, 240px) !important;
  }

  .navbar {
    padding: 10px 16px;
  }

  .auth-container {
    padding: 1rem;
  }
}

/* ========== 模块内容卡片 ========== */
.module-content-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: none;
  box-shadow: none;
}

.module-content-card > * {
  flex: 1;
}

.no-modules-message {
  padding: 20px;
  text-align: center;
  color: var(--color-text-muted);
}

/* ========== 首页样式 ========== */
.home-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
}

.home-title {
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--color-text-primary);
  text-align: center;
}

/* ============================================
   响应式左右 padding 系统
   设计原则：桌面端宽松，平板端适中，手机端紧凑
   ============================================ */

/* ========== 默认（桌面 1200px+）========== */
.main-content {
  padding: 16px 15px;
}

.navbar {
  padding: 12px 15px;
}

/* ========== 1600px+ 超大屏幕 ========== */
@media (min-width: 1600px) {
  .main-content {
    padding: 20px 36px;
  }

  .navbar {
    padding: 14px 36px;
  }
}

/* ========== 1400px 大屏幕 ========== */
@media (max-width: 1400px) {
  .main-content {
    padding: 16px 24px;
  }

  .navbar {
    padding: 12px 24px;
  }
}

/* ========== 1200px 中等桌面屏幕 ========== */
@media (max-width: 1200px) {
  .main-content {
    padding: 14px 20px;
  }

  .navbar {
    padding: 10px 20px;
  }

  .navbar-title {
    font-size: 15px;
  }
}

/* ========== 1024px - 平板横屏 / 小笔记本 ========== */
@media (max-width: 1024px) {
  .main-content {
    padding: 12px 16px;
  }

  .navbar {
    padding: 10px 16px;
  }

  .navbar-right {
    gap: 8px;
  }

  .breadcrumb {
    display: none;
  }
}

/* ========== 992px - 平板竖屏 ========== */
@media (max-width: 992px) {
  .main-content {
    padding: 12px 14px;
  }

  .navbar-title {
    font-size: 14px;
  }

  .nav-btn {
    padding: 0 10px;
    height: 32px;
    font-size: 12px;
  }

  .user-menu-trigger {
    padding: 4px 10px 4px 4px;
  }

  .user-avatar {
    width: 26px;
    height: 26px;
  }

  .welcome-btn {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
  }
}

/* ========== 768px - 平板 / 大屏手机 ========== */
@media (max-width: 768px) {
  .main-content {
    padding: 10px 12px;
  }

  .navbar {
    padding: 8px 12px;
    height: 52px;
  }

  .navbar-left {
    gap: 12px;
  }

  .navbar-title {
    font-size: 15px;
  }

  .navbar-actions {
    padding-right: 8px;
  }

  .auth-container {
    padding: 1rem;
  }

  .auth-card {
    padding: 1.75rem 1.5rem;
  }

  .auth-card .auth-title-main {
    font-size: 1.35rem;
  }

  .auth-card .auth-title-sub {
    font-size: 1rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.65rem 0.85rem;
  }

  .task-list-container {
    margin-top: var(--spacing-4);
  }

  .task-list-header h3 {
    font-size: 1.15rem;
    margin-bottom: var(--spacing-4);
  }

  .sidebar-expand-fab {
    left: 12px;
    bottom: 12px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .grid-responsive {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-responsive {
    padding: 1rem;
  }

  .btn, button, [class*="btn-"] {
    min-height: 44px;
    min-width: 44px;
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.75rem;
    padding: 0 0.75rem;
  }

  .modal-content {
    margin: 0.5rem;
    max-height: calc(100vh - 1rem);
  }

  .modal-header {
    padding: 1rem 1.25rem;
  }

  .modal-body {
    padding: 1rem 1.25rem;
  }

  .modal-footer {
    padding: 0.75rem 1.25rem;
  }

  .left-sidebar {
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
    width: 280px;
    max-width: 85vw;
  }

  .left-sidebar:not(.collapsed) {
    transform: translateX(0);
    visibility: visible;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    backdrop-filter: blur(2px);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }
}

/* ========== 576px - 大屏手机 ========== */
@media (max-width: 576px) {
  .main-content {
    padding: 8px 10px;
  }

  .navbar {
    padding: 6px 10px;
  }

  .navbar-title {
    font-size: 14px;
  }

  .navbar-actions {
    display: none;
  }

  .user-menu-trigger {
    padding: 4px 8px 4px 4px;
  }

  .user-info {
    display: none;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .auth-container {
    padding: 0.75rem;
  }

  .auth-card {
    padding: 1.5rem 1.25rem;
    border-radius: 12px;
  }

  .auth-card .auth-title-main {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
  }

  .auth-card .auth-title-sub {
    font-size: 0.95rem;
    padding-bottom: 1rem;
  }

  .form-group {
    margin-bottom: 0.75rem;
  }

  .form-group label {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    border-radius: 8px;
    min-height: 44px;
  }

  .auth-card .btn {
    height: 46px;
    font-size: 1rem;
  }

  .task-list-container {
    margin-top: var(--spacing-3);
  }

  .task-list-header h3 {
    font-size: 1.05rem;
    margin-bottom: var(--spacing-3);
  }

  .task-count-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    margin-left: var(--spacing-2);
  }

  .grid-responsive {
    grid-template-columns: 1fr;
  }

  .card-responsive {
    padding: 0.85rem;
    border-radius: var(--radius-md);
  }

  .home-page {
    padding: 1.5rem 1rem;
  }

  .home-title {
    font-size: 1.4rem;
  }

  .left-sidebar {
    width: 100%;
    max-width: 100%;
  }

  .btn-block-responsive {
    width: 100%;
  }

  .input-full-width {
    width: 100%;
  }

  .modal-content {
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
    height: 100vh;
  }
}

/* ========== 480px - 中等尺寸手机 ========== */
@media (max-width: 480px) {
  .main-content {
    padding: 6px 8px;
  }

  .navbar {
    padding: 6px 8px;
    height: 48px;
  }

  .navbar-title {
    font-size: 13px;
    font-weight: 600;
  }

  .breadcrumb {
    display: none;
  }

  .user-avatar {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }

  .welcome-btn {
    height: 36px;
    padding: 0 10px;
    font-size: 11px;
  }

  .auth-container {
    padding: 0.5rem;
  }

  .auth-card {
    padding: 1.25rem 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  }

  .auth-card .auth-title-main {
    font-size: 1.15rem;
  }

  .auth-card .auth-title-sub {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.55rem 0.7rem;
    min-height: 44px;
  }

  .form-group textarea {
    min-height: 100px;
  }

  .auth-card .btn {
    height: 44px;
    font-size: 0.95rem;
  }

  .switch-link {
    margin-top: 1.25rem;
    font-size: 0.85rem;
  }

  .task-list-header h3 {
    font-size: 1rem;
  }

  .card-responsive {
    padding: 0.75rem;
  }

  .home-page {
    padding: 1.25rem 0.75rem;
  }

  .home-title {
    font-size: 1.25rem;
  }

  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  input[type="search"],
  input[type="date"],
  textarea,
  select {
    font-size: 16px !important;
  }

  .compact-spacing {
    gap: 0.5rem;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .reduce-motion * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== 360px - 小尺寸手机 ========== */
@media (max-width: 360px) {
  .main-content {
    padding: 4px 6px;
  }

  .navbar {
    padding: 4px 8px;
  }

  .navbar-title {
    font-size: 12px;
  }

  .module-badge {
    padding: 3px 8px;
    font-size: 10px;
  }

  .user-avatar {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }

  .welcome-btn {
    height: 32px;
    padding: 0 8px;
    font-size: 10px;
  }

  .auth-card {
    padding: 1rem 0.85rem;
  }

  .auth-card .auth-title-main {
    font-size: 1.05rem;
  }

  .auth-card .auth-title-sub {
    font-size: 0.85rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.5rem 0.65rem;
    min-height: 42px;
  }

  .auth-card .btn {
    height: 42px;
    font-size: 0.9rem;
  }

  .task-count-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
  }

  .card-responsive {
    padding: 0.65rem;
    border-radius: var(--radius-sm);
  }

  .home-title {
    font-size: 1.1rem;
  }

  .ultra-compact {
    padding: 0.25rem !important;
    margin: 0.25rem !important;
    gap: 0.25rem !important;
  }

  .text-xs-responsive {
    font-size: 10px !important;
  }

  .text-sm-responsive {
    font-size: 11px !important;
  }
}

/* ============================================
   触摸友好优化
   ============================================ */

/* 确保所有可点击元素有足够的触摸区域 */
button,
.btn,
[class*="btn-"],
a,
.nav-item,
.sidebar-action-item,
.task-item,
input[type="checkbox"],
input[type="radio"],
select {
  min-height: 44px;
  min-width: 44px;
}

/* 按钮和链接的间距优化 */
button + button,
.btn + .btn,
a + a {
  margin-left: 0.5rem;
}

/* 输入框触摸优化 */
input,
textarea,
select {
  min-height: 44px;
  touch-action: manipulation;
}

/* 移除 hover 依赖，添加 active 状态 */
@media (hover: none) and (pointer: coarse) {
  button:hover,
  .btn:hover,
  .nav-item:hover {
    background: inherit;
  }

  button:active,
  .btn:active,
  .nav-item:active {
    opacity: 0.8;
    transform: scale(0.98);
  }
}

/* ============================================
   响应式工具类
   ============================================ */

/* 显示/隐藏工具类 */
.hidden-xs { display: none !important; }
.visible-xs { display: block !important; }

@media (min-width: 481px) {
  .hidden-xs { display: block !important; }
  .visible-xs { display: none !important; }
}

.hidden-sm { display: none !important; }
.visible-sm { display: block !important; }

@media (min-width: 577px) {
  .hidden-sm { display: block !important; }
  .visible-sm { display: none !important; }
}

.hidden-md { display: none !important; }
.visible-md { display: block !important; }

@media (min-width: 769px) {
  .hidden-md { display: block !important; }
  .visible-md { display: none !important; }
}

.hidden-lg { display: none !important; }
.visible-lg { display: block !important; }

@media (min-width: 1025px) {
  .hidden-lg { display: block !important; }
  .visible-lg { display: none !important; }
}

/* Flex 响应式工具类 */
@media (max-width: 768px) {
  .flex-col-md {
    flex-direction: column !important;
  }

  .flex-wrap-md {
    flex-wrap: wrap !important;
  }

  .justify-center-md {
    justify-content: center !important;
  }

  .items-stretch-md {
    align-items: stretch !important;
  }
}

@media (max-width: 576px) {
  .flex-col-sm {
    flex-direction: column !important;
  }

  .flex-wrap-sm {
    flex-wrap: wrap !important;
  }

  .gap-sm {
    gap: 0.5rem !important;
  }
}

/* 间距响应式调整 */
@media (max-width: 768px) {
  .p-md-1 { padding: 0.25rem !important; }
  .p-md-2 { padding: 0.5rem !important; }
  .p-md-3 { padding: 1rem !important; }
  .m-md-0 { margin: 0 !important; }
  .m-md-auto { margin: 0 auto !important; }
}

@media (max-width: 576px) {
  .p-sm-1 { padding: 0.25rem !important; }
  .p-sm-2 { padding: 0.5rem !important; }
  .m-sm-0 { margin: 0 !important; }
  .w-sm-100 { width: 100% !important; }
}

/* 文本响应式对齐 */
@media (max-width: 768px) {
  .text-center-md { text-align: center !important; }
  .text-left-md { text-align: left !important; }
}

@media (max-width: 576px) {
  .text-center-sm { text-align: center !important; }
  .text-left-sm { text-align: left !important; }
}

/* ============================================
   高 DPI 屏幕优化
   ============================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* 高清屏幕边框优化 */
  .border-thin {
    border-width: 0.5px !important;
  }
}

/* ============================================
   横屏模式优化
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {
  .auth-container {
    padding: 0.5rem;
    align-items: flex-start;
  }

  .auth-card {
    padding: 1rem;
    max-height: 95vh;
    overflow-y: auto;
  }

  .navbar {
    height: 44px;
    padding: 4px 12px;
  }

  .main-content {
    margin-top: 44px;
  }
}


/* ===== renderer/css/theme.css ===== */
/* ============================================
   主题系统 - Theme System
   ============================================ */

/* ========== 默认主题变量 (后备值，在 data-theme 设置前生效) ========== */
:root {
  /* 背景色 */
  --color-bg-primary: #1a1a1f;
  --color-bg-secondary: #212127;
  --color-bg-card: #27272f;
  --color-bg-card-solid: #2d2d37;
  --color-bg-sidebar: linear-gradient(180deg, #212127 0%, #1a1a1f 100%);
  --color-bg-navbar: rgba(33, 33, 39, 0.85);
  --color-bg-input: #33333d;
  --color-bg-table-header: #212127;
  --color-bg-table-row-alt: rgba(60, 60, 70, 0.3);
  --color-bg-table-hover: rgba(2, 132, 199, 0.12);
  --color-bg-module-hover: rgba(2, 132, 199, 0.15);

  /* 文字色 */
  --color-text-primary: #f1f5f9;
  --color-text-secondary: #cbd5e1;
  --color-text-muted: #94a3b8;
  --color-sidebar-text: #f8fafc;
  --color-sidebar-text-muted: rgba(203, 213, 225, 0.85);
  --color-navbar-text: #e2e8f0;

  /* 边框色 */
  --color-border: rgba(71, 85, 105, 0.5);
  --color-border-light: rgba(71, 85, 105, 0.2);
  --color-border-lighter: rgba(148, 163, 184, 0.08);
  --color-border-subtle: rgba(148, 163, 184, 0.15);
  --color-sidebar-border: rgba(71, 85, 105, 0.4);

  /* 状态色 */
  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.1);
  --color-info: #3b82f6;
  --color-accent: #8b5cf6;

  /* 阴影 */
  --color-shadow-soft: rgba(0, 0, 0, 0.04);

  /* 下拉菜单 */
  --color-sidebar-bg-dropdown: #27272f;

  /* 兼容旧变量名 */
  --bg-primary: var(--color-bg-primary);
  --bg-secondary: var(--color-bg-secondary);
  --bg-card: var(--color-bg-card);
  --bg-card-solid: var(--color-bg-card-solid);
  --bg-sidebar: var(--color-bg-sidebar);
  --bg-navbar: var(--color-bg-navbar);
  --bg-input: var(--color-bg-input);
  --bg-table-header: var(--color-bg-table-header);
  --bg-table-row-alt: var(--color-bg-table-row-alt);
  --bg-table-hover: var(--color-bg-table-hover);
  --bg-module-hover: var(--color-bg-module-hover);

  --text-primary: var(--color-text-primary);
  --text-secondary: var(--color-text-secondary);
  --text-muted: var(--color-text-muted);
  --sidebar-text: var(--color-sidebar-text);
  --sidebar-text-muted: var(--color-sidebar-text-muted);
  --sidebar-bg-dropdown: var(--color-sidebar-bg-dropdown);
  --navbar-text: var(--color-navbar-text);

  --border-color: var(--color-border);
  --border-light: var(--color-border-light);
  --sidebar-border: var(--color-sidebar-border);

  /* 主题特定补充变量 */
  --color-bg-tertiary: #1e293b;
  --color-bg-hover: #334155;

  /* 字体大小后备值 */
  --base-font-size: 14px;
}

/* ========== 浅色主题 - Light Theme ========== */
[data-theme="light"] {
  /* 背景色 */
  --color-bg-primary: #f1f0eb;
  --color-bg-secondary: #e8e6df;
  --color-bg-card: #fdfcfb;
  --color-bg-card-solid: #f8f7f5;
  --color-bg-sidebar: linear-gradient(180deg, #fdfcfb 0%, #f1f0eb 100%);
  --color-bg-navbar: rgba(253, 252, 251, 0.9);
  --color-bg-input: #edebe4;
  --color-bg-table-header: #ebe9e4;
  --color-bg-table-row-alt: rgba(120, 113, 108, 0.03);
  --color-bg-table-hover: rgba(14, 165, 233, 0.06);
  --color-bg-module-hover: rgba(14, 165, 233, 0.08);

  /* 文字色 */
  --color-text-primary: #0f172a;
  --color-text-secondary: #334155;
  --color-text-muted: #64748b;
  --color-sidebar-text: #1e293b;
  --color-sidebar-text-muted: rgba(51, 65, 85, 0.85);
  --color-navbar-text: #1e293b;

  /* 边框色 */
  --color-border: rgba(148, 163, 184, 0.25);
  --color-border-light: rgba(148, 163, 184, 0.12);
  --color-border-lighter: rgba(148, 163, 184, 0.06);
  --color-border-subtle: rgba(148, 163, 184, 0.1);
  --color-sidebar-border: rgba(148, 163, 184, 0.2);

  /* 状态色 */
  --color-success: #059669;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-danger-bg: rgba(220, 38, 38, 0.08);
  --color-info: #2563eb;
  --color-accent: #7c3aed;

  /* 阴影 */
  --color-shadow-soft: rgba(0, 0, 0, 0.03);

  /* 下拉菜单 */
  --color-sidebar-bg-dropdown: #fdfcfb;

  /* ========== 兼容旧变量名 ========== */
  --bg-primary: var(--color-bg-primary);
  --bg-secondary: var(--color-bg-secondary);
  --bg-card: var(--color-bg-card);
  --bg-card-solid: var(--color-bg-card-solid);
  --bg-sidebar: var(--color-bg-sidebar);
  --bg-navbar: var(--color-bg-navbar);
  --bg-input: var(--color-bg-input);
  --bg-table-header: var(--color-bg-table-header);
  --bg-table-row-alt: var(--color-bg-table-row-alt);
  --bg-table-hover: var(--color-bg-table-hover);
  --bg-module-hover: var(--color-bg-module-hover);

  --text-primary: var(--color-text-primary);
  --text-secondary: var(--color-text-secondary);
  --text-muted: var(--color-text-muted);
  --sidebar-text: var(--color-sidebar-text);
  --sidebar-text-muted: var(--color-sidebar-text-muted);
  --sidebar-bg-dropdown: var(--color-sidebar-bg-dropdown);
  --navbar-text: var(--color-navbar-text);

  --border-color: var(--color-border);
  --border-light: var(--color-border-light);
  --sidebar-border: var(--color-sidebar-border);

  /* ========== 主题特定补充变量 ========== */
  --color-bg-tertiary: #f8fafc;
  --color-bg-hover: #f1f5f9;
}

/* ========== 深色主题 - Dark Theme ========== */
[data-theme="dark"] {
  /* 背景色 */
  --color-bg-primary: #1a1a1f;
  --color-bg-secondary: #212127;
  --color-bg-card: #27272f;
  --color-bg-card-solid: #2d2d37;
  --color-bg-sidebar: linear-gradient(180deg, #212127 0%, #1a1a1f 100%);
  --color-bg-navbar: rgba(33, 33, 39, 0.85);
  --color-bg-input: #33333d;
  --color-bg-table-header: #212127;
  --color-bg-table-row-alt: rgba(60, 60, 70, 0.3);
  --color-bg-table-hover: rgba(2, 132, 199, 0.12);
  --color-bg-module-hover: rgba(2, 132, 199, 0.15);

  /* 文字色 */
  --color-text-primary: #f1f5f9;
  --color-text-secondary: #cbd5e1;
  --color-text-muted: #94a3b8;
  --color-sidebar-text: #f8fafc;
  --color-sidebar-text-muted: rgba(203, 213, 225, 0.85);
  --color-navbar-text: #e2e8f0;

  /* 边框色 */
  --color-border: rgba(71, 85, 105, 0.5);
  --color-border-light: rgba(71, 85, 105, 0.2);
  --color-border-lighter: rgba(148, 163, 184, 0.08);
  --color-border-subtle: rgba(148, 163, 184, 0.15);
  --color-sidebar-border: rgba(71, 85, 105, 0.4);

  /* 状态色 */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.1);
  --color-info: #3b82f6;
  --color-accent: #8b5cf6;

  /* 阴影 */
  --color-shadow-soft: rgba(0, 0, 0, 0.04);

  /* 下拉菜单 */
  --color-sidebar-bg-dropdown: #27272f;

  /* ========== 兼容旧变量名 ========== */
  --bg-primary: var(--color-bg-primary);
  --bg-secondary: var(--color-bg-secondary);
  --bg-card: var(--color-bg-card);
  --bg-card-solid: var(--color-bg-card-solid);
  --bg-sidebar: var(--color-bg-sidebar);
  --bg-navbar: var(--color-bg-navbar);
  --bg-input: var(--color-bg-input);
  --bg-table-header: var(--color-bg-table-header);
  --bg-table-row-alt: var(--color-bg-table-row-alt);
  --bg-table-hover: var(--color-bg-table-hover);
  --bg-module-hover: var(--color-bg-module-hover);

  --text-primary: var(--color-text-primary);
  --text-secondary: var(--color-text-secondary);
  --text-muted: var(--color-text-muted);
  --sidebar-text: var(--color-sidebar-text);
  --sidebar-text-muted: var(--color-sidebar-text-muted);
  --sidebar-bg-dropdown: var(--color-sidebar-bg-dropdown);
  --navbar-text: var(--color-navbar-text);

  --border-color: var(--color-border);
  --border-light: var(--color-border-light);
  --sidebar-border: var(--color-sidebar-border);

  /* ========== 主题特定补充变量 ========== */
  --color-bg-tertiary: #1e293b;
  --color-bg-hover: #334155;
}

/* ========== 系统主题跟随 ========== */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --color-bg-primary: #f1f0eb;
    --color-bg-secondary: #e8e6df;
    --color-bg-card: #fdfcfb;
    --color-bg-card-solid: #f8f7f5;
    --color-bg-sidebar: linear-gradient(180deg, #fdfcfb 0%, #f1f0eb 100%);
    --color-bg-navbar: rgba(253, 252, 251, 0.9);
    --color-bg-input: #edebe4;
    --color-bg-table-header: #ebe9e4;
    --color-bg-table-row-alt: rgba(120, 113, 108, 0.03);
    --color-bg-table-hover: rgba(14, 165, 233, 0.06);
    --color-bg-module-hover: rgba(14, 165, 233, 0.08);

    --color-text-primary: #0f172a;
    --color-text-secondary: #334155;
    --color-text-muted: #64748b;
    --color-sidebar-text: #1e293b;
    --color-sidebar-text-muted: rgba(51, 65, 85, 0.85);
    --color-navbar-text: #1e293b;

    --color-border: rgba(148, 163, 184, 0.25);
    --color-border-light: rgba(148, 163, 184, 0.12);
    --color-sidebar-border: rgba(148, 163, 184, 0.2);

    --color-sidebar-bg-dropdown: #fdfcfb;

    /* ========== 主题特定补充变量 ========== */
    --color-bg-tertiary: #f8fafc;
    --color-bg-hover: #f1f5f9;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg-primary: #1a1a1f;
    --color-bg-secondary: #212127;
    --color-bg-card: #27272f;
    --color-bg-card-solid: #2d2d37;
    --color-bg-sidebar: linear-gradient(180deg, #212127 0%, #1a1a1f 100%);
    --color-bg-navbar: rgba(33, 33, 39, 0.85);
    --color-bg-input: #33333d;
    --color-bg-table-header: #212127;
    --color-bg-table-row-alt: rgba(60, 60, 70, 0.3);
    --color-bg-table-hover: rgba(2, 132, 199, 0.12);
    --color-bg-module-hover: rgba(2, 132, 199, 0.15);

    --color-text-primary: #f1f5f9;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #94a3b8;
    --color-sidebar-text: #f8fafc;
    --color-sidebar-text-muted: rgba(203, 213, 225, 0.85);
    --color-navbar-text: #e2e8f0;

    --color-border: rgba(71, 85, 105, 0.5);
    --color-border-light: rgba(71, 85, 105, 0.2);
    --color-sidebar-border: rgba(71, 85, 105, 0.4);

    --color-sidebar-bg-dropdown: #27272f;

    /* ========== 主题特定补充变量 ========== */
    --color-bg-tertiary: #1e293b;
    --color-bg-hover: #334155;
  }
}


/* ===== renderer/css/base.css ===== */
/* ============================================
   基础样式 - Base Styles
   ============================================ */

/* ========== 样式重置 - Reset ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--base-font-size, 14px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  height: 100vh;
  overflow: hidden;
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  scroll-behavior: smooth;
}

.app {
  height: 100vh;
  overflow: hidden;
  min-width: 800px;
}

/* ========== Loading Progress Styles ========== */
.loading-progress-container {
  width: 100%;
  max-width: 300px;
  margin: 20px auto;
}

.loading-progress-bar {
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, #3182ce, #805ad5);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.loading-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.cursor-pointer {
  cursor: pointer;
}

/* ========== 排版 - Typography ========== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
}

h1 { font-size: var(--font-3xl); }
h2 { font-size: var(--font-2xl); }
h3 { font-size: var(--font-xl); }
h4 { font-size: var(--font-lg); }
h5 { font-size: var(--font-base); }
h6 { font-size: var(--font-sm); }

p {
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-4);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

/* ========== 列表 - Lists ========== */
ul, ol {
  padding-left: var(--spacing-6);
  margin-bottom: var(--spacing-4);
}

li {
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-1);
}

/* ========== 代码 - Code ========== */
code {
  padding: 2px 6px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Consolas', monospace;
  font-size: 0.9em;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
}

pre {
  padding: var(--spacing-4);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--spacing-4);
}

pre code {
  padding: 0;
  background: none;
  font-size: var(--font-sm);
  line-height: var(--line-height-relaxed);
}

/* ========== 分隔线 - Divider ========== */
hr {
  border: none;
  border-top: 1px solid var(--color-border-light);
  margin: var(--spacing-6) 0;
}

/* ========== 引用 - Blockquote ========== */
blockquote {
  padding-left: var(--spacing-4);
  border-left: 3px solid var(--color-primary);
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: var(--spacing-4);
}

/* ========== 滚动条 - Scrollbar ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

/* ============================================
   工具类 - Utility Classes
   ============================================ */

/* ========== 显示/隐藏 ========== */
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.visible { visibility: visible; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ========== Flex 布局 ========== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-grow { flex-grow: 1; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }

.self-auto { align-self: auto; }
.self-start { align-self: flex-start; }
.self-center { align-self: center; }
.self-end { align-self: flex-end; }
.self-stretch { align-self: stretch; }

.gap-0 { gap: 0; }
.gap-1 { gap: var(--spacing-1); }
.gap-2 { gap: var(--spacing-2); }
.gap-3 { gap: var(--spacing-3); }
.gap-4 { gap: var(--spacing-4); }
.gap-5 { gap: var(--spacing-5); }
.gap-6 { gap: var(--spacing-6); }
.gap-8 { gap: var(--spacing-8); }

/* ========== Grid 布局 ========== */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ========== 宽度/高度 ========== */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-1\/2 { width: 50%; }
.w-1\/3 { width: 33.333333%; }
.w-1\/4 { width: 25%; }
.max-w-full { max-width: 100%; }
.min-w-0 { min-width: 0; }

.h-full { height: 100%; }
.h-auto { height: auto; }
.min-h-0 { min-height: 0; }
.min-h-screen { min-height: 100vh; }

/* ========== 内外边距 ========== */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mt-auto { margin-top: auto; }
.mb-auto { margin-bottom: auto; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-1); }
.p-2 { padding: var(--spacing-2); }
.p-3 { padding: var(--spacing-3); }
.p-4 { padding: var(--spacing-4); }
.p-5 { padding: var(--spacing-5); }
.p-6 { padding: var(--spacing-6); }
.p-8 { padding: var(--spacing-8); }

.px-2 { padding-left: var(--spacing-2); padding-right: var(--spacing-2); }
.px-3 { padding-left: var(--spacing-3); padding-right: var(--spacing-3); }
.px-4 { padding-left: var(--spacing-4); padding-right: var(--spacing-4); }
.px-6 { padding-left: var(--spacing-6); padding-right: var(--spacing-6); }

.py-2 { padding-top: var(--spacing-2); padding-bottom: var(--spacing-2); }
.py-3 { padding-top: var(--spacing-3); padding-bottom: var(--spacing-3); }
.py-4 { padding-top: var(--spacing-4); padding-bottom: var(--spacing-4); }

/* ========== 文字对齐 ========== */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* ========== 文字溢出 ========== */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== 字重 ========== */
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* ========== 文字颜色 ========== */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.text-white { color: white; }

/* ========== 背景色 ========== */
.bg-primary { background-color: var(--color-bg-primary); }
.bg-secondary { background-color: var(--color-bg-secondary); }
.bg-card { background-color: var(--color-bg-card); }
.bg-input { background-color: var(--color-bg-input); }
.bg-accent { background-color: var(--color-primary); }
.bg-accent-alpha-10 { background-color: var(--color-primary-alpha-10); }

/* ========== 位置 ========== */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.inset-0 { inset: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* ========== 溢出 ========== */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-visible { overflow: visible; }

/* ========== 交互 ========== */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-default { cursor: default; }

/* ========== 选择 ========== */
.select-none {
  user-select: none;
  -webkit-user-select: none;
}

.select-all {
  user-select: all;
  -webkit-user-select: all;
}

.select-text {
  user-select: text;
  -webkit-user-select: text;
}

/* ========== Z-index ========== */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }
.z-100 { z-index: 100; }
.z-1000 { z-index: 1000; }

/* ========== 圆角 ========== */
.rounded-none { border-radius: 0; }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ========== 边框 ========== */
.border-0 { border-width: 0; }
.border { border-width: 1px; }
.border-solid { border-style: solid; }
.border-default { border-color: var(--color-border); }
.border-light { border-color: var(--color-border-light); }

/* ========== 阴影 ========== */
.shadow-none { box-shadow: none; }
.shadow-xs { box-shadow: var(--shadow-xs); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ========== 过渡动画 ========== */
.transition-fast { transition: all var(--transition-fast); }
.transition-normal { transition: all var(--transition-normal); }
.transition-slow { transition: all var(--transition-slow); }

/* ============================================
   移动端响应式增强 - Mobile Responsive Enhancements
   ============================================ */

/* 移除最小宽度限制 - 响应式适配 */
@media (max-width: 1024px) {
  .app {
    min-width: auto;
  }
}

/* ============================================
   触摸友好优化 - Touch-Friendly Optimizations
   ============================================ */

/* 确保所有交互元素有足够的触摸区域 */
button,
[role="button"],
input[type="submit"],
input[type="reset"],
input[type="button"],
a[href],
select {
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
}

/* 输入框触摸优化 */
input,
textarea,
select {
  min-height: 44px;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}

/* 复选框和单选按钮触摸区域增强 */
input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
}

/* 标签关联增大点击区域 */
label {
  cursor: pointer;
  touch-action: manipulation;
}

/* 移除 hover 依赖，添加 active 状态反馈 */
@media (hover: none) and (pointer: coarse) {
  /* 禁用 hover 效果 - 触摸屏没有真正的 hover */
  button:hover,
  .btn:hover,
  a:hover,
  .nav-item:hover,
  .sidebar-action-item:hover {
    background: inherit;
    color: inherit;
  }

  /* 添加 active 状态视觉反馈 */
  button:active,
  .btn:active,
  a:active,
  .nav-item:active,
  .sidebar-action-item:active {
    opacity: 0.8;
    transform: scale(0.98);
  }

  /* 立即移除 focus 状态 - 触摸屏不需要持久 focus */
  button:focus,
  .btn:focus,
  input:focus,
  textarea:focus,
  select:focus {
    outline: none;
  }
}

/* 防止双击缩放 */
* {
  touch-action: manipulation;
}

/* 长按菜单禁用 */
body {
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* 允许文本选择 */
p, span, h1, h2, h3, h4, h5, h6, td, th, li, code, pre {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}

/* ============================================
   安全区域适配 - Safe Area Insets
   ============================================ */

/* iPhone X 及以上刘海屏适配 */
@supports (padding-top: env(safe-area-inset-top)) {
  .navbar {
    padding-top: max(12px, env(safe-area-inset-top)) !important;
  }

  .main-content {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sidebar-expand-fab {
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
  }

  .auth-container {
    padding-top: max(2rem, env(safe-area-inset-top));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
}

/* ============================================
   滚动性能优化 - Scroll Performance
   ============================================ */

/* 平滑滚动增强 */
.scroll-smooth {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* 滚动容器性能优化 */
.overflow-auto,
.overflow-y-auto,
.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
}

/* ============================================
   高对比度模式支持
   ============================================ */

@media (prefers-contrast: high) {
  * {
    border-width: 2px !important;
  }

  .border-light {
    border-color: var(--color-text-muted) !important;
  }
}

/* ============================================
   减少动画模式支持
   ============================================ */

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

/* ============================================
   横屏模式优化
   ============================================ */

@media (orientation: landscape) and (max-height: 500px) {
  /* 矮屏幕优化 - 减少垂直间距 */
  .navbar {
    height: 44px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }

  .main-content {
    margin-top: 44px !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  .auth-container {
    padding: 0.5rem !important;
    align-items: center !important;
  }

  .auth-card {
    padding: 1rem !important;
    max-height: 95vh;
    overflow-y: auto;
  }
}

/* ============================================
   响应式表单优化
   ============================================ */

@media (max-width: 768px) {
  /* 表单标签垂直排列 */
  .form-group {
    flex-direction: column;
    align-items: stretch !important;
  }

  .form-group label {
    margin-bottom: 0.5rem;
    width: 100% !important;
  }

  /* 输入框全宽 */
  .form-group input,
  .form-group textarea,
  .form-group select {
    width: 100% !important;
  }

  /* 按钮全宽 */
  .form-actions button,
  .form-actions .btn {
    width: 100%;
    margin-left: 0 !important;
    margin-bottom: 0.5rem;
  }
}

/* ============================================
   表格响应式优化
   ============================================ */

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-overflow-scrolling: touch;
  margin: 0 -1rem;
  padding: 0 1rem;
}

@media (max-width: 768px) {
  .table-responsive table {
    min-width: 600px;
  }
}

@media (max-width: 576px) {
  .table-responsive {
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
  }

  .table-responsive table {
    min-width: 500px;
    font-size: 0.85rem;
  }

  .table-responsive th,
  .table-responsive td {
    padding: 0.5rem 0.35rem;
  }
}

/* ============================================
   额外响应式工具类
   ============================================ */

/* 响应式显示 */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }

@media (max-width: 576px) {
  .d-sm-none { display: none !important; }
  .d-sm-block { display: block !important; }
  .d-sm-flex { display: flex !important; }
}

@media (max-width: 768px) {
  .d-md-none { display: none !important; }
  .d-md-block { display: block !important; }
  .d-md-flex { display: flex !important; }
}

@media (max-width: 1024px) {
  .d-lg-none { display: none !important; }
  .d-lg-block { display: block !important; }
  .d-lg-flex { display: flex !important; }
}

/* 响应式间距 */
@media (max-width: 768px) {
  .p-md-0 { padding: 0 !important; }
  .p-md-1 { padding: var(--spacing-1) !important; }
  .p-md-2 { padding: var(--spacing-2) !important; }
  .p-md-3 { padding: var(--spacing-3) !important; }
  .p-md-4 { padding: var(--spacing-4) !important; }

  .m-md-0 { margin: 0 !important; }
  .m-md-auto { margin: auto !important; }

  .gap-md-1 { gap: var(--spacing-1) !important; }
  .gap-md-2 { gap: var(--spacing-2) !important; }
  .gap-md-3 { gap: var(--spacing-3) !important; }
}

@media (max-width: 576px) {
  .p-sm-0 { padding: 0 !important; }
  .p-sm-1 { padding: var(--spacing-1) !important; }
  .p-sm-2 { padding: var(--spacing-2) !important; }

  .m-sm-0 { margin: 0 !important; }

  .gap-sm-1 { gap: var(--spacing-1) !important; }
  .gap-sm-2 { gap: var(--spacing-2) !important; }
}

/* 响应式字体大小 */
@media (max-width: 768px) {
  .text-md-sm { font-size: var(--font-sm) !important; }
  .text-md-base { font-size: var(--font-base) !important; }
  .text-md-lg { font-size: var(--font-lg) !important; }
}

@media (max-width: 576px) {
  .text-sm-xs { font-size: var(--font-xs) !important; }
  .text-sm-sm { font-size: var(--font-sm) !important; }
  .text-sm-base { font-size: var(--font-base) !important; }
}

/* 响应式文本对齐 */
@media (max-width: 768px) {
  .text-md-left { text-align: left !important; }
  .text-md-center { text-align: center !important; }
  .text-md-right { text-align: right !important; }
}

@media (max-width: 576px) {
  .text-sm-left { text-align: left !important; }
  .text-sm-center { text-align: center !important; }
  .text-sm-right { text-align: right !important; }
}

/* 响应式 flex 方向 */
@media (max-width: 768px) {
  .flex-md-col { flex-direction: column !important; }
  .flex-md-row { flex-direction: row !important; }
  .flex-md-wrap { flex-wrap: wrap !important; }
  .flex-md-nowrap { flex-wrap: nowrap !important; }
}

@media (max-width: 576px) {
  .flex-sm-col { flex-direction: column !important; }
  .flex-sm-row { flex-direction: row !important; }
  .flex-sm-wrap { flex-wrap: wrap !important; }
}

/* 响应式宽度 */
@media (max-width: 768px) {
  .w-md-full { width: 100% !important; }
  .w-md-auto { width: auto !important; }
}

@media (max-width: 576px) {
  .w-sm-full { width: 100% !important; }
  .w-sm-auto { width: auto !important; }
}


/* ===== renderer/css/ai-guide.css ===== */
/* ============================================
   AI Simulation Guide - 主入口文件
   模块结构:
   - ai-guide/_variables.css: CSS 变量定义
   - ai-guide/_layout.css: 主布局
   - ai-guide/_sidebar.css: 侧边栏
   - ai-guide/_chat.css: 聊天相关
   - ai-guide/_modals.css: 弹窗
   - ai-guide/_buttons.css: 按钮
   - ai-guide/_utilities.css: 工具类和杂项
   ============================================ */

/* ============================================
   _variables.css - CSS 变量定义
   AI Simulation Guide 使用的所有 CSS 变量
   完全使用项目 CSS 变量，支持深色/浅色主题
   ============================================ */

.simulation-guide-with-sidebar {
  /* 主色调 - 使用项目变量，保持一致性 */
  --ai-guide-primary: var(--color-primary);
  --ai-guide-primary-hover: var(--color-primary-dark);
  --ai-guide-primary-light: var(--color-primary-light);
  --ai-guide-primary-alpha-10: var(--color-primary-alpha-10);
  --ai-guide-primary-alpha-15: var(--color-primary-alpha-15);

  /* 侧边栏 - 使用项目变量 */
  --ai-guide-sidebar-bg: var(--color-bg-sidebar);
  --ai-guide-sidebar-hover: var(--color-bg-module-hover);
  --ai-guide-sidebar-border: var(--color-sidebar-border);
  --ai-guide-sidebar-text: var(--color-sidebar-text);
  --ai-guide-sidebar-muted: var(--color-sidebar-text-muted);

  /* 主内容区 - 使用项目变量 */
  --ai-guide-bg-primary: var(--color-bg-primary);
  --ai-guide-bg-secondary: var(--color-bg-secondary);
  --ai-guide-bg-tertiary: var(--color-bg-card);
  --ai-guide-border: var(--color-border);
  --ai-guide-border-light: var(--color-border-light);

  /* 文字 - 使用项目变量 */
  --ai-guide-text-primary: var(--color-text-primary);
  --ai-guide-text-secondary: var(--color-text-secondary);
  --ai-guide-text-muted: var(--color-text-muted);

  /* 用户消息气泡 - 现代简约设计 */
  /* 用户消息：使用主色调的淡背景，有层次但不突兀 */
  --ai-guide-user-bubble-bg: var(--color-primary-alpha-10);
  --ai-guide-user-bubble-text: var(--color-text-primary);

  /* AI 消息：使用次级背景色，与页面融合 */
  --ai-guide-assistant-bubble-bg: var(--color-bg-secondary);
  --ai-guide-assistant-bubble-border: var(--color-border-light);

  /* 输入框 - 使用项目输入框背景 */
  --ai-guide-input-bg: var(--color-bg-input);
  --ai-guide-input-border: var(--color-border);
  --ai-guide-input-focus-border: var(--color-primary);
  --ai-guide-input-focus-shadow: var(--color-primary-alpha-15);

  /* 头像区分色 */
  --ai-guide-avatar-ai: var(--color-primary);
  --ai-guide-avatar-user: var(--color-cyan);

  /* 代码块背景 */
  --ai-guide-code-bg: var(--color-bg-input);

  /* 状态颜色 - 使用项目变量 */
  --ai-guide-success: var(--color-success);
  --ai-guide-warning: var(--color-warning);
  --ai-guide-danger: var(--color-danger);

  /* 圆角变量 - 使用项目变量 */
  --ai-guide-radius-sm: var(--radius-sm);
  --ai-guide-radius-md: var(--radius-md);
  --ai-guide-radius-lg: var(--radius-lg);
  --ai-guide-radius-full: var(--radius-full);

  /* 阴影变量 - 使用项目变量 */
  --ai-guide-shadow-sm: var(--shadow-sm);
  --ai-guide-shadow-md: var(--shadow-md);
  --ai-guide-shadow-lg: var(--shadow-lg);

  /* 过渡动画变量 - 使用项目变量 */
  --ai-guide-transition-fast: var(--transition-fast);
  --ai-guide-transition-normal: var(--transition-normal);

  /* ========== 兼容性别名（指向主变量）========== */
  /* 表形式页面专用变量 - 统一指向主变量 */
  --guide-primary: var(--ai-guide-primary);
  --guide-primary-hover: var(--ai-guide-primary-hover);
  --guide-primary-light: var(--ai-guide-primary-light);
  --guide-primary-subtle: var(--ai-guide-primary-alpha-10);
  --guide-primary-muted: var(--ai-guide-primary-alpha-15);
  --guide-bg-base: var(--ai-guide-bg-secondary);
  --guide-bg-subtle: var(--ai-guide-bg-tertiary);
  --guide-bg-elevated: var(--ai-guide-bg-card);
  --guide-border: var(--ai-guide-border);
  --guide-border-default: var(--ai-guide-border);
  --guide-border-subtle: var(--ai-guide-border-light);
  --guide-text-primary: var(--ai-guide-text-primary);
  --guide-text-secondary: var(--ai-guide-text-secondary);
  --guide-text-muted: var(--ai-guide-text-muted);
  --guide-success: var(--ai-guide-success);
  --guide-warning: var(--ai-guide-warning);
  --guide-danger: var(--ai-guide-danger);
  --guide-radius-sm: var(--ai-guide-radius-sm);
  --guide-radius-md: var(--ai-guide-radius-md);
  --guide-radius-lg: var(--ai-guide-radius-lg);
  --guide-radius-full: var(--ai-guide-radius-full);
  --guide-shadow-sm: var(--ai-guide-shadow-sm);
  --guide-shadow-md: var(--ai-guide-shadow-md);
  --guide-shadow-lg: var(--ai-guide-shadow-lg);
}
/* ============================================
   _layout.css - 主布局、容器
   AI Simulation Guide 主布局和容器样式
   ============================================ */

/* 仿真引导页面紧贴主侧边栏（由父元素 main-content 提供 left margin） */
.simulation-guide-with-sidebar {
  display: flex;
  flex: 1;
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--ai-guide-bg-secondary);
  overflow: hidden;
  align-items: stretch;
  gap: 0;
  border: 0;
  position: relative;
  z-index: 10;
}

.simulation-guide-with-sidebar * {
  box-sizing: border-box;
}

.simulation-guide-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: var(--ai-guide-bg-primary);
  box-sizing: border-box;
  margin-left: 0;
  padding-left: 0;
}

.simulation-guide-container {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  width: 100%;
  height: 100%;
  padding: 0 16px 8px;
  box-sizing: border-box;
}

.simulation-guide-with-sidebar .conversational-mode-container {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  height: 100%;
}

/* ==================== 顶部标题栏 ==================== */
.simulation-guide-with-sidebar .guide-header-card {
  padding: var(--spacing-5) 0 var(--spacing-4);
  border-bottom: 1px solid var(--ai-guide-border);
  background: var(--ai-guide-bg-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-4);
}

.simulation-guide-with-sidebar .guide-header-card h2 {
  flex: 1;
  font-size: var(--font-xl);
  font-weight: 600;
  color: var(--ai-guide-text-primary);
  margin: 0;
  line-height: 1.25;
}

.simulation-guide-with-sidebar .current-module-badge {
  padding: 6px 14px;
  background: var(--ai-guide-primary-light);
  color: var(--ai-guide-primary);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 500;
  white-space: nowrap;
}

/* ==================== 消息搜索栏 ==================== */
.simulation-guide-with-sidebar .message-search-bar {
  padding: var(--spacing-4) 0;
  border-bottom: 1px solid var(--ai-guide-border);
}

.simulation-guide-with-sidebar .message-search-bar input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: var(--ai-guide-bg-secondary);
  border: 1px solid var(--ai-guide-border);
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  color: var(--ai-guide-text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.simulation-guide-with-sidebar .message-search-bar input:focus {
  border-color: var(--ai-guide-primary);
  background: var(--ai-guide-bg-primary);
  box-shadow: 0 0 0 3px var(--ai-guide-primary-light);
}

.simulation-guide-with-sidebar .message-search-result {
  font-size: var(--font-sm);
  color: var(--ai-guide-text-secondary);
  margin-top: 8px;
}

/* ==================== 当前参数展示条 ==================== */
.simulation-guide-with-sidebar .current-params-bar {
  background: var(--ai-guide-bg-primary);
  border: 1px solid var(--ai-guide-border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  flex-shrink: 0;
}

.simulation-guide-with-sidebar .current-params-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--ai-guide-primary-light);
  user-select: none;
}

.simulation-guide-with-sidebar .current-params-header:hover {
  background: var(--ai-guide-primary);
  color: white;
}

.simulation-guide-with-sidebar .current-params-header:hover .params-label,
.simulation-guide-with-sidebar .current-params-header:hover .params-count {
  color: white;
}

.simulation-guide-with-sidebar .params-label {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--ai-guide-primary);
  flex: 1;
}

.simulation-guide-with-sidebar .params-count {
  font-size: var(--font-xs);
  color: var(--ai-guide-text-muted);
}

.simulation-guide-with-sidebar .expand-icon {
  font-size: 10px;
  color: var(--ai-guide-text-muted);
}

.simulation-guide-with-sidebar .current-params-json {
  padding: 12px 16px;
  background: var(--ai-guide-code-bg);
  max-height: 200px;
  overflow-y: auto;
}

.simulation-guide-with-sidebar .current-params-json pre {
  margin: 0;
  font-size: var(--font-xs);
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  color: #e5e5e5;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
}

.simulation-guide-with-sidebar .current-params-actions {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--ai-guide-border);
}

.simulation-guide-with-sidebar .btn-action {
  flex: 1;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.simulation-guide-with-sidebar .btn-action:not(.primary) {
  background: var(--ai-guide-bg-secondary);
  border: 1px solid var(--ai-guide-border);
  color: var(--ai-guide-text-secondary);
}

.simulation-guide-with-sidebar .btn-action:not(.primary):hover {
  border-color: var(--ai-guide-primary);
  color: var(--ai-guide-primary);
}

.simulation-guide-with-sidebar .btn-action.primary {
  background: var(--ai-guide-primary);
  border: none;
  color: white;
  font-weight: 500;
}

.simulation-guide-with-sidebar .btn-action.primary:hover {
  background: var(--ai-guide-primary-hover);
  transform: translateY(-1px);
}

/* ==================== 对话区域 ==================== */
.simulation-guide-with-sidebar .chat-container {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ai-guide-border) transparent;
}

.simulation-guide-with-sidebar .chat-container::-webkit-scrollbar {
  width: 6px;
}

.simulation-guide-with-sidebar .chat-container::-webkit-scrollbar-track {
  background: transparent;
}

.simulation-guide-with-sidebar .chat-container::-webkit-scrollbar-thumb {
  background: var(--ai-guide-border);
  border-radius: 3px;
}

.simulation-guide-with-sidebar .chat-container::-webkit-scrollbar-thumb:hover {
  background: var(--ai-guide-text-muted);
}

/* ==================== 新空状态设计 ==================== */
.simulation-guide-with-sidebar .empty-chat {
  max-width: 680px;
  margin: 50px auto;
  text-align: center;
  animation: fadeInUp var(--transition-normal);
}

.simulation-guide-with-sidebar .empty-chat-header {
  margin-bottom: 40px;
  padding: 0 20px;
}

.simulation-guide-with-sidebar .empty-chat-header h3 {
  font-size: 28px;
  font-weight: 700;
  color: var(--ai-guide-text-primary);
  margin: 0 0 12px 0;
  line-height: 1.3;
  background: linear-gradient(135deg, var(--ai-guide-text-primary) 0%, var(--ai-guide-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.simulation-guide-with-sidebar .empty-chat p {
  font-size: var(--font-base);
  color: var(--ai-guide-text-secondary);
  margin: 0;
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto;
}

.simulation-guide-with-sidebar .module-section {
  margin-bottom: 28px;
}

.simulation-guide-with-sidebar .module-section h4 {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--ai-guide-text-muted);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.simulation-guide-with-sidebar .module-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.simulation-guide-with-sidebar .module-card {
  position: relative;
  padding: 20px 16px;
  background: var(--ai-guide-bg-primary);
  border: 2px solid var(--ai-guide-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  overflow: hidden;
}

/* 卡片顶部渐变装饰条 */
.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ai-guide-primary) 0%, var(--ai-guide-primary-hover) 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.simulation-guide-with-sidebar .module-card:hover {
  border-color: var(--ai-guide-primary);
  background: var(--ai-guide-primary-light);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.simulation-guide-with-sidebar .module-card:hover::before {
  transform: scaleX(1);
}

.simulation-guide-with-sidebar .module-name {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--ai-guide-text-primary);
}

/* ==================== 聊天容器留白 ==================== */
.simulation-guide-with-sidebar .chat-bottom-spacer {
  flex-shrink: 0;
  height: 10px;
}

/* ==================== 输入区域 ==================== */
.simulation-guide-with-sidebar .input-area {
  flex: 0 0 auto;
  background: var(--ai-guide-bg-primary);
  padding: 8px 0;
  border-top: 1px solid var(--ai-guide-border);
  box-sizing: border-box;
  overflow: visible;
}

.simulation-guide-with-sidebar .conversational-mode-container > .params-json-bar {
  flex-shrink: 0;
  max-height: 140px;
  overflow: hidden;
}

.simulation-guide-with-sidebar .conversational-mode-container > .chat-container {
  flex: 1 1 0;
  min-height: 100px;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* ==================== ConversationPage 布局 ==================== */
.conversation-page {
  display: flex;
  flex: 1;
  height: 100%;
  overflow: hidden;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: var(--ai-guide-bg-primary);
}

/* 顶部栏 */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--ai-guide-border);
  flex-shrink: 0;
}

.chat-title {
  flex: 1;
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--ai-guide-text-primary);
  margin: 0;
}

.chat-header-actions {
  display: flex;
  gap: 8px;
}

.btn-toggle-sidebar,
.btn-settings {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--ai-guide-border);
  border-radius: var(--radius-md);
  color: var(--ai-guide-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-toggle-sidebar:hover,
.btn-settings:hover {
  border-color: var(--ai-guide-primary);
  color: var(--ai-guide-primary);
  background: var(--ai-guide-primary-light);
}

/* 消息列表区域 */
.chat-messages {
  flex: 1 1 auto;
  min-height: 400px;
  height: calc(100vh - 200px);
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--ai-guide-border) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--ai-guide-border);
  border-radius: 3px;
}

.simulation-guide-with-sidebar .chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--ai-guide-text-muted);
}

/* 空状态 - 简约高级设计 */
.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 60px 40px;
  text-align: center;
  position: relative;
}

.chat-empty::before {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, var(--ai-guide-primary-alpha-8) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0.6;
  pointer-events: none;
}

.chat-empty .empty-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 28px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-empty .empty-icon svg {
  width: 100%;
  height: 100%;
  color: var(--ai-guide-primary);
  opacity: 0.8;
}

.chat-empty .empty-title {
  font-size: var(--font-xl);
  font-weight: 600;
  color: var(--ai-guide-text-primary);
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
}

.chat-empty .empty-hint {
  font-size: var(--font-base);
  color: var(--ai-guide-text-muted);
  margin: 0;
  max-width: 280px;
  line-height: 1.6;
}

/* 输入区域容器 */
.chat-input-container {
  flex-shrink: 0;
  border-top: 1px solid var(--ai-guide-border);
  background: var(--ai-guide-bg-primary);
  min-height: 50px;
}

/* ============================================
   响应式左右 padding 系统
   设计原则：桌面端宽松，平板端适中，手机端紧凑
   ============================================ */

/* ========== 默认（桌面 1200px+）========== */
.simulation-guide-container {
  padding: 0 0 8px;
}

.simulation-guide-with-sidebar .guide-header-card {
  padding: 20px 24px 16px;
}

.simulation-guide-with-sidebar .message-search-bar {
  padding: 16px 24px;
}

.chat-messages {
  padding: 0 24px;
}

.chat-empty {
  padding: 60px 48px;
}

/* ========== 1400px+ 超大屏幕 ========== */
@media (min-width: 1400px) {
  .simulation-guide-container {
    padding: 0 0 10px;
  }

  .simulation-guide-with-sidebar .guide-header-card {
    padding: 20px 32px 16px;
  }

  .simulation-guide-with-sidebar .message-search-bar {
    padding: 16px 32px;
  }

  .chat-messages {
    padding: 0 32px;
  }

  .chat-empty {
    padding: 80px 60px;
  }
}

/* ========== 1200px 中等桌面 ========== */
@media (max-width: 1200px) {
  .simulation-guide-container {
    padding: 0 0 8px;
  }

  .simulation-guide-with-sidebar .guide-header-card {
    padding: 16px 20px 12px;
  }

  .simulation-guide-with-sidebar .message-search-bar {
    padding: 16px 20px;
  }

  .chat-messages {
    padding: 0 16px;
  }

  .chat-empty {
    padding: 48px 32px;
  }
}

/* ========== 1024px 平板横屏 ========== */
@media (max-width: 1024px) {
  .simulation-guide-container {
    padding: 0 0 8px;
  }

  .simulation-guide-with-sidebar .guide-header-card {
    padding: 14px 16px 10px;
  }

  .simulation-guide-with-sidebar .message-search-bar {
    padding: 14px 16px;
  }

  .chat-messages {
    padding: 0 12px;
  }
}

/* ========== 768px 平板 ========== */
@media (max-width: 768px) {
  .simulation-guide-container {
    padding: 0 0 6px;
  }

  .simulation-guide-with-sidebar .guide-header-card {
    padding: 12px 12px 10px;
  }

  .simulation-guide-with-sidebar .guide-header-card h2 {
    font-size: 18px;
  }

  .simulation-guide-with-sidebar .message-search-bar {
    padding: 12px 12px;
  }

  .chat-messages {
    padding: 0 10px;
  }

  .chat-empty {
    padding: 40px 24px;
  }

  .simulation-guide-with-sidebar .module-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== 576px 大屏手机 ========== */
@media (max-width: 576px) {
  .simulation-guide-container {
    padding: 0 0 6px;
  }

  .simulation-guide-with-sidebar .guide-header-card {
    padding: 10px 10px 8px;
  }

  .simulation-guide-with-sidebar .guide-header-card h2 {
    font-size: 16px;
  }

  .simulation-guide-with-sidebar .current-module-badge {
    padding: 4px 10px;
    font-size: 11px;
  }

  .simulation-guide-with-sidebar .message-search-bar {
    padding: 10px 10px;
  }

  .chat-messages {
    padding: 0 8px;
  }

  .chat-empty {
    padding: 32px 16px;
  }
}

/* ========== 480px 中等手机 ========== */
@media (max-width: 480px) {
  .simulation-guide-container {
    padding: 0 0 4px;
  }

  .simulation-guide-with-sidebar .guide-header-card {
    padding: 10px 8px 8px;
  }

  .simulation-guide-with-sidebar .message-search-bar {
    padding: 10px 8px;
  }

  .simulation-guide-with-sidebar .message-search-bar input {
    padding: 8px 12px 8px 36px;
    font-size: 14px;
  }

  .chat-messages {
    padding: 0 6px;
  }

  .chat-empty {
    padding: 24px 12px;
  }
}

/* ========== 360px 小手机 ========== */
@media (max-width: 360px) {
  .simulation-guide-container {
    padding: 0 0 4px;
  }

  .simulation-guide-with-sidebar .guide-header-card h2 {
    font-size: 14px;
  }

  .simulation-guide-with-sidebar .message-search-bar {
    padding: 8px 6px;
  }

  .chat-messages {
    padding: 0 4px;
  }
}

/* ==================== 增强模块选择卡片 ==================== */
.module-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.module-card {
  position: relative;
  padding: 24px 16px;
  background: var(--ai-guide-bg-primary);
  border: 2px solid var(--ai-guide-border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  overflow: hidden;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ai-guide-primary) 0%, var(--ai-guide-primary-hover) 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.module-card:hover {
  border-color: var(--ai-guide-primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.module-card:hover::before {
  transform: scaleX(1);
}

.module-name {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--ai-guide-text-primary);
  line-height: 1.4;
}

/* 模块卡片选中状态 */
.module-card.selected {
  border-color: var(--ai-guide-primary);
  background: var(--ai-guide-primary-light);
}

.module-card.selected::before {
  transform: scaleX(1);
}

/* 响应式适配 */
@media (max-width: 768px) {
  .module-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .module-card {
    padding: 18px 12px;
  }

  .message-wrapper {
    gap: 12px;
    margin-bottom: 20px;
  }

  .message-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .message-content {
    padding: 12px 14px;
    font-size: var(--font-sm);
  }
}
/* ============================================
   _sidebar.css - 侧边栏样式
   AI Simulation Guide 侧边栏
   现代简约设计，使用项目 CSS 变量
   ============================================ */

.simulation-guide-with-sidebar .ai-chat-sidebar {
  background: var(--ai-guide-sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  z-index: 11;
  position: relative;
  transition: width 0.2s ease;
  pointer-events: auto;
  height: 100%;
  box-sizing: border-box;
  min-height: 0;
  margin: 0;
  padding: 0;
  gap: 0;
}

.simulation-guide-with-sidebar .ai-chat-sidebar.collapsed {
  overflow: visible;
}

/* 拖拽调整条 */
.simulation-guide-with-sidebar .sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  cursor: col-resize;
  background: var(--ai-guide-sidebar-border);
  transition: background-color 0.15s ease;
  z-index: 12;
  user-select: none;
  -webkit-user-select: none;
}

.simulation-guide-with-sidebar .sidebar-resize-handle:hover,
.simulation-guide-with-sidebar .sidebar-resize-handle.active {
  background: var(--ai-guide-primary);
  width: 2px;
}

.simulation-guide-with-sidebar .ai-chat-sidebar.resizing {
  transition: none;
}

/* 侧边栏顶部 */
.simulation-guide-with-sidebar .sidebar-top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 14px 0;
  border-bottom: 1px solid var(--ai-guide-sidebar-border);
  gap: 8px;
}

.simulation-guide-with-sidebar .btn-new-chat {
  flex: 1;
  padding: 8px 12px;
  background: var(--ai-guide-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-sm);
  font-weight: 500;
  transition: background var(--transition-fast);
  text-align: center;
}

.simulation-guide-with-sidebar .btn-new-chat:hover {
  background: var(--ai-guide-primary-hover);
}

.simulation-guide-with-sidebar .collapsed .btn-new-chat {
  padding: 6px 4px;
  font-size: 16px;
  width: 32px;
}

.simulation-guide-with-sidebar .sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--ai-guide-sidebar-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 600;
}

.simulation-guide-with-sidebar .sidebar-toggle-btn:hover {
  color: var(--ai-guide-sidebar-text);
  background: var(--ai-guide-sidebar-hover);
}

.simulation-guide-with-sidebar .collapsed .sidebar-top-left,
.simulation-guide-with-sidebar .collapsed .sidebar-search,
.simulation-guide-with-sidebar .collapsed .sidebar-conversation-list,
.simulation-guide-with-sidebar .collapsed .sidebar-footer {
  display: none;
}

.simulation-guide-with-sidebar .collapsed .sidebar-top {
  padding: 12px 0;
  justify-content: flex-end;
  border-bottom: none;
}

.simulation-guide-with-sidebar .sidebar-expand-btn {
  position: absolute;
  top: 12px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: var(--ai-guide-primary);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 14px;
  font-weight: 600;
  z-index: 13;
}

.simulation-guide-with-sidebar .sidebar-expand-btn:hover {
  background: var(--ai-guide-primary-hover);
}

/* 搜索框 */
.simulation-guide-with-sidebar .sidebar-search {
  flex-shrink: 0;
  padding: 0 0 10px 0;
  border-bottom: 1px solid var(--ai-guide-sidebar-border);
}

.simulation-guide-with-sidebar .search-input {
  width: 100%;
  padding: 7px 10px;
  background: var(--ai-guide-bg-input);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  color: var(--ai-guide-sidebar-text);
  outline: none;
  transition: border-color var(--transition-fast);
  box-sizing: border-box;
}

.simulation-guide-with-sidebar .search-input::placeholder {
  color: var(--ai-guide-sidebar-muted);
}

.simulation-guide-with-sidebar .search-input:focus {
  border-color: var(--ai-guide-primary);
}

/* 会话列表 */
.simulation-guide-with-sidebar .sidebar-conversation-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0;
}

.simulation-guide-with-sidebar .sidebar-conversation-list::-webkit-scrollbar {
  width: 5px;
}

.simulation-guide-with-sidebar .sidebar-conversation-list::-webkit-scrollbar-track {
  background: transparent;
}

.simulation-guide-with-sidebar .sidebar-conversation-list::-webkit-scrollbar-thumb {
  background: var(--ai-guide-border);
  border-radius: 3px;
}

.simulation-guide-with-sidebar .sidebar-conversation-list::-webkit-scrollbar-thumb:hover {
  background: var(--ai-guide-primary);
}

/* 会话项 */
.simulation-guide-with-sidebar .conversation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: 2px;
  transition: background var(--transition-fast);
}

.simulation-guide-with-sidebar .conversation-item:hover {
  background: var(--ai-guide-sidebar-hover);
}

.simulation-guide-with-sidebar .conversation-item.active {
  background: var(--color-primary-alpha-10);
}

.simulation-guide-with-sidebar .conversation-item.loading {
  opacity: 0.6;
  pointer-events: none;
}

.simulation-guide-with-sidebar .conversation-item.loading .conversation-title::after {
  content: '...';
  display: inline-block;
  animation: loading-dots 1.4s ease-in-out infinite;
}

.simulation-guide-with-sidebar .conversation-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.simulation-guide-with-sidebar .collapsed .conversation-info {
  display: none;
}

.simulation-guide-with-sidebar .conversation-title {
  font-size: var(--font-sm);
  color: var(--ai-guide-sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.simulation-guide-with-sidebar .conversation-time {
  font-size: var(--font-xs);
  color: var(--ai-guide-sidebar-muted);
  margin-top: 2px;
}

.simulation-guide-with-sidebar .conversation-preview {
  font-size: var(--font-xs);
  color: var(--ai-guide-sidebar-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  line-height: 1.3;
}

/* 会话分组标题 */
.simulation-guide-with-sidebar .conversation-group-header {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--ai-guide-sidebar-muted);
  padding: 8px 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.simulation-guide-with-sidebar .conversation-delete-btn {
  flex-shrink: 0;
  padding: 4px 6px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-fast);
  font-size: 14px;
  color: var(--ai-guide-sidebar-muted);
  margin-left: 6px;
}

.simulation-guide-with-sidebar .conversation-item:hover .conversation-delete-btn {
  opacity: 1;
}

.simulation-guide-with-sidebar .conversation-delete-btn:hover {
  background: var(--color-danger-alpha-10);
  color: var(--color-danger);
}

.simulation-guide-with-sidebar .empty-conversations {
  padding: 24px 0;
  text-align: center;
  color: var(--ai-guide-sidebar-muted);
  font-size: var(--font-sm);
}

/* 侧边栏底部 */
.simulation-guide-with-sidebar .sidebar-footer {
  flex-shrink: 0;
  padding: 4px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 36px;
  box-sizing: border-box;
  border-top: 1px solid var(--ai-guide-sidebar-border);
}

.simulation-guide-with-sidebar .sidebar-footer-item {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: var(--font-sm);
  color: var(--ai-guide-text-muted);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 5px;
}

.simulation-guide-with-sidebar .sidebar-footer-item:hover {
  color: var(--ai-guide-primary);
  background: var(--color-primary-alpha-8);
}

.simulation-guide-with-sidebar .collapsed .sidebar-footer {
  display: none;
}
/* ========== 后台响应指示器 ========== */
.simulation-guide-with-sidebar .bg-running-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

.simulation-guide-with-sidebar .bg-running-indicator .bg-running-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ai-guide-primary);
  animation: bg-pulse 1.4s ease-in-out infinite;
}

.simulation-guide-with-sidebar .bg-running-indicator .bg-running-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.simulation-guide-with-sidebar .bg-running-indicator .bg-running-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.simulation-guide-with-sidebar .bg-running-indicator-collapsed {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
}

.simulation-guide-with-sidebar .bg-running-indicator-collapsed .bg-running-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ai-guide-primary);
  animation: bg-pulse 1.4s ease-in-out infinite;
}

.simulation-guide-with-sidebar .conversation-item.background-running {
  position: relative;
}

.simulation-guide-with-sidebar .conversation-item.background-running .conversation-title {
  color: var(--ai-guide-primary);
}

@keyframes loading-dots {
  0%, 100% {
    opacity: 0.3;
    content: '.';
  }
  33% {
    opacity: 0.6;
    content: '..';
  }
  66% {
    opacity: 1;
    content: '...';
  }
}

/* ============================================
   _chat.css - 聊天相关样式
   AI Simulation Guide 消息气泡、输入区域等
   现代简约设计，完全使用项目 CSS 变量
   ============================================ */

/* ==================== 消息气泡基础样式 ==================== */
.simulation-guide-with-sidebar .message-wrapper {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  animation: messageSlideIn 100ms ease;
}

/* 头像 - 现代简约 */
.simulation-guide-with-sidebar .message-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xs);
  font-weight: 600;
  flex-shrink: 0;
}

.simulation-guide-with-sidebar .message-avatar.assistant {
  background: var(--ai-guide-avatar-ai);
  color: white;
}

.simulation-guide-with-sidebar .message-avatar.user {
  background: var(--ai-guide-avatar-user);
  color: white;
}

/* 消息气泡 */
.simulation-guide-with-sidebar .message-bubble {
  flex: 1;
  min-width: 0;
  max-width: calc(100% - 52px);
  display: flex;
  flex-direction: column;
}

.simulation-guide-with-sidebar .message-content {
  padding: 10px 14px;
  font-size: var(--font-base);
  line-height: var(--line-height-relaxed);
  color: var(--ai-guide-text-primary);
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* 用户消息气泡 - 淡蓝背景 */
.simulation-guide-with-sidebar .message-wrapper.user .message-content {
  background: var(--ai-guide-user-bubble-bg);
  border-radius: var(--radius-lg);
  max-width: 85%;
}

/* AI 消息气泡 - 次级背景色，添加最小高度 */
.simulation-guide-with-sidebar .message-wrapper.assistant .message-content {
  background: var(--ai-guide-assistant-bubble-bg);
  border-radius: var(--radius-lg);
  max-width: 85%;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* 消息布局 - 用户头像在右 */
.simulation-guide-with-sidebar .message-wrapper.user {
  flex-direction: row;
}

.simulation-guide-with-sidebar .message-wrapper.user .message-avatar {
  order: 2;
}

.simulation-guide-with-sidebar .message-wrapper.user .message-bubble {
  order: 1;
}

.simulation-guide-with-sidebar .message-wrapper.user .message-bubble {
  align-items: flex-end;
}

/* AI 消息布局 - 头像在左 */
.simulation-guide-with-sidebar .message-wrapper.assistant {
  flex-direction: row;
}

.simulation-guide-with-sidebar .message-wrapper.assistant .message-avatar {
  order: 1;
}

.simulation-guide-with-sidebar .message-wrapper.assistant .message-bubble {
  order: 2;
}

/* ==================== 消息底部信息栏 ==================== */
.simulation-guide-with-sidebar .message-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 0;
}

.simulation-guide-with-sidebar .message-timestamp {
  font-size: var(--font-xs);
  color: var(--ai-guide-text-muted);
}

.simulation-guide-with-sidebar .message-actions {
  display: flex;
  gap: 4px;
}

.simulation-guide-with-sidebar .action-btn {
  padding: 4px 8px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-xs);
  color: var(--ai-guide-text-muted);
  transition: all var(--transition-fast);
}

.simulation-guide-with-sidebar .action-btn:hover {
  background: var(--ai-guide-bg-tertiary);
  color: var(--ai-guide-text-primary);
}

/* ==================== 打字机光标 ==================== */
.simulation-guide-with-sidebar .typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--ai-guide-primary);
  animation: blink 1s step-end infinite;
  vertical-align: baseline;
  margin-left: 2px;
  margin-bottom: 0.25em;
}

/* ==================== 流式进度指示器 - 简约版 ==================== */
.simulation-guide-with-sidebar .streaming-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: var(--font-xs);
  color: var(--ai-guide-text-muted);
}

.simulation-guide-with-sidebar .streaming-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.simulation-guide-with-sidebar .streaming-dot {
  width: 6px;
  height: 6px;
  background: var(--ai-guide-primary);
  border-radius: 50%;
  animation: streamingDotPulse 1.5s ease-in-out infinite;
}

.simulation-guide-with-sidebar .streaming-text {
  font-size: var(--font-xs);
  color: var(--ai-guide-text-muted);
}

.simulation-guide-with-sidebar .streaming-stats {
  font-size: var(--font-xs);
  color: var(--ai-guide-text-muted);
}

/* ==================== AI 思考状态 ==================== */
.simulation-guide-with-sidebar .ai-thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--ai-guide-bg-secondary);
  border-radius: var(--radius-md);
  max-width: 240px;
}

.ai-thinking-text {
  font-size: var(--font-sm);
  color: var(--ai-guide-text-muted);
}

.ai-thinking-dots {
  display: flex;
  gap: 4px;
}

.ai-thinking-dots span {
  width: 5px;
  height: 5px;
  background: var(--ai-guide-primary);
  border-radius: 50%;
  animation: thinkingPulse 1.4s infinite ease-in-out;
}

.ai-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ==================== 输入区域 ==================== */
.simulation-guide-with-sidebar .chat-input-container {
  padding: 16px 20px;
  flex-shrink: 0;
  background: var(--ai-guide-bg-primary);
}

.simulation-guide-with-sidebar .chat-input-wrapper {
  position: relative;
  background: var(--ai-guide-input-bg);
  border: 1px solid var(--ai-guide-input-border);
  border-radius: var(--radius-xl);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  overflow: hidden;
  min-height: 40px;
}

.simulation-guide-with-sidebar .chat-input-wrapper:focus-within {
  border-color: var(--ai-guide-input-focus-border);
  box-shadow: 0 0 0 3px var(--ai-guide-input-focus-shadow);
}

.simulation-guide-with-sidebar .chat-input-wrapper.disabled {
  opacity: 0.6;
}

.simulation-guide-with-sidebar .chat-input-wrapper textarea {
  width: 100%;
  padding: 10px 60px 10px 18px;
  border: none;
  background: transparent;
  font-size: var(--font-base);
  line-height: 1.5;
  resize: none;
  color: var(--ai-guide-text-primary);
  font-family: inherit;
  max-height: 120px;
  overflow-y: auto;
  outline: none;
}

.simulation-guide-with-sidebar .chat-input-wrapper textarea::placeholder {
  color: var(--ai-guide-text-muted);
}

.simulation-guide-with-sidebar .chat-input-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 6px 12px;
}

.simulation-guide-with-sidebar .btn-send-message {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ai-guide-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 16px;
}

.simulation-guide-with-sidebar .btn-send-message:hover:not(:disabled) {
  background: var(--ai-guide-primary-hover);
  transform: scale(1.05);
}

.simulation-guide-with-sidebar .btn-send-message:active:not(:disabled) {
  transform: scale(0.95);
}

.simulation-guide-with-sidebar .btn-send-message:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.simulation-guide-with-sidebar .btn-send-message .send-loading {
  display: flex;
  align-items: center;
  gap: 3px;
}

.simulation-guide-with-sidebar .btn-send-message .loading-dot {
  width: 5px;
  height: 5px;
  background: white;
  border-radius: 50%;
  animation: loadingPulse 1s infinite ease-in-out;
}

.simulation-guide-with-sidebar .btn-send-message .loading-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.simulation-guide-with-sidebar .btn-send-message .loading-dot:nth-child(3) {
  animation-delay: 0.3s;
}

/* ==================== 消息参数高亮 ==================== */
.simulation-guide-with-sidebar .message-content .param-highlight {
  display: inline;
  background: var(--color-primary-alpha-10);
  color: var(--ai-guide-primary);
  padding: 1px 4px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.9em;
}

.simulation-guide-with-sidebar .message-content .param-value {
  color: var(--ai-guide-primary);
  font-weight: 500;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* ==================== 参数表格 ==================== */
.simulation-guide-with-sidebar .params-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: var(--font-sm);
}

.simulation-guide-with-sidebar .params-table th,
.simulation-guide-with-sidebar .params-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--ai-guide-border-light);
}

.simulation-guide-with-sidebar .params-table th {
  background: var(--ai-guide-bg-secondary);
  font-weight: 600;
  color: var(--ai-guide-text-primary);
}

.simulation-guide-with-sidebar .params-table td {
  color: var(--ai-guide-text-secondary);
}

.simulation-guide-with-sidebar .params-table .param-name {
  font-weight: 500;
  color: var(--ai-guide-text-primary);
}

.simulation-guide-with-sidebar .params-table .param-value {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  color: var(--ai-guide-primary);
}

/* ==================== 编辑模式 ==================== */
.simulation-guide-with-sidebar .edit-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--ai-guide-bg-secondary);
  border: 1px solid var(--ai-guide-border);
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  line-height: 1.5;
  color: var(--ai-guide-text-primary);
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.simulation-guide-with-sidebar .edit-textarea:focus {
  border-color: var(--ai-guide-primary);
}

.simulation-guide-with-sidebar .edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.simulation-guide-with-sidebar .btn-edit-save {
  padding: 6px 14px;
  background: var(--ai-guide-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  cursor: pointer;
}

.simulation-guide-with-sidebar .btn-edit-cancel {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--ai-guide-border);
  color: var(--ai-guide-text-secondary);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  cursor: pointer;
}

/* ==================== 验证问题提示 ==================== */
.simulation-guide-with-sidebar .validation-issues {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.simulation-guide-with-sidebar .validation-issue {
  font-size: var(--font-xs);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.simulation-guide-with-sidebar .validation-issue.high {
  background: var(--color-danger-alpha-8);
  color: var(--color-danger);
  border-left: 3px solid var(--color-danger);
}

.simulation-guide-with-sidebar .validation-issue.medium {
  background: var(--color-warning-alpha-8);
  color: var(--color-warning);
  border-left: 3px solid var(--color-warning);
}

.simulation-guide-with-sidebar .validation-issue.low {
  background: var(--color-primary-alpha-8);
  color: var(--color-primary);
  border-left: 3px solid var(--color-primary);
}

/* ==================== 消息进度指示器 ==================== */
.simulation-guide-with-sidebar .message-progress {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--color-primary-alpha-10);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-primary-alpha-15);
}

.simulation-guide-with-sidebar .message-progress .progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.simulation-guide-with-sidebar .message-progress .progress-stage {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--ai-guide-primary);
}

.simulation-guide-with-sidebar .message-progress .progress-module {
  font-size: var(--font-xs);
  padding: 2px 8px;
  background: var(--ai-guide-primary);
  color: white;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.simulation-guide-with-sidebar .message-progress .progress-bar-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.simulation-guide-with-sidebar .message-progress .progress-bar {
  flex: 1;
  height: 4px;
  background: var(--ai-guide-border-light);
  border-radius: 2px;
  overflow: hidden;
}

.simulation-guide-with-sidebar .message-progress .progress-fill {
  height: 100%;
  background: var(--ai-guide-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.simulation-guide-with-sidebar .message-progress .progress-label {
  font-size: var(--font-xs);
  color: var(--ai-guide-primary);
  font-weight: 500;
  white-space: nowrap;
}

/* ==================== 工具调用结果 ==================== */
.simulation-guide-with-sidebar .tool-results {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.simulation-guide-with-sidebar .tool-result {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
}

.simulation-guide-with-sidebar .tool-result.success {
  background: var(--color-success-alpha-8);
  border: 1px solid var(--color-success-alpha-15);
}

.simulation-guide-with-sidebar .tool-result.error {
  background: var(--color-danger-alpha-8);
  border: 1px solid var(--color-danger-alpha-15);
}

.simulation-guide-with-sidebar .tool-result-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.simulation-guide-with-sidebar .tool-result.success .tool-icon {
  color: var(--color-success);
}

.simulation-guide-with-sidebar .tool-result.error .tool-icon {
  color: var(--color-danger);
}

.simulation-guide-with-sidebar .tool-result .tool-name {
  font-weight: 600;
  color: var(--ai-guide-text-primary);
}

.simulation-guide-with-sidebar .tool-result-message {
  color: var(--ai-guide-text-secondary);
  margin-top: 4px;
}

/* ==================== 搜索高亮 ==================== */
.simulation-guide-with-sidebar .search-highlight {
  background: var(--color-warning-alpha-15);
  color: var(--color-warning);
  padding: 1px 4px;
  border-radius: 3px;
}
/* ============================================
   _modals.css - 弹窗通用样式
   AI Simulation Guide 弹窗、对话框等
   ============================================ */

/* ==================== 弹窗通用样式 ==================== */
.simulation-guide-with-sidebar .modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  animation: fadeInUp var(--transition-fast);
}

.simulation-guide-with-sidebar .parameter-editor-modal,
.simulation-guide-with-sidebar .ai-settings-modal {
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  background: var(--ai-guide-bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleIn var(--transition-normal);
}

.simulation-guide-with-sidebar .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ai-guide-border);
}

.simulation-guide-with-sidebar .modal-header h3 {
  font-size: var(--font-xl);
  font-weight: 600;
  color: var(--ai-guide-text-primary);
  margin: 0;
}

.simulation-guide-with-sidebar .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.simulation-guide-with-sidebar .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--ai-guide-border);
}

.simulation-guide-with-sidebar .btn-cancel {
  padding: 10px 20px;
  background: var(--ai-guide-bg-secondary);
  border: 1px solid var(--ai-guide-border);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  color: var(--ai-guide-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.simulation-guide-with-sidebar .btn-cancel:hover {
  background: var(--ai-guide-bg-tertiary);
  border-color: var(--ai-guide-text-muted);
}

.simulation-guide-with-sidebar .btn-save {
  padding: 10px 20px;
  background: var(--ai-guide-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.simulation-guide-with-sidebar .btn-save:hover {
  background: var(--ai-guide-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ==================== 参数编辑器样式 ==================== */
.simulation-guide-with-sidebar .parameter-editor-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 单参数编辑模式时更紧凑 */
.simulation-guide-with-sidebar .parameter-editor-modal.single-edit .parameter-editor-grid {
  gap: 12px;
}

.simulation-guide-with-sidebar .parameter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.simulation-guide-with-sidebar .parameter-field label {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--ai-guide-text-primary);
}

.simulation-guide-with-sidebar .parameter-field input[type="number"],
.simulation-guide-with-sidebar .parameter-field input[type="text"] {
  padding: 10px 12px;
  border: 1px solid var(--ai-guide-border);
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  background: var(--ai-guide-bg-secondary);
  color: var(--ai-guide-text-primary);
  transition: all var(--transition-fast);
}

.simulation-guide-with-sidebar .parameter-field input[type="number"]:focus,
.simulation-guide-with-sidebar .parameter-field input[type="text"]:focus {
  outline: none;
  border-color: var(--ai-guide-primary);
  box-shadow: 0 0 0 3px var(--ai-guide-primary-light);
  background: var(--ai-guide-bg-primary);
}

.simulation-guide-with-sidebar .parameter-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--ai-guide-primary);
}

/* ==================== 设置弹窗样式 ==================== */
.simulation-guide-with-sidebar .settings-modal-overlay {
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.6);
}

.simulation-guide-with-sidebar .ai-settings-modal {
  max-width: 560px;
  border-radius: 20px;
  overflow: hidden;
}

/* 弹窗头部样式 */
.simulation-guide-with-sidebar .settings-modal-header {
  background: linear-gradient(135deg, var(--ai-guide-primary) 0%, var(--ai-guide-primary-hover) 100%);
  padding: 24px 28px;
  border-bottom: none;
}

.simulation-guide-with-sidebar .settings-header-content {
  display: flex;
  align-items: center;
}

.simulation-guide-with-sidebar .settings-modal-header h3 {
  color: white;
  font-size: var(--font-xl);
  font-weight: 700;
  margin: 0 0 4px 0;
}

.simulation-guide-with-sidebar .settings-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--font-sm);
  margin: 0;
}

.simulation-guide-with-sidebar .settings-btn-close {
  background: rgba(255, 255, 255, 0.2);
  width: 36px;
  height: 36px;
  font-size: 20px;
  color: white;
}

.simulation-guide-with-sidebar .settings-btn-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 弹窗主体样式 */
.simulation-guide-with-sidebar .settings-modal-body {
  padding: 24px 28px;
  background: var(--ai-guide-bg-primary);
}

.simulation-guide-with-sidebar .settings-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 设置分区 */
.simulation-guide-with-sidebar .setting-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.simulation-guide-with-sidebar .setting-section-header {
  display: flex;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ai-guide-border);
}

.simulation-guide-with-sidebar .section-icon {
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ai-guide-primary-light);
  border-radius: 8px;
}

.simulation-guide-with-sidebar .section-title {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--ai-guide-text-primary);
}

/* API 模式卡片 */
.simulation-guide-with-sidebar .api-mode-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.simulation-guide-with-sidebar .api-mode-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: var(--ai-guide-bg-secondary);
  border: 2px solid var(--ai-guide-border);
  border-radius: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.simulation-guide-with-sidebar .api-mode-card:hover {
  border-color: var(--ai-guide-primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.simulation-guide-with-sidebar .api-mode-card.active {
  border-color: var(--ai-guide-primary);
  background: linear-gradient(135deg, var(--ai-guide-primary-light) 0%, rgba(255, 255, 255, 0) 100%);
  box-shadow: 0 4px 20px var(--ai-guide-primary-light);
}

.simulation-guide-with-sidebar .mode-radio {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--ai-guide-primary);
  flex-shrink: 0;
}

.simulation-guide-with-sidebar .mode-card-content {
  flex: 1;
  min-width: 0;
}

.simulation-guide-with-sidebar .mode-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.simulation-guide-with-sidebar .mode-title {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--ai-guide-text-primary);
}

.simulation-guide-with-sidebar .mode-description {
  font-size: var(--font-sm);
  color: var(--ai-guide-text-secondary);
  line-height: 1.5;
  margin: 0 0 10px 0;
}

.simulation-guide-with-sidebar .mode-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.simulation-guide-with-sidebar .tag {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.simulation-guide-with-sidebar .tag-recommended {
  background: #dcfce7;
  color: #16a34a;
}

.simulation-guide-with-sidebar .tag-easy {
  background: #dbeafe;
  color: #2563eb;
}

.simulation-guide-with-sidebar .tag-flexible {
  background: #f3e8ff;
  color: #9333ea;
}

.simulation-guide-with-sidebar .tag-custom {
  background: #ffedd5;
  color: #ea580c;
}

/* 输入字段网格 */
.simulation-guide-with-sidebar .setting-fields-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.simulation-guide-with-sidebar .setting-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.simulation-guide-with-sidebar .field-label {
  display: flex;
  align-items: center;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--ai-guide-text-primary);
}

.simulation-guide-with-sidebar .setting-input {
  padding: 12px 16px;
  border: 2px solid var(--ai-guide-border);
  border-radius: 12px;
  font-size: var(--font-base);
  background: var(--ai-guide-bg-secondary);
  color: var(--ai-guide-text-primary);
  transition: all var(--transition-fast);
}

.simulation-guide-with-sidebar .setting-input:focus {
  outline: none;
  border-color: var(--ai-guide-primary);
  box-shadow: 0 0 0 4px var(--ai-guide-primary-light);
  background: var(--ai-guide-bg-primary);
}

.simulation-guide-with-sidebar .setting-input::placeholder {
  color: var(--ai-guide-text-muted);
}

/* 温度滑块 */
.simulation-guide-with-sidebar .temperature-field {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.simulation-guide-with-sidebar .temperature-field .field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.simulation-guide-with-sidebar .temp-value {
  font-weight: 600;
  color: var(--ai-guide-primary);
  background: var(--ai-guide-primary-light);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: var(--font-sm);
}

.simulation-guide-with-sidebar .setting-slider {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  background: linear-gradient(90deg, var(--ai-guide-border) 0%, var(--ai-guide-border) 100%);
  border-radius: 4px;
  outline: none;
}

.simulation-guide-with-sidebar .setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--ai-guide-primary) 0%, var(--ai-guide-primary-hover) 100%);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px var(--ai-guide-primary-light);
}

.simulation-guide-with-sidebar .setting-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 16px var(--ai-guide-primary-light);
}

.simulation-guide-with-sidebar .slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

.simulation-guide-with-sidebar .slider-label {
  font-size: var(--font-sm);
  color: var(--ai-guide-text-secondary);
}

/* 自定义 API 分区 */
.simulation-guide-with-sidebar .custom-api-section {
  padding-top: 0;
  border-top: none;
  margin-top: 0;
}

/* 危险区域 */
.simulation-guide-with-sidebar .danger-section {
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
}

.simulation-guide-with-sidebar .danger-icon {
  background: #fef2f2;
}

.simulation-guide-with-sidebar .danger-title {
  color: #dc2626;
}

.simulation-guide-with-sidebar .danger-content {
  padding: 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
}

.simulation-guide-with-sidebar .danger-description {
  font-size: var(--font-sm);
  color: #991b1b;
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.simulation-guide-with-sidebar .btn-clear-all {
  width: 100%;
  padding: 12px 20px;
  background: #fee2e2;
  border: 2px solid #fecaca;
  border-radius: 12px;
  font-size: var(--font-sm);
  font-weight: 500;
  color: #dc2626;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.simulation-guide-with-sidebar .btn-clear-all:hover {
  background: #fecaca;
  border-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.simulation-guide-with-sidebar .btn-icon {
  font-size: 16px;
}

/* 弹窗底部 */
.simulation-guide-with-sidebar .settings-modal-footer {
  padding: 20px 28px;
  background: var(--ai-guide-bg-secondary);
  border-top: 1px solid var(--ai-guide-border);
}

.simulation-guide-with-sidebar .btn-save {
  padding: 12px 24px;
  font-size: var(--font-base);
}

.simulation-guide-with-sidebar .btn-cancel {
  padding: 12px 24px;
  font-size: var(--font-base);
}

/* ==================== 简约设置弹窗样式 ==================== */
.simulation-guide-with-sidebar .settings-simple-modal {
  width: 100%;
  max-width: 420px;
  background: var(--ai-guide-bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.simulation-guide-with-sidebar .settings-simple-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ai-guide-border);
}

.simulation-guide-with-sidebar .settings-simple-header h3 {
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--ai-guide-text-primary);
  margin: 0;
}

.simulation-guide-with-sidebar .settings-simple-body {
  padding: 20px;
}

.simulation-guide-with-sidebar .setting-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.simulation-guide-with-sidebar .setting-label {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--ai-guide-text-primary);
}

.simulation-guide-with-sidebar .setting-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.simulation-guide-with-sidebar .radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-sm);
  color: var(--ai-guide-text-secondary);
  cursor: pointer;
}

.simulation-guide-with-sidebar .radio-label input {
  accent-color: var(--ai-guide-primary);
}

.simulation-guide-with-sidebar .setting-input {
  padding: 10px 14px;
  border: 1px solid var(--ai-guide-border);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  background: var(--ai-guide-bg-secondary);
  color: var(--ai-guide-text-primary);
  transition: all var(--transition-fast);
}

.simulation-guide-with-sidebar .setting-input:focus {
  outline: none;
  border-color: var(--ai-guide-primary);
  box-shadow: 0 0 0 3px var(--ai-guide-primary-light);
}

.simulation-guide-with-sidebar .temperature-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.simulation-guide-with-sidebar .temperature-control .setting-slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  background: var(--ai-guide-border);
  border-radius: 3px;
  outline: none;
}

.simulation-guide-with-sidebar .temperature-control .setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--ai-guide-primary);
  border-radius: 50%;
  cursor: pointer;
}

.simulation-guide-with-sidebar .temperature-control .temp-value {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--ai-guide-primary);
  min-width: 32px;
  text-align: right;
}

.simulation-guide-with-sidebar .settings-simple-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--ai-guide-border);
  background: var(--ai-guide-bg-secondary);
}

/* 设置弹窗 - 数据管理危险操作区域 */
.simulation-guide-with-sidebar .setting-row-danger {
  padding: 16px;
  background: var(--ai-guide-bg-tertiary, rgba(220, 53, 69, 0.05));
  border: 1px solid rgba(220, 53, 69, 0.2);
  border-radius: var(--radius-md);
}

.simulation-guide-with-sidebar .setting-row-danger .setting-label {
  color: var(--ai-guide-danger, #dc3545);
}

.simulation-guide-with-sidebar .setting-danger-hint {
  font-size: var(--font-xs);
  color: var(--ai-guide-text-secondary);
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.simulation-guide-with-sidebar .btn-danger-outline {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--ai-guide-danger, #dc3545);
  border-radius: var(--radius-md);
  color: var(--ai-guide-danger, #dc3545);
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  align-self: flex-start;
}

.simulation-guide-with-sidebar .btn-danger-outline:hover {
  background: var(--ai-guide-danger, #dc3545);
  color: white;
}

/* 设置分组分隔线 */
.simulation-guide-with-sidebar .setting-divider {
  height: 1px;
  background: var(--ai-guide-border);
  margin: 8px 0;
}

/* 设置提示文字 */
.simulation-guide-with-sidebar .setting-hint {
  font-size: var(--font-xs);
  color: var(--ai-guide-text-tertiary);
  margin-top: 4px;
  line-height: 1.4;
}

/* ==================== 新提交弹窗设计 ==================== */
.simulation-guide-with-sidebar .submit-options-modal {
  background: var(--ai-guide-bg-primary);
  border-radius: 20px;
  padding: 0;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn var(--transition-normal);
  overflow: hidden;
}

.simulation-guide-with-sidebar .submit-options-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--ai-guide-primary) 0%, var(--ai-guide-primary-hover) 100%);
  border-bottom: none;
}

.simulation-guide-with-sidebar .submit-options-modal .modal-header h3 {
  font-size: var(--font-lg);
  font-weight: 600;
  color: white;
  margin: 0;
}

.simulation-guide-with-sidebar .modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  cursor: pointer;
  font-size: 20px;
  transition: all var(--transition-fast);
}

.simulation-guide-with-sidebar .modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.simulation-guide-with-sidebar .submit-options-modal .modal-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.simulation-guide-with-sidebar .option-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px 20px;
  background: var(--ai-guide-bg-secondary);
  border: 2px solid var(--ai-guide-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.simulation-guide-with-sidebar .option-btn:hover {
  border-color: var(--ai-guide-primary);
  background: var(--ai-guide-primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.simulation-guide-with-sidebar .option-icon {
  font-size: 24px;
  margin-bottom: 0px;
}

.simulation-guide-with-sidebar .option-title {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--ai-guide-text-primary);
}

.simulation-guide-with-sidebar .option-desc {
  font-size: var(--font-sm);
  color: var(--ai-guide-text-muted);
  margin: 0;
}

/* ==================== 预提交审查弹窗 ==================== */
.simulation-guide-with-sidebar .submit-review-modal {
  background: var(--ai-guide-bg-primary);
  border-radius: var(--radius-lg);
  padding: 0;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn var(--transition-normal);
  overflow: hidden;
}

.simulation-guide-with-sidebar .submit-review-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--ai-guide-primary) 0%, var(--ai-guide-primary-hover) 100%);
  border-bottom: none;
}

.simulation-guide-with-sidebar .submit-review-modal .modal-header h3 {
  font-size: var(--font-lg);
  font-weight: 600;
  color: white;
  margin: 0;
}

.simulation-guide-with-sidebar .submit-review-modal .modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.simulation-guide-with-sidebar .submit-review-modal .modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.simulation-guide-with-sidebar .submit-review-modal .modal-body {
  padding: 20px 24px;
  max-height: 400px;
  overflow-y: auto;
}

.simulation-guide-with-sidebar .submit-review-modal .review-message {
  padding: 12px 16px;
  background: #fef3c7;
  border-radius: var(--radius-md);
  color: #92400e;
  font-size: var(--font-sm);
  margin-bottom: 16px;
}

.simulation-guide-with-sidebar .submit-review-modal .review-issues {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.simulation-guide-with-sidebar .submit-review-modal .issues-section {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border-left: 4px solid;
}

.simulation-guide-with-sidebar .submit-review-modal .issues-section.high {
  background: #fef2f2;
  border-color: #ef4444;
}

.simulation-guide-with-sidebar .submit-review-modal .issues-section.medium {
  background: #fffbeb;
  border-color: #f59e0b;
}

.simulation-guide-with-sidebar .submit-review-modal .issues-section.low {
  background: #f0fdf4;
  border-color: #22c55e;
}

.simulation-guide-with-sidebar .submit-review-modal .issues-title {
  font-size: var(--font-sm);
  font-weight: 600;
  margin-bottom: 8px;
}

.simulation-guide-with-sidebar .submit-review-modal .issues-section.high .issues-title {
  color: #dc2626;
}

.simulation-guide-with-sidebar .submit-review-modal .issues-section.medium .issues-title {
  color: #d97706;
}

.simulation-guide-with-sidebar .submit-review-modal .issues-section.low .issues-title {
  color: #16a34a;
}

.simulation-guide-with-sidebar .submit-review-modal .issue-item {
  font-size: var(--font-sm);
  color: var(--ai-guide-text-secondary);
  padding: 4px 0;
}

.simulation-guide-with-sidebar .submit-review-modal .review-success {
  padding: 16px;
  background: #f0fdf4;
  border-radius: var(--radius-md);
  color: #16a34a;
  font-size: var(--font-sm);
  text-align: center;
}

.simulation-guide-with-sidebar .submit-review-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--ai-guide-border);
}

/* ==================== Settings Modal 增强 ==================== */
.setting-row {
  margin-bottom: 20px;
}

.setting-label {
  display: block;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--ai-guide-text-primary);
  margin-bottom: 8px;
}

.setting-control {
  display: flex;
  gap: 16px;
}

.radio-label,
.switch-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-sm);
  color: var(--ai-guide-text-primary);
  cursor: pointer;
}

.setting-hint {
  font-size: var(--font-xs);
  color: var(--ai-guide-text-muted);
  margin-top: 6px;
}

/* ==================== 自定义确认弹窗 ==================== */
.simulation-guide-with-sidebar .confirm-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  animation: fadeIn 0.15s ease-out;
}

.simulation-guide-with-sidebar .confirm-dialog {
  width: 360px;
  background: linear-gradient(180deg, #2d2d2d 0%, #252525 100%);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: scaleIn 0.2s ease-out;
}

.simulation-guide-with-sidebar .confirm-dialog-header {
  padding: 24px 20px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.simulation-guide-with-sidebar .confirm-dialog-header.danger {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.12) 0%, rgba(239, 68, 68, 0.06) 100%);
}

.simulation-guide-with-sidebar .confirm-dialog-header .confirm-icon {
  display: none;
}

.simulation-guide-with-sidebar .confirm-dialog-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: #f0f0f0;
  margin: 0;
  letter-spacing: -0.01em;
}

.simulation-guide-with-sidebar .confirm-dialog-header.danger h3 {
  color: #f87171;
}

.simulation-guide-with-sidebar .confirm-dialog-body {
  padding: 20px 24px;
  text-align: center;
}

.simulation-guide-with-sidebar .confirm-dialog-body p {
  font-size: 14px;
  color: #a0a0a0;
  margin: 0;
  line-height: 1.5;
}

.simulation-guide-with-sidebar .confirm-dialog-footer {
  display: flex;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  border-radius: 0 0 16px 16px;
}

.simulation-guide-with-sidebar .confirm-dialog-footer .btn {
  flex: 1;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
  outline: none;
}

.simulation-guide-with-sidebar .confirm-dialog-footer .btn:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.simulation-guide-with-sidebar .confirm-dialog-footer .btn-cancel {
  color: #888;
  background: rgba(255, 255, 255, 0.02);
}

.simulation-guide-with-sidebar .confirm-dialog-footer .btn-cancel:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #aaa;
}

.simulation-guide-with-sidebar .confirm-dialog-footer .btn-danger {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
}

.simulation-guide-with-sidebar .confirm-dialog-footer .btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}
/* ============================================
   _buttons.css - 按钮样式
   AI Simulation Guide 各种按钮样式
   ============================================ */

/* ==================== 顶部工具栏 ==================== */
.simulation-guide-with-sidebar .top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-2);
  border-bottom: 1px solid var(--ai-guide-border);
  flex-shrink: 0;
  height: 56px;
  box-sizing: border-box;
  overflow: hidden;
}

.simulation-guide-with-sidebar .toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  flex: 1;
}

/* 步骤指示器内联样式（与标题同一行） */
.step-indicator-inline {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.step-indicator-inline .step-indicator-modern {
  padding: 0;
  gap: 18px;
}

.step-indicator-inline .step-indicator-modern::before {
  top: 14px;
}

.step-indicator-inline .step-indicator-modern .step-circle {
  width: 24px;
  height: 24px;
  font-size: 11px;
  border-width: 2px;
}

.step-indicator-inline .step-indicator-modern .step-label {
  margin-top: 2px;
  font-size: 10px;
}

.step-indicator-inline .step-indicator-modern .step-item {
  max-width: none;
}

.simulation-guide-with-sidebar .page-title {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--ai-guide-text-primary);
  margin: 0;
  white-space: nowrap;
}

.simulation-guide-with-sidebar .toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.simulation-guide-with-sidebar .toolbar-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ai-guide-bg-secondary);
  border: 1px solid var(--ai-guide-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.simulation-guide-with-sidebar .toolbar-btn:hover {
  background: var(--ai-guide-bg-tertiary);
  border-color: var(--ai-guide-primary);
}

.simulation-guide-with-sidebar .toolbar-btn .icon {
  font-size: 16px;
}

/* 工具栏文字按钮（ChatGPT风格） */
.simulation-guide-with-sidebar .toolbar-text-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--ai-guide-border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--ai-guide-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.simulation-guide-with-sidebar .toolbar-text-btn:hover {
  background: var(--ai-guide-bg-secondary);
  border-color: var(--ai-guide-primary);
  color: var(--ai-guide-primary);
}

.simulation-guide-with-sidebar .toolbar-btn-danger:hover {
  background: #fef2f2;
  border-color: #ef4444;
  color: #ef4444;
}

/* ==================== 参数展示条（简约悬浮风格） ==================== */
.simulation-guide-with-sidebar .current-params-bar {
  display: none; /* 默认隐藏 */
  background: var(--ai-guide-bg-primary);
  border: 1px solid var(--ai-guide-border);
  border-radius: var(--radius-xl);
  margin-bottom: 12px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: all var(--transition-fast);
}

.simulation-guide-with-sidebar .current-params-bar.visible {
  display: flex;
}

.simulation-guide-with-sidebar .current-params-bar:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 顶部栏 - 紧凑单行设计 */
.simulation-guide-with-sidebar .params-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
}

.simulation-guide-with-sidebar .params-bar-header:hover {
  background: var(--ai-guide-bg-secondary);
}

.simulation-guide-with-sidebar .params-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.simulation-guide-with-sidebar .params-label {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--ai-guide-text-primary);
}

.simulation-guide-with-sidebar .params-count {
  font-size: 11px;
  color: var(--ai-guide-text-muted);
  background: var(--ai-guide-bg-secondary);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.simulation-guide-with-sidebar .params-module {
  font-size: 11px;
  color: #3b82f6;
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

/* 状态标签 */
.simulation-guide-with-sidebar .params-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}

.simulation-guide-with-sidebar .params-status.status-empty {
  background: #fef2f2;
  color: #ef4444;
}

.simulation-guide-with-sidebar .params-status.status-partial {
  background: #fffbeb;
  color: #f59e0b;
}

.simulation-guide-with-sidebar .params-status.status-complete {
  background: #f0fdf4;
  color: #22c55e;
}

.simulation-guide-with-sidebar .params-status.awaiting {
  background: #eff6ff;
  color: #3b82f6;
}

.simulation-guide-with-sidebar .current-params-bar.awaiting-confirmation {
  border-left: 3px solid #3b82f6;
}

/* JSON格式参数展示条（可折叠） */
.simulation-guide-with-sidebar .params-json-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 16px;
  background: var(--ai-guide-bg-secondary);
  border-bottom: 1px solid var(--ai-guide-border);
  font-family: var(--font-mono);
  font-size: 12px;
  min-height: 40px;
  max-height: 200px;
  overflow: hidden;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.simulation-guide-with-sidebar .params-json-bar.collapsed {
  min-height: 40px;
  max-height: 40px;
  overflow: hidden;
}

.simulation-guide-with-sidebar .params-json-bar:not(.collapsed) {
  max-height: 140px;
}

.simulation-guide-with-sidebar .params-json-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.simulation-guide-with-sidebar .params-json-header:hover {
  opacity: 0.8;
}

.simulation-guide-with-sidebar .params-json-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.simulation-guide-with-sidebar .expand-icon {
  font-size: 10px;
  color: var(--ai-guide-text-muted);
  width: 12px;
}

.simulation-guide-with-sidebar .json-error {
  color: var(--color-danger);
  font-size: 11px;
}

.simulation-guide-with-sidebar .params-validation-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
}

.simulation-guide-with-sidebar .params-validation-status.valid {
  background: var(--color-success-alpha-10);
  color: var(--color-success);
}

.simulation-guide-with-sidebar .params-validation-status.incomplete {
  background: var(--color-warning-alpha-10);
  color: var(--color-warning);
}

.simulation-guide-with-sidebar .params-validation-status.error {
  background: var(--color-danger-alpha-10);
  color: var(--color-danger);
}

.simulation-guide-with-sidebar .params-json-content {
  color: var(--ai-guide-text-primary);
  white-space: pre;
  overflow-x: auto;
  margin: 0;
  background: transparent;
  max-height: 250px;
  overflow-y: auto;
}

.simulation-guide-with-sidebar .params-json-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
}

.simulation-guide-with-sidebar .params-missing-warning {
  color: var(--color-warning);
  font-size: 11px;
  font-family: var(--font-sans);
}

.simulation-guide-with-sidebar .params-json-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.simulation-guide-with-sidebar .params-json-actions .btn-toolbar {
  padding: 6px 12px;
  font-size: 12px;
}

/* 展开内容区 */
.simulation-guide-with-sidebar .params-bar-content {
  padding: 0 14px 14px;
}

.simulation-guide-with-sidebar .params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.simulation-guide-with-sidebar .param-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: var(--ai-guide-bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--ai-guide-border);
}

.simulation-guide-with-sidebar .param-key {
  font-size: 10px;
  color: var(--ai-guide-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.simulation-guide-with-sidebar .param-value {
  font-size: 12px;
  color: var(--ai-guide-text-primary);
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-weight: 600;
}

/* 缺失参数提示 */
.simulation-guide-with-sidebar .missing-params {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  font-size: 12px;
}

.simulation-guide-with-sidebar .missing-label {
  font-weight: 600;
  color: #dc2626;
}

.simulation-guide-with-sidebar .missing-items {
  color: #dc2626;
}

/* 空状态 */
.simulation-guide-with-sidebar .params-empty {
  padding: 20px;
  text-align: center;
  color: var(--ai-guide-text-muted);
  font-size: var(--font-sm);
}

/* 底部操作栏 */
.simulation-guide-with-sidebar .params-bar-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--ai-guide-border);
  background: var(--ai-guide-bg-secondary);
}

.simulation-guide-with-sidebar .btn-toolbar {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--ai-guide-bg-primary);
  border: 1px solid var(--ai-guide-border);
  color: var(--ai-guide-text-secondary);
}

.simulation-guide-with-sidebar .btn-toolbar:hover {
  border-color: var(--ai-guide-primary);
  color: var(--ai-guide-primary);
  background: var(--ai-guide-primary-light);
}

.simulation-guide-with-sidebar .btn-toolbar.btn-primary {
  background: linear-gradient(135deg, var(--ai-guide-primary) 0%, var(--ai-guide-primary-hover) 100%);
  color: white;
  border: none;
}

.simulation-guide-with-sidebar .btn-toolbar.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px var(--ai-guide-primary-light);
}

.simulation-guide-with-sidebar .btn-toolbar:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  background: var(--ai-guide-bg-secondary);
  color: var(--ai-guide-text-muted);
  border-color: var(--ai-guide-border);
}

.simulation-guide-with-sidebar .btn-toolbar:disabled:hover {
  border-color: var(--ai-guide-border);
  color: var(--ai-guide-text-muted);
  background: var(--ai-guide-bg-secondary);
  box-shadow: none;
  transform: none;
}

.simulation-guide-with-sidebar .btn-toolbar.btn-primary:disabled {
  background: linear-gradient(135deg, #94a3b8 0%, #94a3b8 100%);
  color: white;
  border: none;
}

/* ==================== 提交任务按钮（参数卡片） ==================== */
.simulation-guide-with-sidebar .btn-submit-task {
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--ai-guide-primary) 0%, var(--ai-guide-primary-hover) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px var(--ai-guide-primary-light);
}

.simulation-guide-with-sidebar .btn-submit-task:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--ai-guide-primary-light);
}

/* ==================== 快捷回复按钮（内联一体化样式） ==================== */
.simulation-guide-with-sidebar .quick-reply-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 0;
  background: transparent;
  border: none;
}

.simulation-guide-with-sidebar .quick-reply-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.simulation-guide-with-sidebar .quick-reply-btn.primary {
  background: linear-gradient(135deg, var(--ai-guide-primary) 0%, var(--ai-guide-primary-hover) 100%);
  color: white;
  border: none;
  box-shadow: 0 2px 8px var(--ai-guide-primary-light);
}

.simulation-guide-with-sidebar .quick-reply-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px var(--ai-guide-primary-light);
}

.simulation-guide-with-sidebar .quick-reply-btn.secondary {
  background: var(--ai-guide-bg-primary);
  color: var(--ai-guide-text-secondary);
  border: 1px solid var(--ai-guide-border);
}

.simulation-guide-with-sidebar .quick-reply-btn.secondary:hover {
  background: var(--ai-guide-bg-secondary);
  color: var(--ai-guide-primary);
  border-color: var(--ai-guide-primary);
  transform: translateY(-2px);
}

/* 系统操作按钮（修改参数等）- 橙色警告风格 */
.simulation-guide-with-sidebar .quick-reply-btn.warning,
.simulation-guide-with-sidebar .quick-reply-btn.system-action {
  background: linear-gradient(135deg, var(--color-warning) 0%, #e67e22 100%);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.simulation-guide-with-sidebar .quick-reply-btn.warning:hover,
.simulation-guide-with-sidebar .quick-reply-btn.system-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(243, 156, 18, 0.4);
}

/* ==================== 模块/参数确认面板 ==================== */
.simulation-guide-with-sidebar .module-confirm-panel,
.simulation-guide-with-sidebar .params-confirm-panel {
  margin-top: 12px;
  padding: 14px;
  background: var(--ai-guide-bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--ai-guide-border);
}

.simulation-guide-with-sidebar .confirm-content {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ai-guide-border);
}

.simulation-guide-with-sidebar .confirm-message {
  flex: 1;
}

.simulation-guide-with-sidebar .confirm-message p {
  margin: 0 0 4px 0;
  font-size: var(--font-sm);
  color: var(--ai-guide-text-primary);
  font-weight: 500;
}

.simulation-guide-with-sidebar .confirm-message .confirm-hint {
  font-size: 12px;
  color: var(--ai-guide-text-secondary);
}

.simulation-guide-with-sidebar .confirm-actions {
  display: flex;
  gap: 12px;
}

.simulation-guide-with-sidebar .btn-confirm {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.simulation-guide-with-sidebar .btn-confirm.primary {
  background: linear-gradient(135deg, var(--ai-guide-primary) 0%, var(--ai-guide-primary-hover) 100%);
  color: white;
  border: none;
  box-shadow: 0 2px 8px var(--ai-guide-primary-light);
}

.simulation-guide-with-sidebar .btn-confirm.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--ai-guide-primary-light);
}

.simulation-guide-with-sidebar .btn-confirm.secondary {
  background: transparent;
  color: var(--ai-guide-primary);
  border: 1.5px solid var(--ai-guide-primary);
}

.simulation-guide-with-sidebar .btn-confirm.secondary:hover {
  background: var(--ai-guide-primary-light);
  transform: translateY(-1px);
}

.simulation-guide-with-sidebar .btn-cancel:hover {
  background: var(--ai-guide-bg-secondary);
}

.simulation-guide-with-sidebar .params-display {
  background: var(--ai-guide-bg-primary);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.simulation-guide-with-sidebar .params-display pre {
  margin: 0;
  font-size: var(--font-xs);
  color: var(--ai-guide-text-primary);
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* ==================== 推荐参数展示 ==================== */
.simulation-guide-with-sidebar .recommended-params-section {
  margin-top: 12px;
  padding: 12px;
  background: var(--ai-guide-bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--ai-guide-border);
}

.simulation-guide-with-sidebar .recommended-params-display {
  background: var(--ai-guide-bg-primary);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  max-height: 180px;
  overflow-y: auto;
}

.simulation-guide-with-sidebar .recommended-params-display pre {
  margin: 0;
  font-size: var(--font-xs);
  color: var(--ai-guide-text-primary);
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.simulation-guide-with-sidebar .recommended-actions {
  display: flex;
  gap: 10px;
}

.simulation-guide-with-sidebar .btn-recommended {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.simulation-guide-with-sidebar .btn-recommended.primary {
  background: linear-gradient(135deg, var(--ai-guide-primary) 0%, var(--ai-guide-primary-hover) 100%);
  color: white;
  border: none;
  box-shadow: 0 2px 8px var(--ai-guide-primary-light);
}

.simulation-guide-with-sidebar .btn-recommended.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--ai-guide-primary-light);
}
/* ============================================
   _utilities.css - 工具类和杂项样式
   AI Simulation Guide 工具类、补间动画、响应式等
   ============================================ */

/* ==================== 滑动过渡 ==================== */
.simulation-guide-with-sidebar .slide-enter-active,
.simulation-guide-with-sidebar .slide-leave-active {
  transition: all 0.3s ease;
  overflow: hidden;
}

.simulation-guide-with-sidebar .slide-enter-from,
.simulation-guide-with-sidebar .slide-leave-to {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.simulation-guide-with-sidebar .slide-enter-to,
.simulation-guide-with-sidebar .slide-leave-from {
  max-height: 500px;
  opacity: 1;
}

/* ==================== 建议区域 ==================== */
.simulation-guide-with-sidebar .suggestion-section h4 {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--ai-guide-text-muted);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.simulation-guide-with-sidebar .suggestion-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.simulation-guide-with-sidebar .suggestion-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  background: var(--ai-guide-bg-primary);
  border: 1px solid var(--ai-guide-border);
  border-radius: var(--radius-lg);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--ai-guide-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.simulation-guide-with-sidebar .suggestion-chip:hover {
  background: var(--ai-guide-bg-secondary);
  border-color: var(--ai-guide-primary);
  color: var(--ai-guide-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ==================== 增强组件样式 ==================== */

/* Avatar 图标 */
.message-avatar .avatar-icon {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Action 按钮图标 */
.action-icon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: middle;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.action-btn--danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--ai-guide-danger);
}

/* 增强的 param-description */
.param-description {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--guide-text-muted);
  line-height: 1.4;
}

.desc-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.6;
}

/* 增强的 feedback 图标 */
.feedback-icon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: middle;
}

.error-message,
.warning-message,
.valid-message {
  display: inline-flex;
  align-items: center;
}

/* 增强的 step-header-inline */
.step-header-inline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.step-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-progress-inline {
  font-size: 13px;
  color: var(--guide-text-secondary);
  font-weight: 500;
}

.step-hint-inline {
  font-size: 13px;
  color: var(--guide-text-secondary);
}

.step-hint-inline .modified-count {
  color: var(--guide-primary);
  font-weight: 500;
}

/* 增强的 progress bar */
.params-progress-bar.enhanced {
  display: block;
  margin-bottom: 12px;
}

.progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--guide-text-primary);
}

.progress-track {
  height: 8px;
  background: var(--guide-border-default);
  border-radius: 4px;
  overflow: hidden;
}

.params-progress-bar.enhanced .progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.params-progress-bar.enhanced .progress-fill.complete {
  background: var(--ai-guide-success);
}

/* 增强的 missing-params-banner */
.missing-params-banner {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--guide-radius-lg);
  margin-bottom: 24px;
}

.missing-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.missing-icon {
  width: 20px;
  height: 20px;
  background: var(--ai-guide-danger);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.missing-icon svg {
  width: 12px;
  height: 12px;
  stroke: white;
  stroke-width: 2.5;
}

.missing-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--ai-guide-text-primary);
}

.missing-chips {
  display: flex;
  margin-left: 0;
  gap: 8px;
}

/* 增强的 param-wrapper */
.param-wrapper {
  transition: all 0.2s ease;
  border-radius: var(--guide-radius-lg);
  padding: 4px;
}

.param-wrapper.has-value {
  background: rgba(59, 130, 246, 0.03);
}

/* 增强的 optional params toolbar */
.optional-params-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--guide-border-subtle);
}

.toolbar-left {
  flex: 1;
}

.toolbar-info {
  font-size: 13px;
  color: var(--guide-text-secondary);
}

.toolbar-right {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.toolbar-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--guide-bg-subtle);
  border: 1px solid var(--guide-border);
  border-radius: var(--guide-radius-sm);
  font-size: 13px;
  color: var(--guide-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  writing-mode: horizontal-tb;
}

.toolbar-btn:hover {
  border-color: var(--guide-primary);
  color: var(--guide-primary);
  background: var(--guide-primary-subtle);
}

.toolbar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* 增强的 optional param item */
.optional-param-item {
  border-radius: var(--guide-radius-lg);
  overflow: hidden;
  transition: all 0.2s ease;
}

.optional-param-item.has-value {
  background: var(--guide-bg-base);
  border-color: var(--guide-primary-muted);
}

.param-summary {
  display: flex;
  align-items: center;
  padding: 14px 16px;
}

.param-summary .param-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.param-unit-tag {
  font-size: 11px;
  padding: 2px 6px;
  background: var(--guide-bg-subtle);
  color: var(--guide-text-muted);
  border-radius: var(--guide-radius-sm);
  font-weight: 500;
}

.param-value-preview {
  margin-right: 8px;
}

.param-value-preview .value-unit {
  color: var(--guide-text-muted);
}

.expand-icon svg {
  width: 16px;
  height: 16px;
}

.param-expanded-content {
  padding: 0 16px 16px;
  border-top: 1px solid var(--guide-border-subtle);
}

.btn-use-default-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 12px;
  background: var(--guide-bg-subtle);
  border: 1px dashed var(--guide-border-default);
  border-radius: var(--guide-radius-md);
  font-size: 12px;
  color: var(--guide-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-use-default-inline:hover {
  background: var(--guide-primary-subtle);
  border-color: var(--guide-primary);
  border-style: solid;
  color: var(--guide-primary);
}

.btn-icon-small {
  width: 14px;
  height: 14px;
}

/* 增强的 step-actions */
.step-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--guide-border-subtle);
}

.step-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--guide-radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.step-actions .btn.btn-secondary {
  background: var(--guide-bg-subtle);
  color: var(--guide-text-secondary);
}

.step-actions .btn.btn-secondary:hover {
  background: var(--guide-border);
  color: var(--guide-text-primary);
}

.step-actions .btn.btn-default {
  background: transparent;
  border: 1px solid var(--guide-border);
  color: var(--guide-text-secondary);
}

.step-actions .btn.btn-default:hover {
  border-color: var(--guide-primary);
  color: var(--guide-primary);
  background: var(--guide-primary-subtle);
}

.step-actions .btn.btn-primary {
  background: var(--guide-primary);
  color: white;
}

.step-actions .btn.btn-primary:hover:not(:disabled) {
  background: var(--guide-primary-hover);
}

.step-actions .btn.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon {
  width: 16px;
  height: 16px;
}

/* 增强的 Enum 选项卡片 */
.param-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin: 12px 0 0 0;
}

.param-options-grid.single-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--guide-bg-base);
  border: 1px solid var(--guide-border-default);
  border-radius: var(--guide-radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-width: 80px;
}

.option-card:hover:not(:disabled) {
  border-color: var(--guide-primary);
  background: var(--guide-primary-subtle);
  transform: translateY(-1px);
}

.option-card.selected {
  background: var(--guide-primary);
  border-color: var(--guide-primary);
  box-shadow: 0 2px 8px var(--guide-primary-muted);
}

.option-card.selected:hover {
  background: var(--guide-primary-hover);
}

.option-check {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-check svg {
  width: 14px;
  height: 14px;
  stroke: white;
  stroke-width: 3;
}

.option-card .option-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--guide-text-secondary);
  transition: color 0.2s ease;
}

.option-card.selected .option-label {
  color: white;
}

.recommended-tag {
  position: absolute;
  top: -6px;
  right: -6px;
  padding: 2px 6px;
  background: var(--ai-guide-success);
  color: white;
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--guide-radius-full);
}

.option-card.selected .recommended-tag {
  background: white;
  color: var(--guide-primary);
}

/* 增强的 Boolean 切换卡片 */
.boolean-toggle-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0 0 0;
}

.toggle-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--guide-bg-base);
  border: 1px solid var(--guide-border-default);
  border-radius: var(--guide-radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-card:hover:not(.disabled) {
  border-color: var(--guide-primary);
  background: var(--guide-primary-subtle);
}

.toggle-card--true.selected {
  background: rgba(34, 197, 94, 0.1);
  border-color: var(--ai-guide-success);
}

.toggle-card--true.selected .toggle-icon {
  color: var(--ai-guide-success);
}

.toggle-card--false.selected {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--ai-guide-danger);
}

.toggle-card--false.selected .toggle-icon {
  color: var(--ai-guide-danger);
}

.toggle-icon {
  width: 18px;
  height: 18px;
}

.toggle-icon--empty {
  opacity: 0.3;
}

.toggle-card .toggle-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--guide-text-secondary);
}

.toggle-card.selected .toggle-text {
  color: var(--guide-text-primary);
}

/* 增强的 param-range-info */
.param-range-info {
  margin-bottom: 12px;
}

.range-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--guide-bg-subtle);
  border-radius: var(--guide-radius-md);
  font-size: 12px;
}

.range-label {
  color: var(--guide-text-muted);
  font-weight: 500;
}

.range-value {
  color: var(--guide-primary);
  font-weight: 600;
}

.range-unit {
  color: var(--guide-text-muted);
}

/* 增强的 quick-value-buttons */
.quick-value-buttons {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
  align-items: center;
  opacity: 1;
}

.quick-btn {
  padding: 6px 12px;
  background: var(--guide-bg-base);
  border: 1px solid var(--guide-border-default);
  border-radius: var(--guide-radius-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--guide-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-btn:hover {
  border-color: var(--guide-primary);
  color: var(--guide-primary);
  background: var(--guide-primary-subtle);
}

.quick-btn.active {
  background: var(--guide-primary);
  border-color: var(--guide-primary);
  color: white;
}

.quick-unit {
  font-size: 10px;
  opacity: 0.7;
}

/* 增强的 ChatInput */
.simulation-guide-with-sidebar .chat-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--guide-bg-base);
  border: 1px solid var(--guide-border-default);
  border-radius: var(--guide-radius-lg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: visible;
  min-height: 36px;
}

.simulation-guide-with-sidebar .chat-input-wrapper.focused {
  border-color: var(--guide-primary);
  box-shadow: 0 0 0 3px var(--guide-primary-subtle);
}

.simulation-guide-with-sidebar .chat-input-wrapper textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  font-size: 14px;
  line-height: 1.4;
  color: var(--guide-text-primary);
  outline: none;
  padding: 0;
  box-sizing: border-box;
}

.simulation-guide-with-sidebar .chat-input-wrapper textarea::placeholder {
  color: var(--guide-text-muted);
}

.simulation-guide-with-sidebar .btn-send-message {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--guide-bg-subtle);
  border: 1px solid var(--guide-border-default);
  border-radius: var(--guide-radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.simulation-guide-with-sidebar .btn-send-message.ready {
  background: var(--guide-primary);
  border-color: var(--guide-primary);
}

.simulation-guide-with-sidebar .btn-send-message.ready:hover {
  background: var(--guide-primary-hover);
  transform: scale(1.05);
}

.simulation-guide-with-sidebar .send-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.simulation-guide-with-sidebar .send-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--guide-text-muted);
  transition: stroke 0.2s ease;
}

.simulation-guide-with-sidebar .btn-send-message.ready .send-icon svg {
  stroke: white;
}

.chat-input-char-count {
  font-size: 11px;
  color: var(--guide-text-muted);
  padding-bottom: 4px;
}

.chat-input-char-count.warning {
  color: var(--ai-guide-warning);
}

.chat-input-hint {
  font-size: 11px;
  color: var(--guide-text-muted);
}

.chat-input-hint kbd {
  font-size: inherit;
}

/* 增强的 quick-reply-buttons */
.simulation-guide-with-sidebar .quick-reply-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.simulation-guide-with-sidebar .quick-reply-btn {
  padding: 8px 16px;
  border-radius: var(--guide-radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.simulation-guide-with-sidebar .quick-reply-btn.primary {
  background: var(--guide-primary);
  color: white;
  border: none;
  box-shadow: 0 2px 8px var(--guide-primary-muted);
}

.simulation-guide-with-sidebar .quick-reply-btn.primary:hover {
  background: var(--guide-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--guide-primary-muted);
}

.simulation-guide-with-sidebar .quick-reply-btn.secondary {
  background: var(--guide-bg-base);
  color: var(--guide-text-secondary);
  border: 1px solid var(--guide-border-default);
}

.simulation-guide-with-sidebar .quick-reply-btn.secondary:hover {
  border-color: var(--guide-primary);
  color: var(--guide-primary);
  background: var(--guide-primary-subtle);
}

.simulation-guide-with-sidebar .quick-reply-btn.warning,
.simulation-guide-with-sidebar .quick-reply-btn.system-action {
  background: linear-gradient(135deg, var(--color-warning) 0%, #e67e22 100%);
  color: white;
  border: none;
}

.simulation-guide-with-sidebar .quick-reply-btn.warning:hover,
.simulation-guide-with-sidebar .quick-reply-btn.system-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

/* 增强的 required/optional badge */
.required-badge,
.optional-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--guide-radius-full);
  display: inline-block;
}

.required-badge {
  background: rgba(239, 68, 68, 0.1);
  color: var(--ai-guide-danger);
}

.optional-badge {
  background: var(--guide-bg-subtle);
  color: var(--guide-text-muted);
}

/* ===== renderer/css/components/button.css ===== */
/* ============================================
   Button 组件 - Button Component
   ============================================ */

/* ========== 基础按钮样式 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  height: var(--height-btn);
  padding: 0 var(--spacing-4);
  font-size: var(--font-base);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  text-decoration: none;
  font-family: inherit;
}

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

.btn:not(:disabled):active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ========== 主按钮 - Primary ========== */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:not(:disabled):hover {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-dark));
  box-shadow: var(--shadow-md);
}

/* ========== 次要按钮 - Secondary ========== */
.btn-secondary {
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:not(:disabled):hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ========== 危险按钮 - Danger ========== */
.btn-danger {
  background: linear-gradient(135deg, var(--color-danger), var(--color-danger-dark));
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-danger:not(:disabled):hover {
  background: linear-gradient(135deg, var(--color-danger-dark), var(--color-danger-dark));
  box-shadow: var(--shadow-md);
}

/* ========== 成功按钮 - Success ========== */
.btn-success {
  background: linear-gradient(135deg, var(--color-success), var(--color-success-dark));
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-success:not(:disabled):hover {
  background: linear-gradient(135deg, var(--color-success-dark), var(--color-success-dark));
  box-shadow: var(--shadow-md);
}

/* ========== 警告按钮 - Warning ========== */
.btn-warning {
  background: linear-gradient(135deg, var(--color-warning), var(--color-warning-dark));
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-warning:not(:disabled):hover {
  background: linear-gradient(135deg, var(--color-warning-dark), var(--color-warning-dark));
  box-shadow: var(--shadow-md);
}

/* ========== 幽灵按钮 - Ghost ========== */
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn-ghost:not(:disabled):hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

/* ========== 图标按钮 - Icon Button ========== */
.btn-icon {
  width: var(--height-btn);
  padding: 0;
}

.btn-icon-sm {
  width: var(--height-btn-sm);
  height: var(--height-btn-sm);
  padding: 0;
}

/* ========== 尺寸变体 - Sizes ========== */
.btn-sm {
  height: var(--height-btn-sm);
  padding: 0 var(--spacing-3);
  font-size: var(--font-sm);
}

.btn-lg {
  height: var(--height-btn-lg);
  padding: 0 var(--spacing-6);
  font-size: var(--font-lg);
}

/* ========== 块级按钮 - Block ========== */
.btn-block {
  width: 100%;
}

/* ========== 按钮组 - Button Group ========== */
.btn-group {
  display: inline-flex;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.btn-group .btn:not(:last-child) {
  border-right: 1px solid var(--color-border-light);
}

/* ========== 文字按钮 - Text Button ========== */
.btn-text {
  background: transparent;
  color: var(--color-primary);
  padding: 0 var(--spacing-2);
  height: auto;
}

.btn-text:not(:disabled):hover {
  color: var(--color-primary-dark);
  background: var(--color-primary-alpha-10);
}

/* ========== 加载状态 - Loading ========== */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  color: white;
}

.btn-secondary.btn-loading::after {
  color: var(--color-primary);
}


/* ===== renderer/css/components/input.css ===== */
/* ============================================
   Input 组件 - Input Component
   ============================================ */

/* ========== 基础输入框样式 ========== */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  height: var(--height-input);
  padding: 0 var(--spacing-3);
  font-size: var(--font-base);
  line-height: var(--height-input);
  color: var(--color-text-primary);
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
  font-family: inherit;
}

/* ========== 文本域 ========== */
textarea {
  height: auto;
  min-height: 80px;
  padding: var(--spacing-3);
  line-height: var(--line-height-normal);
  resize: vertical;
}

/* ========== 聚焦状态 ========== */
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha-10);
}

/* ========== 禁用状态 ========== */
input[type="text"]:disabled,
input[type="password"]:disabled,
input[type="email"]:disabled,
input[type="number"]:disabled,
input[type="search"]:disabled,
input[type="tel"]:disabled,
input[type="url"]:disabled,
input[type="date"]:disabled,
input[type="time"]:disabled,
input[type="datetime-local"]:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== 只读状态 ========== */
input[type="text"]:read-only,
input[type="password"]:read-only,
input[type="email"]:read-only,
input[type="number"]:read-only,
input[type="search"]:read-only,
input[type="tel"]:read-only,
input[type="url"]:read-only,
textarea:read-only {
  background: var(--color-bg-secondary);
  cursor: default;
}

/* ========== 错误状态 ========== */
.input-error input,
.input-error textarea,
.input-error select {
  border-color: var(--color-danger);
}

.input-error input:focus,
.input-error textarea:focus,
.input-error select:focus {
  box-shadow: 0 0 0 3px var(--color-danger-alpha-10);
}

.error-message {
  display: block;
  margin-top: var(--spacing-1);
  font-size: var(--font-xs);
  color: var(--color-danger);
}

/* ========== 成功状态 ========== */
.input-success input,
.input-success textarea,
.input-success select {
  border-color: var(--color-success);
}

.input-success input:focus,
.input-success textarea:focus,
.input-success select:focus {
  box-shadow: 0 0 0 3px var(--color-success-alpha-10);
}

.success-message {
  display: block;
  margin-top: var(--spacing-1);
  font-size: var(--font-xs);
  color: var(--color-success);
}

/* ========== 输入框组 ========== */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group input {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  flex: 1;
}

.input-group .btn {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  height: var(--height-input);
}

.input-group .input-group-addon {
  display: flex;
  align-items: center;
  padding: 0 var(--spacing-3);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-left: none;
  color: var(--color-text-muted);
  font-size: var(--font-sm);
}

.input-group .input-group-addon:first-child {
  border-left: 1px solid var(--color-border);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .input-group-addon:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ========== 搜索输入框 ========== */
.input-search {
  position: relative;
}

.input-search::before {
  content: '';
  position: absolute;
  left: var(--spacing-3);
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
  background-size: contain;
  opacity: 0.5;
  pointer-events: none;
}

.input-search input {
  padding-left: 36px;
}

/* ========== 带图标输入框 ========== */
.input-with-icon {
  position: relative;
}

.input-icon {
  position: absolute;
  left: var(--spacing-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-icon-right {
  left: auto;
  right: var(--spacing-3);
}

.input-with-icon input {
  padding-left: 36px;
}

.input-with-icon input.with-icon-right {
  padding-right: 36px;
}

/* ========== 标签 ========== */
.form-label {
  display: block;
  margin-bottom: var(--spacing-2);
  font-size: var(--font-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
}

.form-label.required::after {
  content: '*';
  color: var(--color-danger);
  margin-left: 2px;
}

/* ========== 提示文字 ========== */
.form-hint {
  display: block;
  margin-top: var(--spacing-1);
  font-size: var(--font-xs);
  color: var(--color-text-muted);
}

/* ========== 尺寸变体 ========== */
.input-sm {
  height: 30px;
  padding: 0 var(--spacing-2);
  font-size: var(--font-sm);
}

.input-lg {
  height: 42px;
  padding: 0 var(--spacing-4);
  font-size: var(--font-lg);
}

/* ========== 复选框和单选框 ========== */
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  outline: none;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  transition: all var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
  background: var(--color-bg-input);
  position: relative;
  flex-shrink: 0;
}

input[type="radio"] {
  border-radius: 50%;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="checkbox"]:hover,
input[type="radio"]:hover {
  border-color: var(--color-primary);
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha-15);
}

.checkbox-label,
.radio-label {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-3);
  cursor: pointer;
  font-size: var(--font-base);
  color: var(--color-text-primary);
  padding: 4px 0;
}

.checkbox-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.checkbox-group-inline,
.radio-group-inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--spacing-4);
}

/* ========== 开关按钮 ========== */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-border);
  transition: all var(--transition-fast);
  border-radius: 24px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: all var(--transition-fast);
  border-radius: 50%;
  box-shadow: var(--shadow-xs);
}

.switch input:checked + .switch-slider {
  background-color: var(--color-primary);
}

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

/* ========== 文件输入框 ========== */
.file-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.file-input-label {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  padding: 0 var(--spacing-4);
  height: var(--height-input);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-base);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.file-input-label:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.file-name {
  font-size: var(--font-sm);
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

/* ========== 选择框 ========== */
select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--spacing-3) center;
  background-size: 18px;
  padding-right: 40px;
  min-height: 40px;
}

select option {
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  padding: 10px 12px;
  font-size: 14px;
}

select option:checked {
  background: var(--color-primary);
  color: white;
}

select option:hover {
  background: var(--color-primary-alpha-10);
}

/* ========== 多行输入框自动大小 ========== */
textarea.auto-resize {
  overflow: hidden;
  resize: none;
}


/* ===== renderer/css/components/table.css ===== */
/* ============================================
   Table 组件 - Table Component
   ============================================ */

/* ========== 表格容器 ========== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
}

/* ========== 基础表格样式 ========== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-base);
}

/* ========== 表头 ========== */
thead {
  background: var(--color-bg-table-header);
  position: sticky;
  top: 0;
  z-index: 10;
}

th {
  padding: var(--spacing-3) var(--spacing-4);
  text-align: left;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

th.sortable {
  cursor: pointer;
  transition: color var(--transition-fast);
}

th.sortable:hover {
  color: var(--color-primary);
}

th.sortable .sort-icon {
  display: inline-block;
  margin-left: var(--spacing-1);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

th.sortable:hover .sort-icon,
th.sortable.active .sort-icon {
  opacity: 1;
}

th .resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  cursor: col-resize;
  pointer-events: none;
  transition: background-color var(--transition-fast);
}

th:hover .resize-handle {
  pointer-events: auto;
}

th .resize-handle:hover {
  background-color: var(--color-primary);
}

/* ========== 表格单元格 ========== */
td {
  padding: var(--spacing-3) var(--spacing-4);
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

/* ========== 表格行 ========== */
tbody tr {
  transition: background-color var(--transition-fast);
}

tbody tr:hover {
  background-color: var(--color-bg-table-hover);
}

tbody tr:nth-child(even) {
  background-color: var(--color-bg-table-row-alt);
}

tbody tr:nth-child(even):hover {
  background-color: var(--color-bg-table-hover);
}

/* ========== 可选中行 ========== */
tbody tr.selectable {
  cursor: pointer;
}

tbody tr.selected {
  background-color: var(--color-primary-alpha-10);
}

tbody tr.selected:hover {
  background-color: var(--color-primary-alpha-20);
}

/* ========== 空状态 ========== */
.table-empty {
  padding: var(--spacing-12) var(--spacing-4);
  text-align: center;
  color: var(--color-text-muted);
}

.table-empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--spacing-4);
  opacity: 0.3;
}

/* ========== 加载状态 ========== */
.table-loading {
  padding: var(--spacing-8) var(--spacing-4);
  text-align: center;
}

.table-loading .spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========== 分页 ========== */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-4);
  border-top: 1px solid var(--color-border-light);
  background: var(--color-bg-secondary);
}

.pagination-info {
  font-size: var(--font-sm);
  color: var(--color-text-muted);
}

.pagination-controls {
  display: flex;
  gap: var(--spacing-2);
}

.pagination-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 var(--spacing-2);
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-alpha-10);
}

.pagination-btn.active {
  color: white;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-color: var(--color-primary);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== 紧凑模式 ========== */
.table-compact th,
.table-compact td {
  padding: var(--spacing-2) var(--spacing-3);
}

/* ========== 边框模式 ========== */
.table-bordered th,
.table-bordered td {
  border: 1px solid var(--color-border-light);
}

/* ========== 无边框模式 ========== */
.table-borderless th,
.table-borderless td {
  border-bottom: none;
}

/* ========== 斑马纹行 ========== */
.table-zebra tbody tr:nth-child(even) {
  background-color: var(--color-bg-table-row-alt);
}

/* ========== 单元格对齐 ========== */
.td-center {
  text-align: center;
}

.td-right {
  text-align: right;
}

.td-left {
  text-align: left;
}


/* ===== renderer/css/components/modal.css ===== */
/* ============================================
   Modal 组件 - Modal Component
   ============================================ */

/* ========== 遮罩层 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-4);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn var(--transition-normal);
}

/* ========== 模态框容器 ========== */
.modal {
  max-width: 90vw;
  max-height: 90vh;
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: scaleIn var(--transition-normal);
  border: 1px solid var(--color-border-light);
}

/* ========== 尺寸变体 ========== */
.modal-sm { width: 400px; }
.modal-md { width: 520px; }
.modal-lg { width: 720px; }
.modal-xl { width: 900px; }
.modal-full {
  width: 95vw;
  height: 90vh;
}

/* ========== 模态框头部 ========== */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-4) var(--spacing-5);
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-bg-card-solid);
}

.modal-title {
  font-size: var(--font-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

/* ========== 模态框内容 ========== */
.modal-body {
  padding: var(--spacing-5);
  overflow-y: auto;
  max-height: calc(90vh - 120px);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

/* ========== 模态框底部 ========== */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-3);
  padding: var(--spacing-4) var(--spacing-5);
  border-top: 1px solid var(--color-border-light);
  background: var(--color-bg-secondary);
}

/* ========== 确认对话框 ========== */
.confirm-modal .modal-body {
  text-align: center;
  padding: var(--spacing-8) var(--spacing-6);
}

.confirm-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--spacing-4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.confirm-icon.warning {
  background: var(--color-warning-alpha-10);
  color: var(--color-warning);
}

.confirm-icon.danger {
  background: var(--color-danger-alpha-10);
  color: var(--color-danger);
}

.confirm-icon.success {
  background: var(--color-success-alpha-10);
  color: var(--color-success);
}

.confirm-icon.info {
  background: var(--color-primary-alpha-10);
  color: var(--color-primary);
}

.confirm-message {
  font-size: var(--font-lg);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-2);
  font-weight: var(--font-weight-medium);
}

.confirm-description {
  font-size: var(--font-sm);
  color: var(--color-text-muted);
}


/* ========== 拖拽模态框 ========== */
.modal-draggable .modal-header {
  cursor: move;
  user-select: none;
  -webkit-user-select: none;
}

.modal-draggable .modal-header:active {
  cursor: grabbing;
}

/* ========== 可滚动头部 ========== */
.modal-header-scrollable {
  overflow-x: auto;
}

/* ========== 底部居左 */
.modal-footer-left {
  justify-content: flex-start;
}

/* ========== 底部居中 */
.modal-footer-center {
  justify-content: center;
}

/* ========== dialogs.js 使用的模态框样式 ========== */
.modal-dialog {
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: scaleIn var(--transition-normal);
  border: 1px solid var(--color-border-light);
  display: flex;
  flex-direction: column;
}

/* 模态框按钮 */
.modal-btn {
  padding: 8px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  font-size: var(--font-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-btn:hover {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border-hover);
}

.modal-btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.modal-btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.modal-btn-danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: white;
}

.modal-btn-danger:hover {
  background: var(--color-danger-dark);
  border-color: var(--color-danger-dark);
}

/* ========== 关闭按钮 ========== */
.modal-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.modal-close-btn:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
}

/* ========== 三按钮对话框 ========== */
.modal-footer-three {
  justify-content: center;
  gap: var(--spacing-4);
  flex-wrap: nowrap;
}

.modal-dialog .modal-body.tight p {
  margin: 0;
  line-height: 1.4;
}

.modal-btn-three {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideUp var(--transition-normal) backwards;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  white-space: nowrap;
}

.modal-btn-three:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.modal-btn-three:active {
  transform: translateY(0);
}

.modal-btn-three.primary {
  background: linear-gradient(135deg, #0066cc 0%, #0055aa 100%);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
}

.modal-btn-three.primary:hover {
  box-shadow: 0 6px 16px rgba(0, 102, 204, 0.35);
}

.modal-btn-three.tertiary {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.modal-btn-three.tertiary:hover {
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35);
}

.modal-btn-three.secondary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* ========== 侧边栏 ========== */


/* ===== renderer/css/components/card.css ===== */
/* ============================================
   Card 组件 - Card Component
   ============================================ */

/* ========== 基础卡片 ========== */
.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-4) var(--spacing-5);
  border-bottom: 1px solid var(--color-border-light);
}

.card-title {
  font-size: var(--font-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0;
}

.card-subtitle {
  font-size: var(--font-sm);
  color: var(--color-text-muted);
  margin-top: var(--spacing-1);
}

.card-actions {
  display: flex;
  gap: var(--spacing-2);
}

.card-body {
  padding: var(--spacing-5);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

.card-footer {
  display: flex;
  align-items: center;
  padding: var(--spacing-4) var(--spacing-5);
  border-top: 1px solid var(--color-border-light);
  background: var(--color-bg-secondary);
}

.card-clickable {
  cursor: pointer;
}

.card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-alpha-20);
}

.card-clickable:active {
  transform: translateY(-1px);
}

/* ========== 任务卡片 ========== */
.task-card {
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 状态顶部指示条 */
.task-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--color-neutral);
}

.task-card.status-pending::before { background: var(--color-warning); }
.task-card.status-running::before { background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark)); }
.task-card.status-completed::before { background: linear-gradient(90deg, var(--color-success), var(--color-success-dark)); }
.task-card.status-failed::before { background: linear-gradient(90deg, var(--color-danger), var(--color-danger-dark)); }
.task-card.status-unknown::before { background: linear-gradient(90deg, #8b5cf6, #6366f1); }
.task-card.status-iterating::before { background: linear-gradient(90deg, #f59e0b, #d97706); }

/* 状态背景色调 */
.task-card.status-pending { border-color: rgba(245, 158, 11, 0.18); }
.task-card.status-running { border-color: rgba(14, 165, 233, 0.2); }
.task-card.status-completed { border-color: rgba(16, 185, 129, 0.18); }
.task-card.status-failed { border-color: rgba(239, 68, 68, 0.18); }
.task-card.status-unknown { border-color: rgba(139, 92, 246, 0.18); }
.task-card.status-iterating { border-color: rgba(245, 158, 11, 0.18); }

.task-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-border);
}

.task-card.status-pending:hover {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.12);
}

.task-card.status-running:hover {
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: 0 8px 25px rgba(14, 165, 233, 0.15);
}

.task-card.status-completed:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.12);
}

.task-card.status-failed:hover {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.12);
}

.task-card.status-unknown:hover {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.12);
}

.task-card.status-iterating:hover {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.12);
}

.task-card.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha-10);
}

/* 任务卡片复选框 */
.task-checkbox-wrapper {
  position: absolute;
  top: 20px;
  left: 14px;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.task-checkbox-wrapper.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.task-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

/* 任务卡片头部 */
.task-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: var(--spacing-4) var(--spacing-5);
  background: linear-gradient(to right, var(--color-bg-card-solid), transparent);
  border-bottom: 1px solid var(--color-border-light);
  position: relative;
  min-height: 28px;
}

.task-card-header {
  padding-left: var(--spacing-5);
}

.task-card.selected .task-card-header,
.task-card.batch-mode .task-card-header {
  padding-left: 38px;
}

/* 任务名称 */
.task-name {
  flex: 1;
  font-size: var(--font-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  word-break: break-word;
  line-height: 1.3;
  min-width: 0;
}

/* 状态徽章 */
.task-status-badge {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-xs);
}

.task-status-badge.status-pulse {
  animation: status-pulse 1.5s ease-in-out infinite;
}

.task-status-badge.status-pending { background: rgba(230, 126, 34, 0.15); color: #e67e22; }
.task-status-badge.status-running { background: rgba(52, 152, 219, 0.15); color: #3498db; }
.task-status-badge.status-completed { background: rgba(39, 174, 96, 0.15); color: #27ae60; }
.task-status-badge.status-failed { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }
.task-status-badge.status-cancelled { background: rgba(127, 140, 141, 0.15); color: #7f8c8d; }
.task-status-badge.status-unknown { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.task-status-badge.status-iterating { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.task-status-badge.status-verifying { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }

/* 任务卡片主体 */
.task-card-body {
  padding: var(--spacing-4) var(--spacing-5);
}

/* 信息行 */
.task-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-2) 0;
  border-bottom: 1px dotted var(--color-border-light);
  gap: var(--spacing-3);
}

.task-info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--color-text-muted);
  font-size: var(--font-sm);
  font-weight: var(--font-weight-medium);
  flex: 0 0 auto;
  min-width: 55px;
  padding-right: 8px;
  box-sizing: border-box;
}

.info-value {
  color: var(--color-text-primary);
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
  text-align: right;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-value.center {
  text-align: center;
}

/* 任务卡片操作区 */
.task-card-footer {
  padding: var(--spacing-4) var(--spacing-5);
  border-top: 1px solid var(--color-border-light);
}

.task-actions {
  display: flex;
  gap: var(--spacing-2);
}

.task-actions .btn-sm {
  flex: 1;
  padding: var(--spacing-2) var(--spacing-3);
  font-size: var(--font-sm);
  height: auto;
}

/* ========== 状态徽章（通用） ========== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: var(--font-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-full);
  line-height: 1;
}

.status-badge.pending { background: var(--color-neutral-alpha-10); color: var(--color-neutral); }
.status-badge.running { background: var(--color-primary-alpha-10); color: var(--color-primary); }
.status-badge.completed { background: var(--color-success-alpha-10); color: var(--color-success); }
.status-badge.failed { background: var(--color-danger-alpha-10); color: var(--color-danger); }
.status-badge.iterating { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.status-badge.cancelled { background: var(--color-warning-alpha-10); color: var(--color-warning); }

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.running .status-dot,
.status-badge.iterating .status-dot {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ========== 进度条 ========== */
.task-card-progress {
  margin-bottom: var(--spacing-4);
}

.progress-bar {
  height: 6px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
  border-radius: var(--radius-full);
  transition: width var(--transition-normal);
}

.progress-text {
  display: flex;
  justify-content: space-between;
  margin-top: var(--spacing-1);
  font-size: var(--font-xs);
  color: var(--color-text-muted);
}


/* ===== renderer/css/pages/tasks.css ===== */
/* ============================================
   Tasks Page - 任务页面样式 - 全面优化版
   ============================================ */

/* ========== 最优先：确保滚动正常 ========== */
.main-content:has(.tasks-container) {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: calc(100vh - 49px) !important;
  display: block !important;
  flex-direction: initial !important;
}

.main-content:has(.tasks-container) > * {
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
}

.main-content:has(.task-detail-container) {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: calc(100vh - 49px) !important;
  display: block !important;
}

.main-content:has(.task-detail-container) > * {
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
}

/* ============================================
   响应式左右 padding 系统
   设计原则：桌面端宽松，平板端适中，手机端紧凑
   ============================================ */

/* ========== 默认（桌面 1200px+）========== */
.tasks-container {
  padding: 16px 12px 16px;
}

/* ========== 1400px+ 超大屏幕 ========== */
@media (min-width: 1400px) {
  .tasks-container {
    padding: 20px 15px 20px;
  }
}

/* ========== 1200px 中等桌面 ========== */
@media (max-width: 1200px) {
  .tasks-container {
    padding: 14px 12px 14px;
  }
}

/* ========== 1024px 平板横屏 ========== */
@media (max-width: 1024px) {
  .tasks-container {
    padding: 12px 12px 12px;
  }
}

/* ========== 768px 平板 ========== */
@media (max-width: 768px) {
  .tasks-container {
    padding: 10px 12px 10px;
  }
}

/* ========== 576px 大屏手机 ========== */
@media (max-width: 576px) {
  .tasks-container {
    padding: 8px 10px 8px;
  }
}

/* ========== 480px 中等手机 ========== */
@media (max-width: 480px) {
  .tasks-container {
    padding: 6px 8px 6px;
  }
}

/* ========== 360px 小手机 ========== */
@media (max-width: 360px) {
  .tasks-container {
    padding: 4px 6px 4px;
  }
}

/* ========== 页面标题 ========== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-6);
}

.page-title {
  font-size: var(--font-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0;
}

.page-actions {
  display: flex;
  gap: var(--spacing-3);
}

/* ========== 模块筛选卡片 ========== */
.module-filter-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  padding: var(--spacing-4);
  margin-bottom: var(--spacing-6);
  box-shadow: var(--shadow-sm);
}

.module-filter-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  margin-bottom: var(--spacing-4);
  padding-bottom: var(--spacing-4);
  border-bottom: 1px solid var(--color-border-light);
}

.module-filter-icon {
  font-size: var(--font-xl);
  color: var(--color-primary);
}

.module-filter-title {
  font-size: var(--font-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0;
}

.module-category {
  margin-bottom: var(--spacing-4);
}

.module-category:last-child {
  margin-bottom: 0;
}

.module-category-label {
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-3);
}

.module-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-2);
}

.module-filter-item {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-2) var(--spacing-4);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--font-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
}

.module-filter-item:hover {
  border-color: var(--color-primary-alpha-20);
  background: var(--color-primary-alpha-10);
  color: var(--color-primary);
}

.module-filter-item.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}

.module-filter-name {
  white-space: nowrap;
}

/* ========== 创建任务卡片 ========== */
.create-task-card {
  background: linear-gradient(135deg, var(--color-bg-card) 0%, var(--color-primary-alpha-10) 100%);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-primary-alpha-20);
  padding: var(--spacing-6);
  margin-bottom: var(--spacing-6);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.create-task-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
}

.create-task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-5);
  padding-bottom: var(--spacing-4);
  border-bottom: 1px solid var(--color-border-light);
}

.create-task-header h3 {
  font-size: var(--font-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
}

.create-task-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-radius: var(--radius-md);
  color: white;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

/* ========== 设置区域切换按钮 ========== */
.settings-toggle-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  width: 100%;
  padding: var(--spacing-3) 0;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: var(--font-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  transition: color var(--transition-fast);
}

.settings-toggle-btn:hover {
  color: var(--color-primary);
}

.settings-toggle-icon {
  display: inline-flex;
  transition: transform var(--transition-normal);
  color: var(--color-text-muted);
  font-size: var(--font-xs);
}

.settings-toggle-icon.expanded {
  transform: rotate(180deg);
}

.settings-content {
  overflow: hidden;
  transition: all var(--transition-normal);
}

.settings-content.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-4);
  padding: var(--spacing-2) 0 var(--spacing-4);
  align-items: start;
}

.settings-clean {
  padding: 0 0 var(--spacing-4);
}

/* ========== 设置行 ========== */
.setting-row {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.setting-row.full-width {
  grid-column: 1 / -1;
}

/* ========== 复选框设置行 ========== */
.checkbox-setting .checkbox-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 0.25rem 0;
}

.checkbox-setting .setting-name {
  line-height: 1.5;
}

.modern-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: var(--color-bg-input);
  border: 2px solid var(--color-border);
  border-radius: 4px;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.modern-checkbox:hover {
  border-color: var(--color-primary);
}

.modern-checkbox:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.modern-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 4px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.setting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.setting-name {
  font-size: var(--font-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
}

.setting-value {
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
}

/* 设置中的 textarea */
.setting-row textarea.setting-textarea {
  width: 100%;
  min-height: 60px;
  padding: var(--spacing-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  resize: vertical;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
}

.setting-row textarea.setting-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb, 59, 130, 246), 0.2);
}

/* ========== 文件输入包装器 ========== */
.file-input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  flex-wrap: nowrap;
}

.file-drop-zone {
  flex: 1;
  min-width: 200px;
  padding: var(--spacing-2) var(--spacing-3);
  background: var(--color-bg-input);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.file-drop-zone:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-alpha-5);
}

.file-drop-zone.has-file {
  border-color: var(--color-primary);
  border-style: solid;
  color: var(--color-text-primary);
  background: var(--color-primary-alpha-8);
}

.file-drop-zone.drag-over {
  border-color: var(--color-primary);
  border-style: solid;
  background: var(--color-primary-alpha-15);
  transform: scale(1.02);
}

.file-drop-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.file-drop-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-clear-file,
.btn-export-file {
  flex-shrink: 0;
  padding: var(--spacing-2) var(--spacing-3);
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-clear-file:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
  background: var(--color-danger-alpha-10);
}

.btn-export-file:hover {
  border-color: var(--color-success);
  color: var(--color-success);
  background: var(--color-success-alpha-10);
}

/* ========== 滑块设置 ========== */
.slider-setting {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

/* 滑块包装器 - 确保滑块和输入框在同一行且垂直居中对齐 */
.slider-setting .slider-wrapper,
.slider-setting .setting-slider-wrap {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  width: 100%;
}

.slider-setting input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 6px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-full);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

/* 滑块数字输入框 - 确保与滑块垂直居中对齐 */
.slider-setting .setting-slider-input,
.slider-setting input[type="number"] {
  flex-shrink: 0;
  width: 70px;
  padding: 11px 8px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  color: var(--color-text-secondary);
  background: var(--color-bg-input);
  border: 1.5px solid var(--color-border-light);
  border-radius: 6px;
  text-align: center;
}

.slider-setting .setting-slider-input:focus,
.slider-setting input[type="number"]:focus {
  outline: none;
  border-color: var(--color-primary);
}

.slider-setting input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.slider-setting input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}


/* 任务列表容器 - 移除顶部额外空白 */
.task-list-container {
  margin-top: 0;
}

.tasks-list-toolbar {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
}

/* ========== 状态筛选标签 ========== */
.status-filter-tabs {
  display: flex;
  gap: var(--spacing-1);
}

.status-tab {
  padding: var(--spacing-1) var(--spacing-3);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--font-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.status-tab:hover {
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
}

.status-tab.active {
  background: var(--color-primary-alpha-10);
  color: var(--color-primary);
  border-color: var(--color-primary-alpha-20);
}

/* ========== 批量操作栏 ========== */
.batch-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--spacing-5);
  background: var(--color-primary-alpha-10);
  border: 1px solid var(--color-primary-alpha-20);
  border-top: none;
  flex-wrap: wrap;
  gap: 8px;
}

.batch-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.select-all-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary);
  cursor: pointer;
}

.batch-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.selected-count {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 600;
}

.batch-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.batch-buttons .btn {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 16px;
}

/* ========== 筛选工具栏 ========== */
.filter-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px var(--spacing-5);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: none;
  gap: 12px;
  margin-top: 0;
  flex-wrap: wrap;
}

.filter-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
  row-gap: 8px;
}

.filter-tag {
  padding: 3px 8px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  line-height: 1.4;
}

.filter-tag:hover {
  background: var(--color-primary-alpha-10);
  border-color: var(--color-primary-alpha-30);
  color: var(--color-primary);
}

.filter-tag.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

/* 选中状态下数字徽章样式 */
.filter-tag.active .tag-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 10px;
  opacity: 1;
  padding: 0 4px;
  border-radius: 6px;
}

/* 不同状态标签的专属颜色 - 统一风格采用蓝绿色系 */
.filter-tag.tag-pending.active {
  background: #e67e22;
  border-color: #e67e22;
  box-shadow: 0 2px 8px rgba(230, 126, 34, 0.35);
}

.filter-tag.tag-running.active {
  background: #3498db;
  border-color: #3498db;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.35);
}

.filter-tag.tag-completed.active {
  background: #27ae60;
  border-color: #27ae60;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.35);
}

.filter-tag.tag-failed.active {
  background: #e74c3c;
  border-color: #e74c3c;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.35);
}

.filter-tag.tag-cancelled.active {
  background: #7f8c8d;
  border-color: #7f8c8d;
  box-shadow: 0 2px 8px rgba(127, 140, 141, 0.35);
}

/* 不同状态的悬停颜色 - 保持统一的蓝绿色系风格 */
.filter-tag.tag-pending:hover {
  background: rgba(230, 126, 34, 0.12);
  border-color: rgba(230, 126, 34, 0.35);
  color: #d35400;
}

.filter-tag.tag-running:hover {
  background: rgba(52, 152, 219, 0.12);
  border-color: rgba(52, 152, 219, 0.35);
  color: #2980b9;
}

.filter-tag.tag-completed:hover {
  background: rgba(39, 174, 96, 0.12);
  border-color: rgba(39, 174, 96, 0.35);
  color: #1e8449;
}

.filter-tag.tag-failed:hover {
  background: rgba(231, 76, 60, 0.12);
  border-color: rgba(231, 76, 60, 0.35);
  color: #c0392b;
}

.filter-tag.tag-cancelled:hover {
  background: rgba(127, 140, 141, 0.12);
  border-color: rgba(127, 140, 141, 0.35);
  color: #636e72;
}

.filter-tag.tag-unknown.active {
  background: #8b5cf6;
  border-color: #8b5cf6;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
  color: #fff;
}

.filter-tag.tag-unknown:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.35);
  color: #7c3aed;
}

.filter-tag.tag-all:hover {
  background: var(--color-primary-alpha-10);
  border-color: var(--color-primary-alpha-30);
  color: var(--color-primary);
}

.tag-count {
  background: var(--color-bg-card);
  padding: 0 4px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 10px;
  opacity: 0.75;
  line-height: 1.4;
}

/* 不同状态标签的数字颜色 - 悬停时显示，与主色调协调 */
.filter-tag.tag-all:hover .tag-count {
  color: var(--color-primary);
}

.filter-tag.tag-pending:hover .tag-count {
  color: #d35400;
}

.filter-tag.tag-running:hover .tag-count {
  color: #2980b9;
}

.filter-tag.tag-completed:hover .tag-count {
  color: #1e8449;
}

.filter-tag.tag-failed:hover .tag-count {
  color: #c0392b;
}

.filter-tag.tag-cancelled:hover .tag-count {
  color: #636e72;
}

.filter-tag.tag-unknown:hover .tag-count {
  color: #8b5cf6;
}

/* ========== 搜索和操作栏（新一行） ========== */
.filter-actions-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 6px var(--spacing-5) 10px var(--spacing-5);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-top: none;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========== 搜索框 ========== */
.search-box {
  position: relative;
  width: 200px;
}

.search-box input {
  padding: 6px 28px 6px 12px;
  width: 100%;
  min-width: 80px;
  font-size: 12px;
  border-radius: 16px;
  border: 1px solid var(--color-border-light);
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
  height: 32px;
  box-sizing: border-box;
}

.search-box input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-bg-card);
}

.search-clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  padding: 0;
  background: var(--color-border-light);
  border: none;
  border-radius: 50%;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.search-clear-btn:hover {
  background: var(--color-primary);
  color: white;
}

/* ========== 排序下拉 ========== */
.sort-dropdown {
  position: relative;
}

.sort-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  height: 32px;
  box-sizing: border-box;
}

.sort-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-alpha-10);
}

.sort-icon {
  font-size: 10px;
  color: var(--color-primary);
}

.sort-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  min-width: 160px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 100;
  overflow: hidden;
  animation: fadeIn 0.15s ease;
  display: none;
}

.sort-dropdown.open .sort-menu {
  display: block;
}

.sort-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 14px;
  background: transparent;
  border: none;
  font-size: 13px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.sort-menu-item:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.sort-menu-item.active {
  color: var(--color-primary);
  font-weight: 600;
  background: var(--color-primary-alpha-10);
}

/* ========== 视图切换 ========== */
.view-toggle {
  display: flex;
  gap: 4px;
  padding: 2px;
  background: var(--color-bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--color-border-light);
  height: 34px;
  box-sizing: border-box;
  align-items: center;
}

.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 13px;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 15px;
  transition: all var(--transition-fast);
}

.view-btn:hover {
  color: var(--color-text-secondary);
  background: var(--color-bg-card);
}

.view-btn.active {
  background: var(--color-bg-card);
  color: var(--color-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

/* 每页显示数量选择器 */
.page-size-selector {
  display: flex;
  align-items: center;
}

.page-size-select {
  padding: 0 28px 0 10px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  font-size: 12px;
  cursor: pointer;
  height: 34px;
  line-height: 34px;
  box-sizing: border-box;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.page-size-select:hover {
  border-color: var(--color-primary);
}

.page-size-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-alpha-20);
}

/* 批量操作按钮 */
.batch-toggle-btn {
  padding: 6px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  height: 32px;
  box-sizing: border-box;
}

.batch-toggle-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-alpha-10);
}

.batch-toggle-btn.active {
  background: var(--color-primary-alpha-10);
  border-color: var(--color-primary-alpha-20);
  color: var(--color-primary);
  font-weight: 600;
}

/* 刷新按钮 */
.btn-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: 16px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 16px;
}

.btn-refresh:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-alpha-10);
}

.btn-refresh.just-refreshed {
  border-color: var(--color-success);
  color: var(--color-success);
  background: var(--color-success-alpha-10);
  cursor: default;
}

/* ========== 筛选结果提示 ========== */
.filter-result-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px var(--spacing-5);
  background: var(--color-primary-alpha-8);
  border: 1px solid var(--color-primary-alpha-20);
  border-top: none;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.clear-filter-btn {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--color-primary-alpha-30);
  border-radius: 12px;
  font-size: 11px;
  color: var(--color-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.clear-filter-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-alpha-10);
}

/* ========== 任务网格滚动容器 ========== */
.task-grid-scroll-container {
  overflow-y: visible;
  overflow-x: visible;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: var(--spacing-5);
  border-top: none;
}

/* ========== 任务表格视图 ========== */
.task-table-container {
  overflow-x: visible;
  width: 100%;
}

.task-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.task-table thead {
  background: var(--color-bg-secondary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.task-table th {
  padding: 10px var(--spacing-4);
  text-align: center;
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  border-bottom: 2px solid var(--color-border);
  letter-spacing: 0.05em;
  white-space: normal;
  vertical-align: middle;
  position: relative;
  user-select: none;
  overflow: visible;
  width: auto;
}

/* 列宽拖拽调整手柄 */
.task-table th .resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 16px;
  cursor: col-resize;
  background: transparent;
  transition: background 0.15s;
  z-index: 100;
  user-select: none;
  pointer-events: auto;
}

.task-table th .resize-handle::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 30px;
  background: transparent;
  border-radius: 2px;
  transition: background 0.15s, height 0.15s;
}

.task-table th .resize-handle:hover::after,
.task-table th .resize-handle.active::after {
  background: var(--color-primary);
  height: 40px;
}

.task-table th:hover .resize-handle::after,
.task-table th.resizing .resize-handle::after {
  background: var(--color-primary);
}

/* 表头悬停效果 */
.task-table th {
  cursor: default;
}

.task-table th:hover {
  background: var(--color-bg-table-hover);
}

/* 操作列表头居中 */
.task-table th.table-col-actions {
  text-align: center;
}

.task-table th:first-child {
  border-radius: var(--radius-md) 0 0 0;
}

.task-table th:last-child {
  border-radius: 0 var(--radius-md) 0 0;
}

.task-table td {
  padding: 10px var(--spacing-4);
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text-primary);
  font-size: 12px;
  vertical-align: middle;
  height: 50px;
  text-align: center;
}

.task-table tbody tr {
  transition: all var(--transition-fast);
}

.task-table tbody tr:hover {
  background: var(--color-bg-table-hover);
}

.task-table tbody tr.selected {
  background: var(--color-primary-alpha-10);
}

.task-table .table-col-checkbox {
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  padding: 10px var(--spacing-4);
}

.task-table .table-col-id {
  width: 25px;
  min-width: 20px;
  max-width: 40px;
  text-align: center;
  box-sizing: border-box;
}

.task-table .table-col-jobid {
  width: 50px;
  min-width: 40px;
  max-width: 120px;
  text-align: center;
  box-sizing: border-box;
}

.task-table .table-col-name {
  width: 80px;
  min-width: 60px;
  max-width: 150px;
  text-align: center;
  box-sizing: border-box;
}

.task-table .table-col-module {
  width: 70px;
  min-width: 50px;
  max-width: 100px;
  text-align: center;
  box-sizing: border-box;
}

.task-table .table-col-type {
  width: 70px;
  min-width: 50px;
  max-width: 100px;
  text-align: center;
  box-sizing: border-box;
}

.task-table .table-col-cpu {
  width: 45px;
  min-width: 40px;
  max-width: 60px;
  text-align: center;
  box-sizing: border-box;
}

.task-table .table-col-status {
  width: 70px;
  min-width: 60px;
  max-width: 100px;
  text-align: center;
  box-sizing: border-box;
}

.task-table .table-col-time {
  width: 100px;
  min-width: 80px;
  max-width: 150px;
  text-align: center;
  box-sizing: border-box;
}

.task-table .table-col-actions {
  width: 120px;
  min-width: 100px;
  max-width: 180px;
  text-align: center;
  box-sizing: border-box;
}

.task-table .table-col-checkbox input[type="checkbox"].task-checkbox {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.task-table-container.batch-mode-active .task-table .table-col-name {
  padding-left: 0 !important;
}

.task-name-text {
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  display: block;
  padding-left: var(--spacing-2) !important;
  word-break: break-word;
  max-width: 200px;
}

.task-table-container.batch-mode-active .task-name-text {
  padding-left: 0 !important;
}

.task-table .table-col-module,
.task-table .table-col-type,
.task-table .table-col-cpu {
  color: var(--color-text-secondary);
}

.task-table .table-col-time {
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.task-table .table-col-actions {
  text-align: center;
  vertical-align: middle;
}

.task-table .table-col-actions .btn {
  width: 60px;
  padding: 4px 6px;
  font-size: 12px;
  height: auto;
  min-height: 26px;
  line-height: 1.4;
  margin-right: 6px;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  vertical-align: middle;
  box-sizing: border-box;
  word-break: keep-all;
  white-space: nowrap;
}

.task-table .table-col-actions .btn:last-child {
  margin-right: 0;
}

/* 确保小按钮样式存在 */
.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
  height: auto;
  min-height: 26px;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
}

/* 确保表格内按钮不会因布局问题隐藏 */
.task-table td .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  visibility: visible;
  opacity: 1;
}

/* ============================================
   任务详情页面样式 - 全面优化版
   ============================================ */

/* ========== 任务详情容器 ========== */
.task-detail-container {
  width: 100%;
  margin: 0 auto;
  padding: 0 16px 16px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
  animation: fadeIn var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: none;
  box-sizing: border-box;
}

.task-detail-container::-webkit-scrollbar {
  width: 10px;
}

.task-detail-container::-webkit-scrollbar-track {
  background: transparent;
}

.task-detail-container::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 5px;
}

/* 任务详情页面覆盖样式 */
.main-content:has(.task-detail-container) {
  height: calc(100vh - 49px) !important;
  overflow-y: auto !important;
  flex: 1 !important;
  align-items: stretch !important;
}

/* ========== 任务详情头部 ========== */
.task-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-5) 0;
  margin-bottom: 0;
  position: sticky;
  top: 0;
  background: var(--color-bg-primary);
  z-index: 10;
}

.task-detail-header-center {
  flex: 1;
  text-align: center;
}

.task-detail-title {
  font-size: var(--font-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0 0 var(--spacing-2) 0;
}

.task-detail-subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-4);
  font-size: var(--font-sm);
  color: var(--color-text-muted);
}

/* 重置 task-detail-subtitle 内所有 .status-dot 的样式，确保不被 card.css 覆盖 */
.task-detail-subtitle .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-neutral);
}

.task-detail-subtitle .task-status-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  transition: all var(--transition-normal);
}

/* 状态颜色 - 蓝绿色系统一风格 */
.task-detail-subtitle .task-status-badge-inline.status-pending .status-dot {
  background: var(--color-warning);
}

.task-detail-subtitle .task-status-badge-inline.status-running .status-dot {
  background: var(--color-primary);
  animation: pulse 1.5s ease-in-out infinite;
}

.task-detail-subtitle .task-status-badge-inline.status-completed .status-dot {
  background: var(--color-success);
}

.task-detail-subtitle .task-status-badge-inline.status-failed .status-dot {
  background: var(--color-danger);
}

.task-detail-subtitle .task-status-badge-inline.status-cancelled .status-dot {
  background: var(--color-neutral);
}

.task-detail-subtitle .task-status-badge-inline.status-unknown .status-dot {
  background: #8b5cf6;
}

.task-detail-subtitle .task-status-badge-inline.status-iterating .status-dot {
  background: var(--color-warning);
  animation: pulse 1.5s ease-in-out infinite;
}

/* 状态文字颜色 */
.task-detail-subtitle .task-status-badge-inline.status-pending {
  color: var(--color-warning-dark);
}

.task-detail-subtitle .task-status-badge-inline.status-running {
  color: var(--color-primary);
}

.task-detail-subtitle .task-status-badge-inline.status-completed {
  color: var(--color-success-dark);
}

.task-detail-subtitle .task-status-badge-inline.status-failed {
  color: var(--color-danger-dark);
}

.task-detail-subtitle .task-status-badge-inline.status-cancelled {
  color: var(--color-neutral-dark);
}

.task-detail-subtitle .task-status-badge-inline.status-unknown {
  color: #8b5cf6;
}

.task-detail-subtitle .task-status-badge-inline.status-iterating {
  color: var(--color-warning-dark);
}

.task-id-badge {
  background: var(--color-bg-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-light);
  letter-spacing: 0.3px;
}

.task-detail-header-right {
  display: flex;
  gap: var(--spacing-2);
}

/* ========== 快捷操作栏 ========== */
.task-quick-actions {
  display: flex;
  gap: var(--spacing-2);
  margin-bottom: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-quick-action {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  padding: var(--spacing-2) var(--spacing-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-quick-action:hover {
  border-color: var(--color-primary-alpha-20);
  color: var(--color-primary);
  background: var(--color-primary-alpha-10);
  transform: translateY(-1px);
}

.btn-quick-action:active {
  transform: scale(0.98);
}

.btn-quick-action.btn-warning:hover {
  border-color: var(--color-warning);
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.1);
}

.btn-quick-action.btn-danger:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.1);
}

.btn-quick-action.btn-refresh-action {
  min-width: 90px;
}

.btn-quick-action.btn-refresh-action .spinning {
  animation: spin 1s linear infinite;
}

/* ========== 信息概览卡片 - 优化版 ========== */
.task-overview-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-5);
  margin-bottom: 0;
  box-shadow: var(--shadow-sm);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--spacing-4);
}

.overview-item {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-1);
  padding: var(--spacing-2);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.overview-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-primary);
}

.overview-item:hover {
  background: var(--color-bg-card);
  transform: translateX(4px);
}

.overview-label {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: var(--font-weight-semibold);
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.overview-label svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.overview-value {
  font-size: var(--font-base);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duration-value {
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
}

/* ========== 存储统计和资源配置合并布局 ========== */
.storage-resource-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-4);
  align-items: start;
}

.storage-resource-grid .storage-section,
.storage-resource-grid .resource-section {
  min-width: 0;
}

.storage-resource-grid .storage-section:empty,
.storage-resource-grid .resource-section:empty {
  display: none;
}

.storage-resource-grid:has(.storage-section:empty) .resource-section,
.storage-resource-grid:has(.resource-section:empty) .storage-section {
  grid-column: 1 / -1;
}

.storage-resource-grid .section-sub-title {
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-3);
  padding-bottom: var(--spacing-2);
  border-bottom: 1px solid var(--color-border-light);
}

.storage-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-3);
}

@media (max-width: 900px) {
  .storage-resource-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== 存储统计面板 ========== */
.storage-stats-panel {
  margin-bottom: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: visible;
  display: block;
  box-shadow: var(--shadow-sm);
}

.storage-stats-panel .panel-header {
  flex-shrink: 0;
}

.storage-stats-panel .panel-content:not(.collapsed) {
  max-height: none;
  overflow: visible;
  padding: var(--spacing-3);
}

.storage-stats-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--spacing-2);
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-1);
  text-align: center;
  padding: var(--spacing-3);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  min-width: 0;
  justify-content: center;
}

.stat-item:hover {
  border-color: var(--color-primary-alpha-20);
  transform: translateY(-2px);
}

.stat-value {
  font-size: var(--font-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}

.stat-label {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
}

/* ========== 内容网格 - 单列布局，每个卡片占一整行 ========== */
.task-content-grid {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
}

.task-content-left,
.task-content-middle,
.task-content-right {
  display: contents;
}

/* ========== 现代面板样式 ========== */
.modern-panel {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-lighter);
  border-radius: 6px;
  overflow: visible;
  margin-bottom: 0;
  min-height: 0;
}

.modern-panel.full-width {
  grid-column: 1 / -1;
  overflow: visible;
  min-height: 0;
}

.modern-panel.full-width .panel-content {
  overflow: visible;
}

.modern-panel.full-width .panel-content:not(.collapsed) {
  max-height: none;
}

.modern-panel.error-panel {
  border-color: var(--color-danger-alpha-20);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--color-bg-secondary);
  cursor: pointer;
  user-select: none;
}

.panel-header:hover {
  background: var(--color-bg-tertiary);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  font-size: var(--font-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
}

.panel-badge {
  font-size: var(--font-xs);
  background: var(--color-primary-alpha-10);
  color: var(--color-primary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-medium);
}

.panel-badge.error {
  background: var(--color-danger-alpha-10);
  color: var(--color-danger);
}

.panel-toggle-icon {
  transition: transform var(--transition-fast);
  color: var(--color-text-muted);
}

.panel-toggle-icon.collapsed {
  transform: rotate(-90deg);
}

.panel-content {
  padding: var(--spacing-3);
  transition: all var(--transition-slow);
  overflow: hidden;
}

.panel-content.collapsed {
  display: none;
  height: 0;
  padding: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
}

.panel-content:not(.collapsed) {
  display: block;
  padding: var(--spacing-3);
  max-height: none;
  height: auto;
  opacity: 1;
  overflow: visible;
  visibility: visible;
}

.panel-toolbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: var(--spacing-2);
}

.panel-toolbar-right {
  justify-content: flex-end;
}

.output-toolbar {
  flex-wrap: wrap;
  gap: var(--spacing-3);
  margin-bottom: var(--spacing-3);
  flex-shrink: 0;
  justify-content: flex-end;
}

.output-actions {
  display: flex;
  gap: var(--spacing-2);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.btn-toolbar {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  padding: var(--spacing-2) var(--spacing-3);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-toolbar:hover {
  border-color: var(--color-primary-alpha-20);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.btn-search {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-box {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.search-box input {
  padding: var(--spacing-2) var(--spacing-3);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  font-size: var(--font-sm);
}

/* 命令块 */
.command-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-3);
  background: var(--color-bg-secondary);
  padding: var(--spacing-4);
  border-radius: var(--radius-md);
}

.command-block code {
  flex: 1;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: var(--font-sm);
  color: var(--color-text-primary);
  word-break: break-all;
  white-space: pre-wrap;
}

.btn-copy {
  flex-shrink: 0;
  padding: var(--spacing-1) var(--spacing-3);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

/* ========== 资源网格 ========== */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-3);
}

.resource-item {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-1);
  padding: var(--spacing-3);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  min-width: 0;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.resource-item:hover {
  border-color: var(--color-primary-alpha-20);
  transform: translateY(-2px);
}

.resource-label {
  font-size: var(--font-sm);
  color: var(--color-text-muted);
}

.resource-value {
  font-size: var(--font-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

/* ========== 代码块 ========== */
.code-block {
  background: var(--color-bg-secondary);
  padding: var(--spacing-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.code-block pre {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: var(--font-sm);
  color: var(--color-text-primary);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

.code-block-sm {
  max-height: 300px;
  overflow-y: auto;
  overflow-x: auto;
}

.code-block-sm pre {
  font-size: var(--font-xs);
  line-height: 1.6;
}

/* 日志文件选择器样式 */
.log-file-selector {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--spacing-2);
  width: 100%;
  padding: 0;
  margin: 0;
}

.log-file-selector label {
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  line-height: normal;
  margin: 0;
  padding: 0;
  height: 100%;
  vertical-align: middle;
}

.log-select {
  flex: 0 1 auto;
  min-width: 180px;
  max-width: 300px;
  padding: 6px var(--spacing-3);
  font-size: var(--font-sm);
  font-family: inherit;
  color: var(--color-text-primary);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1.4;
  height: auto;
  display: inline-block;
  vertical-align: middle;
  margin: 0;
}

.log-select option {
  padding: 6px var(--spacing-3);
  line-height: 1.4;
  vertical-align: middle;
}

.log-select:hover {
  border-color: var(--color-primary);
  background: var(--color-bg-secondary);
}

.log-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.1);
}

/* JSON 内容高亮样式 */
pre.json-content {
  color: var(--color-text-primary);
  font-family: 'Consolas', 'Monaco', monospace;
  line-height: 1.6;
}

/* 代码块包装器 */
.code-block-wrapper {
  display: flex;
  flex-direction: column;
  margin-top: var(--spacing-2);
}

.code-block-wrapper.code-block-sm {
  max-height: 300px;
  overflow-y: auto;
  overflow-x: auto;
}

.code-block-wrapper.code-block-sm .code-block {
  max-height: 100%;
}

/* 文件路径标签 */
.file-path-label {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  padding: var(--spacing-2) var(--spacing-3);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--color-border-light);
  border-bottom: none;
  font-family: 'Consolas', 'Monaco', monospace;
  word-break: break-all;
}

.code-block-wrapper .code-block {
  margin: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.code-block-wrapper.code-block-sm .code-block {
  border-radius: var(--radius-md);
}

/* ========== 结果网格 ========== */
.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-3);
}

/* 结构化结果的代码块 - 与输入参数 JSON 样式保持一致 */
.result-item-wrapper .code-block-wrapper .code-block {
  overflow-x: auto;
  background: var(--color-bg-secondary);
  padding: var(--spacing-4);
  border-radius: var(--radius-md);
}

.result-item-wrapper .code-block-wrapper .code-block pre {
  white-space: pre-wrap;
  word-break: break-all;
}

.result-card {
  background: var(--color-bg-secondary);
  padding: var(--spacing-3) var(--spacing-4);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-primary);
}

.result-card-key {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-1);
}

.result-card-value {
  font-size: var(--font-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.result-card.empty-card {
  border-left: 3px solid var(--color-border-light);
}

.result-card.empty-card .result-card-value {
  color: var(--color-text-muted);
}

/* ========== 结构化结果 ========== */
.structured-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--spacing-3);
}

.result-struct-card {
  background: var(--color-bg-secondary);
  padding: var(--spacing-3) var(--spacing-4);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.result-struct-card:hover {
  border-color: var(--color-primary-alpha-20);
  transform: translateY(-2px);
}

.result-name {
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-2);
}

.result-desc {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-2);
}

.result-preview {
  background: var(--color-bg-card);
  padding: var(--spacing-2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-2);
}

.result-preview pre {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.result-size {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  text-align: right;
}

/* 结构化结果列表样式 */
.result-item-wrapper {
  display: flex;
  flex-direction: column;
}

.result-struct-row {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
  background: transparent;
  padding: 0;
  border-radius: 0;
  border: none;
}

.result-struct-row:hover {
  border-color: var(--color-primary-alpha-20);
}

.result-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-4);
}

.result-name-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  flex: 1;
  min-width: 0;
}

.result-filename {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  word-break: break-all;
}

.result-meta {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.result-struct-row .result-preview {
  background: var(--color-bg-card);
  padding: var(--spacing-2);
  border-radius: var(--radius-sm);
  overflow: auto;
  max-height: 200px;
}

.result-struct-row .result-preview pre {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.result-size {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.result-file-item {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.result-file-item:hover {
  border-color: var(--color-primary-alpha-20);
}

.result-file-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-2) var(--spacing-3);
  background: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border-light);
}

.result-file-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  flex: 1;
  min-width: 0;
}

.result-file-actions {
  display: flex;
  gap: var(--spacing-2);
}

.result-file-name {
  font-size: var(--font-sm);
  color: var(--color-text-primary);
  font-family: 'Consolas', 'Monaco', monospace;
  word-break: break-all;
}

.result-file-size {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  margin-left: var(--spacing-3);
}

.result-file-content {
  padding: var(--spacing-3);
  max-height: 400px;
  overflow: auto;
}

.result-file-content pre {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ========== 图像网格 - 优化版 ========== */
.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--spacing-4);
}

.image-card {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
  transition: all var(--transition-normal);
}

.image-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-alpha-30);
}

.image-card-header {
  padding: var(--spacing-3) var(--spacing-4);
  font-size: var(--font-sm);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-card-body {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-bg-card);
  position: relative;
}

.image-card-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.image-card:hover .image-card-body img {
  transform: scale(1.03);
}

/* Image loading skeleton */
.image-card-body img.loading {
  background: linear-gradient(
    90deg,
    var(--color-bg-secondary) 0%,
    var(--color-bg-card) 50%,
    var(--color-bg-secondary) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.image-card-footer {
  display: flex;
  gap: var(--spacing-2);
  padding: var(--spacing-2) var(--spacing-3);
  border-top: 1px solid var(--color-border-light);
}

.btn-image-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-1);
  padding: var(--spacing-2);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-image-action:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ========== 文件列表 - 现代浏览器风格 ========== */
.file-list-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.file-list-table {
  width: 100%;
  overflow: visible;
  min-width: 0;
  display: table;
}

.file-list-header {
  display: table;
  width: 100%;
  table-layout: fixed;
  gap: 0;
  padding: var(--spacing-3) var(--spacing-4);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-2);
  box-sizing: border-box;
}

.file-list-header span {
  display: table-cell;
  text-align: left;
  width: 60%;
}

.file-list-header span:nth-child(2),
.file-list-header span:nth-child(3) {
  width: 12%;
  text-align: center;
}

.file-list-header span:nth-child(4) {
  width: 16%;
  text-align: center;
}

.file-item {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr 1fr;
  gap: var(--spacing-3);
  padding: var(--spacing-3) var(--spacing-4);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  align-items: center;
  margin-bottom: var(--spacing-2);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.file-item:hover {
  background: var(--color-bg-card);
  border-color: var(--color-border-light);
  transform: translateX(4px);
}

.file-name {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  white-space: normal;
  min-width: 0;
}

.file-list-row {
  min-width: 0;
}

.file-list-row .file-name {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.file-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-alpha-10);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  flex-shrink: 0;
}

.file-type {
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
}

.file-size {
  color: var(--color-text-muted);
  font-family: monospace;
}

.file-actions {
  display: flex;
  gap: var(--spacing-2);
}

.btn-file-action {
  padding: var(--spacing-1) var(--spacing-3);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-file-action:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Legacy file-list-row for backwards compatibility */
.file-list-row {
  display: table;
  width: 100%;
  table-layout: fixed;
  padding: var(--spacing-3) var(--spacing-4);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  align-items: center;
  margin-bottom: var(--spacing-2);
  box-sizing: border-box;
}

.file-list-row span {
  display: table-cell;
  vertical-align: middle;
}

.file-list-row .file-name {
  flex: none;
  width: 60%;
}

.file-list-row .file-type,
.file-list-row .file-size {
  width: 12%;
  text-align: center;
}

.file-list-row .file-actions {
  width: 16%;
  text-align: center;
}

/* ========== 日志容器 - 增强版 ========== */
.log-container {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--spacing-4);
  max-height: 400px;
  overflow-y: auto;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary-alpha-20) transparent;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: var(--font-xs);
  line-height: 1.7;
  position: relative;
}

.log-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.log-container::-webkit-scrollbar-track {
  background: transparent;
}

.log-container::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

.log-container pre {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: var(--font-xs);
  color: var(--color-text-primary);
  white-space: pre;
  word-break: normal;
  margin: 0;
  line-height: 1.6;
}

.output-container {
  max-height: 300px;
  min-height: 80px;
  overflow-y: auto;
  display: block;
}

.output-container pre {
  display: block;
}

.error-log pre {
  color: var(--color-danger);
}

/* Log line hover effect */
.log-line {
  padding: 2px var(--spacing-2);
  border-radius: 2px;
  transition: background var(--transition-fast);
}

.log-line:hover {
  background: var(--color-primary-alpha-8);
}

/* Search highlight */
.highlight {
  background: var(--color-warning);
  color: var(--color-text-primary);
  padding: 0 2px;
  border-radius: 2px;
}

/* Loading state */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-4);
  padding: var(--spacing-6);
  color: var(--color-text-muted);
}

.loading-spinner-sm {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Error state */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-3);
  padding: var(--spacing-6);
  color: var(--color-danger);
  text-align: center;
}

.error-state p {
  margin: 0;
  color: var(--color-text-muted);
}

/* Skeleton loading */
.skeleton-text {
  height: 14px;
  background: linear-gradient(
    90deg,
    var(--color-bg-secondary) 0%,
    var(--color-bg-card) 50%,
    var(--color-bg-secondary) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-2);
}

.skeleton-text:last-child {
  width: 60%;
}

.load-more-footer {
  display: flex;
  justify-content: center;
  padding: var(--spacing-4);
  border-top: 1px solid var(--color-border-light);
  margin-top: var(--spacing-4);
}

.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  padding: var(--spacing-2) var(--spacing-4);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-load-more:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

/* ========== 运行中底部 ========== */
.running-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-3);
  padding: var(--spacing-4);
  color: var(--color-text-muted);
  font-size: var(--font-sm);
}

/* ========== 图片灯箱 - 增强动画 ========== */
.image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--transition-normal);
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  width: 90vw;
  height: 90vh;
  max-width: 1200px;
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: scaleIn var(--transition-normal);
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-4) var(--spacing-5);
  border-bottom: 1px solid var(--color-border-light);
}

.lightbox-filename {
  font-size: var(--font-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.lightbox-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-4);
}

.lightbox-counter {
  font-size: var(--font-sm);
  color: var(--color-text-muted);
}

.lightbox-close {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

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

.lightbox-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: var(--color-bg-secondary);
  padding: var(--spacing-5);
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.1s ease;
}

.lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-5);
  padding: var(--spacing-4) var(--spacing-5);
  border-top: 1px solid var(--color-border-light);
}

.btn-lightbox-nav {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  padding: var(--spacing-2) var(--spacing-4);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-lightbox-nav:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.btn-lightbox-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== 返回按钮 ========== */
.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-back:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateX(-2px);
}

/* ========== 刷新按钮 ========== */
.btn-refresh,
.btn-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-refresh:hover,
.btn-more:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-refresh:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-refresh.spinning svg {
  animation: spin 1s linear infinite;
}

/* ========== 任务网格 ========== */
.task-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  gap: var(--spacing-4) !important;
}

/* ========== 分页组件 ========== */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-4) var(--spacing-2);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-top: calc(-1 * var(--spacing-5));
}

.pagination-info {
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  padding-left: 16px !important;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.pagination-btn {
  padding: var(--spacing-2) var(--spacing-4);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: var(--spacing-1);
}

.pagination-page-btn {
  min-width: 36px;
  height: 36px;
  padding: var(--spacing-1) var(--spacing-2);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination-page-btn:hover:not(:disabled) {
  background: var(--color-primary-alpha-10);
  border-color: var(--color-primary);
}

.pagination-page-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.pagination-page-btn.ellipsis {
  border: none;
  background: transparent;
  cursor: default;
}

.pagination-page-btn.ellipsis:hover {
  background: transparent;
}

/* ========== 空状态 - 增强版 ========== */
.empty-state {
  text-align: center;
  padding: var(--spacing-8) var(--spacing-4);
  color: var(--color-text-muted);
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--color-border-light);
  animation: fadeIn var(--transition-normal);
}

.empty-state.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--spacing-4);
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--font-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-2);
}

.empty-state-desc {
  font-size: var(--font-sm);
  color: var(--color-text-muted);
}

.hint-text {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  margin-top: var(--spacing-1);
}

/* 空状态带插图变体 */
.empty-state.illustration {
  background: linear-gradient(
    135deg,
    var(--color-bg-card) 0%,
    var(--color-primary-alpha-5) 100%
  );
  border: 1px solid var(--color-primary-alpha-15);
}

/* ========== 结果摘要区域 ========== */
.result-summary {
  margin-top: var(--spacing-4);
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--spacing-4);
}

.result-summary-toggle-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  width: 100%;
  padding: var(--spacing-2) var(--spacing-3);
  background: var(--color-success-alpha-8);
  border: 1px solid var(--color-success-alpha-15);
  border-radius: var(--radius-md);
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-success-dark);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.result-summary-toggle-btn:hover {
  background: var(--color-success-alpha-10);
  border-color: var(--color-success);
}

.result-summary-content {
  margin-top: var(--spacing-3);
  padding: var(--spacing-4);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  animation: slideDown 0.2s ease;
}

.result-summary-content.collapsed {
  display: none;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-2) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.result-item:last-child {
  border-bottom: none;
}

.result-key {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
}

.result-value {
  font-size: var(--font-xs);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== 错误摘要区域 ========== */
.error-summary {
  margin-top: var(--spacing-4);
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--spacing-4);
}

.error-toggle-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  width: 100%;
  padding: var(--spacing-2) var(--spacing-3);
  background: var(--color-danger-alpha-8);
  border: 1px solid var(--color-danger-alpha-15);
  border-radius: var(--radius-md);
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-danger-dark);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.error-toggle-btn:hover {
  background: var(--color-danger-alpha-10);
  border-color: var(--color-danger);
}

.error-content {
  margin-top: var(--spacing-3);
  padding: var(--spacing-4);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  font-size: var(--font-xs);
  color: var(--color-danger-dark);
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.6;
  animation: slideDown 0.2s ease;
}

.error-content.collapsed {
  display: none;
}

.error-hint {
  margin-top: var(--spacing-2);
  font-size: 10px;
  color: var(--color-text-muted);
  text-align: right;
}

/* ========== Staggered entrance animations ========== */
.stagger-enter > * {
  opacity: 0;
  transform: translateY(10px);
  animation: slideUp var(--transition-normal) forwards;
}

.stagger-enter > *:nth-child(1) { animation-delay: 0ms; }
.stagger-enter > *:nth-child(2) { animation-delay: 50ms; }
.stagger-enter > *:nth-child(3) { animation-delay: 100ms; }
.stagger-enter > *:nth-child(4) { animation-delay: 150ms; }
.stagger-enter > *:nth-child(5) { animation-delay: 200ms; }
.stagger-enter > *:nth-child(6) { animation-delay: 250ms; }
.stagger-enter > *:nth-child(7) { animation-delay: 300ms; }
.stagger-enter > *:nth-child(8) { animation-delay: 350ms; }

/* ========== 响应式调整 ========== */
@media (max-width: 768px) {
  .tasks-container {
    padding: var(--spacing-4);
  }

  .task-grid {
    grid-template-columns: 1fr;
  }

  .tasks-list-toolbar {
    flex-wrap: wrap;
  }

  .search-box input {
    width: 140px;
    min-width: 80px;
  }

  .batch-action-bar {
    flex-direction: column;
    gap: var(--spacing-3);
    align-items: flex-start;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-3);
  }

  .filter-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .filter-tags {
    flex-wrap: wrap;
  }

  .filter-actions {
    flex-wrap: wrap;
  }

  .search-box {
    flex: 1;
    min-width: 120px;
  }

  .search-box input {
    width: 100%;
    min-width: 80px;
  }

  .task-detail-container {
    padding: 0 var(--spacing-4);
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

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

  .resource-grid {
    grid-template-columns: 1fr;
  }

  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .images-grid {
    grid-template-columns: 1fr;
  }

  .file-list-header,
  .file-item {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .file-item .file-actions {
    display: none;
  }
}

/* 中等屏幕下也尽量保持一行 */
@media (min-width: 769px) and (max-width: 1200px) {
  .search-box input {
    min-width: 80px;
  }

  .filter-actions {
    gap: 6px;
  }
}

/* 智能仿真面板样式 - 与 modern-panel 一致 */
.smart-simulation-panel {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-4);
  margin-bottom: var(--spacing-4);
  box-shadow: var(--shadow-sm);
}

.iteration-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.selector-label {
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  font-size: var(--font-sm);
}

.iteration-count-badge {
  font-size: var(--font-xs);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: rgba(100, 100, 100, 0.2);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
  margin-right: var(--spacing-2);
}

.iteration-btn {
  padding: 8px 16px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-full);
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.iteration-btn:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-primary-alpha-50);
}

.iteration-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.status-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
}

.status-badge.completed { background: #4caf50; color: white; }
.status-badge.running { background: #2196f3; color: white; }
.status-badge.stopped { background: #9c27b0; color: white; }
.status-badge.failed { background: #f44336; color: white; }
.status-badge.pending { background: #ff9800; color: white; }
.status-badge.iterating { background: #f59e0b; color: white; }

.ai-decision-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-lighter);
  border-radius: 8px;
  padding: var(--spacing-4);
  margin-bottom: 12px;
}

.ai-decision-card .card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-decision-card .header-icon {
  background: var(--color-primary);
  color: white;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: bold;
}

.ai-decision-card .header-text {
  font-weight: 600;
  color: var(--color-text-primary);
  flex: 1;
}

.decision-badge {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.decision-badge.continue {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.decision-badge.stop {
  background: rgba(100, 100, 100, 0.2);
  color: var(--color-text-primary);
}

.decision-reason {
  margin: 8px 0;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.decision-action {
  font-weight: 600;
  margin-top: 12px;
  font-size: 14px;
}

.decision-action.continue {
  color: var(--color-success);
}

.decision-action.stop {
  color: var(--color-primary);
}

.convergence-progress {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 12px;
  text-align: right;
}

/* ========== 迭代过程中的 AI 评估面板样式 ========== */
.ai-conversation-panel {
  margin-bottom: 0;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-bg-primary);
  overflow: hidden;
}

.ai-conversation-panel .panel-content {
  padding: var(--spacing-3);
}

.ai-conversation-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
}

.ai-conversation-item {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg-secondary);
}

.conversation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-2) var(--spacing-3);
  background: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border-light);
}

.conversation-iteration-wrapper {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.conversation-iteration {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: var(--font-sm);
}

.iteration-status-text {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-bg-primary);
}

.iteration-status-text.completed { color: var(--color-success); }
.iteration-status-text.stopped { color: var(--color-success); }
.iteration-status-text.running { color: var(--color-info); }
.iteration-status-text.pending { color: var(--color-warning); }
.iteration-status-text.failed { color: var(--color-danger); }

.conversation-timestamp {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
}

.conversation-content {
  padding: var(--spacing-3);
}

/* 决策卡片布局 */
.decision-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--spacing-2);
  margin-bottom: var(--spacing-3);
}

.decision-card {
  padding: var(--spacing-2) var(--spacing-3);
  background: var(--color-bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
}

.decision-card .card-label {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.decision-card .card-value {
  font-size: var(--font-sm);
  font-weight: 600;
}

.card-value.continue,
.card-value.success {
  color: var(--color-success);
}

.card-value.stop,
.card-value.warning {
  color: var(--color-warning);
}

/* AI 原因说明 */
.ai-reason-section {
  margin-bottom: var(--spacing-3);
}

.ai-reason-section .section-title {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-2);
}

.ai-reason-content {
  color: var(--color-text-primary);
  line-height: 1.6;
  font-size: var(--font-sm);
  padding: var(--spacing-2);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
}

/* 指标网格 */
.result-metrics {
  margin-bottom: var(--spacing-2);
}

.result-metrics .section-title {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-2);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--spacing-2);
}

.metric-card {
  background: var(--color-bg-primary);
  padding: var(--spacing-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
  text-align: center;
}
  border-radius: 8px;
  border: 1px solid var(--color-border-lighter);
  min-width: 0;
}

.metric-name {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  margin-bottom: 4px;
  word-break: break-word;
  line-height: 1.3;
}

.metric-number {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--color-primary);
  word-break: break-word;
}

/* AI 原始响应 */
.conversation-response-section {
  margin-top: var(--spacing-3);
}

.response-details {
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.response-summary {
  cursor: pointer;
  padding: var(--spacing-2) var(--spacing-3);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  color: var(--color-text-muted);
  transition: background-color 0.2s ease;
  user-select: none;
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.response-summary:hover {
  background: var(--color-bg-primary);
  color: var(--color-text-secondary);
}

.response-details[open] .response-summary {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.conversation-response {
  background: var(--color-bg-tertiary);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: var(--spacing-2);
  max-height: 200px;
  overflow-y: auto;
}

.conversation-response pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: var(--font-xs);
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* AI 评估 Prompt 折叠显示样式 */
.conversation-prompt {
  margin-bottom: var(--spacing-3);
}

.ai-prompt-details {
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ai-prompt-summary {
  cursor: pointer;
  padding: var(--spacing-2) var(--spacing-3);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  color: var(--color-text-muted);
  transition: background-color 0.2s ease;
  user-select: none;
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.ai-prompt-summary:hover {
  background: var(--color-bg-primary);
  color: var(--color-text-secondary);
}

.ai-prompt-details[open] .ai-prompt-summary {
  border-radius: 8px 8px 0 0;
}

.ai-prompt-content {
  background: var(--color-bg-secondary);
  border-radius: 0 0 8px 8px;
  padding: 12px;
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ========== 迭代结果摘要面板样式 ========== */
.iteration-result-panel {
  margin-bottom: 0;
}

.iteration-result-panel .result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.iteration-result-panel .result-card {
  background: var(--color-bg-secondary);
  border-radius: 8px;
  padding: 16px;
  border-left: 3px solid var(--color-primary);
}

.iteration-result-panel .result-card-key {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.iteration-result-panel .result-card-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
}

/* ========== 资源配置面板内部分隔符 ========== */
.section-divider {
  grid-column: 1 / -1;
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  padding: var(--spacing-2) 0;
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: var(--spacing-2);
}

/* ========== 资源配置面板内小标题 ========== */
.section-subtitle {
  grid-column: 1 / -1;
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  padding: var(--spacing-3) 0 var(--spacing-2);
  margin-top: var(--spacing-2);
}

/* 第一个 section-subtitle 不需要顶部 margin */
.section-subtitle:first-child {
  margin-top: 0;
}

/* 资源配置面板内的存储统计网格 - 响应式调整 */
.resource-grid + .storage-stats-inline,
.storage-stats-wrapper {
  display: flex;
  flex-direction: column;
}

.resource-grid + .storage-stats-wrapper {
  margin-top: var(--spacing-3);
  padding-top: var(--spacing-3);
  border-top: 1px dashed var(--color-border-light);
}

.storage-stats-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--spacing-2);
}

/* ========== 内联存储统计样式 ========== */
.storage-stats-inline {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.stat-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-2);
}

.stat-item-inline {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-1);
}

.stat-item-inline .stat-value {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.stat-item-inline .stat-label {
  color: var(--color-text-muted);
  font-size: var(--font-sm);
}

.stat-separator {
  color: var(--color-border);
  margin: 0 var(--spacing-1);
}

.resource-grid + .storage-stats-grid .storage-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--spacing-2);
}

/* ========== AI 分析报告 Markdown 样式 ========== */
.ai-report-content {
  padding: var(--spacing-5);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  line-height: 1.8;
  color: var(--color-text-primary);
}

.ai-report-content h1,
.ai-report-content h2,
.ai-report-content h3 {
  margin-top: 1.5em;
  margin-bottom: 0.8em;
  line-height: 1.4;
}

.ai-report-content h1:first-child,
.ai-report-content h2:first-child,
.ai-report-content h3:first-child {
  margin-top: 0;
}

.ai-report-content h1 {
  font-size: 1.4em;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  padding-bottom: 0.4em;
  border-bottom: 2px solid var(--color-primary-alpha-20);
}

.ai-report-content h2 {
  font-size: 1.2em;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--color-border-light);
}

.ai-report-content h3 {
  font-size: 1.05em;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.ai-report-content p {
  margin: 0.8em 0;
  line-height: 1.8;
}

.ai-report-content > p:first-child {
  margin-top: 0;
}

.ai-report-content ul,
.ai-report-content ol {
  margin: 0.8em 0;
  padding-left: 1.6em;
}

.ai-report-content ul {
  list-style-type: disc;
}

.ai-report-content ol {
  list-style-type: decimal;
}

.ai-report-content li {
  margin: 0.4em 0;
  line-height: 1.7;
}

.ai-report-content li::marker {
  color: var(--color-primary);
}

.ai-report-content strong {
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}

.ai-report-content em {
  font-style: italic;
}

.ai-report-content code {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 0.15em 0.4em;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
  color: var(--color-primary);
}

.ai-report-content pre {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--spacing-4);
  margin: 1em 0;
  overflow-x: auto;
}

.ai-report-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: var(--font-xs);
  line-height: 1.7;
  color: var(--color-text-primary);
}

.ai-report-content blockquote {
  border-left: 4px solid var(--color-primary);
  background: var(--color-primary-alpha-8);
  margin: 1em 0;
  padding: 0.8em 1.2em;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.ai-report-content blockquote p {
  margin: 0;
  color: var(--color-text-secondary);
  font-style: italic;
}

.ai-report-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: var(--font-sm);
}

.ai-report-content table th {
  background: var(--color-primary-alpha-10);
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
  padding: 0.6em 0.8em;
  text-align: left;
  border: 1px solid var(--color-border-light);
}

.ai-report-content table td {
  padding: 0.5em 0.8em;
  border: 1px solid var(--color-border-light);
}

.ai-report-content table tr:nth-child(even) {
  background: var(--color-bg-card);
}

.ai-report-content a {
  color: var(--color-primary);
  text-decoration: none;
}

.ai-report-content a:hover {
  text-decoration: underline;
}

.ai-report-content hr {
  border: none;
  border-top: 2px solid var(--color-border-light);
  margin: 1.5em 0;
}

/* AI Report Error Display */
.ai-report-error {
  padding: 20px;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--color-border-light);
}

.error-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-light);
}

.error-title {
  font-size: 15px;
  font-weight: 600;
  color: #ef4444;
}

.config-diagnosis {
  margin: 16px 0;
  padding: 16px;
  background: var(--color-bg-primary);
  border-radius: 6px;
  border: 1px solid var(--color-border-light);
}

.diagnosis-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 12px;
}

.config-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
}

.config-label {
  min-width: 80px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.config-value {
  color: var(--color-text-primary);
  font-family: monospace;
  font-size: 12px;
}

.status-ok {
  color: #10b981;
  font-weight: 500;
}

.status-error {
  color: #ef4444;
  font-weight: 500;
}

.troubleshooting {
  margin: 16px 0;
  padding: 16px;
  background: var(--color-bg-warning);
  border-radius: 6px;
  border: 1px solid var(--color-border-warning);
}

.troubleshooting-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-warning);
  margin-bottom: 10px;
}

.troubleshooting-list {
  margin: 0;
  padding-left: 20px;
}

.troubleshooting-list li {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 6px;
}

.troubleshooting-list li:last-child {
  margin-bottom: 0;
}

/* ============================================
   Smart Simulation Enhancement Styles
   智能仿真增强样式
   ============================================ */

/* Convergence Metrics Panel */
.convergence-metrics-panel {
  margin-top: var(--spacing-4);
}

.convergence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--spacing-3);
  margin-bottom: var(--spacing-4);
}

.metric-card {
  background: var(--color-bg-secondary);
  border-radius: 6px;
  padding: var(--spacing-3);
  text-align: center;
  border: 1px solid var(--color-border-lighter);
}

.metric-label {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-1);
  font-weight: var(--font-weight-medium);
}

.metric-value {
  font-size: var(--font-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  font-family: var(--font-mono);
}

/* Deviation Progress Bar */
.deviation-progress-bar {
  margin-top: var(--spacing-2);
}

.progress-track {
  height: 6px;
  background: var(--color-bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-success), var(--color-warning), var(--color-danger));
  transition: width 0.3s ease;
  border-radius: 3px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--spacing-1);
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
}

.convergence-badge {
  font-size: var(--font-xs);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: var(--font-weight-medium);
  margin-left: var(--spacing-2);
}

.convergence-badge.success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.convergence-badge.warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

/* Parameter Changes Panel */
.parameter-changes-panel {
  margin-top: var(--spacing-4);
}

.parameter-changes-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.parameter-change-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  padding: var(--spacing-3);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-border-light);
  transition: all 0.2s ease;
}

.parameter-change-item:hover {
  background: var(--color-bg-hover);
}

.parameter-change-item.changed {
  border-left-color: var(--color-primary);
  background: var(--color-primary-bg);
}

.param-name {
  font-weight: var(--font-weight-semibold);
  min-width: 100px;
  font-family: var(--font-mono);
  font-size: var(--font-sm);
  color: var(--color-text-primary);
}

.param-explanation {
  flex: 1;
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.param-badge {
  font-size: var(--font-xs);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.param-badge.changed {
  background: var(--color-primary);
  color: white;
}

.param-badge.unchanged {
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
}

/* Enhanced AI Decision Card */
.ai-decision-card .card-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.decision-badge {
  font-size: var(--font-xs);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: var(--font-weight-medium);
  margin-left: auto;
}

.decision-badge.continue {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.decision-badge.stop {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.decision-metrics-quick {
  display: flex;
  gap: var(--spacing-4);
  margin-top: var(--spacing-3);
  padding-top: var(--spacing-3);
  border-top: 1px solid var(--color-border-light);
  flex-wrap: wrap;
}

.quick-metric {
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
}

.quick-metric.deviation {
  color: var(--color-warning);
  font-weight: var(--font-weight-semibold);
}

.decision-details {
  margin-top: var(--spacing-3);
}

.btn-toggle-details {
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font-size: var(--font-sm);
  padding: 0;
  font-weight: var(--font-weight-medium);
  transition: color 0.2s ease;
}

.btn-toggle-details:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

.details-content {
  margin-top: var(--spacing-2);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--spacing-3);
  max-height: 200px;
  overflow-y: auto;
}

.details-content pre {
  margin: 0;
  white-space: pre-wrap;
  font-size: var(--font-sm);
  line-height: 1.6;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
}

.recommendations {
  margin-top: var(--spacing-3);
  padding-top: var(--spacing-3);
  border-top: 1px solid var(--color-border-light);
}

.recommendations-title {
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-2);
}

.recommendations-list {
  margin: 0;
  padding-left: var(--spacing-5);
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
}

.recommendations-list li {
  margin-bottom: var(--spacing-1);
  line-height: 1.5;
}

.recommendations-list li:last-child {
  margin-bottom: 0;
}

/* Result Card Highlight */
.result-card.highlight {
  background: linear-gradient(135deg, var(--color-primary-bg), var(--color-bg-secondary));
  border: 1px solid var(--color-primary);
}

.result-card.error {
  background: var(--color-error-bg);
  border: 1px solid var(--color-danger);
}

/* ========== 智能仿真增强样式 ========== */

/* 决策推理卡片 */
.decision-reasoning-card,
.recommendations-card {
  margin-top: 16px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-lighter);
  border-radius: 8px;
  overflow: hidden;
}

.reasoning-text {
  margin: 0;
  font-size: var(--font-sm);
  line-height: 1.6;
  color: var(--color-text-secondary);
  white-space: pre-wrap;
}

/* 推荐建议 */
.recommendations-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recommendation-item {
  display: flex;
  gap: var(--spacing-2);
  padding: var(--spacing-2) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.recommendation-item:last-child {
  border-bottom: none;
}

.rec-number {
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  flex-shrink: 0;
}

.rec-text {
  flex: 1;
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* 首次迭代提示 */
.first-iteration-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-3);
  padding: var(--spacing-4);
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  border-radius: var(--radius-md);
  color: var(--color-info-text);
  font-size: var(--font-sm);
}

/* 参数对比 */
.param-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-2);
}

.param-comparison {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  padding: var(--spacing-3);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
  margin-top: var(--spacing-2);
}

.param-old-value,
.param-new-value {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-1);
}

.param-old-value {
  opacity: 0.7;
}

.param-new-value {
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
}

.value-label {
  font-size: var(--font-xs);
  color: var(--color-text-tertiary);
}

.value-content {
  font-family: var(--font-mono);
  font-size: var(--font-sm);
}

.param-arrow {
  color: var(--color-text-tertiary);
  font-size: var(--font-lg);
}

/* 状态徽章大尺寸 */
.status-badge-large {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-1) var(--spacing-3);
  border-radius: var(--radius-full);
  font-size: var(--font-sm);
  font-weight: var(--font-weight-medium);
}

.status-badge-large.status-success,
.status-badge-large.success {
  background: var(--color-bg-tertiary);
  color: #388e3c;
}

.status-badge-large.status-error,
.status-badge-large.error,
.status-badge-large.failed {
  background: var(--color-bg-tertiary);
  color: #d32f2f;
}

.status-badge-large.status-running,
.status-badge-large.running {
  background: var(--color-bg-tertiary);
  color: #1976d2;
}

.status-badge-large.status-pending,
.status-badge-large.pending {
  background: var(--color-bg-tertiary);
  color: #f57c00;
}

/* 结果区域标题 */
.result-section {
  margin-bottom: var(--spacing-5);
}

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

.section-title {
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-3);
  padding-bottom: var(--spacing-2);
  border-bottom: 1px solid var(--color-border-light);
}

/* JSON 预览 */
.json-preview {
  background: var(--color-bg-secondary);
  padding: var(--spacing-3);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  line-height: 1.6;
  color: var(--color-text-secondary);
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
}

/* 分析报告 Markdown 样式增强 */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  margin-top: var(--spacing-4);
  margin-bottom: var(--spacing-2);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
}

.markdown-content h1 { font-size: var(--font-xl); }
.markdown-content h2 { font-size: var(--font-lg); }
.markdown-content h3 { font-size: var(--font-base); }

.markdown-content p {
  margin-bottom: var(--spacing-3);
  line-height: 1.7;
}

.markdown-content blockquote {
  margin: var(--spacing-3) 0;
  padding: var(--spacing-3);
  background: var(--color-bg-secondary);
  border-left: 3px solid var(--color-primary);
}

.markdown-content blockquote p {
  margin: 0;
}

.markdown-content ul,
.markdown-content ol {
  margin: var(--spacing-3) 0;
  padding-left: var(--spacing-5);
}

.markdown-content li {
  margin-bottom: var(--spacing-2);
  line-height: 1.6;
}

.markdown-content hr {
  margin: var(--spacing-4) 0;
  border: none;
  border-top: 1px solid var(--color-border-light);
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-3) 0;
}

.markdown-content th,
.markdown-content td {
  padding: var(--spacing-2) var(--spacing-3);
  border: 1px solid var(--color-border-light);
  text-align: left;
}

.markdown-content th {
  background: var(--color-bg-secondary);
  font-weight: var(--font-weight-semibold);
}

.markdown-content code {
  background: var(--color-bg-secondary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.markdown-content pre {
  background: var(--color-bg-secondary);
  padding: var(--spacing-3);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--spacing-3) 0;
}

.markdown-content pre code {
  padding: 0;
  background: transparent;
}

/* ========== 统一迭代详情面板样式 ========== */
.iteration-unified-panel {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-bg-primary);
  overflow: hidden;
}

.iteration-unified-panel .panel-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.iteration-unified-panel .panel-content {
  padding: var(--spacing-3);
}

/* 迭代选择器栏 */
.iteration-selector-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--spacing-3);
  margin-bottom: var(--spacing-3);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
}

.selector-label {
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.iteration-buttons {
  display: flex;
  gap: var(--spacing-2);
  flex-wrap: wrap;
}

.iter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: var(--font-sm);
  color: var(--color-text-primary);
}

.iter-btn:hover {
  background: var(--color-bg-tertiary);
}

.iter-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: white;
}

.iter-num {
  font-weight: 600;
}

.iter-status {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
}

.iter-btn.active .iter-status {
  color: white !important;
}

.iter-btn.completed:not(.active) .iter-status { color: var(--color-success); }
.iter-btn.stopped:not(.active) .iter-status { color: var(--color-success); }
.iter-btn.stopped.max-iterations:not(.active) .iter-status { color: var(--color-warning); }
.iter-btn.running:not(.active) .iter-status { color: var(--color-info); }
.iter-btn.failed:not(.active) .iter-status { color: var(--color-danger); }

/* 迭代内容网格 */
.iteration-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-4);
}

.iteration-col-left,
.iteration-col-right {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
}

.iteration-col-right {
  padding-left: var(--spacing-4);
  border-left: 1px solid var(--color-border-light);
}

/* 迭代卡片 */
.iteration-card {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
  padding: var(--spacing-3);
  border: 1px solid var(--color-border-light);
}

.iteration-card .card-header-small {
  padding-bottom: var(--spacing-2);
  margin-bottom: var(--spacing-2);
  border-bottom: 1px solid var(--color-border-light);
}

/* 结果值显示 */
.result-value-display {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-2);
  margin-bottom: var(--spacing-3);
}

.result-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text-primary);
  font-family: var(--font-mono);
}

.result-label {
  font-size: var(--font-sm);
  color: var(--color-text-muted);
}

/* 结果详情列表 */
.result-details-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-1);
  margin-bottom: var(--spacing-3);
}

.result-detail-item {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-sm);
}

.detail-key {
  color: var(--color-text-secondary);
}

.detail-value {
  color: var(--color-text-primary);
  font-weight: 500;
}

/* 结果元信息行 */
.result-meta-row {
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-3);
  padding-top: var(--spacing-2);
  border-top: 1px solid var(--color-border-light);
  font-size: var(--font-xs);
}

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

.meta-value {
  color: var(--color-text-secondary);
}

/* AI决策卡片 */
.ai-decision-card .card-header-small {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-text-label {
  font-weight: 700;
  font-size: var(--font-xs);
  color: white;
  background: var(--color-primary);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: var(--spacing-1);
}

.decision-tag {
  font-size: var(--font-xs);
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.decision-tag.continue {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.decision-tag.stop {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}

/* 内容网格 */
.iteration-content-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
}

.iteration-col-left,
.iteration-col-right {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
}

.iteration-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--spacing-8);
  color: var(--color-text-muted);
}

/* 迭代卡片 */
.iteration-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-lighter);
  border-radius: 8px;
  overflow: hidden;
}

.card-header-small {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border-lighter);
  font-size: 14px;
  color: var(--color-text-primary);
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-actions-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.iteration-badge-small {
  background: var(--color-primary);
  color: white;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.card-header-small.ai-header {
  justify-content: space-between;
}

.ai-text-label {
  background: rgba(100, 100, 100, 0.2);
  color: var(--color-text-primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.decision-tag {
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.decision-tag.continue {
  background: var(--color-bg-tertiary);
  color: #388e3c;
}

.decision-tag.stop {
  background: var(--color-bg-tertiary);
  color: #f57c00;
}

/* 结果卡片 */
.result-value-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  text-align: center;
}

.result-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
  font-family: var(--font-mono);
}

.result-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 10px;
}

.result-details-list {
  padding: 0 16px 16px;
}

.result-detail-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-lighter);
}

.result-detail-item:last-child {
  border-bottom: none;
}

.detail-key {
  color: var(--color-text-secondary);
  font-size: 14px;
}

.detail-value {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--color-text-primary);
}

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

/* 参数卡片 */
.params-compact-list {
  padding: 14px;
}

.param-compact-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border-lighter);
}

.param-compact-item:last-child {
  border-bottom: none;
}

.param-compact-item .param-name {
  color: var(--color-text-secondary);
  font-size: 13px;
}

.param-compact-item .param-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}

/* 参数变化 */
.params-changes-section {
  border-top: 1px solid var(--color-border-lighter);
  padding: 12px 14px 14px;
}

.changes-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.changes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.change-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.change-item .change-key {
  color: var(--color-text-secondary);
}

.change-item .change-explanation {
  font-size: 11px;
  color: var(--color-text-muted);
  font-style: italic;
}

.change-values {
  display: flex;
  align-items: center;
  gap: 6px;
}

.change-values .old-val {
  color: var(--color-text-muted);
  text-decoration: line-through;
  font-family: var(--font-mono);
}

.change-values .change-arrow {
  color: var(--color-primary);
  font-size: var(--font-lg);
}

.change-values .new-val {
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
  font-family: var(--font-mono);
}

/* AI 决策内容 */
.ai-decision-content {
  padding: 14px;
}

.decision-main {
  margin: 0 0 12px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-primary);
}

.decision-reason-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-lighter);
}

.reason-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.reason-content {
  font-size: 13px;
  color: var(--color-text-primary);
  line-height: 1.5;
  margin: 0;
}

.reasoning-collapse details {
  background: var(--color-bg-secondary);
  border-radius: 6px;
  padding: 8px 12px;
}

.reasoning-collapse summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.reasoning-collapse .reasoning-text {
  margin: 8px 0 0 0;
  font-size: 12px;
  color: var(--color-text-tertiary);
  line-height: 1.5;
  padding-left: 8px;
}

/* 收敛卡片 */
.convergence-card .convergence-tag {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background: #fff3e0;
  color: #ef6c00;
}

.convergence-card .convergence-tag.converged {
  background: #e8f5e9;
  color: #2e7d32;
}
.convergence-card .convergence-tag.max-iterations {
  background: #fff3e0;
  color: #ef6c00;
}


.convergence-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.conv-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.conv-item.full-width {
  grid-column: 1 / -1;
}

.conv-label {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.conv-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
}

.conv-value.target { color: var(--color-text-primary); }
.conv-value.actual { color: var(--color-primary); }
.conv-value.deviation { color: #ef6c00; }
.conv-value.deviation.in-tolerance { color: #2e7d32; }

.progress-bar-container {
  padding: 0 14px 14px;
}

.progress-bar-container .progress-track {
  height: 4px;
  background: var(--color-bg-secondary);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-container .progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-label {
  margin-top: var(--spacing-1);
  text-align: center;
  font-size: var(--font-xs);
  color: var(--color-text-tertiary);
}

/* 推荐列表 */
.rec-list {
  margin: 0;
  padding: 14px 14px 14px 32px;
}

.rec-item {
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

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

/* 底部信息栏 */
.iteration-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-lighter);
  font-size: 11px;
  color: var(--color-text-muted);
}

.footer-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 响应式 */
@media (max-width: 900px) {
  .iteration-content-grid {
    grid-template-columns: 1fr;
  }

  .iteration-selector-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
}

/* 统一迭代面板中的收敛标签样式 */
.iteration-unified-panel .convergence-tag {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}

.iteration-unified-panel .convergence-tag.converged {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}
.iteration-unified-panel .convergence-tag.max-iterations {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}


/* 参数变化说明样式 */
.change-explanation {
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  padding-left: var(--spacing-2);
  font-style: italic;
}

/* 纯文字按钮 */
.btn-text-small {
  padding: 4px 10px;
  font-size: 11px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border-light);
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-text-secondary);
}

/* 卡片标题文字 */
.card-title-text {
  font-weight: 600;
}

/* 结果元信息行 */
.result-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 14px;
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border-lighter);
}

.meta-item {
  display: flex;
  gap: 4px;
  font-size: 12px;
}

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

.meta-value {
  color: var(--color-text-primary);
  font-weight: 500;
}

/* 参数调整理由 */
.adjustment-reason {
  margin: 12px 14px 0;
  padding: 10px 12px;
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  border-left: 2px solid var(--color-text-muted);
}

.reason-label {
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-info-text);
  margin-bottom: var(--spacing-1);
}

.reason-text {
  font-size: var(--font-sm);
  color: var(--color-text-primary);
  line-height: 1.6;
}

/* 决策理由 */
.decision-reason-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-lighter);
}

.reason-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.reason-content {
  font-size: 13px;
  color: var(--color-text-primary);
  line-height: 1.5;
  margin: 0;
}

/* Footer 标签 */
.footer-label {
  color: var(--color-text-secondary);
}

/* 收敛容差值 */
.conv-value.tolerance {
  color: var(--color-text-primary);
  font-family: var(--font-mono);
}

/* ========== 统一面板基础样式 ========== */
.combined-summary-panel,
.iteration-unified-panel,
.ai-conversation-panel {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-bg-primary);
  overflow: hidden;
}

/* ========== 智能仿真全局汇总面板样式 ========== */
.combined-summary-panel {
  margin-bottom: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-4);
  padding: var(--spacing-3);
}

.summary-col-left {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
}

.summary-col-right {
  display: flex;
  flex-direction: column;
  padding-left: var(--spacing-4);
  border-left: 1px solid var(--color-border-light);
}

.summary-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-2);
}

.summary-card {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
  padding: var(--spacing-3);
  border: 1px solid var(--color-border-light);
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-card.converged {
  border-color: var(--color-success);
  background: var(--color-success-bg);
}

.summary-card.max-iterations {
  border-color: var(--color-warning);
  background: var(--color-warning-bg);
}

.card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: var(--spacing-1);
}

.card-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: break-word;
  text-align: center;
}

.summary-card.converged .card-value {
  color: var(--color-success-text);
}

.summary-card.max-iterations .card-value {
  color: var(--color-warning-text);
  font-size: 14px;
}

.card-label {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  font-weight: 500;
  text-align: center;
}

.optimization-goals-section,
.final-reason-section {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
  padding: var(--spacing-3);
  border: 1px solid var(--color-border-light);
}

.section-header {
  margin-bottom: var(--spacing-2);
}

.section-title {
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--color-text-primary);
}

.goals-content,
.reason-content {
  font-size: var(--font-sm);
  color: var(--color-text-primary);
  line-height: 1.6;
  padding: var(--spacing-2);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-3);
  padding-bottom: var(--spacing-2);
  border-bottom: 1px solid var(--color-border-light);
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: var(--spacing-1);
}

.timeline-item {
  display: flex;
  gap: var(--spacing-3);
  position: relative;
  padding-bottom: var(--spacing-4);
}

.timeline-item:not(.is-last)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  width: 2px;
  height: calc(100% - 20px);
  background: var(--color-border-light);
}

.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--font-xs);
  font-weight: 700;
  background: var(--color-bg-tertiary);
  border: 2px solid var(--color-border-light);
  color: var(--color-text-secondary);
  z-index: 1;
}

.timeline-dot.completed,
.timeline-dot.stopped {
  border-color: var(--color-success);
  color: var(--color-success);
  background: var(--color-success-bg);
}

.timeline-dot.running {
  border-color: var(--color-info);
  color: var(--color-info);
  background: var(--color-info-bg);
}

.timeline-dot.pending {
  border-color: var(--color-warning);
  color: var(--color-warning);
  background: var(--color-warning-bg);
}

.timeline-dot.failed {
  border-color: var(--color-danger);
  color: var(--color-danger);
  background: var(--color-error-bg);
}

.dot-iteration-num {
  font-size: var(--font-xs);
  font-weight: 700;
}

.timeline-content {
  flex: 1;
  padding-top: 4px;
}

.timeline-status {
  font-size: var(--font-sm);
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-status.completed,
.timeline-status.stopped { color: var(--color-success); }
.timeline-status.running { color: var(--color-info); }
.timeline-status.pending { color: var(--color-warning); }
.timeline-status.failed { color: var(--color-danger); }

.timeline-time {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-2);
}

.timeline-decision {
  font-size: var(--font-sm);
  color: var(--color-text-primary);
  line-height: 1.6;
  padding: var(--spacing-2) var(--spacing-3);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
}

.completion-footer {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  padding-top: var(--spacing-3);
  border-top: 1px solid var(--color-border-light);
  font-size: var(--font-sm);
}

.completion-footer .footer-label {
  color: var(--color-text-muted);
  font-weight: 500;
}

.completion-footer .footer-value {
  color: var(--color-text-primary);
}

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

  .summary-cards-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .summary-cards-row {
    grid-template-columns: 1fr;
  }
}


/* ===== renderer/css/pages/module-generic.css ===== */
/*
  module-generic.css - 通用仿真模块样式

  使用范围：所有使用自动表单生成的模块（通过 manifest.json parameters 定义）
  以及带有自定义UI的仿真模块（如 test-module-1, test-module-2）

  设计原则：
  1. 所有模块特定样式通过 .module-generic 类隔离
  2. 表单使用 .module-form > .form-group 结构
  3. 操作按钮使用 .module-actions
  4. 验证错误使用 .validation-errors
  5. 仿真参数设置使用通用参数组件类

  模块开发流程：
  1. Backend: 在 simulations/{module-id}/manifest.json 中定义 parameters JSON Schema
  2. Frontend: 在 modules/{module-id}/index.html 中使用 .module-generic 结构
  3. CSS: 优先使用本文件的统一样式，模块特定样式仅在必要时创建

  ============================================
  第一部分：基础模块容器与表单
  ============================================ */

/* ========== 模块容器 ========== */
.module-generic {
  padding: 16px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-sizing: border-box;
}

/* ========== 模块头部 ========== */
.module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border-light);
}

.module-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 4px 0;
  letter-spacing: -0.3px;
}

.module-header .description {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}

/* ========== 模块表单 ========== */
.module-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px 20px;
  padding: 20px 0;
}

/* ========== 表单分组 ========== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--color-bg-secondary);
  border-radius: 12px;
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
}

.form-group:hover {
  border-color: var(--color-primary-light);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.08);
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group .unit {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-primary);
  background: var(--color-primary-alpha-10);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
}

.form-group .required {
  color: var(--color-danger);
}

/* ========== 输入框样式 ========== */
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  color: var(--color-text-primary);
  background: var(--color-bg-input);
  border: 1.5px solid var(--color-border-light);
  border-radius: 10px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha-10);
  background: var(--color-bg-card);
}

.form-group input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

/* ========== 数字输入框 ========== */
.form-group input[type="number"] {
  font-weight: 500;
  text-align: center;
}

/* ========== 下拉选择框 ========== */
.form-group select {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--color-text-primary);
  background: var(--color-bg-input);
  border: 1.5px solid var(--color-border-light);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha-10);
  background-color: var(--color-bg-card);
}

/* ========== 复选框 ========== */
.form-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
  border-radius: 4px;
}

.form-group input[type="checkbox"] + label {
  cursor: pointer;
}

/* ========== 描述文本 ========== */
.form-group .description {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* ========== 操作按钮区域 ========== */
.module-actions {
  display: flex;
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--color-border-light);
}

.module-actions button {
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.module-actions button:not(:disabled) {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.module-actions button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.module-actions button:not(:disabled):active {
  transform: translateY(0);
}

.module-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.module-actions button.secondary {
  background: var(--color-bg-card);
  color: var(--color-text-secondary);
  border: 1.5px solid var(--color-border);
  box-shadow: none;
}

.module-actions button.secondary:hover:not(:disabled) {
  background: var(--color-bg-secondary);
  border-color: var(--color-border-hover);
  color: var(--color-text-primary);
  transform: none;
  box-shadow: none;
}

/* ========== 验证错误 ========== */
.validation-errors {
  padding: 12px 16px;
  background: var(--color-danger-alpha-10);
  border: 1px solid var(--color-danger-alpha-30);
  border-radius: 10px;
}

.validation-errors .error {
  color: var(--color-danger);
  font-size: 13px;
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.validation-errors .error::before {
  content: '⚠';
  font-size: 12px;
}

/* ============================================
   第二部分：仿真参数设置通用样式
   所有仿真模块的参数卡片、滑动条、输入框等组件
   ============================================ */

/* ========== 仿真参数容器 ========== */
.module-params-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--color-bg-card);
  border-radius: 16px;
  border: 1px solid var(--color-border-light);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* ========== 面板头部（可折叠） ========== */
.module-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border-light);
  border-radius: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: left;
  transition: all 0.2s ease;
  user-select: none;
}

.module-panel-header::before {
  display: none;
}

.module-panel-header:hover {
  background: var(--color-bg-secondary);
  transform: none;
  box-shadow: none;
  border-color: var(--color-border-light);
}

.module-panel-header .collapse-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--color-text-muted);
  background: transparent;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 10px;
  flex-shrink: 0;
}

.module-panel-header.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.module-panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  letter-spacing: 0.02em;
}

.module-panel-title h2,
.module-panel-title h3 {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.module-panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.module-panel-btn {
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.module-panel-btn:hover:not(:disabled) {
  color: var(--color-primary);
  border-color: var(--color-primary-light);
  background: var(--color-primary-alpha-8);
  transform: translateY(-1px);
}

.module-panel-btn:active:not(:disabled) {
  transform: translateY(0);
}

.module-panel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== 可折叠内容区域 ========== */
.module-params-content {
  overflow: hidden;
  transition: opacity 0.25s ease;
  opacity: 1;
}

.module-params-content.collapsed {
  display: none;
}

/* ========== 标签页导航 ========== */
.module-tabs-nav {
  display: flex;
  gap: 4px;
  padding: 16px 20px 0;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border-light);
  overflow-x: auto;
}

.module-tabs-nav::-webkit-scrollbar {
  height: 4px;
}

.module-tabs-nav::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

.module-tab-btn {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  border-radius: 8px 8px 0 0;
}

.module-tab-btn:hover {
  color: var(--color-text-secondary);
  background: rgba(139, 92, 246, 0.05);
}

.module-tab-btn.active {
  color: var(--color-primary);
  background: var(--color-bg-card);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* ========== 标签页内容 ========== */
.module-tabs-content {
  padding: 16px;
  height: auto;
  max-height: none;
  overflow-y: visible;
}

.module-tab-panel {
  animation: moduleFadeIn 0.25s ease;
}

/* ========== 参数分区 ========== */
.module-param-section {
  margin-bottom: 28px;
}

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

.module-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 16px 0;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--color-border-light);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
}

.module-section-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-muted);
  letter-spacing: 0;
}

/* ========== 参数网格布局 ========== */
.module-param-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 1000px) {
  .module-param-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .module-param-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== 参数卡片 - 统一样式 ========== */
.module-param-card {
  background: var(--color-bg-secondary);
  border-radius: 12px;
  border: 1.5px solid var(--color-border-light);
  padding: 14px 16px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.module-param-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.1);
  background: linear-gradient(135deg, var(--color-bg-secondary) 0%, rgba(139, 92, 246, 0.03) 100%);
}

/* ========== 参数标签行 ========== */
.module-param-label-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.module-param-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  line-height: 1.3;
}

.module-param-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-primary);
  background: var(--color-bg-tertiary);
  padding: 3px 10px;
  border-radius: 4px;
  border: 1.5px solid var(--color-border);
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* ========== 滑块+输入框容器 ========== */
.module-param-slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

/* 滑块 - 视觉主体，占据绝大部分空间 */
.module-param-slider-wrap input[type="range"] {
  flex: 7;
  min-width: 0;
  height: 8px;
  border-radius: 6px;
  background: var(--color-border);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: all 0.2s ease;
  background-image: linear-gradient(var(--color-primary), var(--color-primary));
  background-size: 0% 100%;
  background-repeat: no-repeat;
}

.module-param-slider-wrap input[type="range"]:hover {
  background-image: linear-gradient(var(--color-primary-light), var(--color-primary-light));
}

/* Slider 滑块 */
.module-param-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid var(--color-bg-card);
}

.module-param-slider-wrap input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.5);
}

.module-param-slider-wrap input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  cursor: pointer;
  border: 3px solid var(--color-bg-card);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

/* 输入框容器 - 次要角色，紧凑小巧 */
.module-param-input-wrap {
  flex: 2;
  flex-shrink: 0;
  min-width: 72px;
  max-width: 96px;
}

.module-param-input-wrap input[type="number"] {
  width: 100%;
  padding: 6px 8px;
  font-size: 11px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-input);
  border: 1.5px solid var(--color-border-light);
  border-radius: 8px;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -moz-appearance: textfield;
}

.module-param-input-wrap input[type="number"]::-webkit-inner-spin-button,
.module-param-input-wrap input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.7;
  height: 100%;
  margin-left: 2px;
  transform: scale(0.8);
}

.module-param-input-wrap input[type="number"]:focus {
  outline: none;
  border-color: var(--color-primary);
  color: var(--color-text-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.08);
  background: var(--color-bg-card);
}

[data-theme="dark"] .module-param-input-wrap input[type="number"]:focus {
  background: var(--color-bg-card);
}

/* ========== 提交按钮区域 ========== */
.module-submit-section {
  display: flex;
  gap: 12px;
  width: 100%;
}

/* ========== 提交按钮样式 ========== */
.module-submit-btn {
  flex: 1;
  padding: 14px 24px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.02em;
  border: none;
}

.module-submit-btn.primary {
  background: #0066cc;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
}

.module-submit-btn.primary:hover:not(:disabled) {
  background: #0077ee;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 102, 204, 0.35);
}

.module-submit-btn.secondary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.module-submit-btn.secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
}

.module-submit-btn.tertiary {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}

.module-submit-btn.tertiary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.45);
}

.module-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.module-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ========== JSON 查看器 ========== */
.module-json-viewer {
  padding: 16px;
  margin: 16px;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--color-border);
  max-height: 300px;
  overflow: auto;
}

.module-json-viewer pre {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-primary);
  white-space: pre-wrap;
  word-break: break-all;
  font-family: 'Courier New', monospace;
}

/* ========== 参数扫描面板样式 ========== */
.module-sweep-panel {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.module-sweep-header {
  cursor: pointer;
  padding: 8px 0;
}

.module-sweep-header .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--color-text-primary);
  cursor: pointer;
}

.module-sweep-header input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.module-sweep-body {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.module-sweep-panel .form-group {
  margin-bottom: 16px;
}

.module-sweep-panel .form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.module-sweep-panel .form-select,
.module-sweep-panel .form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--color-bg-card);
  color: var(--color-text-primary);
}

.module-sweep-panel .form-select:focus,
.module-sweep-panel .form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* ========== 运算按钮（枚举类型） ========== */
.generic-operation-cards {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
}

.generic-operation-btn {
  flex-shrink: 0;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border-light);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.generic-operation-btn:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
  background: var(--color-primary-alpha-8);
}

.generic-operation-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* ========== 布尔类型复选框 ========== */
.generic-boolean-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.generic-param-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
  border-radius: 4px;
}

.generic-boolean-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  cursor: pointer;
}

/* ========== 字符串输入框 ========== */
.generic-string-input-wrap {
  width: 100%;
}

.generic-param-text-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  color: var(--color-text-primary);
  background: var(--color-bg-input);
  border: 1.5px solid var(--color-border-light);
  border-radius: 10px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.generic-param-text-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha-10);
  background: var(--color-bg-card);
}

.generic-param-text-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

/* ========== 通用滑块样式 ========== */
.generic-param-slider {
  width: 100%;
  height: 8px;
  border-radius: 6px;
  background: var(--color-border);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.generic-param-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid var(--color-bg-card);
}

/* ========== 通用参数描述文字 ========== */
.generic-param-description {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* ============================================
   响应式左右 padding 系统
   设计原则：桌面端宽松，平板端适中，手机端紧凑
   ============================================ */

/* ========== 默认（桌面 1200px+）========== */
.module-generic,
.generic-module-page {
  padding: 16px 28px;
}

.module-panel-header {
  padding: 14px 28px;
}

.module-tabs-content {
  padding: 20px;
}

/* ========== 1400px+ 超大屏幕 ========== */
@media (min-width: 1400px) {
  .module-generic,
  .generic-module-page {
    padding: 20px 36px;
  }

  .module-panel-header {
    padding: 16px 36px;
  }

  .module-tabs-content {
    padding: 24px;
  }
}

/* ========== 1200px 中等桌面 ========== */
@media (max-width: 1200px) {
  .module-generic,
  .generic-module-page {
    padding: 14px 20px;
  }

  .module-panel-header {
    padding: 12px 20px;
  }

  .module-tabs-content {
    padding: 16px;
  }
}

/* ========== 1024px 平板横屏 ========== */
@media (max-width: 1024px) {
  .module-generic,
  .generic-module-page {
    padding: 12px 16px;
  }
}

/* ========== 768px 平板 ========== */
@media (max-width: 768px) {
  .module-generic {
    padding: 14px 16px;
    gap: 16px;
  }

  .generic-module-page {
    padding: 16px 16px;
    gap: 16px;
  }

  .module-form {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .module-actions {
    flex-direction: column;
  }

  .module-actions button {
    width: 100%;
  }

  .module-tabs-content {
    padding: 14px;
  }

  .module-submit-section {
    flex-direction: column;
  }

  .generic-operation-cards {
    flex-direction: column;
  }
}

/* ========== 576px 大屏手机 ========== */
@media (max-width: 576px) {
  .module-generic,
  .generic-module-page {
    padding: 12px 12px;
  }

  .module-panel-header {
    padding: 10px 12px;
  }

  .module-tabs-content {
    padding: 12px;
  }
}

/* ========== 480px 中等手机 ========== */
@media (max-width: 480px) {
  .module-generic,
  .generic-module-page {
    padding: 10px 10px;
  }

  .module-panel-header {
    padding: 8px 10px;
  }

  .module-tabs-nav {
    padding: 12px 10px 0;
  }

  .module-tab-btn {
    padding: 8px 14px;
  }
}

/* ========== 360px 小手机 ========== */
@media (max-width: 360px) {
  .module-generic,
  .generic-module-page {
    padding: 8px 8px;
  }

  .module-panel-header {
    padding: 6px 8px;
    font-size: 12px;
  }

  .module-param-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== 通用页面容器 ========== */
.generic-module-page {
  padding: 16px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  box-sizing: border-box;
  height: auto;
  min-height: auto;
  max-height: none;
  overflow: visible;
}

/* ========== 通用顶部标题栏 ========== */
.generic-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.generic-title-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.generic-main-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.generic-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
  font-weight: 400;
}

/* ========== 通用主体内容区域 ========== */
.generic-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
}

/* ===== renderer/css/pages/settings.css ===== */
/* ============================================
   Settings Page Styles - 设置页面样式 - 滚动修复版
   ============================================ */

/* ========== 最优先：确保滚动正常 ========== */
.main-content:has(.settings-container) {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: calc(100vh - 49px) !important;
  display: block !important;
  flex-direction: initial !important;
}

.main-content:has(.settings-container) > * {
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
}

/* ========== 设置容器 ========== */
.settings-container {
  padding: 32px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-sizing: border-box;
  overflow: visible !important;
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  flex: none !important;
  padding-bottom: 40px;
}

.settings-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-light);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.settings-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 24px 0;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border-light);
}

/* ========== 设置分区 ========== */
.settings-section {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--color-border-light);
}

.settings-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.settings-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 16px 0;
}

/* ========== 设置项 ========== */
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.setting-item:first-child {
  padding-top: 0;
}

.setting-item:last-child {
  padding-bottom: 0;
}

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

.setting-description {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ========== 单选按钮组 ========== */
.radio-group {
  display: flex;
  gap: 16px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-secondary);
  padding: 10px 16px;
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border-light);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.radio-item:hover {
  border-color: var(--color-primary-alpha-20);
  background: var(--color-primary-alpha-10);
  color: var(--color-primary);
}

.radio-item input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.radio-item:has(input[type="radio"]:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-alpha-10);
  color: var(--color-primary);
  font-weight: 600;
}

/* ========== 开关组件 ========== */
.switch-wrapper {
  position: relative;
  width: 44px;
  height: 24px;
}

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

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--color-border);
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.switch-input:checked + .switch-slider {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}

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

.switch-input:focus + .switch-slider {
  box-shadow: 0 0 0 3px var(--color-primary-alpha-20);
}

/* ========== 选择框 ========== */
.setting-select {
  padding: 8px 14px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 120px;
}

.setting-select:hover {
  border-color: var(--color-primary);
}

.setting-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha-10);
}

/* ========== 设置按钮组 ========== */
.settings-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-light);
}

/* ========== 主题预览卡片 ========== */
.theme-preview-row {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.theme-preview-card {
  flex: 1;
  padding: 16px;
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.theme-preview-card:hover {
  border-color: var(--color-primary-alpha-20);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.theme-preview-card.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha-10);
}

.theme-preview-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.theme-preview-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

/* ========== 响应式调整 ========== */
@media (max-width: 640px) {
  .settings-container {
    padding: 16px;
  }

  .settings-card {
    padding: 20px;
  }

  .setting-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .radio-group {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .radio-item {
    width: 100%;
  }
}


/* ===== renderer/css/pages/profile.css ===== */
/* ============================================
   User Profile Page - 用户个人信息页面 - 滚动修复版
   简约现代单卡片设计
   ============================================ */

/* ========== 最优先：确保滚动正常 ========== */
.main-content:has(.profile-container) {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: calc(100vh - 49px) !important;
  display: block !important;
  flex-direction: initial !important;
}

.main-content:has(.profile-container) > * {
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
}

/* ========== 页面容器 ========== */
.profile-container {
  padding: 32px 24px 80px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  box-sizing: border-box;
  overflow: visible !important;
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  flex: none !important;
  padding-bottom: 80px;
}

/* ========== 页面标题 ========== */
.profile-header {
  text-align: left;
}

.profile-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 8px 0;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.profile-subtitle {
  font-size: 15px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
  font-weight: 400;
}

/* ========== 主卡片 ========== */
.profile-main-card {
  background: var(--color-bg-card);
  border-radius: 16px;
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-main-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ========== 内容分区 ========== */
.profile-section {
  padding: 16px 24px;
}

.profile-section-divider {
  border-top: 1px solid var(--color-border-light);
}


.profile-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.profile-section-header-inline .profile-section-title {
  margin: 0;
}

/* ========== 分区底部按钮区域 ========== */
.profile-section-footer {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 0;
}

/* ========== 密码表单区域 ========== */
.profile-password-form {
  margin-top: 0;
}

/* ========== 表单网格布局 ========== */
.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.profile-form-grid .form-group.full-width {
  grid-column: 1 / -1;
}

.profile-form-grid .form-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}

.profile-form-grid .form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin: 0;
}

.profile-form-grid input[type="text"],
.profile-form-grid input[type="email"],
.profile-form-grid input[type="tel"],
.profile-form-grid input[type="password"],
.profile-form-grid textarea {
  margin: 0;
  padding: 7px 10px;
  font-size: 14px;
  border-radius: 8px;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg-input);
  resize: vertical;
}

.profile-form-grid textarea {
  min-height: 60px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-form-grid input[type="text"]:focus,
.profile-form-grid input[type="email"]:focus,
.profile-form-grid input[type="tel"]:focus,
.profile-form-grid input[type="password"]:focus,
.profile-form-grid textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-alpha-10);
  outline: none;
  background: var(--color-bg-card);
}

.profile-form-grid input.disabled {
  background: var(--color-bg-secondary);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.8;
  border-color: transparent;
}

.profile-form-grid .form-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 2px 0 0 0;
  line-height: 1.4;
}

.profile-form-grid .core-hours-info {
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--color-bg-secondary);
  border-radius: 6px;
  line-height: 1.6;
}

.profile-form-grid .core-hours-card {
  grid-column: 1 / -1;
  background: var(--color-bg-secondary);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 0;
}

.profile-form-grid .core-hours-card .form-label {
  margin-bottom: 8px;
}

.profile-form-grid .core-hours-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-form-grid .core-hours-row {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ========== 提示消息 ========== */
.profile-alert {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.4;
  font-weight: 400;
}

.profile-alert.danger {
  background: var(--color-danger-alpha-8);
  border: 1px solid var(--color-danger-alpha-15);
  color: var(--color-danger-dark);
}

.profile-alert.success {
  background: var(--color-success-alpha-8);
  border: 1px solid var(--color-success-alpha-15);
  color: var(--color-success-dark);
}

/* ========== 退出登录区域 ========== */
.profile-logout-section {
  background: var(--color-bg-secondary);
}

.logout-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logout-text h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 6px 0;
  line-height: 1.4;
}

.logout-text p {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}

/* ========== 按钮样式优化 ========== */
.profile-section .btn {
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-section .btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

.profile-section .btn-ghost {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.profile-section .btn-ghost:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-border-hover);
  color: var(--color-text-primary);
}

.profile-password-toggle-btn {
  border-color: var(--color-primary-alpha-40);
  color: var(--color-primary);
  background: var(--color-primary-alpha-8);
  transition: all 0.2s ease;
}

.profile-password-toggle-btn:hover {
  background: var(--color-primary-alpha-15);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.profile-logout-section .btn-danger {
  background: transparent;
  border: 1.5px solid var(--color-danger-alpha-30);
  color: var(--color-danger);
  font-weight: 500;
  box-shadow: none;
}

.profile-logout-section .btn-danger:not(:disabled):hover {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
  box-shadow: none;
}

/* ========== 响应式调整 ========== */
@media (max-width: 768px) {
  .profile-container {
    padding: 32px 20px;
    gap: 24px;
  }

  .profile-title {
    font-size: 26px;
  }

  .profile-subtitle {
    font-size: 14px;
  }

  .profile-section {
    padding: 24px 20px;
  }

  .profile-form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .profile-section-header-inline {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .logout-content {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 16px;
  }

  .logout-content .btn {
    width: 100%;
  }

  .profile-main-card {
    border-radius: 12px;
  }
}


/* ===== renderer/css/pages/test-module-1.css ===== */
/*
  test-module-1.css - 3D MOSFET 仿真模块样式

  仅包含模块特定的样式，通用仿真参数样式已移至 module-generic.css
*/

/* ========== 页面容器 ========== */
.test-module-1-page {
  padding: 32px 28px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  box-sizing: border-box;
  height: auto;
  min-height: auto;
  max-height: none;
  overflow: visible;
  contain: none !important;
  position: relative;
}

.test-module-1-page *,
.test-module-1-page *::before,
.test-module-1-page *::after {
  contain: none !important;
}

.main-content:has(.test-module-1-page) {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* ========== 顶部标题栏 ========== */
.test-module-1-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 0;
}

.test-module-1-title-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-module-1-main-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.test-module-1-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
  font-weight: 400;
}

.test-module-1-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ========== 顶部操作按钮 ========== */
.test-module-1-header-btn {
  padding: 9px 18px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 10px;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.test-module-1-header-btn:hover:not(:disabled) {
  background: var(--color-bg-secondary);
  border-color: var(--color-primary-light);
  color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

.test-module-1-header-btn:active:not(:disabled) {
  transform: translateY(0);
}

.test-module-1-header-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== 主体内容区域 ========== */
.test-module-1-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: start;
}

.test-module-1-single-column-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
}

.test-module-1-visual-panel-top {
  width: 100%;
}

.test-module-1-params-panel-bottom {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--color-bg-card);
  border-radius: 16px;
  border: 1px solid var(--color-border-light);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.test-module-1-submit-section-bottom {
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 12px;
}

/* ========== 器件结构预览 - 可折叠 ========== */
.test-module-1-visual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 28px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border-light);
  border-radius: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: left;
  transition: all 0.2s ease;
  user-select: none;
}

.test-module-1-visual-header::before {
  display: none;
}

.test-module-1-visual-header:hover {
  background: var(--color-bg-secondary);
  transform: none;
  box-shadow: none;
  border-color: var(--color-border-light);
}

.test-module-1-visual-header .collapse-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--color-text-muted);
  background: transparent;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 10px;
  flex-shrink: 0;
}

.test-module-1-visual-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  letter-spacing: 0.02em;
}

.test-module-1-visual-title h3 {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.test-module-1-visual-header.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.test-module-1-visual-content {
  overflow: hidden;
  transition: opacity 0.25s ease;
  opacity: 1;
}

.test-module-1-visual-content.collapsed {
  display: none;
}

/* ========== 刷新按钮 ========== */
.test-module-1-refresh-btn {
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.test-module-1-refresh-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary-light);
  background: var(--color-primary-alpha-8);
}

/* ========== 图例区域 ========== */
.test-module-1-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 14px 22px;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border-light);
  flex-wrap: wrap;
}

.test-module-1-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.legend-dot.channel {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.legend-dot.source-drain {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.legend-dot.oxide {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.legend-dot.gate {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.legend-label {
  font-size: 11px;
}

/* ========== 3D 画布容器 ========== */
.test-module-1-canvas-container {
  width: 100%;
  min-height: 420px;
  background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-input) 100%);
  position: relative;
  overflow: hidden;
}

.test-module-1-canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ========== 右侧可视化面板 ========== */
.test-module-1-visual-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: auto !important;
  overflow: visible !important;
}

/* ========== 可视化卡片 ========== */
.test-module-1-visual-card {
  background: var(--color-bg-card);
  border-radius: 16px;
  border: 1px solid var(--color-border-light);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}

/* ========== 响应式适配 ========== */
@media (max-width: 1000px) {
  .test-module-1-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .test-module-1-page {
    padding: 20px 16px;
    gap: 20px;
  }

  .test-module-1-header {
    flex-direction: column;
    align-items: stretch;
  }

  .test-module-1-main-title {
    font-size: 18px;
  }

  .test-module-1-submit-section {
    flex-direction: column;
  }

  .test-module-1-legend {
    gap: 12px;
    padding: 12px 16px;
  }

  .test-module-1-canvas-container {
    min-height: 350px;
  }
}


/* ===== renderer/css/pages/test-module-2.css ===== */
/*
  test-module-2.css - 简单计算器模块样式

  仅包含模块特定的样式，通用仿真参数样式已移至 module-generic.css
*/

/* ========== 页面容器 ========== */
.test-module-2-page {
  padding: 32px 28px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  box-sizing: border-box;
  height: auto;
  min-height: auto;
  max-height: none;
  overflow: visible;
}

/* ========== 顶部标题栏 ========== */
.test-module-2-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.test-module-2-title-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-module-2-main-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.test-module-2-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
  font-weight: 400;
}

/* ========== 主体内容区域 ========== */
.test-module-2-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
}

/* ========== 运算按钮 ========== */
.test-module-2-operation-cards {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
}

.test-module-2-operation-btn {
  flex-shrink: 0;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border-light);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.test-module-2-operation-btn:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
  background: var(--color-primary-alpha-8);
}

.test-module-2-operation-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* ========== 响应式适配 ========== */
@media (max-width: 768px) {
  .test-module-2-page {
    padding: 20px 16px;
    gap: 20px;
  }

  .test-module-2-header {
    flex-direction: column;
    align-items: stretch;
  }

  .test-module-2-main-title {
    font-size: 18px;
  }

  .test-module-2-submit-section {
    flex-direction: column;
  }

  .test-module-2-tabs-content {
    padding: 16px;
  }

  .test-module-2-operation-cards {
    flex-direction: column;
  }
}


/* ===== renderer/css/pages/simulation-submit.css ===== */
/* ============================================
   普通仿真 / 智能仿真提交页面
   简约单卡片设计 - 参考用户个人信息页面
   ============================================ */

/* ========== 最优先：确保滚动正常 ========== */
.main-content:has(.simulation-submit-page) {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: calc(100vh - 49px) !important;
  display: block !important;
  flex-direction: initial !important;
}

.main-content:has(.simulation-submit-page) > * {
  height: auto !important;
  min-height: auto !important;
}

/* ========== 工具提示 ========== */
.setting-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
  z-index: 100;
}

.setting-tooltip .tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-bg-secondary);
  color: var(--color-text-muted);
  font-size: 11px;
  font-style: italic;
  margin-left: 0;
  border: 1px solid var(--color-border-light);
}

.setting-tooltip:hover .tooltip-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.setting-tooltip .tooltip-content {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  transform: translateX(0);
  background: var(--color-bg-card);
  color: var(--color-text-secondary);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--color-border);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 9999;
  min-width: 220px;
  max-width: 300px;
  white-space: normal;
}

/* ========== 页面容器 ========== */
.simulation-submit-page {
  padding: 16px 16px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 80px;
  box-sizing: border-box;
  overflow: visible;
  height: auto !important;
  min-height: auto !important;
  flex: none !important;
}

.tasks-container.simulation-submit-page {
  overflow: visible !important;
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  flex: none !important;
  padding: 16px 12px 24px 12px !important;
}

/* ========== 页面标题 ========== */
.simulation-header {
  text-align: left;
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.simulation-header::after {
  display: none;
}

.simulation-title-section {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.simulation-title-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.simulation-main-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 8px 0;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.simulation-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
  font-weight: 400;
}

.smart-simulation-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--color-primary-alpha-10);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 600;
  border-radius: 16px;
  border: 1px solid var(--color-primary-alpha-20);
  letter-spacing: 0.02em;
}

.simulation-header-actions {
  display: none;
}

/* ========== 主卡片 ========== */
.simulation-main-card {
  background: var(--color-bg-card);
  border-radius: 16px;
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.simulation-main-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.simulation-card-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ========== 折叠面板 - 简约风格 ========== */
.simulation-section-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border-light);
  border-radius: 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: left;
  transition: all 0.2s ease;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}

.simulation-section-toggle::before {
  display: none;
}

.simulation-section-toggle:hover {
  background: var(--color-bg-secondary);
  transform: none;
  box-shadow: none;
  border-color: var(--color-border-light);
}

.simulation-section-toggle .toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--color-text-muted);
  background: transparent;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 10px;
  flex-shrink: 0;
}

.simulation-section-toggle .toggle-icon.expanded {
  transform: rotate(180deg);
  color: var(--color-primary);
  background: var(--color-primary-alpha-10);
}

/* ========== 折叠内容区域 ========== */
.simulation-section-content {
  padding: 4px 16px;
  border-bottom: 1px solid var(--color-border-light);
  animation: fadeSlideIn 0.25s ease;
  position: relative;
  z-index: 2;
}

.simulation-section-content.collapsed {
  display: none;
}

/* ========== 参数分区 ========== */

/* ========== 设置网格布局 - 自动适配列数 ========== */
.simulation-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 8px;
}

.simulation-setting-footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: 0;
}

/* ========== 设置分组样式 ========== */
.simulation-settings-group {
  background: var(--color-bg-secondary-alpha-50);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

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

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

/* ========== 验证错误样式 ========== */
.validation-error {
  color: var(--color-danger);
  font-size: 12px;
  margin-top: 6px;
}

.text-warning {
  color: var(--color-warning);
}

/* ========== 设置项 - 简约无卡片样式 ========== */
.simulation-setting-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  transition: none;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 覆盖 tasks.css 中 .setting-row 的 gap - 使用更高优先级 */
.simulation-settings-grid .simulation-setting-card,
.simulation-settings-grid .simulation-setting-card.setting-row {
  gap: 8px;
}

/* 任务名称 - 更大间距 */
.simulation-settings-grid .text-setting.simulation-setting-card,
.simulation-settings-grid .text-setting.simulation-setting-card.setting-row {
  gap: 16px;
}

.simulation-setting-card .setting-header {
  gap: 0;
}

.simulation-setting-card::before {
  display: none;
}

.simulation-setting-card:hover {
  border-color: transparent;
  box-shadow: none;
  background: transparent;
  transform: none;
}

.simulation-setting-card.full-width {
  grid-column: 1 / -1;
}

/* 设置项头部 */
.setting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  min-width: 0;
}

.setting-label,
.setting-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.setting-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-alpha-10);
  padding: 4px 10px;
  border-radius: 8px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  min-width: 36px;
  text-align: center;
  white-space: nowrap;
}

.hour-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-bg-secondary);
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: 6px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
}

/* ========== 滑块样式 - 优化设计：Slider为主，输入框为辅 ========== */
.setting-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  width: 100%;
  padding: 0;
}

/* Slider - 视觉主体，占据绝大部分空间 */
.setting-slider-wrap input[type="range"] {
  flex: 8; /* Slider 占据 8/9 的空间 */
  min-width: 0;
  height: 8px;
  border-radius: 6px;
  background: var(--color-border);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: all 0.2s ease;
  /* 进度填充效果 - JS初始化时会更新 */
  background-image: linear-gradient(var(--color-primary), var(--color-primary));
  background-size: 0% 100%;
  background-repeat: no-repeat;
}

.setting-slider-wrap input[type="range"]:hover {
  background-image: linear-gradient(var(--color-primary-light), var(--color-primary-light));
}

/* Slider 滑块 - 更大更突出 */
.setting-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid var(--color-bg-card);
}

.setting-slider-wrap input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.5);
}

.setting-slider-wrap input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  cursor: pointer;
  border: 3px solid var(--color-bg-card);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

/* 输入框 - 增大宽度 */
.setting-slider-input {
  flex-shrink: 0;
  min-width: 80px;
  max-width: 100px;
  padding: 4px 10px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-input);
  border: 1.5px solid var(--color-border-light);
  border-radius: 8px;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.setting-slider-input:focus {
  outline: none;
  border-color: var(--color-primary);
  color: var(--color-text-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.08);
  background: var(--color-bg-card);
}

.setting-slider-input::-webkit-inner-spin-button,
.setting-slider-input::-webkit-outer-spin-button {
  opacity: 0.7;
  height: 100%;
  margin-left: 2px;
  transform: scale(0.8);
}

/* ========== 文本输入框样式 ========== */
.setting-text-input {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--color-text-primary);
  background: var(--color-bg-input);
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.setting-text-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-alpha-10);
  background: var(--color-bg-card);
}

.setting-text-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

/* ========== 文本域样式 ========== */
.setting-textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--color-text-primary);
  background: var(--color-bg-input);
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  resize: vertical;
  min-height: 44px;
  font-family: inherit;
  line-height: 1.4;
}

.setting-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-alpha-10);
  background: var(--color-bg-card);
}

.setting-textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

/* ========== 复选框样式 ========== */
.setting-checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 0;
  flex-wrap: wrap;
}

.setting-checkbox-wrap.vertical {
  flex-direction: column;
  gap: 6px;
  justify-content: flex-start;
  padding-top: 4px;
}

.setting-checkbox-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  background: var(--color-bg-input);
  border: 2px solid var(--color-border);
  position: relative;
}

.setting-checkbox-wrap input[type="checkbox"]:hover {
  border-color: var(--color-primary);
}

.setting-checkbox-wrap input[type="checkbox"]:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.setting-checkbox-wrap input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 4px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.setting-checkbox-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-weight: 400;
  line-height: 1.4;
}

/* ========== 跨列样式 ========== */
.simulation-setting-card.span-2-cols {
  grid-column: span 2;
}

.simulation-setting-card.span-3-cols {
  grid-column: span 3;
}

/* ========== 文件输入区域 ========== */
.file-input-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-input-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.file-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.file-input-wrapper .file-btn {
  flex-shrink: 0;
}

.file-drop-zone {
  flex: 1;
  min-width: 200px;
  padding: 14px 18px;
  background: var(--color-bg-input);
  border: 1.5px dashed var(--color-border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--color-text-muted);
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-drop-zone:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-alpha-5);
}

.file-drop-zone.has-file {
  color: var(--color-text-primary);
  border-color: var(--color-primary);
  border-style: solid;
  background: var(--color-primary-alpha-8);
}

.file-drop-zone.drag-over {
  border-color: var(--color-primary);
  border-style: solid;
  background: var(--color-primary-alpha-15);
  transform: scale(1.02);
}

.file-drop-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.file-drop-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text-secondary);
}

.file-btn:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-border-hover);
  color: var(--color-text-primary);
  transform: none;
  box-shadow: none;
}

.file-btn.primary {
  background: var(--color-primary);
  color: #ffffff;
  border: 1.5px solid var(--color-primary);
  box-shadow: none;
  font-weight: 500;
}

.file-btn.primary:hover {
  background: var(--color-primary-dark);
  color: #ffffff;
  border-color: var(--color-primary-dark);
  box-shadow: none;
  transform: none;
}

.file-btn.danger {
  color: var(--color-danger);
  border-color: var(--color-danger-alpha-30);
}

.file-btn.danger:hover {
  background: var(--color-danger-alpha-10);
  color: var(--color-danger);
  border-color: var(--color-danger-alpha-40);
  box-shadow: none;
}

.file-btn.success {
  color: var(--color-success);
  border-color: var(--color-success-alpha-30);
}

.file-btn.success:hover {
  background: var(--color-success-alpha-10);
  color: var(--color-success);
  border-color: var(--color-success-alpha-40);
  box-shadow: none;
}

/* ========== JSON 预览区域 ========== */
.json-preview-section {
  margin-top: 0;
}

.json-toggle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--color-border-light);
  gap: 16px;
}

.json-preview-toggle,
.json-toggle-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  padding: 14px 0;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: left;
  transition: all 0.2s ease;
}

.json-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.json-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text-secondary);
}

.json-action-btn:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-border-hover);
  color: var(--color-text-primary);
  transform: none;
  box-shadow: none;
}

.json-preview-toggle:hover,
.json-toggle-btn:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-border-light);
  transform: none;
  box-shadow: none;
}

.json-preview-toggle .toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--color-text-muted);
  background: transparent;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 10px;
  flex-shrink: 0;
}

.json-preview-toggle .toggle-icon.expanded {
  transform: rotate(180deg);
  color: var(--color-primary);
  background: var(--color-primary-alpha-10);
}

.json-preview-content {
  margin-top: 0;
  padding: 4px 16px;
  background: var(--color-bg-secondary);
  border: none;
  border-bottom: 1px solid var(--color-border-light);
  border-radius: 0;
  max-height: 350px;
  overflow-y: auto;
  animation: fadeSlideIn 0.25s ease;
}

.json-preview-content::-webkit-scrollbar {
  width: 6px;
}

.json-preview-content::-webkit-scrollbar-track {
  background: transparent;
}

.json-preview-content::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.json-preview-content.collapsed {
  display: none;
}

.json-preview-content pre {
  margin: 0;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 12px;
  color: var(--color-text-primary);
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
  background: var(--color-bg-input);
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--color-border-light);
}

/* ========== 底部按钮区域 ========== */
.simulation-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 20px 16px;
  border-top: none;
  background: var(--color-bg-secondary);
  margin: 0;
  border-radius: 0 0 16px 16px;
  gap: 12px;
}

.simulation-footer .footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.simulation-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text-secondary);
}

.simulation-reset-btn:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-border-hover);
  color: var(--color-text-primary);
  transform: none;
  box-shadow: none;
}

.simulation-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  letter-spacing: 0;
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: none;
}

.simulation-submit-btn::before {
  display: none;
}

.simulation-submit-btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: var(--color-primary-dark);
}

.simulation-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== 提示文本 ========== */
.setting-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* ============================================
   响应式左右 padding 系统
   设计原则：桌面端宽松，平板端适中，手机端紧凑
   ============================================ */

/* ========== 默认（桌面 1200px+）========== */
.simulation-submit-page {
  padding: 16px 28px;
}

.simulation-section-toggle {
  padding: 14px 28px;
}

.simulation-section-content {
  padding: 8px 28px;
}

.simulation-footer {
  padding: 20px 28px;
}

.json-toggle-header {
  padding: 0 28px;
}

.json-preview-content {
  padding: 8px 28px;
}

/* ========== 1400px+ 超大屏幕 ========== */
@media (min-width: 1400px) {
  .simulation-submit-page {
    padding: 20px 36px;
  }

  .simulation-section-toggle {
    padding: 16px 36px;
  }

  .simulation-section-content {
    padding: 12px 36px;
  }

  .simulation-footer {
    padding: 24px 36px;
  }

  .json-toggle-header {
    padding: 0 36px;
  }

  .json-preview-content {
    padding: 12px 36px;
  }
}

/* ========== 1200px 中等桌面 ========== */
@media (max-width: 1200px) {
  .simulation-submit-page {
    padding: 14px 20px;
  }

  .simulation-section-toggle {
    padding: 12px 20px;
  }

  .simulation-section-content {
    padding: 6px 20px;
  }

  .simulation-footer {
    padding: 16px 20px;
  }

  .json-toggle-header {
    padding: 0 20px;
  }

  .json-preview-content {
    padding: 6px 20px;
  }
}

/* ========== 1024px 平板横屏 ========== */
@media (max-width: 1024px) {
  .simulation-submit-page {
    padding: 12px 16px;
  }
}

/* ========== 768px 平板 ========== */
@media (max-width: 768px) {
  .simulation-submit-page {
    padding: 16px;
    gap: 20px;
  }

  .simulation-main-title {
    font-size: 24px;
  }

  .simulation-section-content {
    padding: 16px;
  }

  .simulation-settings-grid {
    gap: 16px;
  }

  .file-input-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .file-drop-zone {
    width: 100%;
  }

  .file-btn {
    justify-content: center;
  }

  .simulation-footer {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
  }

  .simulation-submit-btn {
    width: 100%;
    justify-content: center;
  }

  .simulation-main-card {
    border-radius: 12px;
  }
}

/* ========== 640px 手机 ========== */
@media (max-width: 640px) {
  .simulation-submit-page {
    padding: 14px 14px;
    gap: 16px;
  }

  .simulation-main-title {
    font-size: 20px;
  }

  .simulation-section-toggle {
    padding: 12px 14px;
    font-size: 14px;
  }

  .simulation-section-content {
    padding: 12px;
  }

  .simulation-settings-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .setting-slider-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .setting-slider-input {
    max-width: 100%;
    flex: none;
    text-align: left;
  }

  .simulation-footer {
    position: sticky;
    bottom: 0;
    background: var(--color-bg-secondary);
    z-index: 10;
  }
}

/* ========== 480px 小手机 ========== */
@media (max-width: 480px) {
  .simulation-submit-page {
    padding: 12px 12px;
    gap: 12px;
  }

  .simulation-section-toggle {
    padding: 10px 12px;
  }

  .simulation-section-content {
    padding: 10px;
  }
}

/* ========== 360px 超小手机 ========== */
@media (max-width: 360px) {
  .simulation-submit-page {
    padding: 10px 10px;
  }

  .simulation-section-toggle {
    padding: 8px 10px;
    font-size: 13px;
  }

  .simulation-section-content {
    padding: 8px;
  }
}

/* ========== 参数扫描样式 ========== */
.sweep-setting {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  grid-column: 1 / -1;
}

.sweep-param-section {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding-top: 12px;
  box-sizing: border-box;
}

.sweep-param-select {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

.sweep-label {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.sweep-select {
  flex: 1;
  min-width: 200px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-size: 14px;
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: auto;
}

.sweep-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.sweep-values-section {
  margin-top: 12px;
}

.sweep-value-input {
  margin-bottom: 12px;
}

.sweep-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sweep-input {
  flex: 1 1 150px;
  min-width: 100px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-size: 14px;
}

.sweep-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.btn-add-value {
  padding: 8px 16px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-add-value:hover {
  background: var(--color-primary-dark, #3a7bc8);
}

.sweep-values-list {
  background: var(--color-bg-secondary);
  border-radius: 6px;
  padding: 10px 12px;
}

.sweep-values-header {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.sweep-value-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sweep-value-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--color-text-primary);
}

.btn-remove-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: 50%;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-remove-value:hover {
  background: var(--color-danger, #dc3545);
  border-color: var(--color-danger, #dc3545);
  color: white;
}

/* ========== 指数输入模式切换 ========== */
.sweep-label-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: nowrap;
  gap: 16px;
}

.sweep-exponential-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--color-text-muted);
  transition: color 0.2s;
  white-space: nowrap;
}

.sweep-exponential-toggle:hover {
  color: var(--color-text-secondary);
}

.sweep-exponential-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}


