/* ============================================================
   Novelor Workspace v3 · 全新设计
   品牌色：靛蓝 #6366f1 + 紫色 #7c3aed
   ============================================================ */

:root {
  /* ============================================================
     Novelor Workspace · UI Tokens（V5.3.6 / 2026-08-30）
     设计语言与 writing-demo 统一：靛蓝 #6366f1 + 紫 #7c3aed
     ============================================================ */

  /* 品牌色 */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --secondary: #7c3aed;
  --secondary-hover: #6d28d9;
  --gradient: linear-gradient(135deg, #6366f1, #7c3aed);
  --gradient-soft: linear-gradient(135deg, rgba(99,102,241,.08), rgba(124,58,237,.05));

  /* 中性色 */
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-active: #e2e8f0;
  --bg-pill: #f1f5f9;
  --bg-2: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --text-1: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --text-4: #cbd5e1;

  /* 功能色 */
  --success: #10b981;
  --success-light: rgba(16,185,129,.12);
  --warning: #f59e0b;
  --warning-light: rgba(245,158,11,.12);
  --danger: #ef4444;
  --danger-light: rgba(239,68,68,.12);
  --info: #3b82f6;
  --info-light: #eff6ff;
  --vip: #f59e0b;

  /* 圆角 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-card: 12px;
  --r-xl: 18px;
  --r-btn: 999px;
  --r-full: 999px;

  /* 阴影 */
  --sh-sm: 0 1px 3px rgba(0,0,0,.06);
  --sh-md: 0 4px 12px rgba(0,0,0,.08);
  --sh-lg: 0 8px 30px rgba(0,0,0,.12);
  --sh-xl: 0 24px 60px -20px rgba(15,23,42,.18);
  --sh-card: 0 1px 3px rgba(0,0,0,.06);
  --sh-xs: 0 1px 2px rgba(0,0,0,.04);
  --sh-primary: 0 4px 16px rgba(99,102,241,.25);

  /* 字体 */
  --font: "OPPO Sans","MiSans",-apple-system,"SF Pro Text","Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  --font-serif: "Noto Serif SC","Source Han Serif CN","Songti SC",Georgia,serif;
  --font-mono: "SF Mono", Menlo, monospace;

  /* 动效 */
  --t-fast: 150ms cubic-bezier(.4,0,.2,1);
  --t-normal: 250ms cubic-bezier(.4,0,.2,1);
  --t-base: 250ms cubic-bezier(.4,0,.2,1);
  --t-slow: 380ms cubic-bezier(.22,1,.36,1);
}

/* 【人工修复 · Fix】导入按钮loading + 进度遮罩旋转动画 */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 【人工修复 · Fix】v5智能分析提取按钮样式 */
.ws-btn-extract {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  color: #fff;
  border: none;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}
.ws-btn-extract:hover:not(:disabled) {
  background: linear-gradient(135deg, #d97706 0%, #dc2626 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}
.ws-btn-extract:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.ws-btn-extract .ws-btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}

/* v5智能分析提取进度浮窗 */
.ws-extract-progress {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 340px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  border: 1px solid #e2e8f0;
  z-index: 9999;
  overflow: hidden;
  animation: wsSlideUp 0.3s ease;
}
@keyframes wsSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.ws-extract-progress-head {
  padding: 14px 16px;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ws-extract-progress-head .ws-spin {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.ws-extract-progress-body {
  padding: 14px 16px;
  font-size: 13px;
  color: #475569;
  line-height: 1.7;
}
.ws-extract-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}
.ws-extract-step:last-child { border-bottom: none; }
.ws-extract-step-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  margin-top: 1px;
}
.ws-extract-step-icon.done { background: #d1fae5; color: #059669; }
.ws-extract-step-icon.doing { background: #fef3c7; color: #d97706; }
.ws-extract-step-icon.pending { background: #f1f5f9; color: #94a3b8; }
.ws-extract-step-icon.error { background: #fee2e2; color: #dc2626; }
.ws-extract-progress-foot {
  padding: 10px 16px;
  background: #f8fafc;
  font-size: 12px;
  color: #64748b;
  border-top: 1px solid #f1f5f9;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-1);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ============================================================
   主内容区
   ============================================================ */
.ws-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  min-width: 0;
}

/* 页面头部 */
.ws-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}
.ws-page-title { font-size: 22px; font-weight: 700; color: var(--text-1); }
.ws-page-desc { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.ws-page-actions { display: flex; gap: 8px; }

/* 统计卡片 */
.ws-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.ws-stat-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 20px;
  border: 1px solid var(--border-light);
  transition: all var(--t-normal);
}
.ws-stat-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.ws-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.ws-stat-value { font-size: 26px; font-weight: 700; color: var(--text-1); line-height: 1.2; }
.ws-stat-label { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.ws-stat-trend { font-size: 11px; font-weight: 600; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.ws-stat-trend.up { color: var(--success); }
.ws-stat-trend.down { color: var(--danger); }

/* 双栏布局 */
.ws-two-col {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  margin-bottom: 24px;
}

/* 卡片 */
.ws-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
}
.ws-card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ws-card-title { font-size: 15px; font-weight: 600; color: var(--text-1); }
.ws-card-body { padding: 20px; }

/* 进度条 */
.ws-progress { margin-bottom: 14px; }
.ws-progress:last-child { margin-bottom: 0; }
.ws-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}
.ws-progress-name { color: var(--text-2); font-weight: 500; }
.ws-progress-value { color: var(--text-3); }
.ws-progress-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.ws-progress-bar i {
  display: block;
  height: 100%;
  background: var(--gradient);
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* 章节列表 */
.ws-chapter-list { display: flex; flex-direction: column; gap: 8px; }
.ws-chapter-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast);
}
.ws-chapter-item:hover { border-color: var(--primary); box-shadow: var(--sh-sm); }
.ws-chapter-num {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}
.ws-chapter-info { flex: 1; min-width: 0; }
.ws-chapter-title { font-size: 13px; font-weight: 600; color: var(--text-1); }
.ws-chapter-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.ws-chapter-status {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--r-full);
  flex: none;
}
.ws-chapter-status.done { background: var(--success-light); color: var(--success); }
.ws-chapter-status.writing { background: var(--info-light); color: var(--info); }
.ws-chapter-status.plan { background: var(--warning-light); color: var(--warning); }

/* 大纲模块 */
.ws-outline-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.ws-outline-block {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--t-fast);
}
.ws-outline-block:hover { border-color: var(--primary); box-shadow: var(--sh-sm); }
.ws-ob-head {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
}
.ws-ob-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ws-ob-status {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--r-full);
}
.ws-ob-status.confirmed { background: var(--success-light); color: var(--success); }
.ws-ob-status.pending { background: var(--warning-light); color: var(--warning); }
.ws-ob-body { padding: 14px 18px; }
.ws-ob-text {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ws-ob-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

/* 角色卡片 */
.ws-char-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.ws-char-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.ws-char-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--primary); }
.ws-char-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ws-char-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex: none;
}
.ws-char-name { font-size: 15px; font-weight: 700; color: var(--text-1); }
.ws-char-role { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.ws-char-desc { font-size: 12px; color: var(--text-2); line-height: 1.7; margin-bottom: 12px; }
.ws-char-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-char-tag {
  font-size: 10px;
  padding: 3px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--r-full);
  font-weight: 500;
}

