/* ============================================================
   客户资源维护系统 — 统一样式表
   ============================================================ */

/* ==========================================================
   1. CSS 变量 (Design Tokens) — 高级简约 · 低饱和度
   ========================================================== */
:root {
  /* 主色：低饱和蓝灰，减轻视觉疲劳 */
  --color-primary: #4a6cf7;
  --color-primary-hover: #3b5de7;
  --color-primary-light: #f0f4ff;
  --color-primary-bg: #e8edff;
  --color-primary-shadow: rgba(74, 108, 247, 0.12);

  /* 危险 / 错误：柔和红 */
  --color-danger: #e5484d;
  --color-danger-hover: #d13438;
  --color-danger-light: #fef2f2;
  --color-danger-bg: #fef2f2;
  --color-danger-text: #991b1b;

  /* 成功：柔和绿 */
  --color-success: #46a758;
  --color-success-light: #f0fdf4;

  /* 警告：柔和琥珀 */
  --color-warning: #f5a524;
  --color-warning-light: #fffdf5;
  --color-warning-bg: #fff8eb;
  --color-warning-text: #92400e;

  /* 橙色：柔和橘 */
  --color-orange: #f76b15;
  --color-orange-hover: #e85d0d;

  /* 中性色：更细腻的灰阶 */
  --color-bg: #f7f8fa;
  --color-bg-alt: #f5f6f8;
  --color-surface: #ffffff;
  --color-border: #e8eaed;
  --color-border-light: #eef0f2;
  --color-border-input: #d1d5db;
  --color-text: #111827;
  --color-text-secondary: #6b7280;
  --color-text-muted: #9ca3af;
  --color-text-subtle: #374151;
  --color-table-header: #f9fafb;
  --color-hover-row: #f8fafc;
  --color-input-bg: #ffffff;
  --color-input-readonly: #f9fafb;
  --color-overlay: rgba(17, 24, 39, 0.35);

  /* 间距：增加更多层级，提升留白控制 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 40px;
  --space-4xl: 48px;

  /* 圆角：更柔和的曲线 */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 999px;

  /* 阴影：更轻盈、更细腻 */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.07);
  --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.08);
  --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.12);
  --shadow-primary: 0 4px 12px rgba(74, 108, 247, 0.15);
  --shadow-btn: 0 2px 8px rgba(74, 108, 247, 0.18);
  --shadow-back-top: 0 8px 24px rgba(74, 108, 247, 0.20);

  /* 字体：优化层级和行高 */
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 13px;
  --font-size-base: 14px;
  --font-size-md: 15px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 28px;
  --font-size-5xl: 32px;

  /* 控件尺寸 */
  --btn-height: 40px;
  --btn-height-sm: 32px;
  --input-height: 42px;
  --input-height-lg: 52px;

  /* 动画曲线 */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --color-primary: #8ca5ff;
  --color-primary-hover: #a5b8ff;
  --color-primary-light: #222e50;
  --color-primary-bg: #263559;
  --color-primary-shadow: rgba(140, 165, 255, 0.16);
  --color-danger: #ff777b;
  --color-danger-hover: #ff9295;
  --color-danger-light: #43272d;
  --color-danger-bg: #43272d;
  --color-danger-text: #ffb4b6;
  --color-success: #76d397;
  --color-success-light: #203a31;
  --color-warning: #f6c56d;
  --color-warning-light: #413725;
  --color-warning-bg: #413725;
  --color-warning-text: #f6c56d;
  --color-bg: #151a24;
  --color-bg-alt: #1a202c;
  --color-surface: #202735;
  --color-border: #374153;
  --color-border-light: #303a4a;
  --color-border-input: #526078;
  --color-text: #eef2f8;
  --color-text-secondary: #b8c3d3;
  --color-text-muted: #8e9aae;
  --color-text-subtle: #d5deea;
  --color-table-header: #283140;
  --color-hover-row: #2a3545;
  --color-input-bg: #222b3a;
  --color-input-readonly: #27303e;
  --color-overlay: rgba(0, 0, 0, 0.6);
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.18);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.26);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.32);
  --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.38);
  --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.48);
  --crm-ink: #eef2f8;
  --crm-muted: #b8c3d3;
  --crm-line: #374153;
  --crm-line-soft: #303a4a;
  --crm-surface: #202735;
  --crm-bg: #151a24;
  --crm-accent: #75d6a4;
  --crm-accent-hover: #94e4b9;
  --crm-blue: #9bc4f3;
  --crm-amber: #f6c56d;
  --crm-red: #ff9295;
}


/* ==========================================================
   2. Reset / Base — 精致排版
   ========================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--font-size-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

::selection {
  background: rgba(74, 108, 247, 0.15);
  color: var(--color-text);
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}


/* ==========================================================
   3. Layout — 呼吸感留白
   ========================================================== */
.page {
  padding: 32px 40px 56px;
  max-width: 1920px;
  margin: 0 auto;
}

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

.page-header > div:first-child {
  display: flex;
  align-items: baseline;
  gap: var(--space-lg);
  min-width: 0;
}

.page-title {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.page-subtitle {
  flex: 1 1 auto;
  min-width: 0;
  margin-top: var(--space-sm);
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  line-height: 1.5;
}

.back-link {
  color: var(--color-text-subtle);
  font-size: var(--font-size-md);
  cursor: pointer;
  margin-bottom: var(--space-xl);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s var(--ease-smooth);
}

.back-link:hover {
  color: var(--color-primary);
}


/* ==========================================================
   4. Buttons — 精致交互 · 微反馈
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  cursor: pointer;
  font-size: var(--font-size-md);
  font-weight: 600;
  line-height: 1;
  transition: all 0.2s var(--ease-smooth);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.15s var(--ease-smooth);
  pointer-events: none;
}

.btn:hover::after {
  opacity: 0.06;
}

.btn:active::after {
  opacity: 0.12;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.97);
}

.btn-secondary {
  background: var(--color-border-light);
  color: var(--color-text-subtle);
}

.btn-secondary:hover {
  background: #e2e5e9;
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.97);
}

.btn-danger {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

.btn-danger:hover {
  background: #fecaca;
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: translateY(0) scale(0.97);
}

.btn-small {
  padding: 6px 14px;
  font-size: var(--font-size-sm);
  height: var(--btn-height-sm);
  border-radius: var(--radius-sm);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

/* 按钮禁用状态 */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn:disabled::after {
  display: none;
}

/* 从工作台进入客户详情时，「记录跟进」按钮 3 秒闪光提醒 */
/* ==========================================================
   5. Cards — 轻盈边界 · 优雅层次
   ========================================================== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.25s var(--ease-smooth), border-color 0.25s var(--ease-smooth);
}

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

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.2px;
  position: relative;
  padding-left: 14px;
}

.card-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 3px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}

.card-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: 6px;
}


/* ==========================================================
   6. Stats — 精致数据卡片
   ========================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: 20px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  box-shadow: var(--shadow-xs);
  min-height: 88px;
  transition: all 0.25s var(--ease-smooth);
}

.stat-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: #dde1e6;
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon-blue  { background: var(--color-primary-light); color: var(--color-primary); }
.stat-icon-orange { background: var(--color-warning-light); color: var(--color-warning); }
.stat-icon-red    { background: var(--color-danger-light); color: var(--color-danger); }
.stat-icon-green  { background: var(--color-success-light); color: var(--color-success); }
.stat-icon-purple { background: #f5f3ff; color: #7c3aed; }

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}

.stat-value {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.stat-card-clickable {
  cursor: pointer;
}

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


/* ==========================================================
   7. Tables — 清晰易读 · 舒适行高
   ========================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-md);
}

thead {
  background: var(--color-table-header);
}

th,
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light);
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}

th {
  color: var(--color-text-secondary);
  font-weight: 600;
  font-size: var(--font-size-sm);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

td {
  color: var(--color-text);
}

tbody tr {
  transition: background 0.15s var(--ease-smooth);
}

tbody tr:hover {
  background: var(--color-hover-row);
}

/* 斑马纹（可选，提升可读性） */
tbody tr:nth-child(even) {
  background: #fafbfc;
}

tbody tr:nth-child(even):hover {
  background: var(--color-hover-row);
}

.table-count {
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
}

/* 空状态 — 更友好的设计 */
.empty {
  padding: 40px 28px;
  text-align: center;
  color: var(--color-text-secondary);
  background: var(--color-table-header);
  border: 1px dashed var(--color-border-input);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-md);
  line-height: 1.7;
}

.empty a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.empty a:hover {
  text-decoration: underline;
}


/* ==========================================================
   8. Forms — 优雅输入 · 清晰反馈
   ========================================================== */
input,
select,
textarea {
  font-family: inherit;
  background: var(--color-input-bg);
  transition: border-color 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.08);
  outline: none;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #c4c9d0;
}

.form-single {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.form-item {
  display: flex;
  flex-direction: column;
}

.form-item label {
  font-size: var(--font-size-sm);
  color: var(--color-text-subtle);
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

.form-item input,
.form-item select,
.form-item textarea {
  min-height: 42px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: var(--font-size-md);
  outline: none;
  color: var(--color-text);
}

.form-item textarea {
  min-height: 92px;
  padding-top: 12px;
  resize: vertical;
}

.form-actions {
  margin-top: 8px;
  display: flex;
  gap: var(--space-md);
}

.help-text {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-top: 6px;
}

.required {
  color: var(--color-danger);
}

.form-section-title {
  margin-top: var(--space-sm);
  margin-bottom: var(--space-xs);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: var(--font-size-sm);
  font-weight: 700;
}

/* 新增/编辑客户弹窗 · 紧凑多列，输入框更短 */
.modal.create-customer-modal,
#editCustomerModal .modal {
  width: min(1120px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
}

.create-customer-body {
  padding: 16px 20px !important;
  max-height: calc(100vh - 150px);
}

.create-form-compact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.create-form-compact .form-section-title {
  margin: 2px 0 0;
  padding: 7px 12px 7px 10px;
  border-left: 4px solid currentColor;
  font-size: 12px;
}

.create-form-compact .form-section-basic {
  background: #edf3ff;
  color: #315fc7;
}

.create-form-compact .form-section-business {
  background: #edf8f3;
  color: #28745d;
}

.create-form-compact .form-section-followup {
  background: #fff6e5;
  color: #99601a;
}

.create-form-compact .form-section-assets {
  background: #f4eff8;
  color: #76528a;
}

.create-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
}

.create-form-grid .form-item label {
  margin-bottom: 4px;
  font-size: 12px;
}

.create-form-grid .form-item input,
.create-form-grid .form-item select {
  min-height: 36px;
  height: 36px;
  width: 100%;
  max-width: 100%;
  padding: 0 10px;
  font-size: 13px;
  box-sizing: border-box;
}

.multi-select {
  position: relative;
  width: 100%;
}

.multi-select.open {
  z-index: 20;
}

.multi-select-trigger {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  background: var(--color-input-bg);
  color: var(--color-text);
  font-family: inherit;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  box-sizing: border-box;
}

.multi-select-trigger:hover {
  border-color: #c4c9d0;
}

.multi-select-trigger:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.08);
  outline: none;
}

.multi-select-trigger > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-select-arrow {
  flex: 0 0 auto;
  color: var(--color-text-secondary);
  font-size: 16px;
  line-height: 1;
  transition: transform 0.15s var(--ease-smooth);
}

.multi-select.open .multi-select-arrow {
  transform: rotate(180deg);
}

.multi-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: none;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-modal);
}

.multi-select.open .multi-select-menu {
  display: block;
}

.form-item .multi-select-option {
  min-height: 34px;
  margin: 0;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-item .multi-select-option:hover {
  background: var(--color-hover-row);
}

.form-item .multi-select-option input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--color-primary);
}

.multi-select-empty {
  padding: 8px;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.amount-input-wrap {
  position: relative;
  width: 100%;
}

.create-form-grid .amount-input-wrap input {
  padding-right: 34px;
}

.amount-input-wrap > span {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--color-text-secondary);
  font-size: 12px;
  pointer-events: none;
  transform: translateY(-50%);
}

.price-range-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  width: 100%;
}

.price-range-separator {
  color: var(--color-text-secondary);
  text-align: center;
}

.customer-image-upload {
  min-height: 36px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.customer-image-upload-btn {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 12px;
  border: 1px dashed var(--color-border-input);
  border-radius: var(--radius-md);
  background: var(--color-table-header);
  color: var(--color-text-subtle);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.customer-image-upload-btn:hover,
.customer-image-upload-btn:focus {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
  outline: none;
}

.customer-image-preview-grid {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.customer-image-thumb {
  position: relative;
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-table-header);
}

.customer-image-preview-btn {
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
}

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

.customer-image-actions {
  position: absolute;
  top: 3px;
  right: 3px;
  display: flex;
  gap: 3px;
}

.customer-image-action {
  width: 21px;
  height: 21px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.76);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.customer-image-action:hover,
.customer-image-action:focus {
  background: var(--color-primary);
  outline: none;
}

.customer-image-action.is-remove:hover,
.customer-image-action.is-remove:focus {
  background: var(--color-danger);
}

.create-form-grid .form-item-span2 {
  grid-column: span 2;
}

.create-form-grid .form-item-span3 {
  grid-column: 1 / -1;
}

.create-form-grid .form-item-span4 {
  grid-column: 1 / -1;
}

.field-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-left: 6px;
}

.multi-link-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.multi-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.multi-link-row input {
  flex: 1;
  min-width: 0;
}

.multi-link-remove {
  flex-shrink: 0;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  background: #fff;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.multi-link-remove:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
  background: #fff5f5;
}

.multi-link-add {
  margin: 0 0 8px 0;
  align-self: flex-start;
}

#detail_shop_link {
  white-space: normal;
  word-break: break-all;
  font-weight: 600;
}

#detail_shop_link .shop-link-item {
  display: block;
  margin: 2px 0;
}

#detail_shop_link a {
  color: var(--color-primary);
  text-decoration: none;
  word-break: break-all;
}

#detail_shop_link a:hover {
  text-decoration: underline;
}

.info-row-block {
  align-items: flex-start;
}

.info-row-block strong {
  text-align: left;
}

@media (max-width: 1100px) {
  .create-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .create-form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .create-form-grid .form-item-span2,
  .create-form-grid .form-item-span3,
  .create-form-grid .form-item-span4 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .create-form-grid {
    grid-template-columns: 1fr;
  }
  .create-form-grid .form-item-span2,
  .create-form-grid .form-item-span3,
  .create-form-grid .form-item-span4 {
    grid-column: auto;
  }
}


/* ==========================================================
   9. Search / Filter
   ========================================================== */
.search-main {
  position: relative;
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.search-main input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 0 14px 0 40px;
  font-size: var(--font-size-md);
  background: var(--color-surface);
}

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

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 16px;
  line-height: 1;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
  flex: 1;
  min-width: 0;
}

.filter-grid input,
.filter-grid select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 0 10px;
  font-size: var(--font-size-base);
  background: var(--color-surface);
}

.filter-grid .btn {
  height: 36px;
  width: 100%;
}

.filter-date-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.filter-field-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  font-weight: 600;
  padding-left: 2px;
  line-height: 1.2;
}

.filter-date-box input[type="date"] {
  width: 100%;
  height: 36px;
}

/* 客户查询区：主次分层，默认更干净 */
.customer-query-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.customer-query-header .card-title {
  margin: 0;
}

.query-more-toggle {
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-md);
}

.query-more-toggle:hover,
.query-more-toggle.is-open {
  color: var(--color-primary);
  background: #eff6ff;
}

.customer-query-primary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.customer-query-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.customer-query-actions .btn {
  height: 40px;
  min-width: 72px;
  padding: 0 14px;
}

.customer-query-actions .btn-reset-filter {
  border: 1px solid transparent;
}

.customer-query-actions .btn-reset-filter.is-filter-active {
  /* Liquid Chrome 风格：仅在筛选态启用深色金属流光按钮 */
  min-width: 88px;
  border: 2px solid #171717;
  border-radius: 999px;
  background: #090909;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06), 0 0 18px rgba(156, 163, 175, 0.30), 0 7px 16px rgba(0, 0, 0, 0.22);
  animation: reset-filter-glow 2.2s ease-in-out infinite;
}

.customer-query-actions .btn-reset-filter.is-filter-active::before {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: 0;
  border-radius: inherit;
  background:
    radial-gradient(130% 160% at 8% 0%, rgba(255, 255, 255, 0.42) 0%, transparent 32%),
    radial-gradient(120% 150% at 94% 100%, rgba(148, 163, 184, 0.42) 0%, transparent 38%),
    linear-gradient(118deg, #050505 0%, #373737 17%, #f3f4f6 29%, #0c0c0d 42%, #686868 57%, #f8fafc 69%, #090909 83%, #2d2d2d 100%);
  background-size: 100% 100%, 100% 100%, 230% 230%;
  background-position: center, center, 0% 50%;
  opacity: 0.82;
  pointer-events: none;
  animation: reset-filter-chrome 3.2s ease-in-out infinite;
  transition: opacity 0.5s var(--ease-smooth);
}

.customer-query-actions .btn-reset-filter.is-filter-active:hover::before {
  opacity: 1;
}

.customer-query-actions .btn-reset-filter.is-filter-active::after {
  z-index: 1;
}

.customer-query-actions .btn-reset-filter-label {
  position: relative;
  z-index: 2;
}

.customer-query-actions .btn-reset-filter.is-filter-active .btn-reset-filter-label {
  mix-blend-mode: difference;
}

.customer-query-actions .btn-reset-filter.is-filter-active:hover {
  background: #090909;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.10), 0 0 24px rgba(226, 232, 240, 0.46), 0 9px 20px rgba(0, 0, 0, 0.28);
}

@keyframes reset-filter-glow {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06), 0 0 12px rgba(156, 163, 175, 0.22), 0 7px 16px rgba(0, 0, 0, 0.22);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.13), 0 0 22px rgba(226, 232, 240, 0.42), 0 8px 18px rgba(0, 0, 0, 0.25);
  }
}

@keyframes reset-filter-chrome {
  0%, 100% {
    background-position: center, center, 0% 50%;
  }
  50% {
    background-position: center, center, 100% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .customer-query-actions .btn-reset-filter.is-filter-active {
    animation: none;
  }

  .customer-query-actions .btn-reset-filter.is-filter-active::before {
    animation: none;
  }
}

.customer-query-section {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.customer-query-section:last-child {
  margin-bottom: 0;
}

.customer-query-label {
  flex-shrink: 0;
  width: 36px;
  padding-top: 7px;
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.customer-query-more {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--color-border-input);
}

.customer-filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.customer-query-funnel-section {
  align-items: center;
}

.customer-query-funnel-section .customer-query-label {
  padding-top: 0;
}

@media (max-width: 900px) {
  .customer-query-primary {
    flex-direction: column;
    align-items: stretch;
  }

  .customer-query-actions {
    width: 100%;
  }

  .customer-query-actions .btn {
    flex: 1;
  }

  .customer-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-query-section {
    flex-direction: column;
    gap: 6px;
  }

  .customer-query-label {
    padding-top: 0;
  }
}


/* ==========================================================
   10. Navigation — 精致标签 · 平滑过渡
   ========================================================== */
.nav-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  margin-bottom: 24px;
}

.nav-row > .top-tabs {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.nav-page-tools {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 43px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}

.top-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #eef0f3;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 20;
}

.nav-page-tools-customer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
}

.nav-page-tools-customer .customer-query-header {
  margin-bottom: 0;
  gap: 8px;
}

