/* ============================================================
   收治风险自查 · 病历助手 —— 前沿科技设计系统 v4（浅色玻璃拟态 · 彩色搭配）
   风格基准：Linear / Stripe / Arc Browser 浅色模式
   ============================================================ */
:root {
  --primary: #4C7DFF;
  --primary-600: #3B6FE0;
  --primary-050: rgba(76, 125, 255, 0.10);
  --accent: #06B6D4;
  --accent-050: rgba(6, 182, 212, 0.10);
  --violet: #8B5CF6;
  --bg: #F4F6FB;
  --bg-2: #EDF0F8;
  --card: rgba(255, 255, 255, 0.8);
  --card-solid: #FFFFFF;
  --card-hover: rgba(255, 255, 255, 0.98);
  --border: rgba(15, 23, 42, 0.09);
  --border-soft: rgba(15, 23, 42, 0.06);
  --text: #0F172A;
  --text-2: #334155;
  --sub: #64748B;
  --sub-2: #94A3B8;
  --red: #EF4444;
  --red-bg: rgba(239, 68, 68, 0.09);
  --amber: #D97706;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --green: #059669;
  --green-bg: rgba(16, 185, 129, 0.10);
  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
  --shadow-sm: 0 6px 20px rgba(15, 23, 42, 0.06);
  --glow-blue: rgba(76, 125, 255, 0.28);
  --glow-cyan: rgba(6, 182, 212, 0.22);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
/* 背景：浅色 + 网格 + 顶部彩色光晕（科技感） */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(76, 125, 255, 0.14), transparent 60%),
    radial-gradient(800px 500px at 0% 110%, rgba(6, 182, 212, 0.10), transparent 60%),
    radial-gradient(600px 400px at 50% 120%, rgba(139, 92, 246, 0.08), transparent 60%),
    var(--bg);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
}

a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 16px; color: var(--text); }
::placeholder { color: var(--sub-2); }

/* ---------- 玻璃卡片 ---------- */
.glass {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72));
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}
.card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #4C7DFF, #2E5FFF 55%, #7C5CFF);
  box-shadow: 0 8px 24px rgba(63, 111, 255, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform .12s ease, box-shadow .2s ease, filter .2s;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:hover { filter: brightness(1.08); box-shadow: 0 10px 30px rgba(63, 111, 255, 0.40); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; font-size: 17px; border-radius: 16px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.7); color: var(--primary);
  border: 1px solid rgba(76, 125, 255, 0.35);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--primary-050); filter: none; }
