@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #fafafa;
  --bg-content: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f5f5f5;
  --border: #e5e5e5;
  --border-light: #f0f0f0;
  --text-1: #1a1a1a;
  --text-2: #666666;
  --text-3: #999999;
  --accent: #1a1a1a;
  --accent-light: #f5f5f5;
  --primary: #6366f1;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text-1); }

#app { display: flex; min-height: 100vh; }

/* ── 侧边栏 ── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 0;
  transition: width 0.3s ease;
}

.sidebar.collapsed {
  width: 72px;
}

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

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
}

.logo-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.sidebar.collapsed .logo-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-toggle {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  transition: all 0.15s;
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.sidebar-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-toggle {
  display: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  padding: 0 12px;
}

.sidebar.collapsed .sidebar-nav {
  align-items: center;
  padding: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.sidebar.collapsed .nav-item {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  color: currentColor;
  flex-shrink: 0;
}

.nav-text {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.sidebar.collapsed .nav-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
}

.sidebar-bottom {
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar.collapsed .sidebar-bottom {
  align-items: center;
  padding: 0;
}

/* ── 主内容 ── */
.content {
  flex: 1;
  min-width: 0;
  padding: 48px 64px;
  max-width: 1600px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 48px;
}

.header-left h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin: 0 0 8px;
  color: var(--text-1);
}

.header-subtitle {
  font-size: 14px;
  color: var(--text-3);
  margin: 0;
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg-card);
  min-width: 320px;
  transition: all .2s;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  flex-shrink: 0;
}

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font-size: 14px;
  color: var(--text-1);
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--text-3);
}

/* ── 区块 ── */
.section-block {
  margin-bottom: 56px;
}

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

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text-1);
}

.view-all {
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  transition: color .15s;
}

.view-all:hover {
  color: var(--text-1);
}

.result-count {
  font-size: 13px;
  color: var(--text-3);
}

/* ── 最近项目网格 ── */
.recent-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 16px;
}

.recent-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}

.recent-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--border);
}

.recent-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.recent-card-body {
  padding: 14px 16px;
}

.recent-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-card-meta {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
}

/* ── 筛选栏 ── */
.filter-bar {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.filter-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: wrap;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}

.pill:hover {
  border-color: var(--text-2);
  color: var(--text-1);
}

.pill.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.pill.pill-sm {
  padding: 4px 12px;
  font-size: 12px;
}

/* ── 案例网格 ── */
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.mcard {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}

.mcard:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--border);
}

.mcard img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.mcard-body {
  padding: 12px 14px;
}

.mcard-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.mcard-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-light);
  color: var(--text-2);
}

.mcard-meta {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-3);
  font-size: 14px;
  grid-column: 1 / -1;
}

/* ── 案例详情面板 ── */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.detail-overlay[hidden] {
  display: none !important;
}

/* ── 编辑弹层 ── */
.edit-modal {
  background: var(--bg-content);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

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

.edit-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-2);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.close-btn:hover {
  color: var(--text-1);
}

.case-form {
  padding: 24px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
}

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

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

.btn-primary, .btn-secondary {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

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

.btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

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

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

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

/* ── 卡片操作按钮 ── */
.mcard-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: none;
  gap: 8px;
}

.mcard:hover .mcard-actions {
  display: flex;
}

.action-btn {
  background: rgba(255, 255, 255, 0.95);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* ── 销售案例卡片 ── */
/* 销售库网格布局 */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

/* 销售库卡片 - 重新设计 */
.sales-case-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.sales-case-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
}

/* 状态标签 */
.case-status {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  z-index: 5;
  z-index: 1;
}

.status-won {
  background: #e8f8f0;
  color: #27ae60;
}

.status-lost {
  background: #fee;
  color: #e74c3c;
}

.status-active {
  background: #ecf5ff;
  color: #409eff;
}

/* 卡片头部 */
.case-card-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.case-id-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.case-id {
  font-weight: 600;
  color: var(--text-1);
  font-size: 13px;
}

.case-events {
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-content);
  padding: 2px 8px;
  border-radius: 10px;
}

.case-customer-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  margin-top: 4px;
}

/* 卡片主体 */
.case-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 信息网格 - 户型、面积、预算 */
.case-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
  background: var(--bg-content);
  border-radius: 8px;
}