.nav-page-tools-customer .customer-query-primary {
  min-width: 0;
  margin-bottom: 0;
}

.nav-page-tools-customer .customer-query-primary .search-main {
  flex: 0 1 272px;
  max-width: 272px;
}

.nav-page-tools-customer .customer-query-more {
  grid-column: 1 / -1;
  margin-top: 0;
}

.nav-page-tools-customer .customer-query-inline-filters {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.nav-page-tools-customer .customer-query-inline-filters::-webkit-scrollbar {
  display: none;
}

.nav-page-tools-customer .customer-query-inline-filters .customer-filter-control {
  flex: 0 0 128px;
  width: 128px;
  height: 40px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 0 10px;
  font-size: var(--font-size-base);
  background: var(--color-surface);
}

.nav-page-tools-customer .customer-query-section {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
}

.nav-page-tools-customer .customer-query-more-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.nav-page-tools-customer .customer-filter-overflow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  min-width: 0;
}

.nav-page-tools-customer .customer-filter-overflow:empty {
  display: none;
}

.nav-page-tools-customer .customer-filter-overflow .customer-filter-control {
  width: 100%;
  height: 36px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 0 10px;
  font-size: var(--font-size-base);
  background: var(--color-surface);
}

.nav-page-tools-followup {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
}

.nav-page-tools-followup .task-tabs {
  gap: 6px;
  flex: 0 0 auto;
  margin-bottom: 0;
  flex-wrap: nowrap;
}

.nav-page-tools-followup .task-tab {
  padding: 8px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.nav-page-tools-followup .task-filter-row {
  flex: 1 1 auto;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 180px) 76px 76px;
  gap: 8px;
}

.nav-page-tools-followup .task-filter-row-no-owner {
  grid-template-columns: minmax(0, 1fr) 76px 76px;
}

.nav-page-tools-followup .task-filter-row input,
.nav-page-tools-followup .task-filter-row select {
  height: 36px;
  padding: 0 10px;
  font-size: var(--font-size-base);
}

.nav-page-tools-followup .task-filter-row .btn {
  min-width: 0;
  height: 36px;
  padding: 0 10px;
}

@media (max-width: 1400px) and (min-width: 901px) {
  .nav-page-tools-followup .task-tabs {
    flex-wrap: wrap;
  }
}

.top-tab {
  border: none;
  background: transparent;
  color: var(--color-text-subtle);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-md);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
  text-decoration: none;
  transition: all 0.2s var(--ease-smooth);
}

.top-tab:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--color-text);
}

.top-tab.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.top-tab.active:hover {
  background: var(--color-surface);
  color: var(--color-primary);
}

.public-pool-nav-link {
  position: relative;
}

.nav-row .public-pool-nav-link {
  padding-right: 30px;
}

.public-pool-nav-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-surface);
  border-radius: var(--radius-full);
  background: var(--color-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.1px;
  box-shadow: 0 1px 3px rgba(229, 72, 77, 0.3);
  pointer-events: none;
}

.public-pool-nav-badge[hidden] {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.page-capture-btn {
  gap: 6px;
}

.page-capture-icon {
  font-size: 14px;
  line-height: 1;
}

.page-capture-btn.is-capturing {
  min-width: 126px;
}

.user-pill {
  height: var(--btn-height);
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-subtle);
  font-size: var(--font-size-base);
  transition: all 0.2s var(--ease-smooth);
}

.user-pill:hover {
  border-color: var(--color-border-input);
  box-shadow: var(--shadow-xs);
}

.role-tag {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

/* 用户账号菜单 */
.user-menu {
  position: relative;
}

.user-menu-trigger {
  height: var(--btn-height);
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-subtle);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}

.user-menu-trigger:hover {
  background: var(--color-table-header);
  border-color: var(--color-border-input);
  box-shadow: var(--shadow-xs);
}

.user-menu.open .user-menu-trigger {
  background: var(--color-table-header);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.user-menu-arrow {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-left: 2px;
  transition: transform 0.2s var(--ease-smooth);
}

.user-menu.open .user-menu-arrow {
  transform: rotate(180deg);
}

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s var(--ease-smooth), transform 0.2s var(--ease-smooth), visibility 0.2s;
}

.user-menu.open .user-menu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.user-menu-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: 4px;
}

.user-menu-identity {
  min-width: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 70px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  background: var(--color-table-header);
  color: var(--color-text-subtle);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--ease-smooth), border-color 0.2s var(--ease-smooth);
}

.theme-toggle:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.theme-toggle-icon {
  font-size: 16px;
  line-height: 1;
}

.user-menu-name {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--color-text);
}

.user-menu-role {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.user-menu-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: none;
  background: none;
  color: var(--color-text-subtle);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s var(--ease-smooth);
}

.user-menu-item:hover {
  background: var(--color-table-header);
  color: var(--color-text);
}

.user-menu-item-danger {
  color: var(--color-danger);
}

.user-menu-item-danger:hover {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

/* 系统管理下拉 */
.tab-dropdown {
  position: relative;
  display: inline-flex;
}

.dropdown-trigger {
  height: 38px;
}

.tab-dropdown-menu {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 160px;
  /* 顶部 6px 透明间距：视觉上仍有空隙，但鼠标可连续滑入，不会收起菜单 */
  padding: calc(6px + var(--space-sm)) var(--space-sm) var(--space-sm);
  background: transparent;
  border: none;
  box-shadow: none;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  pointer-events: none;
  /* 关闭：更慢 + 延迟，离开后不立刻硬收 */
  transition:
    opacity 0.45s var(--ease-out),
    transform 0.45s var(--ease-out),
    visibility 0.45s,
    pointer-events 0s linear 0.45s;
  transition-delay: 0.18s, 0.18s, 0.18s, 0s;
}

/* 实际可见的菜单面板 */
.tab-dropdown-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  bottom: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: -1;
  pointer-events: none;
}

.tab-dropdown:hover .tab-dropdown-menu,
.tab-dropdown:focus-within .tab-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  /* 打开：更慢更柔 */
  transition:
    opacity 0.4s var(--ease-out),
    transform 0.4s var(--ease-out),
    visibility 0.4s,
    pointer-events 0s linear 0s;
  transition-delay: 0s;
}

.tab-dropdown-menu a {
  color: var(--color-text-subtle);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.15s var(--ease-smooth);
}

.tab-dropdown-menu a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.tab-dropdown-menu a.active {
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
}


