/* AI 营销全案策划师 Agent - 样式文件 */

:root {
  --primary: #0f172a;
  --primary-light: #1e293b;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-soft: #eef2ff;
  --text: #334155;
  --text-light: #64748b;
  --text-lighter: #94a3b8;
  --bg: #f8fafc;
  --bg-white: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 24px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-width: 248px;
  --header-height: 56px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* 布局 */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-white);
  color: var(--text);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 9px 16px;
  margin: 2px 10px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.18s;
  font-size: 13px;
  border-radius: var(--radius);
  border-left: none;
}

.nav-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-section {
  padding: 18px 20px 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-lighter);
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-lighter);
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* 顶部栏 */
.header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 页面内容 */
.page-content {
  padding: 28px;
  max-width: 1100px;
}

.page-section {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 24px;
}

.page-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

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

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

.form-label-row,
.page-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.form-label-row .form-label,
.page-section-title-row .page-section-title {
  margin-bottom: 0;
}

.btn-clear {
  padding: 2px 10px;
  border: none;
  background: transparent;
  color: var(--text-lighter);
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
}

.btn-clear:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.08);
}

.analysis-data-sources {
  margin-top: 16px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-light);
}

.analysis-data-sources-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  font-size: 13px;
}

.analysis-data-method {
  margin-bottom: 6px;
}

.analysis-data-disclaimer {
  margin: 8px 0;
  padding: 8px 10px;
  background: #fffbeb;
  border-left: 3px solid var(--warning);
  line-height: 1.6;
  color: #92400e;
}

.analysis-data-list {
  margin: 6px 0 0 18px;
  line-height: 1.7;
}

.analysis-data-list a {
  color: var(--accent);
  text-decoration: none;
}

.analysis-data-list a:hover {
  text-decoration: underline;
}

.analysis-data-refs-title {
  margin-top: 10px;
  font-weight: 600;
  color: var(--text);
}

.analysis-data-time {
  margin-top: 8px;
  color: var(--text-lighter);
  font-size: 11px;
}

.proposal-preview {
  padding: 20px 24px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  line-height: 1.75;
  font-size: 14px;
  color: var(--text);
}

.proposal-preview h1,
.proposal-preview h2,
.proposal-preview h3,
.proposal-preview h4 {
  color: var(--primary);
  margin: 1.2em 0 0.6em;
  line-height: 1.35;
}

.proposal-preview h1 { font-size: 1.5em; }
.proposal-preview h2 { font-size: 1.25em; }
.proposal-preview h3 { font-size: 1.1em; }

.proposal-preview p {
  margin: 0.6em 0;
}

.proposal-preview ul,
.proposal-preview ol {
  margin: 0.6em 0 0.6em 1.4em;
}

.proposal-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.proposal-preview th,
.proposal-preview td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.form-label .required {
  color: var(--error);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  background: var(--bg-white);
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

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

.form-hint {
  font-size: 12px;
  color: var(--text-lighter);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  line-height: 1.4;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.28);
}

.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border-light);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}

.btn-success:hover {
  background: #059669;
}

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

.btn-lg {
  padding: 12px 28px;
  font-size: 14px;
}

.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.btn-danger {
  background: var(--error);
  color: #ffffff;
}

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

/* 卡片 */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow);
}

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

.card-desc {
  font-size: 13px;
  color: var(--text-light);
}

