:root {
  /* 颜色系统 - 合并两个调色板 */
  --primary: #6366f1;
  --primary-light: #e0e7ff;
  --primary-transparent: rgba(99, 102, 241, 0.1);
  --secondary: #8b5cf6;
  --accent: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --dark: #111827;
  
  /* 中性色 - 采用样式表1的升序命名，确保全覆盖 */
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* 间距系统 - 样式表1的rem系统 */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* 圆角系统 - 合并两个系统 */
  --radius-sm: 0.5rem;      /* 8px */
  --radius-md: 0.75rem;     /* 12px */
  --radius-lg: 1rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  --radius: 0.75rem;        /* 样式表2的兼容变量 */
  
  /* 阴影系统 - 合并两个定义 */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* 字体系统 */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Microsoft Yahei", sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  
  /* 布局变量 */
  --sidebar-width: 280px;
  --library-width: 450px;
  --library-min-width: 450px;
  --library-max-width: 1000px;
  
  /* 动画 */
  --transition: all 0.2s ease;
  --transition-bounce: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  
  /* 拖拽时的全局光标 */
  &.resizing {
    cursor: col-resize;
    user-select: none;
  }
  
  &.resizing-row {
    cursor: row-resize;
    user-select: none;
  }
  
  &.dragging {
    cursor: grabbing;
    user-select: none;
  }
}

/* 应用容器 */
.app-container {
  display: flex;
  position: relative;
   height: calc(100vh - 80px);
  box-sizing: border-box;
  overflow: auto; 
}

/* 导航栏 - 合并两个版本的最佳实践 */
.navbar {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: var(--spacing-md) var(--spacing-xl);
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .logo {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--gray-900);
}

.nav-links {
  display: flex;
  gap: 1px;
  flex: 1;
}

.nav-link {
  padding: 15px 20px;
  text-decoration: none;
  color: var(--gray-600);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--gray-50);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary);
}

/* 左侧：对话侧边栏 */
.conversation-sidebar {
  width: var(--sidebar-width);
  background: white;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.3s ease, width 0.1s ease;
  position: relative;
  
  /* 拖拽时的视觉反馈 */
  &.resizing {
    transition: none;
  }
}

.sidebar-header {
  padding: var(--spacing-xl);
  border-bottom: 1px solid var(--gray-200);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--spacing-sm);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.logo-text {
  font-weight: 700;
  font-size: var(--font-size-lg);
  color: var(--dark);
}

.logo-subtitle {
  font-size: var(--font-size-sm);
  color: var(--gray-600);
  margin-bottom: var(--spacing-lg);
  margin-left: 48px;
}

.new-task-btn {
  width: 100%;
  padding: 12px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  transition: var(--transition);
}

.new-task-btn:hover {
  background-color: #4f46e5;
}

/* 对话列表 */
.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.conversation-section {
  margin-bottom: var(--spacing-xl);
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 8px;
  border: 1px solid transparent;
  
  /* 可拖拽的对话项 */
  &[draggable="true"] {
    cursor: grab;
    
    &:hover {
      background-color: var(--gray-100);
    }
    
    &:active {
      cursor: grabbing;
    }
  }
  
  /* 拖拽中的状态 */
  &.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    box-shadow: var(--shadow-lg);
    cursor: grabbing;
  }
  
  /* 拖拽悬停目标 */
  &.drag-over {
    border: 2px dashed var(--primary);
    background-color: var(--primary-light);
    transform: translateY(2px);
  }
}

.conversation-item:hover {
  background-color: var(--gray-100);
}

.conversation-item.active {
  background-color: var(--primary-light);
  border-color: var(--primary);
}

.conversation-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  flex-shrink: 0;
}

.conversation-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.conversation-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-900);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-subtitle {
  font-size: 12px;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.status-active {
  background-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.status-pending {
  background-color: var(--warning);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.1);
}

.status-completed {
  background-color: var(--gray-400);
  box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.1);
}

/* 中间：对话主区域 */
.conversation-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
  min-width: 400px;
  max-width: calc(100vw - var(--sidebar-width) - 320px);
  overflow: hidden;
  position: relative;
  transition: width 0.1s ease;
  
  /* 拖拽时的视觉反馈 */
  &.resizing {
    transition: none;
  }
}

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

.task-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-type {
  display: inline-block;
  padding: 4px 10px;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.task-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--gray-900);
}

.task-meta {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 2px;
}

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

