:root {
  /* 浅色苹果医疗风（顶部 + 3D 解剖区） */
  --light-bg: #f3f7fb;
  --light-surface: #ffffff;
  --light-border: rgba(15, 23, 42, 0.09);
  --light-text: #0f172a;
  --light-muted: #64748b;

  /* 深黑医院 PACS 灯箱风（MRI 阅片区） */
  --dark-bg: #080b10;
  --dark-surface: #11161f;
  --dark-border: rgba(148, 163, 184, 0.16);
  --dark-text: #f1f5f9;
  --dark-muted: #94a3b8;

  /* 品牌强调色 */
  --sky: #0284c7;
  --cyan: #22d3ee;
  --rose: #e11d48;
  --rose-bright: #f43f5e;
  --topbar-h: 54px;
  --footer-h: 30px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--light-bg);
  color: var(--light-text);
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ==================== Top Header (Apple Clinical Light) ==================== */
.topbar {
  height: var(--topbar-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--light-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.28);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.brand-name small {
  font-size: 10px;
  font-weight: 700;
  color: var(--sky);
  background: rgba(2, 132, 199, 0.1);
  padding: 1px 6px;
  border-radius: 99px;
  margin-left: 3px;
  vertical-align: middle;
}

.brand-sub {
  font-size: 11px;
  color: var(--light-muted);
}

.case-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #edf2f7;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  overflow-x: auto;
  scrollbar-width: none;
}
.case-tabs::-webkit-scrollbar { display: none; }

.case-tab {
  border: none;
  background: transparent;
  color: #475569;
  padding: 5px 14px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.case-tab:hover {
  color: #0f172a;
}

.case-tab.active {
  background: #ffffff;
  color: var(--sky);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.topbar-actions {
  flex-shrink: 0;
}

.btn-video {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 9px;
  border: none;
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(225, 29, 72, 0.28);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-video:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(225, 29, 72, 0.38);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.8);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.8); }
  70% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* ==================== Main Split Workspace ==================== */
.workspace {
  height: calc(100vh - var(--topbar-h) - var(--footer-h));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(15, 23, 42, 0.12);
}

.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
}

.pane-mri {
  background: var(--dark-bg);
  color: var(--dark-text);
}

.pane-3d {
  background: var(--light-bg);
  color: var(--light-text);
}

.pane-header {
  height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.pane-header-dark {
  background: #0d121a;
  border-bottom: 1px solid var(--dark-border);
}

.pane-header-light {
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--light-border);
}

.pane-title-group {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.pane-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(34, 211, 238, 0.14);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.3);
  flex-shrink: 0;
}

.pane-badge.badge-3d {
  background: rgba(2, 132, 199, 0.1);
  color: var(--sky);
  border-color: rgba(2, 132, 199, 0.25);
}

.pane-subtitle {
  font-size: 12px;
  color: var(--light-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plane-switch {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--dark-border);
  border-radius: 7px;
  padding: 2px;
}

.plane-btn {
  border: none;
  background: transparent;
  color: var(--dark-muted);
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.plane-btn.active {
  background: rgba(34, 211, 238, 0.22);
  color: #ecfeff;
  font-weight: 600;
}

.header-chip {
  border: 1px solid var(--dark-border);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.header-chip:hover {
  border-color: var(--cyan);
  color: #ffffff;
}

.header-chip:not(.active) {
  background: rgba(34, 211, 238, 0.18);
  border-color: rgba(34, 211, 238, 0.5);
  color: var(--cyan);
}

.slice-readout {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #e2e8f0;
  flex-shrink: 0;
}

.coord-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.28);
}

/* ==================== MRI Stage with Zhiying Bilateral Leader Pins ==================== */
.mri-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 118px;
  align-items: center;
  justify-items: center;
  padding: 12px 10px 54px;
  background: radial-gradient(circle at center, #111620 0%, #05070a 100%);
  overflow: hidden;
  cursor: ns-resize;
  user-select: none;
  touch-action: none;
}

.mri-leaders {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.mri-img-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  max-width: min(100%, 460px);
  max-height: min(100%, 460px);
  aspect-ratio: 1 / 1;
  z-index: 2;
}

.mri-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.18), 0 14px 36px rgba(0, 0, 0, 0.72);
  pointer-events: none;
}

