/* 
 * Claude Co-Desk - 组件样式文件
 * 移植自claudecodeui的组件样式
 */

/* 侧边栏样式 - 移植自Sidebar.jsx */
.sidebar {
  width: var(--sidebar-width);
  background: hsl(var(--card));
  border-right: 1px solid hsl(var(--border));
  display: flex;
  flex-direction: column;
  transition: transform 300ms ease-in-out;
  z-index: 40;
  /* 改善整体视觉效果 */
  box-shadow: 2px 0 8px -2px hsl(var(--border) / 0.1);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid hsl(var(--border));
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 32px;
  height: 32px;
  background: hsl(var(--primary));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon {
  width: 20px;
  height: 20px;
  color: hsl(var(--primary-foreground));
}

.logo-text {
  font-size: 18px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

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

/* 旧样式已删除，使用更高优先级的新样式 */

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* 抽屉区域样式 */
.drawer-section {
  margin-bottom: 16px;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 200ms ease;
  position: relative;
}

.drawer-header:hover {
  background: hsl(var(--accent));
  border-color: hsl(var(--primary) / 0.3);
  box-shadow: 0 2px 8px hsl(var(--primary) / 0.1);
}

.drawer-content-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.drawer-content-info h3 {
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0;
}

.item-count {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-actions button {
  padding: 6px;
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 150ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-actions button:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.agents-team-btn:hover {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.add-task-btn:hover, .new-project-btn:hover {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.expand-btn .expand-icon {
  transition: transform 200ms ease;
}

.drawer-section.expanded .expand-btn .expand-icon {
  transform: rotate(180deg);
}

.drawer-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 300ms ease, opacity 300ms ease, background-color 300ms ease, box-shadow 300ms ease;
}

.drawer-section.expanded .drawer-content {
  /* 使用一个CSS自定义属性来动态设置高度，通过JS计算实际内容高度 */
  max-height: var(--drawer-content-height, 500px);
  /* 如果只有少量内容，使用fit-content自动适应高度 */
  height: fit-content;
  min-height: fit-content;
  opacity: 1;
  margin-top: 8px;
  
  /* 抽屉视觉样式增强 */
  background: hsl(var(--background) / 0.5);
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  
  /* 内容自适应，不设置滚动条 */
  overflow: visible;
  
  /* 增强层次感 */
  backdrop-filter: blur(2px);
  position: relative;
}

/* 任务列表样式 */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0; /* 移除内边距，因为父级抽屉已有内边距 */
  background: transparent; /* 透明背景，避免与抽屉背景冲突 */
  border: none; /* 移除边框，因为父级抽屉已有边框 */
  border-radius: 0; /* 移除圆角，避免重复 */
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: all 200ms ease;
  font-size: 12px;
}

.task-item:hover {
  background: hsl(var(--accent));
  border-color: hsl(var(--primary) / 0.3);
}

.task-item.active {
  background: hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
}

.empty-tasks {
  text-align: center;
  padding: 20px;
  color: hsl(var(--muted-foreground));
}

.empty-tasks p {
  margin: 0 0 12px 0;
  font-size: 13px;
}

.create-first-task-btn {
  padding: 8px 16px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  transition: all 200ms ease;
}

.create-first-task-btn:hover {
  background: hsl(var(--primary) / 0.9);
}

/* 任务管理器仪表板样式 */
.task-manager-dashboard {
  width: 100%;
  height: 100%;
  background: hsl(var(--background));
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 24px;
  box-sizing: border-box;
}

/* Dashboard内容包装器 */
.dashboard-content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 900px;
  height: 100%;
  min-height: calc(100vh - 100px);
  position: relative;
}

.dashboard-welcome {
  text-align: center;
  margin: 0 auto 32px auto;
  max-width: 800px;
  width: 100%;
}

.dashboard-welcome h2 {
  font-size: 24px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0 0 12px 0;
}

.dashboard-welcome p {
  color: hsl(var(--muted-foreground));
  margin: 0;
}

.dashboard-content-wrapper .dashboard-grid {
  display: grid;
  grid-template-columns: 400px 400px 400px;
  gap: 24px;
  margin: 0 auto 32px auto;
  max-width: 1200px;
  width: 100%;
  justify-content: center;
}

@media (max-width: 1024px) {
  .dashboard-content-wrapper .dashboard-grid {
    grid-template-columns: 1fr;
    max-width: 600px;
  }
}

.dashboard-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 20px;
  transition: all 200ms ease;
  min-height: 320px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.dashboard-card:hover {
  box-shadow: 0 4px 12px hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary) / 0.3);
}

.dashboard-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: hsl(var(--foreground));
}

/* 应用卡片样式 */
.applications-overview-card {
  /* 继承基础dashboard-card样式 */
}

.applications-dashboard-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow: hidden;
}

.applications-content-wrapper {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.applications-loading,
.applications-empty {
  text-align: center;
  padding: 20px;
  color: hsl(var(--muted-foreground));
}

.applications-loading p,
.applications-empty p {
  margin: 0 0 8px 0;
  font-weight: 500;
}

.applications-loading small,
.applications-empty small {
  color: hsl(var(--muted-foreground) / 0.7);
}

.apps-section {
  margin-bottom: 16px;
}

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

.apps-section h6 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  gap: 8px;
}

.apps-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem; /* Updated gap spacing */
}

.app-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 12px;
  background: hsl(var(--muted) / 0.3);
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  transition: all 200ms ease;
}

.app-item:hover {
  background: hsl(var(--muted) / 0.5);
  border-color: hsl(var(--primary) / 0.3);
}

.app-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.app-name {
  font-size: 14px;
  font-weight: 500;
  color: hsl(var(--foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 应用启动按钮样式已移除，仅用于查看 */

.more-apps {
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  padding: 8px;
  font-style: italic;
}

.apps-management-tip {
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid hsl(var(--border));
  margin-top: auto;
}

.btn-link {
  background: none;
  border: none;
  color: hsl(var(--primary));
  cursor: pointer;
  font-size: 14px;
  text-decoration: underline;
  transition: color 200ms ease;
}

.btn-link:hover {
  color: hsl(var(--primary) / 0.8);
}

.dashboard-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  align-items: center;
}

.social-icons-container {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--border) / 0.3);
  width: 100%;
  max-width: 400px;
  display: flex;
  justify-content: center;
}

.dashboard-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 0;
}

/* 侧边栏创建任务按钮样式 */
.sidebar-create-task-btn {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: 2px solid hsl(var(--primary));
  border-radius: var(--radius);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
  box-shadow: 0 1px 3px hsl(var(--primary) / 0.2);
}

.sidebar-create-task-btn:hover {
  background: hsl(var(--primary) / 0.9);
  box-shadow: 0 2px 4px hsl(var(--primary) / 0.2);
}

.sidebar-create-task-btn:active {
  transform: translateY(1px);
}

.dashboard-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 200ms ease;
  text-decoration: none;
  color: hsl(var(--foreground));
}

.dashboard-action-btn:hover {
  background: hsl(var(--accent));
  border-color: hsl(var(--primary) / 0.3);
  box-shadow: 0 2px 8px hsl(var(--primary) / 0.1);
}

.dashboard-action-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--primary) / 0.1);
  border-radius: var(--radius);
  color: hsl(var(--primary));
}

.dashboard-action-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.dashboard-action-content h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: hsl(var(--foreground));
}

.dashboard-action-content p {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

.init-system-highlight {
  background: linear-gradient(135deg, hsl(var(--primary) / 0.1), hsl(var(--primary) / 0.05));
  border-color: hsl(var(--primary) / 0.5);
}

.init-system-highlight:hover {
  background: linear-gradient(135deg, hsl(var(--primary) / 0.15), hsl(var(--primary) / 0.1));
  border-color: hsl(var(--primary));
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-6px);
  }
  60% {
    transform: translateY(-3px);
  }
}

/* 初始化引导模态窗口样式 */
.init-guide-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.init-guide-content {
  background: white;
  border-radius: 12px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.init-guide-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  animation: pulseScale 2s ease-in-out infinite;
}

.init-guide-content h2 {
  color: #333;
  font-size: 24px;
  margin-bottom: 16px;
}

.init-guide-content p {
  color: #666;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 32px;
}

.init-guide-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.init-guide-btn {
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.init-guide-btn.primary {
  background: linear-gradient(135deg, #ff6b35, #ff8c42);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.init-guide-btn.primary:hover {
  background: linear-gradient(135deg, #ff5722, #ff6b35);
  box-shadow: 0 6px 16px rgba(255, 87, 34, 0.4);
  transform: translateY(-2px);
}

.init-guide-btn.secondary {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
}

.init-guide-btn.secondary:hover {
  background: #e9e9e9;
  color: #333;
}

@keyframes pulseScale {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .init-guide-content {
    padding: 24px;
    margin: 16px;
  }
  
  .init-guide-content h2 {
    font-size: 20px;
  }
  
  .init-guide-content p {
    font-size: 14px;
  }
  
  .init-guide-actions {
    flex-direction: column;
  }
}

/* 员工团队区域样式（保留用于弹窗） */
.employees-section {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid hsl(var(--border));
}

/* 智能体管理弹窗样式 */
.agents-modal .modal-content {
  width: 90%;
  max-width: 800px;
}

.agents-modal-content {
  min-height: 400px;
}

.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 16px 0;
}

.agent-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 16px;
  transition: all 200ms ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agent-card:hover {
  box-shadow: 0 4px 12px hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary) / 0.3);
}

.agent-avatar {
  font-size: 32px;
  text-align: center;
  padding: 8px;
  background: hsl(var(--accent));
  border-radius: var(--radius);
}

.agent-info {
  text-align: center;
}

.agent-name {
  font-size: 16px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 4px;
}

.agent-role {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.agent-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: hsl(var(--accent));
  border-radius: var(--radius);
}

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

.agent-actions .btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
}

/* 侧边栏任务列表样式优化 */
/* 重写侧边栏任务项的布局，覆盖全局的flex布局 */
.drawer-content .task-item {
  display: block !important;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}

.drawer-content .task-item .task-item-header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.drawer-content .task-item .task-name {
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--foreground));
  margin-bottom: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 12px;
  min-width: 0;
}

.drawer-content .task-item .task-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.drawer-content .task-item .task-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

.drawer-content .task-item .delete-task-btn {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.task-item .task-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: hsl(var(--muted-foreground));
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.pending {
  background: hsl(var(--muted-foreground));
}

.status-dot.active {
  background: hsl(142, 76%, 36%);
}

.status-dot.completed {
  background: hsl(221, 83%, 53%);
}

.view-more-tasks {
  padding: 8px;
  text-align: center;
  border-top: 1px solid hsl(var(--border));
  margin-top: 8px;
}

.view-more-btn {
  background: none;
  border: none;
  color: hsl(var(--primary));
  font-size: 11px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: all 150ms ease;
}

.view-more-btn:hover {
  background: hsl(var(--primary) / 0.1);
}

/* Dashboard stats样式 */
.system-status, .task-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-item, .stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.status-label {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}

.status-value {
  font-size: 13px;
  font-weight: 500;
}

.status-value.status-success {
  color: hsl(142, 76%, 36%);
}

.status-value.status-warning {
  color: hsl(45, 93%, 47%);
}

.stat-item {
  flex-direction: column;
  text-align: center;
  padding: 12px;
  background: hsl(var(--accent));
  border-radius: var(--radius);
}

.stat-number {
  font-size: 24px;
  font-weight: 600;
  color: hsl(var(--primary));
}

.stat-label {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin-top: 4px;
}

.employees-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.employee-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 200ms ease;
  position: relative;
}

