/* ============ CSS VARIABLES ============ */
:root {
  /* 仅放大文字；布局/图片保持原尺寸 */
  --fs-scale: 1.4;
  /* 2026-08 现代化精修：在原深蓝基调上把强调色调亮净、背景加深、描边转冷蓝、
     投影更柔；新增医疗青 accent-2 / 统一圆角 / 卡片顶部内高光 token。 */
  --mas-primary: #173a5e;
  --mas-primary-dark: #0e2740;
  --mas-primary-deeper: #0a1c34;
  --mas-accent: #3a92e6;
  --mas-accent-light: #6bb4ff;
  --mas-accent-2: #35c9c0;                 /* 医疗青：仅点缀/次要数据 */
  --mas-accent-glow: rgba(58, 146, 230, 0.35);
  --mas-success: #27ae60;
  --mas-success-light: #2ecc71;
  --mas-warning: #f5a623;
  --mas-danger: #ef5b5b;
  --mas-bg-dark: #0a1626;
  --mas-bg-card: rgba(18, 40, 66, 0.94);   /* 无 blur，故保持近不透明 */
  --mas-bg-card-solid: #12283f;
  --mas-border: rgba(90, 160, 240, 0.16);
  --mas-border-light: rgba(90, 160, 240, 0.09);
  --mas-text: #eaf1f9;
  --mas-text-dim: #9db4d2;
  --mas-text-muted: #5f7ea3;
  --mas-glass: rgba(17, 40, 66, 0.66);
  --mas-glass-border: rgba(90, 160, 240, 0.14);
  --mas-card-hi: rgba(120, 180, 255, 0.08); /* 卡片顶部 1px 内高光 */
  --mas-radius: 16px;
  --mas-radius-sm: 11px;
  --mas-shadow: 0 6px 22px rgba(0,0,0,0.34);
  --mas-shadow-lg: 0 16px 48px rgba(0,0,0,0.44);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans SC', -apple-system, sans-serif;
  background: var(--mas-bg-dark);
  color: var(--mas-text);
  overflow: hidden;
  height: 100vh;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--mas-text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--mas-accent); }

/* ============ ANIMATED BG ============ */
.mas-bg-animation {
  /* 全屏 3 层 radial-gradient 叠加 + position:fixed 强制独立合成层。改成
     单层简单背景以释放 GPU compositor 内存。 */
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 900px 500px at 50% 50%, rgba(15,40,68,0.3) 0%, transparent 70%);
}

/* ============ TOP HEADER ============ */
.mas-top-header {
  height: 56px;
  background: linear-gradient(135deg, var(--mas-primary-dark), var(--mas-primary));
  border-bottom: 1px solid var(--mas-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: relative; z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.mas-top-header::after {
  content:''; position:absolute; bottom:0; left:0; right:0; height:1px;
  background: linear-gradient(90deg, transparent, var(--mas-accent), transparent);
}

.mas-header-left { display: flex; align-items: center; gap: 16px; }

.mas-logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--mas-accent), var(--mas-accent-light));
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: calc(14px * var(--fs-scale)); color: white;
  box-shadow: 0 2px 12px rgba(58, 146, 230,0.4);
}

.mas-system-title {
  font-size: calc(18px * var(--fs-scale)); font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(90deg, #fff, var(--mas-accent-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.mas-hospital-name {
  font-size: calc(12px * var(--fs-scale)); color: var(--mas-text-dim);
  padding-left: 16px; border-left: 1px solid var(--mas-border);
  line-height: 1.4;
}

.mas-header-right { display: flex; align-items: center; gap: 20px; }

.mas-header-status {
  display: flex; align-items: center; gap: 6px;
  font-size: calc(12px * var(--fs-scale)); color: var(--mas-success-light);
}
.mas-header-status .mas-dot {
  width: 7px; height: 7px; background: var(--mas-success-light);
  border-radius: 50%; animation: mas-pulse-dot 2s infinite;
}
@keyframes mas-pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--mas-success-light); }
  50% { opacity: 0.5; box-shadow: 0 0 8px var(--mas-success-light); }
}

.mas-header-user {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px; border-radius: 20px;
  background: rgba(255,255,255,0.08); cursor: pointer;
  transition: all 0.2s;
}
.mas-header-user:hover { background: rgba(255,255,255,0.12); }
.mas-header-user .mas-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--mas-accent), #6c5ce7);
  display: flex; align-items: center; justify-content: center;
  font-size: calc(12px * var(--fs-scale)); font-weight: 700;
}
.mas-header-user span { font-size: calc(13px * var(--fs-scale)); }

/* ============ LAYOUT ============ */
.mas-app-layout {
  display: flex; height: calc(100vh - 56px);
  position: relative; z-index: 1;
}

/* ============ SIDEBAR ============ */
.mas-sidebar {
  width: 220px; min-width: 220px;
  background: var(--mas-primary-deeper);
  border-right: 1px solid var(--mas-border-light);
  display: flex; flex-direction: column;
  padding: 16px 0;
  transition: all 0.3s;
}

.mas-nav-section { padding: 0 12px; margin-bottom: 8px; }
.mas-nav-section-label {
  font-size: calc(10px * var(--fs-scale)); font-weight: 700; color: var(--mas-text-muted);
  text-transform: uppercase; letter-spacing: 2px;
  padding: 8px 12px; margin-bottom: 4px;
}

.mas-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: var(--mas-radius-sm);
  cursor: pointer; transition: background 0.18s cubic-bezier(.22,.61,.36,1), color 0.18s, transform 0.18s;
  font-size: calc(13.5px * var(--fs-scale)); color: var(--mas-text-dim);
  margin-bottom: 2px; position: relative;
}
.mas-nav-item:hover {
  background: rgba(58,146,230,0.09); color: var(--mas-text);
}
.mas-nav-item.active {
  background: linear-gradient(90deg, rgba(58,146,230,0.20), rgba(58,146,230,0.04));
  color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--mas-border);
}
.mas-nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--mas-accent);
  border-radius: 0 3px 3px 0;
}

.mas-nav-icon {
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  font-size: calc(15px * var(--fs-scale)); flex-shrink: 0;
}

.mas-nav-badge {
  margin-left: auto; padding: 1px 7px; border-radius: 10px;
  font-size: calc(10px * var(--fs-scale)); font-weight: 700;
  background: var(--mas-accent); color: white;
}

.mas-sidebar-footer {
  margin-top: auto; padding: 16px;
  border-top: 1px solid var(--mas-border-light);
}
.mas-sidebar-version {
  font-size: calc(11px * var(--fs-scale)); color: var(--mas-text-muted); text-align: center;
}

/* ============ MAIN CONTENT ============ */
.mas-main-content {
  flex: 1; overflow-y: auto; padding: 24px;
}

/* 问诊助手 / 诊疗分析 / 患者管理：主工作区浅色底 */
.mas-main-content--light {
  flex: 1;
  min-width: 0;
  background: #eef2f7;
  color: #0f172a;
  --mas-text: #0f172a;
  --mas-text-dim: #334155;
  --mas-text-muted: #64748b;
  --mas-bg-card: #ffffff;
  --mas-bg-card-solid: #ffffff;
  --mas-border: #d1d9e6;
  --mas-border-light: #e2e8f0;
  --mas-glass-border: #e2e8f0;
  --mas-glass: rgba(248, 250, 252, 0.98);
  --mas-accent: #2563eb;
  --mas-accent-light: #1d4ed8;
  --mas-accent-glow: rgba(37, 99, 235, 0.18);
  --mas-success-light: #15803d;
  --mas-warning: #b45309;
  --mas-danger: #b91c1c;
}
.mas-main-content--light .mas-card-header,
.mas-main-content--light .mas-panel:not(.mas-panel-emr):not(.mas-panel-mmi):not(.mas-panel-current-patient) .mas-panel-header {
  background: #f1f5f9;
}
.mas-main-content--light .mas-panel {
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
.mas-main-content--light .mas-data-table thead {
  background: #f1f5f9;
}
.mas-main-content--light .mas-page-btn {
  background: #fff;
  border-color: var(--mas-border-light);
}
.mas-main-content--light .mas-search-box {
  background: #fff;
  border-color: var(--mas-border);
}
.mas-main-content--light .mas-form-input {
  background: #fff;
  color: #1a2a3e;
  border-color: var(--mas-border);
}
.mas-main-content--light .mas-consult-step-tabs {
  background: #fff;
  border: 1px solid var(--mas-border-light);
  border-radius: 10px;
  margin-bottom: 12px;
}
.mas-main-content--light .mas-consult-step-tab-num {
  background: #e2e8f0;
  color: var(--mas-text-muted);
  border-color: #cbd5e1;
}
.mas-main-content--light .mas-consult-patient-bar {
  background: #f8fafc;
  border: 1px solid var(--mas-border-light);
  border-radius: 10px;
  margin-bottom: 12px;
}
/* 表单题组：冷灰蓝托盘，白底输入/选项在上面对比清晰 */
.mas-main-content--light .mas-q-group {
  background: linear-gradient(180deg, #eef3f9 0%, #e6eef6 42%, #f0f5fa 100%);
  border: 1px solid rgba(58, 146, 230, 0.2);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
/* EMR / 多模态图像管理 正文：蓝灰托盘（与表单题组同系） */
.mas-main-content--light .mas-panel-emr .mas-panel-body,
.mas-main-content--light .mas-panel-mmi .mas-panel-body {
  background: linear-gradient(180deg, #eef3f9 0%, #e6eef6 42%, #f0f5fa 100%);
}
/* 当前患者卡片外框：与参考色 #dce6f2 配套，整块纯色无渐变 */
.mas-main-content--light .mas-panel.mas-panel-current-patient {
  background: #dce6f2;
}
.mas-main-content--light .mas-panel-current-patient {
  border-left: 4px solid #a8c4e0;
  box-shadow: 0 2px 12px rgba(120, 160, 200, 0.14), 0 1px 3px rgba(15, 23, 42, 0.04);
}
.mas-main-content--light .mas-panel-current-patient-header {
  background: #dce6f2;
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
}
.mas-main-content--light .mas-panel-current-patient .mas-panel-body.mas-panel-current-patient-body {
  background: #dce6f2;
  padding: 14px;
}
/* 姓名 + 性别年龄：白底小框 */
.mas-main-content--light .mas-current-patient-identity {
  background: #ffffff;
  border: 1px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(180, 210, 235, 0.55), 0 2px 12px rgba(120, 170, 210, 0.1);
  border-radius: 10px;
  padding: 14px 16px 16px;
}
.mas-main-content--light .mas-panel-current-patient .mas-current-patient-chip {
  background: #ffffff;
  border: 1px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(180, 210, 235, 0.5), 0 1px 4px rgba(100, 150, 200, 0.1);
}
.mas-main-content--light .mas-diag-v3 {
  background: #fff;
  border: 1px solid var(--mas-border-light);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
/* 侧栏：仅槽底为纯色浅灰蓝（未创建/列表下方空白区）— 勿用渐变 */
.mas-main-content--light .mas-diag-patient-list {
  background: #f0f4f8;
  border-right-color: rgba(30, 64, 175, 0.1);
}
.mas-main-content--light .mas-diag-main {
  background: #fff;
}
/* 患者列表滚动区内边距，卡片之间留出圆角间隙 */
.mas-main-content--light .mas-diag-patient-scroll {
  padding: 8px 10px 12px;
}
/* 患者行：圆角小卡片 + 纯色底 */
.mas-main-content--light .mas-diag-patient-item {
  background: #d6e4f5;
  border-bottom: none;
  border-left: 3px solid transparent;
  border-radius: 10px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.mas-main-content--light .mas-diag-patient-item:last-of-type {
  margin-bottom: 0;
}
.mas-main-content--light .mas-diag-patient-item:hover {
  background: #c8daf0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}
.mas-main-content--light .mas-diag-patient-item.active {
  background: #bdd4ef;
  border-left: 3px solid #7eb3e0;
  box-shadow: 0 2px 8px rgba(60, 130, 200, 0.18);
}
.mas-main-content--light .mas-diag-patient-item .mas-badge.mas-badge-green {
  background: rgba(30, 41, 59, 0.09);
  color: #1e293b;
  border: 1px solid rgba(71, 85, 105, 0.28);
}
.mas-main-content--light .mas-diag-patient-item .mas-badge.mas-badge-blue {
  background: rgba(67, 56, 202, 0.1);
  color: #4338ca;
  border: 1px solid rgba(129, 140, 248, 0.32);
}
.mas-main-content--light .mas-diag-patient-item .mas-badge.mas-badge-orange {
  background: rgba(154, 52, 18, 0.08);
  color: #9a3412;
  border: 1px solid rgba(234, 88, 12, 0.22);
}
.mas-main-content:not(.mas-main-content--light) .mas-diag-patient-item .mas-badge.mas-badge-green {
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.28);
}
.mas-main-content:not(.mas-main-content--light) .mas-diag-patient-item .mas-badge.mas-badge-blue {
  background: rgba(129, 140, 248, 0.15);
  color: #c7d2fe;
  border: 1px solid rgba(129, 140, 248, 0.3);
}
.mas-main-content:not(.mas-main-content--light) .mas-diag-patient-item .mas-badge.mas-badge-orange {
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.mas-main-content--light .mas-emr-textarea,
.mas-main-content--light .mas-patient-input {
  background: #fff;
  color: #1a2a3e;
  border-color: var(--mas-border);
}
.mas-main-content--light .mas-collect-right .mas-img-cat-box {
  background: #ffffff;
  border: 1px solid var(--mas-border-light);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}
.mas-main-content--light .mas-img-cat-box {
  background: #f1f5f9;
  border-color: var(--mas-border-light);
}
.mas-main-content--light .mas-img-thumb-sm,
.mas-main-content--light .mas-img-thumb-lg {
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  border-color: #cbd5e1;
  color: var(--mas-text-muted);
}
.mas-main-content--light .mas-log-section {
  background: #f8fafc;
  border-color: var(--mas-border-light);
}
.mas-main-content--light .mas-log-header {
  background: #f1f5f9;
}
.mas-main-content--light .mas-log-content {
  background: #fff;
  color: #334155;
}
.mas-main-content--light .mas-input-snapshot {
  background: #f1f5f9;
}
.mas-main-content--light .mas-img-upload-zone {
  background: #f8fafc;
}
.mas-main-content--light .mas-img-tab {
  background: #f1f5f9;
  color: var(--mas-text-dim);
}
.mas-main-content--light .mas-img-tabs {
  background: #f1f5f9;
}
.mas-main-content--light .mas-exam-check {
  background: #f1f5f9;
  color: var(--mas-text-muted);
  border-color: var(--mas-border-light);
}
.mas-main-content--light .mas-module-card {
  background: var(--mas-bg-card);
}
.mas-main-content--light .mas-consult-footer {
  background: #f8fafc;
  border-top-color: var(--mas-border-light);
}

/* ============ CARDS ============ */
.mas-card {
  background: var(--mas-bg-card);
  border: 1px solid var(--mas-glass-border);
  border-radius: var(--mas-radius);
  /* 之前 backdrop-filter: blur(12px) —— Chrome 给每个 .mas-card 开独立
     GPU layer 持续采样背后内容做 blur。首页同时 7+ 个 .mas-card →
     400MB GPU 内存 + 持续 100% GPU 工作。删之；mas-bg-card 已是
     near-opaque 颜色，视觉差异极小。
     现代化精修：用柔和外投影 + 顶部 1px 内高光营造玻璃层次，GPU 零成本。 */
  box-shadow: var(--mas-shadow), inset 0 1px 0 var(--mas-card-hi);
  overflow: hidden;
}

.mas-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--mas-border-light);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(0,0,0,0.15);
}
.mas-card-title {
  font-size: calc(14px * var(--fs-scale)); font-weight: 700; color: var(--mas-text);
  display: flex; align-items: center; gap: 8px;
}
.mas-card-title .mas-icon { color: var(--mas-accent-light); }
.mas-card-body { padding: 20px; }

/* ============ STAT CARDS ============ */
.mas-stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 20px;
}
.mas-stat-card {
  background: var(--mas-bg-card);
  border: 1px solid var(--mas-glass-border);
  border-radius: var(--mas-radius); padding: 20px;
  position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 var(--mas-card-hi);
  transition: transform 0.22s cubic-bezier(.22,.61,.36,1), box-shadow 0.22s;
}
.mas-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--mas-shadow-lg), inset 0 1px 0 var(--mas-card-hi);
}
.mas-stat-card::before {
  content:''; position:absolute; top:0; left:0; right:0; height:3px;
}
.mas-stat-card:nth-child(1)::before { background: linear-gradient(90deg, var(--mas-accent), var(--mas-accent-light)); }
.mas-stat-card:nth-child(2)::before { background: linear-gradient(90deg, var(--mas-accent-2), #5fe7de); }
.mas-stat-card:nth-child(3)::before { background: linear-gradient(90deg, var(--mas-warning), #e67e22); }
.mas-stat-card:nth-child(4)::before { background: linear-gradient(90deg, var(--mas-success), var(--mas-success-light)); }

.mas-stat-label { font-size: calc(12px * var(--fs-scale)); color: var(--mas-text-muted); margin-bottom: 8px; }
.mas-stat-value { font-size: calc(28px * var(--fs-scale)); font-weight: 900; line-height: 1; }
.mas-stat-sub { font-size: calc(11px * var(--fs-scale)); color: var(--mas-text-dim); margin-top: 6px; display:flex; align-items:center; gap:4px; }
.mas-stat-up { color: var(--mas-success-light); }
.mas-stat-down { color: var(--mas-danger); }
.mas-stat-card:nth-child(1) .mas-stat-value { color: var(--mas-accent-light); }
.mas-stat-card:nth-child(2) .mas-stat-value { color: var(--mas-accent-2); }
.mas-stat-card:nth-child(3) .mas-stat-value { color: var(--mas-warning); }
.mas-stat-card:nth-child(4) .mas-stat-value { color: var(--mas-success-light); }

/* ============ BUTTONS ============ */
.mas-btn {
  padding: 9px 20px; border-radius: 10px; border: none;
  font-size: calc(13px * var(--fs-scale)); font-weight: 600; cursor: pointer;
  font-family: inherit; transition: transform 0.18s cubic-bezier(.22,.61,.36,1), box-shadow 0.18s, border-color 0.18s, color 0.18s;
}
.mas-btn-primary {
  background: linear-gradient(135deg, var(--mas-accent), #2f6fd0);
  color: white;
  box-shadow: 0 4px 16px var(--mas-accent-glow);
}
.mas-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 26px var(--mas-accent-glow); }
.mas-btn-outline {
  background: transparent; color: var(--mas-text-dim);
  border: 1px solid var(--mas-border);
}
.mas-btn-outline:hover { border-color: var(--mas-accent); color: var(--mas-accent-light); background: rgba(58,146,230,0.08); }

/* ============ BADGES ============ */
.mas-badge {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: calc(11px * var(--fs-scale)); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.mas-badge-blue { background: rgba(58,146,230,0.15); color: var(--mas-accent-light); }
.mas-badge-green { background: rgba(39,174,96,0.15); color: var(--mas-success-light); }
.mas-badge-orange { background: rgba(243,156,18,0.15); color: var(--mas-warning); }
.mas-badge-red { background: rgba(231,76,60,0.15); color: var(--mas-danger); }
.mas-badge-purple { background: rgba(155,89,182,0.15); color: #a78bfa; }

/* ============ DATA TABLE ============ */
.mas-data-table {
  width: 100%; border-collapse: separate;
  border-spacing: 0; background: var(--mas-bg-card);
  border-radius: var(--mas-radius); overflow: hidden;
  border: 1px solid var(--mas-glass-border);
}
.mas-data-table thead { background: rgba(0,0,0,0.2); }
.mas-data-table th {
  padding: 12px 16px; text-align: left;
  font-size: calc(12px * var(--fs-scale)); font-weight: 600; color: var(--mas-text-dim);
  border-bottom: 1px solid var(--mas-border-light);
  white-space: nowrap;
}
.mas-data-table td {
  padding: 12px 16px; font-size: calc(13px * var(--fs-scale));
  border-bottom: 1px solid var(--mas-border-light);
}
/* 患者ID：小按钮（深蓝字 + 浅蓝底，易辨认且不过分抢眼） */
.mas-data-table td.mas-patient-id-cell {
  vertical-align: middle;
}
.mas-patient-id-btn {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-size: calc(12px * var(--fs-scale));
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #1e3a8a;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #93c5fd;
  border-radius: 7px;
  padding: 5px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s, color 0.15s;
  line-height: 1.25;
  box-shadow: 0 1px 2px rgba(30, 58, 138, 0.08);
}
.mas-patient-id-btn:hover {
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #3b82f6;
  color: #172554;
}
.mas-patient-id-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.35);
}
.mas-patient-id-btn:active {
  transform: scale(0.98);
}
/* 当前患者白框内：姓名 · 性别 · 岁 — 横向，右侧 ID 按钮 */
.mas-current-patient-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.mas-current-patient-row .mas-current-patient-name {
  margin-bottom: 0;
  font-size: calc(20px * var(--fs-scale));
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.02em;
}
.mas-current-patient-demographics {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: calc(13px * var(--fs-scale));
  font-weight: 500;
  color: #475569;
}
.mas-current-patient-sep {
  color: #94a3b8;
  user-select: none;
}
.mas-current-patient-id-btn {
  margin-left: auto;
  flex-shrink: 0;
  cursor: default;
}
.mas-current-patient-id-btn:hover {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #93c5fd;
  color: #1e3a8a;
}
.mas-data-table tbody tr { transition: background 0.15s; }
.mas-data-table tbody tr:hover { background: rgba(58, 146, 230,0.05); }
.mas-data-table tbody tr:last-child td { border-bottom: none; }

/* ============ ACTION BUTTON ============ */
.mas-action-btn {
  padding: 4px 10px; border-radius: 6px;
  background: rgba(58, 146, 230,0.1); color: var(--mas-accent-light);
  border: 1px solid rgba(58, 146, 230,0.2);
  font-size: calc(11px * var(--fs-scale)); cursor: pointer; transition: all 0.2s;
  font-family: inherit; margin-right: 6px;
}
.mas-action-btn:hover { background: rgba(58, 146, 230,0.2); }

/* ============ PAGINATION ============ */
.mas-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-top: 16px;
}
.mas-page-btn {
  width: 32px; height: 32px; border-radius: 6px;
  background: rgba(0,0,0,0.2); border: 1px solid var(--mas-border-light);
  color: var(--mas-text-dim); font-size: calc(12px * var(--fs-scale));
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.mas-page-btn:hover, .mas-page-btn.active {
  background: var(--mas-accent); color: white; border-color: var(--mas-accent);
}
.mas-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.mas-page-ellipsis {
  min-width: 20px; text-align: center; color: var(--mas-text-dim);
  font-size: calc(12px * var(--fs-scale)); user-select: none;
}
.mas-page-total {
  margin-left: 8px; color: var(--mas-text-muted);
  font-size: calc(12px * var(--fs-scale));
}

/* ============ SEARCH BOX ============ */
.mas-search-box {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.2); border: 1px solid var(--mas-border);
  border-radius: 8px; padding: 8px 14px; width: 320px;
}
.mas-search-box input {
  background: none; border: none; color: var(--mas-text);
  font-size: calc(13px * var(--fs-scale)); font-family: inherit; flex: 1; outline: none;
}
.mas-search-box input::placeholder { color: var(--mas-text-muted); }

/* ============ FORM ELEMENTS ============ */
.mas-form-group { display: flex; flex-direction: column; gap: 6px; }
.mas-form-label { font-size: calc(12px * var(--fs-scale)); font-weight: 600; color: var(--mas-text-dim); }
.mas-form-input {
  padding: 10px 14px; background: rgba(0,0,0,0.2);
  border: 1px solid var(--mas-border); border-radius: 10px;
  color: var(--mas-text); font-size: calc(13px * var(--fs-scale)); font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.mas-form-input:focus { outline: none; border-color: var(--mas-accent); box-shadow: 0 0 0 3px rgba(58,146,230,0.16); }
.mas-form-hint { font-size: calc(11px * var(--fs-scale)); color: var(--mas-text-muted); }

/* ============ TOGGLE ============ */
.mas-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--mas-border-light);
}
.mas-toggle-title { font-size: calc(13px * var(--fs-scale)); font-weight: 500; }
.mas-toggle-desc { font-size: calc(11px * var(--fs-scale)); color: var(--mas-text-muted); margin-top: 2px; }
.mas-toggle {
  width: 44px; height: 24px; border-radius: 12px;
  background: rgba(90,122,158,0.3); cursor: pointer;
  position: relative; transition: background 0.25s cubic-bezier(.22,.61,.36,1), box-shadow 0.25s;
  flex-shrink: 0;
}
.mas-toggle.on { background: var(--mas-accent); box-shadow: 0 0 12px var(--mas-accent-glow); }
.mas-toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; background: white;
  border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.35);
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1);
}
.mas-toggle.on::after { transform: translateX(20px); }

/* ============ TEXTAREA ============ */
.mas-textarea {
  width: 100%; min-height: 100px; background: rgba(0,0,0,0.2);
  border: 1px solid var(--mas-border); border-radius: 10px;
  padding: 12px; color: var(--mas-text); font-size: calc(12.5px * var(--fs-scale));
  font-family: inherit; resize: vertical; line-height: 1.6;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.mas-textarea:focus { outline: none; border-color: var(--mas-accent); box-shadow: 0 0 0 3px rgba(58,146,230,0.16); }

/* ============ CONSULTATION V2 (问诊助手) ============ */
.mas-consult-v2 {
  display: flex; flex-direction: column; height: calc(100vh - 104px); min-height: 0;
}

/* Step tabs with connectors */
.mas-consult-step-tabs {
  display: flex; align-items: center; gap: 0; padding: 12px 16px;
  border-bottom: 1px solid var(--mas-border-light); flex-shrink: 0;
}
.mas-consult-step-tab {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 6px 12px; border-radius: 10px; transition: background 0.18s cubic-bezier(.22,.61,.36,1); position: relative;
}
.mas-consult-step-tab:hover { background: rgba(58, 146, 230,0.06); }
.mas-consult-step-tab-num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(12px * var(--fs-scale)); font-weight: 700;
  background: rgba(0,0,0,0.2); color: var(--mas-text-muted);
  border: 2px solid var(--mas-border-light);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.mas-consult-step-tab.active .mas-consult-step-tab-num {
  background: var(--mas-accent); color: #fff; border-color: var(--mas-accent);
  box-shadow: 0 0 0 4px rgba(58,146,230,0.15);
}
.mas-consult-step-tab.done .mas-consult-step-tab-num {
  background: var(--mas-success); color: #fff; border-color: var(--mas-success);
}
.mas-consult-step-tab-text {
  font-size: calc(13px * var(--fs-scale)); font-weight: 500; color: var(--mas-text-muted); white-space: nowrap;
}
.mas-consult-step-tab.active .mas-consult-step-tab-text { color: var(--mas-accent-light); font-weight: 600; }
.mas-consult-step-tab.done .mas-consult-step-tab-text { color: var(--mas-success-light); }
.mas-consult-step-tab-line {
  width: 30px; height: 2px; background: var(--mas-border-light); margin: 0 4px; flex-shrink: 0;
  border-radius: 2px; transition: background 0.3s;
}
.mas-consult-step-tab-line.done { background: linear-gradient(90deg, var(--mas-success), var(--mas-success-light)); }

/* Patient info bar */
.mas-consult-patient-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; font-size: calc(12px * var(--fs-scale)); color: var(--mas-text-dim);
  background: rgba(0,0,0,0.1); border-bottom: 1px solid var(--mas-border-light);
  flex-shrink: 0;
}

/* Form area */
.mas-consult-form-area {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}

.mas-consult-main { flex: 1; display: flex; flex-direction: column; padding: 16px; overflow-y: auto; }
.mas-consult-step-header {
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-shrink: 0;
}
.mas-consult-step-num {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--mas-accent), var(--mas-accent-light));
  color: #fff; font-size: calc(18px * var(--fs-scale)); font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 6px 16px var(--mas-accent-glow);
}
.mas-consult-step-body { flex: 1; overflow-y: auto; padding-bottom: 12px; }
.mas-consult-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-top: 1px solid var(--mas-border-light); flex-shrink: 0;
}

