/* ==================== 基础重置 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; -webkit-font-smoothing: antialiased; color: #1F2937; }

/* ==================== 登录页 ==================== */
.login-view {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #E6F4FF 0%, #F0F7FF 40%, #F5F7FA 100%);
  overflow: hidden; z-index: 100;
}
.login-bg-decoration { position: absolute; inset: 0; pointer-events: none; }
.login-circle { position: absolute; border-radius: 50%; opacity: 0.08; }
.login-circle-1 { width: 400px; height: 400px; background: #1677FF; top: -100px; right: -80px; }
.login-circle-2 { width: 300px; height: 300px; background: #1677FF; bottom: -60px; left: -60px; }
.login-circle-3 { width: 200px; height: 200px; background: #4096FF; top: 40%; left: 20%; opacity: 0.05; }

.login-card {
  position: relative; width: 400px; background: #fff; border-radius: 16px;
  padding: 40px 36px; box-shadow: 0 8px 32px rgba(22, 119, 255, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
  z-index: 1;
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-logo { display: flex; justify-content: center; margin-bottom: 16px; }
.login-header h1 { font-size: 20px; font-weight: 600; color: #1F2937; margin-bottom: 6px; }
.login-header p { font-size: 13px; color: #9CA3AF; }

.login-form { display: flex; flex-direction: column; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 500; color: #4B5563; }
.form-group input[type="text"], .form-group input[type="password"] {
  height: 42px; padding: 0 14px; border: 1px solid #E5E7EB; border-radius: 8px;
  font-size: 14px; color: #1F2937; transition: all .2s; outline: none; background: #FAFBFC;
}
.form-group input:focus { border-color: #1677FF; background: #fff; box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.08); }

.role-selector { display: flex; gap: 10px; }
.role-option { flex: 1; cursor: pointer; }
.role-option input { display: none; }
.role-label {
  display: block; text-align: center; padding: 10px 0; border: 1px solid #E5E7EB;
  border-radius: 8px; font-size: 13px; color: #6B7280; transition: all .2s; background: #FAFBFC;
}
.role-option input:checked + .role-label { border-color: #1677FF; color: #1677FF; background: #E6F4FF; font-weight: 500; }

.btn-login { width: 100%; height: 44px; margin-top: 6px; font-size: 15px; }
.login-tip { text-align: center; font-size: 12px; color: #9CA3AF; margin-top: 4px; }

/* ==================== 按钮通用 ==================== */
.btn-primary {
  background: #1677FF; color: #fff; border: none; border-radius: 8px; padding: 8px 20px;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px;
}
.btn-primary:hover { background: #4096FF; }
.btn-primary:active { background: #0958D9; }
.btn-primary:disabled { background: #A0CFFF; cursor: not-allowed; }

.btn-default {
  background: #fff; color: #4B5563; border: 1px solid #E5E7EB; border-radius: 8px; padding: 8px 20px;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px;
}
.btn-default:hover { border-color: #1677FF; color: #1677FF; }

.btn-outline {
  background: transparent; color: #1677FF; border: 1px solid #1677FF; border-radius: 8px;
  padding: 8px 20px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s;
}
.btn-outline:hover { background: #E6F4FF; }

/* ==================== 主应用 ==================== */
.app-view { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* 顶部导航 */
.top-bar {
  height: 56px; background: #fff; border-bottom: 1px solid #E5E7EB;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; flex-shrink: 0; z-index: 50;
}
.top-bar-left { display: flex; align-items: center; gap: 12px; }
.top-logo { display: flex; }
.top-title { font-size: 16px; font-weight: 600; color: #1F2937; }
.top-dept {
  font-size: 12px; color: #1677FF; background: #E6F4FF; padding: 2px 10px;
  border-radius: 4px; font-weight: 500;
}
.top-bar-right { display: flex; align-items: center; gap: 16px; }
.top-btn {
  display: flex; align-items: center; gap: 6px; background: #F3F4F6; border: none;
  padding: 6px 12px; border-radius: 6px; font-size: 13px; color: #6B7280; cursor: pointer; transition: all .2s;
}
.top-btn:hover { background: #E5E7EB; color: #1F2937; }
.top-btn.offline { background: #FFF1F0; color: #FF4D4F; }

.doctor-info { display: flex; align-items: center; gap: 10px; }
.doctor-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #1677FF; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
}
.doctor-text { display: flex; flex-direction: column; }
.doctor-name { font-size: 13px; font-weight: 600; color: #1F2937; }
.doctor-role { font-size: 11px; color: #9CA3AF; }

/* 网络Banner */
.network-banner {
  height: 40px; background: #FF4D4F; color: #fff; display: flex; align-items: center;
  justify-content: center; gap: 8px; font-size: 13px; flex-shrink: 0; z-index: 49;
  animation: slideDownBanner .3s ease-out;
}
@keyframes slideDownBanner { from { height: 0; opacity: 0; } to { height: 40px; opacity: 1; } }

/* ==================== 应用主体 ==================== */
.app-body { flex: 1; display: flex; overflow: hidden; }

/* 左侧患者列表 */
.patient-sidebar {
  width: 340px; flex-shrink: 0; background: #fff; border-right: 1px solid #E5E7EB;
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-header {
  padding: 16px 20px 12px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #F3F4F6;
}
.sidebar-header h2 { font-size: 16px; font-weight: 600; color: #1F2937; }
.patient-count { font-size: 12px; color: #9CA3AF; }
.patient-count span { color: #1677FF; font-weight: 600; }

.search-box {
  margin: 12px 16px 8px; position: relative;
}
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.search-box input {
  width: 100%; height: 36px; padding: 0 12px 0 36px; border: 1px solid #E5E7EB;
  border-radius: 8px; font-size: 13px; color: #1F2937; outline: none; transition: all .2s; background: #FAFBFC;
}
.search-box input:focus { border-color: #1677FF; background: #fff; box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.06); }
.search-box input::placeholder { color: #C0C6CC; }

.filter-tabs { display: flex; gap: 4px; padding: 4px 16px 8px; }
.filter-tab {
  flex: 1; padding: 5px 0; border: none; background: none; font-size: 12px; color: #6B7280;
  cursor: pointer; border-radius: 6px; transition: all .2s; font-weight: 500;
}
.filter-tab:hover { background: #F3F4F6; }
.filter-tab.active { background: #E6F4FF; color: #1677FF; }

.patient-list { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }

/* 患者行 */
.patient-row {
  display: flex; align-items: center; padding: 12px 14px; border-radius: 8px; cursor: pointer;
  transition: all .15s; margin-bottom: 2px; border: 1px solid transparent;
}
.patient-row:hover { background: #F5F7FA; }
.patient-row.active { background: #E6F4FF; border-color: #91CAFF; }
.patient-row-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 15px; font-weight: 600; flex-shrink: 0; margin-right: 12px;
}
.avatar-blue { background: #E6F4FF; color: #1677FF; }
.avatar-green { background: #F0FDF4; color: #52C41A; }
.avatar-orange { background: #FFF7E6; color: #FA8C16; }
.avatar-purple { background: #F9F0FF; color: #722ED1; }

.patient-row-info { flex: 1; min-width: 0; }
.patient-row-name { font-size: 14px; font-weight: 600; color: #1F2937; display: flex; align-items: center; gap: 6px; }
.patient-row-meta { font-size: 12px; color: #9CA3AF; margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.patient-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.queue-num { font-size: 11px; color: #C0C6CC; }

.status-tag {
  font-size: 11px; padding: 1px 8px; border-radius: 4px; font-weight: 500; white-space: nowrap;
}
.status-waiting { background: #FFF7E6; color: #FA8C16; }
.status-consulting { background: #E6F4FF; color: #1677FF; }
.status-completed { background: #F0FDF4; color: #52C41A; }

.ai-status-dot { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; color: #9CA3AF; }
.ai-status-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.ai-status-generated::before { background: #1677FF; }
.ai-status-adopted::before { background: #52C41A; }
.ai-status-rejected::before { background: #FF4D4F; }
.ai-status-none::before { background: #D1D5DB; }

.dot-sep { color: #E5E7EB; }

/* 空列表状态 */
.empty-list-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; }
.empty-list-state p { font-size: 13px; color: #9CA3AF; margin-top: 12px; }

/* ==================== 右侧主内容区 ==================== */
.main-content { flex: 1; position: relative; overflow: hidden; background: #F5F7FA; }

/* 空状态 */
.empty-state {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
}
.empty-illustration { margin-bottom: 8px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: #4B5563; }
.empty-state p { font-size: 13px; color: #9CA3AF; }

/* ==================== 患者详情抽屉 ==================== */
.detail-drawer { position: absolute; inset: 0; pointer-events: none; }
.drawer-overlay {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0); transition: background .3s;
  pointer-events: none;
}
.detail-drawer.open .drawer-overlay { background: rgba(0, 0, 0, 0.25); pointer-events: auto; }

.drawer-panel {
  position: absolute; top: 0; right: 0; width: 56%; max-width: 720px; height: 100%;
  background: #fff; box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .35s cubic-bezier(0.22, 0.61, 0.36, 1);
  pointer-events: auto;
}
.detail-drawer.open .drawer-panel { transform: translateX(0); }

/* 抽屉头部 */
.drawer-header {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 24px;
  border-bottom: 1px solid #F3F4F6; flex-shrink: 0;
}
.drawer-patient-info { display: flex; align-items: center; gap: 12px; }
.drawer-patient-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: #E6F4FF; color: #1677FF;
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 600;
}
.drawer-patient-info h3 { font-size: 17px; font-weight: 600; color: #1F2937; }
.drawer-patient-meta { font-size: 12px; color: #9CA3AF; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.drawer-close {
  width: 32px; height: 32px; border: none; background: #F3F4F6; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.drawer-close:hover { background: #E5E7EB; }

/* Tab导航 */
.drawer-tabs { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid #F3F4F6; flex-shrink: 0; }
.drawer-tab {
  display: flex; align-items: center; gap: 6px; padding: 12px 16px; border: none; background: none;
  font-size: 14px; color: #6B7280; cursor: pointer; position: relative; transition: color .2s; font-weight: 500;
}
.drawer-tab:hover { color: #1677FF; }
.drawer-tab.active { color: #1677FF; }
.drawer-tab.active::after {
  content: ''; position: absolute; bottom: -1px; left: 12px; right: 12px; height: 2px;
  background: #1677FF; border-radius: 1px;
}
.tab-badge {
  font-size: 10px; background: #FF4D4F; color: #fff; padding: 1px 5px; border-radius: 8px;
  font-weight: 500; line-height: 1.4;
}

/* Tab内容 */
.drawer-body { flex: 1; overflow-y: auto; }
.tab-content { display: none; padding: 20px 24px; }
.tab-content.active { display: block; }

/* ==================== 电子病历样式 ==================== */
.emr-section { margin-bottom: 20px; }
.section-title {
  font-size: 14px; font-weight: 600; color: #1F2937; display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.title-bar { width: 3px; height: 14px; background: #1677FF; border-radius: 2px; }

.emr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.emr-field { display: flex; flex-direction: column; gap: 2px; }
.field-label { font-size: 12px; color: #9CA3AF; }
.field-value { font-size: 14px; color: #1F2937; font-weight: 500; }
.field-value.allergy { color: #FF4D4F; font-weight: 600; }

.emr-text {
  font-size: 14px; line-height: 1.7; color: #4B5563; background: #FAFBFC; padding: 12px 16px;
  border-radius: 8px; border: 1px solid #F3F4F6;
}

.vitals-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.vital-item {
  background: #FAFBFC; border: 1px solid #F3F4F6; border-radius: 8px; padding: 12px;
  text-align: center; display: flex; flex-direction: column; gap: 4px;
}
.vital-label { font-size: 12px; color: #9CA3AF; }
.vital-value { font-size: 18px; font-weight: 600; color: #1F2937; }
.vital-unit { font-size: 12px; font-weight: 400; color: #9CA3AF; margin-left: 2px; }

/* 检验表格 */
.lab-table { border: 1px solid #F3F4F6; border-radius: 8px; overflow: hidden; }
.lab-row {
  display: grid; grid-template-columns: 2fr 1.2fr 1.5fr 0.8fr; padding: 10px 16px;
  font-size: 13px; border-bottom: 1px solid #F3F4F6; align-items: center;
}
.lab-row:last-child { border-bottom: none; }
.lab-row.header { background: #FAFBFC; font-weight: 600; color: #6B7280; font-size: 12px; }
.lab-name { color: #1F2937; }
.lab-result { font-weight: 600; }
.lab-result.normal { color: #52C41A; }
.lab-result.high { color: #FF4D4F; }
.lab-result.low { color: #FA8C16; }
.lab-range { color: #9CA3AF; font-size: 12px; }
.lab-flag { font-size: 11px; padding: 1px 6px; border-radius: 4px; text-align: center; }
.lab-flag.normal { background: #F0FDF4; color: #52C41A; }
.lab-flag.high { background: #FFF1F0; color: #FF4D4F; }
.lab-flag.low { background: #FFF7E6; color: #FA8C16; }

/* ==================== AI辅诊骨架屏 ==================== */
.ai-skeleton { padding: 4px 0; }
.skeleton-card { background: #fff; border: 1px solid #F3F4F6; border-radius: 8px; padding: 20px; }
.skeleton-line { background: linear-gradient(90deg, #F3F4F6 25%, #E8EAED 50%, #F3F4F6 75%); background-size: 200% 100%; border-radius: 4px; animation: shimmer 1.5s infinite; margin-bottom: 10px; }
.skeleton-line.h-6 { height: 24px; }
.skeleton-line.h-5 { height: 20px; }
.skeleton-line.h-4 { height: 16px; }
.skeleton-line.w-40 { width: 160px; }
.skeleton-line.w-16 { width: 64px; }
.skeleton-line.w-32 { width: 128px; }
.skeleton-line.w-60 { width: 240px; }
.skeleton-line.w-70 { width: 280px; }
.skeleton-line.w-80 { width: 320px; }
.skeleton-line.w-full { width: 100%; }
.skeleton-bar { height: 8px; background: linear-gradient(90deg, #F3F4F6 25%, #E8EAED 50%, #F3F4F6 75%); background-size: 200% 100%; border-radius: 4px; animation: shimmer 1.5s infinite; margin: 12px 0; }
.skeleton-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.skeleton-divider { height: 1px; background: #F3F4F6; margin: 16px 0; }
.skeleton-btn-row { display: flex; gap: 12px; margin-top: 20px; }
.skeleton-btn { width: 120px; height: 36px; background: linear-gradient(90deg, #F3F4F6 25%, #E8EAED 50%, #F3F4F6 75%); background-size: 200% 100%; border-radius: 8px; animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.skeleton-loading-text {
  text-align: center; margin-top: 24px; font-size: 13px; color: #9CA3AF; display: flex;
  align-items: center; justify-content: center; gap: 8px;
}
.loading-dots { display: inline-flex; gap: 4px; }
.loading-dots span {
  width: 6px; height: 6px; background: #1677FF; border-radius: 50%;
  animation: dotBounce 1.2s infinite ease-in-out;
}
.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotBounce { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }

/* ==================== AI诊断卡片 ==================== */
.low-confidence-tip, .mid-confidence-tip {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 8px;
  font-size: 13px; margin-bottom: 12px; animation: fadeIn .3s;
}
.low-confidence-tip { background: #FFF7E6; color: #FA8C16; border: 1px solid #FFD591; }
.mid-confidence-tip { background: #FFFBE6; color: #D48806; border: 1px solid #FFE58F; }

.ai-diagnosis-card { margin-bottom: 16px; }
.ai-diagnosis-item {
  background: #fff; border: 1px solid #E5E7EB; border-radius: 8px; padding: 18px 20px;
  margin-bottom: 12px; transition: box-shadow .2s; animation: fadeInUp .4s;
}
.ai-diagnosis-item:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); }

.diagnosis-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.diagnosis-title { display: flex; flex-direction: column; gap: 4px; }
.diagnosis-name { font-size: 16px; font-weight: 600; color: #1F2937; }
.diagnosis-icd { font-size: 12px; color: #9CA3AF; }

.confidence-wrapper { display: flex; align-items: center; gap: 8px; }
.confidence-label { font-size: 12px; color: #9CA3AF; white-space: nowrap; }
.confidence-bar-bg {
  width: 100px; height: 8px; background: #F3F4F6; border-radius: 4px; overflow: hidden;
}
.confidence-bar-fill {
  height: 100%; border-radius: 4px; width: 0; transition: width 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.confidence-bar-fill.high { background: linear-gradient(90deg, #52C41A, #73D13D); }
.confidence-bar-fill.mid { background: linear-gradient(90deg, #FAAD14, #FFC53D); }
.confidence-bar-fill.low { background: linear-gradient(90deg, #FF4D4F, #FF7875); }
.confidence-value { font-size: 14px; font-weight: 600; }
.confidence-value.high { color: #52C41A; }
.confidence-value.mid { color: #FAAD14; }
.confidence-value.low { color: #FF4D4F; }
.confidence-range { font-size: 13px; font-weight: 600; color: #FA8C16; }

.diagnosis-basis {
  background: #F0F7FF; border: 1px solid #D6E8FF; border-radius: 8px; padding: 12px 14px;
  font-size: 13px; line-height: 1.7; color: #4B5563; margin-bottom: 14px;
}
.diagnosis-basis-title { font-size: 12px; font-weight: 600; color: #1677FF; margin-bottom: 6px; display: flex; align-items: center; gap: 4px; }
.basis-item { display: flex; gap: 6px; margin-bottom: 4px; }
.basis-item::before { content: '•'; color: #1677FF; font-weight: bold; }

.ai-subsection { margin-top: 14px; }
.ai-subsection-title { font-size: 13px; font-weight: 600; color: #1F2937; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.recommend-tag {
  display: inline-block; font-size: 12px; padding: 3px 10px; background: #F0F7FF; color: #1677FF;
  border-radius: 4px; margin-right: 6px; margin-bottom: 4px; border: 1px solid #D6E8FF;
}
.diff-tag {
  display: inline-block; font-size: 12px; padding: 3px 10px; background: #FFF7E6; color: #FA8C16;
  border-radius: 4px; margin-right: 6px; margin-bottom: 4px; border: 1px solid #FFD591;
}

/* Top3 列表模式 */
.top3-item {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
  background: #fff; border: 1px solid #E5E7EB; border-radius: 8px; margin-bottom: 8px;
  transition: all .2s; animation: fadeInUp .4s;
}
.top3-item:hover { border-color: #FA8C16; box-shadow: 0 2px 8px rgba(250, 140, 22, 0.08); }
.top3-rank { display: flex; align-items: center; gap: 12px; flex: 1; }
.rank-num {
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.rank-1 { background: #FFF1F0; color: #FF4D4F; }
.rank-2 { background: #FFF7E6; color: #FA8C16; }
.rank-3 { background: #FFFBE6; color: #D48806; }
.top3-name { font-size: 14px; font-weight: 500; color: #1F2937; }
.top3-icd { font-size: 11px; color: #9CA3AF; margin-left: 8px; }

/* ==================== 用药建议卡片 ==================== */
.medication-card { margin-bottom: 16px; }
.med-card-title {
  font-size: 14px; font-weight: 600; color: #1F2937; margin-bottom: 10px; display: flex;
  align-items: center; gap: 8px;
}
.med-card-title::before { content: ''; width: 3px; height: 14px; background: #722ED1; border-radius: 2px; }

.med-item {
  background: #fff; border: 1px solid #E5E7EB; border-radius: 8px; padding: 16px 18px;
  margin-bottom: 10px; transition: box-shadow .2s; animation: fadeInUp .4s;
}
.med-item:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); }
.med-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.med-name { font-size: 15px; font-weight: 600; color: #1F2937; }
.med-spec { font-size: 12px; color: #9CA3AF; margin-top: 2px; }
.med-purpose { font-size: 12px; padding: 2px 8px; background: #F9F0FF; color: #722ED1; border-radius: 4px; }

.med-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; margin-bottom: 10px; }
.med-detail-item { display: flex; gap: 6px; font-size: 13px; }
.med-detail-label { color: #9CA3AF; white-space: nowrap; }
.med-detail-value { color: #1F2937; font-weight: 500; }

.med-warning {
  display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: #FF4D4F;
  background: #FFF1F0; padding: 8px 12px; border-radius: 6px; margin-top: 8px;
}
.med-interaction {
  display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: #FA8C16;
  background: #FFF7E6; padding: 8px 12px; border-radius: 6px; margin-top: 6px;
}

/* ==================== 操作按钮 ==================== */
.ai-actions { display: flex; gap: 12px; margin-top: 4px; }
.btn-adopt {
  flex: 1; height: 40px; background: #52C41A; color: #fff; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-adopt:hover { background: #73D13D; }
.btn-adopt:disabled { background: #D9F7BE; color: #52C41A; cursor: default; }

.btn-reject {
  flex: 1; height: 40px; background: #fff; color: #FF4D4F; border: 1px solid #FFCCC7;
  border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-reject:hover { background: #FFF1F0; border-color: #FF4D4F; }
.btn-reject:disabled { opacity: 0.5; cursor: default; }

/* 已采纳/驳回状态 */
.adopted-banner, .rejected-banner {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 500; margin-top: 12px; animation: fadeIn .3s;
}
.adopted-banner { background: #F6FFED; color: #389E0D; border: 1px solid #B7EB8F; }
.rejected-banner { background: #FFF1F0; color: #CF1322; border: 1px solid #FFA39E; flex-wrap: wrap; }
.undo-link { margin-left: auto; color: #1677FF; background: none; border: none; cursor: pointer; font-size: 13px; text-decoration: underline; }
.reject-reason-label { color: #9CA3AF; font-weight: 400; font-size: 12px; width: 100%; margin-top: 4px; }

/* AI不可用/空数据 */
.ai-unavailable, .ai-empty-data {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center;
}
.ai-unavailable-icon, .ai-empty-icon { margin-bottom: 16px; }
.ai-unavailable h4, .ai-empty-data h4 { font-size: 15px; font-weight: 600; color: #4B5563; margin-bottom: 6px; }
.ai-unavailable p, .ai-empty-data p { font-size: 13px; color: #9CA3AF; margin-bottom: 16px; max-width: 300px; line-height: 1.6; }

/* ==================== Toast ==================== */
.toast-container { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 500; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: toastIn .3s cubic-bezier(0.22, 0.61, 0.36, 1); max-width: 400px; pointer-events: auto;
}
.toast.removing { animation: toastOut .3s ease-in forwards; }
.toast-success { background: #F6FFED; border: 1px solid #B7EB8F; color: #389E0D; }
.toast-error { background: #FFF1F0; border: 1px solid #FFA39E; color: #CF1322; }
.toast-info { background: #E6F4FF; border: 1px solid #91CAFF; color: #0958D9; }
.toast-warning { background: #FFFBE6; border: 1px solid #FFE58F; color: #D48806; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px); } }

/* ==================== 驳回弹窗 ==================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 9000;
  display: flex; align-items: center; justify-content: center; animation: fadeIn .2s;
}
.modal-card {
  width: 480px; background: #fff; border-radius: 12px; overflow: hidden;
  animation: modalIn .3s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid #F3F4F6; }
.modal-header h3 { font-size: 16px; font-weight: 600; color: #1F2937; }
.modal-close { width: 30px; height: 30px; border: none; background: #F3F4F6; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.modal-close:hover { background: #E5E7EB; }
.modal-body { padding: 20px 24px; }
.modal-label { font-size: 13px; font-weight: 500; color: #4B5563; display: block; margin-bottom: 10px; }
.required { color: #FF4D4F; }

.reject-reasons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.reason-chip { cursor: pointer; }
.reason-chip input { display: none; }
.reason-chip span {
  display: inline-block; padding: 6px 14px; border: 1px solid #E5E7EB; border-radius: 6px;
  font-size: 12px; color: #6B7280; transition: all .2s; background: #FAFBFC;
}
.reason-chip input:checked + span { border-color: #1677FF; color: #1677FF; background: #E6F4FF; font-weight: 500; }

.modal-textarea {
  width: 100%; height: 80px; padding: 10px 14px; border: 1px solid #E5E7EB; border-radius: 8px;
  font-size: 13px; color: #1F2937; resize: none; outline: none; font-family: inherit; transition: all .2s; background: #FAFBFC;
}
.modal-textarea:focus { border-color: #1677FF; background: #fff; box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.06); }
.char-count { text-align: right; font-size: 12px; color: #C0C6CC; margin-top: 4px; }

.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid #F3F4F6; }

/* ==================== 自定义滚动条 ==================== */
::-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; }

/* ==================== 响应式 1280px ==================== */
@media (max-width: 1280px) {
  .patient-sidebar { width: 300px; }
  .drawer-panel { width: 64%; max-width: 680px; }
  .vitals-grid { grid-template-columns: repeat(2, 1fr); }
  .emr-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .patient-sidebar { width: 280px; }
  .drawer-panel { width: 70%; }
  .med-details { grid-template-columns: 1fr; }
}
