/* ============ 基础样式 ============ */
:root {
  --primary: #4A90D9;
  --primary-dark: #3570B0;
  --primary-light: #E8F1FB;
  --danger: #E74C3C;
  --danger-light: #FDE8E8;
  --success: #27AE60;
  --success-light: #E8F8EF;
  --warning: #F39C12;
  --warning-light: #FEF5E7;
  --text: #333333;
  --text-secondary: #666666;
  --text-light: #999999;
  --bg: #F5F6FA;
  --bg-white: #FFFFFF;
  --border: #E4E7ED;
  --border-light: #F0F2F5;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
  --radius: 8px;
  --radius-sm: 4px;
  --sidebar-width: 220px;
  --topbar-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.5;
}

.hidden { display: none !important; }

/* ============ 登录页 ============ */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #4A90D9 0%, #3570B0 100%);
}

.login-card {
  background: var(--bg-white);
  border-radius: 16px;
  padding: 48px 40px;
  width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  text-align: center;
}

.login-logo { margin-bottom: 16px; }

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

.login-subtitle {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 32px;
}

.login-form .form-group {
  margin-bottom: 20px;
  text-align: left;
}

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

.login-form .form-group input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 16px;
  font-size: 14px;
  transition: border-color 0.2s;
  background: var(--bg);
}

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

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

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

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #C0392B; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover { background: #219A52; }

.btn-warning {
  background: var(--warning);
  color: white;
}
.btn-warning:hover { background: #D68910; }

.btn-info {
  background: #17A2B8;
  color: white;
}
.btn-info:hover { background: #138496; }

.btn-sm { height: 28px; padding: 0 12px; font-size: 12px; }
.btn-block { width: 100%; }

.btn-group {
  display: flex;
  gap: 8px;
}

/* ============ 顶部栏 ============ */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-bar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

/* ============ 通知铃铛 ============ */
.notification-bell {
  position: relative;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s;
}
.notification-bell:hover {
  background: var(--primary-light);
}
.bell-icon {
  font-size: 20px;
  line-height: 1;
}
.notification-badge {
  position: absolute;
  top: 0;
  right: -2px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 4px;
}
.notification-badge.hidden {
  display: none !important;
}

/* ============ 通知面板 ============ */
.notification-panel {
  position: absolute;
  top: var(--topbar-height);
  right: 0;
  width: 380px;
  max-height: 480px;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.notification-panel.hidden {
  display: none !important;
}
.notification-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.notification-panel-title {
  font-weight: 600;
  font-size: 15px;
}
.notification-list {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}
.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  gap: 10px;
}
.notification-item:hover {
  background: var(--primary-light);
}
.notification-item.unread {
  background: #FFF8E8;
}
.notification-item.unread:hover {
  background: #FFEDB3;
}
.notification-item-label {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
}
.notification-item-body {
  flex: 1;
  min-width: 0;
}
.notification-item-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}
.notification-item-content {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.notification-item-meta {
  font-size: 12px;
  color: var(--text-light);
}
.notification-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

/* ============ 通知详情弹窗 ============ */
.notification-detail-card {
  padding: 20px;
}
.notification-detail-label {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  margin-bottom: 12px;
}
.notification-detail-row {
  margin-bottom: 10px;
  font-size: 14px;
}
.notification-detail-row strong {
  display: inline-block;
  width: 80px;
  color: var(--text-secondary);
}
.notification-detail-content {
  background: var(--bg);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.notification-detail-content.empty {
  color: var(--text-light);
  text-align: center;
}

.user-info {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 12px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}

/* ============ 侧边栏 ============ */
.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--topbar-height));
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 90;
}

.sidebar-section {
  padding: 16px 0 8px;
}

.sidebar-section-title {
  font-size: 11px;
  color: var(--text-light);
  padding: 0 20px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 0;
  text-decoration: none;
}

.sidebar-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.sidebar-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* ============ 主内容区 ============ */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 24px;
  min-height: calc(100vh - var(--topbar-height));
}

.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h2 {
  font-size: 20px;
  font-weight: 600;
}

/* ============ 统计卡片 ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  border: 1px solid var(--border-light);
}

.stat-card .stat-number {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
}

.stat-card .stat-label {
  font-size: 14px;
  color: var(--text-light);
}

.stat-total .stat-number { color: var(--primary); }
.stat-active .stat-number { color: var(--warning); }
.stat-deal .stat-number { color: var(--success); }

/* ============ Dashboard 图表 ============ */
.dashboard-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.chart-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.chart-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chart-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-bar-label {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 80px;
  text-align: right;
}

.chart-bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.chart-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-sm);
  transition: width 0.3s ease;
  min-width: 2px;
}