.conversation-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--gray-300);
  background: white;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.conversation-action-btn:hover {
  background-color: var(--gray-100);
  border-color: var(--gray-400);
}

/* 任务设置区域 - 调整为更紧凑（新修改） */
.task-settings {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--gray-200);
  background: white;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.settings-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.settings-title::before {
  content: '';
  width: 4px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
}

.settings-row {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.setting-group {
  flex: 1;
  min-width: 0;
}

.setting-label {
  font-size: var(--font-size-xs);
  color: var(--gray-600);
  margin-bottom: 4px;
  font-weight: 500;
}

.setting-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: white;
  color: var(--gray-800);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all 0.2s;
  height: 36px;
}

.setting-select:hover {
  border-color: var(--gray-400);
}

.setting-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.generate-design-btn {
  padding: 10px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--font-size-sm);
  transition: all 0.2s;
}

.generate-design-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.generate-design-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 趋势选择器样式（新修改） */
.trend-preview {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-sm);
}

.current-trend-display {
  padding: 6px 10px;
  margin-top: 8px;
  font-size: var(--font-size-xs);
}

.trend-recommendations {
  padding: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

/* ============================================
   拖拽分割线样式 - 核心拖拽交互
   ============================================ */

/* 基础拖拽手柄 */
.resize-handle {
  position: absolute;
  right: -5px;
  top: 0;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  z-index: 10;
  background-color: transparent;
  transition: var(--transition);
  
  /* 居中线条 */
  &::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    width: 2px;
    height: 100%;
    background-color: var(--gray-300);
    transition: var(--transition);
  }
  
  /* 悬停状态 */
  &:hover {
    background-color: var(--primary-transparent);
    
    &::before {
      background-color: var(--primary);
      width: 2px;
    }
    
    /* 悬停时显示拖拽图标 */
    &::after {
      content: '⋮';
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      color: var(--primary);
      font-size: 12px;
      font-weight: bold;
    }
  }
  
  /* 拖拽中状态 */
  &.resizing {
    background-color: var(--primary-transparent);
    cursor: col-resize;
    
    &::before {
      background-color: var(--primary);
      width: 2px;
      box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    }
    
    &::after {
      content: '⋮';
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      color: var(--primary);
      font-size: 12px;
      font-weight: bold;
    }
  }
}

/* 水平拖拽手柄（用于上下分栏） */
.resize-handle-horizontal {
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 10px;
  cursor: row-resize;
  z-index: 10;
  background-color: transparent;
  transition: var(--transition);
  
  &::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 100%;
    height: 2px;
    background-color: var(--gray-300);
    transition: var(--transition);
  }
  
  &:hover {
    background-color: var(--primary-transparent);
    
    &::before {
      background-color: var(--primary);
    }
    
    &::after {
      content: '⋯';
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      color: var(--primary);
      font-size: 12px;
      font-weight: bold;
      letter-spacing: 2px;
    }
  }
  
  &.resizing {
    background-color: var(--primary-transparent);
    cursor: row-resize;
    
    &::before {
      background-color: var(--primary);
      box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    }
  }
}

/* 拖拽遮罩层（防止iframe等干扰） */
.resize-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 9999;
  display: none;
  cursor: col-resize;
  
  &.active {
    display: block;
  }
  
  &.horizontal {
    cursor: row-resize;
  }
}

/* 拖拽预览线（更现代的拖拽体验） */
.resize-preview-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.8);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 100;
  
  &.visible {
    opacity: 1;
  }
}

/* 消息容器 */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  padding-bottom: 16px;
  background-color: var(--gray-50);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  margin-bottom: 24px;
  animation: fadeIn 0.3s ease;
  
  /* 可拖拽的消息 */
  &[draggable="true"] {
    cursor: grab;
    
    &:active {
      cursor: grabbing;
    }
  }
  
  /* 拖拽中 */
  &.dragging {
    opacity: 0.5;
    transform: scale(0.98) rotate(2deg);
    box-shadow: var(--shadow-lg);
  }
}

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

.message.user {
  margin-left: auto;
  justify-content: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 12px;
  align-self: flex-start;
}

.message.assistant .message-avatar {
  background-color: var(--gray-200);
  color: var(--gray-700);
}

.message.user .message-avatar {
  background-color: var(--primary-light);
  color: var(--primary);
  margin-right: 0;
  margin-left: 12px;
  order: 1;
}