.orient {
  position: absolute;
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(203, 213, 225, 0.8);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}
.orient-top { top: 6px; left: 50%; transform: translateX(-50%); }
.orient-bottom { bottom: 6px; left: 50%; transform: translateX(-50%); }
.orient-left { left: 7px; top: 50%; transform: translateY(-50%); }
.orient-right { right: 7px; top: 50%; transform: translateY(-50%); }

/* Bilateral Callout Columns (Zhiying signature style!) */
.pin-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  z-index: 6;
  pointer-events: none;
}

.pin-col-left {
  align-items: flex-end;
  padding-right: 4px;
}

.pin-col-right {
  align-items: flex-start;
  padding-left: 4px;
}

.mri-pin-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 112px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(20, 27, 38, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  transition: all 0.15s ease;
}

.mri-pin-pill:hover,
.mri-pin-pill.active {
  background: #ffffff;
  color: #0f172a;
  border-color: #ffffff;
  font-weight: 700;
  transform: scale(1.03);
}

.mri-pin-pill.is-lesion {
  border-color: rgba(244, 63, 94, 0.65);
  background: rgba(45, 16, 26, 0.94);
  color: #ffe4e6;
}

.mri-pin-pill.is-lesion.active,
.mri-pin-pill.is-lesion:hover {
  background: #f43f5e;
  color: #ffffff;
  border-color: #fb7185;
}

.mri-pin-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mri-stage.labels-hidden .pin-col,
.mri-stage.labels-hidden .mri-leaders {
  opacity: 0;
  pointer-events: none;
}

/* Bottom 1-line Clinical Reading Tip Card (Zhiying signature!) */
.mri-tip-card {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 9px;
  background: rgba(18, 24, 34, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  pointer-events: none;
}

.tip-badge {
  font-size: 11px;
  font-weight: 700;
  color: #ecfeff;
  background: rgba(34, 211, 238, 0.18);
  border: 1px solid rgba(34, 211, 238, 0.35);
  padding: 1px 7px;
  border-radius: 5px;
  flex-shrink: 0;
}

.tip-text {
  font-size: 12px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== MRI Scrubber Controls ==================== */
.mri-controls {
  height: 50px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0d121a;
  border-top: 1px solid var(--dark-border);
  flex-shrink: 0;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--dark-border);
  background: #17202e;
  color: var(--dark-text);
  font-size: 11px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.slider-wrap {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.28);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid #082f49;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.65);
  cursor: pointer;
}

.pane-3d input[type="range"] {
  background: rgba(15, 23, 42, 0.14);
}

.pane-3d input[type="range"]::-webkit-slider-thumb {
  background: var(--sky);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.45);
}

.slider-ticks {
  position: relative;
  height: 6px;
  margin-top: 3px;
  pointer-events: none;
}

.slider-tick {
  position: absolute;
  top: 0;
  width: 4px;
  height: 6px;
  border-radius: 2px;
  transform: translateX(-50%);
  opacity: 0.9;
}

.pill-btn {
  border: 1px solid var(--dark-border);
  background: #17202e;
  color: var(--dark-text);
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pill-btn:hover { border-color: var(--cyan); }
.pill-btn.active {
  background: rgba(34, 211, 238, 0.2);
  border-color: var(--cyan);
  color: #ecfeff;
  font-weight: 600;
}

.pill-btn-light {
  background: #f1f5f9;
  color: #334155;
  border-color: rgba(15, 23, 42, 0.12);
}

.pill-btn-light.active {
  background: var(--sky);
  border-color: var(--sky);
  color: #ffffff;
}

/* ==================== 3D Light Clinical Studio ==================== */
.view-presets {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mini-btn {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #ffffff;
  color: #475569;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.mini-btn:hover {
  color: #0f172a;
  border-color: rgba(2, 132, 199, 0.35);
}

.mini-btn.active {
  color: #ffffff;
  background: var(--sky);
  border-color: var(--sky);
  font-weight: 600;
}

.viewport-3d {
  flex: 1;
  min-height: 0;
  position: relative;
  /* Zhiying-inspired crisp Apple clinical ice-white studio gradient */
  background: radial-gradient(circle at 50% 42%, #ffffff 0%, #eef4fa 65%, #e2ebf4 100%);
  overflow: hidden;
}

#threeCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ==================== 3D Bilateral Live Leader-Line Callouts (Zhiying Style) ==================== */
.leaders-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}

.pin3d-col {
  position: absolute;
  top: 14px;
  bottom: 106px;
  width: 118px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
  z-index: 8;
}

.pin3d-col-left {
  left: 10px;
  align-items: flex-start;
}

.pin3d-col-right {
  right: 10px;
  align-items: flex-end;
}

.pin3d-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 114px;
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: #1e293b;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  transition: all 0.14s ease;
}

.pin3d-pill:hover,
.pin3d-pill.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  transform: scale(1.03);
}