.info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.info-label {
  font-size: 11px;
  color: var(--text-3);
}

.info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

/* 位置信息 */
.case-location {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-content);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-2);
}

.case-location svg {
  flex-shrink: 0;
  color: var(--primary);
}

/* 户型结构 */
.case-structure {
  font-size: 12px;
  color: var(--text-2);
  padding: 6px 10px;
  background: #fff8e1;
  border-left: 3px solid #ffc107;
  border-radius: 4px;
}

/* 风格偏好 */
.case-style {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 8px 10px;
  background: var(--bg-content);
  border-radius: 6px;
}

.style-label {
  color: var(--text-3);
  flex-shrink: 0;
}

.style-value {
  color: var(--text-1);
  font-weight: 500;
}

/* 客户关键词标签 */
.case-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-tag {
  display: inline-block;
  padding: 4px 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 11px;
  font-weight: 500;
  border-radius: 12px;
  white-space: nowrap;
}

/* 卡片底部 */
.case-card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-content);
}

.case-consultant {
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.case-customer {
  font-weight: 500;
  color: var(--text-1);
  font-size: 15px;
}

.case-info {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}

/* ── SCRM 详情界面 ── */
.scrm-detail-container {
  padding: 0;
}

.scrm-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
}

.scrm-header h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text-1);
}

.scrm-header-info {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--text-2);
}

.scrm-header-info b {
  color: var(--text-1);
  font-weight: 500;
}

.scrm-tabs {
  display: flex;
  gap: 0;
  background: var(--bg-content);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  padding: 0 32px;
}

.stage-tab {
  position: relative;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.stage-tab:hover {
  color: var(--text-1);
  background: var(--bg-hover);
}

.stage-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.stage-status {
  font-size: 11px;
  margin-left: 8px;
  opacity: 0.6;
}

.scrm-content {
  padding: 32px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* ── SCRM 阶段内容 ── */
.scrm-stage-content {
  max-width: 1200px;
}

.scrm-section {
  margin-bottom: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
}

.scrm-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0 0 20px;
}

.subsection-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0 0 12px;
}

.section-text-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-2);
  white-space: pre-wrap;
}

/* ── 核心关注 (动态总览) ── */
.scrm-critical {
  background: linear-gradient(135deg, #fff8f0 0%, #fff4e6 100%);
  border: 1px solid #f0dcc8;
}

.critical-battles {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.critical-battle-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.6);
  padding: 16px;
  border-radius: var(--radius-md);
}

.battle-badge {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: #ff8c42;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.battle-content {
  flex: 1;
}

.battle-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 8px;
}

.battle-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
  margin-bottom: 10px;
}

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

.battle-status.normal {
  background: #e8f5e9;
  color: #2e7d32;
}

.battle-status.risk {
  background: #ffebee;
  color: #c62828;
}

/* ── 空间资料 ── */
.space-images {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.space-image-item {
  flex: 0 0 calc(50% - 8px);
  max-width: calc(50% - 8px);
}

.space-image-item img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

/* ── 客户基本盘 ── */
.basic-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-field-label {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}

.profile-field-value {
  font-size: 14px;
  color: var(--text-1);
}

/* ── 问卷数据 ── */
.questionnaire-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.q-field {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.q-field:last-child {
  border-bottom: none;
}

.q-label {
  flex-shrink: 0;
  width: 100px;
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}

.q-value {
  flex: 1;
  font-size: 14px;
  color: var(--text-1);
}

.demand-section {
  background: linear-gradient(135deg, #fffbf0 0%, #fff8e6 100%);
  border: 1px solid #ffe8b3;
}

.demand-summary {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-2);
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
}

/* ── 阶段卡片 (预沟通/现场接待) ── */
.stage-card {
  border: 2px solid #4caf50;
  border-radius: var(--radius-md);
}

.stage-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.stage-card-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: #4caf50;
  color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.stage-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0;
}

.stage-card-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-2);
}

/* ── 需求与推进洞察 ── */
.insight-subsection {
  margin-bottom: 24px;
}

.insight-subsection:last-child {
  margin-bottom: 0;
}

.insight-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.insight-list li {
  padding: 10px 0;
  padding-left: 20px;
  position: relative;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-light);
}