/* ==========================================================
   11. Modal — 优雅弹窗 · 平滑动画
   ========================================================== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease-smooth), visibility 0.25s;
  backdrop-filter: blur(4px);
  overscroll-behavior: none;
  touch-action: none;
}

.modal-mask.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s var(--ease-out);
  overscroll-behavior: contain;
  touch-action: auto;
}

.modal-body {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

html.modal-open,
body.modal-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.modal-mask.show .modal {
  transform: scale(1) translateY(0);
}

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

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
}

.modal-close {
  border: none;
  background: var(--color-border-light);
  border-radius: var(--radius-md);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: var(--font-size-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: all 0.2s var(--ease-smooth);
}

.modal-close:hover {
  background: #dfe2e6;
  color: var(--color-text);
  transform: rotate(90deg);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
}

/* 客户详情在客户列表中以大尺寸弹窗展示 */
.customer-detail-modal {
  width: min(1180px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
}

.customer-detail-modal-body {
  padding: 20px 24px 28px;
  max-height: calc(100vh - 104px);
}

.customer-detail-modal-content {
  display: block;
}

.customer-detail-modal-state {
  padding: 64px 20px;
  color: var(--color-text-secondary);
  text-align: center;
}

.customer-detail-modal-error {
  color: var(--color-danger);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
  background: var(--color-surface);
}

.daily-report-snapshot-dialog {
  width: min(1380px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 32px);
}

.daily-report-snapshot-caption {
  margin-top: 4px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.daily-report-snapshot-body {
  display: block;
  padding: 20px 24px;
  background: #eef2f7;
  max-height: calc(100vh - 190px);
  overflow: auto;
  cursor: grab;
  user-select: none;
}

.daily-report-snapshot-body.is-dragging {
  cursor: grabbing;
}

.daily-report-snapshot-stage {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-width: 100%;
  min-height: 100%;
  box-sizing: border-box;
  padding: 24px;
}

.daily-report-snapshot-image {
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  flex: 0 0 auto;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}

.daily-report-snapshot-body.is-dragging .daily-report-snapshot-image {
  cursor: grabbing;
}

.daily-report-snapshot-footer {
  align-items: center;
  justify-content: space-between;
}

.daily-report-snapshot-hint {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.daily-report-snapshot-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

@media (max-width: 700px) {
  .daily-report-snapshot-dialog {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  .daily-report-snapshot-body {
    padding: 12px;
  }

  .daily-report-snapshot-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-report-snapshot-actions {
    justify-content: flex-end;
  }
}


/* ==========================================================
   12. Tags / Badges — 柔和标签
   ========================================================== */
.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.15s var(--ease-smooth);
}

.badge-type   { background: #e8f5e9; color: #2e7d32; }
.badge-stage  { background: var(--color-primary-light); color: var(--color-primary); }
.badge-level  { background: #fff8e1; color: #f57f17; }
.badge-danger { background: var(--color-danger-light); color: var(--color-danger); }
.badge-info   { background: #eef2ff; color: #3730a3; }
.badge-light  { background: var(--color-border-light); color: var(--color-text-subtle); }
.badge-lifecycle-new { background: #fff4d6; color: #8b5e00; }
.badge-lifecycle-warm { background: #e8f1ff; color: #2457a6; }
.badge-lifecycle-loyal { background: #e8f7f1; color: #16745a; }
.badge-customer-tag { background: #eef2ff; color: #315bdc; border: 1px solid #dbe4ff; }
.badge-potential { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.badge-maintenance-normal { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge-maintenance-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge-maintenance-expired { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge-public-pool { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }


/* ==========================================================
   13. Login Page
   ========================================================== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #eef4ff 0%, #f8fafc 45%, #ffffff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 420px;
  max-width: 100%;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

.login-title {
  font-size: var(--font-size-3xl);
  font-weight: 900;
  color: var(--color-text);
  text-align: center;
}

.login-subtitle {
  margin-top: var(--space-md);
  margin-bottom: var(--space-2xl);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-btn {
  width: 100%;
  margin-top: var(--space-xs);
}

.login-tip {
  margin-top: 18px;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--color-table-header);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  text-align: center;
}


/* ==========================================================
   14. Dashboard — 精致待办卡片
   ========================================================== */

/* 紧凑待办卡片网格 */
.todo-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.todo-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  cursor: pointer;
  transition: all 0.25s var(--ease-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-xs);
}

.todo-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-primary);
  transform: translateY(-3px);
}

.todo-card:active {
  transform: translateY(-1px) scale(0.98);
}

.todo-card.is-active {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-primary);
  transform: translateY(-2px);
  background: var(--color-primary-light);
}

.todo-card.is-active .todo-card-label {
  color: var(--color-primary);
  font-weight: 700;
}

.todo-card-icon { font-size: 22px; margin-bottom: 6px; }
.todo-card-num { font-size: 28px; font-weight: 700; color: var(--color-text); line-height: 1.1; }
.todo-card-label { font-size: var(--font-size-sm); font-weight: 600; color: var(--color-text-secondary); margin-top: 4px; }
.todo-card-label small { font-weight: 700; }

.todo-card-primary { border-top: 3px solid var(--color-primary); }
.todo-card-primary .todo-card-num { color: var(--color-primary); }

.todo-card-danger { border-top: 3px solid var(--color-danger); background: #fffbfb; }
.todo-card-danger .todo-card-num { color: var(--color-danger); }
.todo-card-danger .todo-card-label small { color: var(--color-danger); }

.todo-card-success { border-top: 3px solid var(--color-success); }
.todo-card-success .todo-card-num { color: var(--color-success); }

.todo-card-info { border-top: 3px solid #7c3aed; }
.todo-card-info .todo-card-num { color: #7c3aed; }

.todo-card-warning { border-top: 3px solid var(--color-warning); background: #fffdf7; }
.todo-card-warning .todo-card-num { color: #b45309; }

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

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

/* 业务员工作台：左中右三栏同一行 */
.workbench-three-col {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(280px, 1fr) minmax(260px, 0.95fr);
  gap: 16px;
  align-items: stretch;
}

.workbench-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
}

.workbench-quick-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.workbench-quick-cards .todo-card {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border-top-width: 0;
  border-left: 3px solid transparent;
  box-shadow: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 8px;
  min-height: 44px;
}

.workbench-quick-cards .todo-card-primary { border-left-color: var(--color-primary); }
.workbench-quick-cards .todo-card-danger { border-left-color: var(--color-danger); }
.workbench-quick-cards .todo-card-success { border-left-color: var(--color-success); }
.workbench-quick-cards .todo-card-info { border-left-color: #7c3aed; }
.workbench-quick-cards .todo-card-warning { border-left-color: var(--color-warning); }

.workbench-quick-cards .todo-card:hover,
.workbench-quick-cards .todo-card.is-active {
  transform: translateY(-1px);
}

.workbench-quick-cards .todo-card-icon {
  font-size: 16px;
  margin: 0;
  line-height: 1;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}

.workbench-quick-cards .todo-card-num {
  font-size: 18px;
  line-height: 1;
  min-width: 28px;
  flex-shrink: 0;
}

.workbench-quick-cards .todo-card-label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 980px) {
  .workbench-quick-cards {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .workbench-quick-cards {
    grid-template-columns: 1fr;
  }
}

.workbench-left-list-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--color-border-light, #eef2f7);
  padding-top: 12px;
}

.workbench-left-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.workbench-panel-list,
.workbench-left-list-wrap .task-list {
  flex: 1;
  min-height: 220px;
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding-right: 2px;
}

.workbench-panel-list .dashboard-task-item,
.workbench-left-list-wrap .dashboard-task-item {
  padding: 10px 12px;
}

.workbench-panel-list .dashboard-task-meta,
.workbench-left-list-wrap .dashboard-task-meta {
  font-size: 12px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 1200px) {
  .workbench-three-col {
    grid-template-columns: 1fr 1fr;
  }
  .workbench-col-left {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .workbench-three-col {
    grid-template-columns: 1fr;
  }
  .workbench-col-left {
    grid-column: auto;
  }
  .workbench-panel-list,
  .workbench-left-list-wrap .task-list {
    max-height: 360px;
  }
}

.dashboard-task-item {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
  background: var(--color-surface);
  transition: all 0.2s var(--ease-smooth);
}

.dashboard-task-item .dashboard-task-action {
  flex: 0 0 auto;
  min-width: 64px;
  box-sizing: border-box;
}

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

.dashboard-task-main {
  min-width: 0;
}

.dashboard-task-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.dashboard-task-meta {
  margin-top: var(--space-sm);
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.dashboard-task-hint {
  margin-top: 8px;
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  font-weight: 600;
  background: var(--color-primary-light);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.card-urgent {
  border-color: var(--color-danger-light);
  background: #fffbfb;
}

.card-urgent:hover {
  border-color: #fecaca;
}

/* 本月业绩 — 精致业绩卡片 */
.performance-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.performance-actions input,
.performance-actions select {
  height: var(--btn-height);
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: var(--font-size-base);
  background: var(--color-surface);
  transition: all 0.2s var(--ease-smooth);
}

.performance-actions input:focus,
.performance-actions select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.08);
}

.performance-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.performance-summary-card {
  background: var(--color-table-header);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.2s var(--ease-smooth);
}

.performance-summary-card:hover {
  background: #f0f2f5;
}

/* 月度任务 */
.monthly-task-page-body {
  height: 100vh;
  overflow: hidden;
}

.monthly-task-page {
  height: 100vh;
  padding: 32px 40px 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.monthly-task-page > .page-header {
  flex: 0 0 auto;
  margin-bottom: 24px;
}

.monthly-task-page > .page-header .page-title {
  font-size: 22px;
}

.monthly-task-page > .page-header .page-subtitle {
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.35;
}

.monthly-task-page > .nav-row {
  flex: 0 0 auto;
  margin-bottom: 24px;
}

.monthly-task-page > .nav-row .top-tabs {
  padding: 4px;
}

.monthly-task-page > .nav-row .top-tab {
  padding: 10px 20px;
  font-size: var(--font-size-md);
}

.monthly-task-page > .nav-row .public-pool-nav-link {
  padding-right: 30px;
}

.monthly-task-hero {
  color: #fff;
  background:
    radial-gradient(circle at 84% 10%, rgba(255, 255, 255, 0.17), transparent 24%),
    linear-gradient(125deg, #2447d5 0%, #4d6ff0 56%, #718cff 100%);
  border: 0;
  overflow: hidden;
  position: relative;
  flex: 0 0 auto;
  padding: 16px 20px;
  margin-bottom: 12px;
}

.monthly-task-hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -80px;
  top: -150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 46px rgba(255, 255, 255, 0.035);
}

.monthly-task-hero-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  position: relative;
  z-index: 1;
}

.monthly-task-eyebrow {
  font-size: 13px;
  opacity: 0.82;
  margin-bottom: 3px;
}

.monthly-task-target {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -0.5px;
}

.monthly-task-status {
  font-size: 13px;
  margin-top: 3px;
  opacity: 0.88;
}

.monthly-progress-score {
  min-width: 142px;
  padding: 10px 16px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 12px 30px rgba(19, 45, 148, 0.18);
  backdrop-filter: blur(5px);
  position: relative;
  z-index: 1;
}

.monthly-progress-score span,
.monthly-progress-score strong {
  display: block;
}

.monthly-progress-score span {
  font-size: 12px;
  opacity: 0.8;
}

.monthly-progress-score strong {
  margin-top: -2px;
  font-size: 36px;
  line-height: 1.15;
  font-weight: 800;
  white-space: nowrap;
  text-shadow: 0 2px 12px rgba(17, 37, 112, 0.22);
}

.monthly-progress-block {
  position: relative;
  z-index: 1;
  margin-top: 10px;
}

.monthly-progress-caption,
.monthly-progress-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.monthly-progress-caption {
  margin-bottom: 5px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
}

.monthly-progress-caption strong {
  color: #fff;
  font-size: 14px;
}

.monthly-progress-track {
  height: 16px;
  margin: 0;
  padding: 3px;
  background: rgba(14, 34, 111, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(18, 36, 102, 0.24), 0 1px 0 rgba(255, 255, 255, 0.12);
}

.monthly-progress-fill {
  width: 0;
  height: 100%;
  min-width: 0;
  background: linear-gradient(90deg, #8be9ff 0%, #ffffff 55%, #dffbff 100%);
  border-radius: inherit;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 14px rgba(191, 246, 255, 0.88);
  transition: width 0.6s var(--ease-out);
}

.monthly-progress-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 22%, rgba(255,255,255,.72) 46%, transparent 68%);
  animation: monthlyProgressShine 2.4s linear infinite;
}

@keyframes monthlyProgressShine {
  from { transform: translateX(-120%); }
  to { transform: translateX(120%); }
}

.monthly-progress-scale {
  margin-top: 3px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.58);
}

.monthly-task-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  position: relative;
  z-index: 1;
}

.monthly-task-metrics > div {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.monthly-task-metrics .monthly-metric-achieved {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
}

.monthly-task-metrics .monthly-metric-exceeded {
  background: rgba(19, 178, 104, 0.32);
  border-color: rgba(190, 255, 221, 0.55);
  box-shadow: inset 0 0 0 1px rgba(224, 255, 238, 0.1), 0 0 18px rgba(8, 98, 57, 0.16);
}

.monthly-task-metrics .monthly-metric-exceeded span {
  color: #d9ffe9;
  opacity: 1;
  font-weight: 700;
}

.monthly-task-metrics .monthly-metric-exceeded strong {
  color: #fff;
  font-size: 18px;
  text-shadow: 0 2px 9px rgba(0, 68, 35, 0.25);
}

.monthly-task-metrics span,
.monthly-task-metrics strong {
  display: block;
}

.monthly-task-metrics span {
  font-size: 12px;
  opacity: 0.78;
  margin-bottom: 1px;
}

.monthly-task-metrics strong {
  font-size: 16px;
}

.monthly-task-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.6fr);
  gap: 12px;
  align-items: stretch;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.monthly-entry-card,
.monthly-records-card,
.monthly-admin-card {
  min-height: 0;
  margin-bottom: 0;
  padding: 16px 20px;
  overflow: hidden;
}

.monthly-records-card,
.monthly-admin-card {
  flex: 1 1 0;
}

.monthly-records-card,
.monthly-admin-card {
  display: flex;
  flex-direction: column;
}

.monthly-records-card > .card-title-row,
.monthly-admin-card > .card-title-row {
  flex: 0 0 auto;
  margin-bottom: 10px;
}

.monthly-records-card > .table-wrap,
.monthly-admin-card > .table-wrap {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
}

.monthly-add-entry-btn {
  min-width: 170px;
  box-shadow: 0 7px 18px rgba(74, 108, 247, 0.22);
}

.monthly-add-entry-btn span {
  margin-right: 2px;
  font-size: 20px;
  line-height: 0;
  font-weight: 400;
}

.monthly-records-card thead,
.monthly-admin-card thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.monthly-task-page .card-title {
  font-size: 17px;
}

.monthly-task-page .card-title::before {
  height: 18px;
}

.monthly-task-page .card-desc {
  margin-top: 3px;
  font-size: 12px;
}

.monthly-task-page th,
.monthly-task-page td {
  padding: 9px 14px;
}

.monthly-entry-form {
  margin-top: 0;
}

.monthly-entry-form label {
  display: block;
  margin: 10px 0 5px;
  font-size: 13px;
  font-weight: 650;
  color: var(--color-text);
}

.money-input-wrap,
.admin-money-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.money-input-wrap:focus-within,
.admin-money-input:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.08);
}

.money-input-wrap span,
.admin-money-input span {
  padding-left: 12px;
  color: var(--color-text-secondary);
}

.money-input-wrap input,
.admin-money-input input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 8px 12px 8px 6px;
  background: transparent;
  font: inherit;
}

.monthly-entry-form textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 72px;
  min-height: 56px;
  resize: none;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font: inherit;
}

.monthly-sales-modal {
  width: 500px;
}

.monthly-modal-subtitle {
  margin-top: 3px;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.monthly-modal-money input {
  padding-top: 13px;
  padding-bottom: 13px;
  font-size: 20px;
  font-weight: 700;
}

.monthly-modal-money > span {
  font-size: 18px;
}

.monthly-entry-form textarea:focus {
  outline: 0;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.08);
}

.monthly-form-hint,
.monthly-user-account,
.monthly-not-set {
  color: var(--color-text-secondary);
  font-size: 12px;
}

.monthly-form-hint { margin: 7px 0 9px; }
.monthly-submit-btn { width: 100%; }
.required-mark { color: var(--color-danger); }
.monthly-amount-cell { font-weight: 700; white-space: nowrap; }
.monthly-remark-cell { max-width: 360px; white-space: normal; word-break: break-word; }
.monthly-action-column { width: 76px; text-align: right; }

.monthly-delete-btn {
  border: 0;
  border-radius: 6px;
  padding: 5px 10px;
  color: var(--color-danger);
  background: var(--color-danger-light);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.monthly-delete-btn:hover {
  color: #fff;
  background: var(--color-danger);
}

.monthly-delete-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.monthly-user-name { font-weight: 650; }
.monthly-user-account { margin-top: 3px; }
.monthly-not-set { margin-top: 3px; color: var(--color-danger); }
.monthly-admin-title-row { align-items: center; }
.month-picker-label { color: var(--color-text-secondary); font-size: 13px; }
.monthly-admin-table .admin-money-input { width: 160px; }

.monthly-admin-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.monthly-filter-field {
  gap: 7px;
  flex-wrap: nowrap;
}

.monthly-admin-daily-total {
  min-width: 190px;
  padding: 8px 14px;
  border: 1px solid #cfd9ff;
  border-radius: 10px;
  background: linear-gradient(135deg, #f0f4ff, #e7edff);
  color: var(--color-primary);
}

.monthly-admin-daily-total span,
.monthly-admin-daily-total strong {
  display: block;
}

.monthly-admin-daily-total span {
  color: var(--color-text-secondary);
  font-size: 12px;
}

.monthly-admin-daily-total strong {
  margin-top: 1px;
  font-size: 20px;
  line-height: 1.25;
}

.monthly-daily-amount {
  color: var(--color-primary);
  font-size: 16px;
  font-weight: 750;
  white-space: nowrap;
}

.monthly-admin-exceeded {
  color: var(--color-success);
  font-weight: 700;
  white-space: nowrap;
}

.monthly-task-page .message:not(:empty) {
  margin-top: 8px;
}

.admin-progress-line {
  display: inline-block;
  vertical-align: middle;
  width: 140px;
  height: 10px;
  border-radius: 999px;
  background: #e9edf7;
  overflow: hidden;
  margin-right: 8px;
}

.admin-progress-line > div {
  height: 100%;
  background: linear-gradient(90deg, #4a6cf7, #7892ff);
  border-radius: inherit;
  box-shadow: 0 0 8px rgba(74, 108, 247, 0.35);
}

.admin-progress-line.is-complete > div {
  background: linear-gradient(90deg, #35a854, #66c67c);
  box-shadow: 0 0 8px rgba(53, 168, 84, 0.35);
}

.admin-progress-text { font-size: 14px; font-weight: 700; color: var(--color-text); white-space: nowrap; }

@media (max-width: 900px) {
  .monthly-task-page-body { height: auto; overflow: auto; }
  .monthly-task-page { height: auto; min-height: 100vh; overflow: visible; }
  .monthly-task-layout { grid-template-columns: 1fr; overflow: visible; }
  .monthly-task-metrics { grid-template-columns: 1fr; }
  .monthly-task-target { font-size: 30px; }
  .monthly-progress-score strong { font-size: 28px; }
  .monthly-admin-title-row { align-items: flex-start; gap: 12px; }
  .monthly-admin-filters { width: 100%; justify-content: flex-start; }
}

@media (min-width: 901px) and (max-height: 760px) {
  .monthly-task-page { padding-top: 10px; padding-bottom: 10px; }
  .monthly-task-page > .page-header { margin-bottom: 7px; }
  .monthly-task-page > .page-header .page-subtitle { display: none; }
  .monthly-task-page > .nav-row { margin-bottom: 8px; }
  .monthly-task-hero { padding-top: 11px; padding-bottom: 11px; margin-bottom: 8px; }
  .monthly-task-status { display: none; }
  .monthly-progress-block { margin-top: 6px; }
  .monthly-progress-caption { margin-bottom: 3px; }
  .monthly-progress-track { height: 13px; }
  .monthly-progress-scale { display: none; }
  .monthly-task-metrics > div { padding-top: 5px; padding-bottom: 5px; }
  .monthly-entry-card, .monthly-records-card, .monthly-admin-card { padding-top: 12px; padding-bottom: 12px; }
  .monthly-entry-form textarea { height: 52px; }
  .monthly-admin-daily-total { min-width: 165px; padding-top: 5px; padding-bottom: 5px; }
  .monthly-admin-daily-total strong { font-size: 17px; }
}

.performance-label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-md);
}

.performance-value {
  color: var(--color-text);
  font-size: 26px;
  font-weight: 700;
}

.performance-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-xl);
}

.performance-grid-single {
  grid-template-columns: 1fr !important;
}

.sub-card-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  padding-left: 12px;
  position: relative;
}

.sub-card-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 3px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}

/* 管理员：客户资源总览 */
.admin-overview-summary {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.admin-overview-summary > div {
  background: var(--color-table-header);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}

.admin-overview-summary > div:hover {
  background: #f0f2f5;
}

.admin-overview-summary > div:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.admin-overview-summary > div {
  min-width: 0;
}

.admin-overview-label {
  display: block;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.admin-overview-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--color-text);
  font-size: 28px;
  line-height: 1.15;
}

.admin-overview-summary .admin-overview-extra {
  display: block;
  margin-top: 5px;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.admin-workbench {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.admin-workbench-overview,
.admin-workbench-card {
  margin-bottom: 0;
}

.admin-workbench-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xl);
}

.admin-workbench-card-wide {
  grid-column: 1 / -1;
}

.admin-workbench-card .table-wrap {
  overflow-x: auto;
}

.admin-workbench-card table {
  min-width: 620px;
}

.admin-workbench-card-wide table {
  min-width: 800px;
}

.danger-text {
  color: var(--color-danger);
}


/* ==========================================================
   15. Customer List
   ========================================================== */
.customer-list-title-row {
  align-items: center;
  gap: 12px;
}

.customer-list-title-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  min-width: 0;
}

.customer-category-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background: #f3f4f6;
  border-radius: 999px;
}

.category-tab {
  border: none;
  background: transparent;
  color: var(--color-text-subtle, #6b7280);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  line-height: 1.2;
}

.category-tab:hover {
  color: var(--color-primary, #4a6cf7);
  background: rgba(255, 255, 255, 0.7);
}

.category-tab.active {
  background: #ffffff;
  color: var(--color-primary, #4a6cf7);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.customer-list-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.customer-followup-shortcuts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.customer-followup-shortcuts .quick-chip {
  padding: 6px 10px;
  white-space: nowrap;
}

.quick-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 3px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--color-border-light);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.quick-chip.active .quick-chip-count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.quick-chip-overdue:not(.active) {
  color: #b42318;
  border-color: #f3c3bf;
}

.quick-chip-overdue:not(.active) .quick-chip-count {
  background: #fff0ef;
  color: #b42318;
}

.action-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.customer-table-wrap.has-frozen-header {
  overflow: visible;
}

.customer-table-wrap.has-frozen-header > table {
  display: block;
}

.customer-table-wrap.has-frozen-header > table > thead {
  display: block;
  position: sticky;
  top: 0;
  z-index: 10;
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--color-table-header);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.12);
}

.customer-table-wrap.has-frozen-header > table > thead::-webkit-scrollbar {
  display: none;
}

.customer-table-wrap.has-frozen-header > table > tbody {
  display: block;
  overflow-x: auto;
}

.customer-table-wrap.has-frozen-header > table > thead > tr,
.customer-table-wrap.has-frozen-header > table > tbody > tr {
  display: table;
  table-layout: fixed;
  width: var(--customer-table-width);
}

.customer-table-wrap.has-frozen-header > table > thead > tr > th,
.customer-table-wrap.has-frozen-header > table > tbody > tr > td {
  width: var(--customer-column-width);
}

@media print {
  .customer-table-wrap.has-frozen-header > table {
    display: table;
  }

  .customer-table-wrap.has-frozen-header > table > thead {
    display: table-header-group;
    position: static;
    overflow: visible;
    box-shadow: none;
  }

  .customer-table-wrap.has-frozen-header > table > tbody {
    display: table-row-group;
    overflow: visible;
  }

  .customer-table-wrap.has-frozen-header > table > thead > tr,
  .customer-table-wrap.has-frozen-header > table > tbody > tr {
    display: table-row;
    width: auto;
  }

  .customer-table-wrap.has-frozen-header > table > thead > tr > th,
  .customer-table-wrap.has-frozen-header > table > tbody > tr > td {
    width: auto;
  }
}

.customer-list-table {
  min-width: 1120px;
}

.customer-list-table .customer-actions-column,
.customer-list-table .customer-actions-cell {
  position: sticky;
  right: 0;
  min-width: 320px;
  width: 320px;
  padding-left: 10px;
  padding-right: 10px;
  white-space: normal;
  background: var(--color-surface);
  box-shadow: -8px 0 14px rgba(15, 23, 42, 0.04);
}

.customer-list-table .customer-actions-column {
  z-index: 3;
  background: var(--color-table-header);
}

.customer-list-table .customer-actions-cell {
  z-index: 2;
}

.customer-list-table .customer-actions-cell.is-menu-open {
  z-index: 40;
}

.customer-list-table tbody tr:nth-child(even) .customer-actions-cell {
  background: #fafbfc;
}

.customer-list-table tbody tr:hover .customer-actions-cell {
  background: var(--color-hover-row);
}

/* 日报 */
.daily-report-filter-row {
  align-items: flex-start;
  gap: 20px;
}

.daily-report-filter-row > :first-child {
  flex: 1 1 auto;
  min-width: 220px;
}

.daily-report-filters {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.customer-tag-cell {
  position: relative;
  min-width: 140px;
  overflow: visible;
}

.customer-tag-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  max-width: 100%;
}

.customer-tag-value {
  display: inline-flex;
  align-items: center;
  max-width: 104px;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid #dbe4ff;
  border-radius: 999px;
  background: #f5f7ff;
  color: #315bdc;
  font-size: var(--font-size-sm);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-tag-value.is-empty {
  border-color: var(--color-border-light);
  background: #fafbfc;
  color: var(--color-text-muted);
}

.customer-tag-edit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  padding: 0;
  border: 1px solid #b9c9ff;
  border-radius: 8px;
  background: #ffffff;
  color: var(--color-primary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(74, 108, 247, 0.12);
  transition: transform 0.18s var(--ease-smooth), border-color 0.18s var(--ease-smooth), box-shadow 0.18s var(--ease-smooth), background 0.18s var(--ease-smooth);
}

.customer-tag-edit-button:hover,
.customer-tag-edit-button:focus-visible {
  border-color: var(--color-primary);
  background: #f5f7ff;
  box-shadow: 0 4px 10px rgba(74, 108, 247, 0.2);
  outline: none;
  transform: translateY(-1px) rotate(-8deg) scale(1.06);
}

.customer-tag-edit-button:active {
  transform: scale(0.86) rotate(-8deg);
}

.customer-tag-edit-button.is-tag-saved {
  border-color: var(--color-success);
  color: var(--color-success);
  box-shadow: 0 0 0 3px rgba(70, 167, 88, 0.15);
}

.customer-tag-edit-button.is-tag-error {
  border-color: var(--color-danger);
  color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.15);
}

.customer-tag-popover {
  position: absolute;
  top: calc(100% - 4px);
  left: 12px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 154px;
  max-width: 220px;
  padding: 8px;
  border: 1px solid #dbe4ff;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
  transform-origin: top left;
  animation: customer-tag-popover-in 0.16s var(--ease-out, ease-out);
}

.customer-tag-popover.opens-up {
  top: auto;
  bottom: calc(100% - 4px);
  transform-origin: bottom left;
}

.customer-tag-popover[hidden] {
  display: none;
}

.customer-tag-popover-title {
  padding: 2px 8px 6px;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.customer-tag-option {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #ffffff;
  color: var(--color-text);
  font: inherit;
  font-size: var(--font-size-sm);
  text-align: left;
  cursor: pointer;
  transition: background 0.16s var(--ease-smooth), border-color 0.16s var(--ease-smooth), color 0.16s var(--ease-smooth);
}

.customer-tag-option:hover,
.customer-tag-option:focus-visible,
.customer-tag-option.is-selected {
  border-color: #dbe4ff;
  background: #f5f7ff;
  color: #315bdc;
  outline: none;
}

.customer-tag-option.is-selected::after {
  content: "✓";
  float: right;
  font-weight: 700;
}

.customer-tag-option:disabled {
  cursor: wait;
  opacity: 0.55;
}

.customer-tag-cell.is-tag-saving .customer-tag-edit-button {
  cursor: wait;
  opacity: 0.65;
}

@keyframes customer-tag-popover-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.daily-report-filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}

.daily-report-filter-label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.daily-report-filter-item input,
.daily-report-filter-item select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 0 10px;
  color: var(--color-text);
}

.daily-report-period-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.daily-report-section {
  margin-bottom: 20px;
}

.daily-report-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.daily-report-section-head h2 {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-xl);
}

.daily-report-section-head p {
  margin: 6px 0 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.daily-report-metric-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.daily-report-metric-grid .stat-card {
  min-width: 0;
  padding: 16px 18px;
  gap: 12px;
}

.daily-report-metric-grid .stat-icon {
  width: 38px;
  height: 38px;
  font-size: 16px;
}

.daily-report-metric-grid .stat-value {
  font-size: 24px;
  overflow-wrap: anywhere;
}

.daily-report-money {
  font-size: 20px !important;
}

.daily-report-note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.daily-report-note-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.daily-report-note-field textarea {
  width: 100%;
  min-height: 124px;
  resize: vertical;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 12px;
  color: var(--color-text);
  line-height: 1.6;
}

.daily-report-note-field textarea[readonly] {
  background: var(--color-table-header);
  color: var(--color-text-secondary);
}

.daily-report-note-readonly,
.daily-report-ai-unavailable {
  margin-top: 12px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.daily-report-plan-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.6fr) minmax(240px, 1.6fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-table-header);
}

.daily-report-plan-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.daily-report-plan-field select,
.daily-report-plan-field textarea {
  width: 100%;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 9px 10px;
  background: #fff;
  color: var(--color-text);
  font: inherit;
  line-height: 1.45;
}

.daily-report-plan-field select {
  height: 42px;
}

.daily-report-plan-field textarea {
  min-height: 42px;
  resize: vertical;
}

.daily-report-plan-help {
  grid-column: 1 / -1;
  margin-top: -2px;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.daily-report-plan-table-wrap {
  max-height: 900px;
  overflow: auto;
}

.daily-report-plan-table {
  min-width: 1260px;
}

.daily-report-plan-table th,
.daily-report-plan-table td {
  vertical-align: top;
  white-space: normal;
}

.daily-report-plan-text {
  min-width: 190px;
  max-width: 280px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.daily-report-plan-completion-cell {
  min-width: 210px;
  line-height: 1.5;
}

.daily-report-plan-completion-input {
  width: 100%;
  min-height: 58px;
  resize: vertical;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 8px 9px;
  color: var(--color-text);
  font: inherit;
  line-height: 1.45;
}

.daily-report-plan-save-button {
  margin-top: 6px;
}

.daily-report-plan-followup-time {
  margin-top: 6px;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.daily-report-plan-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.daily-report-plan-status.is-planned {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.daily-report-plan-status.is-completed {
  background: var(--color-success-light);
  color: var(--color-success);
}

.daily-report-plan-status.is-pending,
.daily-report-plan-status.is-incomplete {
  background: var(--color-warning-light);
  color: #a16207;
}

.daily-report-plan-status.is-carried {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

.daily-report-summary-cell {
  max-width: 220px;
  white-space: normal;
  line-height: 1.5;
}

.daily-report-link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--color-primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.daily-report-link-button:hover,
.daily-report-detail-link:hover {
  text-decoration: underline;
}

.daily-report-customer-table-wrap {
  max-height: 900px;
  overflow: auto;
}

.daily-report-customer-table {
  min-width: 1060px;
}

.daily-report-customer-table th,
.daily-report-customer-table td {
  white-space: normal;
  vertical-align: top;
}

.daily-report-customer-name {
  min-width: 130px;
  font-weight: 700;
  color: var(--color-text);
}

.daily-report-badge,
.daily-report-priority {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.daily-report-badge.is-ok {
  background: var(--color-success-light);
  color: var(--color-success);
}

.daily-report-badge.is-warn {
  background: var(--color-warning-light);
  color: #a16207;
}

.daily-report-money-small {
  color: var(--color-success);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.daily-report-detail-link {
  display: inline-block;
  color: var(--color-primary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.daily-report-muted {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.daily-report-row-details {
  min-width: 300px;
  margin-top: 8px;
  font-size: var(--font-size-sm);
}

.daily-report-row-details summary {
  color: var(--color-primary);
  cursor: pointer;
  font-weight: 600;
}

.daily-report-record-block {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-table-header);
}

.daily-report-record-block h4 {
  margin: 0 0 8px;
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

.daily-report-record + .daily-report-record {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border-light);
}

.daily-report-record {
  color: var(--color-text-secondary);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.daily-report-record strong {
  color: var(--color-text);
}

.daily-report-ai-summary {
  padding: 14px 16px;
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-text);
  line-height: 1.6;
  font-weight: 600;
}

.daily-report-ai-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.daily-report-ai-columns > div {
  padding: 14px 16px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-table-header);
}

.daily-report-ai-columns h3,
.daily-report-ai-customer-block h3 {
  margin: 0 0 10px;
  color: var(--color-text);
  font-size: var(--font-size-md);
}

.daily-report-ai-columns ul {
  margin: 0;
  padding-left: 20px;
  color: var(--color-text-secondary);
  line-height: 1.65;
}

.daily-report-ai-customer-block {
  margin-top: 18px;
}

.daily-report-priority.is-high {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

.daily-report-priority.is-medium {
  background: var(--color-warning-light);
  color: #a16207;
}

.daily-report-priority.is-low {
  background: var(--color-success-light);
  color: var(--color-success);
}

@media (max-width: 1200px) {
  .daily-report-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .daily-report-filter-row {
    flex-direction: column;
  }

  .daily-report-filters {
    width: 100%;
    justify-content: flex-start;
  }

  .daily-report-note-grid,
  .daily-report-ai-columns {
    grid-template-columns: 1fr;
  }

  .daily-report-plan-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daily-report-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .daily-report-metric-grid {
    grid-template-columns: 1fr;
  }

  .daily-report-filters,
  .daily-report-filter-item,
  .daily-report-filters .btn {
    width: 100%;
  }

  .daily-report-plan-form {
    grid-template-columns: 1fr;
  }

  .daily-report-plan-form .btn {
    width: 100%;
  }
}

/* 日报表格重构：日报内容统一放入一张表，避免概览卡片和重复明细分散页面 */
.daily-report-filter-card {
  padding: 18px 24px;
  margin-bottom: 16px;
}

.daily-report-filter-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.daily-report-filter-bar > :first-child {
  flex: 1 1 auto;
  min-width: 240px;
}

.daily-report-filter-item {
  min-width: 156px;
}

.daily-report-salesperson-filter {
  min-width: 190px;
}

.daily-report-filter-item input,
.daily-report-filter-item select {
  height: 38px;
}

.daily-report-period-line {
  margin-top: 14px;
}

.daily-report-sheet-card {
  padding: 0;
  overflow: hidden;
}

.daily-report-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--color-border-light);
}

.daily-report-sheet-head .card-title {
  font-size: 20px;
}

.daily-report-sheet-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-shrink: 0;
}

.daily-report-sheet-table-wrap {
  max-height: calc(100vh - 270px);
  overflow: auto;
}

.daily-report-sheet-table {
  min-width: 1660px;
  table-layout: fixed;
}

.daily-report-sheet-col-customer { width: 170px; }
.daily-report-sheet-col-action { width: 250px; }
.daily-report-sheet-col-followup { width: 330px; }
.daily-report-sheet-col-ai { width: 300px; }
.daily-report-sheet-col-summary { width: 230px; }
.daily-report-sheet-col-plan { width: 300px; }
.daily-report-sheet-col-completion { width: 290px; }

.daily-report-sheet-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

.daily-report-sheet-table thead th {
  height: 50px;
  padding-top: 14px;
  padding-bottom: 14px;
  background: #f7f8fa;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.daily-report-sheet-table th,
.daily-report-sheet-table td {
  padding: 15px 16px;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}

.daily-report-sheet-table tbody tr:nth-child(even) {
  background: #fcfdff;
}

.daily-report-sheet-table tbody tr:hover {
  background: #f5f8ff;
}

.daily-report-sheet-note-row th,
.daily-report-sheet-ai-row th,
.daily-report-sheet-plan-entry-row th {
  background: #fbfcfe;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  text-transform: none;
  letter-spacing: 0;
}

.daily-report-sheet-note-row td,
.daily-report-sheet-note-row th {
  border-bottom-color: #e7ebf2;
}

.daily-report-sheet-textarea,
.daily-report-inline-plan-form textarea,
.daily-report-inline-plan-form select,
.daily-report-plan-completion-input {
  width: 100%;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-text);
  font: inherit;
  line-height: 1.5;
}

.daily-report-sheet-textarea {
  min-height: 104px;
  padding: 10px 12px;
  resize: vertical;
}

.daily-report-sheet-textarea[readonly] {
  background: var(--color-table-header);
  color: var(--color-text-secondary);
}

.daily-report-sheet-note-action {
  min-width: 150px;
}

.daily-report-sheet-note-action button[hidden] {
  display: none !important;
}

.daily-report-sheet-readonly {
  margin-top: 10px;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.daily-report-sheet-ai-row td {
  padding-top: 16px;
  padding-bottom: 16px;
}

.daily-report-ai-placeholder,
.daily-report-sheet-info-row td {
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.daily-report-ai-overall-summary {
  padding: 12px 14px;
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-text);
  line-height: 1.6;
  font-weight: 600;
}

.daily-report-ai-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.daily-report-ai-summary-block {
  padding: 10px 12px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: #fff;
}

.daily-report-ai-summary-block strong {
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

.daily-report-ai-summary-block ul {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--color-text-secondary);
  line-height: 1.55;
}

.daily-report-inline-plan-form {
  display: grid;
  grid-template-columns: 190px minmax(260px, 1fr) minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.daily-report-inline-plan-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.daily-report-inline-plan-form select,
.daily-report-inline-plan-form textarea {
  padding: 9px 10px;
}

.daily-report-inline-plan-form select {
  height: 42px;
}

.daily-report-inline-plan-form textarea {
  min-height: 42px;
  resize: vertical;
}

.daily-report-inline-plan-help {
  grid-column: 1 / -1;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.daily-report-sheet-info-row td {
  padding: 28px 16px;
  text-align: center;
  background: #fbfcfe;
}

.daily-report-sheet-info-row strong {
  display: block;
  margin-bottom: 4px;
  color: var(--color-text);
}

.daily-report-sheet-record-cell,
.daily-report-sheet-ai-cell,
.daily-report-sheet-plan-cell,
.daily-report-sheet-completion-cell {
  line-height: 1.55;
}

.daily-report-sheet-record-cell {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
}

.daily-report-sheet-record + .daily-report-sheet-record,
.daily-report-sheet-plan-item + .daily-report-sheet-plan-item,
.daily-report-sheet-completion-item + .daily-report-sheet-completion-item {
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--color-border-light);
}

.daily-report-sheet-record-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 3px;
}

.daily-report-sheet-record-head strong {
  color: var(--color-text);
  font-size: 12px;
}

.daily-report-sheet-record-head span {
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 700;
}

.daily-report-sheet-record small,
.daily-report-sheet-completion-item small {
  display: block;
  margin-top: 5px;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.daily-report-sheet-record-cell > .daily-report-sheet-record {
  flex: 1 1 0;
  min-width: 0;
  margin-top: 0;
  padding: 10px;
  border: 1px solid var(--color-border-light);
  border-radius: 0;
}

.daily-report-sheet-record-cell > .daily-report-sheet-record + .daily-report-sheet-record {
  border-left: 0;
}

.daily-report-sheet-col-customer { width: 12%; }
.daily-report-sheet-col-followup { width: 88%; }

.daily-report-followup-detail {
  text-align: left;
  overflow-wrap: anywhere;
}

.daily-report-sheet-inherited-cell {
  color: var(--color-text-secondary);
  font-size: 12px;
}

.daily-report-sheet-plan-item,
.daily-report-sheet-completion-item {
  color: var(--color-text);
}

.daily-report-sheet-plan-date {
  margin-bottom: 4px;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.daily-report-sheet-completion-result {
  margin-top: 8px;
}

.daily-report-plan-completion-input {
  min-height: 62px;
  margin-top: 8px;
  padding: 8px 9px;
  resize: vertical;
}

.daily-report-plan-save-button {
  display: block;
  margin-top: 6px;
}

.daily-report-customer-analysis > div {
  margin-top: 7px;
}

@media (max-width: 900px) {
  .daily-report-filter-bar,
  .daily-report-sheet-head {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-report-sheet-actions {
    justify-content: space-between;
  }

  .daily-report-ai-summary-grid {
    grid-template-columns: 1fr;
  }

  .daily-report-inline-plan-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .daily-report-filter-card,
  .daily-report-sheet-head {
    padding: 16px;
  }

  .daily-report-filters,
  .daily-report-filter-item,
  .daily-report-filters .btn {
    width: 100%;
  }

  .daily-report-inline-plan-form {
    grid-template-columns: 1fr;
  }

  .daily-report-inline-plan-form .btn {
    width: 100%;
  }
}

/* 日报最终布局：查询控件跟随导航，表头只对应客户明细列 */
.daily-report-page {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.daily-report-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-width: 0;
  margin-bottom: 24px;
}

.daily-report-nav-row > .nav-row {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin-bottom: 0;
}

.daily-report-nav-row > .nav-row > .top-tabs {
  margin-bottom: 0;
}

.daily-report-nav-filters {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
}

.daily-report-nav-filter-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.daily-report-nav-filter-item input,
.daily-report-nav-filter-item select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 0 10px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}

.daily-report-nav-filter-item input {
  width: 148px;
}

.daily-report-nav-filter-item select {
  width: 170px;
}

.daily-report-nav-filters .btn {
  height: 38px;
  white-space: nowrap;
}

.daily-report-sheet-card {
  max-width: 100%;
  padding: 0;
  overflow: visible;
}

.daily-report-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border-light);
}

.daily-report-sheet-head > :first-child {
  min-width: 0;
}

.daily-report-sheet-head .card-title {
  font-size: 20px;
}

.daily-report-sheet-head .card-desc {
  max-width: 780px;
}

.daily-report-sheet-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 12px;
}

/* 日报操作按钮的 React 孤岛挂载点(FlowButton + FlameButton) */
.daily-report-ai-btn-root {
  display: inline-flex;
  flex-shrink: 0;
}

.daily-report-snapshot-btn-root {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.daily-report-sheet-scope,
.daily-report-sheet-date {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-full);
  background: var(--color-table-header);
  color: var(--color-text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.daily-report-sheet-date {
  border-color: rgba(74, 108, 247, 0.18);
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 700;
}

.daily-report-sheet-message {
  margin: 14px 24px 0;
}

.daily-report-sheet-message:empty {
  display: none;
}

.daily-report-sheet-table-wrap {
  max-height: none;
  overflow: visible;
}

.daily-report-sheet-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.daily-report-sheet-col-customer { width: 13%; }
.daily-report-sheet-col-action { width: 19%; }
.daily-report-sheet-col-followup { width: 22%; }
.daily-report-sheet-col-ai { width: 18%; }
.daily-report-sheet-col-plan { width: 15%; }
.daily-report-sheet-col-completion { width: 13%; }

.daily-report-sheet-table thead {
  position: static;
  top: auto;
  z-index: auto;
}

.daily-report-sheet-table th,
.daily-report-sheet-table td {
  min-width: 0;
  padding: 14px 16px;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.daily-report-sheet-table thead th {
  height: auto;
  color: var(--color-text-secondary);
  white-space: normal;
}

.daily-report-sheet-note-header-row > th {
  padding: 18px 20px;
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
}

.daily-report-sheet-note-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 140px;
  gap: 16px;
  align-items: end;
}

.daily-report-sheet-note-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.daily-report-sheet-note-field label,
.daily-report-sheet-note-action {
  color: var(--color-text);
  font-size: 13px;
  font-weight: 700;
}

.daily-report-sheet-textarea {
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}

.daily-report-sheet-note-action {
  min-width: 0;
  align-self: end;
}

.daily-report-sheet-note-action button[hidden] {
  display: none !important;
}

.daily-report-sheet-readonly {
  margin-top: 8px;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}

.daily-report-sheet-ai-row > th {
  padding: 0;
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
}

.daily-report-sheet-ai-panel {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
  background: #fbfcfe;
}

.daily-report-sheet-ai-label {
  margin-bottom: 10px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 700;
}

.daily-report-sheet-column-header-row th {
  padding-top: 13px;
  padding-bottom: 13px;
  background: #f5f7fa;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.daily-report-sheet-column-header-row th + th {
  border-left: 1px solid var(--color-border-light);
}

.daily-report-sheet-table tbody tr:nth-child(even) {
  background: #fcfdff;
}

.daily-report-sheet-table tbody tr:hover {
  background: #f5f8ff;
}

.daily-report-sheet-customer-row > td {
  border-bottom-color: var(--color-border-light);
}

.daily-report-sheet-info-row td {
  padding: 30px 16px;
  background: #fbfcfe;
  text-align: center;
}

.daily-report-sheet-info-row strong {
  display: block;
  margin-bottom: 4px;
  color: var(--color-text);
}

.daily-report-sheet-table tfoot th {
  padding: 0;
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
}

.daily-report-inline-plan-panel {
  padding: 18px 20px;
  border-top: 1px solid var(--color-border-light);
  background: #fbfcfe;
}

.daily-report-inline-plan-title {
  margin-bottom: 12px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 700;
}

.daily-report-inline-plan-form {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.daily-report-inline-plan-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.daily-report-inline-plan-form select,
.daily-report-inline-plan-form textarea {
  width: 100%;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 9px 10px;
  background: #fff;
  color: var(--color-text);
  font: inherit;
  line-height: 1.5;
}

.daily-report-inline-plan-form select {
  height: 42px;
}

.daily-report-inline-plan-form textarea {
  min-height: 42px;
  resize: vertical;
}

.daily-report-inline-plan-help {
  margin-top: 9px;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.daily-report-ai-placeholder {
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.daily-report-ai-overall-summary {
  padding: 11px 13px;
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-text);
  line-height: 1.6;
  font-weight: 600;
}

.daily-report-ai-generated-at {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-secondary);
}

.daily-report-ai-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.daily-report-ai-summary-block {
  padding: 9px 11px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: #fff;
}

.daily-report-ai-summary-block strong {
  color: var(--color-text);
  font-size: 12px;
}

.daily-report-ai-summary-block ul {
  margin: 5px 0 0;
  padding-left: 17px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

@media (max-width: 1120px) {
  .daily-report-nav-row {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .daily-report-nav-row > .nav-row {
    flex: 1 1 100%;
  }

  .daily-report-nav-filters {
    margin-left: auto;
  }
}

@media (max-width: 900px) {
  .daily-report-sheet-head {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-report-sheet-actions {
    justify-content: flex-start;
  }

  .daily-report-sheet-note-panel {
    grid-template-columns: 1fr;
  }

  .daily-report-sheet-note-action {
    align-self: start;
  }

  .daily-report-ai-summary-grid {
    grid-template-columns: 1fr;
  }

  .daily-report-inline-plan-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .daily-report-nav-filters {
    width: 100%;
    margin-left: 0;
    align-items: stretch;
    flex-wrap: wrap;
  }

  .daily-report-nav-filter-item {
    flex: 1 1 160px;
  }

  .daily-report-nav-filter-item input,
  .daily-report-nav-filter-item select {
    width: 100%;
  }

  .daily-report-nav-filters .btn {
    flex: 1 1 100%;
  }

  .daily-report-sheet-head,
  .daily-report-sheet-message {
    margin-right: 0;
    margin-left: 0;
  }

  .daily-report-sheet-head {
    padding: 16px;
  }

  .daily-report-sheet-message {
    margin-right: 16px;
    margin-left: 16px;
  }

  .daily-report-sheet-table th,
  .daily-report-sheet-table td {
    padding: 11px 10px;
    font-size: 12px;
  }

  .daily-report-inline-plan-form {
    grid-template-columns: 1fr;
  }

  .daily-report-inline-plan-form .btn {
    width: 100%;
  }
}

.customer-list-table tbody tr.customer-row-highlight > td {
  animation: customer-row-highlight 2.2s ease;
}

@keyframes customer-row-highlight {
  0%, 100% { background-color: transparent; }
  15%, 35%, 55%, 75% { background-color: #fff3bf; }
}

.customer-row-actions {
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 5px;
}

.customer-row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 27px;
  border: 1px solid #d9e0ea;
  border-radius: 5px;
  padding: 4px 8px;
  background: #ffffff;
  color: #475569;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.customer-row-action:hover {
  border-color: #aebbd0;
  background: #f8fafc;
  color: #0f172a;
}

.customer-row-action.is-primary {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.customer-row-action.is-followup {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.customer-row-action.is-followup-view {
  background: #ffffff;
}

.customer-row-action.is-quote,
.customer-row-action.is-quote-view {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.customer-row-action.is-quote-view {
  background: #ffffff;
}

.customer-row-action.is-deal {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #6d28d9;
}

.customer-row-action.is-deal-view {
  background: #ffffff;
}

.customer-row-action.is-followup-view:hover {
  border-color: #bbf7d0;
  background: #ffffff;
  color: #166534;
}

.customer-row-action.is-quote-view:hover {
  border-color: #fed7aa;
  background: #ffffff;
  color: #9a3412;
}

.customer-row-action.is-deal-view:hover {
  border-color: #ddd6fe;
  background: #ffffff;
  color: #6d28d9;
}

/* 查看类按钮统一使用纯白背景，保留各自原有的边框和文字颜色。 */
.customer-row-action.is-followup-view,
.customer-row-action.is-followup-view:hover,
.customer-row-action.is-quote-view,
.customer-row-action.is-quote-view:hover,
.customer-row-action.is-deal-view,
.customer-row-action.is-deal-view:hover {
  background-color: #ffffff !important;
  background-image: none !important;
}

.customer-row-action.is-danger {
  border-color: #fecaca;
  background: #fffafa;
  color: #b91c1c;
}

.customer-row-action:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.customer-row-menu {
  position: relative;
  display: inline-flex;
}

.customer-row-menu summary {
  width: 30px;
  padding-left: 6px;
  padding-right: 6px;
  list-style: none;
  font-size: 18px;
  line-height: 1;
}

.customer-row-menu summary::-webkit-details-marker {
  display: none;
}

.customer-row-menu-list {
  position: fixed;
  z-index: 2000;
  min-width: 148px;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.customer-row-menu-list button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #374151;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.customer-row-menu-list button:hover {
  background: #f3f4f6;
}

.customer-row-menu-list button.is-danger {
  color: #b91c1c;
}

.back-to-top-btn {
  position: fixed;
  right: 8px;
  bottom: 24px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  width: 48px;
  min-width: 48px;
  height: 112px;
  padding: 12px 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: linear-gradient(135deg, #4169e9 0%, #7188f5 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(52, 79, 190, 0.24), 0 3px 8px rgba(52, 79, 190, 0.20);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.9);
  transition: opacity 0.25s var(--ease-smooth), visibility 0.25s var(--ease-smooth), transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, background 0.22s ease;
  will-change: transform;
}

.back-to-top-btn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top-btn:hover {
  background: linear-gradient(135deg, #315bdc 0%, #617cf1 100%);
  transform: translateY(-3px) scale(1.045);
  box-shadow: 0 14px 30px rgba(52, 79, 190, 0.32), 0 5px 12px rgba(52, 79, 190, 0.22);
}

.back-to-top-btn:active {
  transform: translateY(1px) scale(0.93);
  animation: page-edge-button-bounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.page-edge-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.20);
  font-size: 17px;
  line-height: 1;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.22s ease;
}

.page-edge-label {
  line-height: 1;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.back-to-top-btn:hover .page-edge-icon {
  background: rgba(255, 255, 255, 0.30);
  transform: scale(1.12) rotate(-3deg);
}

.back-to-top-btn.is-direction-changing .page-edge-icon {
  animation: page-edge-icon-pop 0.48s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes page-edge-button-bounce {
  0% { transform: translateY(1px) scale(0.93); }
  55% { transform: translateY(-3px) scale(1.06); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes page-edge-icon-pop {
  0% { transform: scale(0.55) rotate(-10deg); }
  58% { transform: scale(1.20) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top-btn,
  .page-edge-icon {
    transition: none;
    animation: none !important;
  }
}


/* ==========================================================
   16. Customer Detail — 精致详情页
   ========================================================== */
.detail-page {
  padding-top: 26px;
}

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

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 客户英雄区 */
.customer-hero {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  transition: box-shadow 0.25s var(--ease-smooth);
}

.customer-hero:hover {
  box-shadow: var(--shadow-sm);
}

.hero-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-top-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.hero-top-row .customer-name {
  margin-bottom: 0;
}

.hero-top-row .hero-badges {
  margin-bottom: 0;
}

.hero-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 0;
  color: var(--color-text-subtle);
  font-size: var(--font-size-sm);
}

.hero-meta-bar .hero-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 14px;
  border-right: 1px solid var(--color-border-light);
  line-height: 1.4;
}

.hero-meta-bar .hero-meta-item:first-child {
  padding-left: 0;
}

.hero-meta-bar .hero-meta-item:last-child {
  border-right: none;
  padding-right: 0;
}

.hero-meta-label {
  color: var(--color-text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.hero-meta-label::after {
  content: "：";
}

.hero-meta-bar .hero-meta-item strong {
  color: var(--color-text);
  font-weight: 700;
  word-break: break-all;
}

.hero-side {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  padding-top: 2px;
}

.hero-side .btn {
  white-space: nowrap;
}

/* 下一步任务焦点条 */
.task-focus-card {
  margin-bottom: 16px;
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-table-header) 100%);
}

.task-focus-card.is-overdue {
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.task-focus-card.is-today {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

.task-focus-card.is-idle {
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.08);
}

.task-focus-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1.6fr auto;
  gap: 16px 20px;
  align-items: center;
}

.task-focus-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: 600;
  margin-bottom: 6px;
}

.task-focus-value {
  font-size: var(--font-size-base);
  color: var(--color-text);
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
}

.task-focus-status .task-focus-value {
  font-weight: 600;
  color: var(--color-text-subtle);
}

.task-focus-card.is-overdue .task-focus-status .task-focus-value {
  color: var(--color-danger);
}

.task-focus-card.is-today .task-focus-status .task-focus-value {
  color: #059669;
}

.task-focus-actions {
  display: flex;
  justify-content: flex-end;
}

/* 客户资料折叠 */
.profile-collapse-card {
  margin-bottom: 16px;
  padding: 0;
  overflow: hidden;
}

.profile-task-strip {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr 1.6fr;
  gap: 12px 18px;
  padding: 16px 22px;
  background: linear-gradient(180deg, var(--color-table-header) 0%, var(--color-surface) 100%);
  border-bottom: 1px solid var(--color-border-light);
}

.profile-task-strip.is-overdue {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08) 0%, var(--color-surface) 100%);
  border-bottom-color: rgba(239, 68, 68, 0.2);
}

.profile-task-strip.is-today {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, var(--color-surface) 100%);
  border-bottom-color: rgba(16, 185, 129, 0.2);
}

.profile-task-strip.is-idle {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.1) 0%, var(--color-surface) 100%);
  border-bottom-color: rgba(245, 158, 11, 0.22);
}

.profile-task-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-task-value {
  font-size: var(--font-size-base);
  color: var(--color-text);
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
}

.profile-task-status .profile-task-value {
  font-weight: 600;
  color: var(--color-text-subtle);
}

.profile-task-strip.is-overdue .profile-task-status .profile-task-value {
  color: var(--color-danger);
}

.profile-task-strip.is-today .profile-task-status .profile-task-value {
  color: #059669;
}

/* 英雄区跟进条：独立成行，三等分对齐 */
.hero-task-strip {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1.5fr;
  gap: 0;
  min-width: 0;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--color-table-header);
  border: 1px solid var(--color-border-light);
}

.hero-task-strip.is-overdue {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.22);
}

.hero-task-strip.is-today {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.22);
}

.hero-task-strip.is-idle {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.24);
}

.hero-task-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 0 14px;
  border-right: 1px solid var(--color-border-light);
}

.hero-task-item:first-child {
  padding-left: 0;
}

.hero-task-item:last-child {
  border-right: none;
  padding-right: 0;
}

.hero-task-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.hero-task-value {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}

.hero-task-status .hero-task-value {
  font-weight: 600;
  color: var(--color-text-subtle);
}

.hero-task-strip.is-overdue .hero-task-status .hero-task-value {
  color: var(--color-danger);
}

.hero-task-strip.is-today .hero-task-status .hero-task-value {
  color: #059669;
}

.profile-collapse-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.profile-collapse-header .card-title {
  margin-bottom: 0;
}

.profile-collapse-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.profile-summary {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-collapse-chevron {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background: var(--color-table-header);
  color: var(--color-text-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: transform 0.2s var(--ease-smooth);
}

.profile-collapse-card.is-open .profile-collapse-chevron {
  transform: rotate(180deg);
}

.profile-collapse-body {
  padding: 0 18px 14px;
  border-top: 1px solid var(--color-border-light);
}

/* 展开后的紧凑资料：标签与值贴近，三列网格 */
.profile-info-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px 10px;
  margin-top: 10px !important;
}

.profile-info-grid .info-row {
  min-height: 0;
  padding: 6px 10px;
  gap: 4px 6px;
  justify-content: flex-start;
  align-items: baseline;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-table-header);
  border-bottom: 1px solid var(--color-border-light);
}

.profile-info-grid .info-row span {
  flex: 0 0 auto;
  max-width: none;
  width: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.profile-info-grid .info-row span::after {
  content: "：";
  margin: 0 1px 0 0;
  color: var(--color-text-muted, var(--color-text-secondary));
}

.profile-info-grid .info-row strong {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-text-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.profile-text-block {
  margin-top: 0 !important;
  padding: 8px 10px !important;
  border-radius: var(--radius-md) !important;
}

.profile-text-block .detail-text-title {
  font-size: 12px;
  margin-bottom: 3px;
}

.profile-text-block .detail-text-content {
  font-size: 13px;
  line-height: 1.4;
  max-height: 64px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.profile-collapse-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

/* 主工作区：跟进 + 成交 */
.detail-grid-priority {
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.detail-grid-orders-only {
  grid-template-columns: minmax(0, 1fr);
}

.work-card .card-title-row {
  margin-bottom: 16px;
}

.card-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  margin-left: 8px;
  border-radius: 999px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  flex-shrink: 0;
}

.hero-main {
  flex: 1;
  min-width: 0;
}

.task-focus-grid-readonly {
  grid-template-columns: 1.1fr 1.4fr 1.6fr;
}

.work-card > .card-title {
  margin-bottom: 16px;
}

.customer-name {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
  line-height: 1.2;
}

.hero-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-meta {
  display: flex;
  gap: 24px;
  color: var(--color-text-subtle);
  font-size: var(--font-size-md);
  flex-wrap: wrap;
}

.hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

/* 详情页双栏 */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(360px, 0.95fr);
  gap: var(--space-xl);
  align-items: start;
}

.left-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.left-stack .card {
  margin-bottom: 0;
}

.left-stack .card + .card {
  margin-top: 0;
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.side-stack .card {
  margin-bottom: 0;
}

/* 快速跟进 */
.quick-followup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.simple-followup-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.followup-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.method-combo {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.method-custom-input {
  width: 100%;
}

.method-custom-input.is-hidden {
  display: none !important;
}

.followup-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.followup-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border: 1px dashed var(--color-border-input);
  border-radius: var(--radius-md);
  background: var(--color-table-header);
  color: var(--color-text-subtle);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease-smooth);
}

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

.attachment-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.attachment-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-table-header);
  overflow: hidden;
  flex: 0 0 auto;
}

.attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.attachment-file {
  width: 72px;
  height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  text-decoration: none;
  color: var(--color-text-subtle);
  box-sizing: border-box;
}

.attachment-file-icon {
  font-size: 20px;
  line-height: 1;
}

.attachment-file-name {
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.7);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.attachment-remove:hover {
  background: var(--color-danger);
}

.timeline-attachments {
  margin-bottom: 8px;
}

button.attachment-thumb,
.attachment-thumb.is-clickable {
  padding: 0;
  cursor: zoom-in;
  border: 1px solid var(--color-border);
  background: var(--color-table-header);
  appearance: none;
  -webkit-appearance: none;
}

button.attachment-thumb img,
.attachment-thumb.is-clickable img {
  pointer-events: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(17, 24, 39, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(3px);
  pointer-events: auto;
}

.image-lightbox.show {
  display: flex !important;
}

.image-lightbox img {
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  background: #fff;
  object-fit: contain;
}

.image-lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.image-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* 客户资料信息行 */
.info-list {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-md);
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  min-height: 40px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row span {
  flex: 0 0 145px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.info-row strong {
  flex: 1;
  color: var(--color-text);
  font-size: var(--font-size-base);
  font-weight: 600;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-row strong:empty::after {
  content: "-";
  color: var(--color-text-muted);
}

/* 长文本资料块 */
.detail-text-block {
  margin-top: var(--space-lg);
  background: var(--color-table-header);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  border: 1px solid var(--color-border-light);
}

.detail-text-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.detail-text-content {
  font-size: var(--font-size-base);
  color: var(--color-text);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* info-table (旧版兼容) */
.info-table {
  width: 100%;
  border-collapse: collapse;
}

.info-table td {
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-light);
  white-space: normal;
}

.info-table td:first-child {
  color: var(--color-text-secondary);
  width: 110px;
}

.info-table td:last-child {
  text-align: right;
  color: var(--color-text);
}

/* 下一步任务 */
.task-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text-subtle);
}

.task-row:last-child {
  border-bottom: none;
}

.task-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.task-right {
  color: var(--color-primary);
}

/* 跟进历史时间线 — 更精致的设计 */
.timeline {
  position: relative;
  padding-left: 36px;
  margin-top: 8px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 10px;
  width: 2px;
  background: var(--color-border-light);
}

.timeline-item {
  position: relative;
  margin-bottom: 10px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px 10px;
  background: var(--color-surface);
  transition: all 0.2s var(--ease-smooth);
}

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

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-light);
}

.timeline-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px 16px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.timeline-head-main {
  display: flex;
  align-items: center;
  gap: 6px 16px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.timeline-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 18px;
  flex: 0 1 auto;
  min-width: 0;
  flex-wrap: wrap;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.timeline-body {
  min-width: 0;
}

.timeline-body.has-attachments {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
  gap: 4px;
}

.timeline-body.has-attachments .timeline-attachments {
  margin: 0;
}

.timeline-copy {
  min-width: 0;
}

.timeline-content {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: flex-start;
  column-gap: 6px;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  line-height: 1.5;
  margin-bottom: 8px;
  padding-left: 6px;
}

.timeline-content-label,
.timeline-feedback-label {
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.timeline-content-text {
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.timeline-feedback {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: flex-start;
  column-gap: 6px;
  background: var(--color-primary-light);
  color: var(--color-text-subtle);
  padding: 8px 10px 8px 6px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.timeline-feedback-text {
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.timeline-delete-btn {
  border: none;
  background: transparent;
  color: var(--color-danger);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  transition: all 0.15s var(--ease-smooth);
}

.timeline-delete-btn:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* 成交记录区 — 精致卡片 */
.order-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.order-summary > div {
  background: var(--color-table-header);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all 0.2s var(--ease-smooth);
}

.order-summary > div:hover {
  background: #f0f2f5;
}

.order-summary-label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-sm);
}

.order-summary-value {
  color: var(--color-text);
  font-size: var(--font-size-2xl);
  font-weight: 700;
}

.order-mini-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-mini-item {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 0;
  background: var(--color-surface);
  overflow: hidden;
  transition: all 0.2s var(--ease-smooth);
}

.order-mini-item:hover {
  border-color: var(--color-border-input);
  box-shadow: var(--shadow-xs);
}

.order-card {
  padding: 12px 14px 14px;
}

.order-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border-light);
}

.order-card-amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.order-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.order-edit-btn.icon-button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.order-edit-btn.icon-button:hover { color: var(--color-primary); border-color: var(--color-primary); }

.order-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.order-kv {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  padding: 6px 8px 6px 0;
  border-bottom: 1px dashed var(--color-border-light);
  min-width: 0;
}

.order-kv:nth-last-child(-n + 2) {
  border-bottom: none;
}

.order-kv span {
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  white-space: nowrap;
}

.order-kv b {
  color: var(--color-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
}

.order-kv b.is-warn {
  color: var(--color-danger);
}

.order-mini-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.order-mini-remark {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--color-primary-light);
  border-radius: var(--radius-sm);
  color: var(--color-text-subtle);
  font-size: var(--font-size-sm);
}

/* 记录跟进弹窗 */
.followup-modal {
  width: 640px;
}

.followup-history-modal {
  width: min(900px, calc(100vw - 32px));
}

.followup-history-modal-body {
  min-height: 220px;
  max-height: calc(100vh - 184px);
  padding: 20px 24px 24px;
}

.followup-history-modal-body .timeline {
  margin-top: 0;
}

.followup-history-modal-body .timeline-item:last-child {
  margin-bottom: 0;
}

.order-history-modal {
  width: min(900px, calc(100vw - 32px));
}

.order-history-modal-body {
  min-height: 220px;
  max-height: calc(100vh - 184px);
  padding: 20px 24px 24px;
}

.order-history-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.order-history-summary > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fbfcfe 0%, #f5f7fb 100%);
}

.order-history-summary-label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.order-history-summary-value {
  color: var(--color-text);
  font-size: 18px;
  line-height: 1.2;
}

.order-history-modal-body .order-mini-list {
  gap: 12px;
}

.order-history-modal-body .empty {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  border: 1px dashed var(--color-border-input);
  border-radius: var(--radius-md);
  background: #fafbfd;
}

@media (max-width: 680px) {
  .followup-history-modal {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .followup-history-modal-body {
    max-height: calc(100vh - 154px);
    min-height: 180px;
    padding: 16px 14px 20px;
  }

  .followup-history-modal-body .timeline {
    padding-left: 30px;
  }

  .timeline-head-main,
  .timeline-meta {
    flex-basis: 100%;
  }

  .timeline-meta {
    justify-content: flex-start;
  }

  .timeline-body.has-attachments {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 4px;
  }

  .order-history-modal {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .order-history-modal-body {
    max-height: calc(100vh - 154px);
    min-height: 180px;
    padding: 16px 14px 20px;
  }

  .order-history-summary {
    grid-template-columns: 1fr;
  }
}

.card-title-row .card-title {
  margin-bottom: 0;
}

/* 成交记录弹窗 */
#order_items_container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e3e8f0;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #f8fafc 0%, #f5f7fb 100%);
}

.order-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--color-text-subtle);
  font-size: var(--font-size-sm);
  font-weight: 700;
  line-height: 1.2;
}

.order-items-add-btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.order-items-add-btn:hover {
  border-color: #aebbd0;
  background: #f1f5f9;
  color: #1e293b;
}

.order-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(72px, 0.7fr) minmax(0, 1.35fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid #e1e7ef;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}

.order-item-row:focus-within,
.order-item-row:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.order-item-row input {
  width: 100%;
  min-width: 0;
  height: 38px;
  min-height: 38px;
  border: 1px solid #d5dce6;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  background: #ffffff;
  color: var(--color-text);
  font-size: 13px;
  outline: none;
}

.order-item-row input::placeholder {
  color: #9aa5b5;
}

.order-item-row > button {
  width: 52px;
  min-width: 52px;
  height: 38px;
  padding: 0 8px;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  background: #fff7f7;
  color: #dc2626;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease-smooth), border-color 0.2s var(--ease-smooth), color 0.2s var(--ease-smooth);
}

.order-item-row > button:hover {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.order-item-row > button:focus-visible {
  outline: 2px solid rgba(229, 72, 77, 0.35);
  outline-offset: 2px;
}

.order-amount-summary {
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.order-amount-summary.is-error {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

@media (max-width: 560px) {
  .order-item-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .order-item-row > button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.order-inline-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.order-remaining-status-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: end;
}

.order-pay-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  align-items: end;
}

.order-status-item {
  min-width: 120px;
}

.order-status-tag-wrap {
  display: flex;
  align-items: center;
  min-height: 42px;
}

.order-status-tag-wrap .badge {
  font-size: 13px;
  padding: 8px 14px;
  line-height: 1.2;
}

.order-paid-percent {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.order-paid-percent.is-full {
  background: #ecfdf5;
  color: #047857;
}

.order-paid-percent[hidden] {
  display: none !important;
}

.order-unpaid-percent {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.order-unpaid-percent.is-zero {
  background: #ecfdf5;
  color: #047857;
}

.order-unpaid-percent[hidden] {
  display: none !important;
}

#order_amount[readonly],
#current_deal_amount[readonly],
#remaining_amount[readonly] {
  background: var(--color-input-readonly);
  color: var(--color-text);
  font-weight: 700;
  cursor: not-allowed;
}

#order_remark {
  min-height: 56px;
  height: 56px;
  resize: vertical;
}

.order-pay-btn {
  border: none;
  border-radius: var(--radius-full);
  padding: 5px 12px;
  background: var(--color-orange);
  color: #ffffff;
  font-size: var(--font-size-xs);
  font-weight: 700;
  cursor: pointer;
  margin-left: var(--space-sm);
  transition: all 0.2s var(--ease-smooth);
}

.order-pay-btn:hover {
  background: var(--color-orange-hover);
  transform: translateY(-1px);
}

.order-delete-btn {
  border: none;
  border-radius: var(--radius-full);
  padding: 5px 12px;
  background: var(--color-danger);
  color: #ffffff;
  font-size: var(--font-size-xs);
  font-weight: 700;
  cursor: pointer;
  margin-left: var(--space-sm);
  transition: all 0.2s var(--ease-smooth);
}

.order-delete-btn:hover {
  background: var(--color-danger-hover);
  transform: translateY(-1px);
}


/* ==========================================================
   17. Follow-up Tasks — 精致标签页
   ========================================================== */
.task-tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: 20px;
}

.task-tab {
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  background: var(--color-border-light);
  color: var(--color-text-subtle);
  cursor: pointer;
  font-size: var(--font-size-md);
  font-weight: 600;
  transition: all 0.2s var(--ease-smooth);
}

.task-tab:hover {
  background: #dfe2e6;
  transform: translateY(-1px);
}

.task-tab.active {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: var(--shadow-btn);
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.3);
  color: inherit;
  font-size: var(--font-size-xs);
  font-weight: 700;
  padding: 0 6px;
  margin-left: 4px;
}

.task-tab.active .tab-count {
  background: rgba(255,255,255,0.3);
}

.tab-count-danger {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

.task-tab.active .tab-count-danger {
  background: rgba(255,255,255,0.3);
  color: #ffffff;
}

.task-filter-row {
  display: grid;
  grid-template-columns: 1fr 240px 160px 160px;
  gap: 14px;
  align-items: end;
}

.task-filter-row input,
.task-filter-row select {
  height: var(--input-height);
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: var(--font-size-md);
  outline: none;
  background: var(--color-surface);
  transition: all 0.2s var(--ease-smooth);
}

.task-filter-row input:focus,
.task-filter-row select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.08);
}


/* ==========================================================
   18. Admin Analytics — 精致排行榜
   ========================================================== */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

.analytics-full-card {
  grid-column: 1 / -1;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.ranking-list-wide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.ranking-item {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  background: var(--color-surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
  transition: all 0.2s var(--ease-smooth);
}

.ranking-item:hover {
  border-color: var(--color-border-input);
  box-shadow: var(--shadow-xs);
}

.ranking-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 0;
}

.ranking-index {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-border-light);
  color: var(--color-text-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.rank-first  { background: #fef3c7; color: #b45309; }
.rank-second { background: #e5e7eb; color: var(--color-text-subtle); }
.rank-third  { background: #ffedd5; color: #c2410c; }

.ranking-name {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--color-text);
}

.ranking-sub {
  margin-top: var(--space-xs);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.ranking-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}


/* ==========================================================
   19. Maintenance Rules — 精致规则设置
   ========================================================== */
.potential-rule-card {
  margin-bottom: var(--space-xl);
}

.old-customer-rule-card {
  margin-bottom: var(--space-xl);
}

.old-customer-rule-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) minmax(180px, 1fr) auto;
  align-items: end;
  gap: var(--space-lg);
}

.old-customer-rule-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.old-customer-rule-form input[type="number"] {
  width: 100%;
  height: 38px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  background: var(--color-input-bg);
}

.potential-rule-form {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) repeat(4, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: var(--space-lg);
}

.potential-rule-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.potential-rule-form input[type="number"] {
  width: 100%;
  height: 38px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  background: var(--color-input-bg);
}

.potential-rule-form input[type="number"]:focus {
  border-color: var(--color-primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.08);
}

.potential-rule-switch {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  min-height: 38px;
  color: var(--color-text) !important;
  font-weight: 600;
}

.potential-rule-switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

.potential-rule-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.potential-rule-input em {
  color: var(--color-text-secondary);
  font-style: normal;
  white-space: nowrap;
}

.public-pool-card {
  overflow: hidden;
}

.public-pool-toolbar {
  align-items: flex-start;
}

.public-pool-table {
  min-width: 1180px;
}

.public-pool-table th,
.public-pool-table td {
  white-space: nowrap;
  vertical-align: middle;
}

.public-pool-table td:first-child {
  min-width: 150px;
  white-space: normal;
}

.public-pool-customer-link {
  display: block;
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: none;
}

.public-pool-customer-link:hover {
  text-decoration: underline;
}

.public-pool-table td:first-child small {
  display: block;
  margin-top: 3px;
  color: var(--color-text-secondary);
}

.public-pool-action-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.public-pool-target {
  min-width: 110px;
  max-width: 140px;
  height: 34px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
}

.ownership-history-card {
  margin-bottom: var(--space-xl);
}

.ownership-history-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--color-border-light);
}

.ownership-history-item {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.ownership-history-time {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

.ownership-history-main {
  min-width: 0;
}

.ownership-history-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
  font-weight: 700;
}

.ownership-history-detail {
  margin: 6px 0 0;
  color: var(--color-text-secondary);
  line-height: 1.55;
  word-break: break-word;
}

.ownership-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 7px;
  color: var(--color-text-subtle);
  font-size: var(--font-size-xs);
}

.crm-source-ownership {
  background: #f3f4f6;
  color: #4b5563;
}

.business-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-lg);
}

.business-status-item {
  min-width: 0;
  padding: 12px 14px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
}

.business-status-item span,
.potential-reasons-title {
  display: block;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.business-status-item strong {
  display: block;
  margin-top: 4px;
  min-height: 24px;
  color: var(--color-text);
  word-break: break-word;
}

.potential-reasons {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border-light);
}

.potential-reason-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.potential-reason-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--color-orange);
  background: var(--color-warning-light);
}

.potential-reason-item strong {
  color: var(--color-text);
}

.potential-reason-item span {
  color: var(--color-text-secondary);
}

.potential-reason-warning,
.potential-data-note {
  color: var(--color-warning-text) !important;
  font-size: var(--font-size-sm);
}

.potential-reason-empty,
.potential-data-note {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.potential-data-note {
  margin-top: 2px;
}

/* ==========================================================
   20. Import Page
   ========================================================== */
.import-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--space-2xl);
  align-items: start;
}

.import-card-title-row {
  align-items: flex-start;
  gap: 24px;
}

.import-card-title-row > div:first-child {
  min-width: 0;
}

.import-template-button {
  min-width: 168px;
  min-height: 44px;
  padding: 12px 20px;
  flex-shrink: 0;
  font-weight: 700;
  box-shadow: var(--shadow-primary);
}

.import-template-icon {
  font-size: 18px;
  line-height: 1;
  margin-right: 4px;
}

.import-help {
  background: var(--color-table-header);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.import-help-title {
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 14px;
}

.import-field-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.import-field-list span {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.import-note {
  margin-top: 18px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  font-size: var(--font-size-base);
}

.import-result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.import-result-grid > div {
  background: var(--color-table-header);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.import-error-box {
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
}

@media (max-width: 720px) {
  .import-card-title-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .import-template-button {
    width: 100%;
  }
}

.import-error-row {
  padding: 6px 0;
  border-bottom: 1px solid #fecaca;
  font-size: var(--font-size-base);
}

.import-error-row:last-child {
  border-bottom: none;
}


/* ==========================================================
   21. Export Page — 精致导出卡片
   ========================================================== */
.export-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: end;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
}

.export-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  transition: all 0.25s var(--ease-smooth);
}

.export-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.export-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--color-primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: var(--space-lg);
}

.export-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.export-desc {
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 18px;
}

.export-note {
  color: var(--color-text-subtle);
  background: var(--color-table-header);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  line-height: 1.8;
}


/* ==========================================================
   22. Operation Logs
   ========================================================== */
.log-filter-grid {
  display: grid;
  grid-template-columns: 180px 180px 180px 160px 160px 120px 120px;
  gap: 14px;
  align-items: end;
}

.log-filter-grid input,
.log-filter-grid select {
  height: 44px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 0 12px;
  background: var(--color-surface);
  outline: none;
}

.log-filter-grid input:focus,
.log-filter-grid select:focus {
  border-color: var(--color-primary);
}

.log-detail-modal {
  width: 960px;
  max-width: calc(100vw - 80px);
}

.log-basic-card {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  background: var(--color-table-header);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: var(--space-xl);
}

.log-basic-card div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-basic-card span {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.log-basic-card strong {
  color: var(--color-text);
  font-size: var(--font-size-md);
}

.log-detail-section {
  margin-bottom: var(--space-xl);
}

#logChangeBody td {
  vertical-align: top;
}

#logChangeBody td:first-child {
  font-weight: 700;
  color: var(--color-text);
  width: 180px;
}

#logChangeBody td:nth-child(2) {
  color: var(--color-text-secondary);
}

#logChangeBody td:nth-child(3) {
  color: var(--color-text);
  font-weight: 600;
}