/* 编辑器 */
.ws-editor-wrap {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 128px);
  max-height: calc(100vh - 128px);
  min-height: 0;
}
.ws-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  flex: none;
  position: relative;
  z-index: 100;
}
.ws-tb-group { display: flex; gap: 2px; padding-right: 10px; margin-right: 6px; border-right: 1px solid var(--border-light); }
.ws-tb-group:last-child { border-right: none; }
.ws-tb-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.ws-tb-btn:hover { background: var(--bg-hover); color: var(--text-1); }
.ws-tb-btn.active { background: var(--primary-light); color: var(--primary); }
.ws-tb-spacer { flex: 1; }

.ws-ai-bar {
  display: flex;
  gap: 10px;
  padding: 12px 18px;
  background: var(--gradient-soft);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  flex: none;
  position: relative;
  z-index: 9999;
}
.ws-ai-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
  z-index: 1000;
  pointer-events: auto !important;
}
.ws-ai-btn:hover { border-color: var(--primary); box-shadow: var(--sh-sm); }

.ws-editor-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 40px 60px;
  background: var(--bg);
  min-height: 0;
  scroll-behavior: smooth;
}

/* 自定义滚动条样式 */
.ws-editor-content::-webkit-scrollbar {
  width: 8px;
}
.ws-editor-content::-webkit-scrollbar-track {
  background: var(--bg-hover);
  border-radius: 4px;
}
.ws-editor-content::-webkit-scrollbar-thumb {
  background: var(--text-4);
  border-radius: 4px;
}
.ws-editor-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}
.ws-doc {
  max-width: 100%;
  width: 100%;
  margin: 0;
  background: transparent !important;
  padding: 0 !important;
  min-height: auto;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: none !important;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.8;
  color: #1a1a1a;
  outline: none;
}
.ws-doc h1 {
  font-size: 28px;
  font-weight: 600;
  text-align: left;
  margin-bottom: 32px;
  font-family: var(--font);
  color: var(--text-1);
  padding-bottom: 16px;
  border-bottom: 2px solid var(--primary-light);
}
.ws-doc p { margin-bottom: 20px; text-align: justify; outline: none; min-height: 1.2em; text-indent: 2em; }
.ws-doc p:focus { background: rgba(99,102,241,0.03); border-radius: 4px; }