/* Step progress */
.mas-step-progress { display: flex; flex-direction: column; gap: 0; }
.mas-step-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 8px 4px;
  cursor: pointer; position: relative; transition: opacity 0.2s;
}
.mas-step-item:hover { opacity: 0.9; }
.mas-step-connector {
  position: absolute; left: 15px; top: 36px; width: 2px; height: calc(100% - 20px);
  background: var(--mas-border-light);
}
.mas-step-item.done .mas-step-connector { background: var(--mas-success); }
.mas-step-item.active .mas-step-connector { background: var(--mas-accent); }
.mas-step-indicator {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(13px * var(--fs-scale)); font-weight: 700;
  background: rgba(0,0,0,0.2); color: var(--mas-text-muted);
  border: 2px solid var(--mas-border-light); transition: all 0.3s;
}
.mas-step-item.active .mas-step-indicator { background: var(--mas-accent); color: #fff; border-color: var(--mas-accent); }
.mas-step-item.done .mas-step-indicator { background: var(--mas-success); color: #fff; border-color: var(--mas-success); }
.mas-step-info { flex: 1; min-width: 0; }
.mas-step-title { font-size: calc(13px * var(--fs-scale)); font-weight: 600; color: var(--mas-text); }
.mas-step-desc { font-size: calc(11px * var(--fs-scale)); color: var(--mas-text-muted); }
.mas-step-item.active .mas-step-title { color: var(--mas-accent-light); }

/* Patient quick card */
.mas-pq-item { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--mas-border-light); }
.mas-pq-item:last-child { border-bottom: none; }
.mas-pq-label { font-size: calc(11px * var(--fs-scale)); color: var(--mas-text-muted); min-width: 60px; }
.mas-pq-value { font-size: calc(13px * var(--fs-scale)); font-weight: 600; color: var(--mas-text); }

/* Q-form elements */
.mas-q-group {
  margin-bottom: 16px; padding: 12px; background: rgba(0,0,0,0.1);
  border-radius: 8px; border: 1px solid var(--mas-border-light);
}
.mas-q-label { font-size: calc(13px * var(--fs-scale)); font-weight: 600; color: var(--mas-text); margin-bottom: 8px; }
.mas-q-req { font-size: calc(11px * var(--fs-scale)); color: var(--mas-danger); font-weight: 400; }
.mas-q-hint { font-size: calc(11px * var(--fs-scale)); color: var(--mas-accent-light); margin-bottom: 8px; }
.mas-q-mini { font-size: calc(11px * var(--fs-scale)); color: var(--mas-text-muted); margin-bottom: 4px; font-weight: 600; }
.mas-q-input {
  padding: 10px 14px; border-radius: 8px; border: 1px solid rgba(58, 146, 230, 0.35);
  background: #fff; color: #1a2a3e; font-size: calc(13px * var(--fs-scale));
  outline: none; font-family: inherit; width: 100%; transition: border-color 0.2s;
  resize: vertical;
}
.mas-q-input::placeholder {
  color: #6b7c90;
}
.mas-q-input:focus { border-color: var(--mas-accent); box-shadow: 0 0 0 2px rgba(58, 146, 230, 0.2); }
.mas-q-input:-webkit-autofill,
.mas-q-input:-webkit-autofill:hover,
.mas-q-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 30px #fff inset;
  -webkit-text-fill-color: #1a2a3e;
}
.mas-q-row { display: flex; gap: 12px; }
.mas-q-row > div { flex: 1; }
/* 详细专科检查 OD/OS 分栏的眼别标题（反馈4） */
.mas-q-eye-head {
  font-size: calc(12px * var(--fs-scale)); font-weight: 700; color: var(--mas-accent-light);
  text-align: center; padding: 5px 0; margin-bottom: 8px; border-radius: 6px;
  background: rgba(58, 146, 230, 0.12);
}
.mas-q-options { display: flex; gap: 8px; flex-wrap: wrap; }
.mas-q-opt {
  padding: 7px 16px; border-radius: 8px; cursor: pointer;
  background: #fff; color: #2c3e50;
  border: 1px solid rgba(58, 146, 230, 0.35); font-size: calc(12px * var(--fs-scale));
  transition: all 0.2s; user-select: none;
}
.mas-q-opt:hover { border-color: var(--mas-accent-light); color: var(--mas-accent); }
.mas-q-opt.active {
  background: #fff; color: var(--mas-accent);
  border-color: var(--mas-accent); font-weight: 600;
  box-shadow: 0 0 0 2px rgba(58, 146, 230, 0.25);
}

/* 问诊第5步：生成报告后的白底阅读区（病历 + AI 结果） */
.mas-consult-report-light {
  --mas-text: #0f172a;
  --mas-text-dim: #334155;
  --mas-text-muted: #64748b;
  --mas-accent-light: #1a5276;
  --mas-accent: #2563eb;
  --mas-border-light: #e2e8f0;
  --mas-border: #cbd5e1;
  --mas-success-light: #15803d;
  --mas-warning: #b45309;
  --mas-danger: #b91c1c;
  background: #fff;
  color: var(--mas-text-dim);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 28px rgba(15, 23, 42, 0.08);
}
.mas-consult-report-light-inner.mas-q-group {
  background: #f8fafc;
  border-color: #e2e8f0;
  margin-bottom: 16px;
}
.mas-consult-report-light-body {
  font-size: calc(13px * var(--fs-scale));
  line-height: 2;
  color: var(--mas-text-dim);
}
.mas-consult-report-ai {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}
.mas-consult-report-ai--success {
  background: linear-gradient(180deg, #f0fdf4 0%, #f8fafc 100%) !important;
  border-color: #86efac !important;
}
.mas-consult-report-ai-h {
  color: #1a5276 !important;
  border-bottom-color: #e2e8f0 !important;
}
.mas-consult-report-ai--success .mas-consult-report-ai-h {
  color: #15803d !important;
  border-bottom-color: #bbf7d0 !important;
}
.mas-consult-report-light .mas-ai-body {
  color: var(--mas-text-dim);
}
.mas-consult-report-light .mas-analyzer-badge.idle {
  background: #f1f5f9;
  color: #64748b;
}
.mas-consult-report-light .mas-analyzer-badge.done {
  background: #dcfce7;
  color: #166534;
}

/* AI cards */
.mas-ai-card {
  border: 1px solid rgba(58, 146, 230,0.2); border-radius: 10px;
  background: linear-gradient(135deg, rgba(58, 146, 230,0.06), rgba(10,20,36,0.3));
  margin-bottom: 14px; overflow: hidden;
}
.mas-ai-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: calc(13px * var(--fs-scale)); font-weight: 600;
  color: var(--mas-accent-light); border-bottom: 1px solid rgba(58, 146, 230,0.1);
}
.mas-ai-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mas-accent-light); animation: mas-pulse-dot 2s infinite;
}
.mas-ai-body { padding: 14px; font-size: calc(12px * var(--fs-scale)); line-height: 1.9; color: var(--mas-text-dim); }

/* Exam items */
.mas-exam-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin-bottom: 6px;
  background: rgba(0,0,0,0.1); border-radius: 8px;
  border: 1px solid var(--mas-border-light);
}
.mas-exam-check {
  width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(14px * var(--fs-scale)); cursor: pointer; transition: all 0.2s;
  background: rgba(0,0,0,0.2); color: var(--mas-text-muted);
  border: 1px solid var(--mas-border-light);
}
.mas-exam-check.checked {
  background: var(--mas-success); color: #fff; border-color: var(--mas-success);
}

/* Generating spinner */
.mas-generating-spinner {
  width: 48px; height: 48px; margin: 0 auto;
  border: 4px solid var(--mas-border-light);
  border-top-color: var(--mas-accent-light);
  border-radius: 50%;
  animation: mas-spin 0.8s linear infinite;
}
@keyframes mas-spin { to { transform: rotate(360deg); } }