/* ==========================================================
   23. Change Password
   ========================================================== */
.change-password-card {
  max-width: 680px;
}

.password-form {
  margin-top: var(--space-xl);
}

.password-field {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.password-field input {
  flex: 1;
}

.password-toggle-btn {
  height: var(--btn-height);
  min-width: 64px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-border-light);
  color: var(--color-text-subtle);
  font-weight: 700;
  cursor: pointer;
}

.password-toggle-btn:hover {
  background: #e5e7eb;
}

/* 数据导入导出统一页：顶部切换卡片 */
.data-io-switch-card {
  padding: 14px 16px;
  margin-bottom: 16px;
}

.data-io-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.data-io-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  background: var(--color-border-light);
  color: var(--color-text-subtle);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}

.data-io-tab:hover {
  border-color: #c7d2fe;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.data-io-tab.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-text);
  box-shadow: 0 0 0 1px rgba(74, 108, 247, 0.12);
}

.data-io-tab-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.data-io-tab-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.data-io-tab-title {
  font-size: var(--font-size-md);
  font-weight: 700;
}

.data-io-tab-desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  font-weight: 500;
}

.data-io-tab.active .data-io-tab-desc {
  color: var(--color-text-subtle);
}

.data-io-panel {
  animation: dataIoFade 0.2s var(--ease-smooth);
}