.btn-soft { background: var(--primary-050); color: var(--primary); box-shadow: none; }
.btn-soft:hover { box-shadow: none; filter: brightness(1.15); }
.btn-accent { background: linear-gradient(135deg, #06B6D4, #22D3EE 55%, #3B82F6); box-shadow: 0 8px 24px rgba(6, 182, 212, 0.28), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-danger-soft { background: var(--red-bg); color: var(--red); box-shadow: none; }
.btn-danger-soft:hover { box-shadow: none; filter: brightness(1.2); }

/* ---------- 输入框 ---------- */
.field { position: relative; margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 50px; padding: 0 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { padding: 12px 16px; min-height: 90px; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(76, 125, 255, 0.13);
}
.field .hint { font-size: 12px; color: var(--sub-2); margin-top: 6px; }
select option { background: #fff; color: var(--text); }

/* ---------- 风险徽章 ---------- */
.risk-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
}
.risk-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.risk-high { background: var(--red-bg); color: var(--red); }
.risk-mid { background: var(--amber-bg); color: var(--amber); }
.risk-low { background: var(--green-bg); color: var(--green); }
.risk-text-high { color: var(--red); }
.risk-text-mid { color: var(--amber); }
.risk-text-low { color: var(--green); }

/* ---------- Toast ---------- */
#toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: center; width: max-content; max-width: 88vw; }
.toast {
  padding: 12px 20px; border-radius: 14px; font-size: 14px; font-weight: 500;
  background: rgba(15, 23, 42, 0.92); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow); animation: toast-in .25s ease;
  max-width: 88vw; text-align: center;
}
.toast.success { border-color: rgba(52, 211, 153, 0.5); }
.toast.error { border-color: rgba(248, 113, 113, 0.5); }
.toast.warn { border-color: rgba(251, 191, 36, 0.5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: mask-in .2s ease;
}
@keyframes mask-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 480px; max-height: 86vh; overflow-y: auto;
  background: linear-gradient(170deg, #FFFFFF, #F7F9FE);
  backdrop-filter: blur(26px); -webkit-backdrop-filter: blur(26px);
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 28px 28px 24px 24px;
  box-shadow: 0 -14px 50px rgba(15, 23, 42, 0.14);
  padding: 24px 22px 26px;
  animation: sheet-up .28s cubic-bezier(.2,.9,.3,1);
  position: relative;
}
@media (min-width: 640px) {
  .modal-mask { align-items: center; padding: 24px; }
  .modal { border-radius: 28px; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; }
.modal-sub { font-size: 13px; color: var(--sub); margin-bottom: 18px; }
.modal-close { width: 34px; height: 34px; border-radius: 50%; background: rgba(15, 23, 42, 0.05); display: flex; align-items: center; justify-content: center; color: var(--sub); font-size: 18px; }
.modal-close:hover { background: rgba(15, 23, 42, 0.09); }

/* ---------- 加载 ---------- */
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 0; color: var(--sub); font-size: 14px; }
.spinner { width: 22px; height: 22px; border: 2.5px solid rgba(15, 23, 42, 0.12); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--sub-2); }
.empty .empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; opacity: .55; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 18px 0 6px; font-size: 14px; color: var(--sub); }
.pager button { min-width: 40px; min-height: 38px; padding: 0 12px; border-radius: 12px; background: rgba(15, 23, 42, 0.05); border: 1px solid var(--border); color: var(--text-2); font-weight: 500; }
.pager button:disabled { opacity: .4; pointer-events: none; }

/* ---------- 工具 ---------- */
.row { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.center { display: flex; align-items: center; justify-content: center; }
.flex1 { flex: 1; }
.hidden { display: none !important; }
.text-sub { color: var(--sub); }
.text-danger { color: var(--red); }
.text-amber { color: var(--amber); }
.text-green { color: var(--green); }
.text-primary { color: var(--primary); }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; }

/* 图标通用 */
.ic { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* 滚动条（浅色适配） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.16); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   门户工作台 —— 双引擎控制台（浅色版 · 上下垂直双引擎）
   ============================================================ */

/* ---- 门户专属背景层：浅色光晕 + 光尘 ---- */
.portal-bg { position: fixed; inset: 0; z-index: -3; overflow: hidden; pointer-events: none; }
.portal-bg .pb-glow { position: absolute; border-radius: 50%; filter: blur(90px); }
.pb-glow.g1 { width: 600px; height: 600px; left: -180px; top: -140px; background: radial-gradient(circle, rgba(76,125,255,.34), transparent 62%); animation: pb-float 12s ease-in-out infinite; }
.pb-glow.g2 { width: 640px; height: 640px; right: -220px; top: 26%; background: radial-gradient(circle, rgba(34,211,238,.24), transparent 62%); animation: pb-float 14s ease-in-out infinite reverse; }
.pb-glow.g3 { width: 540px; height: 540px; left: 28%; bottom: -220px; background: radial-gradient(circle, rgba(139,92,246,.20), transparent 62%); animation: pb-float 16s ease-in-out infinite; }
@keyframes pb-float { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-36px) scale(1.05); } }
.portal-bg .pb-stars { position: absolute; inset: 0; }
.portal-bg .pb-stars i { position: absolute; width: 2px; height: 2px; background: rgba(30, 41, 59, 0.55); border-radius: 50%; opacity: 0; animation: star-tw var(--d, 3s) ease-in-out infinite; animation-delay: var(--dl, 0s); }
@keyframes star-tw { 0%,100% { opacity: .08; transform: scale(1); } 50% { opacity: .55; transform: scale(1.6); } }

/* ---- 门户整体 ---- */
.portal { max-width: 860px; margin: 0 auto; padding: 0 20px 96px; position: relative; }

/* ---- 门户顶栏（白色玻璃条） ---- */
.pt-bar { display: flex; align-items: center; gap: 12px; padding: 14px 22px; margin: 16px auto 0; max-width: 860px;
  background: linear-gradient(170deg, rgba(255,255,255,.92), rgba(255,255,255,.75));
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(15,23,42,.08); border-radius: 18px; position: relative; overflow: hidden;
  box-shadow: 0 10px 34px rgba(15,23,42,.07); }