/* 表格 */
.table-container {
  overflow-x: auto;
  margin: 16px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  background: var(--bg);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

tr:hover td {
  background: rgba(15,52,96,0.02);
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.tag-blue {
  background: #e3f2fd;
  color: #1565c0;
}

.tag-green {
  background: #e8f5e9;
  color: #2e7d32;
}

.tag-orange {
  background: #fff3e0;
  color: #e65100;
}

.tag-red {
  background: #ffebee;
  color: #c62828;
}

.tag-gray {
  background: var(--bg);
  color: var(--text-light);
}

/* 步骤条 */
.steps {
  display: flex;
  margin-bottom: 28px;
  position: relative;
}

.step {
  flex: 1;
  text-align: center;
  position: relative;
  padding-bottom: 32px;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-lighter);
  position: relative;
  z-index: 2;
  transition: all 0.3s;
}

.step.active .step-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.step.completed .step-circle {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.step-label {
  font-size: 12px;
  color: var(--text-lighter);
  font-weight: 500;
}

.step.active .step-label {
  color: var(--accent);
  font-weight: 600;
}

.step.completed .step-label {
  color: var(--success);
}

.step-line {
  position: absolute;
  top: 16px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 1;
}

.step:last-child .step-line {
  display: none;
}

.step.completed .step-line {
  background: var(--success);
}

/* 进度 */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  margin: 16px 0;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* 提示框 */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-info {
  background: var(--accent-soft);
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.alert-warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.alert-success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

/* 报价计算 */
.price-calc-result {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.price-row:last-child {
  border-bottom: none;
  font-weight: 600;
  font-size: 15px;
  color: var(--primary);
  padding-top: 12px;
}

.price-label {
  color: var(--text-light);
}

.price-value {
  font-weight: 600;
  color: var(--text);
}

/* 方案预览 */
.proposal-preview {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  font-size: 14px;
  line-height: 1.8;
}

.proposal-preview h1 {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}

.proposal-preview h2 {
  font-size: 18px;
  color: var(--primary);
  margin: 28px 0 14px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}

.proposal-preview h3 {
  font-size: 15px;
  color: var(--text);
  margin: 18px 0 10px;
}

.proposal-preview p {
  margin-bottom: 10px;
  color: var(--text-light);
}

.proposal-preview table {
  margin: 14px 0;
  font-size: 13px;
}

.proposal-preview .highlight {
  background: #fff8e1;
  padding: 2px 6px;
  border-radius: 3px;
}

/* 加载状态 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-lighter);
  font-size: 13px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 10px;
}

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

/* 隐藏页面 */
.page-panel {
  display: none;
}

.page-panel.active {
  display: block;
}

/* 首页欢迎 */
.welcome-header {
  text-align: center;
  padding: 48px 28px 36px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
}

.welcome-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.welcome-header p {
  font-size: 14px;
  opacity: 0.8;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.feature-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.2s;
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

/* 完成状态 */
.completion-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

/* ========== 客户管理 ========== */
.client-list-container {
  display: grid;
  gap: 16px;
}

.client-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.client-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.client-card.active-client {
  border-color: var(--accent);
  border-left: 4px solid var(--accent);
}

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

.client-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.client-card-meta {
  font-size: 12px;
  color: var(--text-lighter);
  margin-top: 4px;
}

.client-card-actions {
  display: flex;
  gap: 6px;
}

.client-card-actions .btn {
  padding: 4px 10px;
  font-size: 11px;
}

.client-card-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 13px;
  color: var(--text-light);
}

.client-card-info-item {
  display: flex;
  justify-content: space-between;
}

.client-card-info-label {
  color: var(--text-lighter);
}

.client-card-info-value {
  color: var(--text);
  font-weight: 500;
}

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

.client-search {
  display: flex;
  gap: 12px;
  align-items: center;
}

.client-search input {
  width: 240px;
}

.client-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-lighter);
  margin-top: 4px;
}

/* ========== 沟通记录 ========== */
.comm-timeline {
  position: relative;
  padding-left: 28px;
}

.comm-timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.comm-record {
  position: relative;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.comm-record::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 20px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-white);
}

.comm-record-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.comm-record-time {
  font-size: 12px;
  color: var(--text-lighter);
}

.comm-record-stage {
  font-weight: 600;
  font-size: 14px;
  color: var(--primary);
}

.comm-record-content {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}

.comm-record-followup {
  margin-top: 10px;
  font-size: 12px;
  color: var(--warning);
  padding: 8px 12px;
  background: #fff8e1;
  border-radius: 4px;
}

.comm-record-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.comm-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

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

.wf-rail-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.wf-status-select {
  font-size: 12px !important;
  padding: 4px 8px !important;
  height: auto;
}

.project-status-select {
  font-size: 12px;
  padding: 6px 10px;
  min-width: 120px;
}

.comm-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  flex-wrap: wrap;
}