@keyframes dataIoFade {
  from { opacity: 0.5; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .data-io-tabs {
    grid-template-columns: 1fr;
  }
}

/* 账号管理：创建表单紧凑横向布局，避免整页被拉长 */
.account-create-header {
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.account-create-hint {
  margin: 0;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.account-create-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px 12px;
  align-items: end;
}

.account-create-form .form-item {
  margin: 0;
  min-width: 0;
}

.account-create-form .form-item label {
  margin-bottom: 4px;
  font-size: var(--font-size-xs);
}

.account-create-form .form-item input,
.account-create-form .form-item select {
  min-height: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: var(--font-size-base);
}

.account-create-form .password-field {
  gap: 6px;
}

.account-create-form .password-toggle-btn {
  height: 36px;
  min-width: 48px;
  font-size: var(--font-size-xs);
  padding: 0 8px;
}

.account-create-actions {
  display: flex;
  align-items: end;
  padding-bottom: 0;
}

.account-create-actions .btn {
  height: 36px;
  min-width: 72px;
  white-space: nowrap;
}

.card-compact {
  padding-bottom: 14px;
}

.card-compact #userMessage {
  margin-top: 10px;
}

.card-compact #userMessage:empty {
  display: none;
  margin: 0;
}

@media (max-width: 1100px) {
  .account-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-create-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .account-create-form {
    grid-template-columns: 1fr;
  }

  .account-create-header {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ==========================================================
   24. Account Management
   ========================================================== */
.user-modal {
  width: 1080px;
  max-width: calc(100vw - 80px);
}

.account-section {
  margin-bottom: 26px;
}

.account-section:last-child {
  margin-bottom: 0;
}

.account-section-title {
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 14px;
  padding-left: 12px;
  position: relative;
}

.account-section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 4px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}

.user-modal table th,
.user-modal table td {
  padding: 14px 16px;
}

.user-modal .table-wrap {
  max-height: 320px;
  overflow-y: auto;
}

.user-modal .modal-body {
  max-height: calc(100vh - 180px);
}

.user-delete-btn {
  margin-left: var(--space-md);
}


/* ==========================================================
   25. Customer Transfer — 精致转移弹窗
   ========================================================== */
.checkbox-col {
  width: 48px;
  text-align: center;
}

.checkbox-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.transfer-modal {
  width: 520px;
}

.transfer-info-box {
  background: var(--color-primary-light);
  color: var(--color-text-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: var(--font-size-base);
  line-height: 1.7;
}

.transfer-info-box span {
  color: var(--color-primary);
  font-weight: 700;
}

.batch-lifecycle-modal .form-help {
  margin-top: 8px;
  color: var(--color-text-subtle);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.transfer-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: var(--font-size-base);
  line-height: 1.7;
}


/* ==========================================================
   26. Utilities — 通用工具类
   ========================================================== */
.message {
  margin-top: var(--space-md);
  font-size: var(--font-size-base);
  min-height: 20px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  transition: all 0.2s var(--ease-smooth);
}

.message:empty {
  padding: 0;
  margin: 0;
}

.message-success {
  color: var(--color-success);
  background: var(--color-success-light);
  border: 1px solid #bbf7d0;
}

.message-error {
  color: var(--color-danger);
  background: var(--color-danger-light);
  border: 1px solid #fecaca;
}

.link-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  padding: 0;
  font-size: var(--font-size-base);
  transition: all 0.15s var(--ease-smooth);
}

.link-btn:hover {
  opacity: 0.8;
}

.link-blue {
  color: var(--color-primary);
}

.link-red {
  color: var(--color-danger);
}

.header-link-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s var(--ease-smooth);
}