.employee-item:hover {
  background: hsl(var(--accent));
  border-color: hsl(var(--primary) / 0.3);
  box-shadow: 0 2px 8px hsl(var(--primary) / 0.1);
}

.employee-item.active {
  background: hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 1px hsl(var(--primary) / 0.2);
}

.employee-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.employee-name {
  font-weight: 500;
  font-size: 13px;
  color: hsl(var(--foreground));
  margin-bottom: 2px;
}

.employee-role {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  line-height: 1.2;
}

.employee-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator.online {
  background: hsl(142, 76%, 36%);
  box-shadow: 0 0 0 2px hsl(142, 76%, 36% / 0.2);
}

.status-indicator.idle {
  background: hsl(45, 93%, 47%);
  box-shadow: 0 0 0 2px hsl(45, 93%, 47% / 0.2);
}

.status-indicator.offline {
  background: hsl(var(--muted-foreground));
  box-shadow: 0 0 0 2px hsl(var(--muted-foreground) / 0.2);
}

.status-indicator.working {
  background: hsl(221, 83%, 53%);
  box-shadow: 0 0 0 2px hsl(221, 83%, 53% / 0.2);
  animation: pulse-working 2s ease-in-out infinite alternate;
}

@keyframes pulse-working {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.status-text {
  font-size: 10px;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.daily-tasks-btn {
  padding: 4px;
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 150ms ease;
}

.daily-tasks-btn:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

/* 系统初始化提示 */
.system-init-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  background: hsl(var(--card));
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius);
  margin: 8px 0;
}

.system-init-prompt .icon {
  font-size: 24px;
  margin-bottom: 8px;
  color: hsl(var(--muted-foreground));
}

.system-init-prompt .title {
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--foreground));
  margin-bottom: 4px;
}

.system-init-prompt .description {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  margin-bottom: 12px;
  line-height: 1.4;
}

.init-system-btn {
  padding: 8px 16px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
}

.init-system-btn:hover {
  background: hsl(var(--primary) / 0.9);
}

.init-system-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 加载员工状态 */
.loading-employees {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

.loading-text {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  font-style: italic;
}

/* 系统初始化进度弹窗样式 */
.modal-content.large-modal {
  width: 95vw !important;
  max-width: 1200px !important;
  height: 85vh !important;
  max-height: 800px !important;
  display: flex !important;
  flex-direction: column !important;
}

.init-terminal-container {
  background: hsl(220, 13%, 18%);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 12px;
  height: 300px;
  overflow: hidden;
  margin-bottom: 20px;
}

.init-terminal {
  height: 100%;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.4;
  color: hsl(120, 100%, 75%);
  overflow-y: auto;
  white-space: pre-wrap;
  padding: 8px;
}

.init-progress {
  margin-bottom: 20px;
}

.progress-container {
  margin-bottom: 16px;
  padding: 0 4px;
}

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

.progress-bar {
  width: 100%;
  height: 8px;
  background: hsl(var(--muted));
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(221, 83%, 53%));
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

/* 终端输出样式 */
.init-terminal .success {
  color: hsl(120, 100%, 75%);
}

.init-terminal .error {
  color: hsl(0, 100%, 75%);
}

.init-terminal .warning {
  color: hsl(45, 100%, 75%);
}

.init-terminal .info {
  color: hsl(200, 100%, 75%);
}

.init-terminal .dim {
  color: hsl(var(--muted-foreground));
}

.projects-section {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.new-project-btn {
  padding: 4px;
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 150ms ease;
}

.new-project-btn:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0; /* 移除内边距，因为父级抽屉已有内边距 */
}

.project-item {
  position: relative;
  padding: 12px 16px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border) / 0.6);
  border-radius: calc(var(--radius) + 2px);
  cursor: pointer;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  /* 增强视觉层次 */
  box-shadow: 0 1px 3px 0 hsl(var(--border) / 0.1);
}

.project-item:hover {
  background: hsl(var(--accent) / 0.8);
  border-color: hsl(var(--accent-foreground) / 0.3);
  box-shadow: 0 2px 8px 0 hsl(var(--border) / 0.15);
  transform: translateY(-1px);
}

.project-item.active {
  background: hsl(var(--primary) / 0.08);
  border-color: hsl(var(--primary) / 0.3);
  box-shadow: 0 2px 8px 0 hsl(var(--primary) / 0.15);
  /* 添加左侧活跃指示条 */
}

.project-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: hsl(var(--primary));
  border-radius: 0 2px 2px 0;
}

.project-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.project-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: calc(var(--radius) - 1px);
  background: hsl(var(--muted) / 0.5);
  color: hsl(var(--muted-foreground));
  transition: all 150ms ease;
  flex-shrink: 0;
}

.project-item:hover .project-icon {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.project-item.active .project-icon {
  background: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
}

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

.project-name {
  font-weight: 600;
  font-size: 14px;
  color: hsl(var(--foreground));
  margin-bottom: 2px;
  line-height: 1.4;
  /* 确保长项目名能够正确截断 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-path {
  font-size: 11px;
  color: hsl(var(--muted-foreground) / 0.8);
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 150ms ease;
}

.project-item:hover .project-actions {
  opacity: 1;
}

.project-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: all 150ms ease;
  background: none;
  border: none;
}

.project-menu-btn:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

/* 会话列表样式 */
.sessions-list {
  margin-top: 8px;
  padding-left: 44px; /* 对齐项目图标 */
  border-left: 1px solid hsl(var(--border) / 0.3);
  margin-left: 16px;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 1px);
  cursor: pointer;
  transition: all 150ms ease;
  margin-bottom: 2px;
}

.session-item:hover {
  background: hsl(var(--accent) / 0.6);
}

.session-item.active {
  background: hsl(var(--primary) / 0.15);
  border: 1px solid hsl(var(--primary) / 0.3);
  color: hsl(var(--primary));
  box-shadow: 0 1px 3px hsl(var(--primary) / 0.1);
}

.session-icon {
  width: 16px;
  height: 16px;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
}

.session-item.active .session-icon {
  color: hsl(var(--primary));
}

.session-content {
  flex: 1;
  min-width: 0;
}

.session-title {
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--foreground));
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 主会话和子会话类型标识 */
.session-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 150ms ease;
}

.session-type-badge.primary {
  background: hsl(var(--primary) / 0.2);
  color: hsl(var(--primary));
  border: 1px solid hsl(var(--primary) / 0.3);
}

.session-type-badge.sub {
  background: hsl(var(--muted) / 0.5);
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

.session-item.active .session-type-badge.primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.session-item.active .session-type-badge.sub {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

/* 主会话和子会话样式差异 */
.session-item.primary-session {
  border-left: 2px solid hsl(var(--primary) / 0.4);
}

.session-item.sub-session {
  margin-left: 8px;
  opacity: 0.85;
  border-left: 2px solid hsl(var(--muted) / 0.4);
}

.session-time {
  font-size: 11px;
  color: hsl(var(--muted-foreground) / 0.7);
  line-height: 1.2;
}

/* 会话状态指示器 - 移植自claudecodeui */
.session-status {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.activity-indicator {
  width: 8px;
  height: 8px;
  background: #228B64; /* 深绿色主题 */
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.selected-indicator {
  width: 6px;
  height: 6px;
  background: hsl(var(--primary));
  border-radius: 50%;
  border: 1px solid hsl(var(--background));
}


/* 会话选中状态 */
.session-item.selected {
  background: hsl(var(--accent));
  border: 1px solid hsl(var(--primary) / 0.4);
  color: hsl(var(--accent-foreground));
}

.session-item.selected .session-icon {
  color: hsl(var(--primary));
}

.session-item.selected .session-title {
  font-weight: 600;
}

.session-item.connected {
  background: hsl(var(--accent) / 0.3);
  border: 1px solid hsl(var(--primary) / 0.2);
  border-left: 3px solid #228B64; /* 深绿色主题 - 连接状态左边框 */
}

.session-item.connected .session-icon {
  color: hsl(var(--primary));
}

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

/* 主内容区样式 */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 标签栏 */
.tab-bar {
  display: flex;
  background: hsl(var(--background));
  border-bottom: 1px solid hsl(var(--border));
  padding: 0 16px;
  height: var(--tab-bar-height);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px; /* 增加内边距，更大的点击区域 */
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  border-bottom: 3px solid transparent; /* 增加边框厚度 */
  border-radius: 6px 6px 0 0; /* 添加圆角 */
  transition: all 200ms ease;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  margin: 4px 2px 0 2px; /* 添加间距 */
}

.tab-btn:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--accent) / 0.6);
  transform: translateY(-1px); /* 微妙的上移效果 */
}

.tab-btn.active {
  color: hsl(var(--primary));
  background: hsl(var(--background)); /* 活跃背景 */
  border-bottom-color: hsl(var(--primary));
  font-weight: 600; /* 更粗的字体 */
  box-shadow: 0 -2px 8px hsl(var(--primary) / 0.15); /* 顶部阴影 */
  transform: translateY(-2px); /* 明显的上移效果 */
  z-index: 1; /* 确保在其他标签之上 */
}

.tab-btn.active::before {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 3px;
  background: hsl(var(--primary));
  border-radius: 2px 2px 0 0;
}

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

/* 内容面板 */
.content-panels {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.content-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease-in-out;
}

.content-panel.active {
  opacity: 1;
  pointer-events: auto;
}

/* 聊天界面样式 - 移植自ChatInterface.jsx */
.chat-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scroll-behavior: smooth;
}

.chat-message {
  margin-bottom: 16px;
}

.chat-message.user {
  display: flex;
  justify-content: flex-end;
}

.chat-message.assistant {
  display: flex;
  justify-content: flex-start;
}

.message-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.4;
}

.message-bubble.user {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-bottom-right-radius: 6px;
}

.message-bubble.assistant {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border-bottom-left-radius: 6px;
}

.message-time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
  text-align: right;
}

.chat-input-container {
  padding: 16px;
  background: hsl(var(--background));
  border-top: 1px solid hsl(var(--border));
}

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

.chat-input {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 12px 16px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: 20px;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: hsl(var(--foreground));
  transition: all 150ms ease;
}

.chat-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.chat-input::placeholder {
  color: hsl(var(--muted-foreground));
}

.send-btn {
  width: 40px;
  height: 40px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
  flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
  background: hsl(var(--primary) / 0.9);
  transform: scale(1.05);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* 文件面板样式 */
.files-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background));
}

.files-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.project-path-display {
  font-size: 12px;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  margin-left: 8px;
}

/* 视图模式切换器 */
.view-mode-toggle {
  display: flex;
  align-items: center;
}

.view-toggle-buttons {
  display: flex;
  background: hsl(var(--muted));
  border-radius: calc(var(--radius) - 1px);
  padding: 2px;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border: none;
  background: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  border-radius: calc(var(--radius) - 2px);
  transition: all 150ms ease;
}

.view-toggle-btn:hover {
  color: hsl(var(--foreground));
}

.view-toggle-btn.active {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 3px hsl(var(--border) / 0.3);
}