.pt-bar::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(76,125,255,.4), transparent); }
.pt-bar .pb-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; letter-spacing: .2px; white-space: nowrap; }
.pt-bar .pb-logo { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, #4C7DFF, #22D3EE); color: #fff; box-shadow: 0 6px 18px rgba(76,125,255,.4), inset 0 1px 0 rgba(255,255,255,.4); }
.pt-bar .pb-logo svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pt-bar .flex1 { flex: 1; }
.pt-bar .pb-user { display: flex; align-items: center; gap: 9px; padding: 5px 12px 5px 6px; border-radius: 999px;
  background: rgba(15,23,42,.04); border: 1px solid rgba(15,23,42,.08); cursor: pointer; transition: .25s; }
.pt-bar .pb-user:hover { background: rgba(15,23,42,.07); border-color: rgba(76,125,255,.35); }
.pt-bar .pb-avatar { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #4C7DFF, #8B5CF6); box-shadow: 0 0 12px rgba(124,92,255,.45); }
.pt-bar .pb-name { font-size: 13px; font-weight: 600; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-bar .pb-pts { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; color: #B45309;
  background: rgba(245,158,11,.13); border: 1px solid rgba(245,158,11,.28); padding: 3px 9px; border-radius: 999px; }
.pt-bar .pb-pts svg { width: 13px; height: 13px; fill: currentColor; }
.pt-bar .pb-logout { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; color: var(--sub);
  background: rgba(15,23,42,.04); border: 1px solid rgba(15,23,42,.08); transition: .25s; }
.pt-bar .pb-logout:hover { color: var(--red); background: var(--red-bg); border-color: rgba(239,68,68,.35); }
.pt-bar .pb-logout svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 560px) { .pt-bar { margin: 10px 12px 0; padding: 11px 14px; } .pt-bar .pb-name { display: none; } }

/* ---- Hero 区 ---- */
.pt-hero { text-align: center; padding: 52px 10px 8px; position: relative; animation: rise-in .7s cubic-bezier(.2,.7,.2,1) both; }
.pt-kicker { display: inline-flex; align-items: center; gap: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; letter-spacing: .34em; color: #4C7DFF; text-transform: uppercase; }
.pt-kicker::before, .pt-kicker::after { content: ""; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, rgba(76,125,255,.6)); }
.pt-kicker::after { background: linear-gradient(90deg, rgba(76,125,255,.6), transparent); }
.pt-title { margin-top: 16px; font-size: clamp(29px, 5.4vw, 42px); font-weight: 800; letter-spacing: -.6px; line-height: 1.22;
  background: linear-gradient(115deg, #0F172A 5%, #3B5BDB 45%, #0891B2 92%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.pt-sub { margin-top: 12px; font-size: 14px; color: var(--sub); letter-spacing: .3px; }
.pt-sub b { color: var(--text-2); font-weight: 600; }

/* ---- 引擎卡（白色玻璃） ---- */
.engine { position: relative; margin-top: 24px; border-radius: 28px; overflow: hidden; padding: 30px 32px 24px;
  background: linear-gradient(168deg, rgba(255,255,255,.95), rgba(255,255,255,.78));
  backdrop-filter: blur(26px); -webkit-backdrop-filter: blur(26px);
  border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 24px 60px rgba(15,23,42,.09), inset 0 1px 0 rgba(255,255,255,.9);
  transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s, border-color .45s;
  animation: rise-in .75s cubic-bezier(.2,.7,.2,1) both; }
.engine.eg-1 { animation-delay: .12s; }
.engine.eg-2 { animation-delay: .24s; }
.engine:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--eg-c) 55%, transparent); box-shadow: 0 40px 90px rgba(15,23,42,.14), 0 0 60px color-mix(in srgb, var(--eg-c) 14%, transparent), inset 0 1px 0 rgba(255,255,255,.95); }
.engine:active { transform: scale(.992); }

/* 引擎卡主题色 */
.engine[data-theme="risk"] { --eg-c: #4C7DFF; --eg-c2: #8B5CF6; --eg-soft: rgba(76,125,255,.10); }
.engine[data-theme="mr"]   { --eg-c: #06B6D4; --eg-c2: #10B981; --eg-soft: rgba(6,182,212,.09); }

/* 顶部高光线 */
.engine::before { content: ""; position: absolute; left: 8%; right: 8%; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--eg-c) 60%, transparent), transparent); }
/* 背景光晕（左上主色 + 右下辅色） */
.engine .eg-glow { position: absolute; pointer-events: none; border-radius: 50%; filter: blur(70px); transition: opacity .5s; opacity: .5; }
.engine .eg-glow.gl { width: 380px; height: 380px; left: -120px; top: -150px; background: radial-gradient(circle, color-mix(in srgb, var(--eg-c) 30%, transparent), transparent 64%); }
.engine .eg-glow.gr { width: 340px; height: 340px; right: -130px; bottom: -150px; background: radial-gradient(circle, color-mix(in srgb, var(--eg-c2) 26%, transparent), transparent 64%); }
.engine:hover .eg-glow { opacity: .95; }
/* 左上大序号 */
.engine .eg-num { position: absolute; right: 26px; top: 14px; font-size: 74px; font-weight: 800; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(15,23,42,.10); user-select: none; pointer-events: none; transition: .4s; }
.engine:hover .eg-num { -webkit-text-stroke-color: color-mix(in srgb, var(--eg-c) 60%, transparent); }
/* 细网格纹理 */
.engine .eg-grid { position: absolute; inset: 0; pointer-events: none; opacity: .6;
  background-image: linear-gradient(rgba(15,23,42,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(15,23,42,.035) 1px, transparent 1px);
  background-size: 30px 30px; mask-image: radial-gradient(ellipse 75% 70% at 70% 10%, #000, transparent 72%); -webkit-mask-image: radial-gradient(ellipse 75% 70% at 70% 10%, #000, transparent 72%); }
/* 鼠标追踪光效层 */
.engine .eg-spot { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%), color-mix(in srgb, var(--eg-c) 9%, transparent), transparent 65%); }
.engine:hover .eg-spot { opacity: 1; }

/* 卡头：核心 + 名称 */
.engine .eg-top { display: flex; align-items: center; gap: 22px; position: relative; z-index: 1; }
.eg-core { position: relative; width: 66px; height: 66px; flex-shrink: 0; display: grid; place-items: center; }
.eg-core .core { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; color: #fff; position: relative; z-index: 2;
  background: linear-gradient(140deg, var(--eg-c), var(--eg-c2));
  box-shadow: 0 12px 32px color-mix(in srgb, var(--eg-c) 45%, transparent), inset 0 1px 0 rgba(255,255,255,.5); }
.eg-core .core::after { content: ""; position: absolute; inset: 0; border-radius: 18px; background: linear-gradient(160deg, rgba(255,255,255,.45), transparent 45%); }
.eg-core .core svg { width: 27px; height: 27px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; position: relative; z-index: 1; }
/* 轨道光环 */
.eg-core .ring { position: absolute; inset: -7px; border-radius: 24px; z-index: 1;
  background: conic-gradient(from 0deg, transparent 0%, var(--eg-c) 12%, transparent 30%, transparent 55%, var(--eg-c2) 68%, transparent 86%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1.5px));
  animation: ring-spin 7s linear infinite; opacity: .9; }
