* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
}

/* 登录页面 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h1 {
  text-align: center;
  margin-bottom: 10px;
  color: #667eea;
}

.subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 30px;
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.password-input {
  position: relative;
  display: flex;
}

.password-input input {
  flex: 1;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.toggle-password {
  padding: 12px 15px;
  background: #f0f0f0;
  border: 2px solid #e0e0e0;
  border-left: none;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}

.toggle-password:hover {
  background: #e0e0e0;
}

/* 按钮样式 */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5a6fd6;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-logout {
  background: #dc3545;
  color: white;
}

.btn-logout:hover {
  background: #c82333;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-icon {
  padding: 8px 12px;
  font-size: 18px;
  background: transparent;
  border: 1px solid #ddd;
}

.btn-block {
  width: 100%;
}

.btn-upload {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

/* 错误消息 */
.error-msg {
  margin-top: 15px;
  padding: 10px;
  background: #ffe6e6;
  color: #dc3545;
  border-radius: 6px;
  text-align: center;
}

.msg {
  margin-top: 15px;
  padding: 10px;
  border-radius: 6px;
  text-align: center;
}

.msg.success {
  background: #e6ffe6;
  color: #28a745;
}

.msg.error {
  background: #ffe6e6;
  color: #dc3545;
}

/* Header */
.header {
  background: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
  font-size: 20px;
  color: #667eea;
}

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

.header-right {
  display: flex;
  gap: 15px;
  align-items: center;
}

.username {
  font-weight: 500;
  color: #555;
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 卡片 */
.card {
  background: white;
  padding: 25px;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.card h2 {
  margin-bottom: 20px;
  color: #333;
  font-size: 18px;
}

/* 用户列表 */
.user-list {
  margin-top: 15px;
}

.user-item {
  padding: 10px 15px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 8px;
}

/* 功能区 */
.function-area {
  background: white;
  padding: 25px;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.function-area h2 {
  margin-bottom: 20px;
  color: #333;
}

.function-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.function-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  text-align: center;
}

.function-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.function-card.coming-soon {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  cursor: not-allowed;
}

.function-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.function-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.function-card p {
  font-size: 14px;
  opacity: 0.9;
}

/* 错题管理主容器 */
.main-container {
  display: flex;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.panel {
  background: white;
  display: flex;
  flex-direction: column;
  min-width: 200px;
}

.panel-header {
  padding: 12px 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-header h3 {
  font-size: 14px;
  color: #555;
}

.panel-content {
  flex: 1;
  overflow: auto;
  padding: 10px;
}

/* 分割条 */
.resizer {
  width: 5px;
  background: #e0e0e0;
  cursor: col-resize;
  transition: background 0.3s;
  flex-shrink: 0;
}

.resizer:hover {
  background: #667eea;
}

/* 隐藏分割条 - 强制完全隐藏 */
.resizer.hidden {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 0 0 0 !important;
  flex-shrink: 0 !important;
  visibility: hidden !important;
}

/* 任务管理 */
.task-filters {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

.task-filter {
  padding: 5px 12px;
  border: 1px solid #e0e0e0;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s;
}

.task-filter:hover {
  background: #f0f0f0;
}

.task-filter.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

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

.task-item {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 12px;
  border-left: 4px solid #e0e0e0;
  cursor: pointer;
  transition: all 0.3s;
}

.task-item:hover {
  background: #e9ecef;
}

.task-item.priority-high {
  border-left-color: #dc3545;
}

.task-item.priority-normal {
  border-left-color: #ffc107;
}

.task-item.priority-low {
  border-left-color: #28a745;
}

.task-item.status-done {
  opacity: 0.6;
  text-decoration: line-through;
}

.task-title {
  font-weight: 500;
  margin-bottom: 5px;
  font-size: 14px;
}

.task-desc {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

.task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #999;
}

.task-actions {
  display: flex;
  gap: 5px;
}

.task-action-btn {
  padding: 3px 8px;
  font-size: 11px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 3px;
  cursor: pointer;
}

.task-action-btn:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* 任务表单 */
#taskDesc {
  width: 100%;
  padding: 10px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

#taskDueDate {
  width: 100%;
  padding: 10px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
}

/* 文件浏览器 */
.file-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

/* 上传进度条 */
.upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.3s;
  border-radius: 4px;
}

#progressText {
  font-size: 13px;
  font-weight: 500;
  color: #667eea;
  min-width: 40px;
  text-align: right;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.file-item {
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.file-item:hover {
  background: #e9ecef;
}

.file-item.selected {
  background: #667eea;
  color: white;
}

.file-item input[type="checkbox"] {
  cursor: pointer;
}

.file-icon {
  font-size: 18px;
}

.file-name {
  flex: 1;
  font-size: 14px;
}

/* 图片预览 */
.image-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

.image-viewer {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100% - 50px);
  background: #f8f9fa;
  border-radius: 6px;
  overflow: hidden;
}

.image-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s;
}

.image-viewer .placeholder,
.file-list .placeholder {
  color: #999;
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

.tab-bar {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.tab {
  padding: 4px 10px;
  background: #e0e0e0;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 150px;
}

.tab span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.tab-close {
  width: 16px;
  height: 16px;
  border: none;
  background: transparent;
  color: #666;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

.tab-close:hover {
  background: #ff4444;
  color: white;
}

.tab.active {
  background: #667eea;
  color: white;
}

.tab.active .tab-close {
  color: white;
}

.tab.active .tab-close:hover {
  background: #ff4444;
  color: white;
}

/* 文本预览 */
.text-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

.text-editor {
  width: 100%;
  height: calc(100% - 50px);
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 15px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  resize: none;
}

.text-editor:focus {
  outline: none;
  border-color: #667eea;
}

.text-editor[readonly] {
  background: #f8f9fa;
}

/* AI 对话 */
.chat-content {
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message {
  display: flex;
  max-width: 85%;
}

.message.user {
  align-self: flex-end;
}

.message.ai {
  align-self: flex-start;
}

.message-content {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.message.user .message-content {
  background: #667eea;
  color: white;
  border-bottom-right-radius: 4px;
}

.message.ai .message-content {
  background: #f0f0f0;
  color: #333;
  border-bottom-left-radius: 4px;
}

.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 15px;
  border-top: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.chat-input-area textarea {
  flex: 1;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  resize: none;
  font-family: inherit;
  font-size: 14px;
}

.chat-input-area textarea:focus {
  outline: none;
  border-color: #667eea;
}

.model-select {
  padding: 5px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 12px;
}

/* 右键菜单 */
.context-menu {
  position: fixed;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
  z-index: 1000;
  display: none;
  min-width: 150px;
}

.context-menu.show {
  display: block;
}

.menu-item {
  padding: 10px 15px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-item:hover {
  background: #f0f0f0;
}

.menu-item:first-child {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.menu-item:last-child {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

/* 菜单分割线 */
.menu-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 6px 0;
}

/* 模态框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: white;
  padding: 25px;
  border-radius: 10px;
  min-width: 400px;
  max-width: 90%;
  max-height: 85vh;
  overflow: auto;
}

.modal-content h3 {
  margin-bottom: 15px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
}

/* 移动菜单 - 目录树 */
.dir-tree {
  min-height: 350px;
  max-height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 2px solid #e8ecef;
  border-radius: 12px;
  padding: 16px;
  background: linear-gradient(180deg, #fafbfc 0%, #f5f7f9 100%);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

/* 目录项 */
.dir-item {
  padding: 10px 14px;
  margin: 2px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 14px;
  color: #333;
}

.dir-item:hover {
  background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
  transform: translateX(4px);
}

.dir-item.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  transform: translateX(0);
}

.dir-item span:first-child {
  font-size: 16px;
}

.dir-item .dir-expand {
  font-size: 12px;
  transition: transform 0.2s;
}

.dir-children {
  display: block;
  width: 100%;
  margin-left: 0;
}

/* 隐藏面板 */
.panel.hidden {
  display: none !important;
}

/* 隐藏分割条 */
.resizer.hidden {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 响应式 */
@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
  }
  
  .resizer {
    width: 100%;
    height: 5px;
    cursor: row-resize;
  }
  
  .panel {
    min-height: 200px;
  }
}

/* AI 对话加载动画 */
.loading-spinner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #f0f0f0;
  border-radius: 12px;
  color: #666;
  font-size: 14px;
}

.loading-spinner .dots {
  display: inline-flex;
  gap: 3px;
}

.loading-spinner .dot {
  width: 8px;
  height: 8px;
  background: #667eea;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-spinner .dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-spinner .dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.thinking-text {
  animation: pulse 2s ease-in-out infinite;
}

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

/* 消息出现动画 */
.message {
  animation: slideIn 0.3s ease-out;
}

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

/* 试卷预处理任务样式 */
.task-type-exam {
  border-left-color: #9c27b0;
}

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

.status-pending {
  background: #fff3e0;
  color: #f57c00;
}

.status-running {
  background: #e3f2fd;
  color: #1976d2;
}

.status-completed {
  background: #e8f5e9;
  color: #388e3c;
}

.status-failed {
  background: #ffebee;
  color: #d32f2f;
}

.status-killed {
  background: #fce4ec;
  color: #c2185b;
}

.loading-dots {
  display: inline-block;
  animation: blink 1.4s infinite both;
}

@keyframes blink {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

.btn-danger {
  background: #f44336;
  color: white;
}

.btn-danger:hover {
  background: #d32f2f;
}

/* 版本号徽章 */
.version-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: "Courier New", monospace;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
  animation: pulse-version 2s ease-in-out infinite;
  cursor: pointer;
  transition: all 0.3s;
}

.version-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

@keyframes pulse-version {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.02);
  }
}

/* 版本更新提示 */
.version-update {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  z-index: 10000;
  text-align: center;
}

.version-update h3 {
  margin: 0 0 15px 0;
  color: #667eea;
}

.version-update p {
  margin: 10px 0;
  color: #666;
}

.version-update .btn {
  margin: 10px 5px;
}

/* resizer4 样式 */
#resizer4 {
  background: #e0e0e0;
}

#resizer4:hover {
  background: #667eea;
}

/* AI 对话弹窗样式 */
.chat-modal .modal-content {
  max-height: 85vh;
  min-width: 500px;
  max-width: 600px;
  height: 70vh;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.chat-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #e0e0e0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 10px 10px 0 0;
}

.chat-modal .modal-header h3 {
  margin: 0;
  font-size: 16px;
}

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

.chat-modal .btn-clear-history {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

.chat-modal .btn-clear-history:hover {
  background: rgba(255,255,255,0.3);
}

.chat-modal .btn-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-modal .btn-close:hover {
  background: rgba(255,255,255,0.3);
}

.chat-modal .chat-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-modal .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.chat-modal .chat-input-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 20px;
  border-top: 1px solid #e0e0e0;
  background: #f8f9fa;
  border-radius: 0 0 10px 10px;
}

.chat-modal .model-select-container {
  display: flex;
  justify-content: flex-end;
}

.chat-modal .model-select {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  background: white;
  cursor: pointer;
}

.chat-modal #chatInput {
  resize: none;
  min-height: 60px;
  max-height: 120px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.chat-modal .chat-input-area .btn {
  align-self: flex-end;
  padding: 8px 20px;
}

/* 修复文本预览布局 - AI 对话改为弹窗后 */
#textPanel {
  flex: 1 1 auto;
  min-width: 300px;
}

/* 任务管理面板隐藏时不影响布局 */
#taskPanel[style*="display: none"] {
  display: none !important;
  flex: 0 0 0 !important;
  min-width: 0 !important;
}

/* 任务管理弹窗样式 */
.task-modal .modal-content {
  max-height: 85vh;
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.task-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 16px 16px 0 0;
}

.task-modal .modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

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

.task-modal .modal-header .btn-icon-sm {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.task-modal .modal-header .btn-icon-sm:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.task-modal .modal-header .btn-icon-sm.spinning {
  animation: spin 0.5s linear;
}

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

.task-modal .modal-header .btn-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.task-modal .modal-header .btn-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.task-modal .panel-content {
  padding: 24px;
  background: #f8f9fa;
}

.task-modal .task-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.task-modal .task-filter {
  padding: 8px 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  color: #666;
}

.task-modal .task-filter:hover {
  background: #f8f9fa;
  border-color: #667eea;
  color: #667eea;
}

.task-modal .task-filter.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.task-modal .task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 500px; min-height: 500px;
  overflow-y: auto;
  padding-right: 8px;
}

/* 滚动条美化 */
.task-modal .task-list::-webkit-scrollbar {
  width: 6px;
}

.task-modal .task-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.task-modal .task-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.task-modal .task-list::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

.task-modal .task-item {
  padding: 18px 20px;
  border: none;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-left: 4px solid transparent;
}

.task-modal .task-item:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateX(4px);
}

.task-modal .task-item.priority-high {
  border-left-color: #dc3545;
  background: linear-gradient(90deg, rgba(220, 53, 69, 0.05) 0%, white 100%);
}

.task-modal .task-item.priority-normal {
  border-left-color: #ffc107;
  background: linear-gradient(90deg, rgba(255, 193, 7, 0.05) 0%, white 100%);
}

.task-modal .task-item.priority-low {
  border-left-color: #28a745;
  background: linear-gradient(90deg, rgba(40, 167, 69, 0.05) 0%, white 100%);
}

.task-modal .task-item.status-done,
.task-modal .task-item.status-completed {
  opacity: 0.7;
}

.task-modal .task-item.status-done:hover,
.task-modal .task-item.status-completed:hover {
  opacity: 1;
}

.task-modal .task-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 10px;
  color: #212529;
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-modal .task-desc {
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 10px;
  line-height: 1.5;
}

.task-modal .task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #adb5bd;
  padding-top: 10px;
  border-top: 1px solid #f1f3f5;
}

.task-modal .task-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.task-modal .task-action-btn {
  padding: 6px 12px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  color: #495057;
}

.task-modal .task-action-btn:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  transform: translateY(-1px);
}