/* 文件树容器 */
.file-tree {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-tree-files {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* 表格视图样式 */
.file-tree-header {
  flex-shrink: 0;
  background: hsl(var(--background));
  border-bottom: 1px solid hsl(var(--border));
  z-index: 20;
  /* 增强边框和阴影确保视觉分离 */
  box-shadow: 0 2px 4px -1px hsl(var(--border) / 0.1);
}

.file-tree-row {
  display: grid;
  grid-template-columns: 1fr 80px 120px 80px;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  min-height: 36px;
  border-radius: calc(var(--radius) - 1px);
  transition: all 150ms ease;
  cursor: pointer;
}

.file-tree-row:hover {
  background: hsl(var(--accent) / 0.6);
}

.file-tree-row.header-row {
  cursor: default;
  font-weight: 600;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px;
  background: hsl(var(--muted) / 0.3);
  border-radius: 0;
}

.file-tree-row.header-row:hover {
  background: hsl(var(--muted) / 0.3);
}

/* 表格列样式 */
.file-name-col {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.file-size-col {
  text-align: right;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
}

.file-modified-col {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.file-permissions-col {
  text-align: center;
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
}

/* 文件项基础样式 */
.file-item {
  border-radius: calc(var(--radius) - 1px);
  transition: all 150ms ease;
  margin-bottom: 1px;
}

.file-item:hover {
  background: hsl(var(--accent) / 0.6);
}

/* 详细视图项 */
.detailed-item {
  /* 继承基础样式 */
}

/* 简单视图项 */
.simple-item .file-item-content {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  cursor: pointer;
}

/* 紧凑视图项 */
.compact-item .file-item-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  cursor: pointer;
}

.file-main-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.file-meta-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

/* 文件图标样式 */
.file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
}

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

/* 文件名样式 */
.file-name {
  font-size: 14px;
  color: hsl(var(--foreground));
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* 文件大小样式 */
.file-size {
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

/* 空状态 */
.file-tree-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: hsl(var(--muted-foreground));
  height: 100%;
}

.file-tree-empty .empty-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.file-tree-empty h4 {
  font-size: 16px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 8px;
}

.file-tree-empty p {
  font-size: 14px;
  opacity: 0.8;
}

/* 加载状态 */
.file-tree-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  height: 100%;
}

.file-tree-loading .spinner {
  width: 32px;
  height: 32px;
  margin-bottom: 16px;
}

/* 文件编辑器模态框样式 */
.file-editor-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-editor-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(2px);
}

.file-editor-container {
  position: relative;
  width: 90vw;
  height: 80vh;
  max-width: 1200px;
  max-height: 800px;
  background: #ffffff !important; /* 强制设置亮色主题背景 */
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #f9fafb !important; /* 强制设置亮色主题头部背景 */
  border-bottom: 1px solid #e5e7eb !important;
  flex-shrink: 0;
}

.file-editor-title {
  flex: 1;
  min-width: 0;
}

.file-editor-title .file-name {
  font-size: 16px;
  font-weight: 600;
  color: #111827 !important; /* 强制设置深色文字 */
  display: block;
  line-height: 1.4;
}

.file-editor-title .file-path {
  font-size: 12px;
  color: #6b7280 !important; /* 强制设置中等色彩文字 */
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  line-height: 1.3;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-type-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* 暗色主题下的标题样式 */
.dark .file-editor-title .file-name {
  color: #f9fafb !important;
}

.dark .file-editor-title .file-path {
  color: #d1d5db !important;
}

.file-editor-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.file-editor-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.file-editor-textarea {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  padding: 20px;
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  font-size: 14px;
  line-height: 1.6;
  background: #ffffff !important; /* 强制设置亮色主题背景 */
  color: #000000 !important; /* 强制设置黑色文字 */
  tab-size: 4;
  white-space: pre;
  overflow: auto;
}

.file-editor-textarea::placeholder {
  color: hsl(var(--muted-foreground) / 0.7);
}

.file-editor-textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px hsl(var(--ring) / 0.2);
}

/* 暗色主题下的编辑器优化 */
.dark .file-editor-textarea {
  background: #1f2937 !important; /* 强制设置暗色主题背景 */
  color: #f9fafb !important; /* 强制设置浅色文字 */
}

.dark .file-editor-container {
  background: #111827 !important; /* 强制设置暗色主题背景 */
  border-color: #374151 !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8) !important;
}

.dark .file-editor-header {
  background: #1f2937 !important;
  border-color: #374151 !important;
}

.dark .file-editor-textarea::placeholder {
  color: #9ca3af !important;
}

/* 代码语法高亮基础样式 - 简化版 */
.file-editor-textarea {
  /* 基础代码样式 */
  font-variant-ligatures: none;
  font-feature-settings: normal;
}

/* 语法高亮容器样式 */
.syntax-highlight-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.syntax-highlighted .file-editor-textarea {
  /* 当启用语法高亮时，隐藏原生文本颜色 */
  color: transparent;
  caret-color: hsl(var(--foreground));
}

.syntax-highlight-layer {
  /* 高亮层样式 */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  white-space: pre-wrap;
  word-wrap: break-word;
  z-index: 1;
}

.syntax-highlight-layer pre {
  margin: 0;
  padding: 20px;
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  font-size: 14px;
  line-height: 1.6;
  background: transparent;
  border: none;
  overflow: visible;
}

.syntax-highlight-layer code {
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  padding: 0;
}

/* Prism.js主题覆盖 */
.syntax-highlight-layer .token.comment,
.syntax-highlight-layer .token.prolog,
.syntax-highlight-layer .token.doctype,
.syntax-highlight-layer .token.cdata {
  color: #8e908c;
}

.syntax-highlight-layer .token.punctuation {
  color: #c5c8c6;
}

.syntax-highlight-layer .token.property,
.syntax-highlight-layer .token.tag,
.syntax-highlight-layer .token.boolean,
.syntax-highlight-layer .token.number,
.syntax-highlight-layer .token.constant,
.syntax-highlight-layer .token.symbol,
.syntax-highlight-layer .token.deleted {
  color: #de935f;
}

.syntax-highlight-layer .token.selector,
.syntax-highlight-layer .token.attr-name,
.syntax-highlight-layer .token.string,
.syntax-highlight-layer .token.char,
.syntax-highlight-layer .token.builtin,
.syntax-highlight-layer .token.inserted {
  color: #b5bd68;
}

.syntax-highlight-layer .token.operator,
.syntax-highlight-layer .token.entity,
.syntax-highlight-layer .token.url,
.syntax-highlight-layer .language-css .token.string,
.syntax-highlight-layer .style .token.string {
  color: #8abeb7;
}

.syntax-highlight-layer .token.keyword,
.syntax-highlight-layer .token.atrule,
.syntax-highlight-layer .token.attr-value {
  color: #b294bb;
}

.syntax-highlight-layer .token.function,
.syntax-highlight-layer .token.class-name {
  color: #f0c674;
}

/* 图片查看器样式 */
.image-viewer-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.image-viewer-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-viewer-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.image-viewer-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 150ms ease;
}

.image-viewer-close:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

/* 响应式优化 */
@media (max-width: 768px) {
  .file-editor-container {
    width: 95vw;
    height: 85vh;
    margin: 20px;
  }
  
  .file-editor-header {
    padding: 12px 16px;
  }
  
  .file-editor-title .file-name {
    font-size: 14px;
  }
  
  .file-editor-title .file-path {
    font-size: 11px;
  }
  
  .file-editor-textarea {
    padding: 16px;
    font-size: 13px;
  }
  
  .image-viewer-close {
    top: -40px;
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

/* 终端样式 - 移植自Shell.jsx */
.terminal-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #fff;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: hsl(var(--card));
  border-bottom: 1px solid hsl(var(--border));
}

.terminal-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

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

/* xterm.js 终端容器样式 - 支持固定宽度和水平滚动 */
.terminal-wrapper {
  flex: 1;
  padding: 0;
  background: #000;
  overflow: auto; /* 允许水平和垂直滚动 */
  position: relative;
  min-width: 100%;
}

/* xterm.js 自定义样式 - 固定宽度支持 */
.terminal-wrapper .xterm {
  height: 100% !important;
  padding: 8px;
  min-width: 1200px; /* 为120列设置最小宽度 */
}

.terminal-wrapper .xterm .xterm-viewport {
  overflow: auto !important; /* 允许双向滚动 */
}

.terminal-wrapper .xterm .xterm-screen {
  outline: none !important;
}

/* 移除xterm.js默认的focus outline */
.terminal-wrapper .xterm:focus .xterm-screen {
  outline: none !important;
}

/* 兼容旧的terminal-output样式 */
.terminal-output {
  flex: 1;
  padding: 16px;
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  font-size: 13px;
  line-height: 1.4;
  overflow-y: auto;
  background: #000;
  color: #fff;
}

/* 输入指示器动画 */
.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: hsl(var(--muted-foreground));
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  40% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* 空状态样式 */
.empty-state, .error-state {
  padding: 40px 20px;
  text-align: center;
  color: hsl(var(--muted-foreground));
}

.empty-message, .error-message {
  font-size: 16px;
  margin-bottom: 8px;
}

.empty-hint {
  font-size: 14px;
  opacity: 0.8;
}

/* 项目列表间距 */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 滚动条样式已移至全局 main.css */

/* 移动端响应式 */
@media (max-width: 767px) {
  .sidebar {
    position: fixed;
    top: var(--mobile-header-height);
    left: 0;
    height: calc(100vh - var(--mobile-header-height));
    transform: translateX(-100%);
    z-index: 50;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-overlay {
    position: fixed;
    top: var(--mobile-header-height);
    left: 0;
    width: 100vw;
    height: calc(100vh - var(--mobile-header-height));
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease-in-out;
  }
  
  .sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }
  
  .main-content {
    width: 100%;
  }
  
  .message-bubble {
    max-width: 85%;
  }
  
  .tab-bar {
    padding: 0 12px;
  }
  
  .tab-btn {
    padding: 0 12px;
    font-size: 13px;
  }
  
  .chat-input-container {
    padding: 12px;
  }
  
  .chat-messages {
    padding: 12px;
  }
}

/* 工具消息样式 */
.message-bubble.tool-use {
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.tool-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: hsl(var(--muted));
  border-bottom: 1px solid hsl(var(--border));
  font-weight: 500;
}

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

.tool-name {
  color: hsl(var(--foreground));
  font-family: var(--font-mono);
}

.tool-status {
  margin-left: auto;
  font-size: 14px;
}

.tool-status.tool-success {
  color: hsl(var(--success-foreground, 22 163 74));
}

.tool-status.tool-error {
  color: hsl(var(--destructive-foreground));
}

.tool-input {
  margin: 0;
  border-bottom: 1px solid hsl(var(--border));
}

.tool-input summary {
  padding: 8px 16px;
  background: hsl(var(--muted));
  cursor: pointer;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}

.tool-input summary:hover {
  background: hsl(var(--accent));
}

.tool-input-content {
  padding: 12px 16px;
  margin: 0;
  background: hsl(var(--card));
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-x: auto;
  border: none;
}

.tool-result {
  padding: 0;
}

.tool-result-content {
  padding: 12px 16px;
}

.tool-result-preview {
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: pre-wrap;
}

.result-truncated {
  margin-top: 8px;
  padding: 6px 12px;
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  font-size: 12px;
  border-radius: var(--radius);
}

.file-content {
  margin: 0;
  padding: 12px;
  background: hsl(var(--card));
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-x: auto;
  border-radius: var(--radius);
}

.bash-output {
  margin: 0;
  padding: 12px;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-x: auto;
  border-radius: var(--radius);
}

.json-result {
  margin: 0;
  padding: 12px;
  background: hsl(var(--card));
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-x: auto;
  border-radius: var(--radius);
}

.tool-result-long {
  font-size: 13px;
}

.result-preview {
  font-family: var(--font-mono);
  white-space: pre-wrap;
  margin-bottom: 8px;
}

.result-expand {
  margin: 0;
}

.result-expand summary {
  padding: 6px 12px;
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  cursor: pointer;
  font-size: 12px;
  border-radius: var(--radius);
}

.result-expand summary:hover {
  background: hsl(var(--accent));
  opacity: 0.8;
}

.result-full {
  margin: 8px 0 0 0;
  padding: 12px;
  background: hsl(var(--card));
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-x: auto;
  border-radius: var(--radius);
}

.tool-result-text {
  margin: 0;
  padding: 12px;
  background: hsl(var(--card));
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: pre-wrap;
  border-radius: var(--radius);
}

.todo-success {
  padding: 8px 12px;
  background: hsl(var(--success, 22 163 74) / 0.1);
  color: hsl(var(--success-foreground, 22 163 74));
  border-radius: var(--radius);
  font-weight: 500;
}

/* 终端会话状态样式 */
.terminal-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-header h3::before {
  content: "💻";
  font-size: 16px;
}

/* 当有活跃会话时的状态指示 */
.terminal-header.has-session h3::before {
  content: "🔄";
  animation: pulse 2s ease-in-out infinite;
}

.terminal-header.connected h3::before {
  content: "✅";
  animation: none;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* 终端输出中的会话切换消息样式 */
.terminal-output {
  font-family: var(--font-mono);
  line-height: 1.4;
}

.session-switch-message {
  color: hsl(var(--primary));
  font-weight: 500;
  border-left: 3px solid hsl(var(--primary));
  padding-left: 8px;
  margin: 4px 0;
}

/* 终端主题切换按钮样式 - 强制应用样式 */
.session-actions #terminal-theme-toggle {
  background: rgba(156, 163, 175, 0.4) !important;
  border: 1px solid rgba(0, 0, 0, 0.4) !important;
  color: #374151 !important;
}

.session-actions #terminal-theme-toggle:hover {
  background: rgba(59, 130, 246, 0.25) !important;
  border-color: rgba(59, 130, 246, 0.6) !important;
  color: rgb(59, 130, 246) !important;
  transform: translateY(-1px) scale(1.02) !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
}