.engine:hover .eg-core .ring { animation-duration: 2.6s; opacity: 1; }
@keyframes ring-spin { to { transform: rotate(360deg); } }
/* 核心光晕呼吸 */
.eg-core::before { content: ""; position: absolute; inset: -14px; border-radius: 30px; background: radial-gradient(circle, color-mix(in srgb, var(--eg-c) 36%, transparent), transparent 70%); filter: blur(6px); animation: core-breathe 3.2s ease-in-out infinite; }
@keyframes core-breathe { 0%,100% { opacity: .5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }

.engine .eg-head { min-width: 0; }
.eg-head .eg-name { font-size: 22px; font-weight: 800; letter-spacing: -.2px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.eg-head .eg-en { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10.5px; letter-spacing: .22em; color: var(--sub-2); text-transform: uppercase; }
.eg-head .eg-desc { margin-top: 6px; font-size: 13.5px; color: var(--sub); line-height: 1.7; max-width: 480px; }
.eg-head .eg-desc b { color: color-mix(in srgb, var(--eg-c) 80%, #0F172A); font-weight: 600; }

/* 中部：特性胶囊 + 微缩预览 */
.engine .eg-mid { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-top: 22px; position: relative; z-index: 1; flex-wrap: wrap; }
.eg-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.eg-tags .tag { font-size: 11.5px; font-weight: 600; letter-spacing: .4px; color: var(--text-2); padding: 6px 12px; border-radius: 999px;
  background: rgba(15,23,42,.035); border: 1px solid rgba(15,23,42,.08); transition: .3s; white-space: nowrap; }
.eg-tags .tag::before { content: "◆ "; color: var(--eg-c); font-size: 8px; vertical-align: 1px; }
.engine:hover .eg-tags .tag { border-color: color-mix(in srgb, var(--eg-c) 40%, transparent); background: var(--eg-soft); }

/* 收治卡：三档风险指示条 */
.eg-meter { display: flex; align-items: flex-end; gap: 8px; height: 58px; }
.eg-meter .m-col { width: 30px; height: 58px; border-radius: 9px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
  background: rgba(15,23,42,.045); border: 1px solid rgba(15,23,42,.08); }
.eg-meter .m-fill { width: 100%; border-radius: 7px 7px 2px 2px; animation: m-pulse 2.6s ease-in-out infinite; }
.eg-meter .m-col:nth-child(1) .m-fill { height: 74%; background: linear-gradient(180deg, #FCA5A5, #EF4444); box-shadow: 0 0 16px rgba(239,68,68,.45); }
.eg-meter .m-col:nth-child(2) .m-fill { height: 48%; background: linear-gradient(180deg, #FDE68A, #F59E0B); box-shadow: 0 0 16px rgba(245,158,11,.45); animation-delay: .6s; }
.eg-meter .m-col:nth-child(3) .m-fill { height: 26%; background: linear-gradient(180deg, #6EE7B7, #10B981); box-shadow: 0 0 16px rgba(16,185,129,.45); animation-delay: 1.2s; }
.eg-meter .m-lab { font-size: 9.5px; text-align: center; color: var(--sub-2); line-height: 1; padding: 4px 0 3px; }
@keyframes m-pulse { 0%,100% { opacity: .72; } 50% { opacity: 1; } }

/* 病历卡：微缩文档扫描 */
.eg-scan { position: relative; width: 96px; height: 66px; border-radius: 12px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(160deg, rgba(15,23,42,.05), rgba(15,23,42,.02)); border: 1px solid rgba(15,23,42,.1); }
.eg-scan .s-line { position: absolute; left: 9px; right: 9px; height: 4px; border-radius: 4px; background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--eg-c) 75%, #334155), transparent); }
.eg-scan .s-line.s1 { top: 16px; opacity: .5; }
.eg-scan .s-line.s2 { top: 30px; opacity: .32; }
.eg-scan .s-line.s3 { top: 44px; opacity: .5; }
.eg-scan .scan-beam { position: absolute; left: 5px; right: 5px; height: 18px; border-radius: 8px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--eg-c) 55%, transparent), transparent);
  animation: scan-move 2.3s ease-in-out infinite; }
@keyframes scan-move { 0% { top: 4%; opacity: 0; } 18% { opacity: 1; } 82% { opacity: 1; } 100% { top: 86%; opacity: 0; } }
.eg-scan .s-check { position: absolute; right: 7px; bottom: 6px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--eg-c), var(--eg-c2)); box-shadow: 0 0 10px color-mix(in srgb, var(--eg-c) 60%, transparent); }
.eg-scan .s-check svg { width: 9px; height: 9px; stroke: #fff; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* 底部：状态 + 进入按钮 */
.engine .eg-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 18px; border-top: 1px solid rgba(15,23,42,.07); position: relative; z-index: 1; flex-wrap: wrap; }
.eg-status { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--sub); flex-wrap: wrap; }
.eg-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.eg-status .st-item { display: inline-flex; align-items: center; gap: 5px; }
.eg-status .st-item b { color: var(--text-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.eg-status .st-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--sub-2); }
.eg-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 14px; font-size: 14.5px; font-weight: 700; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--eg-c), var(--eg-c2));
  box-shadow: 0 12px 32px color-mix(in srgb, var(--eg-c) 35%, transparent), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .3s, box-shadow .3s, filter .3s; }
.eg-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s; }
.eg-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 42px color-mix(in srgb, var(--eg-c) 45%, transparent), inset 0 1px 0 rgba(255,255,255,.4); filter: brightness(1.06); }
.eg-btn:hover svg { transform: translateX(4px); }
.eg-btn:active { transform: translateY(0) scale(.97); }