.comm-status-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comm-status-bar-label {
  font-size: 13px;
  color: var(--text-light);
}

.comm-status-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comm-status-badge.status-initial { background: #e3f2fd; color: #1565c0; }
.comm-status-badge.status-info-collecting { background: #f3e5f5; color: #7b1fa2; }
.comm-status-badge.status-proposal-drafting { background: #fff3e0; color: #e65100; }
.comm-status-badge.status-proposal-sent { background: #e8f5e9; color: #2e7d32; }
.comm-status-badge.status-negotiating { background: #fff8e1; color: #f57c00; }
.comm-status-badge.status-contract-signed { background: #e0f2f1; color: #00695c; }
.comm-status-badge.status-running { background: #e8f5e9; color: #1b5e20; }
.comm-status-badge.status-lost { background: #ffebee; color: #c62828; }
.comm-status-badge.status-paused { background: #f5f5f5; color: #9e9e9e; }

/* ========== 流程看板 ========== */
.workflow-board {
  display: grid;
  gap: 0;
}

.workflow-stage {
  display: flex;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.workflow-stage:last-child {
  border-bottom: none;
}

.workflow-stage-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-lighter);
  flex-shrink: 0;
  margin-right: 16px;
}

.workflow-stage.completed .workflow-stage-num {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.workflow-stage.in-progress .workflow-stage-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.workflow-stage-body {
  flex: 1;
}

.workflow-stage-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.workflow-stage-time {
  font-size: 12px;
  color: var(--text-lighter);
  margin-bottom: 6px;
}

.workflow-stage-notes {
  font-size: 13px;
  color: var(--text-light);
  background: var(--bg);
  padding: 8px 12px;
  border-radius: 4px;
  margin-top: 6px;
}

.workflow-log-list {
  margin-top: 16px;
}

.workflow-log-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}

.workflow-log-item:last-child {
  border-bottom: none;
}

.workflow-log-time {
  width: 140px;
  color: var(--text-lighter);
  flex-shrink: 0;
}

.workflow-log-action {
  flex: 1;
  color: var(--text);
}

.workflow-log-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-light);
  flex-shrink: 0;
}

/* ========== AI 分析加载状态 ========== */
.ai-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 28px;
  gap: 20px;
}

.ai-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ai-spin 0.9s linear infinite;
  flex-shrink: 0;
}

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

.ai-loading-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-loading-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}

.ai-loading-sub {
  font-size: 12px;
  color: var(--text-lighter);
}

/* AI 生成结果内容 */
.ai-result-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}

.ai-result-content p {
  margin-bottom: 10px;
}

/* 按钮加载状态 */
.btn-loading {
  opacity: 0.8;
  cursor: not-allowed;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

.btn-secondary .btn-spinner {
  border-color: rgba(0,0,0,0.15);
  border-top-color: var(--text);
}

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

/* AI 状态指示器 */
.ai-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 16px;
}

.ai-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 560px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-lighter);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  background: var(--bg);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ========== 多渠道输入区域 ========== */
.multi-input-area {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.multi-input-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}

.multi-input-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.multi-input-tab:hover {
  color: var(--accent);
  background: rgba(15, 52, 96, 0.04);
}

.multi-input-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--bg-white);
}

.multi-input-content {
  display: none;
  padding: 20px;
}

.multi-input-content.active {
  display: block;
}

/* ========== 截图上传 ========== */
.screenshot-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
}

.screenshot-upload-area:hover {
  border-color: var(--accent);
  background: rgba(15, 52, 96, 0.02);
}