/* 明亮模式激活状态 */
.session-actions #terminal-theme-toggle.theme-active {
  background: rgba(59, 130, 246, 0.15) !important;
  border-color: rgba(59, 130, 246, 0.4) !important;
  color: rgb(59, 130, 246) !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
}

/* 主题图标切换动画 */
.terminal-theme-icon .sun-icon,
.terminal-theme-icon .moon-icon {
  transition: all 300ms ease;
  transform-origin: center;
}

/* 暗色模式状态 (默认) */
.terminal-theme-dark .sun-icon {
  display: block;
  opacity: 1;
}

.terminal-theme-dark .moon-icon {
  display: none !important;
  opacity: 0;
}

/* 明亮模式状态 */
.terminal-theme-light .sun-icon {
  display: none !important;
  opacity: 0;
}

.terminal-theme-light .moon-icon {
  display: block !important;
  opacity: 1;
}

/* 终端明亮主题样式 */
.session-terminal-wrapper.terminal-light-theme .xterm {
  background: #ffffff !important;
}

.session-terminal-wrapper.terminal-light-theme .xterm .xterm-viewport {
  background: #ffffff !important;
}

.session-terminal-wrapper.terminal-light-theme .xterm .xterm-screen {
  background: #ffffff !important;
}

/* 确保xterm.js容器在明亮模式下的样式 */
.session-terminal-wrapper.terminal-light-theme {
  background: #ffffff !important;
}

/* 明亮模式下的终端包装器样式 */
.terminal-container.terminal-light-theme {
  background: #ffffff !important;
  color: #000000 !important;
}

.terminal-container.terminal-light-theme .terminal-wrapper {
  background: #ffffff !important;
}

/* 明亮主题下的文字颜色修复 - 解决白色文字在白色背景下不可见的问题 */
.session-terminal-wrapper.terminal-light-theme .xterm .xterm-rows span[style*="color:#ffffff"],
.session-terminal-wrapper.terminal-light-theme .xterm .xterm-rows span[style*="color: rgb(255, 255, 255)"],
.session-terminal-wrapper.terminal-light-theme .xterm .xterm-rows span[style*="color: #ffffff"],
.session-terminal-wrapper.terminal-light-theme .xterm .xterm-rows span[style*="color:rgb(255,255,255)"] {
  color: #000000 !important;
}

/* 修复明亮主题下其他可能的白色文字问题 */
.session-terminal-wrapper.terminal-light-theme .xterm .xterm-rows span[style*="color: white"] {
  color: #000000 !important;
}

/* 确保明亮主题下cursor和selection的可见性 */
.session-terminal-wrapper.terminal-light-theme .xterm .xterm-cursor-layer .xterm-cursor {
  background-color: #000000 !important;
  color: #ffffff !important;
}

/* 移动端主题切换按钮响应式优化 */
@media (max-width: 767px) {
  #terminal-theme-toggle {
    padding: 6px;
  }
  
  .terminal-theme-icon {
    width: 18px;
    height: 18px;
  }
  
  /* 移动端session-actions间距优化 */
  .session-actions {
    gap: 6px;
  }
  
  .session-actions .action-btn {
    min-width: 32px;
    min-height: 32px;
  }
}

/* 终端session-actions按钮超高优先级修复 - 对抗session_mode.css的覆盖 */

/* 容器样式 - 高权重选择器 */
div.session-header div.session-actions {
  background: rgba(0, 0, 0, 0.05) !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  border-radius: 8px !important;
  padding: 4px !important;
  backdrop-filter: blur(8px) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
}

/* 通用按钮样式 - 覆盖session_mode.css的background:none */
div.session-header div.session-actions button.action-btn {
  background: #1e40af !important;
  border: 1px solid #1d4ed8 !important;
  color: white !important;
  padding: 8px !important;
  border-radius: 6px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  cursor: pointer !important;
}

/* 通用按钮悬停效果 */
div.session-header div.session-actions button.action-btn:hover {
  background: #2563eb !important;
  border-color: #3b82f6 !important;
  color: white !important;
  transform: translateY(-1px) scale(1.05) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4) !important;
}

/* ID选择器 - 最高权重：主题切换按钮 */
#terminal-theme-toggle {
  background: #f59e0b !important;
  border: 1px solid #d97706 !important;
  color: white !important;
  padding: 8px !important;
  border-radius: 6px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  cursor: pointer !important;
}

#terminal-theme-toggle:hover {
  background: #ea580c !important;
  border-color: #dc2626 !important;
  color: white !important;
  transform: translateY(-1px) scale(1.05) !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4) !important;
}

#terminal-theme-toggle.theme-active {
  background: #10b981 !important;
  border-color: #059669 !important;
  color: white !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3) !important;
}

/* ID选择器：文件按钮 */
#files-drawer-btn {
  background: #7c3aed !important;
  border: 1px solid #6d28d9 !important;
  color: white !important;
  padding: 8px !important;
  border-radius: 6px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  cursor: pointer !important;
}

#files-drawer-btn:hover {
  background: #8b5cf6 !important;
  border-color: #a855f7 !important;
  transform: translateY(-1px) scale(1.05) !important;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4) !important;
}

/* ID选择器：设置按钮 */
#session-settings {
  background: #1e40af !important;
  border: 1px solid #1d4ed8 !important;
  color: white !important;
  padding: 8px !important;
  border-radius: 6px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  cursor: pointer !important;
}

#session-settings:hover {
  background: #2563eb !important;
  border-color: #3b82f6 !important;
  color: white !important;
  transform: translateY(-1px) scale(1.05) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4) !important;
}

/* 确保SVG图标显示 */
#terminal-theme-toggle svg,
#files-drawer-btn svg, 
#session-settings svg {
  width: 16px !important;
  height: 16px !important;
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 2 !important;
}

/* Mobile Test Drawer Button Styles */
#mobile-test-drawer-btn {
  width: 32px !important;
  height: 32px !important;
  background: #059669 !important;
  border: 1px solid #047857 !important;
  color: white !important;
  padding: 0 !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#mobile-test-drawer-btn:hover {
  background: #10b981 !important;
  border-color: #34d399 !important;
  transform: translateY(-1px) scale(1.05) !important;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4) !important;
}

#mobile-test-drawer-btn.active {
  background: #065f46 !important;
  border-color: #047857 !important;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3) !important;
}

#mobile-test-drawer-btn svg {
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 2 !important;
}

/* Mobile Test Drawer Content Styles */
.mobile-test-form {
  padding: 16px;
  max-width: 100%;
}

.mobile-test-form .test-section {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid hsl(var(--border));
}

.mobile-test-form .test-section h4 {
  font-size: 16px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 8px;
}

.mobile-test-form .test-description {
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

.mobile-test-form .form-group {
  margin-bottom: 16px;
}

.mobile-test-form .form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: hsl(var(--foreground));
  margin-bottom: 6px;
}

.mobile-test-form .form-group label .required {
  color: #dc2626;
  margin-left: 4px;
}

.mobile-test-form .form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  font-size: 14px;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mobile-test-form .form-control:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}

.mobile-test-form .form-control::placeholder {
  color: hsl(var(--muted-foreground));
}

.mobile-test-form .form-check {
  margin-bottom: 8px;
}

.mobile-test-form .form-check-input {
  margin-right: 8px;
}

.mobile-test-form .form-check-label {
  font-size: 14px;
  color: hsl(var(--foreground));
  cursor: pointer;
}

.mobile-test-form .notification-options {
  padding-left: 16px;
}

.mobile-test-form .notification-methods {
  margin-top: 8px;
  padding-left: 16px;
}

.mobile-test-form .form-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.mobile-test-form .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.2s ease;
  text-decoration: none;
}

.mobile-test-form .btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.mobile-test-form .btn-primary:hover {
  background: hsl(var(--primary) / 0.9);
}

.mobile-test-form .btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--secondary));
}

.mobile-test-form .btn-secondary:hover {
  background: hsl(var(--secondary) / 0.8);
}

.mobile-test-form .btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

.mobile-test-form .btn-outline-primary {
  background: transparent;
  color: hsl(var(--primary));
  border-color: hsl(var(--primary));
}