.pin3d-pill.is-focus {
  border-color: rgba(244, 63, 94, 0.45);
  background: rgba(255, 241, 242, 0.95);
  color: #be123c;
}

.pin3d-pill.is-focus.active,
.pin3d-pill.is-focus:hover {
  background: #e11d48;
  color: #ffffff;
  border-color: #e11d48;
}

.viewport-3d.labels-hidden .leaders-3d,
.viewport-3d.labels-hidden .pin3d-col {
  opacity: 0;
  pointer-events: none;
}

.loading-mask {
  position: absolute;
  inset: 0;
  background: rgba(243, 247, 251, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 20;
  color: var(--light-muted);
  font-size: 13px;
  transition: opacity 0.25s ease;
}

.loading-mask.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(2, 132, 199, 0.18);
  border-top-color: var(--sky);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.case-badge-3d {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: 245px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  pointer-events: none;
  z-index: 8;
}

.case-badge-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.case-badge-desc {
  font-size: 11px;
  color: #475569;
  line-height: 1.42;
}

.anatomy-tooltip {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  color: #f8fafc;
  font-size: 12px;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
}

.anatomy-tooltip small {
  color: #94a3b8;
  margin-left: 6px;
}

/* 3D Frosted Glass Control Dock */
.control-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 12;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(15, 23, 42, 0.09);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.09);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.lesion-master-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.lesion-master-btn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.lesion-master-btn.active {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.42);
  color: #be123c;
}

.lesion-master-btn.active .dot {
  background: #f43f5e;
  box-shadow: 0 0 6px rgba(244, 63, 94, 0.7);
}

.lesion-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.lesion-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 99px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #ffffff;
  color: #1e293b;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lesion-chip:hover {
  transform: translateY(-1px);
  border-color: var(--sky);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.lesion-chip .swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.opacity-control {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 165px;
  font-size: 12px;
  color: #475569;
  font-weight: 500;
}

.opacity-control input[type="range"] {
  flex: 1;
  max-width: 135px;
}

.opacity-control .mono {
  width: 34px;
  text-align: right;
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 600;
}