.screenshot-upload-area.dragover {
  border-color: var(--accent);
  background: rgba(15, 52, 96, 0.05);
}

.screenshot-upload-area .upload-icon {
  font-size: 32px;
  color: var(--text-lighter);
  margin-bottom: 12px;
}

.screenshot-upload-area .upload-text {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.screenshot-upload-area .upload-hint {
  font-size: 12px;
  color: var(--text-lighter);
}

.screenshot-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.screenshot-preview img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: cover;
}

.screenshot-preview .preview-item {
  position: relative;
}

.screenshot-preview .preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.screenshot-preview .preview-remove:hover {
  background: var(--error);
}

/* ========== 手动数据录入 ========== */
.manual-data-entry {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.manual-data-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 12px;
}

.manual-data-row label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
}

.manual-data-row input,
.manual-data-row select,
.manual-data-row textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.2s;
}

.manual-data-row input:focus,
.manual-data-row select:focus,
.manual-data-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.08);
}

/* ========== 案例库 ========== */
.case-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.case-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--accent-light);
}

.case-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.case-card-header h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
}

.case-card-header .case-meta {
  font-size: 12px;
  color: var(--text-lighter);
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.case-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg);
  color: var(--text-light);
  border: 1px solid var(--border-light);
}

.case-tag.industry {
  background: #e3f2fd;
  color: #1565c0;
  border-color: #bbdefb;
}

.case-tag.type {
  background: #f3e5f5;
  color: #7b1fa2;
  border-color: #e1bee7;
}

.case-tag.result {
  background: #e8f5e9;
  color: #2e7d32;
  border-color: #c8e6c9;
}

/* ========== 可编辑字段 ========== */
.editable-field {
  position: relative;
  padding: 6px 8px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.2s;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editable-field:hover {
  background: var(--bg);
  border-color: var(--border-light);
}

.editable-field .field-value {
  flex: 1;
  font-size: 13px;
  color: var(--text);
}

.editable-field .field-placeholder {
  color: var(--text-lighter);
  font-style: italic;
}

.editable-field.editing {
  border-color: var(--accent);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.08);
}

.editable-field input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text);
  background: transparent;
  font-family: inherit;
  padding: 0;
}

.edit-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  color: var(--text-lighter);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  opacity: 0;
  transition: all 0.2s;
}

.editable-field:hover .edit-btn {
  opacity: 1;
}

.edit-btn:hover {
  background: var(--bg);
  color: var(--accent);
}

.editable-field.editing .edit-btn {
  opacity: 1;
  color: var(--success);
}

/* ========== 跟进提醒 ========== */
.reminder-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: all 0.2s;
}

.reminder-card:hover {
  box-shadow: var(--shadow);
}

.reminder-card.overdue {
  border-left: 4px solid var(--error);
  background: #fff5f5;
}

.reminder-card.due-today {
  border-left: 4px solid var(--warning);
  background: #fffaf5;
}

.reminder-card.upcoming {
  border-left: 4px solid var(--accent);
}

.reminder-client {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  min-width: 120px;
}

.reminder-date {
  font-size: 13px;
  color: var(--text-light);
  min-width: 100px;
}

.reminder-action {
  display: flex;
  gap: 8px;
}

/* ========== 版本历史 ========== */
.version-list {
  max-height: 360px;
  overflow-y: auto;
}

.version-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.2s;
}

.version-item:hover {
  background: var(--bg);
}

.version-item:last-child {
  border-bottom: none;
}

.version-item.current {
  background: rgba(46, 125, 50, 0.04);
}

.version-time {
  font-size: 12px;
  color: var(--text-lighter);
  min-width: 100px;
}

.version-action {
  display: flex;
  gap: 8px;
}

.version-action .btn {
  padding: 3px 10px;
  font-size: 11px;
}