.chart-bar-fill.level-bar { background: var(--warning); }
.chart-bar-fill.province-bar { background: var(--primary); }

.chart-bar-count {
  font-size: 12px;
  color: var(--text-light);
  min-width: 30px;
}

/* ============ 最近更新 ============ */
.recent-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.recent-list {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

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

.recent-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.recent-item-badge {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
}

.badge-active { background: var(--warning-light); color: var(--warning); }
.badge-deal { background: var(--success-light); color: var(--success); }

.recent-item-name {
  font-size: 14px;
  font-weight: 500;
}

.recent-item-time {
  font-size: 12px;
  color: var(--text-light);
}

/* ============ 表格 ============ */
.table-wrap {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.data-table th {
  background: var(--bg);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table td.action-cell {
  max-width: none;
  white-space: nowrap;
  overflow: visible;
}

.data-table td.company-cell {
  max-width: none;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  min-width: 120px;
}

.data-table tr:hover td { background: var(--primary-light); }

/* 操作按钮组 */
.data-table .action-cell {
  white-space: nowrap;
}

.action-btns {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
}

/* 审核批注标签 */
.annotation-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: white;
  margin-right: 4px;
  white-space: nowrap;
}

.annotation-badge:hover {
  opacity: 0.9;
  cursor: default;
}

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

.input-search {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  font-size: 14px;
  width: 200px;
  transition: border-color 0.2s;
}

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

.input-select {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  font-size: 14px;
  background: var(--bg-white);
  cursor: pointer;
  max-width: 160px;
}

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

/* ============ 表单 ============ */
.customer-form {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

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

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

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  font-size: 14px;
  transition: border-color 0.2s;
  background: var(--bg);
}

.form-group textarea {
  height: auto;
  padding: 10px 12px;
  min-height: 80px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-white);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

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

.modal.hidden { display: none !important; }

.modal-content {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 0;
  width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-lg .modal-content { width: 720px; }

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
  padding: 0;
}

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

.modal-body {
  padding: 24px;
}

/* ============ 跟进记录 ============ */
.follow-record-list {
  margin-bottom: 16px;
}

.follow-record-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 8px;
  position: relative;
}

.follow-record-item .record-content {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 4px;
}

.follow-record-item .record-meta {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
}

.follow-record-item .delete-record {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 12px;
  color: var(--text-light);
  cursor: pointer;
}

.follow-record-item .delete-record:hover { color: var(--danger); }

.add-follow-record {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.add-follow-record textarea {
  flex: 1;
  height: 80px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  font-size: 14px;
  resize: vertical;
}

.add-follow-record textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* ============ 表单内嵌跟进记录 ============ */
.follow-records-group {
  grid-column: 1 / -1;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg);
}

.follow-records-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: block;
}

.inline-follow-records {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.inline-follow-records:empty::after {
  content: '暂无跟进记录';
  display: block;
  text-align: center;
  color: var(--text-light);
  padding: 16px;
  font-size: 13px;
}

.inline-follow-record {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
  position: relative;
}

.inline-follow-record .inline-record-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  word-break: break-all;
}

.inline-follow-record .inline-record-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.inline-follow-record .inline-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  padding: 2px;
}

.inline-follow-record .inline-delete-btn:hover { color: var(--danger); }

.inline-add-follow {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.inline-add-follow textarea {
  flex: 1;
  min-height: 60px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 14px;
  resize: vertical;
  background: var(--bg-white);
}

.inline-add-follow textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.inline-add-follow textarea::placeholder {
  color: var(--text-light);
}

.follow-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
}

.follow-count-badge:hover { background: var(--primary); color: white; }

/* ============ 重复客户提示 ============ */
.duplicate-alert {
  background: var(--danger-light);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.duplicate-alert-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 8px;
}

.duplicate-list {
  font-size: 13px;
  color: var(--text-secondary);
}

.duplicate-item {
  padding: 6px 0;
  border-bottom: 1px solid rgba(231, 76, 60, 0.2);
}

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

/* ============ 审核批注区 ============ */
.annotation-section {
  margin-bottom: 20px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border-light);
}

.annotation-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.annotation-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.annotation-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.annotation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.annotation-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: white;
  position: relative;
}

.annotation-item .annotation-text {
  font-weight: 600;
}

.annotation-item .annotation-content-text {
  font-weight: 400;
  opacity: 0.9;
}

.annotation-item .annotation-meta {
  font-size: 11px;
  opacity: 0.7;
}

.annotation-item .annotation-delete {
  background: rgba(255,255,255,0.3);
  border: none;
  color: white;
  font-size: 12px;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 2px;
  line-height: 1;
}

.annotation-item .annotation-delete:hover {
  background: rgba(255,255,255,0.6);
}