.dock-toggles {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.toggle-chip {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #f8fafc;
  color: #475569;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.toggle-chip.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.4);
  color: #0369a1;
  font-weight: 600;
}

.video-inline-btn {
  border-color: rgba(225, 29, 72, 0.35);
  color: #be123c;
  background: rgba(244, 63, 94, 0.08);
  font-weight: 600;
}

.video-inline-btn:hover {
  background: rgba(244, 63, 94, 0.16);
}

/* ==================== Footer ==================== */
.footer {
  height: var(--footer-h);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-top: 1px solid var(--light-border);
  font-size: 10.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer strong {
  color: #334155;
  font-weight: 600;
}

/* ==================== Surgery Micro-Animation Modal ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-backdrop[hidden] { display: none; }

.modal-card {
  width: min(580px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h2 { font-size: 16px; color: #0f172a; }
.modal-head p { font-size: 12px; color: #64748b; margin-top: 2px; }

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(244, 63, 94, 0.12);
  color: #e11d48;
}

.video-count {
  font-style: normal;
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.24);
  font-size: 11px;
  font-weight: 700;
  margin-left: 2px;
}

.video-tabs {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.video-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: #475569;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.video-tab:hover { color: #0f172a; }

.video-tab.active {
  background: #ffffff;
  color: #e11d48;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.video-frame {
  position: relative;
  border-radius: 11px;
  overflow: hidden;
  background: #000;
}

.video-frame video {
  width: 100%;
  display: block;
  max-height: 52vh;
  object-fit: contain;
}

.video-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(8, 12, 18, 0.78);
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: var(--cyan);
}

.video-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.video-btns { display: flex; gap: 6px; }
.video-tip { font-size: 11px; color: #64748b; }

.video-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 12.5px;
  color: #334155;
}

.mobile-expand-btn {
  display: none;
}

/* ==================== Mobile Responsive (知影同款一屏闭环：上 3D 不遮挡 + 下 MRI 拇指滑块常驻) ==================== */
@media (max-width: 900px) {
  html, body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .topbar {
    height: auto;
    padding: 6px 10px;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
  }

  .brand-mark { width: 26px; height: 26px; border-radius: 7px; }
  .brand-name { font-size: 14px; }
  .brand-sub { display: none; }

  .btn-video {
    padding: 5px 10px;
    font-size: 11.5px;
  }

  .case-tabs {
    order: 3;
    width: 100%;
    padding: 3px;
    justify-content: space-between;
  }

  .case-tab {
    flex: 1;
    text-align: center;
    padding: 4px 4px;
    font-size: 11.5px;
  }

  .workspace {
    flex: 1;
    min-height: 0;
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: 46% 54%;
  }

  /* 手机端：上 3D 展台，下 MRI 灯箱（拇指滑动切层完全不遮挡 3D 模型！） */
  .pane-3d { order: 1; }
  .pane-mri { order: 2; }

  .pane-header {
    height: 34px;
    min-height: 34px;
    padding: 0 8px;
    flex-wrap: nowrap;
  }

  .pane-badge,
  .pane-subtitle,
  .case-badge-3d,
  .hide-mobile,
  .footer {
    display: none;
  }

  .view-presets {
    width: 100%;
    justify-content: space-between;
  }

  .mini-btn {
    padding: 2px 7px;
    font-size: 11px;
  }

  .plane-btn,
  .header-chip {
    padding: 2px 7px;
    font-size: 11px;
  }

  .slice-readout {
    font-size: 11px;
    gap: 5px;
  }

  .coord-pill {
    font-size: 10px;
    padding: 1px 5px;
  }

  .mri-stage {
    grid-template-columns: 76px minmax(0, 1fr) 76px;
    padding: 4px 4px 28px;
  }

  .mri-pin-pill {
    max-width: 74px;
    padding: 2px 5px;
    font-size: 10px;
  }

  .mri-tip-card {
    left: 6px;
    right: 6px;
    bottom: 3px;
    padding: 3px 7px;
    border-radius: 6px;
  }

  .tip-badge { font-size: 9.5px; padding: 1px 5px; }
  .tip-text { font-size: 10.5px; }

  .mri-controls {
    height: 44px;
    padding: 0 8px;
    gap: 7px;
  }

  .icon-btn { width: 26px; height: 26px; }
  .pill-btn { padding: 4px 8px; font-size: 11px; }

  .pin3d-col {
    top: 6px;
    bottom: 46px;
    width: 76px;
    gap: 5px;
  }

  .pin3d-col-left { left: 5px; }
  .pin3d-col-right { right: 5px; }

  .pin3d-pill {
    max-width: 74px;
    padding: 2px 5px;
    font-size: 10px;
  }

  /* 手机端默认收起为单行紧凑条，彻底把 3D 模型露出来！ */
  .mobile-expand-btn {
    display: inline-flex;
  }

  .control-dock {
    left: 6px;
    right: 6px;
    bottom: 6px;
    padding: 6px 8px;
    gap: 6px;
    border-radius: 10px;
  }

  .control-dock.collapsed-mobile .dock-extra {
    display: none;
  }

  .control-dock .dock-toggles {
    width: 100%;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .control-dock .toggle-chip {
    padding: 3px 6px;
    font-size: 10.5px;
  }
}