.message-content {
  flex: 1;
  max-width: 70%;
}

.message.user .message-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.message-bubble {
  padding: 16px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.6;
  transition: var(--transition);
  
  /* 拖拽悬停效果 */
  &.drag-over {
    border: 2px dashed var(--primary);
    background-color: var(--primary-light);
    transform: scale(1.02);
  }
}

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

.message.assistant .message-bubble {
  background-color: white;
  color: var(--gray-900);
  border: 1px solid var(--gray-200);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow);
}

.message-time {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 6px;
  text-align: right;
}

.message.user .message-time {
  text-align: left;
}

/* 特殊消息类型：图片网格 */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.image-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  
  /* 可拖拽的图片 */
  &[draggable="true"] {
    cursor: grab;
    
    &:active {
      cursor: grabbing;
    }
  }
  
  /* 拖拽中 */
  &.dragging {
    opacity: 0.6;
    transform: scale(0.9) rotate(3deg);
    box-shadow: var(--shadow-lg);
    z-index: 100;
  }
  
  /* 放置目标 */
  &.drag-over {
    border: 3px dashed var(--primary);
    transform: scale(1.05);
    
    &::after {
      content: '释放以添加';
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: var(--primary);
      color: white;
      padding: 4px 8px;
      border-radius: var(--radius-sm);
      font-size: 12px;
      font-weight: 600;
      pointer-events: none;
    }
  }
}

.image-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.image-item.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.image-preview {
  height: 140px;
  background-color: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-info {
  padding: 10px;
  background-color: white;
}

.image-title {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-meta {
  font-size: 11px;
  color: var(--gray-600);
}

.image-select {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 2;
}

.image-select.selected {
  background-color: var(--primary);
  color: white;
}

/* 特殊消息类型：选项选择 */
.options-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.option-btn {
  padding: 10px 18px;
  background-color: white;
  border: 1px solid var(--gray-300);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  
  /* 可拖拽的选项 */
  &[draggable="true"] {
    cursor: grab;
    
    &:active {
      cursor: grabbing;
    }
  }
  
  /* 拖拽中 */
  &.dragging {
    opacity: 0.7;
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
  }
}

.option-btn:hover {
  background-color: var(--gray-100);
}

.option-btn.selected {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 特殊消息类型：表单输入 */
.form-container {
  background-color: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 12px;
}

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

.form-label {
  display: block;
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--gray-800);
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 14px;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* 右侧：素材库 */
.material-library {
  width: var(--library-width);
  background: white;
  border-left: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  min-width: var(--library-min-width);
  max-width: var(--library-max-width);
  flex-shrink: 0;
  transition: transform 0.3s ease, width 0.1s ease;
  position: relative;
  
  /* 拖拽时的视觉反馈 */
  &.resizing {
    transition: none;
  }
}

/* 素材库头部 - 更紧凑（新修改） */
.library-header {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--gray-200);
  background: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.library-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 2px;
}

.library-subtitle {
  font-size: var(--font-size-xs);
  color: var(--gray-500);
  margin-bottom: var(--spacing-sm);
}

.search-methods {
  display: flex;
  gap: 6px;
  margin-bottom: var(--spacing-md);
}

.search-method {
  flex: 1;
  padding: 6px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.search-method:hover {
  background-color: var(--gray-100);
}

.search-method.active {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.search-method-icon {
  font-size: var(--font-size-sm);
  margin-bottom: 2px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-700);
  margin: 0 auto;
}

.search-method.active .search-method-icon {
  background-color: var(--primary);
  color: white;
}

.search-method-title {
  font-weight: 600;
  font-size: var(--font-size-xs);
}



.search-input-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: var(--font-size-sm);
}

.search-input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  transition: border-color 0.2s;
  height: 36px;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.image-upload-area {
  padding: var(--spacing-md);
  margin-top: var(--spacing-sm);
  font-size: var(--font-size-xs);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: none;
  
  /* 拖拽文件悬停 */
  &.drag-over {
    border-color: var(--primary);
    background-color: var(--primary-light);
    border-style: solid;
    
    &::after {
      content: '释放以上传';
      display: block;
      margin-top: 8px;
      color: var(--primary);
      font-weight: 600;
    }
  }
}

.image-upload-area:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.upload-icon {
  font-size: var(--font-size-lg);
  margin-bottom: 6px;
  color: var(--gray-500);
}

.upload-text {
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: var(--spacing-xs);
}

.upload-hint {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* 素材库内容区域 - 调整间距（新修改） */
.library-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--spacing-lg);
  
  /* 拖拽排序时的样式 */
  &.drag-sorting {
    .library-item {
      transition: transform 0.2s;
    }
  }
}

.library-section {
  margin-bottom: var(--spacing-lg);
}

.library-section-title {
  margin-bottom: var(--spacing-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.view-all {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--spacing-sm);
}

.library-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  cursor: pointer;
  transition: var(--transition-bounce);
  margin-bottom: var(--spacing-sm);
  
  /* 可拖拽的素材项 */
  &[draggable="true"] {
    cursor: grab;
    
    &:active {
      cursor: grabbing;
    }
  }
  
  /* 拖拽中 - 幽灵效果 */
  &.dragging {
    opacity: 0.4;
    transform: scale(0.95) rotate(2deg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    cursor: grabbing;
    
    /* 拖拽时的缩略图跟随效果由JS处理 */
  }
  
  /* 放置目标 */
  &.drag-over {
    border: 2px dashed var(--primary);
    background-color: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
    
    &::before {
      content: '';
      position: absolute;
      top: -2px;
      left: -2px;
      right: -2px;
      bottom: -2px;
      border: 2px solid var(--primary);
      border-radius: var(--radius-sm);
      pointer-events: none;
    }
  }
  
  /* 排序插入标记 */
  &.insert-before::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
  }
  
  &.insert-after::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
  }
}

