/* ========== 立即使用 - 功能体验页 ========== */
.page-functions .functions-main {
  padding: 0;
  margin: 0;
  min-height: calc(100vh - var(--header-height, 90px));
}
.site-header--compact .header-inner { padding: 0 24px; }
.header-user-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.header-account-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  opacity: 0.85;
}
.header-user-status {
  color: var(--color-text);
  font-weight: 500;
}
.header-user-status:empty { display: none; }
.trial-hint {
  color: var(--color-text);
  opacity: 0.9;
}
.trial-hint:empty { display: none; }
.header-auth-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.header-login-btn {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.header-login-btn:hover {
  background: rgba(116, 86, 241, 0.08);
}
.header-logout-btn {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.header-logout-btn:hover {
  background: var(--color-bg-light);
  color: var(--color-heading);
  border-color: var(--color-text);
}
.header-auth-btn[hidden] { display: none !important; }

.functions-app {
  display: flex;
  min-height: calc(100vh - var(--header-height, 90px));
}

/* ---------- 立即使用页字体 ---------- */
.page-functions {
  --font-functions-heading: 'Noto Serif SC', 'Source Han Serif SC', serif;
  --font-functions-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
}
.page-functions .functions-sidebar-title,
.page-functions .functions-panel-head h3,
.page-functions .workbench-form-title,
.page-functions .result-title,
.page-functions .result-block h5 {
  font-family: var(--font-functions-heading);
}
.page-functions .functions-content,
.page-functions .chat-msg-bubble,
.page-functions .form-label,
.page-functions .result-content {
  font-family: var(--font-functions-body);
}

/* ---------- 侧边栏折叠按钮 < / > ---------- */
.sidebar-toggle-btn {
  flex-shrink: 0;
  width: 28px;
  height: 56px;
  margin-left: -1px;
  border: 1px solid var(--color-border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  background: var(--color-white);
  color: var(--color-text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s, color 0.2s;
}
.sidebar-toggle-btn:hover {
  background: var(--color-bg-light);
  color: var(--color-primary);
}
.sidebar-toggle-icon { font-weight: 600; }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 98;
}
.sidebar-backdrop[hidden] { display: none !important; }
.sidebar-backdrop:not([hidden]) { display: block; }
.functions-content { position: relative; }

/* ---------- 左侧边栏（可拖拽调整宽度） ---------- */
.functions-sidebar {
  flex-shrink: 0;
  background: linear-gradient(175deg, #f9fafc 0%, #f3f5f9 100%);
  border-right: 1px solid #dde2eb;
  padding: 24px 0 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  transition: width 0.25s ease, min-width 0.25s ease, transform 0.25s ease;
  overflow: hidden;
}
.functions-sidebar.is-collapsed {
  width: 0 !important;
  min-width: 0 !important;
  border-right-width: 0;
  padding-left: 0;
  padding-right: 0;
}
.functions-sidebar-brand {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0 12px 20px 0;
  border-bottom: 1px solid var(--color-border);
}
.functions-sidebar-logo {
  width: 82px;
  height: 82px;
  border-radius: 18px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(116,86,241,0.25);
}
.functions-sidebar-logo img,
.functions-sidebar-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}
.functions-sidebar-title {
  margin: 14px 0 0;
  padding: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-heading);
  text-align: center;
  line-height: 1.4;
  border-bottom: none;
  letter-spacing: 0.01em;
}
.functions-sidebar-nav {
  width: calc(100% - 12px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 12px 0 0;
}
.functions-nav-item {
  width: 100%;
  padding: 11px 14px 11px 16px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #5a6478;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, transform 0.15s;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.functions-nav-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  color: #8a95a5;
  transition: color 0.18s;
}
.functions-nav-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}
.functions-nav-item:hover {
  background: rgba(116, 86, 241, 0.06);
  color: var(--color-heading);
  transform: translateX(3px);
}
.functions-nav-item:hover .functions-nav-icon { color: var(--color-primary); opacity: 0.85; }
.functions-nav-item.is-active {
  background: rgba(116, 86, 241, 0.10);
  color: var(--color-primary);
  font-weight: 600;
  padding-left: 20px;
}
.functions-nav-item.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--color-primary);
  border-radius: 0 2px 2px 0;
}
.functions-nav-item.is-active .functions-nav-icon { color: var(--color-primary); }
.functions-sidebar-resize {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}
.functions-sidebar-resize::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  width: 2px;
  height: 40px;
  background: var(--color-border);
  border-radius: 1px;
  opacity: 0.6;
}
.functions-sidebar-resize:hover::after { opacity: 1; background: var(--color-primary); }

/* ---------- 右侧主内容 ---------- */
.functions-content {
  flex: 1;
  min-width: 0;
  background: var(--color-bg-lighter);
  padding: 24px;
  overflow: auto;
}