/* ============ DIAGNOSIS PATIENT LIST ============ */
.mas-diag-patient-list {
  width: 200px; min-width: 180px; flex-shrink: 0;
  background: rgba(0,0,0,0.15); border-right: 1px solid var(--mas-border-light);
  display: flex; flex-direction: column; overflow: hidden;
}
.mas-diag-patient-scroll {
  min-height: 0;
}
.mas-diag-patient-item {
  padding: 10px 12px; cursor: pointer; position: relative;
  border-bottom: 1px solid var(--mas-border-light);
  transition: background 0.15s, box-shadow 0.15s;
}
.mas-diag-patient-item:hover { background: rgba(58, 146, 230,0.06); }
.mas-diag-patient-item.active {
  background: rgba(58, 146, 230,0.12);
  border-left: 3px solid var(--mas-accent);
}
.mas-main-content:not(.mas-main-content--light) .mas-diag-patient-item:hover {
  background: rgba(148, 163, 184, 0.07);
}
.mas-main-content:not(.mas-main-content--light) .mas-diag-patient-item.active {
  background: rgba(148, 163, 184, 0.12);
  border-left: 3px solid #94a3b8;
}
.mas-main-content:not(.mas-main-content--light) .mas-diag-patient-scroll {
  padding: 8px 10px 12px;
}
.mas-main-content:not(.mas-main-content--light) .mas-diag-patient-item {
  border-bottom: none;
  border-radius: 10px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.mas-main-content:not(.mas-main-content--light) .mas-diag-patient-item:last-of-type {
  margin-bottom: 0;
}

/* ============ DIAGNOSIS V3 (3-tab layout) ============ */
.mas-diag-v3 { height: calc(100vh - 104px); display: flex; flex-direction: row; }
.mas-diag-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.mas-diag-tabs {
  display: flex; align-items: center; gap: 6px; padding: 0 4px 12px;
  border-bottom: 1px solid var(--mas-border-light); flex-shrink: 0;
}
.mas-diag-tab {
  padding: 8px 22px; border-radius: 8px; cursor: pointer; transition: all 0.3s;
  background: transparent; color: var(--mas-text-muted); border: 1px solid transparent;
  display: flex; align-items: center; gap: 8px; font-size: calc(13px * var(--fs-scale)); font-weight: 400;
  white-space: nowrap; font-family: inherit;
}
.mas-diag-tab:hover { color: var(--mas-accent-light); background: rgba(58, 146, 230,0.06); }
.mas-diag-tab.active {
  background: rgba(58, 146, 230,0.12); color: var(--mas-accent-light);
  border-color: rgba(58, 146, 230,0.3); font-weight: 600;
}
.mas-diag-tab-dot { width: 8px; height: 8px; border-radius: 50%; }
.mas-diag-tab-patient {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  color: var(--mas-text-muted); font-size: calc(12px * var(--fs-scale));
}
.mas-diag-content {
  flex: 1;
  overflow-y: auto;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 多模态分析 · 详情页头部：标题居中 */
.mas-diag-detail-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.mas-diag-detail-topbar-left { justify-self: start; }
.mas-diag-detail-topbar-center {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.mas-diag-detail-topbar-right { justify-self: end; }
.mas-diag-detail-title {
  font-size: calc(18px * var(--fs-scale));
  font-weight: 800;
  color: var(--mas-text);
  letter-spacing: 0.02em;
}

/* Collection layout：左右列等高拉伸，EMR 占满左列剩余高度与右侧「分析完成」底对齐 */
.mas-collect-layout {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: stretch;
}
.mas-collect-left {
  flex: 1 1 340px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  min-height: 0;
}
.mas-collect-left > .mas-panel:not(.mas-panel-emr) {
  flex-shrink: 0;
}
.mas-collect-left .mas-panel-emr {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.mas-collect-left .mas-panel-emr .mas-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mas-collect-left .mas-panel-emr .mas-emr-textarea {
  flex: 1 1 auto;
  min-height: 160px;
  max-height: none;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}
.mas-collect-right { flex: 1 1 460px; min-width: 340px; display: flex; flex-direction: column; gap: 16px; }
.mas-collect-right .mas-panel-mmi {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.mas-collect-right .mas-panel-mmi .mas-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Image category box */
.mas-img-cat-box {
  margin-bottom: 14px;
  padding: 14px;
  background: rgba(10,20,36,0.5); border-radius: 10px; border: 1px solid;
}
.mas-img-cat-header {
  font-size: calc(15px * var(--fs-scale));
  font-weight: 700;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 7px;
}
.mas-img-cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mas-img-eyes-row {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: flex-start;
}
.mas-img-eye-col {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.mas-eye-label-sm {
  font-size: calc(13px * var(--fs-scale));
  color: var(--mas-text-muted);
  margin: 8px 0 6px;
  font-weight: 700;
}
.mas-img-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.mas-img-row--eye { margin-bottom: 0; }
.mas-img-thumb-sm {
  width: 110px;
  height: 84px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1a3a5c, #0e2a4a);
  display: flex; align-items: center; justify-content: center;
  position: relative; border: 1px solid rgba(26,58,92,0.4);
  cursor: pointer;
  flex-shrink: 0;
  font-size: calc(11px * var(--fs-scale));
  color: #4a7a9a;
  overflow: hidden;
}
.mas-img-thumb-lg {
  width: 140px; height: 100px; border-radius: 7px;
  background: linear-gradient(135deg, #1a3a5c, #0e2a4a);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(26,58,92,0.4); overflow: hidden; flex-shrink: 0;
}
.mas-img-remove {
  position: absolute; left: 0; right: 0; bottom: 0; height: 22px;
  border: none; border-radius: 0 0 10px 10px;
  background: rgba(217,48,37,0.82);
  display: flex; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; font-size: calc(11px * var(--fs-scale)); color: #fff;
  line-height: 1; font-weight: 600; transition: background 0.15s;
}
.mas-img-remove:hover { background: rgba(217,48,37,0.96); }
.mas-img-remove:disabled { opacity: 0.45; cursor: not-allowed; }
.mas-img-add-btn {
  width: 110px;
  height: 84px;
  border-radius: 10px;
  border: 2px dashed rgba(42,90,138,0.4);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  background: transparent;
  color: #2a5a8a;
  font-size: calc(28px * var(--fs-scale));
  transition: all 0.2s;
}
.mas-img-add-btn:hover { border-color: var(--mas-accent-light); color: var(--mas-accent-light); }

/* Progress bar */
.mas-progress-bar { height: 5px; border-radius: 3px; background: rgba(26,58,92,0.3); overflow: hidden; margin-top: 8px; }
.mas-progress-fill { height: 100%; background: linear-gradient(90deg, var(--mas-accent), var(--mas-accent-light)); border-radius: 3px; transition: width 0.5s ease; }

/* Analysis grid */
/* 4 个可见模块（cfp/oct/bscan/ffa，emr 不在此网格）→ 4 列铺满；
   此前 repeat(5) 会在右侧空一格，看起来像缺了一张卡。 */
.mas-analysis-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .mas-analysis-grid { grid-template-columns: repeat(2, 1fr); } }
.mas-module-card { text-align: center; position: relative; overflow: hidden; padding: 22px;
  display: flex; flex-direction: column;
  transition: transform 0.22s cubic-bezier(.22,.61,.36,1), box-shadow 0.22s; }
.mas-module-card:hover { transform: translateY(-2px); box-shadow: var(--mas-shadow-lg), inset 0 1px 0 var(--mas-card-hi); }
/* 按钮吸底：无论上方状态文案多寡，各卡按钮基线对齐，视觉更整齐。 */
.mas-module-card > .mas-btn-start:first-of-type { margin-top: auto; }
.mas-module-top-line { position: absolute; top: 0; left: 0; right: 0; height: 3px; transition: background 0.5s; }
.mas-module-card-name { font-size: calc(14px * var(--fs-scale)); font-weight: 700; color: var(--mas-text); margin: 8px 0 14px; }

/* 多模态分析（非详情）整页：纵向撑满，底部双框贴底 */
.mas-diag-analysis-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 多模态分析底部双栏（左 7 / 右 3） */
.mas-diag-bottom-split {
  /* 下半屏占满：随页面布局拉伸，不再贴底悬浮 */
  position: relative;
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 12px;
  margin-top: 16px;
  flex: 1 1 320px;
  min-height: 280px;
  padding-top: 0;
  background: transparent;
  border-top: none;
  z-index: 1;
}
.mas-diag-bottom-split .mas-panel {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.mas-diag-bottom-head {
  padding: 10px 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.mas-diag-bottom-title {
  font-size: calc(14px * var(--fs-scale));
  font-weight: 800;
}
.mas-diag-bottom-sub {
  font-size: calc(12px * var(--fs-scale));
  color: var(--mas-text-muted);
  white-space: nowrap;
}
.mas-diag-bottom-body {
  padding: 12px 14px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.mas-diag-bottom-empty {
  color: var(--mas-text-muted);
  font-size: calc(14px * var(--fs-scale));
}
.mas-diag-guide-list {
  margin: 0;
  padding-left: 22px;
  line-height: 1.85;
  font-size: calc(16px * var(--fs-scale));
  color: #0f172a;
}
.mas-diag-guide-list--blocks {
  list-style: decimal;
  padding-left: 1.35em;
}
.mas-diag-guide-block {
  margin: 0 0 14px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}
.mas-diag-guide-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.mas-diag-guide-block-title {
  font-size: calc(14px * var(--fs-scale));
  font-weight: 800;
  color: #1e40af;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
  line-height: 1.45;
}
.mas-diag-guide-subul {
  margin: 0;
  padding-left: 1.1em;
  list-style: disc;
}
.mas-diag-guide-subli {
  font-size: calc(14px * var(--fs-scale));
  line-height: 1.65;
  color: #334155;
  margin: 6px 0;
}
.mas-diag-guide-item { margin: 6px 0; }
.mas-diag-progress-list { display: flex; flex-direction: column; gap: 10px; }
.mas-diag-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mas-diag-progress-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.mas-diag-progress-name > span:last-child {
  font-size: calc(13px * var(--fs-scale));
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mas-diag-log-wrap {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--mas-border-light);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.mas-diag-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.mas-diag-log-title {
  font-size: calc(12px * var(--fs-scale));
  font-weight: 800;
  color: #475569;
}
.mas-diag-log-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.mas-diag-log-btn {
  padding: 4px 10px !important;
  font-size: calc(11px * var(--fs-scale)) !important;
}
.mas-diag-log-container {
  max-height: 200px;
  overflow: auto;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: calc(11px * var(--fs-scale));
  line-height: 1.45;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 8px;
  padding: 8px 10px;
  border: 1px solid var(--mas-border-light);
}
.mas-diag-log-line {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 4px 8px;
  margin-bottom: 5px;
  align-items: start;
}
.mas-diag-log-time { color: var(--mas-text-muted); white-space: nowrap; }
.mas-diag-log-tag { color: #2563eb; white-space: nowrap; }
.mas-diag-log-msg { word-break: break-word; color: #0f172a; }
.mas-diag-log--error .mas-diag-log-msg { color: #b91c1c; font-weight: 600; }
.mas-diag-log--success .mas-diag-log-msg { color: #15803d; }
.mas-diag-log-empty {
  flex: 1 1 auto;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 10px;
  font-size: calc(12px * var(--fs-scale));
  line-height: 1.6;
  color: var(--mas-text-muted);
  background: rgba(15, 23, 42, 0.03);
  border-radius: 8px;
  border: 1px dashed var(--mas-border-light);
}

/* Big start button */
.mas-btn-lg { padding: 16px 28px; font-size: calc(15px * var(--fs-scale)); border-radius: 12px; box-shadow: 0 4px 24px rgba(58, 146, 230,0.2); }

/* Report display */
.mas-report-display {
  line-height: 1.9; color: var(--mas-text-dim); font-size: calc(13px * var(--fs-scale));
  padding: 16px; background: rgba(6,16,30,0.5); border-radius: 10px;
  border: 1px solid var(--mas-border-light);
}

/* 诊疗分析 Tab「综合智能诊疗分析报告」：白底阅读区 */
.mas-diag-report-paper {
  --mas-text: #0f172a;
  --mas-text-dim: #334155;
  --mas-text-muted: #64748b;
  --mas-accent-light: #1a5276;
  --mas-accent: #2563eb;
  --mas-border-light: #e2e8f0;
  background: #fff !important;
  border-color: #e2e8f0 !important;
}
.mas-diag-report-paper-body {
  background: #fff;
}
.mas-report-display--paper {
  background: #f8fafc !important;
  color: var(--mas-text-dim) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px;
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.06);
  font-size: calc(14px * var(--fs-scale));
  line-height: 1.85;
}

/* 综合诊疗报告：与 EMR 卡片同系的结构化版面 */
.mas-report-display--paper .mas-comprehensive-report {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mas-report-display--paper .mas-report-doc-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.mas-report-display--paper .mas-report-doc-card--preamble {
  background: #f8fafc;
}
.mas-report-display--paper .mas-report-doc-card-title {
  padding: 12px 14px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.10), transparent 60%);
  border-bottom: 1px solid #e2e8f0;
  font-size: calc(15px * var(--fs-scale));
  font-weight: 900;
  color: #0f172a;
}
.mas-report-display--paper .mas-report-doc-card-body {
  padding: 12px 14px 14px;
  font-size: calc(14px * var(--fs-scale));
  line-height: 1.85;
  color: #334155;
}
.mas-report-display--paper .mas-report-doc-subh {
  margin: 12px 0 6px;
  font-weight: 800;
  color: #0f172a;
  font-size: calc(14px * var(--fs-scale));
}
.mas-report-display--paper .mas-report-doc-subh:first-child {
  margin-top: 0;
}
/* 第八节 诊疗建议：子标题与列表分层，避免「一坨字」 */
.mas-report-display--paper .mas-report-doc-card--plan-viii .mas-report-doc-card-body {
  line-height: 1.82;
}
.mas-report-display--paper .mas-report-doc-subh--plan {
  margin: 18px 0 10px;
  padding: 8px 10px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.07), transparent 72%);
  border-left: 3px solid #2563eb;
  border-radius: 0 8px 8px 0;
  font-size: calc(14px * var(--fs-scale));
}
.mas-report-display--paper .mas-report-doc-subh--plan:first-child {
  margin-top: 4px;
}
.mas-report-display--paper .mas-report-doc-li--plan {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  align-items: flex-start;
}
.mas-report-display--paper .mas-report-doc-li--plan:last-child {
  margin-bottom: 6px;
}
.mas-report-display--paper .mas-report-doc-p--plan {
  margin: 0 0 12px;
  padding: 6px 0 6px 12px;
  border-left: 2px solid #cbd5e1;
  color: #334155;
}
.mas-report-display--paper .mas-report-doc-eye {
  margin: 10px 0 4px;
  font-weight: 800;
  color: #1e40af;
  font-size: calc(14px * var(--fs-scale));
}
.mas-report-display--paper .mas-report-doc-bracket {
  margin: 10px 0 6px;
  font-weight: 800;
  color: #0f172a;
  font-size: calc(14px * var(--fs-scale));
}
.mas-report-display--paper .mas-report-doc-p {
  margin: 6px 0;
  color: #334155;
  word-break: break-word;
}
.mas-report-display--paper .mas-report-doc-p:first-child {
  margin-top: 0;
}
.mas-report-display--paper .mas-report-doc-hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 10px 0;
}
.mas-report-display--paper .mas-report-doc-li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 5px 0;
  padding-left: 2px;
  color: #334155;
  line-height: 1.75;
}
.mas-report-display--paper .mas-report-doc-li--num {
  padding-left: 0;
}
.mas-report-display--paper .mas-report-doc-li-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 0.55em;
  border-radius: 50%;
  background: #2563eb;
  opacity: 0.75;
}
.mas-report-display--paper .mas-report-doc-li-text {
  flex: 1;
  min-width: 0;
}
.mas-report-display--paper .mas-report-doc-kv {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  margin: 5px 0;
  line-height: 1.75;
}
.mas-report-display--paper .mas-report-doc-k {
  font-weight: 700;
  color: #1e40af;
  flex-shrink: 0;
}
.mas-report-display--paper .mas-report-doc-k::after {
  content: '：';
  color: #64748b;
  font-weight: 600;
}
.mas-report-display--paper .mas-report-doc-v {
  color: #334155;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.mas-report-display--paper .mas-report-emphasis {
  font-weight: 800;
  color: #0f172a;
}
.mas-report-display--paper .mas-report-source-tag {
  display: inline-block;
  font-size: calc(11px * var(--fs-scale));
  font-weight: 600;
  padding: 2px 8px;
  margin: 0 2px;
  vertical-align: baseline;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border-radius: 6px;
}
.mas-report-display--paper .mas-report-doc-empty {
  color: #64748b;
}

/* EMR 详情：医生视角分区卡片 */
.mas-emr-detail-page {
  display: block;
}
.mas-emr-detail-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.45);
}
.mas-diag-imaging-detail {
  display: block;
}
.mas-diag-imaging-detail-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.45);
}
.mas-emr-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mas-emr-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}
.mas-emr-card-title {
  padding: 12px 14px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.10), transparent 60%);
  border-bottom: 1px solid #e2e8f0;
  font-size: calc(15px * var(--fs-scale));
  font-weight: 900;
  color: #0f172a;
}
.mas-emr-card-body {
  padding: 12px 14px;
  font-size: calc(15px * var(--fs-scale));
  line-height: 1.9;
  color: #0f172a;
}
.mas-emr-line { margin: 6px 0; white-space: pre-wrap; word-break: break-word; }
.mas-emr-empty { color: #64748b; font-size: calc(14px * var(--fs-scale)); padding: 6px 0; }
.mas-emr-block { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(148, 163, 184, 0.55); }
.mas-emr-block:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.mas-emr-block-title {
  font-size: calc(14px * var(--fs-scale));
  font-weight: 900;
  color: #1e40af;
  margin-bottom: 6px;
}

.mas-emr-eye-table-wrap {
  overflow: auto;
  border: 1px solid rgba(226, 232, 240, 1);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  margin: 8px 0 10px;
}
.mas-emr-eye-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
.mas-emr-eye-table th,
.mas-emr-eye-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 1);
  text-align: left;
  font-size: calc(15px * var(--fs-scale));
  line-height: 1.7;
}
.mas-emr-eye-table thead th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 900;
  z-index: 1;
}
.mas-emr-eye-item { color: #0f172a; font-weight: 800; }
.mas-emr-eye-od,
.mas-emr-eye-os { color: #0f172a; font-weight: 600; }
.mas-emr-basic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}
@media (max-width: 980px) {
  .mas-emr-basic-grid { grid-template-columns: 1fr; }
}
.mas-emr-basic-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px;
  align-items: start;
}
.mas-emr-basic-k {
  color: #334155;
  font-weight: 800;
  font-size: calc(14px * var(--fs-scale));
  letter-spacing: 0.02em;
}
.mas-emr-basic-v {
  color: #0f172a;
  font-weight: 600;
  font-size: calc(15px * var(--fs-scale));
  word-break: break-word;
}
.mas-diag-module-report-title {
  font-size: calc(14px * var(--fs-scale));
  font-weight: 600;
  color: var(--mas-text);
  margin-bottom: 12px;
}
.mas-diag-module-od-os {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.mas-diag-module-eye-col {
  flex: 1;
  min-width: min(260px, 100%);
}
.mas-imaging-report-card {
  background: #fff;
  /* A4 portrait paper ratio: 210mm x 297mm */
  aspect-ratio: 210 / 297;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}
.mas-imaging-report-title {
  padding: 14px 14px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
}
.mas-imaging-report-title .t1 {
  font-weight: 900;
  font-size: calc(16px * var(--fs-scale));
  color: #0f172a;
  letter-spacing: 0.08em;
}
.mas-imaging-report-title .t2 {
  margin-top: 6px;
  font-weight: 900;
  font-size: calc(15px * var(--fs-scale));
  color: #0f172a;
  letter-spacing: 0.06em;
}
.mas-imaging-report-body {
  padding: 12px 14px 14px;
  height: calc(100% - 64px);
  overflow: auto;
  display: flex;
  flex-direction: column;
}
/* 平铺报告列表(诊断报告·入院日期)：卡片按内容高度。旧卡有 aspect-ratio:210/297
   (A4纸型)会强制拉成很高 → 内容短时下方大片留白。这里取消，正文也不再用固定高度。
   注：PDF 导出是后端另渲染的，不受此 DOM 样式影响。 */
.mas-diag-imaging-detail .mas-imaging-report-card { height: auto; aspect-ratio: auto; overflow: visible; }
.mas-diag-imaging-detail .mas-imaging-report-body { height: auto; overflow: visible; }
.mas-imaging-report-figures { flex: 0 0 auto; }
.mas-imaging-report-spacer {
  flex: 1 1 auto;
  min-height: 18%;
}
.mas-imaging-report-textblock { flex: 0 0 auto; }
.mas-imaging-report-section { margin-top: 12px; }
.mas-imaging-report-section:first-child { margin-top: 0; }
.mas-imaging-report-sec-title {
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 6px;
  font-size: calc(16px * var(--fs-scale));
}
.mas-imaging-report-textblock .mas-emr-line {
  font-size: calc(14px * var(--fs-scale));
  line-height: 1.95;
}
.mas-imaging-report-textblock .mas-emr-empty {
  font-size: calc(13px * var(--fs-scale));
}
.mas-imaging-report-disclaimer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #d6dde8;
  font-size: calc(11px * var(--fs-scale));
  line-height: 1.7;
  color: #64748b;
}
.mas-imaging-more{
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid rgba(58, 146, 230,0.35);
  background: rgba(58, 146, 230,0.10);
  color: #1d4ed8;
  font-weight: 800;
  font-size: calc(12px * var(--fs-scale));
  cursor: pointer;
}
.mas-imaging-more:hover{
  background: rgba(58, 146, 230,0.16);
}
.mas-imaging-edit{
  width: 100%;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 10px 12px;
  font-size: calc(14px * var(--fs-scale));
  line-height: 1.9;
  color: #0f172a;
  background: #ffffff;
}
.mas-imaging-edit:focus{
  outline: none;
  border-color: rgba(58, 146, 230,0.55);
  box-shadow: 0 0 0 3px rgba(58, 146, 230,0.12);
}
.mas-imaging-report-imggrid {
  display: grid;
  /* 恒定每排 2 个，超出自动换行到下一排 */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mas-imaging-report-img {
  width: 100%;
  height: 160px;
  /* Show full image (no cropping) */
  object-fit: contain;
  /* Report images: no "frame", smoother scrolling */
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: zoom-in;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: pan-y;
}
.mas-imaging-report-img:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.mas-img-preview-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(2, 6, 23, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.mas-img-preview-dialog {
  position: relative;
  width: min(1100px, 92vw);
  height: min(820px, 90vh);
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.mas-img-preview-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: #0f172a;
  font-size: 22px;
  line-height: 34px;
  cursor: pointer;
}
.mas-img-preview-close:hover { background: rgba(241, 245, 249, 0.95); }
.mas-img-preview-title {
  padding: 12px 54px 10px 16px;
  font-weight: 800;
  font-size: calc(14px * var(--fs-scale));
  color: #0f172a;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #f8fafc, #ffffff);
}
.mas-img-preview-tools{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
}
.mas-img-preview-toolbtn{
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: #0f172a;
  font-weight: 800;
  font-size: calc(12px * var(--fs-scale));
  cursor: pointer;
}
.mas-img-preview-toolbtn:hover{ background: #f1f5f9; }
.mas-img-preview-zooms{ display:flex; gap:8px; }

/* ============ MODEL COMPARISON ============ */
.mas-compare-page {
  min-height: 100%;
  padding: 22px;
  color: #0f172a;
  background:
    radial-gradient(circle at 92% 4%, rgba(37, 99, 235, 0.08), transparent 24rem),
    #f5f7fb;
  overflow: auto;
}
.mas-compare-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(120deg, #102a46 0%, #173a5e 58%, #1d4f78 100%);
  box-shadow: 0 14px 38px rgba(15, 42, 70, 0.18);
}
.mas-compare-kicker {
  margin-bottom: 7px;
  color: #7dd3fc;
  font-size: calc(9px * var(--fs-scale));
  font-weight: 800;
  letter-spacing: 0.18em;
}
.mas-compare-hero h1 { font-size: calc(22px * var(--fs-scale)); line-height: 1.15; letter-spacing: 0.02em; }
.mas-compare-hero p { margin-top: 8px; color: #cbd8e8; font-size: calc(11.5px * var(--fs-scale)); }
.mas-compare-hero-note {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 230px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 13px;
  background: rgba(255,255,255,0.08);
}
.mas-compare-shield { display:grid; place-items:center; width:32px; height:32px; border-radius:10px; background:#22c55e; font-weight:900; }
.mas-compare-hero-note strong, .mas-compare-hero-note small { display:block; }
.mas-compare-hero-note strong { font-size: calc(11px * var(--fs-scale)); }
.mas-compare-hero-note small { margin-top:3px; color:#cbd8e8; font-size: calc(9px * var(--fs-scale)); }

.mas-compare-provider-strip {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin: 14px 0;
}
.mas-compare-provider {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 245px;
  padding: 11px 13px;
  border: 1px solid #dfe5ee;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(15,23,42,0.04);
}
.mas-compare-provider strong, .mas-compare-provider small { display:block; }
.mas-compare-provider strong { font-size: calc(11px * var(--fs-scale)); }
.mas-compare-provider small { margin-top:2px; color:#64748b; font-size: calc(9px * var(--fs-scale)); }
.mas-compare-status-dot { width:9px; height:9px; border-radius:50%; flex:0 0 auto; }
.mas-compare-status-dot.ready { background:#22c55e; box-shadow:0 0 0 4px rgba(34,197,94,0.12); }
.mas-compare-status-dot.offline { background:#ef4444; box-shadow:0 0 0 4px rgba(239,68,68,0.10); }
.mas-compare-provider-state { margin-left:auto; padding:3px 8px; border-radius:999px; font-size: calc(8.5px * var(--fs-scale)); font-weight:800; }
.mas-compare-provider-state.ready { color:#15803d; background:#dcfce7; }
.mas-compare-provider-state.offline { color:#b91c1c; background:#fee2e2; }
.mas-compare-provider-loading { align-self:center; color:#64748b; font-size: calc(10px * var(--fs-scale)); }
.mas-compare-icon-btn { align-self:center; width:36px; height:36px; border:1px solid #dbe3ed; border-radius:10px; color:#315b7d; background:#fff; font-size:20px; cursor:pointer; }
.mas-compare-icon-btn:hover { background:#eef6ff; }
.mas-compare-icon-btn:disabled { opacity:.5; cursor:not-allowed; }

.mas-compare-workspace { display:grid; grid-template-columns: 320px minmax(0, 1fr); gap:14px; align-items:start; }
.mas-compare-controls, .mas-compare-stage { border:1px solid #dfe5ee; border-radius:16px; background:#fff; box-shadow:0 5px 18px rgba(15,23,42,0.05); }
.mas-compare-controls { padding:16px; position:sticky; top:0; }
.mas-compare-stage { min-width:0; overflow:hidden; }
.mas-compare-step { padding:0 0 16px; margin-bottom:16px; border-bottom:1px solid #e9edf3; }
.mas-compare-step.muted { opacity:.55; }
.mas-compare-step-head { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.mas-compare-step-head > span { display:grid; place-items:center; width:27px; height:27px; flex:0 0 auto; border-radius:9px; color:#1d4ed8; background:#e8f0ff; font-size: calc(10px * var(--fs-scale)); font-weight:900; }
.mas-compare-step-head strong, .mas-compare-step-head small { display:block; }
.mas-compare-step-head strong { font-size: calc(11.5px * var(--fs-scale)); }
.mas-compare-step-head small { margin-top:2px; color:#64748b; font-size: calc(8.8px * var(--fs-scale)); }
.mas-compare-field-label { display:block; margin-bottom:6px; color:#475569; font-size: calc(9px * var(--fs-scale)); font-weight:700; }
.mas-compare-search { display:flex; align-items:center; gap:7px; padding:0 10px; margin-bottom:8px; border:1px solid #d7dee9; border-radius:10px; background:#f8fafc; }
.mas-compare-search span { color:#64748b; font-size:18px; }
.mas-compare-search input { min-width:0; width:100%; padding:9px 0; border:0; outline:0; color:#0f172a; background:transparent; font:inherit; font-size: calc(10px * var(--fs-scale)); }
.mas-compare-search:focus-within { border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,0.12); background:#fff; }
.mas-compare-select { width:100%; min-height:40px; padding:8px 32px 8px 10px; border:1px solid #d7dee9; border-radius:10px; color:#0f172a; background:#fff; font:inherit; font-size: calc(10px * var(--fs-scale)); }
.mas-compare-select:focus { outline:0; border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,0.12); }
.mas-compare-patient-card { display:flex; align-items:center; gap:10px; margin-top:10px; padding:10px; border:1px solid #dbeafe; border-radius:11px; background:#f4f8ff; }
.mas-compare-avatar { display:grid; place-items:center; width:36px; height:36px; border-radius:11px; color:#fff; background:linear-gradient(135deg,#2563eb,#0ea5e9); font-weight:900; }
.mas-compare-patient-main { min-width:0; }
.mas-compare-patient-main strong, .mas-compare-patient-main small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mas-compare-patient-main strong { font-size: calc(10.5px * var(--fs-scale)); }
.mas-compare-patient-main small { margin-top:2px; color:#64748b; font-size: calc(8.5px * var(--fs-scale)); }
.mas-compare-current-chip { margin-left:auto; padding:2px 7px; border-radius:999px; color:#1d4ed8; background:#dbeafe; font-size: calc(8px * var(--fs-scale)); font-weight:800; }
.mas-compare-eye-switch { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.mas-compare-eye-switch button { padding:9px 7px; border:1px solid #d7dee9; border-radius:11px; color:#475569; background:#fff; cursor:pointer; }
.mas-compare-eye-switch button strong, .mas-compare-eye-switch button small { display:block; }
.mas-compare-eye-switch button strong { font-size: calc(11px * var(--fs-scale)); }
.mas-compare-eye-switch button small { margin-top:2px; font-size: calc(8px * var(--fs-scale)); }
.mas-compare-eye-switch button.active { border-color:#2563eb; color:#1d4ed8; background:#eff6ff; box-shadow:inset 0 0 0 1px #2563eb; }
.mas-compare-eye-switch button:disabled { opacity:.35; cursor:not-allowed; }
.mas-compare-run { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; min-height:57px; padding:10px 14px; border:0; border-radius:13px; color:#fff; background:linear-gradient(135deg,#2563eb,#1684d8); box-shadow:0 8px 20px rgba(37,99,235,0.24); cursor:pointer; text-align:left; }
.mas-compare-run:hover:not(:disabled) { transform:translateY(-1px); box-shadow:0 11px 26px rgba(37,99,235,0.30); }
.mas-compare-run:disabled { color:#94a3b8; background:#e2e8f0; box-shadow:none; cursor:not-allowed; }
.mas-compare-run strong, .mas-compare-run small { display:block; }
.mas-compare-run strong { font-size: calc(11px * var(--fs-scale)); }
.mas-compare-run small { margin-top:2px; opacity:.85; font-size: calc(8.5px * var(--fs-scale)); }
.mas-compare-run-icon { font-size:24px; line-height:1; }
.mas-compare-privacy { margin:9px 4px 0; color:#64748b; font-size: calc(8px * var(--fs-scale)); line-height:1.55; }
.mas-compare-spinner { width:18px; height:18px; border:2px solid rgba(255,255,255,.35); border-top-color:#fff; border-radius:50%; animation:mas-compare-spin .8s linear infinite; }
.mas-compare-spinner.dark { border-color:#cbd5e1; border-top-color:#2563eb; }
@keyframes mas-compare-spin { to { transform:rotate(360deg); } }

.mas-compare-image-toolbar { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:14px 16px; border-bottom:1px solid #e8edf3; }
.mas-compare-image-toolbar strong { font-size: calc(11.5px * var(--fs-scale)); }
.mas-compare-image-toolbar span { margin-left:9px; color:#64748b; font-size: calc(9px * var(--fs-scale)); }
.mas-compare-image-toolbar button, .mas-compare-report-meta button, .mas-compare-error button { padding:6px 10px; border:1px solid #bfdbfe; border-radius:9px; color:#1d4ed8; background:#eff6ff; font-weight:700; cursor:pointer; }
.mas-compare-image-toolbar button:disabled, .mas-compare-report-meta button:disabled { opacity:.45; cursor:not-allowed; }
.mas-compare-image-grid { display:grid; grid-template-columns:repeat(4,minmax(120px,1fr)); gap:11px; padding:14px 16px; background:#f8fafc; }
.mas-compare-image-card { position:relative; min-width:0; padding:0; overflow:hidden; border:2px solid transparent; border-radius:12px; background:#fff; box-shadow:0 2px 8px rgba(15,23,42,.07); cursor:pointer; text-align:left; }
.mas-compare-image-card.selected { border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.12); }
.mas-compare-image-card img { display:block; width:100%; height:132px; object-fit:contain; background:#071522; }
.mas-compare-check { position:absolute; top:7px; left:7px; display:grid; place-items:center; width:22px; height:22px; border:1px solid rgba(255,255,255,.8); border-radius:7px; color:#fff; background:rgba(15,23,42,.62); font-weight:900; }
.mas-compare-image-card.selected .mas-compare-check { border-color:#2563eb; background:#2563eb; }
.mas-compare-zoom { position:absolute; top:7px; right:7px; display:grid; place-items:center; width:24px; height:24px; border-radius:7px; color:#fff; background:rgba(15,23,42,.62); font-size:17px; }
.mas-compare-image-meta { display:flex; align-items:center; justify-content:space-between; gap:7px; padding:8px 9px; }
.mas-compare-image-meta strong { min-width:0; overflow:hidden; color:#334155; font-size: calc(8.5px * var(--fs-scale)); text-overflow:ellipsis; white-space:nowrap; }
.mas-compare-image-meta small { flex:0 0 auto; color:#94a3b8; font-size: calc(7.5px * var(--fs-scale)); }
.mas-compare-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:205px; padding:24px; color:#64748b; background:#f8fafc; text-align:center; }
.mas-compare-empty strong { margin-top:8px; color:#334155; font-size: calc(11px * var(--fs-scale)); }
.mas-compare-empty p { margin-top:5px; font-size: calc(9px * var(--fs-scale)); }
.mas-compare-empty-icon { display:grid; place-items:center; width:45px; height:45px; border:1px dashed #93a9c2; border-radius:14px; color:#547391; font-size:25px; }

.mas-compare-results { border-top:1px solid #dfe5ee; min-height:360px; }
.mas-compare-tabs { display:flex; gap:4px; padding:10px 14px 0; border-bottom:1px solid #e5eaf1; }
.mas-compare-tabs button { display:flex; align-items:center; gap:7px; padding:9px 14px; border:0; border-bottom:2px solid transparent; color:#64748b; background:transparent; font:inherit; font-size: calc(10px * var(--fs-scale)); font-weight:700; cursor:pointer; }
.mas-compare-tabs button.active { border-bottom-color:#2563eb; color:#1d4ed8; }
.mas-compare-tab-state { width:7px; height:7px; border-radius:50%; }
.mas-compare-tab-state.succeeded { background:#22c55e; }
.mas-compare-tab-state.failed { background:#ef4444; }
.mas-compare-result-empty, .mas-compare-running, .mas-compare-error { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:300px; padding:28px; text-align:center; }
.mas-compare-result-empty strong, .mas-compare-running strong, .mas-compare-error strong { color:#334155; font-size: calc(12px * var(--fs-scale)); }
.mas-compare-result-empty p, .mas-compare-running p, .mas-compare-error p { max-width:520px; margin-top:7px; color:#64748b; font-size: calc(9.5px * var(--fs-scale)); line-height:1.7; }
.mas-compare-orbit { display:flex; gap:12px; margin-bottom:15px; }
.mas-compare-orbit span { display:grid; place-items:center; width:44px; height:44px; border-radius:14px; color:#fff; background:#2563eb; font-weight:900; animation:mas-compare-pulse 1.6s ease-in-out infinite; }
.mas-compare-orbit span:last-child { background:#0f766e; animation-delay:.25s; }
@keyframes mas-compare-pulse { 50% { transform:translateY(-4px); box-shadow:0 10px 24px rgba(37,99,235,.25); } }
.mas-compare-time { margin-top:14px; color:#1d4ed8; font-size: calc(18px * var(--fs-scale)); font-weight:800; font-variant-numeric:tabular-nums; }
.mas-compare-error strong { color:#b91c1c; }
.mas-compare-error button { margin-top:14px; }
.mas-compare-columns { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:14px; background:#f8fafc; }
.mas-compare-report-card { min-width:0; overflow:hidden; border:1px solid #dce3ec; border-radius:13px; background:#fff; }
.mas-compare-report-card.single { margin:14px; }
.mas-compare-report-card > header { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:13px 15px; border-bottom:1px solid #e7ecf2; }
.mas-compare-report-card header strong, .mas-compare-report-card header small { display:block; }
.mas-compare-report-card header strong { font-size: calc(12px * var(--fs-scale)); }
.mas-compare-report-card header small { margin-top:2px; color:#64748b; font-size: calc(8px * var(--fs-scale)); }
.mas-compare-result-status { padding:3px 8px; border-radius:999px; font-size: calc(8px * var(--fs-scale)); font-weight:800; }
.mas-compare-result-status.succeeded { color:#15803d; background:#dcfce7; }
.mas-compare-result-status.failed { color:#b91c1c; background:#fee2e2; }
.mas-compare-report-meta { display:flex; align-items:center; justify-content:space-between; padding:8px 15px; color:#64748b; background:#f8fafc; font-size: calc(8.5px * var(--fs-scale)); }
.mas-compare-report-meta button { padding:4px 8px; font-size: calc(8px * var(--fs-scale)); }
.mas-compare-model-selection { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:10px 15px 0; padding:9px 10px; border:1px solid #d9e3ee; border-radius:10px; color:#486177; background:#f8fafc; font-size:calc(7.8px * var(--fs-scale)); }
.mas-compare-model-selection span { padding:3px 7px; border-radius:999px; background:#e8eef5; font-weight:700; }
.mas-compare-model-selection .mas-compare-model-selection-primary { color:#1d4ed8; background:#dbeafe; }
.mas-compare-model-selection.ophagent .mas-compare-model-selection-primary { color:#0f766e; background:#ccfbf1; }
.mas-compare-model-selection small { flex-basis:100%; color:#64748b; line-height:1.55; }
.mas-model-request-inputs { margin:10px 15px 0; border:1px solid #cbdbea; border-radius:10px; overflow:hidden; color:#24445f; background:#f8fbfe; }
.mas-model-request-inputs summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 11px; background:#eef5fb; cursor:pointer; list-style:none; user-select:none; }
.mas-model-request-inputs summary::-webkit-details-marker { display:none; }
.mas-model-request-inputs summary span { min-width:0; }
.mas-model-request-inputs summary strong, .mas-model-request-inputs summary small { display:block; }
.mas-model-request-inputs summary strong { font-size:calc(8.8px * var(--fs-scale)); }
.mas-model-request-inputs summary small { margin-top:2px; color:#6b8195; font-size:calc(7.5px * var(--fs-scale)); font-weight:500; }
.mas-model-request-inputs summary i { flex:0 0 auto; font-style:normal; font-size:calc(11px * var(--fs-scale)); transition:transform .18s ease; }
.mas-model-request-inputs[open] summary i { transform:rotate(180deg); }
.mas-model-request-inputs pre { max-height:340px; margin:0; padding:12px; overflow:auto; color:#243b53; background:#fbfdff; font:calc(7.8px * var(--fs-scale))/1.6 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; white-space:pre-wrap; overflow-wrap:anywhere; }
.mas-compare-report-body { max-height:620px; overflow:auto; padding:15px; }
.mas-compare-report-body section + section { margin-top:17px; padding-top:14px; border-top:1px solid #e8edf3; }
.mas-compare-report-body h3 { margin-bottom:8px; color:#315b7d; font-size: calc(10px * var(--fs-scale)); }
.mas-compare-report-body pre { margin:0; color:#26384d; font:inherit; font-size: calc(9.5px * var(--fs-scale)); line-height:1.85; white-space:pre-wrap; overflow-wrap:anywhere; }
.mas-compare-section-hint { margin:-3px 0 9px; color:#7b8ca2; font-size:calc(8px * var(--fs-scale)); line-height:1.55; }
.mas-compare-evidence-disclosure { margin-top:17px; padding-top:14px; border-top:1px solid #e8edf3; }
.mas-compare-evidence-disclosure summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 10px; border:1px solid #dce6f0; border-radius:10px; color:#315b7d; background:#f8fafc; cursor:pointer; list-style:none; }
.mas-compare-evidence-disclosure summary::-webkit-details-marker { display:none; }
.mas-compare-evidence-disclosure summary > span:first-child { min-width:0; }
.mas-compare-evidence-disclosure summary strong, .mas-compare-evidence-disclosure summary small { display:block; }
.mas-compare-evidence-disclosure summary strong { font-size:calc(10px * var(--fs-scale)); }
.mas-compare-evidence-disclosure summary small { margin-top:3px; color:#7b8ca2; font-size:calc(7.8px * var(--fs-scale)); font-weight:500; }
.mas-compare-disclosure-state { display:flex; flex:0 0 auto; align-items:center; gap:7px; color:#64748b; }
.mas-compare-disclosure-state b { padding:3px 7px; border-radius:999px; color:#315b7d; background:#e7f0f8; font-size:calc(7.6px * var(--fs-scale)); }
.mas-compare-disclosure-state i { font-style:normal; font-size:calc(11px * var(--fs-scale)); transition:transform .18s ease; }
.mas-compare-evidence-disclosure[open] .mas-compare-disclosure-state i { transform:rotate(180deg); }
.mas-compare-evidence-content { padding-top:10px; }
.mas-compare-evidence-list { display:grid; gap:9px; }
.mas-compare-evidence-list article, .mas-compare-artifact-grid article { position:relative; min-width:0; padding:10px; border:1px solid #e1e8f0; border-radius:10px; background:#f8fafc; }
.mas-compare-evidence-list strong, .mas-compare-artifact-grid strong { display:block; margin-bottom:6px; color:#334155; font-size:calc(8.5px * var(--fs-scale)); }
.mas-compare-evidence-list pre, .mas-compare-artifact-grid pre { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:calc(8px * var(--fs-scale)); line-height:1.6; }
.mas-compare-structured-empty { padding:12px; border:1px dashed #cbd5e1; border-radius:10px; color:#7b8ca2; background:#f8fafc; font-size:calc(8.5px * var(--fs-scale)); text-align:center; }
.mas-compare-artifact-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.mas-compare-artifact-grid a { display:flex; flex-direction:column; gap:7px; color:#1d4ed8; font-size:calc(8px * var(--fs-scale)); font-weight:700; text-decoration:none; }
.mas-compare-artifact-grid img { width:100%; height:150px; border-radius:7px; object-fit:contain; background:#071522; }
.mas-compare-artifact-preview { position:relative; min-height:112px; }
.mas-result-gallery-progress { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:12px; margin-bottom:12px; border:1px solid #bfdbfe; border-radius:10px; background:#eff6ff; color:#1e3a5f; }
.mas-result-gallery-progress > div { flex:1 1 220px; }
.mas-result-gallery-progress strong, .mas-result-gallery-progress span { display:block; font-size:14px; line-height:1.6; }
.mas-result-gallery-progress progress { width:100%; height:7px; accent-color:#2563eb; }
.mas-result-gallery-progress small { width:100%; font-size:12px; line-height:1.6; color:#475569; }
.mas-result-gallery button { min-height:36px; padding:6px 10px; border:1px solid #94a3b8; border-radius:7px; background:white; color:#1d4ed8; font-size:13px; cursor:pointer; }
.mas-result-gallery button:disabled { opacity:.6; cursor:wait; }
.mas-result-gallery button:focus-visible, .mas-result-gallery a:focus-visible { outline:3px solid #2563eb; outline-offset:3px; }
.mas-result-gallery-error { margin:8px 0; padding:10px; border-radius:8px; background:#fff1f2; color:#9f1239; font-size:13px; }
.mas-result-image-frame { position:relative; height:180px; margin-bottom:8px; border-radius:8px; overflow:hidden; background:#eef3f8; }
.mas-result-image-frame img { height:180px; }
.mas-result-image-message { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:30px 10px 10px; background:#eef3f8; color:#475569; text-align:center; font-size:13px; overflow:auto; }
.mas-result-image-message strong { font-size:14px; }
.mas-result-image-message small { font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.mas-result-image-message.error { background:#fff1f2; color:#9f1239; }
.mas-result-image-caption { display:block; color:#475569; font-size:13px; overflow-wrap:anywhere; }
.mas-result-image-card > a { font-size:13px; overflow-wrap:anywhere; }
@media (max-width:600px) { .mas-result-gallery .mas-compare-artifact-grid { grid-template-columns:1fr; } .mas-result-gallery-progress button { min-height:44px; } }
.mas-compare-artifact-duration { position:absolute; z-index:2; top:7px; right:7px; padding:4px 7px; border-radius:999px; color:#fff; background:rgba(15,23,42,.82); font-size:calc(7.5px * var(--fs-scale)); font-weight:800; box-shadow:0 2px 7px rgba(15,23,42,.2); }
.mas-compare-artifact-text-duration { display:block; margin:2px 0 7px; color:#64748b; font-size:calc(7.8px * var(--fs-scale)); font-weight:700; }
.mas-compare-artifact-state { min-height:112px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:12px; border-radius:7px; color:#64748b; background:#eef3f8; font-size:calc(8px * var(--fs-scale)); text-align:center; }
.mas-compare-artifact-state.quiet { background:#f5f8fb; }
.mas-compare-artifact-state small { max-width:230px; color:#8291a5; font-size:calc(7.2px * var(--fs-scale)); line-height:1.45; }
.mas-compare-artifact-state.error { color:#9f1239; background:#fff1f2; }
.mas-compare-artifact-state.error strong { margin:0; color:#9f1239; }
.mas-compare-artifact-state button { padding:5px 10px; border:1px solid #cbd5e1; border-radius:7px; color:#334155; background:#fff; cursor:pointer; }
.mas-compare-model-error { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:230px; padding:24px; text-align:center; }
.mas-compare-model-error strong { color:#b91c1c; font-size: calc(10.5px * var(--fs-scale)); }
.mas-compare-model-error p { margin-top:7px; color:#64748b; font-size: calc(9px * var(--fs-scale)); line-height:1.6; }
.mas-compare-model-error button { display:inline-flex; align-items:center; justify-content:center; gap:7px; margin-top:14px; min-width:128px; padding:8px 14px; border:1px solid #fecaca; border-radius:9px; color:#b91c1c; background:#fff; font-size:calc(8.5px * var(--fs-scale)); font-weight:800; cursor:pointer; }
.mas-compare-model-error button:hover:not(:disabled) { border-color:#f87171; background:#fff1f2; }
.mas-compare-model-error button:disabled { cursor:not-allowed; opacity:.65; }
.mas-model-failure-details { width:100%; max-width:720px; margin-top:14px; border:1px solid #fecaca; border-radius:10px; overflow:hidden; color:#7f1d1d; background:#fff7f7; text-align:left; }
.mas-model-failure-details summary { padding:10px 12px; color:#991b1b; background:#fff1f2; font-size:calc(8.5px * var(--fs-scale)); font-weight:800; cursor:pointer; user-select:none; }
.mas-model-failure-details pre { max-height:310px; margin:0; padding:12px; overflow:auto; color:#3f1d1d; background:#fffafa; font:calc(7.8px * var(--fs-scale))/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; white-space:pre-wrap; overflow-wrap:anywhere; }
.prompt-lab-failure-details { max-width:none; margin:8px 0 12px; }
.prompt-lab-failure-details summary { font-size:12px; }
.prompt-lab-failure-details pre { font-size:12px; }

.mas-compare-preview { position:fixed; inset:0; z-index:10000; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; padding:28px; background:rgba(2,8,18,.82); }
.mas-compare-preview img { max-width:min(1160px,92vw); max-height:84vh; object-fit:contain; border-radius:14px; box-shadow:0 24px 70px rgba(0,0,0,.42); }
.mas-compare-preview > button { position:absolute; top:18px; right:24px; width:42px; height:42px; border:1px solid rgba(255,255,255,.3); border-radius:12px; color:#fff; background:rgba(255,255,255,.12); font-size:27px; cursor:pointer; }
.mas-compare-preview > span { color:#e2e8f0; font-size: calc(9px * var(--fs-scale)); }

.mas-compare-coverage { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.mas-compare-coverage-cell { position:relative; display:grid; grid-template-columns:1fr auto; gap:2px 6px; padding:8px 9px; border:1px solid #e2e8f0; border-radius:10px; color:#94a3b8; background:#f8fafc; }
.mas-compare-coverage-cell.available { border-color:#bfdbfe; color:#1e3a5f; background:#eff6ff; }
.mas-compare-coverage-cell strong { font-size:calc(9px * var(--fs-scale)); }
.mas-compare-coverage-cell span { font-size:calc(8px * var(--fs-scale)); font-weight:800; }
.mas-compare-coverage-cell small { grid-column:1 / -1; font-size:calc(7.8px * var(--fs-scale)); color:#94a3b8; }
.mas-compare-coverage-cell.available small { color:#3b82f6; }
.mas-compare-coverage-summary { display:flex; justify-content:space-between; margin-top:9px; color:#64748b; font-size:calc(8.5px * var(--fs-scale)); font-weight:700; }
.mas-compare-coverage-loading { display:flex; align-items:center; gap:9px; min-height:95px; color:#64748b; font-size:calc(9px * var(--fs-scale)); }

.mas-compare-batch-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; border-bottom:1px solid #e5eaf1; }
.mas-compare-batch-toolbar strong, .mas-compare-batch-toolbar span { display:block; }
.mas-compare-batch-toolbar strong { color:#1e293b; font-size:calc(11.5px * var(--fs-scale)); }
.mas-compare-batch-toolbar span { margin-top:3px; color:#64748b; font-size:calc(8.5px * var(--fs-scale)); }
.mas-compare-history-state { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:12px 16px; padding:11px 13px; border:1px solid #cce6dc; border-radius:10px; color:#246451; background:#f2faf6; }
.mas-compare-history-state > div { min-width:0; }
.mas-compare-history-state strong { display:block; font-size:calc(9px * var(--fs-scale)); line-height:1.6; }
.mas-compare-history-state span { display:block; margin-top:3px; font-size:calc(8px * var(--fs-scale)); line-height:1.7; overflow-wrap:anywhere; }
.mas-compare-history-state.warning { color:#85541b; border-color:#f2dbad; background:#fffbef; }
.mas-compare-history-state button { flex-shrink:0; padding:7px 10px; border:1px solid currentColor; border-radius:7px; background:transparent; color:inherit; cursor:pointer; font:inherit; font-size:calc(8px * var(--fs-scale)); }
.pl-job-message { margin:10px 0; padding:10px 12px; border:1px solid #4b768c; border-radius:8px; color:var(--mas-text); background:var(--mas-bg-card, #142c42); font-size:13px; line-height:1.7; overflow-wrap:anywhere; }
.prompt-lab-run-status.running, .prompt-lab-status-running { color:#38bdf8; }
.pl-running-panel { padding:16px; margin:12px 0; border:1px solid #3988b3; border-radius:12px; background:#102f47; color:#e0f2fe; }
.pl-running-heading { display:flex; flex-wrap:wrap; align-items:center; gap:10px; font-size:15px; }
.pl-running-heading .mas-compare-spinner { width:18px; height:18px; border-color:#386b8b; border-top-color:#7dd3fc; flex-shrink:0; }
.pl-running-heading time { margin-left:auto; font-size:13px; font-variant-numeric:tabular-nums; color:#bae6fd; }
.pl-running-stage { margin:14px 0 8px; font-size:14px; line-height:1.7; overflow-wrap:anywhere; }
.pl-running-panel small, .pl-running-help { font-size:12px; line-height:1.7; color:#b8cfdf; }
.pl-running-help { margin:10px 0 0; }
.pl-progress-log { margin:12px 0; padding:12px; border:1px solid var(--mas-border, #40576a); border-radius:10px; font-size:13px; }
.pl-progress-log summary { cursor:pointer; color:var(--mas-text); }
.pl-progress-log ol { list-style:none; margin:12px 0 0; padding:0; max-height:260px; overflow-y:auto; }
.pl-progress-log li { display:flex; align-items:baseline; gap:12px; padding:8px 0; line-height:1.6; border-top:1px solid #334b60; }
.pl-progress-log time { flex-shrink:0; color:#9fb8ce; font-variant-numeric:tabular-nums; }
.pl-progress-log li span { min-width:0; overflow-wrap:anywhere; }
@media (prefers-reduced-motion: reduce) { .pl-running-panel .mas-compare-spinner { animation:none; } }
.mas-compare-live-feed ol { max-height:280px; overflow-y:auto; }
.mas-compare-export-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; }
.mas-compare-export-actions button { padding:7px 10px; border:1px solid #bfdbfe; border-radius:9px; color:#1d4ed8; background:#eff6ff; font:inherit; font-size:calc(8.5px * var(--fs-scale)); font-weight:800; cursor:pointer; }
.mas-compare-export-actions button:disabled { opacity:.45; cursor:not-allowed; }

.mas-compare-unit-tabs { display:grid; grid-template-columns:repeat(4,minmax(120px,1fr)); gap:8px; padding:12px 14px; border-bottom:1px solid #e5eaf1; background:#f8fafc; }
.mas-compare-unit-tabs button { position:relative; min-width:0; padding:9px 25px 9px 10px; border:1px solid #dce3ec; border-radius:10px; color:#475569; background:#fff; font:inherit; text-align:left; cursor:pointer; }
.mas-compare-unit-tabs button:hover { border-color:#93c5fd; }
.mas-compare-unit-tabs button.active { border-color:#2563eb; color:#1d4ed8; background:#eff6ff; box-shadow:0 0 0 2px rgba(37,99,235,.10); }
.mas-compare-unit-tabs button.empty { color:#94a3b8; background:#f8fafc; }
.mas-compare-unit-tabs span, .mas-compare-unit-tabs small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mas-compare-unit-tabs span { font-size:calc(8.5px * var(--fs-scale)); font-weight:800; }
.mas-compare-unit-tabs small { margin-top:2px; font-size:calc(7.5px * var(--fs-scale)); }
.mas-compare-unit-tabs i { position:absolute; top:50%; right:9px; width:8px; height:8px; border-radius:50%; background:#cbd5e1; transform:translateY(-50%); }
.mas-compare-unit-tabs i.ready { background:#3b82f6; }
.mas-compare-unit-tabs i.running { background:#f59e0b; box-shadow:0 0 0 4px rgba(245,158,11,.12); animation:mas-compare-pulse 1.2s ease-in-out infinite; }
.mas-compare-unit-tabs i.succeeded { background:#22c55e; }
.mas-compare-unit-tabs i.partial { background:#f59e0b; }
.mas-compare-unit-tabs i.failed { background:#ef4444; }
.mas-compare-unit-tabs i.no_images { background:#cbd5e1; }
.mas-compare-prompts { padding:16px; border-bottom:1px solid #dce3ec; background:#fff; color:#0f172a; font-size:14px; }
.mas-compare-prompts > header { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; }
.mas-compare-prompts h2 { margin:0; font-size:17px; }
.mas-compare-prompts p { margin:6px 0; color:#64748b; font-size:13px; line-height:1.6; }
.mas-compare-prompt-controls { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.mas-compare-prompts select { width:100%; max-width:100%; min-width:0; min-height:40px; padding:8px; border:1px solid #cbd5e1; border-radius:8px; color:#0f172a; background:#fff; font:inherit; }
.mas-compare-prompt-controls label { display:flex; align-items:center; gap:8px; }
.mas-compare-prompt-controls select { width:150px; }
.mas-compare-prompt-controls button { min-height:40px; border:1px solid #bfdbfe; border-radius:8px; padding:8px 12px; color:#1d4ed8; background:#eff6ff; font:inherit; cursor:pointer; }
.mas-compare-prompts :disabled { opacity:.55; cursor:default; }
.mas-compare-prompts :focus-visible { outline:3px solid #60a5fa; outline-offset:2px; }
.mas-compare-prompt-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:12px; }
.mas-compare-prompt-grid > article { min-width:0; padding:14px; border:1px solid #dce3ec; border-radius:10px; background:#f8fafc; }
.mas-compare-prompt-card-head { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.mas-compare-prompt-card-head strong { font-size:16px; }
.mas-compare-prompt-card-head span { color:#475569; font-size:12px; background:#eaf1f9; border-radius:5px; padding:3px 7px; }
.mas-compare-prompt-grid label { display:block; margin:8px 0 4px; font-size:13px; color:#475569; }
.mas-compare-prompts .mas-compare-prompt-selected { color:#334155; overflow-wrap:anywhere; }
.mas-compare-prompt-grid summary, .mas-compare-prompt-snapshot summary { padding:8px 0; color:#1d4ed8; cursor:pointer; font-size:14px; font-weight:600; overflow-wrap:anywhere; }
.mas-compare-prompt-grid pre, .mas-compare-prompt-snapshot pre { max-height:360px; overflow:auto; margin:4px 0; padding:12px; border:1px solid #dce3ec; border-radius:8px; color:#334155; background:#fff; white-space:pre-wrap; overflow-wrap:anywhere; font:13px/1.7 system-ui,sans-serif; }
.mas-compare-prompt-error { margin-top:12px; padding:10px; border:1px solid #fecaca; border-radius:8px; color:#b91c1c; background:#fff1f2; overflow-wrap:anywhere; }
.mas-compare-prompt-retry { margin-top:8px; min-height:40px; padding:8px 12px; border:1px solid #bfdbfe; border-radius:8px; color:#1d4ed8; background:#eff6ff; font:14px system-ui,sans-serif; cursor:pointer; }
.mas-compare-prompt-snapshot { padding:8px 16px; border-bottom:1px solid #dce3ec; background:#f8fafc; }
.mas-compare-prompt-snapshot p { margin:4px 0 8px; font-size:13px; color:#64748b; line-height:1.6; }
@media (max-width:800px) { .mas-compare-prompt-grid { grid-template-columns:1fr; } }
.mas-compare-unit-tabs .mas-compare-original-entry { display:inline; color:#2563eb; font-size:inherit; font-weight:600; }
.mas-compare-original-dialog {
  --original-border:#dce3ec; --original-muted:#64748b; --original-accent:#2563eb;
  width:min(1120px,calc(100vw - 32px)); height:min(880px,calc(100dvh - 32px)); max-width:none; max-height:none;
  margin:auto; padding:0; border:1px solid var(--original-border); border-radius:16px;
  background:#fff; color:#0f172a; font:14px/1.5 system-ui,sans-serif; box-shadow:0 24px 80px #02061766;
}
.mas-compare-original-dialog[open] { display:flex; flex-direction:column; }
.mas-compare-original-dialog::backdrop { background:#020617b8; }
.mas-compare-original-dialog button, .mas-compare-original-dialog a { touch-action:manipulation; }
.mas-compare-original-dialog button { min-height:40px; padding:7px 12px; border:1px solid var(--original-border); border-radius:8px; background:#fff; color:#334155; font:inherit; cursor:pointer; }
.mas-compare-original-dialog button:hover:not(:disabled) { background:#eff6ff; border-color:#93c5fd; }
.mas-compare-original-dialog button:disabled { opacity:.45; cursor:default; }
.mas-compare-original-dialog button:focus-visible, .mas-compare-original-dialog a:focus-visible { outline:3px solid #60a5fa; outline-offset:2px; }
.mas-compare-original-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 20px; border-bottom:1px solid var(--original-border); }
.mas-compare-original-head h2 { margin:0; font-size:19px; font-weight:750; }
.mas-compare-original-head p { margin:4px 0 0; color:var(--original-muted); font-size:13px; }
.mas-compare-original-head .mas-compare-original-close { flex-shrink:0; width:42px; height:42px; padding:0; font-size:26px; }
.mas-compare-original-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; padding:10px 20px; }
.mas-compare-original-navigation, .mas-compare-original-zoom { display:flex; align-items:center; gap:6px; }
.mas-compare-original-navigation strong { min-width:80px; text-align:center; font-size:14px; }
.mas-compare-original-zoom span { min-width:40px; color:var(--original-muted); text-align:right; }
.mas-compare-original-zoom button[aria-pressed="true"], .mas-compare-original-list button[aria-current="true"] { background:#eff6ff; border-color:var(--original-accent); color:#1d4ed8; }
.mas-compare-original-stage { position:relative; flex:1; min-height:140px; display:flex; align-items:center; justify-content:center; overflow:auto; background:#071522; overscroll-behavior:contain; }
.mas-compare-original-stage img { display:block; flex-shrink:0; max-width:100%; max-height:100%; object-fit:contain; }
.mas-compare-original-stage.is-zoomed { display:block; }
.mas-compare-original-stage.is-zoomed img { max-width:none; max-height:none; margin:auto; }
.mas-compare-original-state { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding:24px; color:#cbd5e1; text-align:center; }
.mas-compare-original-state.error { color:#fecaca; }
.mas-compare-original-state.error span { max-width:580px; overflow-wrap:anywhere; }
.mas-compare-original-footer { padding:12px 20px; border-top:1px solid var(--original-border); }
.mas-compare-original-file { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.mas-compare-original-file > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mas-compare-original-file a { flex-shrink:0; color:#1d4ed8; text-decoration:underline; text-underline-offset:3px; padding:5px 0; }
.mas-compare-original-list { display:flex; gap:6px; overflow-x:auto; padding:10px 2px 4px; }
.mas-compare-original-list button { flex-shrink:0; min-width:40px; }
.mas-compare-original-footer > small { display:block; margin-top:8px; color:var(--original-muted); font-size:12px; }
@media (max-width:600px) {
  .mas-compare-original-dialog { width:calc(100vw - 16px); height:calc(100dvh - 16px); border-radius:12px; }
  .mas-compare-original-head, .mas-compare-original-toolbar, .mas-compare-original-footer { padding:10px 12px; }
  .mas-compare-original-head h2 { font-size:17px; }
  .mas-compare-original-toolbar { justify-content:center; gap:8px; }
  .mas-compare-original-dialog button { min-height:44px; }
  .mas-compare-original-file { align-items:flex-start; gap:6px; flex-direction:column; }
}
.mas-compare-live { margin:14px; overflow:hidden; border:1px solid #cbdcf3; border-radius:15px; background:linear-gradient(180deg,#f8fbff 0%,#f4f8fd 100%); box-shadow:0 10px 28px rgba(30,64,175,.08); }
.mas-compare-live.complete { border-color:#cce7d8; background:linear-gradient(180deg,#fbfefc 0%,#f4fbf7 100%); }
.mas-compare-live-head { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:14px; padding:14px 15px 11px; }
.mas-compare-live-title { display:flex; align-items:center; gap:10px; min-width:0; }
.mas-compare-live-title strong, .mas-compare-live-title small { display:block; }
.mas-compare-live-title strong { color:#172033; font-size:calc(11.5px * var(--fs-scale)); }
.mas-compare-live-title small { margin-top:3px; color:#64748b; font-size:calc(8.3px * var(--fs-scale)); }
.mas-compare-live-beacon { position:relative; width:10px; height:10px; flex:0 0 auto; border-radius:50%; background:#22c55e; box-shadow:0 0 0 5px rgba(34,197,94,.12); }
.mas-compare-live-beacon.active { background:#2563eb; box-shadow:0 0 0 5px rgba(37,99,235,.12); }
.mas-compare-live-beacon.active::after { content:""; position:absolute; inset:-5px; border:1px solid rgba(37,99,235,.48); border-radius:50%; animation:mas-live-ring 1.6s ease-out infinite; }
@keyframes mas-live-ring { 70%,100% { opacity:0; transform:scale(1.75); } }
.mas-compare-live-clock { text-align:right; font-variant-numeric:tabular-nums; }
.mas-compare-live-clock strong, .mas-compare-live-clock span { display:block; }
.mas-compare-live-clock strong { color:#1d4ed8; font-size:calc(14px * var(--fs-scale)); line-height:1; }
.mas-compare-live.complete .mas-compare-live-clock strong { color:#15803d; }
.mas-compare-live-clock span { margin-top:4px; color:#64748b; font-size:calc(7.8px * var(--fs-scale)); font-weight:700; }
.mas-compare-live-close { display:grid; place-items:center; width:28px; height:28px; padding:0; border:1px solid #d7e2ef; border-radius:9px; color:#64748b; background:#fff; font-size:18px; cursor:pointer; }
.mas-compare-live-close:hover { border-color:#94a3b8; color:#334155; }
.mas-compare-live-progress { height:5px; margin:0 15px; overflow:hidden; border-radius:999px; background:#dfe8f3; }
.mas-compare-live-progress span { display:block; width:0; height:100%; border-radius:inherit; background:linear-gradient(90deg,#2563eb,#0ea5e9); transition:width .35s ease; }
.mas-compare-live.complete .mas-compare-live-progress span { background:linear-gradient(90deg,#16a34a,#22c55e); }
.mas-compare-live-models { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:12px 15px; }
.mas-compare-live-model { display:flex; align-items:center; gap:11px; min-width:0; padding:12px; border:1px solid #dbe5f1; border-radius:12px; background:rgba(255,255,255,.88); }
.mas-compare-live-model.running { border-color:#93c5fd; box-shadow:inset 0 0 0 1px rgba(59,130,246,.10); }
.mas-compare-live-model.succeeded { border-color:#bbf7d0; }
.mas-compare-live-model.partial { border-color:#fde68a; }
.mas-compare-live-model-mark { display:grid; place-items:center; width:38px; height:38px; flex:0 0 auto; border-radius:11px; color:#fff; background:linear-gradient(135deg,#2563eb,#60a5fa); font-size:calc(12px * var(--fs-scale)); font-weight:900; }
.mas-compare-live-model:nth-child(2) .mas-compare-live-model-mark { background:linear-gradient(135deg,#0f766e,#2dd4bf); }
.mas-compare-live-model-main { min-width:0; flex:1; }
.mas-compare-live-model-main > div { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.mas-compare-live-model-main strong { color:#1e293b; font-size:calc(10px * var(--fs-scale)); }
.mas-compare-live-model-main p { margin:4px 0 0; overflow:hidden; color:#475569; font-size:calc(8.3px * var(--fs-scale)); font-weight:650; text-overflow:ellipsis; white-space:nowrap; }
.mas-compare-live-model-main small { display:block; margin-top:4px; color:#7b8ca2; font-size:calc(7.6px * var(--fs-scale)); }
.mas-compare-live-state { flex:0 0 auto; padding:3px 7px; border-radius:999px; color:#64748b; background:#e2e8f0; font-size:calc(7.3px * var(--fs-scale)); font-weight:800; }
.mas-compare-live-state.running { color:#1d4ed8; background:#dbeafe; }
.mas-compare-live-state.succeeded { color:#15803d; background:#dcfce7; }
.mas-compare-live-state.partial { color:#b45309; background:#fef3c7; }
.mas-compare-live-feed { margin:0 15px 15px; overflow:hidden; border:1px solid #dfe7f0; border-radius:11px; background:#fff; }
.mas-compare-live-feed-head { display:flex; align-items:center; justify-content:space-between; padding:8px 11px; border-bottom:1px solid #e8edf3; background:#f8fafc; }
.mas-compare-live-feed-head strong { color:#334155; font-size:calc(8.5px * var(--fs-scale)); }
.mas-compare-live-feed-head span { color:#94a3b8; font-size:calc(7.3px * var(--fs-scale)); }
.mas-compare-live-feed ol { max-height:132px; margin:0; padding:3px 0; overflow:auto; list-style:none; }
.mas-compare-live-feed li { display:grid; grid-template-columns:42px minmax(0,1fr); gap:8px; padding:6px 11px; color:#475569; font-size:calc(8px * var(--fs-scale)); line-height:1.45; }
.mas-compare-live-feed li + li { border-top:1px solid #f1f5f9; }
.mas-compare-live-feed time { color:#94a3b8; font-variant-numeric:tabular-nums; }
.mas-compare-live-feed li.success span { color:#15803d; }
.mas-compare-live-feed li.error span { color:#b91c1c; }
.mas-compare-live-feed li.running span { color:#1d4ed8; }
.mas-compare-results--batch { border-top:0; }
.mas-compare-unit-summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 15px; border-bottom:1px solid #e5eaf1; background:#fff; }
.mas-compare-unit-summary strong, .mas-compare-unit-summary span { display:block; }
.mas-compare-unit-summary strong { color:#1e293b; font-size:calc(11px * var(--fs-scale)); }
.mas-compare-unit-summary div > span { margin-top:2px; color:#64748b; font-size:calc(8px * var(--fs-scale)); }
.mas-compare-result-status.partial { color:#b45309; background:#fef3c7; }
.mas-compare-result-status.no_images { color:#64748b; background:#e2e8f0; }
.mas-compare-result-status.running { color:#1d4ed8; background:#dbeafe; }
.mas-compare-result-status.queued { color:#64748b; background:#e2e8f0; }
.mas-compare-model-pending { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:230px; padding:24px; text-align:center; }
.mas-compare-model-pending .mas-compare-spinner { margin-bottom:11px; }
.mas-compare-model-pending strong { color:#1d4ed8; font-size:calc(10.5px * var(--fs-scale)); }
.mas-compare-model-pending p { margin-top:7px; color:#64748b; font-size:calc(9px * var(--fs-scale)); }

@media (max-width: 1180px) {
  .mas-compare-workspace { grid-template-columns:280px minmax(0,1fr); }
  .mas-compare-image-grid { grid-template-columns:repeat(3,minmax(110px,1fr)); }
  .mas-compare-columns { grid-template-columns:1fr; }
  .mas-compare-report-body { max-height:none; }
  .mas-compare-unit-tabs { grid-template-columns:repeat(2,minmax(120px,1fr)); }
}
@media (max-width: 820px) {
  .mas-app-layout:has(.mas-compare-page) .mas-sidebar { display:none; }
  .mas-app-layout:has(.mas-compare-page) .mas-main-content { width:100%; padding:0; }
  body:has(.mas-compare-page) .mas-top-header { padding:0 12px; }
  body:has(.mas-compare-page) .mas-hospital-name { display:none; }
  .mas-compare-page { padding:12px; }
  .mas-compare-hero { align-items:flex-start; flex-direction:column; padding:20px; }
  .mas-compare-hero-note { width:100%; }
  .mas-compare-provider-strip { flex-wrap:wrap; }
  .mas-compare-provider { flex:1 1 230px; min-width:0; }
  .mas-compare-workspace { grid-template-columns:1fr; }
  .mas-compare-controls { position:static; }
  .mas-compare-image-grid { grid-template-columns:repeat(2,minmax(110px,1fr)); }
  .mas-compare-image-card img { height:150px; }
  .mas-compare-batch-toolbar { align-items:flex-start; flex-direction:column; }
  .mas-compare-unit-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .mas-compare-live-models { grid-template-columns:1fr; }
}
@media (max-width: 520px) {
  body:has(.mas-compare-page) .mas-system-title { font-size:calc(14px * var(--fs-scale)); }
  body:has(.mas-compare-page) .mas-header-user { padding:4px 8px; }
  body:has(.mas-compare-page) .mas-header-user > span:not(.mas-avatar) { display:none; }
  .mas-compare-hero h1 { font-size: calc(18px * var(--fs-scale)); }
  .mas-compare-image-toolbar { align-items:flex-start; flex-direction:column; }
  .mas-compare-image-grid { grid-template-columns:1fr; }
  .mas-compare-image-card img { height:210px; }
  .mas-compare-tabs { overflow-x:auto; }
  .mas-compare-tabs button { white-space:nowrap; }
  .mas-compare-export-actions { width:100%; }
  .mas-compare-export-actions button { flex:1 1 auto; }
  .mas-compare-export-actions .mas-compare-export-md { flex-basis:100%; }
  .mas-compare-unit-tabs { grid-template-columns:1fr 1fr; padding:10px; }
  .mas-compare-artifact-grid { grid-template-columns:1fr; }
  .mas-compare-live { margin:10px; }
  .mas-compare-live-head { grid-template-columns:minmax(0,1fr) auto auto; gap:8px; padding:12px; }
  .mas-compare-live-title small { display:none; }
  .mas-compare-live-progress { margin:0 12px; }
  .mas-compare-live-models { padding:10px 12px; }
  .mas-compare-live-feed { margin:0 12px 12px; }
  .mas-compare-live-feed li { grid-template-columns:38px minmax(0,1fr); padding:6px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .mas-compare-live-beacon.active::after, .mas-compare-unit-tabs i.running { animation:none; }
  .mas-compare-live-progress span { transition:none; }
}
.mas-img-preview-zoom{
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(58, 146, 230,0.28);
  background: rgba(58, 146, 230,0.10);
  color: #1d4ed8;
  font-weight: 900;
  font-size: calc(12px * var(--fs-scale));
  cursor: pointer;
}
.mas-img-preview-zoom.active{
  border-color: rgba(58, 146, 230,0.55);
  background: rgba(58, 146, 230,0.22);
  color: #0f172a;
}
.mas-img-preview-stage{
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
  padding: 18px;
}
.mas-img-preview-img {
  position: relative;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 10px;
}
.mas-img-magnifier{
  position:absolute;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(226,232,240,0.9);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  background-repeat: no-repeat;
  pointer-events: none;
}

/* Patient archive modal */
.mas-archive-mask {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(2, 6, 23, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.mas-archive-dialog {
  width: min(1200px, 96vw);
  height: min(820px, 92vh);
  background: #0b1220;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}
.mas-archive-head {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(180deg, rgba(58, 146, 230,0.08), rgba(15,23,42,0));
}
.mas-archive-title { font-weight: 900; color: #e2e8f0; font-size: calc(16px * var(--fs-scale)); }
.mas-archive-sub { margin-top: 3px; color: rgba(226,232,240,0.72); font-size: calc(12px * var(--fs-scale)); }
.mas-archive-body { flex: 1; min-height: 0; display: flex; }
.mas-archive-left {
  width: 260px;
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.25);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.mas-archive-left-title {
  padding: 10px 12px;
  font-weight: 800;
  color: rgba(226,232,240,0.9);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: calc(13px * var(--fs-scale));
}
.mas-archive-runlist { overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.mas-archive-runitem {
  text-align: left;
  border-radius: 12px;
  padding: 10px 10px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.35);
  color: #e2e8f0;
  cursor: pointer;
}
.mas-archive-runitem.active {
  border-color: rgba(58, 146, 230, 0.55);
  box-shadow: 0 10px 26px rgba(58, 146, 230, 0.12);
  background: rgba(58, 146, 230, 0.12);
}
.mas-archive-right { flex: 1; min-width: 0; padding: 12px; overflow: auto; }
.mas-archive-section { margin-bottom: 14px; }
.mas-archive-sec-title {
  font-weight: 900;
  color: #e2e8f0;
  font-size: calc(14px * var(--fs-scale));
  margin-bottom: 8px;
}
.mas-archive-empty { padding: 18px; border: 1px dashed rgba(148,163,184,0.22); color: rgba(226,232,240,0.7); border-radius: 12px; }
.mas-archive-paper {
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 14px;
}
.mas-archive-modgrid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.mas-archive-modcard {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.3);
}
.mas-archive-modhead {
  padding: 10px 12px;
  font-weight: 900;
  color: rgba(226,232,240,0.92);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: calc(13px * var(--fs-scale));
}
.mas-archive-modbody { padding: 10px 12px; }
.mas-archive-eye2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mas-archive-eye2 .eye {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(2, 6, 23, 0.22);
}
.mas-archive-eye2 .eye-title { font-weight: 900; color: rgba(226,232,240,0.9); font-size: calc(12px * var(--fs-scale)); margin-bottom: 6px; }
.mas-archive-eye2 .eye-text { color: rgba(226,232,240,0.86); font-size: calc(12px * var(--fs-scale)); }
.mas-archive-eye-sectitle { font-weight: 700; color: var(--mas-accent-light); font-size: calc(12px * var(--fs-scale)); margin: 8px 0 2px; }
.mas-archive-eye2 .eye-tip { color: var(--mas-accent-light); }
.mas-archive-imgs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.mas-archive-img { width: 100%; height: 96px; object-fit: contain; border-radius: 6px; border: 1px solid rgba(148,163,184,0.3); cursor: zoom-in; transition: border-color .15s; }
.mas-archive-img:hover { border-color: var(--mas-accent-light); }

/* 档案影像点击放大 lightbox */
.mas-archive-imgzoom { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.82); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.mas-archive-imgzoom-img { max-width: 92vw; max-height: 92vh; object-fit: contain; border-radius: 6px; box-shadow: 0 8px 40px rgba(0,0,0,0.5); }
.mas-archive-imgzoom-close { position: fixed; top: 20px; right: 24px; width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255,255,255,0.15); color: #fff; font-size: 20px; cursor: pointer; }
.mas-archive-imgzoom-close:hover { background: rgba(255,255,255,0.3); }

/* 档案弹窗浅色主题覆盖：原深底文字看不清（EMR/模态/问诊内容看不见）→ 白底深字统一可读 */
.mas-archive-dialog { background: #f8fafc; }
.mas-archive-head { background: linear-gradient(180deg, rgba(58, 146, 230,0.06), #fff); border-bottom-color: #e2e8f0; }
.mas-archive-title { color: #0f172a; }
.mas-archive-sub { color: #64748b; }
.mas-archive-head .mas-btn-outline { background: #fff; color: #334155; border-color: #cbd5e1; }
.mas-archive-head .mas-btn-outline:hover { color: var(--mas-accent); border-color: var(--mas-accent); }
.mas-archive-left { background: #fff; border-right-color: #e2e8f0; }
.mas-archive-left-title { color: #334155; border-bottom-color: #e2e8f0; }
.mas-archive-runitem { background: #fff; color: #1f2937; border-color: #e2e8f0; }
.mas-archive-runitem.active { background: rgba(58, 146, 230,0.06); border-color: var(--mas-accent); }
.mas-archive-right { background: #f8fafc; }
.mas-archive-sec-title { color: #0f172a; }
.mas-archive-empty { color: #64748b; border-color: #cbd5e1; }
.mas-archive-modcard { background: #fff; border-color: #e2e8f0; }
.mas-archive-modhead { background: #f1f5f9; color: #0f172a; border-bottom-color: #e2e8f0; }
.mas-archive-modbody { color: #1f2937; }
.mas-archive-eye2 .eye { background: #f8fafc; border-color: #e2e8f0; }
.mas-archive-eye2 .eye-title { color: #1e40af; }
.mas-archive-eye2 .eye-text { color: #334155; }
.mas-archive-dialog .mas-tab-row { background: #fff; border-bottom-color: #e2e8f0; }
.mas-archive-dialog .mas-tab { color: #64748b; }

@media (max-width: 980px) {
  .mas-archive-dialog { width: 96vw; height: 92vh; }
  .mas-archive-left { width: 220px; }
  .mas-archive-modgrid { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .mas-imaging-report-img { height: 132px; }
}

@media (max-width: 860px) {
  .mas-imaging-report-imggrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mas-imaging-report-img { height: 156px; }
}
/* FFA 造影帧多：每眼内 3 张一排（其余模态仍 2 张）；诊疗分析 + 患者管理档案通用。
   放在响应式覆盖之后，确保各屏宽下 FFA 恒为 3 列。 */
.mas-imaging-report-imggrid--ffa { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mas-archive-imgs--ffa { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mas-diag-module-eye-sep {
  width: 1px;
  background: var(--mas-border-light);
  flex-shrink: 0;
  align-self: stretch;
  min-height: 120px;
}
.mas-diag-eye-report-head {
  font-size: calc(13px * var(--fs-scale));
  font-weight: 700;
  color: var(--mas-accent-light);
  margin-bottom: 8px;
  padding: 6px 10px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(37, 99, 235, 0.15);
}
.mas-btn-xs {
  padding: 4px 10px;
  font-size: calc(11px * var(--fs-scale));
  border-radius: 8px;
}
.mas-diag-report-paper-empty {
  text-align: center;
  color: var(--mas-text-muted);
  padding: 60px 20px;
  font-size: calc(13px * var(--fs-scale));
}

/* ============ DIAGNOSIS LAYOUT (legacy, kept for compat) ============ */
.mas-diag-layout-v2 {
  display: grid;
  grid-template-columns: 1.1fr 0.7fr 1.2fr;
  gap: 12px;
  height: calc(100vh - 104px);
  min-height: 0;
}
.mas-diag-left {
  display: flex; flex-direction: column; gap: 12px;
  min-height: 0; overflow-y: auto;
}

/* Panel (card style matching original) */
.mas-panel {
  background: var(--mas-bg-card);
  border: 1px solid var(--mas-glass-border);
  border-radius: 12px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.mas-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--mas-border-light);
  flex-shrink: 0;
}
.mas-panel-title {
  font-size: calc(14px * var(--fs-scale)); font-weight: 700; color: var(--mas-text);
}
.mas-panel-body {
  flex: 1; overflow-y: auto; padding: 12px; min-height: 0;
}
.mas-panel-control .mas-panel-body { gap: 12px; }
.mas-panel-report {
  display: flex; flex-direction: column;
}

/* EMR 病例文本 / 多模态图像管理：左侧色条 + 渐变抬头（内层 modality 卡片独立样式） */
.mas-panel-emr,
.mas-panel-mmi {
  border-left: 4px solid #1a6cb5;
  box-shadow: 0 2px 14px rgba(26, 108, 181, 0.1);
}
.mas-panel-emr-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px 14px 14px;
  background: linear-gradient(105deg, #dbe8f6 0%, #e8f1fa 42%, #f5f9fc 100%);
  border-bottom: 1px solid #b8cce0;
}
.mas-panel-emr .mas-panel-title,
.mas-panel-mmi .mas-panel-title {
  color: #0c3d5c;
  letter-spacing: 0.03em;
}
.mas-analyzer-badge.mas-analyzer-badge--emr {
  flex: 0 0 auto !important;
  font-size: calc(11px * var(--fs-scale)) !important;
  padding: 6px 14px !important;
  border-radius: 999px;
  line-height: 1.3;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}
.mas-analyzer-badge.mas-analyzer-badge--emr.done {
  background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
  color: #fff !important;
  border: 1px solid rgba(13, 148, 136, 0.45);
}
.mas-analyzer-badge.mas-analyzer-badge--emr.idle {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  color: #b45309 !important;
  border: 1px solid #f59e0b;
}
.mas-main-content:not(.mas-main-content--light) .mas-panel-emr-header {
  background: linear-gradient(105deg, rgba(58, 146, 230, 0.22) 0%, rgba(12, 30, 52, 0.92) 55%, rgba(15, 40, 68, 0.88) 100%);
  border-bottom-color: rgba(58, 146, 230, 0.25);
}
.mas-main-content:not(.mas-main-content--light) .mas-panel-emr .mas-panel-title,
.mas-main-content:not(.mas-main-content--light) .mas-panel-mmi .mas-panel-title {
  color: #e8edf3;
}
.mas-main-content:not(.mas-main-content--light) .mas-analyzer-badge.mas-analyzer-badge--emr.done {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #fff !important;
}
.mas-main-content:not(.mas-main-content--light) .mas-analyzer-badge.mas-analyzer-badge--emr.idle {
  background: rgba(243, 156, 18, 0.2);
  color: #fcd34d !important;
  border-color: rgba(251, 191, 36, 0.45);
}

/* 诊疗采集 · 当前患者（板岩墨灰系，与左侧患者列表同一视觉家族，区别于 EMR 亮蓝） */
.mas-panel-current-patient {
  border-left: 4px solid #334155;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.07), 0 1px 4px rgba(15, 23, 42, 0.04);
}
.mas-panel-current-patient-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(105deg, #dce3ec 0%, #e8edf4 40%, #f4f6f9 100%);
  border-bottom: 1px solid #c5ced9;
}
.mas-panel-current-patient .mas-panel-title {
  color: #1e293b;
  letter-spacing: 0.02em;
}
.mas-current-patient-chip {
  margin-left: auto;
  flex-shrink: 0;
  font-size: calc(10px * var(--fs-scale));
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  color: #1e293b;
  background: #ffffff;
  border: 1px solid #94a3b8;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.mas-panel-current-patient-body {
  padding: 16px 18px;
}
.mas-current-patient-name {
  font-size: calc(19px * var(--fs-scale));
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.mas-current-patient-meta {
  font-size: calc(12px * var(--fs-scale));
  color: #475569;
  font-weight: 500;
}
.mas-main-content:not(.mas-main-content--light) .mas-panel-current-patient {
  border-left-color: #94a3b8;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
}
.mas-main-content:not(.mas-main-content--light) .mas-panel-current-patient-header {
  background: linear-gradient(105deg, rgba(148, 163, 184, 0.2) 0%, rgba(12, 30, 52, 0.92) 52%, rgba(15, 40, 68, 0.88) 100%);
  border-bottom-color: rgba(148, 163, 184, 0.28);
}
.mas-main-content:not(.mas-main-content--light) .mas-panel-current-patient .mas-panel-title {
  color: #f1f5f9;
}
.mas-main-content:not(.mas-main-content--light) .mas-current-patient-chip {
  color: #e2e8f0;
  background: rgba(15, 40, 68, 0.55);
  border-color: rgba(148, 163, 184, 0.45);
}
.mas-main-content:not(.mas-main-content--light) .mas-panel-current-patient .mas-panel-body {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.25) 0%, rgba(15, 40, 68, 0.4) 100%);
}
.mas-main-content:not(.mas-main-content--light) .mas-current-patient-name {
  color: #f8fafc;
}
.mas-main-content:not(.mas-main-content--light) .mas-current-patient-meta {
  color: #94a3b8;
}

/* EMR */
.mas-patient-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.mas-patient-label {
  font-size: calc(13px * var(--fs-scale)); font-weight: 600; color: var(--mas-text-dim); white-space: nowrap;
}
.mas-patient-input {
  flex: 1; padding: 7px 12px;
  border: 1px solid var(--mas-border); border-radius: 8px;
  font-size: calc(13px * var(--fs-scale)); color: var(--mas-text);
  background: rgba(0,0,0,0.15); font-family: inherit;
  transition: border-color 0.2s;
}
.mas-patient-input:focus { outline: none; border-color: var(--mas-accent); }
.mas-patient-input:disabled { opacity: 0.6; }

.mas-emr-textarea {
  width: 100%; min-height: 140px; max-height: 300px; resize: vertical;
  border: 1px solid var(--mas-border); border-radius: 8px;
  padding: 14px;
  font-size: calc(15px * var(--fs-scale));
  line-height: 1.9;
  font-family: 'Menlo','Monaco','Consolas',monospace;
  color: var(--mas-text); background: rgba(0,0,0,0.15);
  transition: border-color 0.2s;
}
.mas-emr-textarea:focus { outline: none; border-color: var(--mas-accent); }
.mas-emr-textarea:disabled { opacity: 0.6; }
.mas-emr-detail-textarea {
  min-height: 88px;
  max-height: 360px;
  margin-top: 6px;
  font-size: calc(13px * var(--fs-scale));
  line-height: 1.75;
}
.mas-char-count { text-align: right; font-size: calc(11px * var(--fs-scale)); color: var(--mas-text-muted); margin-top: 4px; }
.mas-main-content--light .mas-char-count {
  font-size: calc(12px * var(--fs-scale));
}

/* Image Tabs (underline style like original) */
.mas-image-tabs {
  display: flex; border-bottom: 2px solid var(--mas-border-light); margin-bottom: 12px;
}
.mas-image-tab {
  flex: 1; padding: 8px 4px; text-align: center;
  font-size: calc(13px * var(--fs-scale)); font-weight: 600; color: var(--mas-text-muted);
  background: none; border: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.2s; font-family: inherit;
}
.mas-image-tab:hover { color: var(--mas-accent-light); }
.mas-image-tab.active { color: var(--mas-accent-light); border-bottom-color: var(--mas-accent); }
.mas-tab-badge {
  margin-left: 4px; font-size: calc(10px * var(--fs-scale));
  background: var(--mas-accent); color: #fff;
  padding: 0 5px; border-radius: 8px;
}

/* Eye sections */
.mas-eye-sections { display: flex; flex-direction: column; gap: 10px; }
.mas-eye-section { padding: 10px; background: rgba(0,0,0,0.1); border-radius: 8px; }
.mas-eye-label {
  font-size: calc(12px * var(--fs-scale)); font-weight: 700; color: var(--mas-accent-light);
  text-align: center; padding: 4px; margin-bottom: 8px;
  background: rgba(58, 146, 230,0.1); border-radius: 6px;
}
.mas-eye-content { display: flex; flex-direction: column; gap: 6px; }

.mas-upload-area {
  border: 2px dashed var(--mas-border); border-radius: 8px;
  padding: 16px 8px; text-align: center; cursor: pointer;
  transition: all 0.2s; min-height: 60px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.1);
}
.mas-upload-area:hover { border-color: var(--mas-accent-light); background: rgba(58, 146, 230,0.05); }
.mas-upload-area.has-file { border-color: var(--mas-success); background: rgba(39,174,96,0.05); }
.mas-upload-placeholder { font-size: calc(11px * var(--fs-scale)); color: var(--mas-text-muted); }

/* File list with image preview cards */
.mas-file-list-container {
  background: rgba(0,0,0,0.1); border: 1px solid var(--mas-border-light);
  border-radius: 6px; padding: 6px;
}
.mas-file-list-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: calc(11px * var(--fs-scale)); color: var(--mas-text-dim); font-weight: 600; margin-bottom: 4px;
}
.mas-btn-clear {
  padding: 2px 8px; background: rgba(231,76,60,0.15);
  border: 1px solid var(--mas-danger); border-radius: 6px;
  color: var(--mas-danger); font-size: calc(10px * var(--fs-scale)); font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.mas-btn-clear:hover { background: var(--mas-danger); color: #fff; }
.mas-file-list {
  max-height: 200px; overflow-y: auto;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.mas-file-card { display: flex; flex-direction: column; align-items: center; width: 80px; }
.mas-file-card-preview {
  position: relative; width: 80px; height: 80px;
  border-radius: 6px; overflow: hidden;
  border: 1px solid var(--mas-border-light); background: rgba(0,0,0,0.2);
}
.mas-file-card-img { width: 100%; height: 100%; object-fit: cover; }
.mas-file-card-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: calc(10px * var(--fs-scale)); color: var(--mas-text-muted); text-transform: uppercase;
}
.mas-file-card-remove {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; border: none;
  font-size: calc(11px * var(--fs-scale)); cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s;
}
.mas-file-card-preview:hover .mas-file-card-remove { opacity: 1; }
.mas-file-card-remove:hover { background: var(--mas-danger); }
.mas-file-card-name {
  margin-top: 3px; font-size: calc(9px * var(--fs-scale)); color: var(--mas-text-muted);
  text-align: center; width: 80px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.mas-text-desc {
  width: 100%; min-height: 36px; padding: 6px 8px;
  background: rgba(0,0,0,0.1); border: 1px solid var(--mas-border-light);
  border-radius: 6px; color: var(--mas-text); font-size: calc(11px * var(--fs-scale));
  resize: vertical; font-family: inherit; line-height: 1.5;
}
.mas-text-desc:focus { outline: none; border-color: var(--mas-accent); }
.mas-text-desc:disabled { opacity: 0.6; }

/* Control section */
.mas-control-section { display: flex; flex-direction: column; gap: 8px; }
.mas-control-section-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: calc(12px * var(--fs-scale)); font-weight: 700; color: var(--mas-text-dim);
}
.mas-live-badge {
  font-size: calc(10px * var(--fs-scale)); font-weight: 700; padding: 2px 10px;
  border-radius: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  background: rgba(39,174,96,0.15); color: var(--mas-success-light);
}
.mas-live-badge.analyzing { background: rgba(243,156,18,0.15); color: var(--mas-warning); animation: mas-blink 1.2s infinite; }
.mas-live-badge.completed { background: rgba(39,174,96,0.15); color: var(--mas-success-light); }
.mas-live-badge.failed { background: rgba(231,76,60,0.15); color: var(--mas-danger); }

.mas-btn-start {
  width: 100%; padding: 10px; border: none; border-radius: 10px;
  font-size: calc(13px * var(--fs-scale)); font-weight: 600; cursor: pointer;
  background: var(--mas-accent); color: #fff;
  font-family: inherit;
  transition: background 0.16s cubic-bezier(.22,.61,.36,1), box-shadow 0.16s, transform 0.16s;
}
.mas-btn-start:hover:not(:disabled) { background: var(--mas-accent-light); box-shadow: 0 4px 14px var(--mas-accent-glow); transform: translateY(-1px); }
/* 禁用态：中性 ghost（原 45% 透明实蓝在浅色页发灰发紫、抢眼不和谐）。
   未上传/跳过的模块本就是非活动项，应自然弱化而非高亮。 */
.mas-btn-start:disabled {
  background: rgba(148,163,184,0.16); color: var(--mas-text-muted);
  cursor: not-allowed; box-shadow: none;
}

/* Analyzer status list (matching original) */
.mas-analyzer-list {
  display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--mas-border-light); border-radius: 8px;
  padding: 8px; background: rgba(0,0,0,0.1);
}
.mas-analyzer-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 6px;
  transition: background 0.15s;
  border-left: 3px solid var(--mas-border-light);
}
.mas-analyzer-item:hover { background: rgba(58, 146, 230,0.05); }
.mas-analyzer-item.status-running { border-left-color: var(--mas-accent); }
.mas-analyzer-item.status-done { border-left-color: var(--mas-success); }
.mas-analyzer-item.status-failed { border-left-color: var(--mas-danger); }

.mas-analyzer-name { font-size: calc(12px * var(--fs-scale)); font-weight: 600; color: var(--mas-text); min-width: 48px; }
.mas-analyzer-badge {
  font-size: calc(10px * var(--fs-scale)); font-weight: 600; padding: 1px 8px; border-radius: 8px; flex: 1;
}
.mas-analyzer-badge.idle { background: rgba(0,0,0,0.1); color: var(--mas-text-muted); }
.mas-analyzer-badge.running { background: rgba(58, 146, 230,0.15); color: var(--mas-accent-light); }
.mas-analyzer-badge.done { background: rgba(39,174,96,0.15); color: var(--mas-success-light); }
.mas-analyzer-badge.failed { background: rgba(231,76,60,0.15); color: var(--mas-danger); }

.mas-btn-view {
  padding: 2px 10px; font-size: calc(10px * var(--fs-scale)); font-weight: 600;
  background: transparent; border: 1px solid var(--mas-border);
  border-radius: 6px; color: var(--mas-text-dim);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
  font-family: inherit;
}
.mas-btn-view:hover:not(:disabled) { background: var(--mas-accent); color: #fff; border-color: var(--mas-accent); }
.mas-btn-view:disabled { opacity: 0.35; cursor: not-allowed; }

/* Log section (matching original) */
.mas-log-section {
  flex: 1; display: flex; flex-direction: column; min-height: 120px;
  border: 1px solid var(--mas-border-light); border-radius: 8px;
  overflow: hidden; background: rgba(0,0,0,0.1);
}
.mas-log-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; border-bottom: 1px solid var(--mas-border-light);
  background: rgba(0,0,0,0.15);
}
.mas-log-title { font-size: calc(12px * var(--fs-scale)); font-weight: 700; color: var(--mas-text-dim); }
.mas-log-ctrl {
  padding: 2px 6px; background: transparent; border: 1px solid var(--mas-border-light);
  border-radius: 4px; color: var(--mas-text-muted); font-size: calc(11px * var(--fs-scale));
  cursor: pointer; font-family: inherit;
}
.mas-log-ctrl:hover { background: rgba(58, 146, 230,0.1); color: var(--mas-accent-light); }
.mas-log-content {
  flex: 1; overflow-y: auto; padding: 8px 10px;
  font-family: 'Menlo','Monaco','Consolas',monospace;
  font-size: calc(11px * var(--fs-scale)); line-height: 1.7;
}
.mas-log-line { white-space: nowrap; }
.mas-log-empty { text-align: center; padding: 20px; color: var(--mas-text-muted); }

/* Report panel */
.mas-panel-body-report {
  flex: 1; overflow-y: auto; padding: 12px; min-height: 0;
}
.mas-input-snapshot {
  padding: 10px; background: rgba(0,0,0,0.15); border-radius: 8px;
  margin-bottom: 12px; font-size: calc(11px * var(--fs-scale)); color: var(--mas-text-dim);
}
.mas-input-snapshot-title { font-weight: 600; color: var(--mas-text); margin-bottom: 4px; }
.mas-result-content { flex: 1; overflow-y: auto; }
.mas-result-empty {
  height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--mas-text-muted); font-size: calc(13px * var(--fs-scale));
}
.mas-btn-synthesize {
  flex: 1; padding: 9px 16px; border: none; border-radius: 8px;
  font-size: calc(13px * var(--fs-scale)); font-weight: 600; cursor: pointer;
  background: var(--mas-success); color: #fff;
  font-family: inherit; transition: all 0.15s;
}
.mas-btn-synthesize:hover:not(:disabled) { background: #219a52; box-shadow: 0 2px 8px rgba(39,174,96,0.25); }
.mas-btn-synthesize:disabled { opacity: 0.45; cursor: not-allowed; }

/* Image tabs */
.mas-img-tabs {
  display: flex; gap: 0; background: rgba(0,0,0,0.2); border-radius: 8px;
  overflow: hidden; border: 1px solid var(--mas-border-light);
}
.mas-img-tab {
  flex: 1; padding: 8px; text-align: center; font-size: calc(12px * var(--fs-scale));
  cursor: pointer; color: var(--mas-text-dim); transition: all 0.2s;
  border-right: 1px solid var(--mas-border-light);
}
.mas-img-tab:last-child { border-right: none; }
.mas-img-tab.active {
  background: var(--mas-accent); color: white; font-weight: 500;
}
.mas-img-tab:hover:not(.active) { background: rgba(58, 146, 230,0.1); }

/* Image upload zone */
.mas-img-upload-zone {
  border: 2px dashed var(--mas-border);
  border-radius: 8px; padding: 24px;
  text-align: center; cursor: pointer;
  transition: all 0.2s; min-height: 120px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
}
.mas-img-upload-zone:hover { border-color: var(--mas-accent); background: rgba(58, 146, 230,0.05); }
.mas-upload-icon { font-size: calc(28px * var(--fs-scale)); color: var(--mas-text-muted); }
.mas-upload-text { font-size: calc(12px * var(--fs-scale)); color: var(--mas-text-muted); }

/* Image grid */
.mas-img-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-top: 8px;
}
.mas-img-thumb {
  aspect-ratio: 1; background: rgba(0,0,0,0.3);
  border-radius: 6px; border: 1px solid var(--mas-border-light);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.mas-img-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Analysis button */
.mas-analysis-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--mas-accent), #1e6fbf);
  border: none; border-radius: 10px;
  color: white; font-size: calc(15px * var(--fs-scale)); font-weight: 700;
  cursor: pointer; transition: all 0.3s;
  font-family: inherit; letter-spacing: 1px;
  box-shadow: 0 4px 16px rgba(58, 146, 230,0.3);
}
.mas-analysis-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(58, 146, 230,0.5);
}
.mas-analysis-btn:disabled {
  opacity: 0.5; cursor: not-allowed; transform: none;
}

/* Module list */
.mas-module-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.mas-module-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: rgba(0,0,0,0.15);
  border-radius: 8px; border: 1px solid var(--mas-border-light);
}
.mas-module-name { font-size: calc(13px * var(--fs-scale)); font-weight: 500; }
.mas-module-status {
  font-size: calc(11px * var(--fs-scale)); padding: 2px 10px; border-radius: 10px;
}
.mas-module-status.done { background: rgba(39,174,96,0.15); color: var(--mas-success-light); }
.mas-module-status.pending { background: rgba(243,156,18,0.15); color: var(--mas-warning); }
.mas-module-status.idle { background: rgba(90,122,158,0.1); color: var(--mas-text-muted); }
.mas-module-status.running { background: rgba(58, 146, 230,0.15); color: var(--mas-accent-light); animation: mas-blink 1s infinite; }
.mas-module-status.failed { background: rgba(231,76,60,0.15); color: var(--mas-danger); }

@keyframes mas-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Exec log */
.mas-exec-log {
  max-height: 300px; overflow-y: auto;
  background: rgba(0,0,0,0.3); border-radius: 8px;
  padding: 10px; font-family: 'Courier New', monospace;
  font-size: calc(11px * var(--fs-scale)); line-height: 1.7; color: var(--mas-text-dim);
  border: 1px solid var(--mas-border-light);
}
.mas-log-time { color: var(--mas-text-muted); }
.mas-log-info { color: var(--mas-accent-light); }
.mas-log-success { color: var(--mas-success-light); }
.mas-log-system { color: #a78bfa; }
.mas-log-error { color: var(--mas-danger); }

/* Report content */
.mas-report-content {
  font-size: calc(13px * var(--fs-scale)); line-height: 1.8;
  max-height: calc(100vh - 240px);
  overflow-y: auto; padding: 4px;
}
.mas-report-content h3 {
  font-size: calc(14px * var(--fs-scale)); font-weight: 700; color: var(--mas-accent-light);
  margin: 16px 0 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--mas-border-light);
}
.mas-report-content h3:first-child { margin-top: 0; }
.mas-report-content p { margin-bottom: 8px; color: var(--mas-text-dim); }
.mas-report-content .mas-tag {
  display: inline-block; font-size: calc(11px * var(--fs-scale)); padding: 1px 6px;
  background: rgba(58, 146, 230,0.15); color: var(--mas-accent-light);
  border-radius: 4px; margin: 0 2px;
}
.mas-report-content .mas-warning-tag {
  background: rgba(231,76,60,0.15); color: var(--mas-danger);
}

.mas-report-actions {
  display: flex; gap: 10px; padding-top: 12px;
  border-top: 1px solid var(--mas-border-light);
}

/* ============ HOME PAGE ============ */
/* 指挥中心 / 企业级数据大屏气质：玻璃层次、光效、立体卡片 */
.mas-home-showcase {
  max-width: 1680px;
  margin: 0 auto;
}

.mas-stat-card--showcase {
  /* box-shadow 简化：3 层 → 1 层，blur 32px → 12px。每个 box-shadow
     都开 GPU layer 做 blur raster。inset shadow 同样占合成层，删。 */
  border-color: rgba(100, 165, 235, 0.22);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  /* 金属数值（每张卡可覆写） */
  --mas-metal-1: rgba(255, 255, 255, 0.92);
  --mas-metal-2: rgba(226, 232, 240, 0.78);
  --mas-metal-3: rgba(148, 163, 184, 0.55);
  --mas-metal-glow: rgba(255, 255, 255, 0.06);
}
.mas-stat-card--showcase:nth-child(1) { --mas-metal-glow: rgba(107, 180, 255, 0.22); --mas-metal-3: rgba(58, 146, 230, 0.22); }
.mas-stat-card--showcase:nth-child(2) { --mas-metal-glow: rgba(53, 201, 192, 0.22); --mas-metal-3: rgba(53, 201, 192, 0.20); }
.mas-stat-card--showcase:nth-child(3) { --mas-metal-glow: rgba(243, 156, 18, 0.20); --mas-metal-3: rgba(245, 158, 11, 0.20); }
.mas-stat-card--showcase:nth-child(4) { --mas-metal-glow: rgba(46, 204, 113, 0.22); --mas-metal-3: rgba(34, 197, 94, 0.20); }
.mas-stat-card--showcase::before {
  height: 4px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}
.mas-stat-card-shine {
  /* 之前在 4 个 stat 卡片上各跑 mas-home-shine 9s linear-gradient
     background-position 动画 —— 持续 GPU 重做 background paint。改成
     纯静态：只显示一道淡淡的对角线高光，0 动画成本。 */
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 42%, rgba(255, 255, 255, 0.05) 50%, transparent 58%);
  opacity: 0.55;
  z-index: 1;
}
.mas-stat-card--showcase .mas-stat-card-inner,
.mas-stat-card--showcase .mas-stat-head-btn,
.mas-stat-card--showcase .mas-stat-value,
.mas-stat-card--showcase .mas-stat-sub {
  position: relative;
  z-index: 2;
}

/* Showcase KPI 数值：金属质感（适配动态刷新数字） */
.mas-stat-card--showcase .mas-stat-value {
  background: linear-gradient(
    180deg,
    var(--mas-metal-1) 0%,
    rgba(255, 255, 255, 0.65) 18%,
    var(--mas-metal-2) 46%,
    rgba(255, 255, 255, 0.78) 68%,
    var(--mas-metal-3) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.32),
    0 0 18px var(--mas-metal-glow);
}

/* KPI “点钞机/滚轮”数字 */
.mas-stat-value--ticker {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-variant-numeric: tabular-nums;
}
.mas-stat-card--showcase .mas-stat-value--ticker {
  /* ticker 的文字在子元素/伪元素里渲染，避免继承父级的 color: transparent */
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: inherit;
  text-shadow: none;
}
.mas-stat-value--ticker[data-tick] {
  /* 短促“滋啦”抖动 */
  animation: mas-ticker-zla 180ms steps(2, end) 1;
}
@keyframes mas-ticker-zla {
  0% { filter: blur(0.2px); transform: translateY(0); }
  35% { filter: blur(0.6px); transform: translateY(-0.8px); }
  70% { filter: blur(0.2px); transform: translateY(0.5px); }
  100% { filter: blur(0); transform: translateY(0); }
}
.mas-ticker-sep {
  display: inline-block;
  padding: 0 1px;
  opacity: 0.92;
}
.mas-ticker-digit {
  position: relative;
  display: inline-block;
  width: 0.64em;
  height: 1em;
  overflow: hidden;
  vertical-align: baseline;
}
.mas-stat-card--showcase .mas-stat-value--ticker .mas-ticker-sep,
.mas-stat-card--showcase .mas-stat-value--ticker .mas-ticker-digit::before,
.mas-stat-card--showcase .mas-stat-value--ticker .mas-ticker-wheel,
.mas-stat-card--showcase .mas-stat-value--ticker .mas-ticker-wheel > span {
  background: linear-gradient(
    180deg,
    var(--mas-metal-1) 0%,
    rgba(255, 255, 255, 0.65) 18%,
    var(--mas-metal-2) 46%,
    rgba(255, 255, 255, 0.78) 68%,
    var(--mas-metal-3) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.32),
    0 0 18px var(--mas-metal-glow);
}
.mas-ticker-wheel {
  display: flex;
  flex-direction: column;
  line-height: 1em;
  transform: translateY(calc(var(--digit, 0) * -1em));
  transition: transform 520ms cubic-bezier(0.12, 0.85, 0.22, 1);
  transition-delay: var(--delay, 0ms);
  will-change: transform;
}
.mas-ticker-wheel > span {
  height: 1em;
}
.mas-ticker-digit::before {
  content: '0\A1\A2\A3\A4\A5\A6\A7\A8\A9';
  white-space: pre;
  display: block;
  line-height: 1em;
  transform: translateY(calc(var(--digit, 0) * -1em));
  transition: transform 520ms cubic-bezier(0.12, 0.85, 0.22, 1);
  transition-delay: var(--delay, 0ms);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .mas-stat-value--ticker[data-tick] { animation: none !important; }
  .mas-ticker-digit::before { transition: none !important; }
  .mas-ticker-wheel { transition: none !important; }
}

.mas-stat-card-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px 18px;
  min-height: 76px;
}
.mas-stat-card-col--main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.mas-stat-card-col--aside {
  flex-shrink: 0;
  max-width: 44%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  align-self: stretch;
}
.mas-stat-card-col--aside .mas-stat-sub {
  margin-top: 0;
  text-align: right;
  justify-content: flex-end;
  line-height: 1.5;
  font-size: calc(11px * var(--fs-scale));
}

.mas-stat-head-btn {
  margin: 0;
  padding: 7px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: calc(12px * var(--fs-scale));
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  text-align: left;
  line-height: 1.35;
}
.mas-stat-head-btn:hover {
  transform: translateY(-1px);
}
.mas-stat-head-btn:focus-visible {
  outline: 2px solid var(--mas-accent-light);
  outline-offset: 2px;
}
.mas-stat-head-btn--1 {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.5);
  background: linear-gradient(135deg, rgba(58, 146, 230, 0.28), rgba(30, 64, 175, 0.18));
  box-shadow: 0 0 18px rgba(58, 146, 230, 0.14);
}
.mas-stat-head-btn--1:hover {
  background: linear-gradient(135deg, rgba(58, 146, 230, 0.4), rgba(30, 64, 175, 0.28));
  box-shadow: 0 0 22px rgba(58, 146, 230, 0.25);
}
.mas-stat-head-btn--2 {
  color: #7fe9e0;
  border-color: rgba(53, 201, 192, 0.45);
  background: linear-gradient(135deg, rgba(53, 201, 192, 0.22), rgba(20, 120, 115, 0.16));
  box-shadow: 0 0 18px rgba(53, 201, 192, 0.12);
}
.mas-stat-head-btn--2:hover {
  background: linear-gradient(135deg, rgba(53, 201, 192, 0.34), rgba(20, 120, 115, 0.24));
  box-shadow: 0 0 22px rgba(53, 201, 192, 0.2);
}
.mas-stat-head-btn--3 {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(180, 83, 9, 0.16));
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.12);
}
.mas-stat-head-btn--3:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.34), rgba(180, 83, 9, 0.22));
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.2);
}
.mas-stat-head-btn--4 {
  color: #86efac;
  border-color: rgba(52, 211, 153, 0.45);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.22), rgba(21, 128, 61, 0.16));
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.12);
}
.mas-stat-head-btn--4:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.34), rgba(21, 128, 61, 0.24));
  box-shadow: 0 0 22px rgba(34, 197, 94, 0.2);
}
.mas-stat-card--showcase:hover {
  transform: translateY(-3px);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(58, 146, 230, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}
/* 删 4 个 stat 卡数字的 drop-shadow filter —— 各开一个 GPU layer。
   原本想给数字发光，但金属质感渐变（mas-stat-value background-clip）
   已经够明显，drop-shadow 是冗余的视觉负担。 */
.mas-stat-value-suffix {
  font-size: calc(14px * var(--fs-scale));
  font-weight: 500;
  opacity: 0.88;
  margin-left: 2px;
}
@keyframes mas-home-shine {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 0%; }
}

.mas-card--showcase {
  background: linear-gradient(165deg, rgba(16, 42, 72, 0.94) 0%, rgba(8, 22, 42, 0.9) 100%);
  border: 1px solid rgba(82, 145, 220, 0.24);
  /* box-shadow 简化：3 层 → 1 层（含 44px blur 极贵）+ 删 2 个 inset。
     7 个 showcase 卡片 × 3 层 = 21 个 GPU raster cache。 */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.mas-card--showcase .mas-card-header {
  background: linear-gradient(90deg, rgba(58, 146, 230, 0.14) 0%, transparent 58%),
    rgba(0, 0, 0, 0.22);
  border-bottom-color: rgba(90, 150, 220, 0.2);
}
.mas-card--showcase .mas-card-title {
  letter-spacing: 0.04em;
}
.mas-home-card-tag {
  font-size: calc(10px * var(--fs-scale));
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mas-text-muted);
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(58, 146, 230, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.22);
}
.mas-home-link-all {
  font-size: calc(11px * var(--fs-scale));
  font-weight: 600;
  color: var(--mas-accent-light);
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(58, 146, 230, 0.12);
  box-shadow: 0 0 18px rgba(58, 146, 230, 0.12);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.mas-home-link-all:hover {
  background: rgba(58, 146, 230, 0.2);
  border-color: rgba(147, 197, 253, 0.5);
  box-shadow: 0 0 24px rgba(58, 146, 230, 0.2);
}

.mas-home-right-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.mas-home-right-card .mas-card-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.mas-home-card-body--scroll {
  overflow: hidden;
}
.mas-home-card-body--scroll .mas-inst-list,
.mas-home-card-body--scroll .mas-activity-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

.mas-home-map-section.mas-card--showcase .mas-map-container {
  position: relative;
  overflow: hidden;
  /* 6 层 background gradient + 2 个 inset box-shadow（26px blur）→ 简
     化为单层纯色 + 单边边框。装饰感来自 SVG region 本身的配色。 */
  background: #061226;
  border-top: 1px solid rgba(34, 211, 238, 0.2);
}
/* 删 .mas-map-container::after / ::before 两个伪元素 —— 真正的 825MB
   内存大头：
   - ::after  inset -40% 全屏覆盖 + mix-blend-mode: screen（强制独立 GPU
     合成层）+ filter: blur+saturate+contrast 持续 + 10 个 background
     radial/linear-gradient 叠加 + 3 个 keyframe 动画并发（bg-flow 16s
     transform/opacity + neon-flicker 3.8s opacity + scan 5.8s
     background-position）→ GPU 每帧重做整层 raster，是真正的 hot spot
   - ::before 透视网格 + perspective(460px) rotateX(54deg) 3D transform +
     filter: drop-shadow + grid-shimmer 9.5s 动画
   一并删掉 4 个 keyframes：mas-map-scan / mas-map-neon-flicker /
   mas-map-bg-flow / mas-map-grid-shimmer。
   视觉变化：地图容器变成纯色背景（之前的科技感装饰层全去），但地图本体
   完好（SVG region + 连线 + 静态粒子）。 */
.mas-home-map-section.mas-card--showcase .mas-map-container .mas-map-svg {
  position: relative;
  z-index: 1;
}

.mas-home-showcase .mas-map-legend,
.mas-home-showcase .mas-map-stats-overlay {
  /* 删 backdrop-filter blur(14px) —— 同上 GPU 成本。 */
  background: rgba(6, 18, 36, 0.82);
  border: 1px solid rgba(120, 175, 245, 0.28);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}
.mas-home-showcase .mas-map-stats-overlay .ms-val {
  text-shadow: 0 0 22px rgba(96, 165, 250, 0.55);
}

.mas-home-showcase .mas-inst-item--showcase {
  padding: 12px 14px;
  margin-bottom: 8px;
  border-bottom: none;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.22), rgba(20, 45, 78, 0.18));
  border: 1px solid rgba(58, 146, 230, 0.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.mas-home-showcase .mas-inst-item--showcase:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.28);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), 0 0 20px rgba(58, 146, 230, 0.08);
}
.mas-home-showcase .mas-inst-item--showcase:last-child {
  margin-bottom: 0;
}

/* 中心医院（南昌大学附属眼科医院）高光 —— 静态。
   之前 mas-inst-hub-breathe 跑 filter: brightness + box-shadow 动画，
   filter 动画 = GPU 持续重做。改成纯静态高亮。 */
.mas-home-showcase .mas-inst-item--showcase.mas-inst-item--hub {
  background: linear-gradient(135deg, rgba(253, 224, 71, 0.10), rgba(20, 45, 78, 0.18));
  border-color: rgba(253, 224, 71, 0.32);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2), 0 0 18px rgba(253, 224, 71, 0.12);
}
.mas-home-showcase .mas-inst-item--showcase.mas-inst-item--hub .mas-inst-name {
  font-weight: 800;
  color: #f8fafc;
  text-shadow: 0 0 16px rgba(253, 224, 71, 0.14);
}
.mas-home-showcase .mas-inst-item--showcase.mas-inst-item--hub .mas-inst-dot.online {
  background: #fde047;
  box-shadow: 0 0 12px rgba(253, 224, 71, 0.7);
}

.mas-activity-list--showcase {
  position: relative;
  padding-left: 6px;
}
.mas-activity-list--showcase::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 8px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.55), rgba(58, 146, 230, 0.12), transparent);
}
.mas-map-svg--showcase {
  /* 删整个 SVG 容器上的 drop-shadow —— 它套在 11 个 region path（每个
     已经带 drop-shadow）外面再加一层，叠加 raster 成本。 */
}
.mas-map-svg--showcase.mas-map-svg--cyber {
  /* 同上：删双层 drop-shadow filter。 */
}

.mas-legend-dot--hub {
  background: linear-gradient(165deg, #ffffff, #38bdf8 55%, #0284c7);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.85);
}
.mas-legend-dot--node {
  background: radial-gradient(circle at 32% 28%, #fef9c3, #f59e0b 70%, #b45309);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.75);
}

@media (prefers-reduced-motion: reduce) {
  .mas-stat-card-shine {
    animation: none;
    opacity: 0.35;
  }
  .mas-home-showcase .mas-inst-item--showcase.mas-inst-item--hub {
    animation: none !important;
  }
  .mas-home-map-section.mas-card--showcase .mas-map-container::after {
    animation: none !important;
    opacity: 0.75;
  }
  .mas-home-map-section.mas-card--showcase .mas-map-container::before {
    animation: none !important;
  }
}

.mas-home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* minmax(0,1fr) 允许在 zoom/大字下收缩，避免地图被 overflow 裁掉一半 */
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  height: calc(100vh - 180px);
  min-height: 520px;
}
.mas-home-map-section {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.mas-home-right {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
}

/* Map container */
.mas-map-container {
  flex: 1;
  width: 100%;
  min-height: 280px;
  position: relative;
  background: var(--mas-bg-dark);
  border-radius: 0 0 12px 12px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mas-map-container img {
  max-width: 90%; max-height: 90%; object-fit: contain;
  opacity: 0.85;
}
.mas-map-marker {
  position: absolute; cursor: pointer; z-index: 2;
}
.mas-map-marker-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--mas-success-light);
  box-shadow: 0 0 6px var(--mas-success-light);
  animation: mas-pulse-dot 2s infinite;
}
.mas-map-marker-dot.center {
  width: 14px; height: 14px;
  background: var(--mas-accent-light);
  box-shadow: 0 0 10px var(--mas-accent-light);
}
.mas-map-marker-dot.offline {
  background: var(--mas-text-muted);
  box-shadow: none;
  animation: none;
}
.mas-map-marker-label {
  position: absolute; left: 14px; top: -4px;
  white-space: nowrap; font-size: calc(10px * var(--fs-scale));
  color: var(--mas-text-dim);
  pointer-events: none;
}
.mas-map-marker-label.center {
  font-size: calc(11px * var(--fs-scale)); font-weight: 700;
  color: var(--mas-accent-light);
}

.mas-map-legend {
  position: absolute; bottom: 16px; left: 16px;
  background: rgba(10,30,56,0.9); border: 1px solid var(--mas-border);
  border-radius: 8px; padding: 12px 16px;
  font-size: calc(11px * var(--fs-scale));
}
.mas-legend-item { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.mas-legend-item:last-child { margin-bottom: 0; }
.mas-legend-item--note { align-items: flex-start; margin-top: 6px; margin-bottom: 0 !important; }
.mas-legend-note {
  color: var(--mas-text-muted);
  font-size: calc(10px * var(--fs-scale));
  line-height: 1.45;
  font-weight: 400;
}
.mas-legend-dot { width: 10px; height: 10px; border-radius: 50%; }

.mas-map-stats-overlay {
  position: absolute; top: 16px; right: 16px;
  background: rgba(10,30,56,0.9); border: 1px solid var(--mas-border);
  border-radius: 8px; padding: 12px 16px;
}
.mas-map-stats-overlay .ms-label { font-size: calc(10px * var(--fs-scale)); color: var(--mas-text-muted); }
.mas-map-stats-overlay .ms-val { font-size: calc(20px * var(--fs-scale)); font-weight: 900; color: var(--mas-accent-light); }

/* Institution list */
.mas-inst-list { max-height: 260px; overflow-y: auto; }
.mas-inst-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--mas-border-light);
}
.mas-inst-item:last-child { border-bottom: none; }
.mas-inst-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.mas-inst-dot.online { background: var(--mas-success-light); box-shadow: 0 0 6px var(--mas-success-light); }
.mas-inst-dot.offline { background: var(--mas-text-muted); }
.mas-inst-info { flex: 1; min-width: 0; }
.mas-inst-name {
  font-size: calc(13px * var(--fs-scale)); font-weight: 500;
  line-height: 1.35;
}
.mas-inst-meta { font-size: calc(11px * var(--fs-scale)); color: var(--mas-text-muted); }
.mas-inst-aside {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 8px;
  flex-shrink: 0;
  max-width: min(52%, 220px);
  font-size: calc(11px * var(--fs-scale));
  color: var(--mas-text-muted);
  text-align: right;
}
.mas-inst-area { white-space: nowrap; }
.mas-inst-cases-label { white-space: nowrap; }
.mas-inst-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: calc(11px * var(--fs-scale));
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: #d6ebff;
  background: linear-gradient(180deg, rgba(107, 180, 255, 0.26) 0%, rgba(58, 146, 230, 0.2) 100%);
  border: 1px solid rgba(120, 180, 255, 0.4);
  box-shadow: 0 0 14px rgba(58, 146, 230, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.mas-inst-status {
  font-size: calc(11px * var(--fs-scale)); padding: 2px 8px; border-radius: 10px;
}
.mas-inst-status.on { background: rgba(39,174,96,0.15); color: var(--mas-success-light); }
.mas-inst-status.off { background: rgba(90,122,158,0.15); color: var(--mas-text-muted); }

/* Activity log */
.mas-activity-list { max-height: 220px; overflow-y: auto; }
.mas-activity-item {
  display: flex; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--mas-border-light);
  font-size: calc(12px * var(--fs-scale));
}
.mas-activity-item:last-child { border-bottom: none; }
.mas-activity-time { color: var(--mas-text-muted); white-space: nowrap; min-width: 72px; }
.mas-activity-text { color: var(--mas-text-dim); flex: 1; min-width: 0; }

/* 首页时间轴：须写在 .mas-activity-item 之后，否则 padding 会被覆盖导致圆点压住时间 */
.mas-activity-item.mas-activity-item--showcase {
  position: relative;
  padding: 10px 14px 10px 52px;
  margin-bottom: 6px;
  border-bottom: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(58, 146, 230, 0.06);
  transition: border-color 0.2s, background 0.2s;
}
.mas-activity-item.mas-activity-item--showcase::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #bfdbfe, #3b82f6);
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.75);
  z-index: 1;
}
.mas-activity-item.mas-activity-item--showcase:hover {
  border-color: rgba(96, 165, 250, 0.22);
  background: rgba(58, 146, 230, 0.06);
}
.mas-activity-item.mas-activity-item--showcase:last-child {
  margin-bottom: 0;
}

/* ============ STATISTICS ============ */
.mas-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.mas-stats-grid .mas-card { min-height: 300px; }

.mas-chart-container {
  position: relative; width: 100%; height: 260px;
}

/* Donut */
.mas-donut-wrapper {
  display: flex; align-items: center; justify-content: center; gap: 30px;
  padding: 20px;
}
.mas-donut-chart { position: relative; width: 180px; height: 180px; }
.mas-donut-chart svg { transform: rotate(-90deg); }
.mas-donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.mas-donut-center .value { font-size: calc(28px * var(--fs-scale)); font-weight: 900; color: var(--mas-accent-light); }
.mas-donut-center .label { font-size: calc(11px * var(--fs-scale)); color: var(--mas-text-muted); }
.mas-donut-legend { display: flex; flex-direction: column; gap: 10px; }
.mas-donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: calc(12px * var(--fs-scale)); }
.mas-donut-legend-dot { width: 10px; height: 10px; border-radius: 3px; }

/* —— 数据统计：科技感 / 立体图表（深色主界面） —— */
@keyframes mas-stat-bar-rise {
  from { transform: scaleY(0.02); opacity: 0.85; }
  to { transform: scaleY(1); opacity: 1; }
}
@keyframes mas-stat-shimmer {
  0% { transform: translateX(-120%) skewX(-12deg); opacity: 0; }
  30% { opacity: 0.35; }
  100% { transform: translateX(220%) skewX(-12deg); opacity: 0; }
}

.mas-stat-chart-area--bars {
  height: 260px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 20px 12px 8px;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(58, 146, 230, 0.08), transparent 70%);
}
.mas-stat-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.mas-stat-bar-value {
  font-size: calc(11px * var(--fs-scale));
  color: var(--mas-text-dim);
  font-weight: 600;
  text-shadow: 0 0 12px rgba(100, 180, 255, 0.35);
}
.mas-stat-bar-slot {
  flex: 1;
  width: 100%;
  max-width: 52px;
  min-height: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.mas-stat-bar-pillar {
  position: relative;
  width: 100%;
  max-width: 48px;
  min-height: 4px;
  border-radius: 12px 12px 5px 5px;
  transform-origin: bottom center;
  animation: mas-stat-bar-rise 0.85s ease both;
  transition: height 0.85s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, filter 0.25s ease;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.45) 0%, rgba(255, 255, 255, 0.22) 42%, rgba(255, 255, 255, 0.06) 52%, rgba(0, 0, 0, 0.35) 100%),
    linear-gradient(180deg, #7eb8ff 0%, #3d8aed 38%, #2563eb 72%, #1e3a8a 100%);
  box-shadow:
    0 0 22px rgba(58, 146, 230, 0.45),
    0 10px 24px rgba(0, 0, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    inset 0 -6px 12px rgba(0, 20, 60, 0.45);
  border: 1px solid rgba(147, 197, 253, 0.35);
}
.mas-stat-bar-pillar::before {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  top: -5px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.08));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.mas-stat-bar-pillar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.25) 50%, transparent 62%);
  animation: mas-stat-shimmer 3.5s ease-in-out infinite;
  pointer-events: none;
}
.mas-stat-bar-pillar:hover {
  filter: brightness(1.08);
  box-shadow:
    0 0 28px rgba(96, 165, 250, 0.55),
    0 12px 28px rgba(0, 0, 0, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    inset 0 -6px 12px rgba(0, 20, 60, 0.45);
}
.mas-stat-bar-pillar--latest {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.4) 0%, rgba(255, 255, 255, 0.28) 42%, rgba(255, 255, 255, 0.08) 52%, rgba(0, 0, 0, 0.3) 100%),
    linear-gradient(180deg, #5eead4 0%, #2dd4bf 35%, #14b8a6 70%, #0f766e 100%);
  box-shadow:
    0 0 26px rgba(45, 212, 191, 0.5),
    0 10px 24px rgba(0, 0, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    inset 0 -6px 12px rgba(6, 78, 59, 0.5);
  border-color: rgba(110, 231, 183, 0.45);
}
.mas-stat-bar-pillar--latest:hover {
  box-shadow:
    0 0 32px rgba(52, 211, 153, 0.6),
    0 12px 28px rgba(0, 0, 0, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    inset 0 -6px 12px rgba(6, 78, 59, 0.5);
}
.mas-stat-bar-month {
  font-size: calc(11px * var(--fs-scale));
  color: var(--mas-text-muted);
}

.mas-donut-chart--tech svg {
  filter: drop-shadow(0 8px 20px rgba(58, 146, 230, 0.22));
}
.mas-donut-center--tech {
  pointer-events: none;
}
.mas-donut-center-plate {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.14), transparent 52%),
    radial-gradient(circle at 50% 108%, rgba(0, 0, 0, 0.55), transparent 42%),
    linear-gradient(160deg, #1e3a5f 0%, #0f1729 48%, #0a101f 100%);
  box-shadow:
    inset 0 0 28px rgba(0, 0, 0, 0.75),
    inset 0 2px 2px rgba(255, 255, 255, 0.12),
    0 0 0 1px rgba(100, 160, 255, 0.22),
    0 6px 24px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(71, 130, 200, 0.25);
}
.mas-donut-center--tech .value {
  font-size: calc(26px * var(--fs-scale));
  font-weight: 900;
  background: linear-gradient(180deg, #e0f2fe 0%, #7dd3fc 45%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(56, 189, 248, 0.45);
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.35));
}
.mas-donut-center--tech .label {
  margin-top: 2px;
  font-size: calc(10px * var(--fs-scale));
  color: var(--mas-text-muted);
  letter-spacing: 0.06em;
}
.mas-donut-legend-dot--tech {
  width: 11px;
  height: 11px;
  border-radius: 4px;
  background: var(--dot-color, #6bb4ff) !important;
  box-shadow:
    0 0 10px var(--dot-color, rgba(107, 180, 255, 0.6)),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mas-stat-perf-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--mas-border-light);
  transition: background 0.2s ease;
}
.mas-stat-perf-row:last-child {
  border-bottom: none;
}
.mas-stat-perf-row:hover {
  background: linear-gradient(90deg, rgba(58, 146, 230, 0.06), transparent 55%);
}
.mas-stat-perf-name {
  width: 140px;
  flex-shrink: 0;
  font-size: calc(12px * var(--fs-scale));
  font-weight: 600;
}
.mas-stat-hbar-track {
  flex: 1;
  min-width: 0;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.04));
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
  position: relative;
}
.mas-stat-hbar-track--neon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  pointer-events: none;
}
.mas-stat-hbar-fill {
  height: 100%;
  border-radius: 999px;
  max-width: 100%;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, filter 0.25s ease;
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0%, transparent 48%, rgba(0, 0, 0, 0.25) 100%);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.08);
}
.mas-stat-hbar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 35%, rgba(255, 255, 255, 0.2) 50%, transparent 65%);
  animation: mas-stat-shimmer 4s ease-in-out infinite;
}
.mas-stat-hbar-fill--high {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, transparent 45%, rgba(0, 0, 0, 0.22) 100%),
    linear-gradient(90deg, #34d399, #10b981, #059669);
  box-shadow:
    0 0 16px rgba(16, 185, 129, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.mas-stat-hbar-fill--mid {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, transparent 45%, rgba(0, 0, 0, 0.22) 100%),
    linear-gradient(90deg, #93c5fd, #3b82f6, #2563eb);
  box-shadow:
    0 0 16px rgba(58, 146, 230, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.mas-stat-hbar-fill--low {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0%, transparent 45%, rgba(0, 0, 0, 0.22) 100%),
    linear-gradient(90deg, #fcd34d, #f59e0b, #d97706);
  box-shadow:
    0 0 14px rgba(245, 158, 11, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.mas-stat-perf-pct {
  width: 50px;
  flex-shrink: 0;
  text-align: right;
  font-size: calc(13px * var(--fs-scale));
  font-weight: 800;
}
.mas-stat-perf-pct--high { color: var(--mas-success-light); text-shadow: 0 0 12px rgba(52, 211, 153, 0.35); }
.mas-stat-perf-pct--mid { color: var(--mas-accent-light); text-shadow: 0 0 12px rgba(96, 165, 250, 0.35); }
.mas-stat-perf-pct--low { color: var(--mas-warning); text-shadow: 0 0 10px rgba(251, 191, 36, 0.25); }
.mas-stat-perf-meta {
  width: 50px;
  flex-shrink: 0;
  text-align: right;
  font-size: calc(11px * var(--fs-scale));
  color: var(--mas-text-muted);
}
.mas-stat-perf-meta--wide {
  width: 64px;
}

.mas-stat-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  transition: background 0.2s ease;
  padding: 4px 2px;
  border-radius: 8px;
}
.mas-stat-rank-row:hover {
  background: rgba(58, 146, 230, 0.06);
}
.mas-stat-rank-row:last-child {
  margin-bottom: 0;
}
.mas-stat-rank-num {
  width: 22px;
  flex-shrink: 0;
  font-size: calc(12px * var(--fs-scale));
  font-weight: 800;
  color: var(--mas-text-muted);
  text-align: center;
}
.mas-stat-rank-num--top {
  color: #93c5fd;
  text-shadow: 0 0 14px rgba(147, 197, 253, 0.45);
}
.mas-stat-rank-name {
  width: 180px;
  flex-shrink: 0;
  font-size: calc(12px * var(--fs-scale));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mas-stat-hbar-track--rank {
  height: 9px;
}
.mas-stat-hbar-fill--rank-top {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, transparent 50%, rgba(0, 0, 0, 0.2) 100%),
    linear-gradient(90deg, #60a5fa, #3b82f6, #1d4ed8);
  box-shadow:
    0 0 14px rgba(58, 146, 230, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.mas-stat-hbar-fill--rank {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 50%, rgba(0, 0, 0, 0.2) 100%),
    linear-gradient(90deg, #4ade80, #22c55e, #15803d);
  box-shadow:
    0 0 12px rgba(34, 197, 94, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.mas-stat-rank-val {
  width: 44px;
  flex-shrink: 0;
  text-align: right;
  font-size: calc(12px * var(--fs-scale));
  font-weight: 700;
  color: var(--mas-text-dim);
}

/* 浅色页若包含统计卡片时，弱化发光、提高对比 */
.mas-main-content--light .mas-stat-bar-value {
  text-shadow: none;
  color: var(--mas-text-muted);
}
.mas-main-content--light .mas-stat-bar-pillar {
  box-shadow:
    0 4px 14px rgba(58, 146, 230, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    inset 0 -4px 8px rgba(30, 58, 138, 0.12);
}
.mas-main-content--light .mas-stat-bar-pillar--latest {
  box-shadow:
    0 4px 14px rgba(20, 184, 166, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    inset 0 -4px 8px rgba(15, 118, 110, 0.15);
}
.mas-main-content--light .mas-donut-center-plate {
  background: linear-gradient(160deg, #f1f5f9 0%, #e2e8f0 100%);
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.9), 0 0 0 1px rgba(148, 163, 184, 0.35);
  border-color: rgba(148, 163, 184, 0.4);
}
.mas-main-content--light .mas-donut-center--tech .value {
  background: linear-gradient(180deg, #0c4a6e 0%, #0369a1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: none;
  text-shadow: none;
}
.mas-main-content--light .mas-stat-perf-pct--high,
.mas-main-content--light .mas-stat-perf-pct--mid,
.mas-main-content--light .mas-stat-perf-pct--low {
  text-shadow: none;
}
.mas-main-content--light .mas-stat-rank-num--top {
  text-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .mas-stat-bar-pillar {
    animation: none;
  }
  .mas-stat-bar-pillar::after,
  .mas-stat-hbar-fill::after {
    animation: none;
  }
}

/* ============ SETTINGS ============ */
.mas-settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.mas-settings-layout > .mas-card {
  min-width: 0;
}
.mas-settings-nav { display: flex; flex-direction: column; gap: 4px; }
.mas-settings-nav-item {
  padding: 10px 16px; border-radius: 8px;
  font-size: calc(13px * var(--fs-scale)); color: var(--mas-text-dim);
  cursor: pointer; transition: all 0.2s;
}
.mas-settings-nav-item:hover { background: rgba(58, 146, 230,0.08); }
.mas-settings-nav-item.active {
  background: rgba(58, 146, 230,0.15); color: var(--mas-accent-light); font-weight: 500;
}

@media (max-width: 860px) {
  .mas-settings-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .mas-settings-nav {
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .mas-settings-nav-item {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 9px 12px;
  }
}

/* ============ ANIMATIONS ============ */
@keyframes mas-fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.mas-animate-in { animation: mas-fadeInUp 0.5s ease both; }
.mas-delay-1 { animation-delay: 0.1s; }
.mas-delay-2 { animation-delay: 0.2s; }
.mas-delay-3 { animation-delay: 0.3s; }
.mas-delay-4 { animation-delay: 0.4s; }

/* ============ SVG MAP ============ */
.mas-map-svg {
  /* 完整显示 viewBox，在窄/高或 html zoom 下不被拉伸裁切 */
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  flex-shrink: 1;
}
.mas-map-region {
  /* 删 brightness + drop-shadow × 2 三层 filter ——
     drop-shadow 跟随不规则 SVG path 形状走，每个 path 单独开 GPU layer
     做 raster。11 个市 path × 3 层 filter = 11 个独立 raster cache。
     改用更廉价的 stroke 替代发光感。 */
  transition: opacity 0.2s;
  cursor: pointer;
  shape-rendering: geometricPrecision;
}
.mas-map-region--connected {
  /* connected 高亮原本叠 brightness + 2 drop-shadow，同删；改用 stroke
     和 fill alpha 表达高亮。 */
  opacity: 1;
}
.mas-map-region:hover {
  opacity: 1 !important;
  /* hover 用 stroke 加粗 + 颜色，避开 drop-shadow GPU 成本。 */
  stroke-width: 2;
}

/* 已接入地市板块：缓慢“汇聚感”——轻微发亮，然后缓慢变暗（无跳变） */
@keyframes mas-map-region-connected-gather {
  0% {
    filter:
      brightness(1.06)
      drop-shadow(0 0 10px rgba(0, 207, 255, 0.20))
      drop-shadow(0 0 26px rgba(56, 189, 248, 0.12))
      drop-shadow(0 0 16px rgba(253, 224, 71, 0.22));
    opacity: 1;
  }
  100% {
    filter:
      brightness(1.02)
      drop-shadow(0 0 10px rgba(0, 207, 255, 0.22))
      drop-shadow(0 0 26px rgba(56, 189, 248, 0.12))
      drop-shadow(0 0 0 rgba(253, 224, 71, 0));
    opacity: 0.96;
  }
}

/* 接入机构节点：错相闪烁 + 光晕（科技感） */
@keyframes mas-map-edge-blink {
  0%,
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.9));
  }
  48% {
    opacity: 0.2;
    filter: drop-shadow(0 0 16px rgba(253, 224, 71, 1));
  }
  58% {
    opacity: 1;
    filter: drop-shadow(0 0 7px rgba(245, 158, 11, 0.95));
  }
}
.mas-map-node--edge {
  /* 之前跑 mas-map-edge-blink × 19 节点的 filter drop-shadow 动画，
     上轮删了。本轮把静态 drop-shadow 也删——19 个 GPU layer。
     改用 stroke 双色描边表达"亮点"语义。 */
  stroke: rgba(254, 243, 199, 0.95);
  stroke-width: 1.6;
}

/* 中心医院三角标 + 涟漪：双拍心跳（缩放），原点为 translate 后的接入点 */
@keyframes mas-map-hub-heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  8% {
    transform: scale(1.34);
  }
  17% {
    transform: scale(1);
  }
  26% {
    transform: scale(1.22);
  }
  38% {
    transform: scale(1);
  }
}
.mas-map-hub-heart {
  transform-box: fill-box;
  transform-origin: center center;
  animation: mas-map-hub-heartbeat 1.45s cubic-bezier(0.32, 0, 0.18, 1) infinite;
}
.mas-map-hub-label {
  transform-box: fill-box;
  transform-origin: center center;
  animation: mas-map-hub-heartbeat 1.45s cubic-bezier(0.32, 0, 0.18, 1) infinite;
}
.mas-map-hub-core {
  animation: none;
}

@keyframes mas-map-link-flow {
  to {
    stroke-dashoffset: -51;
  }
}
.mas-map-link-line {
  stroke-dashoffset: 0;
  animation: mas-map-link-flow 2.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .mas-map-node--edge,
  .mas-map-hub-core,
  .mas-map-link-line,
  .mas-map-hub-heart,
  .mas-map-hub-label {
    animation: none !important;
  }
  .mas-map-hub-heart {
    transform: scale(1);
  }
  .mas-map-hub-label {
    transform: scale(1);
  }
  .mas-map-region--connected {
    animation: none !important;
  }
  .mas-map-inflow-particles {
    display: none;
  }
}

.mas-map-tooltip {
  display: none; position: absolute;
  background: rgba(10,30,56,0.95); color: #e8edf3;
  padding: 5px 10px; border-radius: 6px;
  font-size: calc(12px * var(--fs-scale)); font-weight: 500;
  white-space: nowrap; pointer-events: none;
  border: 1px solid var(--mas-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 10;
}

/* ============ USER DROPDOWN MENU ============ */
.mas-user-wrapper {
  position: relative;
}
.mas-user-menu {
  position: absolute; top: 48px; right: 0;
  width: 240px; background: var(--mas-bg-card-solid);
  border: 1px solid var(--mas-border);
  border-radius: 12px; overflow: hidden;
  box-shadow: var(--mas-shadow-lg);
  z-index: 200;
  animation: mas-fadeInUp 0.2s ease;
}
.mas-user-menu-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; background: rgba(0,0,0,0.15);
  border-bottom: 1px solid var(--mas-border-light);
}
.mas-user-menu-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--mas-accent), #6c5ce7);
  display: flex; align-items: center; justify-content: center;
  font-size: calc(16px * var(--fs-scale)); font-weight: 700; flex-shrink: 0;
}
.mas-user-menu-divider {
  height: 1px; background: var(--mas-border-light);
}
.mas-user-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: calc(13px * var(--fs-scale));
  color: var(--mas-text-dim); cursor: pointer;
  transition: all 0.15s;
}
.mas-user-menu-item:hover {
  background: rgba(58, 146, 230,0.1); color: var(--mas-text);
}
.mas-user-menu-item.mas-logout {
  color: var(--mas-danger);
}
.mas-user-menu-item.mas-logout:hover {
  background: rgba(231,76,60,0.1);
}

/* ============ ABOUT PAGE（占满主内容区：与侧栏相邻整列拉满） ============ */
.mas-main-content--about {
  flex: 1;
  min-width: 0;
  width: auto;
  max-width: none;
  padding: 24px 0;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
.mas-page-about {
  width: 100%;
  max-width: none;
  flex: 1;
  min-width: 0;
  min-height: calc(100vh - 56px - 48px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.mas-page-about-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-radius: 0;
  width: 100%;
}
.mas-page-about-card .mas-card-body {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1400px) {
  .mas-diag-layout { grid-template-columns: 300px 1fr 1fr; }
}
@media (max-width: 1200px) {
  .mas-home-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
    min-height: calc(100vh - 180px);
  }
  .mas-home-map-section {
    grid-column: 1;
    grid-row: auto;
  }
  .mas-home-right {
    grid-column: 1;
    grid-row: auto;
  }
  .mas-stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* ── Login / auth pages ─────────────────────────────────────── */
.mas-login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0d1b2e 0%, #1a3a6b 100%);
  padding: 24px;
  z-index: 100;
}
.mas-login-card {
  width: 100%; max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 40px 32px 28px;
  box-shadow: 0 30px 80px rgba(13, 27, 46, .35);
}
.mas-login-header { text-align: center; margin-bottom: 24px; }
/* 白底登录卡：标题此前无 color，继承深色主题近白文字 → 白卡上隐形。显式给深色。 */
.mas-login-card .mas-login-header h1 { color: #17263f; letter-spacing: .5px; }
.mas-login-card .mas-login-header p { color: #6b7a90; }
.mas-login-form { display: flex; flex-direction: column; gap: 16px; }
/* 登录卡片是白底，全局 .mas-form-input 用的是深色主题的浅色文字，会看不清。
   在白底卡片内覆盖为深色文字 + 浅色输入背景。 */
.mas-login-card .mas-form-label { color: #4a5568; }
.mas-login-card .mas-form-input {
  background: #f5f7fa; border-color: #d9e1ec; color: #1a2332;
}
.mas-login-card .mas-form-input::placeholder { color: #9aa7b8; }
.mas-login-card .mas-form-input:focus { border-color: var(--mas-accent); }
.mas-login-error {
  background: #fff1f0; border: 1px solid #ffa39e; color: #cf1322;
  padding: 8px 12px; border-radius: 6px;
  font-size: calc(12px * var(--fs-scale));
}
.mas-login-submit {
  margin-top: 8px;
  background: var(--mas-accent);
  color: #fff; border: 0; border-radius: 8px;
  padding: 12px 16px; font-size: calc(14px * var(--fs-scale)); font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.mas-login-submit:hover:not(:disabled) { background: #1d6dc3; }
.mas-login-submit:disabled { opacity: .6; cursor: not-allowed; }
.mas-login-footer {
  margin-top: 28px; padding-top: 16px;
  border-top: 1px solid var(--mas-border-light);
  font-size: calc(11px * var(--fs-scale)); color: var(--mas-text-muted);
  text-align: center;
}
.mas-login-demo-grid {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 6px;
}
.mas-login-demo-grid span {
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.mas-login-demo-grid span:hover { color: var(--mas-accent); }

/* ── Profile / change-password centered cards ───────────────── */
.mas-profile-section { max-width: 720px; margin: 0 auto; }
.mas-profile-row {
  display: grid; grid-template-columns: 140px 1fr;
  padding: 14px 0; border-bottom: 1px solid var(--mas-border-light);
  font-size: calc(13px * var(--fs-scale));
}
.mas-profile-row:last-child { border-bottom: 0; }
.mas-profile-row .mas-profile-key { color: var(--mas-text-muted); }
.mas-profile-row .mas-profile-val { color: var(--mas-text); font-weight: 500; }
.mas-profile-empty { color: var(--mas-text-muted); font-style: italic; }

.mas-pwd-field { position: relative; display: flex; }
.mas-pwd-field .mas-form-input { flex: 1; padding-right: 56px; }
.mas-pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer;
  color: var(--mas-accent); font-size: calc(12px * var(--fs-scale)); padding: 4px 8px;
}
.mas-pwd-success {
  background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d;
  padding: 8px 12px; border-radius: 6px;
  font-size: calc(12px * var(--fs-scale));
}

/* ─── Prompt Lab ────────────────────────────────────────── */
.mas-prompt-lab { padding: 16px; }
.mas-prompt-lab-header h2 { margin: 0; }
.mas-prompt-lab-controls { margin: 12px 0; }
.mas-prompt-lab-controls label { font-size: 13px; color: var(--mas-text-muted); margin-right: 6px; }
.mas-prompt-lab-tabs { border-bottom: 1px solid var(--mas-border); margin: 12px 0; }
.mas-prompt-lab-tabs button {
  background: none; border: none; padding: 8px 16px; cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--mas-text-dim); font-size: 13px;
}
.mas-prompt-lab-tabs button:hover {
  color: var(--mas-accent-light);
  background: rgba(58, 146, 230, 0.06);
}
.mas-prompt-lab-tabs button.active {
  color: var(--mas-accent-light);
  border-bottom-color: var(--mas-accent);
  font-weight: 600;
}

.prompt-lab-edit-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px;
}
.prompt-lab-col { display: flex; flex-direction: column; min-width: 0; }
.prompt-lab-col h3 { margin: 0 0 8px; font-size: 14px; }
.prompt-lab-col textarea {
  width: 100%; box-sizing: border-box; font-family: 'JetBrains Mono', monospace;
  font-size: 13px; padding: 8px;
}
.prompt-lab-prompt-meta { margin-bottom: 8px; font-size: 12px; }
.prompt-lab-prompt-meta select { max-width:100%; }
.prompt-lab-dirty { color: #c66; margin-left: 8px; }
.prompt-lab-char-count {
  text-align: right; font-size: 11px; color: var(--mas-text-muted); margin-top: 4px;
}
/* Prompt Lab 完整 prompt 展示：固定部分只读、模态段可编辑 */
.pl-fixed-label { font-size: 11px; color: var(--mas-text-muted); margin: 8px 0 4px; font-weight: 600; }
.pl-edit-label { font-size: 12px; color: var(--mas-accent-light); margin: 10px 0 4px; font-weight: 700; }
.pl-fixed {
  background: rgba(0,0,0,0.04); border: 1px dashed var(--mas-border);
  border-radius: 4px; padding: 8px 10px; margin: 0;
  font-size: 11px; line-height: 1.5; color: var(--mas-text-muted);
  white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto;
}
.pl-fixed-details { margin-top: 6px; }
/* 多模型结果：每个模型一块，用分隔线区分 */
.pl-provider-block { border-top: 1px solid var(--mas-border); padding-top: 10px; margin-top: 10px; }
.pl-provider-block:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.pl-fixed-details > summary { list-style: none; }
.pl-link {
  background: none !important; border: none !important; color: var(--mas-accent-light) !important;
  padding: 0 !important; margin-left: 8px; font-size: 11px !important; cursor: pointer;
  text-decoration: underline;
}
.prompt-lab-run-btn {
  margin-top: 12px; padding: 10px 24px; font-weight: 600;
  background: var(--mas-accent); color: white;
  border: none; border-radius: 4px; cursor: pointer;
}
.prompt-lab-run-btn:hover:not(:disabled) { background: var(--mas-accent-light); }
.prompt-lab-run-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.prompt-lab-col button {
  background: var(--mas-bg-card-solid); color: var(--mas-text);
  border: 1px solid var(--mas-border); border-radius: 4px;
  padding: 6px 12px; cursor: pointer; font-size: 13px;
}
.prompt-lab-col button:hover:not(:disabled) {
  background: var(--mas-accent); color: white; border-color: var(--mas-accent);
}
.prompt-lab-col button:disabled { opacity: 0.4; cursor: not-allowed; }
.prompt-lab-col select, .prompt-lab-col input[type="file"] {
  background: var(--mas-bg-card-solid); color: var(--mas-text);
  border: 1px solid var(--mas-border); border-radius: 4px;
  padding: 4px 8px; font-size: 13px;
}
.prompt-lab-history-filters select,
.prompt-lab-history-filters input,
.prompt-lab-history-filters button {
  background: var(--mas-bg-card-solid); color: var(--mas-text);
  border: 1px solid var(--mas-border); border-radius: 4px;
  padding: 4px 8px; font-size: 13px;
}
.prompt-lab-history-pager button {
  background: var(--mas-bg-card-solid); color: var(--mas-text);
  border: 1px solid var(--mas-border); border-radius: 4px;
  padding: 4px 12px; cursor: pointer;
}
.prompt-lab-history-pager button:disabled { opacity: 0.4; cursor: not-allowed; }
.prompt-lab-images-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px;
}
.prompt-lab-img-card {
  border: 1px solid var(--mas-border); border-radius: 4px; padding: 6px;
}
.prompt-lab-img-thumb {
  position: relative; width: 100%; aspect-ratio: 1; background: #f3f3f3;
  display: flex; align-items: center; justify-content: center;
}
.prompt-lab-img-thumb img { max-width: 100%; max-height: 100%; }
.prompt-lab-img-duration {
  position: absolute; right: 5px; bottom: 5px; z-index: 2;
  padding: 3px 6px; border-radius: 999px; color: #fff;
  background: rgba(15,23,42,.82); font-size: 10px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(15,23,42,.2);
}
.prompt-lab-img-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 4px; }
.prompt-lab-img-remove {
  background: none; border: none; cursor: pointer; margin-left: auto;
}
.prompt-lab-run-status { font-weight: 600; margin-bottom: 8px; }
.prompt-lab-run-status.failed { color: #c66; }
.prompt-lab-rendered, .prompt-lab-json {
  background: #fafafa; color: #1f2937;
  padding: 10px; border-radius: 4px;
  max-height: 400px; overflow: auto;
  font-family: ui-monospace, 'JetBrains Mono', SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; line-height: 1.5;
}
.prompt-lab-rendered pre, .prompt-lab-json pre {
  margin: 0; white-space: pre-wrap; word-break: break-word; color: inherit;
}
.prompt-lab-rendered h4 { color: #1f2937; margin: 0 0 6px; font-size: 13px; }
.prompt-lab-rendered-block { margin-top: 8px; }
.prompt-lab-rendered-block:first-of-type { margin-top: 0; }
.prompt-lab-rendered-label {
  font-size: 12px; font-weight: 600; color: #2563eb;
  margin-bottom: 3px;
}

/* ── 服务器日志页 ───────────────────────────── */
.mas-server-logs { padding: 4px 0; }
.mas-logs-controls {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 12px 0; font-size: 13px;
}
.mas-logs-controls select, .mas-logs-controls button {
  padding: 4px 10px; border: 1px solid var(--mas-border, #d0d7de);
  border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px;
}
.mas-logs-controls button:hover { background: #f3f4f6; }
.mas-logs-status { margin-left: auto; color: var(--mas-text-muted); }
.mas-logs-status.live { color: #16a34a; font-weight: 600; }
.mas-logs-viewport {
  height: calc(100vh - 240px); min-height: 320px; overflow-y: auto;
  background: #0d1117; color: #c9d1d9; border-radius: 8px; padding: 10px 12px;
  font-family: ui-monospace, 'JetBrains Mono', SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; line-height: 1.55;
}
.mas-log-line {
  white-space: pre-wrap; word-break: break-word; padding: 1px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.mas-log-ts { color: #6e7681; margin-right: 8px; }
.mas-log-level { display: inline-block; min-width: 62px; font-weight: 600; margin-right: 6px; }
.mas-log-name { color: #58a6ff; margin-right: 8px; }
.mas-log-msg { color: #c9d1d9; }
.mas-log-line.lvl-info .mas-log-level { color: #3fb950; }
.mas-log-line.lvl-warning .mas-log-level { color: #d29922; }
.mas-log-line.lvl-warning .mas-log-msg { color: #e3b341; }
.mas-log-line.lvl-error .mas-log-level,
.mas-log-line.lvl-error .mas-log-msg { color: #f85149; }
.mas-log-line.lvl-critical .mas-log-level,
.mas-log-line.lvl-critical .mas-log-msg { color: #ff7b72; font-weight: 600; }
.mas-log-line.lvl-debug .mas-log-level { color: #8b949e; }
.prompt-lab-empty { color: var(--mas-text-muted); padding: 20px 0; text-align: center; }
.prompt-lab-error { color: #c66; padding: 8px; background: #fee; border-radius: 4px; }

@media (max-width: 1280px) {
  .prompt-lab-edit-grid { grid-template-columns: 1fr; }
}

.prompt-lab-history-filters {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
  align-items: center;
}
.prompt-lab-history-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.prompt-lab-history-table th,
.prompt-lab-history-table td {
  padding: 8px; border-bottom: 1px solid var(--mas-border); text-align: left;
}
.prompt-lab-history-table tr:hover {
  background: rgba(58, 146, 230, 0.08); cursor: pointer;
}
.prompt-lab-status-success { color: #2a8; }
.prompt-lab-status-failed { color: #c66; }
.prompt-lab-history-pager {
  margin-top: 12px; display: flex; align-items: center; gap: 8px;
}

.prompt-lab-drawer {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 1000; display: flex; justify-content: flex-end;
}
.prompt-lab-drawer-inner {
  background: white; width: min(720px, 90vw); height: 100vh;
  overflow: auto; padding: 16px; box-shadow: -4px 0 12px rgba(0,0,0,0.1);
}
.prompt-lab-drawer-header { display: flex; align-items: center; justify-content: space-between; }
.prompt-lab-drawer-header button { background: none; border: none; font-size: 24px; cursor: pointer; }
.prompt-lab-drawer-images {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px;
}
.prompt-lab-drawer-img { position: relative; aspect-ratio: 1; }
.prompt-lab-drawer-img img { width: 100%; height: 100%; object-fit: contain; background: #f3f3f3; }
.prompt-lab-drawer-img-side {
  position: absolute; top: 4px; left: 4px;
  background: rgba(0,0,0,0.6); color: white; padding: 2px 6px; border-radius: 2px; font-size: 11px;
}
.prompt-lab-img-expired {
  width: 100%; height: 100%; background: #fee; color: #c66;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.prompt-lab-drawer-emr, .prompt-lab-drawer-prompt {
  background: #fafafa; color: #1f2937;
  padding: 10px; border-radius: 4px;
  max-height: 300px; overflow: auto; white-space: pre-wrap;
  font-family: ui-monospace, 'JetBrains Mono', SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; line-height: 1.5;
}

/* 账号管理表单字段 */
.mas-admu-field { display: flex; flex-direction: column; gap: 4px; font-size: calc(13px * var(--fs-scale)); color: var(--mas-text); }
.mas-admu-field > span { color: var(--mas-text-muted); }
.mas-admu-input {
  padding: 7px 10px; border: 1px solid var(--mas-border); border-radius: 6px;
  background: var(--mas-bg); color: var(--mas-text);
  font-size: calc(13px * var(--fs-scale)); outline: none;
}
.mas-admu-input:focus { border-color: var(--mas-accent); }