/* ========== 行内编辑 ========== */
.inline-editable {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: all 0.15s;
  display: inline-block;
  min-width: 40px;
}

.inline-editable:hover {
  background: var(--bg);
  border-color: var(--border-light);
}

.inline-editable.editing {
  border-color: var(--accent);
  background: var(--bg-white);
  outline: none;
}

.inline-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.inline-edit-btn:hover {
  background: var(--bg);
  border-color: var(--accent-light);
}

.inline-edit-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  margin-top: 8px;
}

.inline-edit-toolbar button {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-white);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.inline-edit-toolbar button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.inline-edit-toolbar button.btn-save {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.inline-edit-toolbar button.btn-save:hover {
  background: var(--accent-light);
}

.inline-edit-toolbar button.btn-cancel {
  color: var(--text-light);
}

/* ========== 飞书推送弹窗样式 ========== */
.feishu-push-modal .push-target-list {
  max-height: 240px;
  overflow-y: auto;
  margin: 12px 0;
}

.feishu-push-modal .push-target-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: background 0.2s;
}

.feishu-push-modal .push-target-item:hover {
  background: var(--bg);
}

.feishu-push-modal .push-target-item input[type="checkbox"] {
  margin-right: 12px;
  accent-color: var(--accent);
}

.feishu-push-modal .push-target-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.feishu-push-modal .push-target-id {
  font-size: 12px;
  color: var(--text-lighter);
}

.feishu-push-modal .push-preview {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.8;
  max-height: 300px;
  overflow-y: auto;
}

.feishu-push-modal .push-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-top: 12px;
}

.feishu-push-modal .push-status.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.feishu-push-modal .push-status.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

.feishu-push-modal .push-status.pending {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffe0b2;
}

.feishu-push-modal .push-log {
  margin-top: 16px;
}

.feishu-push-modal .push-log-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.feishu-push-modal .push-log-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-light);
  border-bottom: 1px dashed var(--border-light);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
  }

  .main-content {
    margin-left: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .client-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .client-card-info {
    grid-template-columns: 1fr;
  }

  .client-list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .client-search {
    width: 100%;
  }

  .client-search input {
    flex: 1;
    width: auto;
  }

  .comm-timeline {
    padding-left: 20px;
  }

  .workflow-log-time {
    width: 100px;
  }

  .modal {
    width: 95vw;
  }

  .modal-header {
    padding: 16px 18px 12px;
  }

  .modal-body {
    padding: 16px 18px;
  }

  .modal-footer {
    padding: 12px 18px 16px;
  }

  .page-content {
    padding: 16px;
  }

  .page-section {
    padding: 18px;
  }

  .proposal-preview {
    padding: 24px;
  }

  .welcome-header {
    padding: 32px 18px 24px;
  }

  .welcome-header h1 {
    font-size: 20px;
  }

  .multi-input-tabs {
    overflow-x: auto;
    white-space: nowrap;
  }

  .multi-input-tab {
    padding: 8px 14px;
    font-size: 12px;
  }

  .manual-data-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .manual-data-row label {
    text-align: left;
  }

  .reminder-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .screenshot-preview {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .case-card-header {
    flex-direction: column;
    gap: 6px;
  }

  .version-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .inline-edit-toolbar {
    flex-wrap: wrap;
  }
}

/* ========== Toast 提示 ========== */
.toast-container {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: auto;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  background: #d1fae5;
  color: #047857;
}

.toast-warning .toast-icon {
  background: #fef3c7;
  color: #b45309;
}

.toast-error .toast-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.toast-info .toast-icon {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ========== 项目中心 Tab ========== */
.project-center-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--border-light);
  border-radius: var(--radius-lg);
  width: fit-content;
}

.project-tab {
  border: none;
  background: transparent;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}

.project-tab:hover {
  color: var(--accent);
}

.project-tab.active {
  background: var(--bg-white);
  color: var(--accent);
  box-shadow: var(--shadow);
  font-weight: 600;
}