.ws-editor-footer {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  border-top: 1px solid var(--border-light);
  font-size: 11px;
  color: var(--text-3);
}

/* ============================================================
   AI 助手浮动按钮 + 面板
   ============================================================ */
.ws-ai-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(99,102,241,0.4);
  z-index: 90;
  transition: all var(--t-normal);
  overflow: hidden;
}
.ws-ai-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(99,102,241,0.5); }
.ws-ai-fab-text { display: none; font-size: 13px; font-weight: 600; margin-left: 6px; }
.ws-ai-fab:hover { width: auto; padding: 0 18px; border-radius: var(--r-full); }
.ws-ai-fab:hover .ws-ai-fab-text { display: inline; }

.ws-ai-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 560px;
  max-height: calc(100dvh - 100px);
  background: var(--bg-card);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  z-index: 95;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: panelIn 0.3s cubic-bezier(0.4,0,0.2,1);
}
.ws-ai-panel.open { display: flex; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ws-ai-header {
  padding: 16px 18px;
  background: var(--gradient);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ws-ai-title { display: flex; align-items: center; gap: 10px; }
.ws-ai-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ws-ai-name { font-size: 14px; font-weight: 700; }
.ws-ai-status { font-size: 11px; opacity: 0.85; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.ws-ai-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; animation: pulse 2s infinite; }
.ws-ai-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  transition: all var(--t-fast);
}
.ws-ai-close:hover { background: rgba(255,255,255,0.2); color: #fff; }

.ws-ai-agents {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  flex: none;
}
.ws-agent-chip {
  flex: none;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--r-full);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.ws-agent-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.ws-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ws-ai-msg { display: flex; gap: 8px; max-width: 85%; }
.ws-ai-msg-assistant { align-self: flex-start; }
.ws-ai-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.ws-ai-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex: none;
}
.ws-ai-msg-user .ws-ai-msg-avatar { background: var(--bg-active); color: var(--text-2); }
.ws-ai-msg-content {
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.6;
}
.ws-ai-msg-assistant .ws-ai-msg-content {
  background: var(--bg);
  color: var(--text-1);
  border-bottom-left-radius: 4px;
}
.ws-ai-msg-user .ws-ai-msg-content {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ws-ai-input-wrap {
  padding: 12px 14px;
  border-top: 1px solid var(--border-light);
  flex: none;
}
.ws-ai-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 13px;
  resize: none;
  outline: none;
  transition: all var(--t-fast);
  line-height: 1.5;
}
.ws-ai-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.ws-ai-input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.ws-ai-quick { display: flex; gap: 6px; }
.ws-ai-quick span {
  font-size: 11px;
  padding: 4px 8px;
  background: var(--bg);
  border-radius: var(--r-full);
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--t-fast);
}
.ws-ai-quick span:hover { background: var(--primary-light); color: var(--primary); }
.ws-ai-send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}
.ws-ai-send:hover { transform: scale(1.08); }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1200px) {
  .ws-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ws-two-col { grid-template-columns: 1fr; }
  .ws-char-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .ws-sidebar { width: 60px; padding: 12px 6px; }
  .ws-nav-label, .ws-nav-item span, .ws-nav-badge, .ws-sidebar-footer { display: none; }
  .ws-nav-item { justify-content: center; padding: 10px; }
  .ws-project-switch, .ws-topbar-center { display: none; }
  .ws-outline-grid { grid-template-columns: 1fr; }
  .ws-doc { padding: 32px 24px; }
}
@media (max-width: 640px) {
  .ws-stats-grid { grid-template-columns: 1fr; }
  .ws-char-grid { grid-template-columns: 1fr; }
  .ws-main { padding: 16px; }
  .ws-ai-panel { width: calc(100vw - 32px); right: 16px; bottom: 16px; }
}
/* Agent 协作中心 */
.pipeline-flow {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0;
}
.pipeline-step {
  flex: none;
  width: 90px;
  text-align: center;
  padding: 14px 8px;
  background: var(--bg);
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
  transition: all var(--t-fast);
  cursor: pointer;
}
.pipeline-step:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
  border-color: var(--primary);
}
.pipeline-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin: 0 auto 8px;
  color: #fff;
}
.pipeline-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}
.pipeline-desc {
  font-size: 10px;
  color: var(--text-3);
  line-height: 1.4;
}
.pipeline-arrow {
  flex: none;
  font-size: 16px;
  color: var(--text-4);
  font-weight: 700;
}
.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--t-normal);
}
.agent-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}
.agent-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
}
.agent-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex: none;
  color: #fff;
}
.agent-card-body {
  padding: 16px 18px;
}