.functions-panel {
  display: none;
  flex-direction: column;
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
}
#panel-fullcycleqc.functions-panel {
  max-width: 1200px;
}
.functions-panel.is-visible {
  display: flex;
  animation: panelFadeIn 0.22s ease;
}
@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.functions-panel[hidden] { display: none !important; }

.functions-panel-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  padding: 0 100px 16px 0;
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}
.functions-panel-head h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--color-heading);
  letter-spacing: 0.01em;
}
.functions-panel-head .btn--ghost {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.btn--ghost {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn--ghost:hover {
  background: rgba(116, 86, 241, 0.08);
  color: var(--color-primary);
}
.btn--sm { padding: 8px 16px; font-size: 14px; border-radius: 8px; }

/* ---------- 对话型面板（导诊/客服/预问诊） ---------- */
.functions-panel--chat {
  height: calc(100vh - var(--header-height, 90px) - 48px);
}
.chat-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--color-white);
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }
.chat-msg {
  display: flex;
  gap: 8px;
  max-width: 88%;
  animation: chatMsgIn 0.25s ease;
}
@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.assistant { align-self: flex-start; }
.chat-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  overflow: hidden;
}
.chat-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 隐藏用户头像（微信风格） */
.chat-msg.user .chat-msg-avatar { display: none; }
.chat-msg.assistant .chat-msg-avatar {
  background: linear-gradient(135deg, #ede9fe 0%, #dbeafe 100%);
  color: var(--color-primary);
}
.chat-msg-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.chat-msg.user .chat-msg-bubble {
  background: linear-gradient(135deg, #7c5af3 0%, #5e3fde 100%);
  color: var(--color-white);
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(116,86,241,0.25);
}
.chat-msg.assistant .chat-msg-bubble {
  background: var(--color-bg-light);
  color: var(--color-heading);
  border-bottom-left-radius: 4px;
}
.chat-msg.streaming .chat-msg-bubble::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 2px;
  background: var(--color-primary);
  animation: blink 0.8s step-end infinite;
  vertical-align: text-bottom;
}
@keyframes blink {
  50% { opacity: 0; }
}
.chat-msg-time {
  font-size: 12px;
  color: var(--color-text);
  opacity: 0.7;
  margin-top: 4px;
}
.chat-msg.user .chat-msg-time {
  color: var(--color-white);
  opacity: 0.9;
}
.chat-input-wrap {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  background: var(--color-white);
}
.chat-input-inner {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 14px;
  background: var(--color-bg-lighter);
  border-radius: 14px;
  border: 1px solid var(--color-border);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-input-inner:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(116, 86, 241, 0.15);
}
.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  min-height: 24px;
  max-height: 120px;
}
.chat-input::placeholder { color: #9ca3af; }
.chat-btn-voice {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: var(--color-white);
  cursor: pointer;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234d5d6d' stroke-width='2'%3E%3Cpath d='M12 1a3 3 0 0 1 3 3v8a3 3 0 0 1-6 0V4a3 3 0 0 1 3-3z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cline x1='12' y1='19' x2='12' y2='23'/%3E%3Cline x1='8' y1='23' x2='16' y2='23'/%3E%3C/svg%3E");
  background-size: 20px;
  background-repeat: no-repeat;
  background-position: center;
}
.chat-btn-voice:hover { background-color: var(--color-bg-light); }
.chat-btn-voice.is-recording {
  background-color: #fef2f2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23dc2626'%3E%3Ccircle cx='12' cy='12' r='6'/%3E%3C/svg%3E");
  background-size: 14px;
}
.chat-btn-send {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c5af3 0%, #5e3fde 100%);
  color: var(--color-white);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(116,86,241,0.28);
  transition: opacity 0.18s, transform 0.1s;
}
.chat-btn-send:hover { opacity: 0.9; transform: translateY(-1px); }
.chat-btn-send:active { transform: translateY(0); }
.chat-btn-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- 工作台表单（辅助诊疗 / 病历质控） ---------- */
.functions-panel--workbench .functions-panel-head {
  margin-bottom: 20px;
}
.functions-panel--workbench .workbench-form {
  background: #fafbfc;
  border: 1px solid #e0e5ed;
  border-left: 3px solid #0ea5e9;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05), 0 4px 16px rgba(14,165,233,0.04);
}
.functions-panel--workbench .workbench-form-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-heading);
  margin: 0 0 16px;
  padding: 0 0 12px;
  border-bottom: 1px solid #e8edf4;
  border-radius: 0;
  letter-spacing: 0.02em;
  background: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.functions-panel--workbench .workbench-form-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: linear-gradient(180deg, #0ea5e9 0%, #7456f1 100%);
  border-radius: 2px;
  flex-shrink: 0;
}
.form-row { margin-bottom: 14px; }
.form-row--2 {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 12px 16px;
  align-items: center;
}
.form-row--2.form-row--short {
  grid-template-columns: auto 72px auto 88px;
  gap: 8px 2px;
  align-items: center;
}
.form-row--short .form-label {
  margin-right: 0;
  padding-right: 0;
  white-space: nowrap;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
}
.form-row--2 .form-label { margin-bottom: 0; }
.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #334155;
}
.form-input--short {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
.form-row--short .form-input--short {
  width: 100%;
  min-width: 0;
  text-align: left;
}
.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(116, 86, 241, 0.15);
}
.form-input::placeholder { color: #94a3b8; }
.form-input--area {
  resize: vertical;
  min-height: 1.4em;
  max-height: none;
}
.form-input--area.form-input--tall { min-height: 4em; }
.form-input--tall { min-height: 4em; }

/* 患者基本信息行：flex 紧凑排列，标签紧贴输入框 */
.form-row--patient {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.form-row--patient .form-label {
  margin-bottom: 0;
  margin-right: 2px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}
.form-row--patient .form-input--short {
  width: auto;
}
#fuzhen-age { width: 70px; }
#fuzhen-sex { width: 92px; }
.form-row--patient .form-input--short:not(:last-child) {
  margin-right: 16px;
}

/* 主诉/现病史/既往史/辅助检查：左侧标题、右侧输入框，高度减半 */
.form-row--label-left {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0;
  align-items: stretch;
  margin-bottom: 8px;
}
.form-row--label-left .form-input--area {
  min-height: 1.4em;
  padding: 6px 10px;
  font-size: 13px;
}
.form-label--cell {
  margin: 0;
  padding: 8px 12px;
  min-height: 38px;
  background: linear-gradient(135deg, #e8f4fd 0%, #dbeafe 100%);
  color: #0369a1;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #bae6fd;
  border-right: none;
  border-radius: 6px 0 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.form-row--label-left .form-input {
  border-radius: 0 6px 6px 0;
  border-left: 1px solid #e2e8f0;
}
.form-row--label-left .form-input:focus { border-left-color: var(--color-primary); }
.workbench-actions { margin-top: 20px; display: flex; }
.workbench-actions .btn--lg {
  padding: 10px 28px;
  font-size: 15px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7c5af3 0%, #5e3fde 100%);
  box-shadow: 0 4px 14px rgba(116,86,241,0.3);
  transition: opacity 0.18s, transform 0.12s, box-shadow 0.18s;
}
.workbench-actions .btn--lg:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(116,86,241,0.38);
}
.workbench-actions .btn--lg:active { transform: translateY(0); }
/* 工作台专用大按钮（覆盖 .workbench-actions .btn--lg 的较低样式） */
.workbench-actions .btn--workbench,
.btn--workbench {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 14px;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #7c5af3 0%, #5035c8 100%);
  box-shadow: 0 6px 20px rgba(116,86,241,0.32), 0 1px 0 rgba(255,255,255,0.15) inset;
  position: relative;
  overflow: hidden;
}
.btn--workbench::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}
.btn--workbench .btn-icon {
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}
.btn--workbench .btn-text {
  position: relative;
}
.workbench-actions .btn--workbench:hover,
.btn--workbench:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(116,86,241,0.42), 0 1px 0 rgba(255,255,255,0.15) inset;
  opacity: 1;
}
.workbench-actions .btn--workbench:active,
.btn--workbench:active { transform: translateY(0); }
.workbench-actions .btn--workbench:disabled,
.btn--workbench:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.workbench-result {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.functions-panel--workbench .result-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-heading);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}
.result-block {
  margin-bottom: 12px;
  padding: 12px 14px;
  background: #fafbfc;
  border: 1px solid #e8ecf2;
  border-left: 3px solid #94a3b8;
  border-radius: 0 6px 6px 0;
}
.result-block:last-child { margin-bottom: 0; }
/* 诊疗结果颜色分类 */
#panel-fuzhen .result-block:nth-child(1) { border-left-color: #0ea5e9; }
#panel-fuzhen .result-block:nth-child(2) { border-left-color: #10b981; }
#panel-fuzhen .result-block:nth-child(3) { border-left-color: #f59e0b; }
#panel-zhikong .result-block:nth-child(1) { border-left-color: #7456f1; }
#panel-zhikong .result-block:nth-child(2) { border-left-color: #ef4444; }
.result-block h5 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.result-content {
  font-size: 14px;
  line-height: 1.65;
  color: #334155;
  white-space: pre-wrap;
}