.library-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.library-item.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.add-to-basket {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 2;
  color: var(--gray-700);
  font-size: var(--font-size-xs);
  transition: var(--transition);
}

.add-to-basket:hover {
  background-color: var(--primary);
  color: white;
}

.add-to-basket.selected {
  background-color: var(--primary);
  color: white;
}

.library-preview {
  height: 160px;
  background-color: var(--gray-100);
  overflow: hidden;
}

.library-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
  
  /* 禁止拖拽图片本身，统一由容器处理 */
  pointer-events: none;
}

.library-item:hover .library-preview img {
  transform: scale(1.05);
}

.library-info {
  padding: 12px;
  background-color: white;
}

.library-item-title {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-item-meta {
  font-size: 11px;
  color: var(--gray-600);
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--spacing-xs);
}

.library-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.tag {
  font-size: 10px;
  padding: 2px 6px;
  background-color: var(--primary-light);
  border-radius: 10px;
  color: var(--primary);
  
  /* 可拖拽标签 */
  &[draggable="true"] {
    cursor: grab;
    
    &:active {
      cursor: grabbing;
    }
  }
  
  /* 拖拽中 */
  &.dragging {
    opacity: 0.7;
    transform: scale(1.2);
    box-shadow: var(--shadow-md);
  }
}

/* 输入区域 */
.input-container {
  padding: 20px 24px;
  border-top: 1px solid var(--gray-200);
  background-color: white;
}

.quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.quick-action {
  padding: 8px 14px;
  background-color: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  
  /* 可拖拽的快速操作 */
  &[draggable="true"] {
    cursor: grab;
    
    &:active {
      cursor: grabbing;
    }
  }
  
  /* 拖拽中 */
  &.dragging {
    opacity: 0.8;
    transform: scale(1.1) rotate(-3deg);
    box-shadow: var(--shadow-lg);
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
  }
}

.quick-action:hover {
  background-color: var(--gray-200);
}

.input-area {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.message-input {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  min-height: 56px;
  transition: var(--transition);
  
  /* 拖拽文件到输入框 */
  &.drag-over {
    border-color: var(--primary);
    background-color: var(--primary-light);
    border-style: dashed;
    border-width: 2px;
  }
}

.message-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.send-button {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: var(--primary);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.send-button:hover {
  background-color: #4f46e5;
}

.send-button:disabled {
  background-color: var(--gray-400);
  cursor: not-allowed;
}

/* 设计方案预览 */
.design-preview {
  margin-top: 16px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.design-preview-header {
  padding: 16px;
  background-color: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.design-preview-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--gray-900);
}

.design-preview-content {
  padding: 20px;
  background-color: white;
}

.design-section {
  margin-bottom: 24px;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--gray-200);
}

.design-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.design-section-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
}

