/* ===== components.css - 原生组件样式（替代Element Plus） ===== */

/* === 表格 === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}
.data-table thead {
  background: #f5f7fa;
}
.data-table th {
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  color: #606266;
  border-bottom: 1px solid #ebeef5;
  white-space: nowrap;
  font-size: 12px;
}
.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  color: #303133;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-table td.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-table td.wrap-cell {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  max-width: 200px;
  word-break: break-all;
}
.data-table tbody tr:hover {
  background: #f5f7fa;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* === 表单 === */
.form-row {
  margin-bottom: 16px;
}
.form-row .form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #606266;
  font-weight: 500;
}
.form-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  font-size: 13px;
  color: #303133;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
}
.form-input:focus {
  border-color: #409eff;
  box-shadow: 0 0 0 2px rgba(64,158,255,0.15);
}
.form-input:disabled {
  background: #f5f7fa;
  color: #c0c4cc;
  cursor: not-allowed;
}
.form-select {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  font-size: 13px;
  color: #303133;
  outline: none;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s;
}
.form-select:focus {
  border-color: #409eff;
  box-shadow: 0 0 0 2px rgba(64,158,255,0.15);
}
.form-select:disabled {
  background: #f5f7fa;
  color: #c0c4cc;
  cursor: not-allowed;
}
.form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  font-size: 13px;
  color: #303133;
  outline: none;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s;
}
.form-textarea:focus {
  border-color: #409eff;
  box-shadow: 0 0 0 2px rgba(64,158,255,0.15);
}
.form-row-half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

/* === 按钮 === */
.btn-primary {
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 6px;
  background: #409eff;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-primary:hover {
  background: #66b1ff;
  box-shadow: 0 2px 8px rgba(64,158,255,0.3);
}
.btn-default {
  height: 36px;
  padding: 0 16px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  background: #fff;
  color: #606266;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-default:hover {
  color: #409eff;
  border-color: #c6e2ff;
  background: #ecf5ff;
}
.btn-danger {
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 6px;
  background: #f56c6c;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-danger:hover {
  background: #f78989;
}
.btn-text {
  background: none;
  border: none;
  color: #409eff;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.btn-text:hover {
  background: #ecf5ff;
}
.btn-text-sm {
  background: none;
  border: none;
  color: #409eff;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.btn-text-sm:hover {
  background: #ecf5ff;
}
.btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
}
.btn-warning {
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 6px;
  background: #e6a23c;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-warning:hover {
  background: #ebb563;
  box-shadow: 0 2px 8px rgba(230,162,60,0.3);
}

/* === 链接 === */
.link {
  color: #409eff;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
}
.link:hover {
  text-decoration: underline;
}
.link-danger {
  color: #f56c6c;
}
.link-danger:hover {
  text-decoration: underline;
}