/* ============ 批注标签管理 ============ */
.annotation-label-list {
  margin-bottom: 24px;
}

.annotation-label-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 8px;
}

.annotation-label-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.annotation-label-color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-block;
}

.annotation-label-item-name {
  font-size: 14px;
  font-weight: 500;
}

.annotation-label-item-actions {
  display: flex;
  gap: 8px;
}

.add-annotation-label-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.add-annotation-label-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ============ 字段配置 ============ */
.field-category-tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  height: 32px;
  padding: 0 16px;
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

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

.field-list {
  margin-bottom: 24px;
}

.field-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 8px;
}

.field-item-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.field-item-label {
  font-size: 14px;
  font-weight: 500;
}

.field-item-type {
  font-size: 12px;
  color: var(--text-light);
  padding: 2px 8px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.field-item-required {
  font-size: 12px;
  color: var(--danger);
}

.field-item-system {
  font-size: 12px;
  color: var(--primary);
}

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

.add-field-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.add-field-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.add-field-form .form-row {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  top: 80px;
  right: 24px;
  padding: 12px 24px;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 14px;
  z-index: 300;
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

.toast.success { border-left: 4px solid var(--success); color: var(--success); }
.toast.error { border-left: 4px solid var(--danger); color: var(--danger); }
.toast.info { border-left: 4px solid var(--primary); color: var(--primary); }

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

/* ============ 空状态 ============ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-light);
}

.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-text { font-size: 14px; }

/* ============ 成交提示 ============ */
.deal-tip {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding: 12px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-section-title { display: none; }
  .sidebar-item span:not(.sidebar-icon) { display: none; }
  .sidebar-item { padding: 10px; justify-content: center; }
  .main-content { margin-left: 60px; }
  .stats-grid { grid-template-columns: 1fr; }
  .dashboard-charts { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .input-search { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
}

/* ============ 待办事项 ============ */
.todo-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 24px;
}

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

.todo-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.todo-count-badge {
  background: var(--danger);
  color: white;
  font-size: 13px;
  font-weight: 700;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.2s;
}

.todo-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.todo-item-urgent {
  border-left: 4px solid var(--danger);
  background: var(--danger-light);
}

.todo-item-normal {
  border-left: 4px solid var(--warning);
  background: var(--warning-light);
}

.todo-item-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.todo-item-body {
  flex: 1;
  min-width: 0;
}

.todo-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

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

.todo-item-company {
  font-size: 13px;
  color: var(--text-secondary);
}

.todo-item-level {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--warning-light);
  color: var(--warning);
}

.todo-item-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-light);
  flex-wrap: wrap;
}

.todo-item-days {
  color: var(--danger);
  font-weight: 600;
}

.todo-item-btn {
  flex-shrink: 0;
}

.todo-empty {
  text-align: center;
  padding: 24px;
  color: var(--success);
  font-size: 14px;
}

/* ============ 财务到期提醒 ============ */
.financial-reminder-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.financial-reminder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.financial-reminder-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.reminder-count-badge {
  background: var(--warning);
  color: white;
  font-size: 13px;
  font-weight: 700;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.reminder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.reminder-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.2s;
}

.reminder-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.reminder-item-urgent {
  border-left: 4px solid var(--danger);
  background: var(--danger-light);
}

.reminder-item-normal {
  border-left: 4px solid var(--warning);
  background: var(--warning-light);
}

.reminder-item-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.reminder-item-body {
  flex: 1;
  min-width: 0;
}

.reminder-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.reminder-item-type {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  padding: 2px 8px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}

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

.reminder-item-company {
  font-size: 13px;
  color: var(--text-secondary);
}

.reminder-item-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-light);
  flex-wrap: wrap;
}

.reminder-empty {
  text-align: center;
  padding: 24px;
  color: var(--success);
  font-size: 14px;
}

/* ============ 回复讨论区 ============ */
.reply-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px solid var(--border-light);
}

.reply-section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.reply-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.reply-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  border: 1px solid var(--border-light);
}

.reply-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.reply-item-user {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.reply-item-time {
  font-size: 12px;
  color: var(--text-light);
  margin-left: auto;
}

.reply-role-tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: white;
}

.reply-role-tag.finance {
  background: var(--success);
}

.reply-role-tag.admin {
  background: var(--primary);
}

.reply-item-content {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  word-break: break-all;
}

.reply-empty {
  text-align: center;
  padding: 16px;
  color: var(--text-light);
  font-size: 13px;
}

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

.reply-input-area textarea {
  flex: 1;
  min-height: 60px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 14px;
  resize: vertical;
  background: var(--bg-white);
}

.reply-input-area textarea:focus {
  outline: none;
  border-color: var(--primary);
}