.header-link-btn:hover {
  opacity: 0.8;
}

/* 日期/时间输入框 */
input[type="date"],
input[type="month"],
input[type="datetime-local"] {
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}


/* ==========================================================
   26b. Stage Funnel (compact bar) — 精致阶段筛选
   ========================================================== */
.stage-funnel-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 0;
  margin: 0;
  flex: 1;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}

.funnel-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  background: var(--color-surface);
  color: var(--color-text-subtle);
  font-size: var(--font-size-xs);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease-smooth);
  flex-shrink: 0;
}

.funnel-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.funnel-chip.active {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-btn);
  font-weight: 600;
}

.funnel-chip-count {
  font-weight: 700;
  font-size: 10px;
  opacity: 0.75;
}

.funnel-chip.active .funnel-chip-count {
  opacity: 1;
}

.funnel-chip-arrow {
  color: var(--color-text-muted);
  font-size: 10px;
  margin: 0 1px;
  flex-shrink: 0;
}

.funnel-loading {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  padding: 2px 0;
}


/* ==========================================================
   26c. Quick Filters & Pagination — 精致筛选
   ========================================================== */
.quick-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.quick-chip {
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  background: var(--color-surface);
  color: var(--color-text-subtle);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}

.quick-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.quick-chip.active {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-btn);
  font-weight: 600;
}

.batch-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  color: var(--color-text-subtle);
  animation: slideDown 0.2s var(--ease-smooth);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.batch-action-bar strong {
  color: var(--color-primary);
  font-weight: 700;
}

@media (max-width: 1100px) {
  .customer-list-title-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .customer-list-tools {
    margin-left: auto;
  }
}

.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  margin-top: 12px;
  border-top: 1px solid var(--color-border-light);
}

.pagination-info {
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
}

.pagination-btns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.page-btn {
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  background: var(--color-surface);
  color: var(--color-text-subtle);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  min-width: 36px;
  text-align: center;
  transition: all 0.2s var(--ease-smooth);
}

.page-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.page-btn-active {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  font-weight: 600;
}

.page-btn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


/* ==========================================================
   27. Responsive
   ========================================================== */

/* --- 1300px --- */
@media (max-width: 1300px) {
  .todo-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .dashboard-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .admin-overview-summary {
    grid-template-columns: repeat(3, 1fr);
  }
  .export-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .export-filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- 1200px --- */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .filter-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
  .detail-grid,
  .detail-grid-priority {
    grid-template-columns: 1fr;
  }
  .task-focus-grid {
    grid-template-columns: 1fr 1fr;
  }
  .profile-task-strip {
    grid-template-columns: 1fr 1fr;
  }
  .profile-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-text-grid {
    grid-template-columns: 1fr 1fr;
  }
  .task-focus-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .followup-options {
    grid-template-columns: repeat(2, 1fr);
  }
  .followup-row-2 {
    grid-template-columns: 1fr;
  }
  .performance-grid {
    grid-template-columns: 1fr;
  }
  .performance-summary-grid {
    grid-template-columns: 1fr;
  }
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  .ranking-list-wide {
    grid-template-columns: 1fr;
  }
  .log-filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- 1000px --- */
@media (max-width: 1000px) {
  .import-layout {
    grid-template-columns: 1fr;
  }
  .import-result-grid {
    grid-template-columns: 1fr;
  }
}

/* --- 900px --- */
@media (max-width: 900px) {
  .page {
    padding: 20px 18px 36px;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .page-header > div:first-child {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  .page-header > div:first-child .page-subtitle {
    margin-top: var(--space-sm);
  }
  .header-actions {
    width: 100%;
  }
  .top-tabs {
    display: flex;
    width: 100%;
  }
  .nav-row {
    flex-direction: column;
    gap: 12px;
  }
  .nav-row > .top-tabs,
  .nav-page-tools {
    width: 100%;
  }
  .nav-page-tools-customer {
    grid-template-columns: 1fr;
  }
  .nav-page-tools-customer .customer-query-more {
    grid-column: auto;
  }
  .nav-page-tools-customer .customer-query-primary .search-main {
    flex-basis: auto;
    max-width: none;
    width: 100%;
  }
  .nav-page-tools-customer .customer-query-inline-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    flex: none;
    overflow: visible;
  }
  .nav-page-tools-customer .customer-query-inline-filters .customer-filter-control {
    width: 100%;
    flex: none;
  }
  .nav-page-tools-customer .customer-query-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .nav-page-tools-customer .customer-query-more-fields {
    width: 100%;
  }
  .nav-page-tools-followup {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 7px 10px;
  }
  .top-tab {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
  }
  .tab-dropdown {
    flex: 1;
  }
  .dropdown-trigger {
    width: 100%;
  }
  .tab-dropdown-menu {
    left: auto;
    right: 0;
  }
  .task-tabs {
    flex-wrap: wrap;
  }
  .task-filter-row {
    grid-template-columns: 1fr;
  }
  .nav-page-tools-followup .task-tabs {
    flex-wrap: wrap;
  }
  .nav-page-tools-followup .task-filter-row {
    grid-template-columns: 1fr;
  }
  .nav-page-tools-followup .task-filter-row-no-owner {
    grid-template-columns: 1fr;
  }
}

/* --- 700px --- */
@media (max-width: 700px) {
  .page {
    padding: 18px;
  }
  .page-header {
    flex-direction: column;
    gap: var(--space-lg);
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .customer-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-side {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .hero-meta-bar .hero-meta-item {
    border-right: none;
    padding: 2px 0;
    width: 100%;
  }
  .hero-task-strip {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .hero-task-item {
    border-right: none;
    padding: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border-light);
  }
  .hero-task-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .task-focus-grid {
    grid-template-columns: 1fr;
  }
  .profile-task-strip {
    grid-template-columns: 1fr;
  }
  .profile-info-grid,
  .profile-text-grid {
    grid-template-columns: 1fr;
  }
  .profile-collapse-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .profile-summary {
    max-width: 100%;
    white-space: normal;
  }
  .hero-meta {
    gap: var(--space-md);
    flex-direction: column;
  }
  .followup-options {
    grid-template-columns: 1fr;
  }
  .todo-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-task-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-overview-summary {
    grid-template-columns: 1fr;
  }
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  .export-grid {
    grid-template-columns: 1fr;
  }
  .export-filter-grid {
    grid-template-columns: 1fr;
  }
  .log-filter-grid {
    grid-template-columns: 1fr;
  }
  .log-basic-card {
    grid-template-columns: 1fr;
  }
  .order-inline-row {
    grid-template-columns: 1fr;
  }
  .order-pay-meta-row {
    grid-template-columns: 1fr;
  }
  .order-remaining-status-row {
    grid-template-columns: 1fr;
  }
}

/* --- 600px --- */
@media (max-width: 600px) {
  .todo-stats-grid {
    grid-template-columns: 1fr;
  }
  .top-tabs {
    flex-direction: column;
    align-items: stretch;
  }
  .top-tab,
  .tab-dropdown,
  .dropdown-trigger {
    width: 100%;
  }
  .tab-dropdown-menu {
    position: static;
    margin-top: 6px;
    box-shadow: none;
    border: 1px solid var(--color-border-input);
  }
  .tab-dropdown:hover .tab-dropdown-menu {
    display: flex;
  }
}

/* ==========================================================
   28. Accessibility & Preferences
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 焦点可见性 */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* 打印样式 */
@media print {
  .top-tabs,
  .header-actions,
  .back-to-top-btn,
  .btn,
  .pagination-bar {
    display: none !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  body {
    background: #fff;
  }
}


/* AI 诊断卡片 */
.ai-diagnosis-card {
  margin-bottom: 18px;
  border: 1px solid var(--color-border);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 20px 22px;
}

.ai-diagnosis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.ai-diagnosis-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-diagnosis-source {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.ai-diagnosis-body {
  color: var(--color-text);
  width: 100%;
}

.ai-diagnosis-loading,
.ai-diagnosis-empty {
  color: var(--color-text-secondary);
  font-size: 15px;
  padding: 10px 0;
}

.ai-diagnosis-note {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 600;
}

.ai-diagnosis-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  background: var(--color-table-header);
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}

.ai-diagnosis-summary.is-good {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

.ai-diagnosis-summary.is-warn {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.28);
}

.ai-diagnosis-summary.is-risk {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}

.ai-diagnosis-level {
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.ai-diagnosis-summary-text {
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
}

.ai-diagnosis-section-title {
  margin: 6px 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-secondary);
  letter-spacing: 0.4px;
}

.ai-diagnosis-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

.ai-chip {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: #fff;
  min-width: 0;
}

.ai-chip.is-good {
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.06);
}

.ai-chip.is-warn {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.07);
}

.ai-chip.is-risk {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.06);
}

.ai-chip-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 6px;
}

.ai-chip-detail {
  font-size: 14px;
  color: var(--color-text-subtle);
  line-height: 1.5;
  word-break: break-word;
}

.ai-action-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  width: 100%;
}