/* 写作区两栏布局 */
.ws-writing-layout {
  display: flex;
  gap: 16px;
  height: calc(100dvh - 56px - 24px - 48px - 16px);
  min-height: 0;
}
.ws-writing-layout .ws-editor-wrap {
  flex: 1;
  min-width: 0;
  height: 100%;
}

/* Agent 团队面板 */
.ws-agent-panel {
  width: 440px;
  flex: none;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ws-agent-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--gradient-soft);
}
.ws-agent-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ws-agent-panel-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.ws-agent-panel-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
}
.ws-agent-panel-status {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.ws-agent-online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}
.ws-agent-panel-clear {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--t-fast);
}
.ws-agent-panel-clear:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text-1);
}

/* 快捷操作 */
.ws-agent-quick-actions {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
}
.ws-agent-quick-btn {
  flex: 1;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.ws-agent-quick-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Agent 对话流 - 简约边框风格 */
.ws-agent-chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fff;
}
.ws-agent-msg {
  display: flex;
  gap: 10px;
  animation: msgIn 0.25s ease;
  max-width: 100%;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.ws-agent-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex: none;
  color: #fff;
  font-weight: 600;
}
.ws-agent-msg-body {
  flex: 1;
  min-width: 0;
}
.ws-agent-msg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.ws-agent-msg-name {
  font-size: 13px;
  font-weight: 700;
  color: #1D1D1F;
}
.ws-agent-msg-time {
  font-size: 11px;
  color: #86868B;
}
.ws-agent-msg-content {
  font-size: 14px;
  color: #1D1D1F;
  line-height: 1.7;
  background: #fff;
  padding: 10px 12px;
  border: 1px solid #E8E8ED;
  border-radius: 6px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.ws-agent-msg-user {
  flex-direction: row-reverse;
  justify-content: flex-end;
  margin-left: auto;
}
.ws-agent-msg-user .ws-agent-msg-content {
  background: #F5F5F7;
  color: #1D1D1F;
  border: 1px solid #E8E8ED;
  border-radius: 6px;
  max-width: 100%;
  margin-left: auto;
  width: auto;
}
.ws-agent-msg-user .ws-agent-msg-head {
  justify-content: flex-end;
}
.ws-agent-msg-user .ws-agent-msg-body {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
}
.ws-agent-msg-user .ws-agent-msg-avatar {
  background: #4F46E5;
}

/* Agent 输入区 - 简约风格 */
.ws-agent-input-wrap {
  border-top: 1px solid #E8E8ED;
  padding: 12px;
  flex: none;
  background: #fff;
}
.ws-agent-agent-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #E8E8ED;
  scrollbar-width: thin;
}
.ws-agent-agent-chips::-webkit-scrollbar {
  height: 4px;
}
.ws-agent-agent-chips::-webkit-scrollbar-thumb {
  background: #E8E8ED;
  border-radius: 2px;
}
.ws-agent-chip {
  flex: none;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #E8E8ED;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  color: #1D1D1F;
}
.ws-agent-chip:hover {
  border-color: #4F46E5;
  color: #4F46E5;
}
.ws-agent-chip.active {
  background: #4F46E5;
  color: #fff;
  border-color: #4F46E5;
}
.ws-agent-input-box {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: #fff;
  border: 1px solid #E8E8ED;
  border-radius: 6px;
  padding: 6px 6px 6px 10px;
  transition: border-color 0.15s ease;
}
.ws-agent-input-box:focus-within {
  border-color: #4F46E5;
}
.ws-agent-input {
  flex: 1;
  padding: 4px 0;
  border: none;
  background: transparent;
  border-radius: 0;
  font-size: 14px;
  resize: none;
  outline: none;
  line-height: 1.5;
  font-family: inherit;
  color: #1D1D1F;
  max-height: 100px;
}
.ws-agent-input::placeholder {
  color: #86868B;
}
.ws-agent-send {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: #4F46E5;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex: none;
  border: none;
}
.ws-agent-send:hover {
  background: #4338CA;
}
.ws-agent-send:active {
  transform: scale(0.95);
}

