﻿/* ============================================================
   phase1-card-styles.css — Phase 1 患者卡片 + ColorTag + 详情面板
   ui-designer-opt + frontend-dev-opt 融合版 v2.0

   配合 color-tag-renderer-v2.js 使用。
   设计系统主色 #1B3A7B | 浅色基底 | 高饱和风险指示
   ============================================================ */

/* ===== 1. ColorTag 标签系统 ===== */

/* 标签组容器 */
.color-tag-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.color-tag-group.expanded {
  /* 展开时允许全部显示 */
}

/* 单个标签 */
.color-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  cursor: default;
  user-select: none;
}

/* 风险等级 — 按照设计规范 */
.color-tag.color-high,
.color-tag[data-risk="high"] {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FCA5A5;
}

.color-tag.color-medium,
.color-tag[data-risk="medium"] {
  background: #FFFBEB;
  color: #D97706;
  border-color: #FDE68A;
}

.color-tag.color-low,
.color-tag[data-risk="low"] {
  background: #F0FDF4;
  color: #059669;
  border-color: #A7F3D0;
}

/* standard = low 别名 */
.color-tag.color-standard,
.color-tag[data-risk="standard"] {
  background: #F0FDF4;
  color: #059669;
  border-color: #A7F3D0;
}

/* neutral = 默认/无风险 */
.color-tag.color-neutral,
.color-tag[data-risk="neutral"] {
  background: #F5F4F0;
  color: #5a6070;
  border-color: #E5E0DB;
}

/* 使用 DB color hex 时 — 通过 inline style --tag-color 控制 */
.color-tag[style*="--tag-color"] {
  border-color: var(--tag-color, #E5E0DB);
  background: color-mix(in srgb, var(--tag-color) 10%, white);
}

/* 小圆点指示器 */
.tag-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

/* 标签名称 */
.tag-name {
  display: inline;
}

/* 展开/折叠 "+N" 按钮 */
.color-tag-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 6px;
  border: 1px dashed #D1CCC4;
  border-radius: 999px;
  background: transparent;
  color: #8A8580;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.color-tag-more:hover {
  background: #EDEBE6;
  border-color: #A39E98;
  color: #5A5550;
}

/* 空状态/骨架屏 */
.p1-skeleton {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #EDEBE6;
  color: #ADAAA6;
  font-size: 11px;
  animation: p1-pulse 1.5s ease-in-out infinite;
}
@keyframes p1-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

/* ===== 2. 业务能力标签 ===== */

/* 行内 pill 模式 */
.skill-tag-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #F0F8F7;
  border: 1px solid #CCDFDC;
  font-size: 12px;
}
.skill-name {
  color: #1B3A7B;
  font-weight: 500;
}
.skill-stars {
  color: #C2410C;
  font-size: 11px;
}

/* 横向进度条模式 */
.skill-tag-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
}
.skill-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.skill-bar-name {
  font-size: 12px;
  font-weight: 500;
  color: #1A1A1A;
}
.skill-bar-stars {
  font-size: 11px;
  color: #8A8580;
}
.skill-bar-track {
  height: 6px;
  border-radius: 3px;
  background: #EDEBE6;
  overflow: hidden;
}
.skill-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #1B3A7B, #059669);
  width: 0%;
  transition: width 0.4s ease;
}
.skill-tag-bar .skill-bar-fill {
  width: calc(var(--star-pct, 60) * 1%);
}