/* 入场动效 */
@keyframes rise-in { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* 移动端适配 */
@media (max-width: 640px) {
  .portal { padding: 0 14px 80px; }
  .pt-hero { padding-top: 38px; }
  .engine { padding: 24px 20px 20px; border-radius: 24px; }
  .engine .eg-num { font-size: 56px; right: 18px; top: 12px; }
  .engine .eg-top { gap: 16px; }
  .eg-core { width: 58px; height: 58px; }
  .eg-core .core { width: 50px; height: 50px; border-radius: 16px; }
  .eg-core .ring { inset: -6px; border-radius: 21px; }
  .eg-head .eg-name { font-size: 19px; }
  .engine .eg-mid { margin-top: 18px; }
  .eg-meter { height: 52px; }
  .eg-meter .m-col { height: 52px; width: 26px; }
  .engine .eg-foot { margin-top: 20px; padding-top: 15px; }
  .eg-btn { width: 100%; justify-content: center; }
}

/* ============================================================
   风险提示弹窗（登录后强制同意） + 报告保存弹窗
   ============================================================ */
.force-mask { position: fixed; inset: 0; z-index: 2000; background: rgba(15,23,42,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 20px; animation: mask-in .2s ease; }
.force-card { width: 100%; max-width: 500px; max-height: 86vh; overflow-y: auto; background: linear-gradient(170deg, #FFFFFF, #F7F9FE);
  border: 1px solid rgba(15,23,42,.09); border-radius: 26px; box-shadow: 0 30px 80px rgba(15,23,42,.28); padding: 26px 24px; animation: a-up .3s cubic-bezier(.2,.9,.3,1); }
.force-card .fc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.force-card .fc-badge { width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #F59E0B, #EF4444); box-shadow: 0 8px 20px rgba(239,68,68,.35); }
.force-card .fc-badge svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.force-card .fc-title { font-size: 18px; font-weight: 800; }
.force-card .fc-sub { font-size: 12.5px; color: var(--sub); }
.force-card .fc-body { font-size: 13px; color: #475569; line-height: 1.9; margin: 16px 0 6px; }
.force-card .fc-body h5 { font-size: 13.5px; font-weight: 700; color: #0F172A; margin: 12px 0 4px; }
.force-card .fc-body h5:first-child { margin-top: 0; }
.force-card .fc-body p { margin: 3px 0; }
.force-card .fc-actions { display: flex; gap: 12px; margin-top: 20px; }
.force-card .fc-check { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: 12px;
  background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.25); font-size: 12px; color: #92400E; line-height: 1.7; }

/* 报告保存弹窗（长按保存提示） */
.save-mask { position: fixed; inset: 0; z-index: 2000; background: rgba(15,23,42,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 20px; animation: mask-in .2s ease; }
.save-card { width: 100%; max-width: 420px; max-height: 88vh; overflow-y: auto; background: #fff; border-radius: 24px;
  box-shadow: 0 30px 80px rgba(15,23,42,.28); padding: 20px; text-align: center; animation: a-up .3s cubic-bezier(.2,.9,.3,1); }
.save-card .sc-img { width: 100%; border-radius: 14px; border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm); }
.save-card .sc-tip { margin-top: 14px; font-size: 13px; color: #475569; line-height: 1.8; text-align: left; }
.save-card .sc-tip b { color: #B45309; }
.save-card .sc-actions { display: flex; gap: 12px; margin-top: 16px; }
.save-card .sc-dl { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, #4C7DFF, #7C5CFF); color: #fff; font-size: 14.5px; font-weight: 700; text-decoration: none; box-shadow: 0 8px 22px rgba(76,125,255,.35); }
.save-card .sc-dl svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.save-card .sc-close { min-width: 110px; min-height: 46px; border-radius: 14px; background: rgba(15,23,42,.06); color: var(--text-2); font-weight: 600; }