.ai-action-item {
  display: grid;
  grid-template-columns: 28px 88px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--color-border-light);
  min-width: 0;
}

.ai-action-index {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 800;
}

.ai-action-who {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-action-what {
  font-size: 15px;
  color: var(--color-text-subtle);
  line-height: 1.4;
  word-break: break-word;
}

@media (max-width: 700px) {
  .ai-diagnosis-summary-text {
    font-size: 17px;
  }
  .ai-action-item {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  .ai-action-who {
    grid-column: 2;
  }
  .ai-action-what {
    grid-column: 2;
  }
}


/* AI 问答 */
.ai-ask-modal {
  width: min(560px, calc(100vw - 32px));
}

.ai-ask-history {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-ask-item {
  position: relative;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 12px 14px;
}

.ai-ask-q,
.ai-ask-a {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.55;
  font-size: 14px;
}

.ai-ask-q {
  margin-bottom: 10px;
  color: var(--color-text);
  font-weight: 600;
}

.ai-ask-a {
  color: var(--color-text-subtle);
}

.ai-ask-a-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.ai-ask-tag {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.ai-ask-tag.is-a {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.ai-ask-meta {
  margin-top: 8px;
  padding-left: 34px;
  font-size: 12px;
  color: var(--color-text-secondary);
}


.ai-model-badge {
  display: none;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}


.ai-ask-meta {
  margin-top: 10px;
  padding-left: 34px;
}

.ai-ask-model-badge {
  display: inline-flex !important;
}


.ai-ask-item {
  position: relative;
}



.ai-ask-corner {
  position: absolute;
  top: 10px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 62%;
  z-index: 1;
}

.ai-ask-corner-badge,
.ai-ask-model-corner,
.ai-ask-month-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.ai-ask-model-corner {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.ai-ask-month-badge {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.ai-ask-item .ai-ask-q {
  padding-right: 170px;
}


/* AI 问答角标（统一最终样式） */
#aiAskHistory .ai-ask-item {
  position: relative !important;
  padding: 14px 16px 12px !important;
  overflow: visible !important;
}

#aiAskHistory .ai-ask-corner {
  position: absolute !important;
  top: 10px !important;
  right: 12px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 6px !important;
  max-width: 70% !important;
  z-index: 5 !important;
  pointer-events: none !important;
}

#aiAskHistory .ai-ask-corner-badge,
#aiAskHistory .ai-ask-model-corner,
#aiAskHistory .ai-ask-month-badge {
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  height: 22px !important;
  padding: 0 8px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

#aiAskHistory .ai-ask-model-corner,
#aiAskHistory .ai-ask-month-badge {
  background: #eef2ff !important;
  color: #3730a3 !important;
  border: 1px solid #c7d2fe !important;
}

#aiAskHistory .ai-ask-item .ai-ask-q {
  padding-right: 180px !important;
}

/* ========================= 报价单 ========================= */
.quote-entry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #fff7ed 0%, #fff 100%);
  border: 1px solid #fed7aa;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.quote-entry-bar[hidden] {
  display: none !important;
}

.quote-entry-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: #9a3412;
}

.quote-entry-label {
  font-weight: 700;
  font-size: 13px;
}

.quote-entry-info strong {
  font-size: 20px;
  color: #c2410c;
}

.quote-entry-hint {
  font-size: 12px;
  color: #a16207;
}

.quote-modal {
  width: min(1280px, 98vw);
  max-height: 92vh;
}

.quote-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.quote-toolbar .help-text {
  font-size: 14px;
}

.quote-toolbar .btn {
  margin-left: auto;
}

.quote-table-wrap {
  overflow: auto;
  max-height: 60vh;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 12px;
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
  font-size: 15px;
}

.quote-table th,
.quote-table td {
  border-bottom: 1px solid #eef2f7;
  padding: 12px 10px;
  vertical-align: middle;
  text-align: center;
}

.quote-table th {
  position: sticky;
  top: 0;
  background: var(--color-table-header, #f9fafb);
  z-index: 1;
  font-weight: 700;
  font-size: 14px;
  color: #374151;
  white-space: nowrap;
  text-align: center;
}

.quote-table .col-img { width: 96px; text-align: center; }
.quote-table .col-code { width: 140px; text-align: center; }
.quote-table .col-price { width: 120px; text-align: center; }
.quote-table .col-path { min-width: 220px; text-align: left; }
.quote-table .col-remark { min-width: 140px; text-align: center; }
.quote-table .col-ops { width: 72px; text-align: center; }

/* 图片路径列：表头与内容都左对齐，不居中 */
.quote-table th.col-path,
.quote-table td.col-path {
  text-align: left !important;
}

/* 录入时输入框仍左对齐，更易填写 */
.quote-table:not(.quote-table-readonly) td.col-code,
.quote-table:not(.quote-table-readonly) td.col-price,
.quote-table:not(.quote-table-readonly) td.col-path,
.quote-table:not(.quote-table-readonly) td.col-remark {
  text-align: left;
}

/* 查看报价单：路径+复制按钮左对齐 */
.quote-table-readonly .quote-path-cell {
  justify-content: flex-start;
}

.quote-table-readonly .quote-path-text {
  flex: 0 1 auto;
  max-width: 220px;
  text-align: left;
}

.quote-table-readonly td {
  text-align: center;
}

.quote-table-readonly td.col-path {
  text-align: left !important;
}

.quote-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
  background: #fff;
}

.quote-input:focus {
  outline: none;
  border-color: #fb923c;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.15);
}

.quote-path-input {
  width: 100%;
  font-size: 13px;
  color: #4b5563;
}

.quote-path-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.quote-path-text {
  flex: 1;
  min-width: 0;
  display: inline-block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: #4b5563;
}

.quote-copy-btn.is-copied {
  color: #15803d !important;
  border-color: #86efac !important;
  background: #f0fdf4 !important;
}

.quote-copy-toast {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 9999;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.82);
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.quote-copy-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.btn-tiny {
  padding: 6px 10px !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  white-space: nowrap;
}

.quote-thumb-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 10px;
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.quote-thumb-wrap.has-image {
  border-style: solid;
  border-color: #e5e7eb;
  overflow: hidden;
}

.quote-thumb-wrap.is-uploadable {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.quote-thumb-wrap.is-uploadable:hover {
  border-color: #fb923c;
  background: #fff7ed;
}

.quote-thumb-wrap.is-uploadable.drag-over {
  border-color: #f97316;
  border-style: dashed;
  background: #ffedd5;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.25);
}

.quote-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  display: block;
  border-radius: 9px;
}

.quote-thumb.is-clickable {
  cursor: zoom-in;
}

.quote-thumb-placeholder {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  padding: 0 4px;
  line-height: 1.3;
}

.quote-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 3;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.78);
  color: #fff;
  font-size: 16px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.quote-thumb-remove:hover {
  background: #dc2626;
}

.quote-list-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quote-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.quote-list-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quote-list-meta {
  font-size: 12px;
  color: #6b7280;
}

.quote-view-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #4b5563;
}

.quote-view-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.quote-view-meta-label {
  color: #6b7280;
}

.quote-view-remark {
  color: #9a3412;
}

.timeline-item.is-highlighted {
  animation: followup-highlight 2.2s ease;
}

@keyframes followup-highlight {
  0%, 100% { box-shadow: none; }
  20%, 70% { box-shadow: 0 0 0 3px #bfdbfe; }
}

/* 下拉选项管理 */
.option-workspace {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 560px;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.option-category-sidebar {
  padding: 20px 12px;
  background: #fafbfc;
  border-right: 1px solid var(--color-border);
}

.option-sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 12px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.option-category-total,
.option-category-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-full);
  background: #eef0f3;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.option-category-nav {
  display: grid;
  gap: 4px;
}

.option-category-button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-subtle);
  font-size: var(--font-size-base);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s var(--ease-smooth), color 0.16s var(--ease-smooth), border-color 0.16s var(--ease-smooth);
}

.option-category-button:hover {
  background: #f1f3f6;
  color: var(--color-text);
}

.option-category-button.is-active {
  background: var(--color-primary-light);
  border-color: #dce4ff;
  color: var(--color-primary);
}

.option-category-button.is-active .option-category-count {
  background: #ffffff;
  color: var(--color-primary);
}

.option-content-panel {
  min-width: 0;
  padding: 24px 28px 28px;
}

.option-content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 56px;
}

.option-content-header h2 {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-xl);
  line-height: 1.35;
}

.option-content-header p {
  margin: 5px 0 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.option-add-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin: 16px 0 4px;
  background: #f8f9fb;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.option-add-bar .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.option-add-bar input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-sm);
  outline: none;
}

.option-add-bar input:focus,
.option-value-control input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

.option-add-button {
  height: 40px;
  padding: 0 16px;
  gap: 6px;
}

.option-add-button > span {
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.option-message {
  margin-bottom: 8px;
}

.option-list-heading,
.option-row {
  display: grid;
  grid-template-columns: 82px minmax(220px, 1fr) 128px 84px;
  gap: 12px;
  align-items: center;
}

.option-list-heading {
  min-height: 38px;
  padding: 0 12px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: 700;
  border-bottom: 1px solid var(--color-border);
}

.option-row {
  min-height: 62px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.16s var(--ease-smooth), opacity 0.16s var(--ease-smooth);
}

.option-row:hover {
  background: #fafbfc;
}

.option-row.is-disabled {
  background: #fbfbfc;
}

.option-row.is-disabled .option-value-control,
.option-row.is-disabled .option-move-controls {
  opacity: 0.6;
}

.option-move-controls,
.option-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.option-icon-button,
.option-action-button {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  padding: 0;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-subtle);
  font-size: var(--font-size-md);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s var(--ease-smooth), border-color 0.16s var(--ease-smooth), color 0.16s var(--ease-smooth);
}

.option-icon-button:hover:not(:disabled) {
  background: var(--color-primary-light);
  border-color: #cfd9ff;
  color: var(--color-primary);
}

.option-icon-button:disabled,
.option-action-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.option-value-control input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-sm);
  outline: none;
}

.option-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  cursor: pointer;
}

.option-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.option-switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  flex: 0 0 36px;
  border-radius: var(--radius-full);
  background: #cfd3da;
  transition: background 0.18s var(--ease-smooth);
}

.option-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s var(--ease-smooth);
}

.option-switch input:checked + .option-switch-track {
  background: var(--color-success);
}

.option-switch input:checked + .option-switch-track::after {
  transform: translateX(16px);
}

.option-switch input:focus-visible + .option-switch-track {
  outline: 3px solid rgba(74, 108, 247, 0.16);
  outline-offset: 2px;
}

.option-save-action:not(:disabled) {
  border-color: #cfd9ff;
  color: var(--color-primary);
}

.option-save-action:hover:not(:disabled) {
  background: var(--color-primary-light);
}

.option-delete-action {
  color: var(--color-danger);
}

.option-delete-action:hover {
  background: var(--color-danger-light);
  border-color: #fecaca;
}

.option-empty {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--color-text-secondary);
  text-align: center;
}

.option-empty strong {
  color: var(--color-text-subtle);
  font-size: var(--font-size-base);
}

.option-empty span {
  font-size: var(--font-size-sm);
}

.remark-ellipsis {
  display: inline-block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.row-actions-menu {
  position: relative;
  display: inline-block;
}

.row-actions-menu summary {
  cursor: pointer;
  list-style: none;
  color: #2563eb;
  font-size: 13px;
  white-space: nowrap;
}

.row-actions-menu summary::-webkit-details-marker {
  display: none;
}

.row-actions-menu-list {
  position: absolute;
  z-index: 30;
  right: 0;
  top: calc(100% + 6px);
  min-width: 150px;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.row-actions-menu-list button,
.row-actions-menu-list a {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #374151;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.row-actions-menu-list button:hover,
.row-actions-menu-list a:hover {
  background: #f3f4f6;
}

.locked-followup-hint {
  margin-top: 5px;
  color: #b45309;
  font-size: 12px;
}

@media (max-width: 900px) {
  .option-workspace {
    grid-template-columns: 184px minmax(0, 1fr);
  }

  .option-content-panel {
    padding: 20px;
  }

  .option-list-heading,
  .option-row {
    grid-template-columns: 76px minmax(180px, 1fr) 112px 76px;
    gap: 8px;
  }
}

@media (max-width: 680px) {
  .option-workspace {
    display: block;
  }

  .option-category-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .option-category-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .option-add-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .option-list-heading {
    display: none;
  }

  .option-row {
    grid-template-columns: 76px minmax(0, 1fr) 76px;
    gap: 8px;
  }

  .option-value-control {
    grid-column: 2 / -1;
    grid-row: 1;
  }

  .option-switch {
    grid-column: 2;
  }

  .option-row-actions {
    grid-column: 3;
    justify-content: flex-end;
  }
}

@media (max-width: 900px) {
  .potential-rule-form,
  .old-customer-rule-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .potential-rule-form > button,
  .old-customer-rule-form > button {
    width: 100%;
  }

  .business-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .potential-rule-form,
  .old-customer-rule-form,
  .business-status-grid {
    grid-template-columns: 1fr;
  }

  .ownership-history-item {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

/* ==========================================================
   Stage 5 · Monthly business operating dashboard
   ========================================================== */
.monthly-business-filter-card {
  padding: 22px 24px 14px;
}

.monthly-business-filter-row {
  gap: 28px;
  align-items: center;
}

.monthly-business-filter-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.monthly-business-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  padding: 8px;
  border: 1px solid #e2e8f4;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8faff 0%, #f4f7fc 100%);
  box-shadow: 0 3px 12px rgba(35, 65, 125, 0.06);
}

.monthly-business-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 3px 0 6px;
  color: #53617a;
  font-size: var(--font-size-xs);
  font-weight: 600;
  white-space: nowrap;
}

.monthly-business-filter-label {
  line-height: 1;
}

.monthly-business-filter-item input,
.monthly-business-filter-item select {
  width: 150px;
  min-width: 150px;
  height: 40px;
  border: 1px solid #d8e0ee;
  border-radius: 9px;
  padding: 0 11px;
  color: var(--color-text);
  font-size: var(--font-size-base);
  background: var(--color-surface);
}

.monthly-business-filters > .btn {
  height: 40px;
  padding: 0 18px;
  border-radius: 9px;
}

.monthly-business-period-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border-light);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.monthly-business-period-line span + span::before {
  content: "·";
  color: var(--color-text-subtle);
  margin-right: 20px;
}

.monthly-business-section {
  margin-bottom: 22px;
}

.monthly-business-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 28px 0 12px;
}

.monthly-business-section-head h2 {
  margin: 0;
  color: var(--color-text);
  font-size: 20px;
}

.monthly-business-section-head p {
  margin: 6px 0 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.monthly-business-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.monthly-business-kpi-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.monthly-business-kpi-card {
  position: relative;
  min-width: 0;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 20px 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: transform 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth), border-color 0.2s var(--ease-smooth);
}

.monthly-business-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  background: var(--kpi-color, var(--color-primary));
}

.monthly-business-kpi-card:hover,
.monthly-business-kpi-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--kpi-color, var(--color-primary));
  box-shadow: var(--shadow-md);
  outline: none;
}