/* ---------- 报告解读 ---------- */
.functions-panel--report {
  height: calc(100vh - var(--header-height, 90px) - 48px);
  min-height: 0; /* 防止面板随内容增高，保证内部可滚动 */
}
.functions-panel--report .report-upload {
  background: var(--color-white);
  border: 2px dashed var(--color-border);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  margin-bottom: 20px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
/* 折叠上传区（保留 DOM 供 JS 使用） */
.report-upload--hidden {
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  overflow: hidden !important;
  pointer-events: none;
}
.report-upload:hover,
.report-upload.dragover { border-color: var(--color-primary); background: rgba(116, 86, 241, 0.04); }
.report-file-input { position: absolute; width: 0; height: 0; opacity: 0; }
.report-upload-text { margin: 0 0 8px; font-size: 16px; color: var(--color-heading); }
.report-upload-hint { margin: 0; font-size: 13px; color: var(--color-text); opacity: 0.8; }
.report-preview {
  margin-bottom: 20px;
  padding: 10px 14px;
  background: var(--color-bg-light);
  border-radius: 10px;
  font-size: 13px;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.report-preview--uploading {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}
.report-preview--ok {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}
.report-preview--error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}
/* 系统提示消息（居中小字） */
.chat-sys-msg {
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  padding: 4px 0 8px;
  user-select: none;
}
.functions-panel--report .chat-frame { flex: 1; min-height: 280px; }
.functions-panel--report .chat-phone-wrap .chat-messages { min-height: 0; }
/* 回形针上传按钮 */
.chat-btn-attach {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  color: #8a95a5;
  cursor: pointer;
  transition: color 0.18s, background 0.18s;
  align-self: flex-end;
  margin-bottom: 1px;
}
.chat-btn-attach:hover {
  color: var(--color-primary);
  background: rgba(116,86,241,0.08);
}
/* 报告解读输入框 */
.functions-panel--report .chat-phone-wrap .chat-input {
  min-height: 38px;
  border-radius: 14px;
}

/* ---------- 对话区手机框样式（全尺寸生效） ---------- */
.chat-phone-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* 手机框效果 */
  max-width: 528px;
  width: 100%;
  margin: 0 auto;
  padding: 8px;
  background: #111118;
  border-radius: 44px;
  border: 4px solid #1c1c24;
  box-shadow:
    0 0 0 1px #2a2a35,
    0 0 0 2px #111118,
    inset 0 0 0 1px rgba(255,255,255,0.06),
    0 28px 56px rgba(0,0,0,0.4),
    0 6px 20px rgba(0,0,0,0.25);
  position: relative;
}
/* 胶囊摄像头/听筒 */
.chat-phone-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 20px;
  background: #1c1c24;
  border-radius: 0 0 12px 12px;
  z-index: 2;
}