/* 空状态美化 */
.task-modal .task-list .placeholder {
  text-align: center;
  padding: 60px 20px;
  color: #adb5bd;
  font-size: 14px;
}

.task-modal .task-list .placeholder::before {
  content: '📋';
  display: block;
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ===== AI 对话 - 思考中动画 ===== */
.thinking-content {
  display: flex;
  align-items: center;
  gap: 2px;
  color: #888;
  font-style: italic;
}

.thinking-content .dot-1,
.thinking-content .dot-2,
.thinking-content .dot-3 {
  animation: dotBlink 1.4s infinite;
  font-weight: bold;
  font-size: 18px;
}

.thinking-content .dot-2 {
  animation-delay: 0.2s;
}

.thinking-content .dot-3 {
  animation-delay: 0.4s;
}

@keyframes dotBlink {
  0%, 20% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

/* ===== AI 对话 - Markdown 渲染样式 ===== */
.message.ai .message-content h1,
.message.ai .message-content h2,
.message.ai .message-content h3,
.message.ai .message-content h4 {
  margin: 10px 0 6px 0;
  line-height: 1.4;
}

.message.ai .message-content h1 { font-size: 1.3em; }
.message.ai .message-content h2 { font-size: 1.2em; }
.message.ai .message-content h3 { font-size: 1.1em; }
.message.ai .message-content h4 { font-size: 1em; }

.message.ai .message-content p {
  margin: 6px 0;
  line-height: 1.6;
}

.message.ai .message-content ul,
.message.ai .message-content ol {
  margin: 6px 0;
  padding-left: 20px;
}

.message.ai .message-content li {
  margin: 3px 0;
  line-height: 1.5;
}

.message.ai .message-content code {
  background: #e8e8e8;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9em;
  color: #c7254e;
}

.message.ai .message-content pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 12px 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
  line-height: 1.5;
}

.message.ai .message-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 13px;
}

