/* MedHub 设计系统 — 清新医疗蓝 */

:root {
  /* 主色：克制的医疗蓝 */
  --blue-50:  #eff6fb;
  --blue-100: #dceaf5;
  --blue-200: #b9d5ec;
  --blue-300: #87b6dc;
  --blue-400: #5494c8;
  --blue-500: #2f76b3;
  --blue-600: #1f5d96;
  --blue-700: #194a78;
  --blue-800: #163a5f;
  --blue-900: #112a44;

  /* 辅色：青绿（用于成功/合规/AI状态） */
  --teal-50:  #ecf7f5;
  --teal-100: #d2ede9;
  --teal-300: #79c8bd;
  --teal-500: #2ea597;
  --teal-700: #1e7a70;

  /* 警示橙（边缘案例/挑战） */
  --amber-50:  #fdf6ec;
  --amber-100: #fae6c4;
  --amber-300: #efbb6e;
  --amber-500: #d68a2b;
  --amber-700: #9a601a;

  /* 警告红（幻觉拦截） */
  --red-50:  #fcefee;
  --red-100: #f7d7d3;
  --red-500: #d2493e;
  --red-700: #9b3128;

  /* 中性灰 */
  --ink-900: #0f1722;
  --ink-800: #1c2735;
  --ink-700: #2c3a4d;
  --ink-600: #475567;
  --ink-500: #6a7889;
  --ink-400: #94a0ad;
  --ink-300: #c1cad3;
  --ink-200: #e1e7ec;
  --ink-150: #ecf0f3;
  --ink-100: #f3f6f8;
  --ink-50:  #f9fafc;
  --white:   #ffffff;

  /* 语义化 */
  --bg-app:        var(--ink-50);
  --bg-surface:    var(--white);
  --bg-elevated:   var(--white);
  --bg-subtle:     var(--ink-100);
  --border:        var(--ink-200);
  --border-strong: var(--ink-300);
  --text-primary:  var(--ink-900);
  --text-secondary:var(--ink-600);
  --text-tertiary: var(--ink-500);
  --text-disabled: var(--ink-400);
  --accent:        var(--blue-500);
  --accent-hover:  var(--blue-600);

  /* 间距 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(17, 42, 68, 0.06), 0 1px 1px rgba(17, 42, 68, 0.04);
  --shadow-md: 0 4px 12px rgba(17, 42, 68, 0.08), 0 2px 4px rgba(17, 42, 68, 0.04);
  --shadow-lg: 0 12px 28px rgba(17, 42, 68, 0.12), 0 4px 8px rgba(17, 42, 68, 0.06);
  --shadow-xl: 0 24px 48px rgba(17, 42, 68, 0.16);
  --shadow-blue: 0 8px 24px rgba(47, 118, 179, 0.18);

  /* 字体 */
  --font-sans: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', Consolas, monospace;
  --font-display: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;

  /* 字号 */
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   15px;
  --text-lg:   17px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  30px;
  --text-4xl:  36px;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-app);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* === 通用组件 === */

.mh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  padding: 8px 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  line-height: 1.2;
}
.mh-btn-primary {
  background: var(--blue-500);
  color: var(--white);
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, var(--shadow-sm);
}
.mh-btn-primary:hover { background: var(--blue-600); }
.mh-btn-primary:active { background: var(--blue-700); }

.mh-btn-secondary {
  background: var(--white);
  color: var(--blue-600);
  border-color: var(--blue-200);
}
.mh-btn-secondary:hover { background: var(--blue-50); border-color: var(--blue-300); }

.mh-btn-ghost {
  background: transparent;
  color: var(--ink-700);
}
.mh-btn-ghost:hover { background: var(--ink-100); }

.mh-btn-sm { padding: 5px 10px; font-size: var(--text-xs); border-radius: var(--radius-sm); }
.mh-btn-lg { padding: 11px 18px; font-size: var(--text-base); border-radius: var(--radius-md); }

/* 卡片 */
.mh-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.mh-card-flat { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }

/* 标签芯片 */
.mh-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--ink-100);
  color: var(--ink-700);
  white-space: nowrap;
  line-height: 1.4;
}
.mh-chip-blue { background: var(--blue-50); color: var(--blue-700); }
.mh-chip-teal { background: var(--teal-50); color: var(--teal-700); }
.mh-chip-amber { background: var(--amber-50); color: var(--amber-700); }
.mh-chip-red { background: var(--red-50); color: var(--red-700); }
.mh-chip-outline { background: transparent; border: 1px solid var(--border); color: var(--ink-600); }

/* 输入 */
.mh-input {
  width: 100%;
  font-family: inherit;
  font-size: var(--text-sm);
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text-primary);
  outline: none;
  transition: all 0.12s;
}
.mh-input:focus { border-color: var(--blue-400); box-shadow: 0 0 0 3px rgba(47,118,179,0.12); }

/* 难度星 */
.mh-stars { display: inline-flex; gap: 1px; color: var(--amber-500); font-size: 11px; letter-spacing: 0; }
.mh-stars .dim { color: var(--ink-300); }

/* 滚动条 */
.mh-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.mh-scroll::-webkit-scrollbar-track { background: transparent; }
.mh-scroll::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 3px; }
.mh-scroll::-webkit-scrollbar-thumb:hover { background: var(--ink-400); }

/* 形状 */
.mh-divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* 工具类 */
.mh-flex { display: flex; }
.mh-row { display: flex; align-items: center; }
.mh-col { display: flex; flex-direction: column; }
.mh-gap-1 { gap: 4px; } .mh-gap-2 { gap: 8px; } .mh-gap-3 { gap: 12px; }
.mh-gap-4 { gap: 16px; } .mh-gap-6 { gap: 24px; }
.mh-grow { flex: 1; }
.mh-text-tertiary { color: var(--text-tertiary); }
.mh-text-secondary { color: var(--text-secondary); }
.mh-mono { font-family: var(--font-mono); }

/* 进度条 */
.mh-progress {
  height: 6px;
  background: var(--ink-150);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.mh-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-400), var(--blue-500));
  border-radius: inherit;
  transition: width 0.4s ease;
}

/* 头像占位 */
.mh-avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--blue-200), var(--blue-400));
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex-shrink: 0;
  user-select: none;
}

/* === 设备外壳 === */
.mh-device-mobile {
  width: 375px;
  height: 760px;
  background: var(--bg-app);
  border-radius: 28px;
  border: 8px solid #1c2735;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}
.mh-device-mobile::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 110px; height: 22px;
  background: #1c2735;
  border-radius: 0 0 14px 14px;
  z-index: 100;
}

.mh-statusbar {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
  background: transparent;
  position: relative;
  z-index: 10;
}

/* === 桌面外壳 === */
.mh-device-desktop {
  width: 1280px;
  height: 800px;
  background: var(--bg-app);
  border-radius: 14px;
  border: 1px solid var(--ink-200);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

/* 隐藏数字输入 spin */
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 轻微 hover 浮起 */
.mh-hover-lift { transition: transform 0.15s, box-shadow 0.15s; }
.mh-hover-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