.chat-phone-wrap .chat-frame {
  border-radius: 38px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.chat-phone-wrap .chat-messages {
  background: #f4f4f6;
  padding-top: 24px; /* 为听筒留空间 */
  padding-left: 12px;
  padding-right: 12px;
}
/* 单层 WeChat 风格输入栏 */
.chat-phone-wrap .chat-input-wrap {
  background: #f7f7f9;
  border-top: 1px solid #e8e8ec;
  border-radius: 0;
  padding: 10px 14px 18px;
  margin: 0;
  min-height: auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  /* 消除外层双框感 */
  box-shadow: none;
}
.chat-phone-wrap .chat-input-wrap:focus-within {
  background: #f7f7f9;
}
/* 内层透明，消除双框 */
.chat-phone-wrap .chat-input-inner {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}
.chat-phone-wrap .chat-input-inner:focus-within {
  border: none;
  box-shadow: none;
}
/* 输入框本身有白底圆角边框 */
.chat-phone-wrap .chat-input {
  flex: 1;
  min-height: 36px;
  max-height: 100px;
  font-size: 15px;
  background: #ffffff;
  border: 1px solid #dcdce0;
  border-radius: 20px;
  padding: 8px 14px;
  line-height: 1.45;
  transition: border-color 0.18s;
}
.chat-phone-wrap .chat-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
/* 语音按钮 */
.chat-phone-wrap .chat-btn-voice {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #ececf0;
  background-size: 18px;
}
.chat-phone-wrap .chat-btn-voice:hover { background-color: #e0e0e6; }
/* 发送按钮：圆形紫色 */
.chat-phone-wrap .chat-btn-send {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 0;
  flex-shrink: 0;
  background: var(--color-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 2L11 13'/%3E%3Cpath d='M22 2L15 22L11 13L2 9L22 2Z'/%3E%3C/svg%3E");
  background-size: 18px;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 2px 8px rgba(116,86,241,0.35);
}
.chat-phone-wrap .chat-btn-send:hover { background-color: var(--color-primary-dark); }
/* 移动端：缩小手机框 */
@media (max-width: 900px) {
  .chat-phone-wrap {
    max-width: 390px;
    border-radius: 40px;
    border-width: 4px;
  }
  .chat-phone-wrap .chat-frame { border-radius: 34px; }
}

/* ---------- 响应式：移动端侧边栏为抽屉 ---------- */
@media (max-width: 900px) {
  .functions-app { flex-direction: row; }
  .functions-content { margin-left: 0; }
  .functions-sidebar {
    position: fixed;
    top: var(--header-height, 90px);
    left: 0;
    bottom: 0;
    width: min(320px, 85vw) !important;
    min-width: 0 !important;
    max-width: none !important;
    z-index: 99;
    flex-direction: column;
    padding: 16px 16px 24px;
    gap: 0;
    border-right: 1px solid var(--color-border);
    border-bottom: none;
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
    transform: translateX(-100%);
    overflow-x: hidden;
    overflow-y: auto;
  }
  .functions-sidebar:not(.is-collapsed) {
    transform: translateX(0);
  }
  .functions-sidebar.is-collapsed {
    width: 0 !important;
    min-width: 0 !important;
    padding: 0;
    border-right-width: 0;
  }
  .sidebar-backdrop:not([hidden]) {
    display: block;
    top: var(--header-height, 90px);
  }
  .sidebar-toggle-btn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
    border: 1px solid var(--color-border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    z-index: 100;
    box-shadow: 2px 0 8px rgba(0,0,0,0.08);
  }
  .functions-sidebar:not(.is-collapsed) ~ .sidebar-toggle-btn {
    left: min(320px, 85vw);
  }
  .functions-sidebar-brand { flex-direction: column; align-items: center; gap: 0; padding: 0 0 16px; border-bottom: 1px solid var(--color-border); width: 100%; }
  .functions-sidebar-title { margin: 12px 0 0; padding: 0; border-bottom: none; text-align: center; font-size: 15px; }
  .functions-sidebar-logo { width: 64px; height: 64px; }
  .functions-sidebar-nav {
    width: 100%;
    flex-direction: column;
    padding: 16px 0 0;
    gap: 8px;
  }
  .functions-nav-item { flex: none; width: 100%; text-align: left; justify-content: flex-start; }
  .functions-nav-icon { margin-right: 10px; }
  .functions-panel--chat { height: auto; min-height: 400px; }
  .form-row--2 { grid-template-columns: 1fr 1fr; }
  .form-row--2.form-row--short { grid-template-columns: auto 72px auto 88px; gap: 8px 2px; }
  .form-row--label-left { grid-template-columns: 82px 1fr; }
  .form-label--cell { padding: 10px 10px; font-size: 12px; }
}

/* ---------- 试用次数与登录弹窗（Mock） ---------- */
.trial-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.trial-modal[hidden] { display: none !important; }
.trial-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.trial-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--color-white);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.2);
}
.trial-modal-header {
  position: relative;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  padding: 18px 20px 16px;
}
.trial-modal-header-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 0%, rgba(255,255,255,0.26) 0, transparent 40%),
              radial-gradient(circle at 90% 0%, rgba(255,255,255,0.28) 0, transparent 45%),
              linear-gradient(135deg, rgba(116,86,241,0.96) 0%, rgba(148,163,253,0.98) 100%);
  opacity: 0.96;
}
.trial-modal-header-main {
  position: relative;
  z-index: 1;
}
.trial-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  text-align: left;
  line-height: 1.4;
}
.trial-modal-subtitle {
  margin: 8px 0 0;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  line-height: 1.5;
}
.trial-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: rgba(15,23,42,0.18);
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}
.trial-modal-close:hover {
  background: rgba(15,23,42,0.32);
  transform: scale(1.05);
}
.trial-modal-body {
  padding: 20px 24px 24px;
}
.trial-modal-form label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-heading);
  margin-bottom: 6px;
}
.trial-form-row { margin-bottom: 16px; }
.trial-form-row--code .trial-code-wrap {
  display: flex;
  gap: 10px;
}
.trial-form-row--code .trial-input { flex: 1; min-width: 0; }
.trial-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 15px;
}
.trial-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(116, 86, 241, 0.15);
}
.trial-code-hint {
  margin: -8px 0 12px;
  font-size: 13px;
  color: var(--color-primary);
}
.trial-code-hint:empty { display: none; }
.trial-modal-actions {
  margin-top: 20px;
  text-align: center;
}
.trial-modal-actions .btn { padding: 12px 32px; font-size: 15px; border-radius: 10px; }