.mobile-test-form .btn-outline-primary:hover {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.mobile-test-form .btn-outline-secondary {
  background: transparent;
  color: hsl(var(--muted-foreground));
  border-color: hsl(var(--border));
}

.mobile-test-form .btn-outline-secondary:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

/* Test Results Styles */
.test-results {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid hsl(var(--border));
}

.test-results h4 {
  font-size: 16px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 12px;
}

.test-output {
  background: hsl(var(--muted));
  border-radius: 6px;
  padding: 16px;
  border: 1px solid hsl(var(--border));
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
}

.loading-state .spinner {
  width: 24px;
  height: 24px;
  border: 2px solid hsl(var(--border));
  border-top: 2px solid hsl(var(--primary));
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-state p {
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

.success-result {
  color: hsl(var(--foreground));
}

.success-result h5 {
  color: #059669;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.result-details {
  margin-bottom: 16px;
}

.result-details p {
  font-size: 14px;
  margin: 4px 0;
}

.result-details strong {
  color: hsl(var(--foreground));
}

.result-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.error-result {
  color: hsl(var(--foreground));
}

.error-result h5 {
  color: hsl(var(--destructive));
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.error-details {
  font-size: 14px;
}

.error-details p {
  margin: 4px 0;
}

/* 每日任务管理模态框样式 */
.tasks-list-section {
  margin-bottom: 24px;
}

.tasks-list-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid hsl(var(--border));
}

.tasks-list-section h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.tasks-list {
  min-height: 120px;
}

.empty-tasks {
  text-align: center;
  padding: 40px 20px;
  color: hsl(var(--muted-foreground));
}

/* 通用文本静音样式 */
.text-muted {
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  opacity: 0.8;
}

.empty-tasks .text-muted {
  font-size: 14px;
  opacity: 0.7;
  margin-top: 8px;
}

.task-item {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  background: hsl(var(--card));
}

.task-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.task-item-title {
  font-weight: 600;
  margin: 0;
  color: hsl(var(--foreground));
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.task-item-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-status-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.task-status-badge.enabled {
  background: hsl(142, 76%, 36%);
  color: white;
}

.task-status-badge.disabled {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.task-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  margin-bottom: 8px;
}

.task-item-goal {
  font-size: 14px;
  line-height: 1.4;
  color: hsl(var(--foreground));
  margin-bottom: 12px;
}

.task-item-resources {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin-bottom: 12px;
}

.task-item-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* 新增任务表单样式 */
.add-task-form {
  border-top: 1px solid hsl(var(--border));
  padding-top: 24px;
  margin-top: 24px;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.form-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.btn-link {
  background: none;
  border: none;
  color: hsl(var(--primary));
  cursor: pointer;
  text-decoration: underline;
  font-size: 14px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: hsl(var(--foreground));
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsla(var(--primary) / 0.2);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* Toggle Switch 现代开关样式 */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.switch-container {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch-container input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: hsl(var(--muted));
  transition: all 0.3s ease;
  border-radius: 24px;
  border: 1px solid hsl(var(--border));
  z-index: 1;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: all 0.3s ease;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.switch-container input:checked + .switch-slider {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
}

.switch-container input:checked + .switch-slider:before {
  transform: translateX(20px);
}

.switch-container input:focus + .switch-slider {
  box-shadow: 0 0 0 2px hsla(var(--primary) / 0.2);
}

.switch-container input:disabled + .switch-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.switch-label {
  font-size: 14px;
  font-weight: 500;
  color: hsl(var(--foreground));
  cursor: pointer;
  user-select: none;
}

.switch-description {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
  line-height: 1.3;
}

/* Dark mode 适配 */
@media (prefers-color-scheme: dark) {
  .switch-slider:before {
    background-color: hsl(var(--card));
  }
}

.radio-group {
  display: flex;
  gap: 16px;
}

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

.radio-item input[type="radio"] {
  width: 16px;
  height: 16px;
}

/* 资源选择器样式 */
.resource-selector {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 12px;
  background: hsl(var(--card));
}

.resource-list {
  min-height: 60px;
  margin-bottom: 12px;
}

.resource-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: hsl(var(--accent));
  border-radius: var(--radius);
  margin-bottom: 4px;
  font-size: 14px;
}

.resource-item .resource-path {
  flex: 1;
  font-family: monospace;
}

.resource-item .remove-resource {
  background: none;
  border: none;
  color: hsl(var(--destructive));
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 2px;
}

.resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.manual-path {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  min-width: 250px;
}

.manual-path .form-control {
  flex: 1;
}

.schedule-input {
  display: flex;
  gap: 12px;
  align-items: center;
}

.schedule-input select,
.schedule-input input[type="time"] {
  padding: 6px 8px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid hsl(var(--border));
}

.btn-outline {
  background: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}

.btn-outline:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

/* 任务页签样式 */
.session-tab.task-tab {
  border-left: 3px solid hsl(142, 76%, 36%);
  background: linear-gradient(45deg, hsla(142, 76%, 36%, 0.1), transparent);
}

.session-tab.task-tab:hover {
  background: linear-gradient(45deg, hsla(142, 76%, 36%, 0.2), hsl(var(--accent)));
}

.session-tab.task-tab.active {
  background: linear-gradient(45deg, hsla(142, 76%, 36%, 0.15), hsl(var(--accent)));
  border-left-color: hsl(142, 76%, 30%);
}

.session-tab.task-tab .session-tab-title::before {
  content: "";
  margin-right: 0px;
}

/* 强制CSS更新 - 时间戳: 2025-01-15-17:30 */
/* 确保按钮可见性修复已应用 */

/* ========== 任务管理分栏布局样式 ========== */

/* 主布局容器 */
.tasks-management-layout {
  display: flex;
  height: 100%;
  gap: 1px;
  background: hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

/* 左侧任务列表面板 */
.tasks-list-panel {
  width: 360px;
  background: hsl(var(--background));
  display: flex;
  flex-direction: column;
}

.tasks-list-panel .panel-header {
  padding: 16px;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: hsl(var(--muted) / 0.3);
}

.tasks-list-panel .panel-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.tasks-list-panel .tasks-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* 任务列表项 */
.task-item {
  padding: 12px;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 1px);
  cursor: pointer;
  transition: all 150ms ease;
  margin-bottom: 4px;
}

.task-item:hover {
  background: hsl(var(--accent) / 0.6);
  border-color: hsl(var(--border));
}

.task-item.selected {
  background: hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary) / 0.3);
  box-shadow: 0 1px 3px hsl(var(--primary) / 0.1);
}

.task-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.task-item-name {
  font-weight: 500;
  font-size: 14px;
  color: hsl(var(--foreground));
  flex: 1;
  margin-right: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}

.task-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-item-status {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.task-item-status.running {
  background: hsl(var(--primary) / 0.2);
  color: hsl(var(--primary));
}

.task-item-status.scheduled {
  background: hsl(120, 50%, 25% / 0.2);
  color: hsl(120, 50%, 40%);
}

.task-item-status.completed {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

/* 状态信息容器样式 */
.status-info-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-item {
  display: flex;
  align-items: center;
}

.status-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-option {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 500;
  border-radius: 3px;
  white-space: nowrap;
}

.status-option.auto-mode {
  background: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
  border: 1px solid hsl(var(--primary) / 0.3);
}

.status-option.verbose-logs {
  background: hsl(220, 50%, 50% / 0.15);
  color: hsl(220, 50%, 45%);
  border: 1px solid hsl(220, 50%, 50% / 0.3);
}

.delete-task-btn {
  background: none;
  border: none;
  padding: 4px;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  border-radius: 4px;
  opacity: 0.7;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-task-btn:hover {
  color: hsl(var(--destructive));
  background: hsl(var(--destructive) / 0.1);
  opacity: 1;
}

.delete-task-btn svg {
  width: 14px;
  height: 14px;
}

/* 危险按钮样式 */
.btn-danger {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  border: 1px solid hsl(var(--destructive));
}

.btn-danger:hover {
  background: hsl(var(--destructive) / 0.9);
  border-color: hsl(var(--destructive) / 0.9);
}

.task-item-goal {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.task-item-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

/* 空状态 */
.empty-tasks {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: hsl(var(--muted-foreground));
}

.empty-tasks .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* 右侧详情面板 */
.task-detail-panel {
  flex: 1;
  background: hsl(var(--background));
  display: flex;
  flex-direction: column;
}

/* 详情空状态 */
.detail-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  text-align: center;
  color: hsl(var(--muted-foreground));
}

.detail-empty-state .empty-icon {
  font-size: 64px;
  margin-bottom: 24px;
  opacity: 0.3;
}

.detail-empty-state h4 {
  margin: 0 0 12px 0;
  color: hsl(var(--foreground));
}

.detail-empty-state p {
  margin: 0;
  line-height: 1.5;
}

/* 任务详情视图 */
.task-detail-view {
  padding: 20px;
  height: 100%;
  overflow-y: auto;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid hsl(var(--border));
}

.detail-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

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

.detail-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-item label {
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value {
  color: hsl(var(--foreground));
  line-height: 1.5;
}

.detail-value.code {
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  font-size: 13px;
  background: hsl(var(--muted));
  padding: 8px 12px;
  border-radius: calc(var(--radius) - 1px);
  border: 1px solid hsl(var(--border));
}

/* 任务表单样式 */
.add-task-form {
  padding: 20px;
  height: 100%;
  overflow-y: auto;
}

/* 独立弹框中的表单样式 */
.standalone-form {
  padding: 20px;
  overflow: visible;
  height: auto;
}

.add-task-form .form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid hsl(var(--border));
}

.add-task-form .form-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.add-task-form .form-section {
  margin-bottom: 32px;
}

.add-task-form .form-section h5 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--foreground));
  padding-bottom: 8px;
  border-bottom: 1px solid hsl(var(--border) / 0.3);
}

.add-task-form .form-group {
  margin-bottom: 20px;
}

.add-task-form .form-actions {
  padding-top: 20px;
  border-top: 1px solid hsl(var(--border));
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* 资源选择器优化 */
.resource-help {
  margin-bottom: 12px;
}

.resource-help p {
  margin: 0;
  font-size: 13px;
}

.resource-selector {
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 1px);
  background: hsl(var(--background));
}

.resource-list {
  min-height: 80px;
  padding: 12px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.1);
}

.resource-list:empty::after {
  content: '暂无资源文件';
  display: block;
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  padding: 20px 0;
  font-style: italic;
}

.resource-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  margin-bottom: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.resource-add-methods {
  padding: 16px;
}

.add-method-group {
  margin-bottom: 20px;
}

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

.add-method-group h6 {
  margin: 0 0 8px 0;
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.resource-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.resource-actions .btn {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.resource-actions .btn svg {
  width: 14px;
  height: 14px;
}

.manual-path {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.manual-path .form-control {
  flex: 1;
  min-width: 0;
}

.manual-path .btn {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.manual-path .btn svg {
  width: 12px;
  height: 12px;
}

/* 按钮样式优化 */
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  height: 32px;
}

.btn-outline {
  background: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}

.btn-outline:hover {
  background: hsl(var(--accent));
}

/* 加载状态和过渡动画 */
.task-item {
  transition: all 200ms ease;
}

.task-item:active {
  transform: scale(0.98);
}

.detail-empty-state {
  animation: fadeIn 300ms ease;
}

.task-detail-view, .add-task-form {
  animation: slideInRight 300ms ease;
}

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

@keyframes slideInRight {
  from { 
    opacity: 0; 
    transform: translateX(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateX(0); 
  }
}

/* 滚动条样式已移至全局 main.css */

/* 表单验证状态 */
.form-control:invalid {
  border-color: hsl(var(--destructive));
  box-shadow: 0 0 0 2px hsl(var(--destructive) / 0.1);
}

.form-control:focus:invalid {
  outline: none;
  border-color: hsl(var(--destructive));
  box-shadow: 0 0 0 2px hsl(var(--destructive) / 0.2);
}

/* 按钮加载状态 */
.btn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 状态指示器增强 */
.task-item-status {
  transition: all 200ms ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.task-item-status.enabled {
  background: linear-gradient(135deg, hsl(var(--primary) / 0.2), hsl(var(--primary) / 0.3));
  border: 1px solid hsl(var(--primary) / 0.3);
}

.task-item-status.disabled {
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
}

/* 资源列表增强 */
.resource-item {
  transition: all 150ms ease;
}

.resource-item:hover {
  background: hsl(var(--muted) / 0.7);
  transform: translateX(2px);
}

.resource-path {
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  font-size: 12px;
}

/* 空状态增强 */
.empty-tasks .empty-icon,
.detail-empty-state .empty-icon {
  filter: grayscale(30%);
  transition: filter 200ms ease;
}

.empty-tasks:hover .empty-icon,
.detail-empty-state:hover .empty-icon {
  filter: grayscale(0%);
}

/* 按钮悬停增强 */
.btn {
  transition: all 150ms ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 300ms ease, height 300ms ease;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

/* 分割线样式 */
.tasks-management-layout {
  border: 1px solid hsl(var(--border));
}

.tasks-list-panel {
  border-right: 1px solid hsl(var(--border));
}

/* 焦点状态增强 */
.task-item:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 1px;
}

/* 响应式调整 */
@media (max-width: 1024px) {
  .tasks-list-panel {
    width: 300px;
  }
  
  .large-modal {
    width: 92vw;
    max-width: 900px;
  }
}

@media (max-width: 768px) {
  .tasks-management-layout {
    flex-direction: column;
  }
  
  .tasks-list-panel {
    width: 100%;
    height: 40%;
    min-height: 200px;
    border-right: none;
    border-bottom: 1px solid hsl(var(--border));
  }
  
  .task-detail-panel {
    height: 60%;
  }
  
  .large-modal {
    width: 98vw;
    height: 90vh;
    max-height: none;
  }
}

@media (max-width: 480px) {
  .tasks-list-panel .panel-header {
    padding: 12px;
  }
  
  .tasks-list-panel .panel-header h4 {
    font-size: 13px;
  }
  
  .task-detail-view,
  .add-task-form {
    padding: 16px;
  }
  
  .detail-header,
  .add-task-form .form-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* 任务执行通知样式 */
.task-execution-notification {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-primary);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.notification-text {
    font-weight: 500;
}

/* 任务错误通知样式 */
.task-error-notification {
    font-family: var(--font-mono);
    font-size: 14px;
}

.notification-content.error {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notification-details {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.notification-message {
    font-size: 13px;
    margin-bottom: 4px;
    line-height: 1.4;
}

.notification-taskid {
    font-size: 11px;
    opacity: 0.8;
    font-family: var(--font-mono);
}

.notification-close {
    background: none;
    border: none;
    color: currentColor;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.notification-close:hover {
    opacity: 1;
}

/* 通知动画 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Dashboard 新增样式 */
.dashboard-welcome-info {
  text-align: center;
  padding: 1rem;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted));
  border-radius: var(--radius);
  margin: 1rem 0;
}

.status-value.code {
  font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", monospace;
  font-size: 0.9em;
  background: hsl(var(--muted));
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}

/* 任务详情弹窗样式 */
.task-detail-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-group label {
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.detail-value {
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  padding: 8px 12px;
  background: hsl(var(--muted) / 0.3);
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
}

.detail-value.code {
  font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", monospace;
  font-size: 13px;
  background: hsl(var(--muted));
  padding: 4px 8px;
  border-radius: 4px;
  word-break: break-all;
  margin-bottom: 4px;
}

/* 资源文件样式 */
.resource-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resource-buttons {
  display: flex;
  gap: 8px;
}

.manual-path-input {
  display: flex;
  gap: 8px;
  align-items: center;
}

.resource-list {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 8px;
  min-height: 60px;
  background: hsl(var(--card));
}

.resource-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--radius);
  background: hsl(var(--muted) / 0.3);
  margin-bottom: 4px;
}

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

.resource-path {
  font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", monospace;
  font-size: 13px;
  color: hsl(var(--foreground));
  flex-grow: 1;
  word-break: break-all;
}

/* 任务状态样式 */
.task-item-status {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.task-item-status.enabled {
  background: hsl(var(--success) / 0.2);
  color: hsl(var(--success));
  border: 1px solid hsl(var(--success) / 0.3);
}

.task-item-status.disabled {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

/* 任务弹窗统一宽度 */
#task-detail-modal .modal-content,
#add-task-modal .modal-content {
  width: 800px;
  max-width: 90vw;
}

/* 独立弹窗样式优化 */
#standalone-add-task-modal .modal-body,
#standalone-task-detail-modal .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  /* 滚动条样式已移至全局 main.css */
}

/* 确保表单元素在滚动时有合适的边距 */
#standalone-add-task-modal .form-group:last-child,
#standalone-task-detail-modal .form-group:last-child {
  margin-bottom: 20px;
}

/* 确保模态框footer始终可见并置底 */
#standalone-add-task-modal .modal-footer,
#standalone-task-detail-modal .modal-footer {
  flex-shrink: 0;
  border-top: 1px solid hsl(var(--border));
  padding: 16px 24px;
  background: hsl(var(--card));
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-top: auto;
}

/* 移动端响应式 */
@media (max-width: 768px) {
  #standalone-add-task-modal .modal-body,
  #standalone-task-detail-modal .modal-body {
    padding: 16px 20px;
  }
  
  #standalone-add-task-modal .modal-footer,
  #standalone-task-detail-modal .modal-footer {
    padding: 12px 20px;
  }
  
  /* 移动端隐藏全自动模式和任务日志选项 */
  #standalone-add-task-modal .toggle-switch,
  #standalone-task-detail-modal .toggle-switch,
  #daily-tasks-modal .toggle-switch {
    display: none !important;
  }
}

/* 智能体管理弹窗样式 */
.agents-modal .modal-content {
  display: grid !important;
  grid-template-columns: 300px 1fr;
  grid-template-rows: auto 1fr;
  height: 100%;
  gap: 1px;
  background: hsl(var(--border));
}

.agents-modal .modal-header {
  grid-column: 1 / -1;
}

.agents-modal .agents-sidebar {
  width: auto; /* 覆盖固定宽度，使用Grid的列宽 */
  grid-column: 1;
  grid-row: 2;
}

.agents-modal .agents-detail {
  width: auto; /* 确保使用Grid的列宽 */
  grid-column: 2;
  grid-row: 2;
}


.agents-layout {
  display: flex;
  height: 100%;
  gap: 1px;
  background: hsl(var(--border));
}

.agents-sidebar {
  width: 300px;
  background: hsl(var(--card));
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.agents-list {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.agent-item {
  padding: 12px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: hsl(var(--background));
}

.agent-item:hover {
  background: hsl(var(--muted));
  border-color: hsl(var(--ring));
}

.agent-item.selected {
  background: hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary));
}

.agent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.agent-name {
  font-weight: 600;
  font-size: 14px;
  color: hsl(var(--foreground));
}

.agent-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.agent-status-indicator.orange {
  background: #f59e0b;
}

.agent-status-indicator.red {
  background: #ef4444;
}

.agent-status-indicator.blue {
  background: #3b82f6;
}

.agent-status-indicator.yellow {
  background: #eab308;
}

.agent-status-indicator.default {
  background: #6b7280;
}

.agent-description {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
  margin-bottom: 4px;
}

.agent-model {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  font-style: italic;
}

.agents-detail {
  flex: 1;
  background: hsl(var(--card));
  padding: 20px;
  overflow-y: auto;
}

.agent-detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: hsl(var(--muted-foreground));
}

.placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.placeholder-text {
  font-size: 16px;
}

.agent-detail-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.agent-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid hsl(var(--border));
}

.agent-detail-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.agent-color-badge {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid hsl(var(--border));
}

.agent-detail-info {
  flex: 1;
  margin-bottom: 20px;
}

.info-item {
  margin-bottom: 16px;
}

.info-item strong {
  display: block;
  margin-bottom: 4px;
  color: hsl(var(--foreground));
  font-size: 14px;
}

.info-item p {
  margin: 0;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  line-height: 1.5;
}

.agent-detail-actions {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid hsl(var(--border));
}

.agent-detail-actions .btn {
  flex: 1;
}

/* 智能体文件查看器样式 */
.agent-file-viewer {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.agent-file-header {
  padding: 16px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.5);
}

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-name {
  font-family: monospace;
  font-size: 14px;
  color: hsl(var(--foreground));
  font-weight: 600;
}

.agent-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-name {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

.agent-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid hsl(var(--border));
}

.agent-file-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.agent-file-content pre {
  margin: 0;
  padding: 16px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  font-size: 13px;
  line-height: 1.5;
  overflow: visible;
  height: auto;
  color: hsl(var(--foreground));
}

.agent-file-content code {
  background: transparent;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
  color: hsl(var(--foreground)) !important;
}

/* 确保语法高亮的标记有正确的颜色 */
.agent-file-content .token.comment,
.agent-file-content .token.prolog,
.agent-file-content .token.doctype,
.agent-file-content .token.cdata {
  color: hsl(var(--muted-foreground));
}

.agent-file-content .token.punctuation {
  color: hsl(var(--foreground));
}

.agent-file-content .token.property,
.agent-file-content .token.tag,
.agent-file-content .token.boolean,
.agent-file-content .token.number,
.agent-file-content .token.constant,
.agent-file-content .token.symbol,
.agent-file-content .token.deleted {
  color: hsl(var(--primary));
}

.agent-file-content .token.selector,
.agent-file-content .token.attr-name,
.agent-file-content .token.string,
.agent-file-content .token.char,
.agent-file-content .token.builtin,
.agent-file-content .token.inserted {
  color: #228B64;
}

.agent-file-content .token.operator,
.agent-file-content .token.entity,
.agent-file-content .token.url,
.agent-file-content .language-css .token.string,
.agent-file-content .style .token.string {
  color: #f59e0b;
}

.agent-file-content .token.atrule,
.agent-file-content .token.attr-value,
.agent-file-content .token.keyword {
  color: #3b82f6;
}

.agent-file-content .token.function,
.agent-file-content .token.class-name {
  color: #8b5cf6;
}

/* ===== 文件夹选择器样式 ===== */
.folder-selector-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-in-out;
}

.folder-selector-overlay.open {
  display: flex;
}

.folder-selector-modal {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  width: 600px;
  max-width: 95vw;
  height: 500px;
  max-height: 85vh;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s ease-in-out;
}

.folder-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.3);
}