.monthly-business-kpi-card .kpi-label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.monthly-business-kpi-card .kpi-value {
  margin-top: 12px;
  color: var(--kpi-color, var(--color-text));
  font-size: clamp(26px, 2.5vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.monthly-business-kpi-card .kpi-money {
  font-size: clamp(21px, 2vw, 30px);
}

.monthly-business-kpi-card .kpi-hint {
  margin-top: auto;
  padding-top: 10px;
  color: var(--color-text-subtle);
  font-size: 12px;
}

.monthly-business-kpi-card.kpi-blue { --kpi-color: #2563eb; }
.monthly-business-kpi-card.kpi-green { --kpi-color: #16a34a; }
.monthly-business-kpi-card.kpi-purple { --kpi-color: #7c3aed; }
.monthly-business-kpi-card.kpi-orange { --kpi-color: #d97706; }
.monthly-business-kpi-card.kpi-red { --kpi-color: #dc2626; }
.monthly-business-kpi-card.kpi-gray { --kpi-color: #64748b; }

.monthly-business-breakdown-card {
  margin-top: 16px;
}

.monthly-business-breakdown-card .table-wrap {
  margin-top: 14px;
}

.monthly-business-quality-card {
  margin-top: 4px;
}

.monthly-business-quality-text {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  background: var(--color-border-light);
  line-height: 1.7;
  font-size: var(--font-size-sm);
}

.badge-success {
  background: #ecfdf5;
  color: #047857;
}

.badge-warning {
  background: #fffbeb;
  color: #b45309;
}

.monthly-business-details-modal {
  width: min(1080px, calc(100vw - 32px));
}

.monthly-business-modal-subtitle {
  margin-top: 5px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.monthly-business-details-body {
  min-height: 180px;
}

.monthly-business-detail-summary {
  margin-bottom: 14px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.monthly-business-details-body .table-wrap {
  max-height: 58vh;
  overflow: auto;
}

@media (max-width: 1100px) {
  .monthly-business-kpi-grid,
  .monthly-business-kpi-grid-three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .monthly-business-filter-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .monthly-business-filters {
    width: 100%;
  }

  .monthly-business-filter-item {
    flex: 1 1 210px;
  }

  .monthly-business-filter-item input,
  .monthly-business-filter-item select {
    flex: 1 1 auto;
  }
}

@media (max-width: 680px) {
  .monthly-business-filters {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .monthly-business-filter-item {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 2px 2px 0;
  }

  .monthly-business-filter-item input,
  .monthly-business-filter-item select,
  .monthly-business-filters > .btn {
    width: 100%;
    min-width: 0;
  }

  .monthly-business-kpi-grid,
  .monthly-business-kpi-grid-three {
    grid-template-columns: 1fr;
  }

  .monthly-business-period-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .monthly-business-period-line span + span::before {
    content: "";
    margin: 0;
  }
}

/* 日报窄屏覆盖：避免公共导航的 flex 拉伸造成大片空白 */
@media (max-width: 900px) {
  .daily-report-nav-row {
    display: block;
    margin-bottom: 18px;
  }

  .daily-report-nav-row > .nav-row {
    display: block;
    width: 100%;
    margin-bottom: 12px;
  }

  .daily-report-nav-row > .nav-row > .top-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    align-content: start;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    flex-direction: initial;
    flex-wrap: initial;
  }

  .daily-report-nav-row > .nav-row > .top-tabs > .top-tab,
  .daily-report-nav-row > .nav-row > .top-tabs > .tab-dropdown {
    width: auto;
    min-width: 0;
    flex: none;
  }

  .daily-report-nav-row > .nav-row > .top-tabs > .tab-dropdown .dropdown-trigger {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .daily-report-sheet-table {
    display: block;
  }

  .daily-report-sheet-table colgroup {
    display: none;
  }

  .daily-report-sheet-table thead,
  .daily-report-sheet-table tbody,
  .daily-report-sheet-table tfoot {
    display: block;
  }

  .daily-report-sheet-table tr {
    display: block;
  }

  .daily-report-sheet-table .daily-report-sheet-column-header-row {
    display: none;
  }

  .daily-report-sheet-table thead th,
  .daily-report-sheet-table tbody td,
  .daily-report-sheet-table tfoot th {
    display: block;
    width: 100%;
  }

  .daily-report-sheet-table tbody .daily-report-sheet-customer-row {
    margin: 0 12px 12px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    overflow: hidden;
  }

  .daily-report-sheet-table tbody .daily-report-sheet-customer-row td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border-bottom: 1px solid var(--color-border-light);
  }

  .daily-report-sheet-table tbody .daily-report-sheet-customer-row td::before {
    content: attr(data-label);
    color: var(--color-text-secondary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.55;
  }

  .daily-report-sheet-table tbody .daily-report-sheet-customer-row td:last-child {
    border-bottom: 0;
  }

  .daily-report-sheet-table tbody .daily-report-sheet-info-row td {
    display: block;
    margin: 0;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .daily-report-nav-row > .nav-row > .top-tabs {
    grid-template-columns: 1fr;
  }
}

/* 日报页不显示浏览器滚动条，但保留滚轮、触控板和键盘滚动 */
html:has(body.daily-report-body) {
  scrollbar-width: none;
}

html:has(body.daily-report-body)::-webkit-scrollbar,
body.daily-report-body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body.daily-report-body {
  overflow-x: hidden;
  scrollbar-width: none;
}

/* 日报表格级内容：客户行只承载当天事实，计划、完成情况和 AI 统一放在表格级区域。 */
.daily-report-sheet-col-customer { width: 20%; }
.daily-report-sheet-col-action { width: 40%; }
.daily-report-sheet-col-followup { width: 80%; }

.daily-report-sheet-plan-summary-row > th,
.daily-report-sheet-completion-summary-row > th {
  padding: 0;
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
}

.daily-report-report-section {
  padding: 18px 20px;
  border-top: 1px solid var(--color-border-light);
  background: #fbfcfe;
}

.daily-report-report-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.daily-report-report-section-title {
  color: var(--color-text);
  font-size: 14px;
  font-weight: 700;
}

.daily-report-report-section-desc {
  margin-top: 4px;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.daily-report-report-section-count {
  flex: 0 0 auto;
  color: var(--color-text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.daily-report-report-empty {
  padding: 14px;
  border: 1px dashed var(--color-border-input);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.daily-report-plan-overview-list,
.daily-report-plan-completion-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.daily-report-plan-overview-item,
.daily-report-plan-completion-record {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.daily-report-plan-overview-head,
.daily-report-plan-completion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.daily-report-plan-overview-customer,
.daily-report-plan-completion-customer {
  min-width: 0;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 700;
}

.daily-report-plan-overview-date {
  flex: 0 0 auto;
  color: var(--color-text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.daily-report-plan-overview-fields,
.daily-report-plan-completion-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.daily-report-plan-overview-fields span,
.daily-report-plan-completion-fields span {
  display: block;
  margin-bottom: 3px;
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.daily-report-plan-overview-fields p,
.daily-report-plan-completion-fields p {
  margin: 0;
  color: var(--color-text);
  line-height: 1.55;
}

.daily-report-plan-status-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.daily-report-plan-status-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.daily-report-plan-status-card span {
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.daily-report-plan-status-card strong {
  color: var(--color-text);
  font-size: 18px;
  line-height: 1.1;
}

.daily-report-plan-status-card.is-completed strong {
  color: var(--color-success);
}

.daily-report-plan-status-card.is-incomplete strong {
  color: var(--color-danger);
}

.daily-report-plan-status-card.is-pending strong,
.daily-report-plan-status-card.is-planned strong {
  color: var(--color-warning);
}

.daily-report-plan-completion-record {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 16px;
}

.daily-report-plan-completion-main,
.daily-report-plan-completion-result {
  min-width: 0;
}

.daily-report-plan-completion-result {
  padding-left: 16px;
  border-left: 1px solid var(--color-border-light);
}

.daily-report-plan-completion-result .daily-report-plan-completion-input {
  display: block;
  width: 100%;
  min-height: 72px;
  resize: vertical;
}

.daily-report-plan-completion-result .daily-report-sheet-completion-result,
.daily-report-plan-completion-result > .daily-report-muted {
  display: block;
  color: var(--color-text-secondary);
  line-height: 1.55;
}

.daily-report-plan-completion-result small {
  display: block;
  margin-top: 7px;
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .daily-report-plan-status-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .daily-report-plan-completion-record {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .daily-report-plan-completion-result {
    padding-top: 12px;
    padding-left: 0;
    border-top: 1px solid var(--color-border-light);
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .daily-report-plan-overview-head,
  .daily-report-plan-completion-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .daily-report-plan-overview-fields,
  .daily-report-plan-completion-fields,
  .daily-report-plan-status-summary {
    grid-template-columns: 1fr;
  }
}

/* 报价跟进与成交确认 */
.quote-progress-panel { margin-top: 20px; padding: 18px; border: 1px solid #e3e8ef; border-radius: 12px; background: #f8fafc; }
.quote-progress-panel [hidden] { display: none !important; }
.quote-progress-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.quote-progress-heading > span { color: #405bd8; }
.quote-progress-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.quote-progress-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13px; }
.quote-progress-field input, .quote-progress-field select, .quote-progress-field textarea, .quote-deal-item input { width: 100%; padding: 9px 10px; border: 1px solid #ccd4e0; border-radius: 6px; box-sizing: border-box; background: white; font: inherit; }
.quote-progress-panel p { margin: 8px 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.quote-progress-history { margin-top: 18px; }
.quote-progress-history-item { border-top: 1px solid #e3e8ef; padding: 12px 0; font-size: 13px; }
#quoteFollowupMessage { margin: 10px 0; color: #a33b20; }

/* 深色模式中覆盖少数仍使用固定浅色值的公共区域。 */
html[data-theme="dark"] .top-tabs {
  background: var(--color-table-header);
}

html[data-theme="dark"] .top-tab:hover {
  background: var(--color-hover-row);
}

html[data-theme="dark"] tbody tr:nth-child(even) {
  background: var(--color-bg-alt);
}

html[data-theme="dark"] tbody tr:nth-child(even):hover {
  background: var(--color-hover-row);
}

html[data-theme="dark"] .admin-overview-summary > div:hover,
html[data-theme="dark"] .card:hover,
html[data-theme="dark"] .stat-card:hover {
  border-color: var(--color-border-input);
}

html[data-theme="dark"] .admin-overview-summary > div:hover {
  background: var(--color-hover-row);
}

html[data-theme="dark"] .todo-card-danger {
  background: var(--color-danger-light);
}

html[data-theme="dark"] .todo-card-warning {
  background: var(--color-warning-light);
}

html[data-theme="dark"] .todo-card-warning .todo-card-num {
  color: var(--color-warning);
}

html[data-theme="dark"] .modal-close:hover {
  background: var(--color-hover-row);
}

html[data-theme="dark"] .btn-primary {
  color: #101827;
}

html[data-theme="dark"] .customer-category-tabs,
html[data-theme="dark"] .option-category-sidebar,
html[data-theme="dark"] .option-add-bar {
  background: var(--color-bg-alt);
}

html[data-theme="dark"] .category-tab:hover,
html[data-theme="dark"] .option-category-button:hover,
html[data-theme="dark"] .option-row:hover {
  background: var(--color-hover-row);
}

html[data-theme="dark"] .category-tab.active,
html[data-theme="dark"] .option-category-total,
html[data-theme="dark"] .option-category-count,
html[data-theme="dark"] .option-category-button.is-active .option-category-count {
  background: var(--color-surface);
}

html[data-theme="dark"] .option-row.is-disabled {
  background: var(--color-bg-alt);
}

html[data-theme="dark"] .customer-row-action,
html[data-theme="dark"] .quote-list-item {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-subtle);
}

html[data-theme="dark"] .customer-row-action:hover {
  background: var(--color-hover-row);
  color: var(--color-text);
}

html[data-theme="dark"] .customer-row-action.is-followup-view,
html[data-theme="dark"] .customer-row-action.is-followup-view:hover,
html[data-theme="dark"] .customer-row-action.is-quote-view,
html[data-theme="dark"] .customer-row-action.is-quote-view:hover,
html[data-theme="dark"] .customer-row-action.is-deal-view,
html[data-theme="dark"] .customer-row-action.is-deal-view:hover {
  background-color: var(--color-surface) !important;
}

html[data-theme="dark"] .quote-list-meta,
html[data-theme="dark"] .quote-view-meta,
html[data-theme="dark"] .quote-view-meta-label {
  color: var(--color-text-secondary);
}

html[data-theme="dark"] .quote-progress-panel {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
}

html[data-theme="dark"] .quote-progress-field input,
html[data-theme="dark"] .quote-progress-field select,
html[data-theme="dark"] .quote-progress-field textarea,
html[data-theme="dark"] .quote-deal-item input {
  background: var(--color-input-bg);
  border-color: var(--color-border-input);
  color: var(--color-text);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  color: var(--color-text);
}

/* 客户列表：固定操作列与标签使用和表格一致的深色背景。 */
html[data-theme="dark"] .customer-list-table tbody tr:nth-child(even) .customer-actions-cell {
  background: var(--color-bg-alt);
}

html[data-theme="dark"] .customer-list-table tbody tr:hover .customer-actions-cell {
  background: var(--color-hover-row);
}

html[data-theme="dark"] .customer-tag-value,
html[data-theme="dark"] .badge-customer-tag {
  border-color: #455a8c;
  background: var(--color-primary-bg);
  color: #b6c6ff;
}

html[data-theme="dark"] .customer-tag-value.is-empty {
  border-color: var(--color-border);
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
}

html[data-theme="dark"] .customer-tag-edit-button,
html[data-theme="dark"] .customer-tag-popover,
html[data-theme="dark"] .customer-tag-option {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-primary);
}

html[data-theme="dark"] .customer-tag-option {
  color: var(--color-text);
}

html[data-theme="dark"] .customer-tag-edit-button:hover,
html[data-theme="dark"] .customer-tag-edit-button:focus-visible,
html[data-theme="dark"] .customer-tag-option:hover,
html[data-theme="dark"] .customer-tag-option:focus-visible,
html[data-theme="dark"] .customer-tag-option.is-selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

html[data-theme="dark"] .badge-lifecycle-new,
html[data-theme="dark"] .badge-level,
html[data-theme="dark"] .badge-maintenance-warning {
  background: var(--color-warning-light);
  color: var(--color-warning);
  border-color: #695537;
}

html[data-theme="dark"] .badge-lifecycle-warm,
html[data-theme="dark"] .badge-info,
html[data-theme="dark"] .badge-public-pool {
  background: var(--color-primary-light);
  color: #b6c6ff;
  border-color: #455a8c;
}

html[data-theme="dark"] .badge-type,
html[data-theme="dark"] .badge-lifecycle-loyal,
html[data-theme="dark"] .badge-maintenance-normal {
  background: var(--color-success-light);
  color: var(--color-success);
  border-color: #3a6651;
}

html[data-theme="dark"] .badge-potential {
  background: #433225;
  color: #ffc48c;
  border-color: #755238;
}

html[data-theme="dark"] .badge-maintenance-expired {
  background: var(--color-danger-light);
  color: var(--color-danger);
  border-color: #794047;
}

/* 日报：表头、空状态、总结面板和表单保持同一深色层级。 */
html[data-theme="dark"] .daily-report-sheet-table thead th,
html[data-theme="dark"] .daily-report-sheet-table .daily-report-sheet-column-header-row th {
  background: var(--color-table-header);
  color: var(--color-text-secondary);
}

html[data-theme="dark"] .daily-report-sheet-table thead .daily-report-sheet-note-header-row > th,
html[data-theme="dark"] .daily-report-sheet-table thead .daily-report-sheet-ai-row > th,
html[data-theme="dark"] .daily-report-sheet-table tfoot th {
  background: var(--color-surface);
  color: var(--color-text);
}

html[data-theme="dark"] .daily-report-sheet-table tbody tr:nth-child(even) {
  background: var(--color-bg-alt);
}

html[data-theme="dark"] .daily-report-sheet-table tbody tr:hover {
  background: var(--color-hover-row);
}

html[data-theme="dark"] .daily-report-sheet-table .daily-report-sheet-info-row td,
html[data-theme="dark"] .daily-report-report-section,
html[data-theme="dark"] .daily-report-sheet-ai-panel,
html[data-theme="dark"] .daily-report-inline-plan-panel,
html[data-theme="dark"] .daily-report-ai-summary-block {
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
}

html[data-theme="dark"] .daily-report-sheet-table .daily-report-sheet-note-row th,
html[data-theme="dark"] .daily-report-sheet-table .daily-report-sheet-ai-row th,
html[data-theme="dark"] .daily-report-sheet-table .daily-report-sheet-plan-entry-row th {
  background: var(--color-surface);
  color: var(--color-text);
}

html[data-theme="dark"] .daily-report-sheet-textarea,
html[data-theme="dark"] .daily-report-inline-plan-form textarea,
html[data-theme="dark"] .daily-report-inline-plan-form select,
html[data-theme="dark"] .daily-report-plan-completion-input {
  border-color: var(--color-border-input);
  background: var(--color-input-bg);
  color: var(--color-text);
}

html[data-theme="dark"] .daily-report-sheet-textarea::placeholder,
html[data-theme="dark"] .daily-report-inline-plan-form textarea::placeholder,
html[data-theme="dark"] .daily-report-plan-completion-input::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

/* 月度任务：金额输入和汇总卡片避免浅底浅字。 */
html[data-theme="dark"] .admin-money-input,
html[data-theme="dark"] .money-input-wrap {
  border-color: var(--color-border-input);
  background: var(--color-input-bg);
}

html[data-theme="dark"] .admin-money-input input,
html[data-theme="dark"] .money-input-wrap input {
  color: var(--color-text);
}

html[data-theme="dark"] .admin-money-input input::placeholder,
html[data-theme="dark"] .money-input-wrap input::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

html[data-theme="dark"] .monthly-admin-daily-total {
  border-color: #455a8c;
  background: linear-gradient(135deg, #263559, #303d62);
  color: #b6c6ff;
}

html[data-theme="dark"] .monthly-admin-daily-total span {
  color: var(--color-text-secondary);
}

html[data-theme="dark"] .admin-progress-line {
  background: var(--color-border);
}

/* 记录成交：商品明细面板与表单项原先写死浅色底，深色下会整块发白。 */
html[data-theme="dark"] #order_items_container {
  border-color: var(--color-border);
  background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-surface) 100%);
}

html[data-theme="dark"] #order_items_container .order-items-header {
  color: var(--color-text-subtle);
}

html[data-theme="dark"] .order-items-add-btn {
  border-color: var(--color-border-input);
  background: var(--color-surface);
  color: var(--color-text-secondary);
}

html[data-theme="dark"] .order-items-add-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-hover-row);
  color: var(--color-text);
}

html[data-theme="dark"] .order-item-row {
  border-color: var(--color-border);
  background: var(--color-input-bg);
}

html[data-theme="dark"] .order-item-row:focus-within,
html[data-theme="dark"] .order-item-row:hover {
  border-color: var(--color-border-input);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .order-item-row input {
  border-color: var(--color-border-input);
  background: var(--color-input-bg);
  color: var(--color-text);
}

html[data-theme="dark"] .order-item-row input::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

html[data-theme="dark"] .order-item-row > button {
  border-color: #794047;
  background: var(--color-danger-light);
  color: var(--color-danger);
}

html[data-theme="dark"] .order-item-row > button:hover {
  border-color: var(--color-danger);
  background: #4d2b31;
  color: var(--color-danger-text);
}

html[data-theme="dark"] .order-amount-summary {
  border-color: var(--color-border);
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
}

html[data-theme="dark"] .order-amount-summary.is-error {
  border-color: #755238;
  background: var(--color-warning-light);
  color: var(--color-warning);
}

html[data-theme="dark"] .order-paid-percent {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

html[data-theme="dark"] .order-paid-percent.is-full,
html[data-theme="dark"] .order-unpaid-percent.is-zero {
  background: var(--color-success-light);
  color: var(--color-success);
}

html[data-theme="dark"] .order-unpaid-percent {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

/* 报价单：表头、缩略图与输入框原先写死浅色底。 */
html[data-theme="dark"] .quote-table-wrap {
  border-color: var(--color-border);
  background: var(--color-surface);
}

html[data-theme="dark"] .quote-table th {
  border-bottom-color: var(--color-border);
  background: var(--color-table-header);
  color: var(--color-text-subtle);
}

html[data-theme="dark"] .quote-table td {
  border-bottom-color: var(--color-border-light);
}

html[data-theme="dark"] .quote-input {
  border-color: var(--color-border-input);
  background: var(--color-input-bg);
  color: var(--color-text);
}

html[data-theme="dark"] .quote-input::placeholder,
html[data-theme="dark"] .quote-path-input::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

html[data-theme="dark"] .quote-path-input,
html[data-theme="dark"] .quote-path-text {
  color: var(--color-text-secondary);
}

html[data-theme="dark"] .quote-copy-btn.is-copied {
  border-color: #3a6651 !important;
  background: var(--color-success-light) !important;
  color: var(--color-success) !important;
}

html[data-theme="dark"] .quote-thumb-wrap {
  border-color: var(--color-border-input);
  background: var(--color-bg-alt);
}

html[data-theme="dark"] .quote-thumb-wrap.has-image {
  border-color: var(--color-border);
}

html[data-theme="dark"] .quote-thumb-placeholder {
  color: var(--color-text-muted);
}

html[data-theme="dark"] .quote-thumb-wrap.is-uploadable:hover {
  border-color: var(--color-warning);
  background: var(--color-warning-light);
}

html[data-theme="dark"] .quote-thumb-wrap.is-uploadable.drag-over {
  border-color: var(--color-orange);
  background: var(--color-warning-bg);
  box-shadow: 0 0 0 2px rgba(247, 107, 21, 0.28);
}

html[data-theme="dark"] .quote-view-remark {
  color: var(--color-warning);
}