/* ========== 智能辅助诊疗 — 富结构结果卡片 ========== */
.result-section {
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #e8ecf2;
  overflow: hidden;
}
.result-section:last-child { margin-bottom: 0; }
.result-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e8ecf2;
}
.result-section-icon { font-size: 14px; line-height: 1; flex-shrink: 0; }
.result-section-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  letter-spacing: 0.03em;
}
.result-section-body { padding: 10px 14px; }
.result-section--primary-dx .result-section-head { background: #eff6ff; border-bottom-color: #bfdbfe; }
.result-section--risk .result-section-head { background: #fff7ed; border-bottom-color: #fed7aa; }
.result-section--qc .result-section-head { background: #fffbeb; border-bottom-color: #fde68a; }
.result-section--treatment .result-section-head { background: #f0fdf4; border-bottom-color: #bbf7d0; }
.result-section--health .result-section-head { background: #f0fdf4; border-bottom-color: #bbf7d0; }

/* Primary Dx */
.dx-primary-name {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.dx-icd {
  font-size: 11px;
  padding: 2px 6px;
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 4px;
  font-weight: 600;
  font-family: monospace;
}
.dx-confidence { display: flex; gap: 2px; margin-bottom: 6px; }
.dx-star { font-size: 13px; }
.dx-evidence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.dx-evidence-item {
  font-size: 11px;
  padding: 2px 7px;
  background: #f1f5f9;
  border-radius: 4px;
  color: #475569;
}

/* Differential Dx */
.diff-dx-list { display: flex; flex-direction: column; gap: 6px; }
.diff-dx-item {
  padding: 7px 10px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #94a3b8;
}
.diff-dx-name {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.diff-dx-evidence { font-size: 11px; color: #64748b; line-height: 1.5; }

/* Risk Badge */
.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}
.risk-badge--low { background: #dcfce7; color: #166534; }
.risk-badge--medium { background: #fef9c3; color: #854d0e; }
.risk-badge--high { background: #fee2e2; color: #991b1b; }
.risk-description { font-size: 13px; color: #475569; line-height: 1.6; }

/* Inquiry List */
.inquiry-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.inquiry-item {
  font-size: 12px;
  padding: 5px 10px;
  background: #f8fafc;
  border-radius: 6px;
  color: #334155;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}
.inquiry-item::before { content: 'Q'; font-weight: 800; color: #7456f1; font-size: 10px; margin-top: 1px; flex-shrink: 0; }

/* Test List */
.test-list { display: flex; flex-direction: column; gap: 5px; }
.test-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.test-name {
  padding: 6px 10px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 12px;
  font-weight: 700;
}
.test-purpose { padding: 6px 10px; font-size: 12px; color: #475569; }

/* QC Score + Defects (fuzhen) */
.qc-score-line {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 8px;
}
.qc-score-val { font-size: 22px; font-weight: 800; color: #f59e0b; }
.qc-score-unit { font-size: 12px; color: #94a3b8; }
.qc-defect-list { display: flex; flex-direction: column; gap: 4px; }
.qc-defect-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 10px;
  background: #fffbeb;
  border-radius: 5px;
  border-left: 3px solid #f59e0b;
}
.qc-defect-desc { font-size: 12px; color: #78350f; line-height: 1.4; flex: 1; }
.qc-defect-score { font-size: 12px; font-weight: 700; color: #d97706; white-space: nowrap; }

/* Treatment */
.treatment-list { display: flex; flex-direction: column; gap: 7px; }
.treatment-item {
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.treatment-direction {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}
.treatment-direction--drug { background: #dbeafe; color: #1d4ed8; }
.treatment-direction--op { background: #fce7f3; color: #9d174d; }
.treatment-direction--monitor { background: #dcfce7; color: #166534; }
.treatment-content { font-size: 12px; color: #334155; line-height: 1.5; }

/* Health List */
.health-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.health-item {
  font-size: 12px;
  padding: 4px 10px;
  color: #334155;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.5;
}
.health-item::before { content: '✓'; color: #10b981; font-size: 12px; flex-shrink: 0; margin-top: 1px; }

/* ========== 病历质控 — 富结构结果（分类缺陷） ========== */
.zhikong-grade-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 12px;
}
.zhikong-grade-badge {
  font-size: 22px;
  font-weight: 900;
  padding: 2px 12px;
  border-radius: 6px;
  letter-spacing: 0.05em;
}
.zhikong-grade-badge--jia { background: #dcfce7; color: #166534; }
.zhikong-grade-badge--yi { background: #fef9c3; color: #854d0e; }
.zhikong-grade-badge--bing { background: #fee2e2; color: #991b1b; }
.zhikong-grade-meta { flex: 1; }
.zhikong-grade-score { font-size: 15px; font-weight: 600; color: #1e293b; }
.zhikong-grade-hint { font-size: 14px; color: #64748b; }
.zhikong-total-deduction { font-size: 15px; font-weight: 700; color: #ef4444; }

.zhikong-category-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.zhikong-category {
  border: 1px solid #e8ecf2;
  border-radius: 7px;
  overflow: hidden;
}
.zhikong-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e8ecf2;
}
.zhikong-category.has-defects .zhikong-category-head { background: #fffbeb; border-bottom-color: #fde68a; }
.zhikong-category.no-defects .zhikong-category-head { background: #f0fdf4; border-bottom-color: #bbf7d0; }
.zhikong-category-name {
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 6px;
}
.zhikong-category-count {
  font-size: 13px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}
.has-defects .zhikong-category-count { background: #fde68a; color: #92400e; }
.no-defects .zhikong-category-count { background: #bbf7d0; color: #166534; }
.zhikong-defect-list { padding: 6px 12px; display: flex; flex-direction: column; gap: 4px; }
.zhikong-defect-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 8px;
  background: #fffbeb;
  border-radius: 4px;
  border-left: 3px solid #f59e0b;
}
.zhikong-defect-desc { font-size: 14px; color: #78350f; line-height: 1.5; flex: 1; }
.zhikong-defect-deduction { font-size: 14px; font-weight: 700; color: #d97706; white-space: nowrap; }
.zhikong-suggestions-box {
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 3px solid #10b981;
  border-radius: 6px;
}
.zhikong-suggestions-title {
  font-size: 14px;
  font-weight: 700;
  color: #166534;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.zhikong-suggestions-body {
  font-size: 14px;
  color: #334155;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ========== 合理用药审方 ========== */
.shenfa-form .form-row--patient { flex-wrap: wrap; }
#shenfa-age { width: 58px; }
#shenfa-sex { width: 78px; }
#shenfa-height { width: 70px; }
#shenfa-weight { width: 70px; }
.form-row--diag-list {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0;
  align-items: stretch;
  margin-bottom: 8px;
}
.shenfa-diag-list {
  border: 1px solid #e2e8f0;
  border-left: none;
  border-radius: 0 6px 6px 0;
  overflow: hidden;
}
.shenfa-diag-list .form-input {
  border: none !important;
  border-bottom: 1px solid #f1f5f9 !important;
  border-radius: 0 !important;
  padding: 7px 10px;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
}
.shenfa-diag-list .form-input:last-child { border-bottom: none !important; }
.shenfa-diag-list .form-input:focus { border-bottom: 1px solid var(--color-primary) !important; box-shadow: none !important; }
.form-label--diag { align-items: flex-start; padding-top: 8px; }

.shenfa-drug-table-wrap {
  overflow-x: auto;
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.shenfa-drug-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 540px;
}
.shenfa-drug-table th {
  background: #f1f5f9;
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.shenfa-drug-table td { padding: 4px 6px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.shenfa-drug-table tr:last-child td { border-bottom: none; }
.shenfa-drug-table .form-input { padding: 5px 8px; font-size: 13px; }
.drug-input--name { min-width: 110px; }
.drug-input--spec { width: 80px; }
.drug-input--dose { width: 55px; }
.drug-input--unit { width: 45px; }
.drug-input--route { width: 75px; }
.drug-input--freq { width: 50px; }
.shenfa-remove-drug {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.shenfa-remove-drug:hover { background: #fee2e2; }
.shenfa-add-drug {
  margin-top: 8px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Shenfa Result */
.shenfa-result-overall {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.shenfa-result-overall--low { background: #dcfce7; border: 1px solid #bbf7d0; }
.shenfa-result-overall--medium { background: #fef9c3; border: 1px solid #fde68a; }
.shenfa-result-overall--high { background: #fee2e2; border: 1px solid #fecaca; }
.shenfa-overall-icon { font-size: 24px; }
.shenfa-overall-content { flex: 1; }
.shenfa-overall-label {
  font-size: 14px;
  font-weight: 800;
  display: block;
  margin-bottom: 2px;
}
.shenfa-overall-label--low { color: #166534; }
.shenfa-overall-label--medium { color: #854d0e; }
.shenfa-overall-label--high { color: #991b1b; }
.shenfa-overall-desc { font-size: 12px; color: #6b7280; }

.shenfa-drug-risk-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.shenfa-drug-risk-item { border: 1px solid #e2e8f0; border-radius: 7px; overflow: hidden; }
.shenfa-drug-risk-header {
  padding: 6px 12px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.shenfa-drug-risk-body { padding: 8px 12px; display: flex; flex-direction: column; gap: 3px; }
.shenfa-drug-risk-tag {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}
.shenfa-drug-risk-tag::before { content: '⚠'; font-size: 11px; color: #f59e0b; flex-shrink: 0; margin-top: 1px; }

.shenfa-risk-section { margin-bottom: 12px; }
.shenfa-risk-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e2e8f0;
}
.shenfa-risk-item {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  margin-bottom: 4px;
}
.shenfa-risk-item--duplicate { border-left: 3px solid #f59e0b; }
.shenfa-risk-item--interaction { border-left: 3px solid #ef4444; }
.shenfa-risk-drugs { font-size: 12px; font-weight: 600; color: #1e293b; margin-bottom: 3px; }
.shenfa-risk-desc { font-size: 12px; color: #64748b; line-height: 1.5; }

/* 聊天气泡内 Markdown 标题 */
.chat-msg-bubble h2,
.chat-msg-bubble h3,
.chat-msg-bubble h4 {
  font-size: 14px;
  font-weight: 700;
  margin: 6px 0 2px;
  line-height: 1.4;
}

/* 智能导诊：基本信息采集栏 */
.daozhen-intake-bar {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.daozhen-intake-hint {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--color-text);
}
.daozhen-intake-fields {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.daozhen-intake-fields label {
  font-size: 14px;
  color: var(--color-text);
  white-space: nowrap;
}
/* 会话结束提示 */
.daozhen-session-end {
  text-align: center;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--color-text);
  opacity: 0.8;
  border-top: 1px dashed var(--color-border);
  margin-top: 8px;
}

/* 预问诊结论卡片 */
.preconsult-conclusion {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 8px;
  font-size: 13px;
}
.preconsult-conclusion-title {
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 10px;
  color: var(--color-primary);
}
.preconsult-conclusion-section {
  margin-bottom: 8px;
}
.preconsult-conclusion-label {
  font-weight: 600;
  color: var(--color-text);
  display: block;
  margin-bottom: 2px;
}
.preconsult-conclusion-value {
  color: var(--color-text);
  line-height: 1.5;
}
.preconsult-conclusion-list {
  margin: 2px 0 0 16px;
  padding: 0;
}
.preconsult-conclusion-list li {
  margin-bottom: 2px;
}

/* ============================================================
   智能辅助诊疗 — 重设计补充样式
   ============================================================ */

/* (A) 字体放大 */
.result-section-body { padding: 12px 16px; font-size: 14px; }
.result-section-title { font-size: 13px; }
.result-section-head { padding: 10px 16px; }
.diff-dx-name { font-size: 14px; }
.diff-dx-evidence { font-size: 13px; }
.inquiry-item { font-size: 14px; }
.test-name, .test-purpose { font-size: 14px; }
.treatment-content { font-size: 14px; }
.health-item { font-size: 14px; }
.risk-description { font-size: 14px; }

/* (B) 风险 alert（全幅色块） */
.risk-alert { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 8px; }
.risk-alert--high   { background: #fef2f2; border-left: 4px solid #ef4444; }
.risk-alert--medium { background: #fffbeb; border-left: 4px solid #f59e0b; }
.risk-alert--low    { background: #f0fdf4; border-left: 4px solid #22c55e; }
.risk-alert-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; }
.risk-alert--high   .risk-alert-badge { color: #b91c1c; }
.risk-alert--medium .risk-alert-badge { color: #92400e; }
.risk-alert--low    .risk-alert-badge { color: #15803d; }
.risk-alert-reason  { font-size: 14px; line-height: 1.6; color: #374151; }
.result-section--risk .result-section-head { background: #f8fafc; border-bottom-color: #e8ecf2; }

/* (C) 进度状态栏 */
.cdss-status-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 12px;
  background: #f0f4ff; border-radius: 8px; font-size: 13px; color: #4f46e5; font-weight: 500;
}
@keyframes cdss-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.cdss-status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #7456f1;
  animation: cdss-pulse 1.2s ease-in-out infinite; flex-shrink: 0;
}
.cdss-status-bar.cdss-status-done {
  background: rgba(34, 197, 94, 0.08);
  color: #15803d;
}
.cdss-status-bar.cdss-status-done .cdss-status-dot {
  background: #22c55e;
  animation: none;
}

/* (D) 骨架 loading 动画 */
@keyframes cdss-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.result-section--loading .result-section-body::after {
  content: ''; display: block; height: 60px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%; animation: cdss-shimmer 1.4s infinite; border-radius: 6px;
}

/* (E) 病历质控无缺陷 + 缺陷类型 badge + 治疗方案说明 */
.qc-no-defect { font-size: 14px; color: #15803d; display: flex; align-items: center; gap: 6px; }
.qc-defect-type {
  font-size: 11px; padding: 1px 6px; background: #fef3c7; color: #92400e;
  border-radius: 4px; font-weight: 600; white-space: nowrap; flex-shrink: 0;
}
.treatment-note { font-size: 12px; color: #6b7280; margin-top: 3px; line-height: 1.4; }

/* ========== 合理用药审方：结果区重构样式 ========== */

/* loading / error 状态 */
.shenfa-loading { padding: 16px 14px; font-size: 14px; color: #4f46e5; font-weight: 500; }
.shenfa-loading--error { color: #dc2626; }

/* 无风险提示 */
.shenfa-no-risk { font-size: 14px; color: #15803d; padding: 8px 12px; }

/* 药品风险行（维度标签 + 风险 badge + 原因文字） */
.shenfa-drug-risk-body { padding: 4px 12px 8px; display: flex; flex-direction: column; gap: 0; }
.shenfa-drug-risk-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; line-height: 1.5;
}
.shenfa-drug-risk-row:last-child { border-bottom: none; }
.shenfa-dim-label {
  flex-shrink: 0; width: 52px; font-size: 11px; color: #64748b;
  background: #f1f5f9; border-radius: 4px; padding: 2px 5px;
  text-align: center; margin-top: 1px;
}
.shenfa-risk-badge {
  flex-shrink: 0; font-size: 11px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; white-space: nowrap; margin-top: 1px;
}
.shenfa-risk-badge--medium { background: #fef9c3; color: #854d0e; }
.shenfa-risk-badge--high   { background: #fee2e2; color: #991b1b; }
.shenfa-risk-reason { flex: 1; font-size: 13px; color: #374151; line-height: 1.5; }

/* 全局风险项（重复用药、药物相互作用） */
.shenfa-global-risk-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; margin-bottom: 6px;
  border-radius: 7px; font-size: 13px; line-height: 1.5;
}
.shenfa-global-risk-item--duplicate   { background: #fffbeb; border-left: 3px solid #f59e0b; }
.shenfa-global-risk-item--interaction { background: #fef2f2; border-left: 3px solid #ef4444; }