.folder-selector-header h3 {
  margin: 0;
  color: hsl(var(--foreground));
  font-size: 16px;
  font-weight: 600;
}

/* 搜索容器样式 */
.folder-search-container {
  padding: 12px 20px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.1);
}

.folder-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.folder-search-icon {
  position: absolute;
  left: 10px;
  color: hsl(var(--muted-foreground));
  z-index: 1;
}

.folder-search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 14px;
  transition: all 0.2s ease;
}

.folder-search-input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.1);
}

.folder-search-input::placeholder {
  color: hsl(var(--muted-foreground));
}

.folder-search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.folder-search-clear:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.folder-search-clear.hidden {
  display: none;
}

/* 文件夹导航样式 */
.folder-navigation {
  padding: 12px 20px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.05);
}

.folder-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
}

.folder-nav-btn {
  background: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--secondary-foreground));
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.folder-nav-btn:hover:not(:disabled) {
  background: hsl(var(--secondary) / 0.8);
}

.folder-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.breadcrumb-path {
  font-family: monospace;
  font-size: 13px;
  color: hsl(var(--foreground));
  background: hsl(var(--muted) / 0.3);
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid hsl(var(--border));
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-close-btn {
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.folder-close-btn:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.folder-selector-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.folder-tree {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  background: hsl(var(--background));
}

/* 滚动条样式已移至全局 main.css */

.folder-item {
  margin: 1px 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.folder-content {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  border-radius: 4px;
  margin: 0 8px;
  flex: 1;
}

.folder-content:hover {
  background: hsl(var(--accent) / 0.1);
}

.folder-item.selected .folder-content {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.folder-item.existing-project .folder-content {
  background: hsl(var(--muted) / 0.5);
  color: hsl(var(--muted-foreground));
  cursor: not-allowed;
  opacity: 0.7;
}

.folder-item.existing-project .folder-content:hover {
  background: hsl(var(--muted) / 0.5);
}

.folder-icon {
  margin-right: 8px;
  display: flex;
  align-items: center;
  color: hsl(var(--muted-foreground));
}

.folder-item.selected .folder-icon {
  color: hsl(var(--primary-foreground));
}

.folder-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.existing-badge {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  font-weight: 500;
}

.enter-hint {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: 8px;
  font-weight: 400;
  opacity: 0.7;
}

.expand-arrow {
  display: inline-block;
  width: 16px;
  height: 16px;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  user-select: none;
  transition: color 0.2s ease;
  margin-right: 4px;
}

.expand-arrow:hover {
  color: hsl(var(--foreground));
}

.expand-placeholder {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 4px;
}

.folder-selector-footer {
  border-top: 1px solid hsl(var(--border));
  padding: 16px 20px;
  background: hsl(var(--muted) / 0.2);
}

.current-path {
  margin-bottom: 12px;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}

.path-label {
  font-weight: 500;
  margin-right: 8px;
}

.path-value {
  color: hsl(var(--foreground));
  font-family: monospace;
  background: hsl(var(--muted) / 0.5);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.folder-selector-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.folder-selector-buttons .btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.folder-selector-buttons .btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--border));
}

.folder-selector-buttons .btn-secondary:hover {
  background: hsl(var(--secondary) / 0.8);
}

.folder-selector-buttons .btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.folder-selector-buttons .btn-primary:hover:not(:disabled) {
  background: hsl(var(--primary) / 0.9);
}

.folder-selector-buttons .btn-primary:disabled {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  cursor: not-allowed;
  opacity: 0.6;
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
}

.empty-folders {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
}

.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: hsl(var(--destructive));
  font-size: 14px;
  text-align: center;
}

.error-message .btn {
  margin-top: 12px;
  padding: 6px 12px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.error-message .btn:hover {
  background: hsl(var(--primary) / 0.9);
}

/* 防止body滚动当模态框打开时 */
body.modal-open {
  overflow: hidden;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .folder-selector-modal {
    width: 95vw;
    height: 80vh;
    margin: 0 10px;
  }
  
  .folder-selector-header,
  .folder-selector-footer {
    padding: 12px 16px;
  }
  
  .folder-content {
    padding: 12px;
  }
  
  .folder-name {
    font-size: 15px;
  }
}

/* 通知配置样式 */
.notification-layout {
  display: flex;
  gap: 20px;
  margin-top: 24px;
}

.notification-selector {
  width: 200px;
  flex-shrink: 0;
}

.notification-layout .selector-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  font-size: 13px;
}

.notification-layout .selector-item:hover {
  background: hsl(var(--accent));
}

.notification-layout .selector-item.active {
  background: hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary));
}