/* Agent 调教配置中心 */
.ws-agent-config-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--t-normal);
}
.ws-agent-config-card:hover {
  box-shadow: var(--sh-md);
}
.ws-agent-config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}
.ws-agent-config-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex: none;
  color: #fff;
}
.ws-agent-config-body {
  padding: 20px;
}
.ws-config-section {
  margin-bottom: 16px;
}
.ws-config-section:last-child {
  margin-bottom: 0;
}
.ws-config-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ws-config-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--text-1);
  resize: vertical;
  outline: none;
  transition: all var(--t-fast);
  line-height: 1.7;
  font-family: var(--font);
  background: var(--bg-card);
}
.ws-config-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.ws-param-row {
  margin-bottom: 12px;
}
.ws-param-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 4px;
}
.ws-param-value {
  color: var(--primary);
  font-weight: 700;
}
.ws-param-slider {
  width: 100%;
  height: 4px;
  cursor: pointer;
}
.ws-param-hint {
  font-size: 10px;
  color: var(--text-4);
  margin-top: 2px;
}
.ws-model-select {
  margin-bottom: 8px;
}
.ws-model-dropdown {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-1);
  background: var(--bg-card);
  outline: none;
  cursor: pointer;
  transition: all var(--t-fast);
}
.ws-model-dropdown:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ===== 写作区三栏布局 ===== */
.ws-writing-3col {
  display: flex;
  gap: 12px;
  height: calc(100dvh - 56px - 24px - 48px - 12px);
  min-height: 0;
}