.design-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.design-image {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  cursor: pointer;
  transition: var(--transition);
  
  /* 可拖拽的设计图 */
  &[draggable="true"] {
    cursor: grab;
    
    &:active {
      cursor: grabbing;
    }
  }
  
  /* 拖拽中 */
  &.dragging {
    opacity: 0.6;
    transform: scale(0.9) rotate(5deg);
    box-shadow: var(--shadow-lg);
    z-index: 100;
  }
  
  /* 放置目标 */
  &.drag-over {
    border: 3px dashed var(--primary);
    transform: scale(1.05);
    background: var(--primary-light);
  }
}

.design-image:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.design-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.design-image-caption {
  padding: 10px;
  background-color: white;
  font-size: 12px;
  color: var(--gray-700);
  text-align: center;
}

.trend-pdf {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background-color: var(--gray-100);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  transition: var(--transition);
  cursor: pointer;
  
  /* 可拖拽的PDF */
  &[draggable="true"] {
    cursor: grab;
    
    &:active {
      cursor: grabbing;
    }
  }
  
  /* 拖拽中 */
  &.dragging {
    opacity: 0.7;
    transform: scale(1.02) rotate(1deg);
    box-shadow: var(--shadow-lg);
    background: white;
    border: 2px dashed var(--primary);
  }
}

.trend-pdf:hover {
  border-color: var(--primary);
  background: white;
  box-shadow: var(--shadow);
}

.pdf-icon {
  width: 40px;
  height: 40px;
  background-color: var(--danger);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--font-size-xl);
}

.pdf-info {
  flex: 1;
}

.pdf-title {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 4px;
}

.pdf-meta {
  font-size: 11px;
  color: var(--gray-600);
}

.pdf-download {
  color: var(--gray-400);
  cursor: pointer;
  transition: color 0.2s;
}

.trend-pdf:hover .pdf-download {
  color: var(--primary);
}

.brand-dna {
  background-color: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.brand-dna-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--primary);
}

.brand-dna-item {
  display: flex;
  margin-bottom: 8px;
  font-size: 13px;
}

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

.brand-dna-label {
  font-weight: 500;
  min-width: 80px;
  color: var(--gray-700);
  flex-shrink: 0;
}

.brand-dna-value {
  color: var(--gray-900);
  flex: 1;
}

.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding: var(--spacing-lg);
}

.action-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-btn.primary {
  background-color: var(--primary);
  color: white;
  border: none;
}

.action-btn.primary:hover {
  background-color: #4f46e5;
}

.action-btn.secondary {
  background-color: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.action-btn.secondary:hover {
  background-color: var(--gray-100);
}

/* 分享链接 */
.share-link {
  margin-top: 16px;
  padding: 16px;
  background-color: var(--accent);
  border-radius: var(--radius);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.share-link-text {
  font-size: 13px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 12px;
}

.copy-btn {
  background-color: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.copy-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* 容器样式（来自样式表2底部） */
.container {
  width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: "Microsoft Yahei", sans-serif;
}

/* 状态标签样式 */
.status-tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  color: white;
}

.status-tag.processing {
  background-color: #409eff;
}

.status-tag.completed {
  background-color: #67c23a;
}

.status-tag.canceled {
  background-color: #f56c6c;
}

/* 加载状态 */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--gray-500);
}