.notification-layout .selector-item .status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: absolute;
  right: 12px;
  background: hsl(var(--muted-foreground));
}

.notification-layout .selector-item .status-indicator.configured {
  background: hsl(var(--primary));
}

.notification-panel {
  flex: 1;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.notification-layout .panel-content {
  display: none;
}

.notification-layout .panel-content.active {
  display: block;
}

.notification-layout .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: hsl(var(--muted));
  border-bottom: 1px solid hsl(var(--border));
}

.notification-layout .panel-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.notification-email-section,
.notification-wechat-section {
  margin-top: 0;
  padding: 20px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: hsl(var(--muted));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
}

.section-title img {
  margin-right: 8px;
}

.config-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: hsl(var(--muted-foreground));
}

.status-indicator.configured {
  background: #fbbf24; /* warning color */
}

.status-indicator.tested {
  background: #10b981; /* success color */
}

.status-text {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.email-config-form {
  padding: 0 16px;
}

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

.form-row .form-group {
  margin-bottom: 0;
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.input-group .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1px solid hsl(var(--border));
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-group .btn:hover {
  background: hsl(var(--muted));
}

.help-link {
  color: hsl(var(--primary));
  text-decoration: none;
  font-size: 12px;
  margin-left: 8px;
}

.help-link:hover {
  text-decoration: underline;
}

.smtp-config-preview {
  margin: 16px 0;
  padding: 16px;
  background: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 500;
  font-size: 14px;
  color: hsl(var(--foreground));
}

.config-details {
  display: grid;
  gap: 8px;
}

.config-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.config-label {
  color: hsl(var(--muted-foreground));
}

.config-value {
  font-weight: 500;
  color: hsl(var(--foreground));
}

.form-actions {
  display: flex;
  gap: 12px;
  margin: 24px 0 16px 0;
  justify-content: flex-end;
}

.test-result {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  display: none;
}

.test-result.success {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

.test-result.error {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

.result-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-icon {
  flex-shrink: 0;
}

.result-message {
  flex: 1;
  font-size: 14px;
}

.email-help-section {
  margin-top: 24px;
  padding: 16px;
  background: hsl(var(--muted) / 0.3);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

.help-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.help-content {
  font-size: 14px;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
}

.provider-help h6 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: hsl(var(--foreground));
}

.help-steps {
  margin: 12px 0;
  padding-left: 20px;
}

.help-steps li {
  margin-bottom: 8px;
  line-height: 1.4;
}

.help-steps a {
  color: hsl(var(--primary));
  text-decoration: none;
}

.help-steps a:hover {
  text-decoration: underline;
}

.help-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
}

.general-help p {
  margin-bottom: 12px;
}

.supported-providers {
  margin-top: 16px;
}

.supported-providers h6 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: hsl(var(--foreground));
}

.supported-providers ul {
  margin-left: 20px;
}

.supported-providers li {
  margin-bottom: 4px;
  font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .form-actions .btn {
    width: 100%;
  }
}

/* 任务表单通知设置样式 */
.notification-options {
    margin-top: 12px;
    padding: 16px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-option {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    transition: all 0.2s ease;
    background: hsl(var(--card));
}

.notification-option:hover {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 2px hsl(var(--primary) / 0.1);
}

.notification-option.disabled {
    opacity: 0.6;
    background: hsl(var(--muted));
}

.notification-option.disabled:hover {
    border-color: hsl(var(--border));
    box-shadow: none;
}

.notification-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 100%;
    font-weight: 500;
}

.notification-option.disabled label {
    cursor: not-allowed;
}

.notification-option input[type="radio"] {
    margin: 0;
    margin-right: 8px;
}

.notification-option input[type="radio"]:disabled {
    cursor: not-allowed;
}

.notification-option img {
    flex-shrink: 0;
}

.notification-option .status-text {
    font-size: 12px;
    margin-left: auto;
    font-weight: 600;
}

.notification-option .status-text.status-ok {
    color: hsl(var(--success));
}

.notification-option .status-text.status-need-config {
    color: hsl(var(--destructive));
}

/* 通知开关样式增强 */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.toggle-switch .switch-container {
    position: relative;
    flex-shrink: 0;
}

.toggle-switch .switch-label {
    font-weight: 600;
    color: hsl(var(--foreground));
    margin: 0;
}

.toggle-switch .switch-description {
    font-size: 14px;
    color: hsl(var(--muted-foreground));
    margin-top: 4px;
}

/* Goal Example Styles */
.goal-example {
    background: hsl(var(--muted) / 0.3);
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 12px;
    margin-top: 8px;
}

.goal-example h6 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.goal-example .example-item {
    margin-bottom: 8px;
    padding: 8px;
    background: hsl(var(--background));
    border-radius: 4px;
    border-left: 3px solid hsl(var(--muted));
    font-size: 13px;
    line-height: 1.4;
}

.goal-example .example-item.bad {
    border-left-color: hsl(var(--destructive));
    background: hsl(var(--destructive) / 0.05);
    text-decoration: line-through;
    color: hsl(var(--muted-foreground));
}

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

.goal-example .example-item.good {
    border-left-color: hsl(var(--success));
    background: hsl(var(--success) / 0.05);
}

.goal-example .example-item strong {
    color: hsl(var(--foreground));
    font-weight: 600;
    display: inline-block;
    margin-bottom: 4px;
}

.goal-example .example-item.good strong {
    color: hsl(var(--success));
}

/* ===== 移动端任务管理器优化 ===== */
@media (max-width: 768px) {
    /* 任务管理器主容器 */
    .task-manager {
        padding: 0;
        margin: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    /* 任务列表容器 */
    .task-list-container {
        flex: 1;
        overflow-y: auto;
        padding: 8px;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 任务项优化 */
    .task-item {
        margin-bottom: 12px;
        padding: 16px;
        border-radius: 12px;
        border: 1px solid hsl(var(--border));
        background: hsl(var(--card));
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    .task-item:last-child {
        margin-bottom: 80px; /* 为底部操作留空间 */
    }
    
    /* 任务标题 */
    .task-title {
        font-size: 16px;
        font-weight: 600;
        line-height: 1.4;
        margin-bottom: 8px;
        color: hsl(var(--foreground));
    }
    
    /* 任务描述 */
    .task-description {
        font-size: 14px;
        line-height: 1.5;
        color: hsl(var(--muted-foreground));
        margin-bottom: 12px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* 任务状态标签 */
    .task-status {
        display: inline-flex;
        align-items: center;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 500;
        margin-right: 8px;
    }
    
    .task-status.running {
        background: hsl(var(--primary) / 0.1);
        color: hsl(var(--primary));
    }
    
    .task-status.completed {
        background: hsl(var(--success) / 0.1);
        color: hsl(var(--success));
    }
    
    .task-status.failed {
        background: hsl(var(--destructive) / 0.1);
        color: hsl(var(--destructive));
    }
    
    /* 任务操作按钮 */
    .task-actions {
        display: flex;
        gap: 8px;
        margin-top: 12px;
        flex-wrap: wrap;
    }
    
    .task-action-btn {
        flex: 1;
        min-height: 36px;
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        border: 1px solid hsl(var(--border));
        background: hsl(var(--background));
        color: hsl(var(--foreground));
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        transition: all 0.2s ease;
    }
    
    .task-action-btn:hover {
        background: hsl(var(--accent));
        border-color: hsl(var(--ring));
    }
    
    .task-action-btn.primary {
        background: hsl(var(--primary));
        color: hsl(var(--primary-foreground));
        border-color: hsl(var(--primary));
    }
    
    .task-action-btn.primary:hover {
        background: hsl(var(--primary) / 0.9);
    }
    
    /* 新建任务按钮 - 移动端固定在底部 */
    .mobile-fab {
        position: fixed;
        bottom: 24px;
        right: 20px;
        width: 56px;
        height: 56px;
        background: hsl(var(--primary));
        color: hsl(var(--primary-foreground));
        border: none;
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        z-index: 100;
    }
    
    .mobile-fab:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    }
    
    .mobile-fab:active {
        transform: scale(0.95);
    }
    
    /* 搜索栏移动端优化 */
    .task-search {
        margin: 12px;
        position: sticky;
        top: 0;
        z-index: 50;
        background: hsl(var(--background));
        padding: 8px 0;
    }
    
    .task-search input {
        width: 100%;
        padding: 12px 16px;
        border-radius: 12px;
        border: 1px solid hsl(var(--border));
        background: hsl(var(--background));
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 过滤器标签移动端优化 */
    .task-filters {
        display: flex;
        gap: 8px;
        padding: 0 12px 12px 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .task-filters::-webkit-scrollbar {
        display: none;
    }
    
    .filter-tag {
        flex-shrink: 0;
        padding: 6px 12px;
        border-radius: 16px;
        border: 1px solid hsl(var(--border));
        background: hsl(var(--background));
        color: hsl(var(--foreground));
        font-size: 14px;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .filter-tag.active {
        background: hsl(var(--primary));
        color: hsl(var(--primary-foreground));
        border-color: hsl(var(--primary));
    }
    
    /* 空状态优化 */
    .empty-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px 20px;
        text-align: center;
        color: hsl(var(--muted-foreground));
    }
    
    .empty-state-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 16px;
        opacity: 0.5;
    }
    
    .empty-state h3 {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 8px;
        color: hsl(var(--foreground));
    }
    
    .empty-state p {
        font-size: 14px;
        line-height: 1.5;
        max-width: 280px;
    }

/* 任务类型指示器样式 */
.task-type-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 8px;
    line-height: 1;
}

.task-type-indicator.mobile {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    color: #1976D2;
    border: 1px solid #42A5F5;
}

.task-type-indicator.pc {
    background: linear-gradient(135deg, #F3E5F5, #E1BEE7);
    color: #7B1FA2;
    border: 1px solid #AB47BC;
}

/* ===== Mobile Task Conversation History Styles ===== */

/* 移动端对话历史遮罩层 */
.mobile-conversation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    animation: fadeIn 0.2s ease-out;
}

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

/* 移动端对话历史容器 */
.mobile-conversation-container {
    background: hsl(var(--background));
    width: 100%;
    height: 90vh;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* 移动端对话头部 */
.mobile-conversation-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    border-radius: 16px 16px 0 0;
    min-height: 64px;
}

.mobile-back-btn {
    background: none;
    border: none;
    padding: 8px;
    margin-right: 12px;
    border-radius: 8px;
    color: hsl(var(--foreground));
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-back-btn:hover {
    background: hsl(var(--accent));
}

.mobile-back-btn svg {
    width: 20px;
    height: 20px;
}

.mobile-conversation-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 12px;
}

.mobile-conversation-type {
    display: flex;
    align-items: center;
}

/* 移动端对话内容区域 */
.mobile-conversation-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 加载状态 */
.mobile-conversation-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: hsl(var(--muted-foreground));
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid hsl(var(--border));
    border-top: 3px solid hsl(var(--primary));
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误状态 */
.mobile-conversation-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 32px;
    text-align: center;
    color: hsl(var(--muted-foreground));
}

.mobile-conversation-error svg {
    margin-bottom: 16px;
}

.mobile-conversation-error h3 {
    color: hsl(var(--foreground));
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.mobile-conversation-error p {
    margin: 0 0 24px 0;
    font-size: 14px;
    line-height: 1.5;
}

.retry-btn {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.retry-btn:hover {
    background: hsl(var(--primary) / 0.9);
}

/* 空状态 */
.mobile-conversation-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 32px;
    text-align: center;
    color: hsl(var(--muted-foreground));
}

.mobile-conversation-empty svg {
    margin-bottom: 16px;
}

.mobile-conversation-empty h3 {
    color: hsl(var(--foreground));
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.mobile-conversation-empty p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* 对话消息列表 */
.mobile-conversation-messages {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* 消息气泡样式 */
.mobile-message {
    display: flex;
    width: 100%;
}

.mobile-message.user-message {
    justify-content: flex-end;
}

.mobile-message.assistant-message {
    justify-content: flex-start;
}

.mobile-message.error-message {
    justify-content: center;
}

.mobile-message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
}

/* 用户消息气泡 */
.mobile-message-bubble.user-bubble {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-bottom-right-radius: 6px;
}

/* 助手消息气泡 */
.mobile-message-bubble.assistant-bubble {
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
    border-bottom-left-radius: 6px;
}

/* 错误消息气泡 */
.mobile-message-bubble.error-bubble {
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
    border-radius: 18px;
    max-width: 90%;
}

.mobile-message-content {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.mobile-message-content:last-child {
    margin-bottom: 0;
}

.mobile-message-time {
    font-size: 11px;
    opacity: 0.7;
    text-align: right;
    margin-top: 4px;
}

.user-bubble .mobile-message-time {
    color: hsl(var(--primary-foreground) / 0.8);
}

.assistant-bubble .mobile-message-time {
    color: hsl(var(--muted-foreground));
    text-align: left;
}

/* 移动端Markdown样式 */
.mobile-message-content strong {
    font-weight: 600;
}

.mobile-message-content em {
    font-style: italic;
}

.mobile-message-content code.mobile-inline-code {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
}

.mobile-message-content pre.mobile-code-block {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    overflow-x: auto;
    margin: 8px 0;
}

.mobile-message-content h3.mobile-heading {
    font-size: 16px;
    font-weight: 600;
    margin: 8px 0 4px 0;
    color: inherit;
}

/* 移动端输入区域 */
.mobile-conversation-input {
    padding: 16px 20px;
    border-top: 1px solid hsl(var(--border));
    background: hsl(var(--background));
}

.mobile-input-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    max-width: 100%;
}

#mobile-conversation-textarea {
    flex: 1;
    border: 1px solid hsl(var(--border));
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 14px;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    resize: none;
    outline: none;
    min-height: 44px;
    max-height: 120px;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

#mobile-conversation-textarea:focus {
    border-color: hsl(var(--primary));
}

#mobile-conversation-textarea::placeholder {
    color: hsl(var(--muted-foreground));
}

.mobile-send-btn {
    width: 44px;
    height: 44px;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.1s ease;
    flex-shrink: 0;
}

.mobile-send-btn:hover:not(:disabled) {
    background: hsl(var(--primary) / 0.9);
}

.mobile-send-btn:active {
    transform: scale(0.95);
}

.mobile-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mobile-send-btn svg {
    width: 20px;
    height: 20px;
}

/* 发送中的加载动画 */
.mobile-sending-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid hsl(var(--primary-foreground) / 0.3);
    border-top: 2px solid hsl(var(--primary-foreground));
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .mobile-conversation-overlay {
        align-items: stretch;
    }
    
    .mobile-conversation-container {
        height: 100vh;
        border-radius: 0;
    }
    
    .mobile-conversation-header {
        border-radius: 0;
    }
    
    .mobile-message-bubble {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .mobile-conversation-messages {
        padding: 12px 16px;
    }
    
    .mobile-conversation-input {
        padding: 12px 16px;
    }
    
    .mobile-conversation-header {
        padding: 12px 16px;
    }
    
    .mobile-message-bubble {
        max-width: 90%;
        padding: 10px 14px;
    }
}

/* ===== PC Task Conversation History Styles ===== */

/* PC端对话历史模态框 */
.pc-conversation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.pc-conversation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.pc-conversation-container {
    background: hsl(var(--background));
    width: 90vw;
    max-width: 900px;
    height: 80vh;
    max-height: 700px;
    border-radius: 12px;
    border: 1px solid hsl(var(--border));
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: scale(0.9) translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

/* PC端对话头部 */
.pc-conversation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    border-radius: 12px 12px 0 0;
    min-height: 64px;
}

.pc-conversation-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.pc-conversation-title h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: hsl(var(--foreground));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pc-conversation-close {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 8px;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pc-conversation-close:hover {
    background: hsl(var(--accent));
    color: hsl(var(--foreground));
}

/* PC端对话内容区域 */
.pc-conversation-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* PC端加载状态 */
.pc-conversation-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: hsl(var(--muted-foreground));
}

.pc-conversation-loading .loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid hsl(var(--border));
    border-top: 3px solid hsl(var(--primary));
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

/* PC端错误状态 */
.pc-conversation-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
    color: hsl(var(--muted-foreground));
}

.pc-conversation-error svg {
    margin-bottom: 20px;
}

.pc-conversation-error h3 {
    color: hsl(var(--foreground));
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
}

.pc-conversation-error p {
    margin: 0 0 24px 0;
    font-size: 15px;
    line-height: 1.5;
}

.pc-conversation-error .retry-btn {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pc-conversation-error .retry-btn:hover {
    background: hsl(var(--primary) / 0.9);
}

/* PC端空状态 */
.pc-conversation-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
    color: hsl(var(--muted-foreground));
}

.pc-conversation-empty svg {
    margin-bottom: 20px;
}

.pc-conversation-empty h3 {
    color: hsl(var(--foreground));
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
}

.pc-conversation-empty p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}

/* PC端对话消息列表 */
.pc-conversation-messages {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

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

.pc-conversation-messages::-webkit-scrollbar-track {
    background: hsl(var(--muted));
}

.pc-conversation-messages::-webkit-scrollbar-thumb {
    background: hsl(var(--muted-foreground) / 0.3);
    border-radius: 3px;
}

.pc-conversation-messages::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--muted-foreground) / 0.5);
}

/* PC端消息样式 */
.pc-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 100%;
}