/* 左侧标签栏 */
.wt-left-panel {
  width: 240px;
  flex: none;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.3s ease;
  height: calc(100vh - 180px);
  max-height: calc(100vh - 180px);
  min-height: 0;
}
.wt-left-panel.collapsed {
  width: 52px;
}
.wt-left-panel.collapsed .wt-tab-text,
.wt-left-panel.collapsed .wt-tab-content,
.wt-left-panel.collapsed .wt-chapter-title,
.wt-left-panel.collapsed .wt-chapter-sum,
.wt-left-panel.collapsed .wt-chapter-meta,
.wt-left-panel.collapsed .wt-chapter-num,
.wt-left-panel.collapsed .wt-add-btn,
.wt-left-panel.collapsed .wt-char-name,
.wt-left-panel.collapsed .wt-char-role,
.wt-left-panel.collapsed .wt-story-title,
.wt-left-panel.collapsed .wt-story-meta,
.wt-left-panel.collapsed .wt-story-bar,
.wt-left-panel.collapsed .wt-memory-type,
.wt-left-panel.collapsed .wt-memory-content,
.wt-left-panel.collapsed .wt-memory-source {
  display: none;
}
.wt-left-panel.collapsed .wt-tab {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.wt-left-panel.collapsed .wt-chapter-card {
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wt-left-panel.collapsed .wt-chapter-check {
  margin: 0;
}
.wt-panel-toggle {
  position: absolute;
  top: 50%;
  right: -12px;
  transform: translateY(-50%);
  width: 24px;
  height: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: none;
  border-radius: 0 8px 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  font-size: 12px;
  z-index: 100;
  transition: all var(--t-fast);
  box-shadow: 2px 0 8px rgba(0,0,0,0.06);
}
.wt-panel-toggle:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.wt-left-panel-wrap {
  position: relative;
  flex: none;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}
.wt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}
.wt-tab {
  flex: 1;
  min-width: 0;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-align: center;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.wt-tab-icon { display: inline; }
.wt-tab-text { display: inline; }
.wt-tab:hover {
  background: var(--bg-hover);
  color: var(--text-2);
}
.wt-tab.active {
  background: var(--primary-light);
  color: var(--primary);
}
.wt-tab-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  min-height: 0;
  scroll-behavior: smooth;
}

/* 自定义滚动条样式 */
.wt-tab-content::-webkit-scrollbar {
  width: 6px;
}
.wt-tab-content::-webkit-scrollbar-track {
  background: var(--bg-hover);
  border-radius: 3px;
}
.wt-tab-content::-webkit-scrollbar-thumb {
  background: var(--text-4);
  border-radius: 3px;
}
.wt-tab-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

/* 章节卡片 */
.wt-chapter-card {
  padding: 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  margin-bottom: 6px;
  border: 1px solid transparent;
  transition: all var(--t-fast);
}
.wt-chapter-card:hover {
  background: var(--bg-hover);
}
.wt-chapter-card.active {
  background: var(--primary-light);
  border-color: var(--primary);
}
.wt-chapter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.wt-chapter-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
}
.wt-chapter-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--text-4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
}
.wt-chapter-check.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.wt-chapter-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
  line-height: 1.4;
}
.wt-chapter-sum {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.wt-chapter-meta {
  font-size: 11px;
  color: var(--text-4);
}
.wt-add-btn {
  padding: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  border: 1px dashed var(--primary);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  margin-top: 8px;
}
.wt-add-btn:hover {
  background: var(--primary-light);
}

/* 角色卡片 */
.wt-char-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  margin-bottom: 4px;
  transition: all var(--t-fast);
}
.wt-char-card:hover {
  background: var(--bg-hover);
}
.wt-char-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}
.wt-char-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
}
.wt-char-role {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
}

/* 故事线卡片 */
.wt-story-card {
  padding: 10px;
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  background: var(--bg);
  border: 1px solid var(--border-light);
}
.wt-story-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 6px;
}
.wt-story-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
  flex: 1;
}
.wt-story-status {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--r-full);
  flex: none;
}
.wt-story-status.active { background: var(--info-light); color: var(--info); }
.wt-story-status.foreshadow { background: var(--warning-light); color: var(--warning); }
.wt-story-status.developing { background: var(--purple-soft); color: var(--secondary); }
.wt-story-meta {
  font-size: 10px;
  color: var(--text-3);
  margin-bottom: 6px;
}
.wt-story-bar {
  height: 4px;
  background: var(--bg-active);
  border-radius: 2px;
  overflow: hidden;
}
.wt-story-bar i {
  display: block;
  height: 100%;
  background: var(--gradient);
  border-radius: 2px;
}

/* 记忆卡片 */
.wt-memory-card {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  margin-bottom: 6px;
  background: var(--bg);
  border-left: 3px solid var(--text-4);
}
.wt-memory-card.important {
  border-left-color: var(--warning);
  background: var(--warning-light);
}
.wt-memory-type {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-3);
  margin-bottom: 4px;
}
.wt-memory-content {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 4px;
}
.wt-memory-source {
  font-size: 9px;
  color: var(--text-4);
}