/* 星级 */
.star-filled { color: #D97706; }
.star-half { color: #D97706; opacity: 0.6; }
.star-empty { color: #E5E0DB; }
.star-score {
  margin-left: 3px;
  font-size: 11px;
  color: #8A8580;
  font-weight: 500;
}

/* 星级 CSS 类名辅助（bar 模式）*/
.skill-tag-bar.star-5 .skill-bar-fill { width: 100%; }
.skill-tag-bar.star-4 .skill-bar-fill { width: 80%; }
.skill-tag-bar.star-3 .skill-bar-fill { width: 60%; }
.skill-tag-bar.star-2 .skill-bar-fill { width: 40%; }
.skill-tag-bar.star-1 .skill-bar-fill { width: 20%; }
.skill-tag-bar.star-0 .skill-bar-fill { width: 5%; }

/* ===== 3. 详情面板 v2 — 流程卡片流 (pc-detail-panel) ===== */

/* 遮罩层 */
.pc-detail-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35); z-index: 999;
  pointer-events: none;
  animation: pc-overlay-fadein 0.2s ease;
}
.pc-detail-overlay.active { pointer-events: auto; }
@keyframes pc-overlay-fadein { from { opacity: 0; } to { opacity: 1; } }

/* 面板主体 — 右侧滑入 */
.pc-detail-panel {
  position: fixed; top: 0; right: 0;
  width: 420px; max-width: 90vw; height: 100vh;
  background: #FFFFFF; border-left: 1px solid #E5E0DB;
  box-shadow: -4px 0 24px rgba(0,0,0,0.08); z-index: 1000;
  display: flex; flex-direction: column;
  animation: pc-detail-slidein 0.25s ease;
  overflow: hidden;
}
@keyframes pc-detail-slidein { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ===== Header（2026-07-24 重设计）===== */
.pc-detail-header {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 20px 16px; flex-shrink: 0;
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, #1B3A7B 0%, #E5E7EB 60%) 1;
}
.pc-detail-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, #1B3A7B 0%, #3B5FAA 100%);
  color: #fff; box-shadow: 0 2px 10px rgba(27,58,123,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.pc-detail-patient-info { flex: 1; min-width: 0; }
.pc-detail-patient-name {
  font-size: 18px; font-weight: 700; color: #1A1A2E; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 6px;
}
/* Meta 胶囊行 */
.pc-detail-meta-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px;
}
.pc-meta-chip {
  font-size: 11.5px; color: #4B5563; background: #EEF2FF;
  padding: 3px 10px; border-radius: 12px; font-weight: 500;
  white-space: nowrap; line-height: 1.5;
}
.pc-meta-chip.pc-meta-chip-dim {
  background: #F3F4F6; color: #6B7280;
}
.pc-detail-patient-tags { margin-top: 2px; }

.pc-detail-close {
  width: 36px; height: 36px; border: none; background: transparent;
  font-size: 22px; color: #9CA3AF; cursor: pointer; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all 0.15s; margin-top: 0;
}
.pc-detail-close:hover { background: #F3F4F6; color: #1F2937; }

/* 操作栏（纠错/锁定/改名） */
.pc-detail-correction-bar {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  padding: 8px 20px; background: #FAFAF8; border-bottom: 1px solid #EDEBE6;
}
.c-action-btn-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600;
  border: 1.5px solid #D6D4CD; background: white; color: #4A4640;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.c-action-btn-sm:active { transform: scale(0.96); }

/* 风险色边框 */
.pc-risk-high { border-left: 4px solid #DC2626; }
.pc-risk-medium { border-left: 4px solid #D97706; }
.pc-risk-low, .pc-risk-standard { border-left: 4px solid #059669; }

/* ===== 内容区（流程卡片流） ===== */
.pc-detail-body { flex: 1; overflow-y: auto; }

/* ---- Mini 时间线：卡片左侧纵向串联线 ---- */
.pc-flow-body {
  padding: 16px 16px 24px 20px;
  position: relative;
}
/* 可见卡片之间用 ::before 画连线（first-of-type 防止操作栏插入后误判） */
.pc-flow-body .pc-stage-card:not(:first-of-type)::before {
  content: '';
  position: absolute;
  left: 16px;
  top: -18px;
  width: 2px;
  height: 18px;
  background: linear-gradient(to bottom, #D1D5DB 0%, #9CA3AF 100%);
  z-index: 0;
}
/* 时间线圆点 */
.pc-flow-body .pc-stage-card {
  position: relative;
}
.pc-flow-body .pc-stage-card::after {
  content: '';
  position: absolute;
  left: -24px;
  top: 22px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #E5E7EB;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #D1D5DB;
  z-index: 1;
}
/* 当前岗位（客管）圆点高亮 */
.pc-stage-cs-card::after { background: var(--role-cs-primary, #1B3A7B) !important; box-shadow: 0 0 0 3px rgba(27,58,123,.15) !important; }
/* 交接建议圆点 */
.pc-handoff-card::after { background: #A855F7 !important; }

/* ===== 流程阶段卡片 ===== */
.pc-stage-card {
  padding: 14px 16px; border-radius: 10px; margin-bottom: 10px;
  background: #F4F5F7; border: 1px solid #E8EAED;
}
.pc-stage-card:last-child { margin-bottom: 0; }

.pc-stage-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.pc-stage-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.pc-stage-online { background: #EDF1FA; color: #2563EB; }
.pc-stage-cs { background: #ECFDF5; color: #059669; }
.pc-stage-consultant { background: #FFFBEB; color: #D97706; }
.pc-stage-doctor { background: #FEF2F2; color: #DC2626; }
.pc-stage-handoff { background: #EDF1FA; color: #1B3A7B; }

.pc-stage-label { font-size: 13px; font-weight: 600; color: #1a1a2e; }
.pc-stage-time { margin-left: auto; font-size: 11px; color: #999; }

/* ===== v4 紧凑内联标签 ===== */
.pc-stage-tags-row {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px;
}
.pc-field-inline {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 13px; line-height: 1.6; margin-bottom: 3px;
}
.pc-field-inline.pc-field-full { align-items: flex-start; }
.pc-fk {
  color: #888; font-size: 12px; flex-shrink: 0;
  min-width: 48px;
}
.pc-fv {
  color: #1A1A1A; flex: 1; white-space: pre-wrap;
}
.pc-field-full .pc-fv { font-size: 12.5px; }

/* ===== 记录列表（咨询师/医生多记录逐条展示） ===== */
.pc-stage-records {
  display: flex; flex-direction: column; gap: 8px;
}
.pc-record-entry {
  padding: 10px 12px; border-radius: 8px;
  background: #FFFFFF; border: 1px solid #E5E7EB;
}
.pc-record-time {
  font-size: 11px; color: #999; margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
/* 岗位标签 */
.pc-role-badge {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 1px 7px; border-radius: 10px; line-height: 18px;
  letter-spacing: 0.5px; flex-shrink: 0;
}
.pc-role-badge.pc-role-consultant {
  background: #EEF2FF; color: #4338CA; /* 靛蓝-咨询师 */
}
.pc-role-badge.pc-role-doctor {
  background: #ECFDF5; color: #059669; /* 翠绿-医生 */
}
.pc-role-badge.pc-role-online {
  background: #FEF3C7; color: #B45309; /* 暖黄-网电 */
}
.pc-role-badge.pc-role-cs {
  background: #F0FDF4; color: #166534; /* 浅绿-客管 */
}

/* ===== 全流程时间线卡片 ===== */
.pc-stage-timeline-card {
  background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
  border-color: #BAE6FD;
}
.pc-stage-timeline { background: #E0F2FE; color: #0369A1; }
.pc-record-ai {
  font-size: 12.5px; color: #1F2937; line-height: 1.55;
  white-space: pre-wrap; margin-bottom: 4px;
}
.pc-record-handoff {
  font-size: 12px; color: #5a6070; line-height: 1.5;
}
.pc-record-handoff .pc-rhf-item {
  display: inline-block; margin-right: 12px;
}
.pc-record-handoff .pc-rhf-k {
  font-size: 11px; color: #999; margin-right: 2px;
}
.pc-record-empty {
  font-size: 12.5px; color: #999; text-align: center;
  padding: 12px 0;
}

/* ===== 交接字段行（咨询师面诊7字段提炼展示） ===== */
.pc-record-fields {
  display: flex; flex-direction: column; gap: 6px;
}
.pc-rf-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px; line-height: 1.55;
  padding: 6px 10px; border-radius: 6px;
  background: #FAFBFC;
}
.pc-rf-label {
  flex-shrink: 0; color: #6B7280; font-weight: 600;
  font-size: 12px; min-width: 70px;
}
.pc-rf-value {
  flex: 1; color: #1F2937; word-break: break-word;
}

/* 迷你标签 */
.pc-mini-tag {
  font-size: 11px; padding: 1px 7px; border-radius: 8px;
  background: #F0F1F3; color: #555; white-space: nowrap;
}
.pc-mini-tag.pc-mini-warn { background: #FFFBEB; color: #D97706; }
.pc-mini-tag.pc-mini-info { background: #EDF1FA; color: #2563EB; }
.pc-mini-tag.pc-mini-good { background: #F0FDF4; color: #059669; }

/* ===== AI 提示条 ===== */
.pc-ai-tip {
  margin-top: 10px; padding: 8px 10px;
  background: #F0F9FF; border-radius: 6px;
  border-left: 3px solid #3B82F6;
  font-size: 12px; color: #1E40AF; line-height: 1.5;
}

/* ===== 角色备注区 ===== */
.pc-note-section {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed #E5E7EB;
}
.pc-note-label {
  font-size: 11px; color: #888; margin-bottom: 6px;
  display: flex; align-items: center; gap: 4px;
}
.pc-note-text {
  font-size: 12px; color: #1a1a2e; line-height: 1.5;
  background: #FFFBEB; border-radius: 6px; padding: 8px 10px;
  border: 1px solid #FDE68A;
}
.pc-note-text.empty { color: #C4C4C4; font-style: italic; }
.pc-note-edit-link {
  font-size: 11px; color: #059669; cursor: pointer;
  margin-top: 6px; display: inline-block;
}
.pc-note-edit-link:hover { text-decoration: underline; }
.pc-note-edit-area { margin-top: 6px; }
.pc-note-textarea {
  width: 100%; border: 1px solid #E5E7EB; border-radius: 6px;
  padding: 8px 10px; font-size: 12px; font-family: inherit;
  resize: vertical; min-height: 60px; line-height: 1.5; color: #1a1a2e;
}
.pc-note-textarea:focus {
  outline: none; border-color: #059669;
  box-shadow: 0 0 0 2px rgba(5,150,105,.12);
}
.pc-note-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.pc-note-btn {
  font-size: 12px; padding: 4px 12px; border-radius: 6px;
  border: none; cursor: pointer; font-weight: 500;
}
.pc-note-btn-cancel { background: #F0F1F3; color: #666; }
.pc-note-btn-save { background: #059669; color: #fff; }

/* ===== 各环节卡片颜色区分 ===== */
.pc-stage-card.pc-stage-online-card {
  background: #EDF1FA;
  border-color: #BFDBFE;
  border-left: 3px solid #3B82F6;
}
.pc-stage-card.pc-stage-cs-card {
  background: #EFFAF4;
  border-color: #86EFAC;
  border-left: 4px solid #16A34A;
  box-shadow: 0 1px 3px rgba(22,163,74,.08);
}
/* 交接建议作为网电→客管→咨询师之间的桥梁，用温和紫 */
.pc-stage-card.pc-handoff-card {
  background: linear-gradient(135deg, #FAF5FF 0%, #F5F3FF 100%);
  border-color: #E9D5FF;
  border-left: 4px solid #A855F7;
  box-shadow: 0 1px 3px rgba(168,85,247,.06);
}
.pc-stage-card.pc-stage-consultant-card {
  background: #FFFBEB;
  border-color: #FDE68A;
  border-left: 3px solid #F59E0B;
}
.pc-stage-card.pc-stage-doctor-card {
  background: #FEF2F2;
  border-color: #FECACA;
  border-left: 3px solid #EF4444;
}
.pc-stage-card.pc-handoff-card {
  background: #FAF5FF;
  border-color: #E9D5FF;
  border-left: 3px solid #A855F7;
}

/* ===== 交接建议卡片 ===== */
.pc-stage-card.pc-handoff-card { background: #FAF5FF; border-color: #E9D5FF; }

/* ===== 网电四个核心文本块 ===== */
.pc-online-insight {
  padding: 8px 10px 6px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
}
.pc-online-insight:last-of-type { margin-bottom: 0; }
.pc-oi-label {
  font-size: 11px; font-weight: 600; color: #6B7280;
  margin-bottom: 3px; letter-spacing: 0.3px;
}
.pc-oi-text {
  font-size: 13px; color: #1F2937; line-height: 1.65;
}
/* 摘要 — 蓝调淡底 */
.pc-online-summary {
  background: linear-gradient(135deg, #EFF6FF 0%, #F0F9FF 100%);
  border: 1px solid #BFDBFE;
}
.pc-online-summary .pc-oi-label { color: #2563EB; }
/* 核心顾虑 — 橙调淡底 */
.pc-online-concern {
  background: linear-gradient(135deg, #FFF7ED 0%, #FFFBEB 100%);
  border: 1px solid #FED7AA;
}
.pc-online-concern .pc-oi-label { color: #C2410C; }
/* 最大恐惧 — 红调淡底 */
.pc-online-fear {
  background: linear-gradient(135deg, #FEF2F2 0%, #FFF5F5 100%);
  border: 1px solid #FECACA;
}
.pc-online-fear .pc-oi-label { color: #DC2626; }
/* 到院动机 — 绿调淡底 */
.pc-online-motivation {
  background: linear-gradient(135deg, #F0FDF4 0%, #ECFDF5 100%);
  border: 1px solid #BBF7D0;
}
.pc-online-motivation .pc-oi-label { color: #16A34A; }
/* 真实需求 — 紫调淡底 */
.pc-online-needs {
  background: linear-gradient(135deg, #FAF5FF 0%, #F5F3FF 100%);
  border: 1px solid #E9D5FF;
}
.pc-online-needs .pc-oi-label { color: #7C3AED; }

/* 接待策略 — 青调淡底 */
.pc-online-strategy {
  background: linear-gradient(135deg, #F0FDFA 0%, #ECFEFF 100%);
  border: 1px solid #99F6E4;
}
.pc-online-strategy .pc-oi-label { color: #0D9488; }

/* 主诉/口腔/决策 — 轻量行 */
.pc-online-extra {
  margin-top: 3px; margin-bottom: 3px; padding: 0 2px;
}

/* ===== 客管操作栏（在滚动体内，不悬浮） ===== */
.cs-actions-bar {
  display: flex; gap: 5px; padding: 10px 14px;
  background: #F4F5F7; border-radius: 10px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.cs-action-btn {
  padding: 9px 10px; border: 1px solid #E5E7EB;
  border-radius: 8px; background: #fff; font-size: 12.5px;
  color: #1a1a2e; cursor: pointer; white-space: nowrap; text-align: center;
  transition: background 0.15s;
}
/* 确认到院/分诊占第一行，各1/2宽 */
.cs-action-btn.cs-action-primary {
  flex: 1 0 calc(50% - 3px); min-width: 0;
  background: #1B3A7B; color: #fff; border-color: #1B3A7B;
  font-weight: 600; font-size: 13px; padding: 10px 10px;
}
.cs-action-btn.cs-action-primary:hover { background: #152E63; border-color: #152E63; }
.cs-action-btn.cs-action-primary:active { background: #0F2247; }
/* 下面3个占第二行，各1/3宽 */
.cs-action-btn.cs-action-secondary {
  flex: 1 0 calc(33.33% - 4px); min-width: 0;
  font-size: 11.5px; padding: 8px 4px; color: #555;
}
.cs-action-btn:hover { background: #F0F1F3; border-color: #8b919e; }
.cs-action-btn:active { background: #E5E7EB; }
.cs-action-btn.cs-action-btn-danger { color: #DC2626; border-color: #FECACA; }
.cs-action-btn.cs-action-btn-danger:hover { background: #FEF2F2; border-color: #FCA5A5; }
/* 客管快速文本录入 */
.cs-quick-input-wrap {
  display: flex; flex: 2 1 180px; min-width: 140px; gap: 4px;
}
.cs-quick-input {
  flex: 1; min-width: 0; padding: 7px 10px;
  border: 1px solid #E5E7EB; border-radius: 8px;
  font-size: 12px; color: #1a1a2e; background: #fff;
  outline: none; transition: border-color 0.15s;
}
.cs-quick-input::placeholder { color: #8b919e; }
.cs-quick-input:focus { border-color: #1B3A7B; box-shadow: 0 0 0 2px rgba(27,58,123,.12); }
.cs-quick-save-btn {
  padding: 7px 10px; border: 1px solid #1B3A7B; border-radius: 8px;
  background: #1B3A7B; color: #fff; font-size: 13px; cursor: pointer;
  white-space: nowrap; transition: background 0.15s;
}
.cs-quick-save-btn:hover { background: #152E63; }
.cs-quick-save-btn:active { background: #0F2247; }
/* 客管卡片高亮 */
.pc-stage-cs-card { border-color: var(--role-cs-primary, #1B3A7B); border-left: 4px solid var(--role-cs-primary, #1B3A7B); }
.cs-role-badge {
  font-size: 11px; font-weight: 700; color: #16A34A;
  background: rgba(22,163,74,.10); padding: 2px 10px; border-radius: 10px;
  letter-spacing: 0.3px;
}

/* ===== 客管时间线录入卡片 ===== */
.pc-cs-timeline-note { margin-top: 2px; }
.pc-cs-tn-display {
  font-size: 13px; color: #5A6070; line-height: 1.65;
  padding: 10px 14px; background: #F9FAFB;
  border-radius: 8px; border: 1px dashed #D1D5DB;
  min-height: 38px; word-break: break-all;
}
.pc-cs-tn-display:empty::after {
  content: '暂无记录'; color: #9CA3AF; font-style: italic;
}
.pc-cs-tn-textarea {
  width: 100%; min-height: 80px; padding: 10px 12px;
  border: 1.5px solid #93B4F5; border-radius: 8px;
  font-size: 13px; line-height: 1.65; resize: vertical;
  font-family: inherit; color: #1F2937; background: #fff;
  box-sizing: border-box; transition: border-color 0.15s;
}
.pc-cs-tn-textarea:focus {
  outline: none; border-color: #1B3A7B;
  box-shadow: 0 0 0 3px rgba(27,58,123,0.10);
}
.pc-cs-tn-actions {
  display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap;
}
.pc-cs-tn-btn {
  padding: 6px 14px; border-radius: 6px; border: 1px solid #D1D5DB;
  background: #fff; color: #5A6070; font-size: 12px; cursor: pointer;
  transition: all 0.15s; font-family: inherit; font-weight: 500;
}
.pc-cs-tn-btn:hover { background: #F3F4F6; border-color: #9CA3AF; }
.pc-cs-btn-voice { border-color: #BFDBFE; color: #1D4ED8; background: #EFF6FF; }
.pc-cs-btn-voice:hover { background: #DBEAFE; }
.pc-cs-btn-edit { border-color: #D1D5DB; }
.pc-cs-btn-save { border-color: #1B3A7B; background: #1B3A7B; color: #fff; }
.pc-cs-btn-save:hover { background: #264D99; }
/* ===== 客管多备注显示（v1.1 只读不可编辑） ===== */
.cs-notes-list { max-height: 260px; overflow-y: auto; margin-bottom: 8px; }
.cs-note-item { padding: 6px 8px; margin: 3px 0; background: #f8fafc; border-radius: 4px; border-left: 3px solid #38bdf8; }
.cs-note-item .cs-note-meta { font-size: 11px; color: #94a3b8; margin-bottom: 2px; }
.cs-note-item .cs-note-text { font-size: 13px; color: #334155; line-height: 1.5; }
.cs-new-note-row { margin-top: 6px; }
.pc-cs-tn-header { font-size: 12px; color: #6B7280; font-weight: 600; margin-bottom: 6px; }
.pc-cs-tn-notes-list { max-height: 220px; overflow-y: auto; }
.pc-cs-tn-note-item { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px solid #F0F1F3; }
.pc-cs-tn-note-item:last-child { border-bottom: none; }
.pc-cs-tn-note-idx { flex: 0 0 auto; font-size: 10px; color: #94a3b8; white-space: nowrap; padding-top: 1px; }
.pc-cs-tn-note-text { flex: 1; font-size: 12.5px; color: #374151; line-height: 1.5; word-break: break-all; }
.cs-role-badge { font-size: 11px; color: #1B3A7B; background: #EFF6FF; padding: 2px 8px; border-radius: 10px; margin-left: 8px; }
.pc-cs-btn-cancel { color: #9CA3AF; }

/* 网电折叠开关 */
.pc-collapse-toggle:hover { color: var(--primary, #2563EB) !important; }

/* ===== 分割线 ===== */
.pc-divider { border: none; border-top: 1px dashed #E0E0E0; margin: 10px 0; }

/* ===== 手机端适配 (≤480px) ===== */
@media (max-width: 480px) {
  /* 面板全宽 */
  .pc-detail-panel {
    width: 100vw; max-width: 100vw;
    border-left: none; border-radius: 0;
  }

  /* Header 紧凑 */
  .pc-detail-header {
    padding: 12px 14px; gap: 10px;
  }
  .pc-detail-avatar { width: 38px; height: 38px; font-size: 16px; }

  /* 内容区间距缩窄 */
  .pc-flow-body { padding: 10px 10px 20px 18px; }

  /* 卡片内缩 */
  .pc-stage-card { padding: 12px 12px; border-radius: 8px; margin-bottom: 8px; }

  /* 时间线适配：左侧圆点间距 */
  .pc-flow-body .pc-stage-card::after {
    left: -20px; top: 20px;
    width: 6px; height: 6px;
  }
  .pc-flow-body .pc-stage-card:not(:first-of-type)::before {
    left: 13px; top: -15px; height: 15px;
  }

  /* 操作栏：确认到院独占首行，其余4个一行 */
  .cs-actions-bar {
    padding: 8px 10px; gap: 4px;
  }
  .cs-action-btn {
    padding: 10px 6px; font-size: 12px;
    border-radius: 8px;
  }
  .cs-action-btn.cs-action-primary {
    flex: 1 0 100%; min-width: 0;
  }
  .cs-action-btn.cs-action-secondary {
    flex: 1 1 0; min-width: 0;
  }
  .cs-quick-input-wrap {
    flex: 1 0 100%; min-width: 0; margin-top: 2px;
  }

  /* 字段内联紧凑 */
  .pc-field-inline { font-size: 13px; gap: 4px; }
  .pc-fk { min-width: 42px; font-size: 11px; }
}

/* =========================================================
   Scheme A — Visit Group（就诊分组）+ Timeline Node
   ========================================================= */
.visit-group-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 0 8px 0;
}

/* --- Visit Group --- */
.visit-group {
  border-radius: 10px;
  background: #fff;
  border: 1px solid #E5E7EB;
  overflow: hidden;
}
.visit-group.collapsed .visit-group-body { display: none; }
.visit-group.collapsed .vg-toggle-icon { transform: rotate(-90deg); }
.visit-group-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: #F8FAFC;
  border-bottom: 1px solid #E5E7EB;
  cursor: pointer; user-select: none;
  transition: background .15s;
}
.visit-group-header:hover { background: #EEF2FF; }
.vg-icon { font-size: 18px; flex-shrink: 0; }
.vg-title { font-weight: 600; color: #1a1a2e; font-size: 15px; flex-shrink: 0; }
.vg-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; flex: 1; min-width: 0; }
.vg-meta-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  font-weight: 500; white-space: nowrap; flex-shrink: 0;
}
.vg-tag-arrived { background: #D1FAE5; color: #047857; }
.vg-tag-intransit { background: #FEF3C7; color: #B45309; }
.vg-tag-pending { background: #FEE2E2; color: #B91C1C; }
.vg-tag-doctor { background: #F3E8FF; color: #7C3AED; }
.vg-tag-outcome { background: #DBEAFE; color: #1D4ED8; }
.vg-toggle-icon { margin-left: auto; color: #9CA3AF; font-size: 12px; transition: transform .2s; flex-shrink: 0; }

.visit-group-body {
  padding: 8px 10px 12px 10px;
  position: relative;
}

/* --- Timeline Node --- */
.tl-node {
  position: relative;
  padding-left: 30px;
}
.tl-node::before {
  content: '';
  position: absolute;
  left: 7px; top: 20px; bottom: -12px;
  width: 2px; background: #E5E7EB;
  z-index: 0;
}
.tl-node:last-child::before { display: none; }
.tl-node::after {
  content: '';
  position: absolute;
  left: 2px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #D1D5DB;
  z-index: 1;
  transition: background .2s, box-shadow .2s;
}
.tl-node.expanded::after {
  background: #1B3A7B;
  box-shadow: 0 0 0 3px rgba(27,58,123,.15);
}

.tl-node-header {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px;
  background: #F9FAFB; border: 1px solid #F0F1F3;
  cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s;
}
.tl-node-header:hover { background: #EEF2FF; border-color: #BFDBFE; }

.tl-role-badge {
  flex-shrink: 0;
  font-size: 11px; padding: 3px 8px; border-radius: 12px;
  font-weight: 500;
}
.badge-online { background: #DBEAFE; color: #1D4ED8; }
.badge-cs { background: #D1FAE5; color: #047857; }
.badge-consultant { background: #FEF3C7; color: #B45309; }
.badge-close { background: #FEF3C7; color: #B45309; }
.badge-doctor { background: #FEE2E2; color: #B91C1C; }

.tl-node-time { flex-shrink: 0; font-size: 11px; color: #9CA3AF; min-width: 50px; }
.tl-node-summary {
  flex: 1; min-width: 0;
  font-size: 12px; color: #5a6070;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-node-toggle { flex-shrink: 0; font-size: 10px; color: #D1D5DB; }

.tl-node.expanded .tl-node-header {
  background: #F0F4FF; border-color: #93B4F5;
  border-bottom-left-radius: 0; border-bottom-right-radius: 0;
}
.tl-node.expanded .tl-node-toggle { color: #1B3A7B; }

.tl-node-body {
  display: none;
  padding: 12px;
  margin: 0 0 10px 0;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-top: none;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.02);
}
.tl-node.expanded .tl-node-body { display: block; }

/* 展开状态下头部与身体连成一体 */
.tl-node.expanded .tl-node-header {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
}

/* 时间线节点内的记录卡片：去掉外层边框，避免嵌套盒子 */
.tl-node-body .pc-record-entry {
  background: transparent;
  border: none;
  padding: 0;
}
.tl-node-body .pc-record-time {
  display: none;
}

/* 字段卡片：标签在上，内容在下 */
.pc-record-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pc-rf-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}
.pc-rf-label {
  color: #1B3A7B;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.pc-rf-value {
  color: #1F2937;
  font-size: 13.5px;
  line-height: 1.75;
  word-break: break-word;
  white-space: pre-wrap;
}
.pc-record-empty {
  font-size: 13px;
  color: #9CA3AF;
  text-align: center;
  padding: 20px 0;
  background: #F8FAFC;
  border-radius: 8px;
}

/* 移动端缩小间距 */
@media (max-width: 768px) {
  .visit-group-header { padding: 8px 10px; }
  .vg-title { font-size: 14px; }
  .tl-node { padding-left: 26px; }
  .tl-node-header { gap: 5px; padding: 6px 8px; }
  .tl-node-summary { font-size: 11px; }
  .tl-node-time { font-size: 10px; min-width: 44px; }
  .tl-node-body { padding: 8px; }
  .pc-rf-row { padding: 10px; gap: 5px; }
  .pc-rf-label { font-size: 11px; }
  .pc-rf-value { font-size: 12.5px; line-height: 1.7; }
}