.pc-message.user-message {
    flex-direction: row-reverse;
}

.pc-message.user-message .pc-message-bubble {
    background: hsl(var(--primary) / 0.1);
    border: 1px solid hsl(var(--primary) / 0.2);
}

.pc-message.assistant-message .pc-message-bubble {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
}

.pc-message.error-message .pc-message-bubble.error-bubble {
    background: hsl(var(--destructive) / 0.1);
    border: 1px solid hsl(var(--destructive) / 0.3);
}

.pc-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: hsl(var(--muted));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: hsl(var(--muted-foreground));
}

.user-message .pc-message-avatar {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.assistant-message .pc-message-avatar {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.pc-message-bubble {
    flex: 1;
    max-width: calc(100% - 48px);
    padding: 16px 18px;
    border-radius: 12px;
    word-wrap: break-word;
}

.pc-message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pc-message-author {
    font-weight: 600;
    font-size: 14px;
    color: hsl(var(--foreground));
}

.pc-message-time {
    font-size: 12px;
    color: hsl(var(--muted-foreground));
}

.pc-message-content {
    font-size: 14px;
    line-height: 1.5;
    color: hsl(var(--foreground));
}

.pc-message-content p {
    margin: 0 0 8px 0;
}

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

/* PC端输入区域 */
.pc-conversation-input {
    padding: 20px 24px;
    border-top: 1px solid hsl(var(--border));
    background: hsl(var(--background));
    border-radius: 0 0 12px 12px;
}

.pc-input-container {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    max-width: 100%;
}

#pc-conversation-textarea {
    flex: 1;
    border: 1px solid hsl(var(--border));
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    resize: none;
    outline: none;
    min-height: 48px;
    max-height: 120px;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

#pc-conversation-textarea:focus {
    border-color: hsl(var(--primary));
}

#pc-conversation-textarea::placeholder {
    color: hsl(var(--muted-foreground));
}

.pc-send-btn {
    width: 48px;
    height: 48px;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.pc-send-btn:hover:not(:disabled) {
    background: hsl(var(--primary) / 0.9);
    transform: translateY(-1px);
}

.pc-send-btn:active {
    transform: translateY(0);
}

.pc-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pc-send-btn svg {
    width: 20px;
    height: 20px;
}

/* PC发送中的加载动画 */
.pc-sending-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid hsl(var(--primary-foreground) / 0.3);
    border-top: 2px solid hsl(var(--primary-foreground));
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* PC端响应式调整 */
@media (max-width: 1200px) {
    .pc-conversation-container {
        width: 95vw;
        height: 85vh;
    }
}

@media (max-width: 768px) {
    .pc-conversation-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        max-width: none;
        max-height: none;
    }
    
    .pc-conversation-header {
        border-radius: 0;
        padding: 16px 20px;
    }
    
    .pc-conversation-messages {
        padding: 16px 20px;
    }
    
    .pc-conversation-input {
        padding: 16px 20px;
        border-radius: 0;
    }
}