/* 中间面板 */
.wt-center-panel {
  flex: 1;
  min-width: 0;
  height: 100%;
}
.wt-center-panel .ws-editor-wrap {
  height: 100%;
}

/* 顶部快捷操作栏 */
.wt-quick-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
  flex: none;
}
.wt-quick-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
}
.wt-quick-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.wt-quick-btn.primary {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
}
.wt-quick-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.wt-quick-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--r-full);
  min-width: 16px;
  text-align: center;
}
.wt-quick-badge.danger {
  background: var(--danger);
}
.wt-quick-spacer {
  flex: 1;
}
.wt-quick-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-3);
}
.wt-save-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

/* 内联AI标注 */
.wt-doc-with-annotations {
  max-width: 100%;
  margin: 0;
  padding: 40px 48px;
  position: relative;
}
.wt-anno-conflict {
  background: var(--danger-light);
  text-decoration: underline;
  text-decoration-color: var(--danger);
  text-underline-offset: 3px;
  cursor: help;
  padding: 0 2px;
  border-radius: 2px;
}
.wt-anno-index {
  background: var(--info-light);
  cursor: help;
  padding: 0 2px;
  border-radius: 2px;
}
.wt-anno-edit {
  background: var(--warning-light);
  cursor: help;
  padding: 0 2px;
  border-radius: 2px;
}
.wt-anno-edit-marker {
  position: relative;
}
.wt-annotations-panel {
  position: absolute;
  right: -280px;
  top: 120px;
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wt-anno-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-md);
  animation: annoIn 0.3s ease;
}
@keyframes annoIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}
.wt-anno-card.wt-anno-conflict {
  border-left: 3px solid var(--danger);
}
.wt-anno-card.wt-anno-edit {
  border-left: 3px solid var(--warning);
}
.wt-anno-card.wt-anno-index {
  border-left: 3px solid var(--info);
}
.wt-anno-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
}
.wt-anno-icon {
  font-size: 12px;
}
.wt-anno-title {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-1);
}
.wt-anno-close {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--t-fast);
}
.wt-anno-close:hover {
  background: var(--bg-active);
  color: var(--text-1);
}
.wt-anno-card-body {
  padding: 10px;
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.6;
}
.wt-anno-card-actions {
  display: flex;
  gap: 6px;
  padding: 0 10px 10px;
}
.wt-anno-btn {
  flex: 1;
  padding: 5px;
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid transparent;
}
.wt-anno-btn.accept {
  background: var(--success-light);
  color: var(--success);
}
.wt-anno-btn.accept:hover {
  background: var(--success);
  color: #fff;
}
.wt-anno-btn.reject {
  background: var(--bg);
  color: var(--text-3);
  border-color: var(--border-light);
}
.wt-anno-btn.reject:hover {
  background: var(--bg-active);
  color: var(--text-2);
}

/* 响应式 */
@media (max-width: 1400px) {
  .wt-annotations-panel {
    display: none;
  }
}
@media (max-width: 1100px) {
  .wt-left-panel {
    width: 180px;
  }
  .ws-agent-panel {
    width: 320px;
  }
}

/* ===== Agent 聊天增强样式 ===== */
/* 用户消息中的指令标签 */
.ws-agent-cmd-tag {
  display: inline-block;
  padding: 2px 10px;
  background: var(--gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--r-full);
  margin-right: 6px;
  letter-spacing: 0.5px;
}

/* Agent 正在执行状态 */
.ws-agent-working .ws-agent-msg-content {
  color: var(--text-3);
  font-style: italic;
}
.ws-agent-typing {
  margin-right: 4px;
}
.ws-agent-dots {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
}
.ws-agent-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  animation: agentDot 1.4s infinite ease-in-out both;
}
.ws-agent-dots i:nth-child(1) { animation-delay: -0.32s; }
.ws-agent-dots i:nth-child(2) { animation-delay: -0.16s; }
@keyframes agentDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* 扩大聊天区域内边距 */
.ws-agent-chat {
  padding: 14px 16px;
}