.insight-list li:last-child {
  border-bottom: none;
}

.insight-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

/* ── 矛盾与冲突 ── */
.conflict-item {
  padding: 12px 16px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

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

.conflict-topic {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 6px;
}

.conflict-summary {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
}

/* ── 时间线 ── */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.timeline-type {
  flex-shrink: 0;
  font-weight: 500;
  color: var(--text-1);
}

.timeline-date {
  color: var(--text-3);
  font-size: 12px;
}

.timeline-creator {
  margin-left: auto;
  color: var(--text-2);
  font-size: 12px;
}

/* ── 动态总览内容 ── */
.overview-content {
  max-width: 1000px;
}

.overview-section {
  margin-bottom: 32px;
}

.overview-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0 0 16px;
}

/* ── 核心关注 ── */
.critical-section {
  background: linear-gradient(135deg, #fff5e6 0%, #ffe8cc 100%);
  border: 1px solid #ffd699;
  border-radius: var(--radius-lg);
  padding: 24px;
}

.critical-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: white;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

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

.critical-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9a3c 0%, #ff6b35 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.critical-content {
  flex: 1;
}

.critical-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 6px;
}

.critical-summary {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 8px;
}

.critical-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: #e8f4f8;
  color: #1e88a8;
}

.critical-status.risk {
  background: #ffe8e8;
  color: #d63447;
}

/* ── 客户基本盘 ── */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.profile-item {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.profile-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-value {
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.6;
}

/* ── 需求与推进洞察 ── */
.section-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-item {
  padding: 12px 16px;
  background: var(--bg-card);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
}

.section-text {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-1);
}

/* ── 紧凑时间线 ── */
.timeline-compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-compact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.15s;
}

.timeline-compact-item:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.timeline-compact-type {
  font-weight: 500;
  color: var(--text-1);
}

.timeline-compact-date {
  color: var(--text-3);
  font-size: 12px;
}

/* ── 响应式 ── */
@media (max-width: 900px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .scrm-tabs {
    padding: 0 16px;
  }

  .scrm-content {
    padding: 20px;
  }
}

.case-consultant {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ── 案例详情区块 ── */
.case-detail-section {
  margin-bottom: 32px;
}

.case-detail-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.questionnaire-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.q-item {
  padding: 12px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
}

.q-item b {
  color: var(--text-1);
  font-weight: 600;
}

/* ── 时间线列表 ── */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-item {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.timeline-item:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

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

.timeline-type {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  padding: 3px 10px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 4px;
}

.timeline-date {
  font-size: 12px;
  color: var(--text-3);
}

.timeline-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 6px;
}

.timeline-content {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.timeline-author {
  font-size: 12px;
  color: var(--text-3);
  font-style: italic;
}

.timeline-creator {
  font-size: 12px;
  color: var(--text-3);
  margin-left: 8px;
}

.timeline-action {
  font-size: 12px;
  color: var(--primary);
  margin-top: 6px;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.05);
  border-radius: 4px;
  display: inline-block;
}

.story-content {
  padding: 20px;
  background: var(--bg-card);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-1);
  box-shadow: var(--shadow-sm);
}

.detail-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(1200px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-content);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
  from {
    transform: translate(-50%, -48%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}

.detail-close {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  padding: 20px;
  background: linear-gradient(to bottom, var(--bg-content) 70%, transparent);
}

.detail-close button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 16px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.detail-close button:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.detail-hero-img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  margin-top: -50px;
}

.detail-body {
  padding: 24px 32px 40px;
}

.detail-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 16px 0 12px;
}

.detail-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--text-2);
}

.detail-meta-row {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.detail-meta-row b {
  color: var(--text-1);
  font-weight: 600;
}

.package-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-1);
}

.package-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 26px;
}

.package-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.package-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.package-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 2px;
}

.package-sub {
  font-size: 12px;
  color: var(--text-3);
}

.lock-icon {
  color: var(--text-3);
  font-size: 13px;
}

.unlock-box {
  background: var(--accent);
  color: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 12px;
}

.unlock-box .u-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.unlock-box .u-sub {
  font-size: 13px;
  opacity: 0.8;
  margin-bottom: 18px;
}

.unlock-actions {
  display: flex;
  gap: 10px;
}