/* === 标签 === */
.tag-success {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: #f0f9eb;
  color: #67c23a;
}
.tag-warning {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: #fdf6ec;
  color: #e6a23c;
}
.tag-danger {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: #fef0f0;
  color: #f56c6c;
}
.tag-primary {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: #ecf5ff;
  color: #409eff;
}
.tag-info {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: #f4f4f5;
  color: #909399;
}
.tag-role-admin { display:inline-block; padding:2px 8px; border-radius:4px; font-size:12px; background:#f4f4f5; color:#909399; }
.tag-role-institution { display:inline-block; padding:2px 8px; border-radius:4px; font-size:12px; background:#fdf6ec; color:#e6a23c; }
.tag-role-manager { display:inline-block; padding:2px 8px; border-radius:4px; font-size:12px; background:#f0f9eb; color:#67c23a; }
.tag-role-user { display:inline-block; padding:2px 8px; border-radius:4px; font-size:12px; background:#ecf5ff; color:#409eff; }

.badge-warning {
  display: inline-block;
  background: #f56c6c;
  color: #fff;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 500;
  vertical-align: middle;
  margin-left: 4px;
}

/* === BMI === */
.bmi-low { color: #67c23a; font-weight: 600; }
.bmi-mid { color: #e6a23c; font-weight: 600; }
.bmi-high { color: #f56c6c; font-weight: 600; }

/* === 弹窗 === */
.modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.2);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-head h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  font-size: 20px;
  color: #909399;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  background: #f5f7fa;
  color: #303133;
}
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 12px 24px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* === 档案详情 === */
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  background: #f9f9f9;
  border-radius: 8px;
}
.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg,#409eff,#67c23a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}
.profile-meta { flex: 1; }
.profile-name { font-size: 16px; font-weight: 600; }
.profile-sub { font-size: 13px; color: #909399; margin-top: 2px; }
.profile-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.metric-box {
  text-align: center;
  padding: 12px;
  background: #ecf5ff;
  border-radius: 8px;
}
.metric-box.metric-mid { background: #fdf6ec; }
.metric-box.metric-high { background: #fef0f0; }
.metric-val { font-size: 22px; font-weight: 700; }
.metric-label { font-size: 12px; color: #909399; margin-top: 2px; }
.profile-section {
  margin-bottom: 16px;
}
.profile-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f0f0;
}
.profile-section p {
  font-size: 13px;
  color: #606266;
  line-height: 1.6;
}
.profile-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 13px;
  color: #606266;
}

/* === 健管师卡片 === */
.mc-org {
  font-size: 12px;
  color: #409eff;
  margin-top: 2px;
}
.mc-sub-list {
  margin-top: 12px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 8px;
}
.mc-sub-title {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 500;
}
.mc-sub-item {
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid #eee;
}
.mc-sub-item:last-child {
  border-bottom: none;
}

/* === 组织架构 === */
.org-child { padding-left: 24px; }
.org-child2 { padding-left: 48px; }

/* === 空状态 === */
.empty-tip {
  text-align: center;
  padding: 40px 20px;
  color: #c0c4cc;
  font-size: 13px;
}

/* === 标题 === */
.section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-bar {
  width: 3px;
  height: 14px;
  background: #e6a23c;
  border-radius: 2px;
  display: inline-block;
}

/* === 可搜索选择器 === */
.search-select { position: relative; }
.search-select-wrap { position: relative; }
.search-select-selected {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; padding: 0 12px; font-size: 13px;
  color: #333; background: #fff; pointer-events: none; z-index: 2;
}
.search-select-empty { padding: 12px; text-align: center; color: #999; font-size: 13px; }
.search-select-trigger {
  position: relative; width: 100%; height: 36px; padding: 0 30px 0 12px; border: 1px solid #dcdfe6; border-radius: 6px;
  font-size: 13px; color: #333; background: #fff; cursor: pointer; text-align: left;
  display: flex; align-items: center; transition: border-color .2s;
}
.search-select-trigger:hover { border-color: #c0c4cc; }
.search-select-trigger.active { border-color: #409eff; }
.search-select-trigger .placeholder { color: #c0c4cc; }
.search-select-trigger .arrow { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #c0c4cc; font-size: 12px; pointer-events: none; }
.search-select-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 2100;
  background: #fff; border: 1px solid #e4e7ed; border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12); max-height: 240px; display: flex; flex-direction: column; overflow: hidden;
}
.search-select-input {
  padding: 8px 12px; border: none; border-bottom: 1px solid #f0f0f0; font-size: 13px; outline: none; width: 100%; box-sizing: border-box;
}
.search-select-input::placeholder { color: #c0c4cc; }
.search-select-list { overflow-y: auto; flex: 1; }
.search-select-item {
  padding: 8px 12px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.search-select-item:hover { background: #f5f7fa; }
.search-select-item.selected { background: #ecf5ff; color: #409eff; }
.search-select-item .sub { color: #909399; font-size: 12px; }
.search-select-empty { padding: 16px; text-align: center; color: #c0c4cc; font-size: 13px; }

/* 评估创建-健康记录选择 */
.assess-record-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 6px; cursor: pointer; border: 1px solid transparent; margin-bottom: 2px;
  transition: background .15s, border-color .15s;
}
.assess-record-row:hover { background: #f5f7fa; }
.assess-record-row.checked { background: #ecf5ff; border-color: #c6e2ff; }
.assess-record-row:has(input:checked) { background: #ecf5ff; border-color: #c6e2ff; }
.assess-record-row input[type=checkbox] { flex-shrink: 0; width: 14px; height: 14px; accent-color: #409eff; }
.assess-record-info { flex: 1; min-width: 0; }
.assess-record-info > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === risk-assessment 组件样式 === */
.ra-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  color: #303133;
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}
.ra-input:focus {
  border-color: #409eff;
  box-shadow: 0 0 0 2px rgba(64,158,255,.2);
}
.ra-input::placeholder {
  color: #c0c4cc;
}

/* === AI 解读内容排版 === */
.ai-interpret-content h1,
.ai-interpret-content h2,
.ai-interpret-content h3 {
  margin: 10px 0 6px;
  color: #303133;
  font-size: 15px;
}
.ai-interpret-content h4,
.ai-interpret-content h5 {
  margin: 8px 0 4px;
  color: #409eff;
  font-size: 14px;
}
.ai-interpret-content ul,
.ai-interpret-content ol {
  margin: 4px 0 8px 20px;
  padding: 0;
}
.ai-interpret-content li {
  margin: 3px 0;
}
.ai-interpret-content p {
  margin: 6px 0;
}
.ai-interpret-content strong {
  color: #F56C6C;
}
.ai-interpret-content hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 10px 0;
}

/* ===== HealthTag 标签组件样式 ===== */
.tag-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  color: #fff;
  font-size: 12px;
  margin: 2px 4px 2px 0;
  white-space: nowrap;
}
.color-dot {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  transition: border 0.2s;
}
.color-dot:hover {
  transform: scale(1.15);
}
.no-tags-hint {
  color: #999;
  font-size: 13px;
  font-style: italic;
}
.tag-remove-icon {
  cursor: pointer;
  margin-left: 4px;
  font-size: 12px;
  opacity: 0.7;
}
.tag-remove-icon:hover {
  opacity: 1;
}
.profile-tags-display {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.profile-assign-panel {
  padding: 8px;
  border: 1px dashed #dcdfe6;
  border-radius: 4px;
  background: #fafafa;
}

/* ===== HealthTag 原生组件样式（替代 Element Plus） ===== */
.ht-btn {
  display: inline-block;
  padding: 6px 16px;
  font-size: 13px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  background: #fff;
  color: #606266;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.4;
}
.ht-btn:hover { color: #409eff; border-color: #c6e2ff; background: #ecf5ff; }
.ht-btn-primary { background: #409eff; color: #fff; border-color: #409eff; }
.ht-btn-primary:hover { background: #66b1ff; border-color: #66b1ff; color: #fff; }
.ht-btn-text { border: none; background: transparent; padding: 4px 8px; color: #409eff; }
.ht-btn-text:hover { background: transparent; color: #66b1ff; }
.ht-btn-danger { color: #f56c6c; }
.ht-btn-danger:hover { color: #f78989; }
.ht-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ht-table th { font-weight: 600; color: #909399; }
.ht-table tr:hover td { background: #f5f7fa; }

.ht-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 4px;
  line-height: 1.5;
}
.ht-tag-success { background: #f0f9eb; color: #67c23a; border: 1px solid #e1f3d8; }
.ht-tag-info { background: #f4f4f5; color: #909399; border: 1px solid #e9e9eb; }
.ht-tag-warning { background: #fdf6ec; color: #e6a23c; border: 1px solid #faecd8; }

.ht-dialog-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 80px;
}
.ht-dialog {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  overflow: hidden;
}
.ht-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #ebeef5;
  font-size: 16px;
  font-weight: 600;
}
.ht-dialog-close {
  border: none;
  background: transparent;
  font-size: 22px;
  color: #909399;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.ht-dialog-close:hover { color: #409eff; }
.ht-dialog-body { padding: 20px; }
.ht-dialog-footer {
  padding: 12px 20px;
  border-top: 1px solid #ebeef5;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.ht-form-item {
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
}
.ht-form-label {
  width: 80px;
  text-align: right;
  padding-right: 12px;
  font-size: 13px;
  color: #606266;
  line-height: 32px;
  flex-shrink: 0;
}
.ht-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 13px;
  color: #606266;
  outline: none;
  box-sizing: border-box;
}
.ht-input:focus { border-color: #409eff; }
.cv-review { max-width: 1000px; margin: 0 auto; padding: 18px; color: #213b49; }
.cv-review h3 { margin: 0 0 6px; font-size: 23px; }
.cv-review header { border-bottom: 2px solid #277588; padding: 0 0 12px; margin-bottom: 16px; }
.cv-review p { margin: 7px 0 12px; line-height: 1.65; color: #495e69; }
.cv-review fieldset { margin: 0 0 16px; padding: 14px 18px 16px; border: 1px solid #cad9de; border-radius: 8px; background: #fff; min-width: 0; }
.cv-review legend { padding: 0 7px; font-weight: 650; color: #235d69; }
.cv-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(215px,100%),1fr)); gap: 12px 18px; }
.cv-wide { grid-column: 1/-1; }
.cv-review label { display: grid; gap: 5px; color: #284450; font-size: 14px; }
.cv-review input:not([type=checkbox]), .cv-review select, .cv-review textarea { width:100%; min-height:36px; padding: 6px 9px; border:1px solid #aebfc6; border-radius:5px; box-sizing:border-box; font:inherit; color:inherit; background:white; }
.cv-review input[readonly] { background:#f3f6f7; }
.cv-review .cv-check { display:flex; align-items:center; margin:14px 0; }
.cv-actions { display:flex; flex-wrap:wrap; gap:10px; }
.cv-review button:disabled { opacity:.5; cursor:not-allowed; }
.cv-review .cv-result, .cv-review .cv-notice { padding:14px 18px; background:#ecf5f5; border-left:3px solid #287784; }
.cv-review .cv-error { padding:10px 14px; color:#882c1c; background:#fff3ee; }
.cv-review li { margin:8px 0; }