/* 用户消息样式优化 */
.ws-agent-msg-user .ws-agent-msg-content {
  background: var(--primary-light);
  padding: 8px 12px;
  border-radius: var(--r-md);
  border-top-right-radius: 4px;
  display: inline-block;
}

/* Agent 消息内容优化 */
.ws-agent-msg-body .ws-agent-msg-content {
  line-height: 1.7;
  font-size: 12.5px;
}

/* 输入框区域扩大 */
.ws-agent-input-wrap {
  padding: 12px 16px 14px;
}
.ws-agent-input {
  font-size: 13px;
  line-height: 1.6;
}

/* Agent 芯片区域优化 */
.ws-agent-agent-chips {
  gap: 5px;
  margin-bottom: 10px;
}
.ws-agent-chip {
  padding: 4px 9px;
  font-size: 11px;
}

/* 响应式调整 */
@media (max-width: 1300px) {
  .ws-agent-panel {
    width: 380px;
  }
}
@media (max-width: 1100px) {
  .ws-agent-panel {
    width: 340px;
  }
}

/* ===== 新建作品模态框 ===== */
.new-project-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
}
.new-project-modal.show {
  display: flex;
}
.new-project-modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.new-project-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.new-project-modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
}
.new-project-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-3);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.new-project-close:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}
.new-project-modal-body {
  padding: 24px;
}
.np-form-group {
  margin-bottom: 20px;
}
.np-form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 10px;
}
.np-required {
  color: #ef4444;
}
.np-form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-1);
  background: var(--bg);
  transition: all 0.2s;
  box-sizing: border-box;
}
.np-form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.np-form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-1);
  background: var(--bg);
  transition: all 0.2s;
  resize: vertical;
  font-family: inherit;
  line-height: 1.6;
  box-sizing: border-box;
}
.np-form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.np-form-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
  padding: 10px 12px;
  background: var(--primary-light);
  border-radius: 8px;
  color: var(--primary);
}
/* 【人工修复 · Fix】导入作品功能：Tab切换/导入方式/文件拖拽/分章预览等新增样式 */
.np-tabs {
  display: flex;
  gap: 0;
  margin: 0 -28px 0;
  padding: 0 28px;
  border-bottom: 2px solid var(--border);
}
.np-tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  display: flex;
  align-items: center;
  transition: all 0.2s;
  user-select: none;
}
.np-tab:hover {
  color: var(--primary);
}
.np-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.np-tab-panel {
  padding-top: 24px;
}
.np-import-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.np-import-method {
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
  text-align: center;
}
.np-import-method:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.np-import-method.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.np-import-panel {
  margin-top: 16px;
}
.np-file-drop {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
}
.np-file-drop:hover,
.np-file-drop.over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.np-import-notice {
  margin-top: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #faf7f2 0%, #eef2ff 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.np-chapter-preview {
  margin-top: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 240px;
  overflow-y: auto;
}
.np-chapter-preview-title {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-hover);
  position: sticky;
  top: 0;
  z-index: 1;
}
.np-chapter-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
}
.np-chapter-list-item:last-child { border-bottom: none; }
.np-chapter-list-item .ch-id {
  color: var(--primary);
  font-weight: 600;
  flex: 0 0 60px;
}
.np-chapter-list-item .ch-title {
  flex: 1;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 12px;
}
.np-chapter-list-item .ch-words {
  flex: 0 0 80px;
  text-align: right;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .np-tabs {
    margin: 0 -20px 0;
    padding: 0 20px;
  }
  .np-tab { padding: 10px 14px; font-size: 13px; }
  .np-genre-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .np-import-methods {
    grid-template-columns: 1fr;
  }
}
.np-genre-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.genre-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
}
.genre-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.genre-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.genre-icon {
  font-size: 24px;
}
.genre-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.genre-option.selected .genre-name {
  color: var(--primary);
}
.new-project-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.np-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.np-btn-ghost {
  background: var(--bg-card);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.np-btn-ghost:hover {
  background: var(--bg-hover);
}
.np-btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.np-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99,102,241,0.4);
}

@media (max-width: 640px) {
  .np-genre-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .new-project-modal-content {
    width: 95%;
  }
}