.message.ai .message-content blockquote {
  border-left: 3px solid #667eea;
  padding: 6px 12px;
  margin: 8px 0;
  background: rgba(102, 126, 234, 0.06);
  color: #555;
}

.message.ai .message-content a {
  color: #667eea;
  text-decoration: underline;
}

.message.ai .message-content a:hover {
  color: #5a6fd6;
}

.message.ai .message-content table {
  border-collapse: collapse;
  margin: 8px 0;
  width: 100%;
  font-size: 13px;
}

.message.ai .message-content th,
.message.ai .message-content td {
  border: 1px solid #ddd;
  padding: 6px 10px;
  text-align: left;
}

.message.ai .message-content th {
  background: #f0f0f0;
  font-weight: 600;
}

.message.ai .message-content hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 10px 0;
}

.message.ai .message-content img {
  max-width: 100%;
  border-radius: 6px;
}

/* Markdown 中的首尾 p 标签不要额外 margin */
.message.ai .message-content > :first-child {
  margin-top: 0;
}

.message.ai .message-content > :last-child {
  margin-bottom: 0;
}

/* ===== 频率限制提示样式 ===== */
.message.ai .message-content.rate-limited {
  color: #e67e22;
  font-style: italic;
}

/* 目录树展开/折叠图标 */
.dir-expand {
  display: inline-block;
  width: 16px;
  cursor: pointer;
  user-select: none;
  font-size: 10px;
  color: #666;
  transition: transform 0.2s;
}

.dir-expand:hover {
  color: #007bff;
}

.dir-children {
  display: block;
  width: 100%;
  margin-left: 0;
}