/* 颜色指示器 */
.color-indicator {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* 价格标签 */
.price-tag {
  color: var(--warning);
  font-weight: 600;
  background: rgba(239, 68, 68, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* 产品详情工具提示 */
.product-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  min-width: 200px;
  display: none;
}

.library-item:hover .product-tooltip {
  display: block;
}

.product-tooltip-title {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
  font-size: 12px;
}

.product-tooltip-description {
  font-size: 11px;
  color: var(--gray-600);
  line-height: 1.4;
  margin-bottom: 8px;
}

.product-tooltip-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.product-tooltip-tag {
  font-size: 10px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 1px 4px;
  border-radius: var(--radius-sm);
}

/* ============================================
   拖拽相关的工具类
   ============================================ */

/* 拖拽时的全局遮罩 */
.dragging-active {
  &::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(99, 102, 241, 0.05);
    pointer-events: none;
    z-index: 9998;
  }
}

/* 拖拽占位符（排序时使用） */
.drag-placeholder {
  background: var(--gray-100);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  opacity: 0.6;
}

/* 拖拽镜像（跟随鼠标的元素） */
.drag-mirror {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.9;
  transform: rotate(3deg) scale(1.05);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transition: none;
}

/* 禁止拖拽 */
.no-drag {
  user-drag: none;
  -webkit-user-drag: none;
}

/* 可拖拽区域光标 */
.draggable {
  cursor: grab;
  
  &:active {
    cursor: grabbing;
  }
}

/* 响应式设计 - 合并两个断点系统 */
@media (max-width: 1200px) {
  .material-library {
    width: 360px;
  }
  
  .conversation-sidebar {
    width: 260px;
  }
}

@media (max-width: 1024px) {
  .conversation-sidebar,
  .material-library {
    position: fixed;
    top: 64px;
    bottom: 0;
    z-index: 90;
    transition: var(--transition);
  }
  
  .conversation-sidebar {
    left: 0;
    transform: translateX(-100%);
  }
  
  .conversation-sidebar.active {
    transform: translateX(0);
  }
  
  .material-library {
    right: 0;
    left: auto;
    width: 400px;
    transform: translateX(100%);
  }
  
  .material-library.active {
    transform: translateX(0);
  }
  
  .conversation-main {
    max-width: 100%;
    width: 100%;
  }
  
  .resize-handle {
    display: none;
  }
  
  .library-toggle {
    display: block;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: var(--spacing-md);
  }
  
  .nav-links {
    gap: var(--spacing-md);
  }
  
  .conversation-sidebar {
    width: 280px;
    top: 0;
  }
  
  .sidebar-toggle {
    display: block;
  }
  
  .messages-container {
    padding: 16px;
  }
  
  .message-content {
    max-width: 85%;
  }
  
  .settings-row {
    flex-direction: column;
    gap: var(--spacing-md);
    flex-wrap: wrap;
  }
  
  .library-grid {
    grid-template-columns: 1fr;
  }
  
  .design-images {
    grid-template-columns: 1fr;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .quick-actions {
    flex-wrap: wrap;
  }
  
  .quick-action {
    min-width: calc(50% - var(--spacing-sm));
  }
  
  .container {
    width: 100%;
    padding: 10px;
  }
  
  /* 新增响应式调整 */
  .library-item-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .price-tag {
    align-self: flex-start;
  }
  
  /* 移动端简化拖拽效果 */
  .resize-handle,
  .resize-handle-horizontal {
    display: none;
  }
  
  .library-item,
  .image-item,
  .design-image {
    &[draggable="true"] {
      cursor: pointer;
    }
  }
}

    /* 可拖拽分割线 */
      .resize-handle {
        position: absolute;
        right: -5px;
        top: 0;
        width: 10px;
        height: 100%;
        cursor: col-resize;
        z-index: 10;
        background-color: transparent;
        transition: var(--transition);
      }

      .resize-handle:hover,
      .resize-handle.resizing {
        background-color: var(--primary-light);
      }

      .resize-handle::before {
        content: "";
        position: absolute;
        left: 4px;
        top: 0;
        width: 2px;
        height: 100%;
        background-color: var(--gray-300);
      }

      .resize-handle:hover::before,
      .resize-handle.resizing::before {
        background-color: var(--primary);
      }
      /* 新的搜索容器布局 */
.search-input-container {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* 左侧：搜索方式切换按钮组 */
.search-method-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.search-toggle-btn {
  padding: 8px 12px;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  color: var(--gray-700);
  font-size: var(--font-size-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.search-toggle-btn:hover {
  background: var(--gray-200);
  border-color: var(--gray-400);
}

.search-toggle-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 500;
}

/* 右侧：内容区域 */
.search-content-area {
  flex: 1;
  position: relative;
}

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

/* 确保上传区域样式 */
.image-upload-area {
  display: none; /* 默认隐藏 */
  padding: var(--spacing-md);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

/* 响应式调整：小屏幕时垂直排列 */
@media (max-width: 768px) {
  .search-input-container {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-md);
  }
  
  .search-method-toggle {
    flex-direction: row;
    justify-content: center;
  }
  
  .search-toggle-btn {
    flex: 1;
    justify-content: center;
  }
}

.remove-material-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s;
}
.design-image:hover .remove-material-btn {
    opacity: 1;
}

/* 生成状态消息的特殊样式 */
.generating-message .message-bubble {
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f0ff 100%);
    border: 1px solid var(--primary-light);
}

/* 设计图展示区域的调整 */
.design-images {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.design-image {
    max-width: 512px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.design-image img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s;
}

.design-image img:hover {
    transform: scale(1.02);
}