.unlock-btn {
  flex: 1;
  padding: 12px;
  border-radius: 100px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.unlock-btn.primary {
  background: white;
  color: var(--accent);
}

.unlock-btn.primary:hover {
  transform: translateY(-1px);
}

.unlock-btn.secondary {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.unlock-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.25);
}

.demo-note {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  margin-top: 14px;
  line-height: 1.5;
}

/* ── 设计资料库 / 销售库 ── */
.unlocked-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 900px;
}

.unlocked-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: all .15s;
}

.unlocked-item:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.unlocked-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  max-width: 1200px;
}

.sales-toolbar {
  margin: 24px 0;
  max-width: 1200px;
}

.sales-search-bar {
  margin-bottom: 16px;
}

.sales-search-bar input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-size: 15px;
  color: var(--text);
  transition: all 0.2s;
}

.sales-search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 133, 63, 0.1);
}

.sales-search-bar input::placeholder {
  color: var(--text-muted);
}

/* 筛选器样式 */
.sales-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

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

.filter-group label {
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
}

.filter-group select {
  padding: 6px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-group select:hover {
  border-color: var(--accent);
}

.filter-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(200, 133, 63, 0.1);
}

.btn-reset {
  padding: 6px 16px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
}

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

/* 结果统计 */
.sales-results-info {
  margin: 16px 0;
  padding: 12px 16px;
  background: #F0E3D0;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  max-width: 1200px;
}


.doc-card {
  padding: 24px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all .15s;
}

.doc-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.doc-icon {
  font-size: 28px;
  margin-bottom: 4px;
}

.doc-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

.doc-sub {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

.doc-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-light);
  color: var(--text-3);
  margin-top: 4px;
}

/* ── 响应式 ── */
@media (max-width: 1200px) {
  .recent-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .case-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .2s;
  }

  .content {
    padding: 32px 24px;
  }

  .page-header {
    flex-direction: column;
    gap: 20px;
  }

  .search-box {
    width: 100%;
  }

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

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

@media (max-width: 600px) {
  .recent-grid,
  .case-grid {
    grid-template-columns: 1fr;
  }
}

/* ── SCRM iframe 详情页 ── */
.scrm-iframe-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.scrm-iframe-overlay[hidden] {
  display: none !important;
}

.scrm-iframe-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
}

.scrm-iframe-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--bg-content);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.scrm-iframe-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
}

.scrm-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: var(--accent-light);
  color: var(--text-1);
  border-color: var(--text-3);
}

.btn-back svg {
  transition: transform 0.2s ease;
}

.btn-back:hover svg {
  transform: translateX(-2px);
}

#scrmIframe {
  flex: 1;
  width: 100%;
  border: none;
  background: white;
}

/* ── 客户卡片操作按钮 ── */
.case-card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.sales-case-card:hover .case-card-actions {
  opacity: 1;
}

.action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-2);
  backdrop-filter: blur(8px);
}

.action-btn:hover {
  background: white;
  border-color: var(--text-1);
  color: var(--text-1);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.action-btn:active {
  transform: translateY(0);
}

/* ── Toast 提示 ── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 20px;
  background: var(--text-1);
  color: white;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
  white-space: nowrap;
}

.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── 对比浮层 ── */
.comparison-bar {
  position: fixed;
  bottom: 0;
  left: 220px;
  right: 0;
  background: white;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  z-index: 900;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.sidebar.collapsed ~ * .comparison-bar {
  left: 72px;
}

.comparison-content {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

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

.comparison-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

.comparison-clear {
  padding: 6px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.comparison-clear:hover {
  background: white;
  border-color: var(--text-1);
  color: var(--text-1);
}

.comparison-items {
  flex: 1;
  display: flex;
  gap: 12px;
  overflow-x: auto;
}

.comparison-item {
  position: relative;
  padding: 10px 16px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 180px;
  flex-shrink: 0;
}

.comparison-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
}

.comparison-item-info {
  font-size: 12px;
  color: var(--text-2);
}

.comparison-item-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.comparison-item-remove:hover {
  background: var(--text-1);
  color: white;
  border-color: var(--text-1);
}

.comparison-view-btn {
  padding: 10px 20px;
  background: var(--text-1);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.comparison-view-btn:hover {
  background: var(--text-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.comparison-view-btn:active {
  transform: translateY(0);
}

