/* 反射弧特有样式（通用样式见 ../shared/base.css） */

#reflex { position: absolute; inset: 0; touch-action: pan-y; }
[hidden] { display: none !important; }

#panel h2 .h2s { font-size: 11px; color: var(--muted); font-weight: normal; margin-left: 6px; letter-spacing: 0; }

/* 场景与操作 */
.seg.wide { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
.seg.wide button { border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 8px; padding: 6px 4px; font-size: 12px; }
.seg.wide button:first-child, .seg.wide button:last-child { border-radius: 8px; }
.actions button { font: inherit; font-size: 13px; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 0; cursor: pointer; }
.actions button:hover:not(:disabled) { border-color: var(--accent); }
.actions button:disabled { opacity: .4; cursor: default; }
.actions button { width: 100%; }
.speed { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 受损部位 */
.lesionGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.lesionGrid button { font: inherit; font-size: 13px; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 0; cursor: pointer; }
.lesionGrid button:hover { border-color: var(--accent); }
.lesionGrid button.on { background: rgba(255,201,74,.14); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.lesionGrid button:last-child { grid-column: 1 / -1; }

/* 对照表 */
.cmp { width: 100%; border-collapse: collapse; font-size: 12px; }
.cmp th, .cmp td { padding: 4px 6px; border: 1px solid var(--line); vertical-align: top; text-align: left; }
.cmp th { color: var(--muted); font-weight: 600; background: var(--panel-2); }
.cmp td:first-child { color: var(--muted); white-space: nowrap; }
.cmp td.yes { color: #7ee081; }
.cmp td.no { color: #ff8a80; }
.cmp tbody tr.on td { background: rgba(255,201,74,.12); color: var(--accent); }
.cmp.five td:first-child { color: var(--text); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }

/* 练习 */
.q { font-size: 14px; line-height: 1.6; margin: 0 0 8px; }
.opts { display: grid; gap: 6px; }
.opts .opt { font: inherit; font-size: 13px; line-height: 1.45; text-align: left; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.opts .opt:hover:not(.ok):not(.bad) { border-color: var(--accent); }
.opts .opt.ok { border-color: #7ee081; background: rgba(126,224,129,.14); color: #c8f5ca; }
.opts .opt.bad { border-color: #ff6b6b; background: rgba(255,107,107,.14); color: #ffc4c4; }
#quizFb { color: #cfd6e0; }
#quizScore { color: var(--muted); }

#app {
  --panel: #0d131f;
  --panel-2: #151e2d;
  --line: #253247;
  --muted: #a2afc4;
  --panel-w: 330px;
}
#stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #05070d; }
.lab-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 22px; border-bottom: 1px solid #1c2636; background: #0a0f19;
}
.lab-header h1 { font-size: 18px; line-height: 1.25; margin: 0; }
.lab-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.outcomes { display: flex; gap: 6px; }
.outcomes span {
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
#motionState.on { color: #ffd07b; border-color: #725833; background: #332719; }
#senseState.on { color: #e3c1ff; border-color: #665083; background: #291e3b; }

#specimen { position: relative; min-height: 0; overflow: hidden; }
#partDetail {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 24px); margin: 0; padding: 6px 10px;
  background: #101a29; border: 1px solid var(--line); border-radius: 8px;
  font-size: 12px; pointer-events: none;
}
.lab-footer { padding: 10px 18px 12px; border-top: 1px solid #1c2636; background: #0a0f19; }
.pathway { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.pathway button {
  position: relative; min-height: 42px; padding: 8px 2px 5px;
  font: inherit; font-size: 12px; color: var(--text); cursor: pointer;
  background: #101825; border: 1px solid var(--line); border-radius: 7px; overflow: hidden;
}
.pathway button::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
  background: var(--c); opacity: .45;
}
.pathway button.reached::before { width: var(--p); opacity: 1; }
.pathway button:hover, .pathway button[aria-pressed=true] { border-color: var(--c); }
.pathway button.active { color: var(--c); background: color-mix(in srgb, var(--c) 13%, #101825); }
.pathway button.blocked { border-color: #ff6573; color: #ff9ca5; }
.pathway button.blocked::after { content: '×'; margin-left: 2px; }
.lab-actions { display: flex; align-items: center; gap: 7px; }
.lab-actions button, .lab-actions a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: #151e2d;
  font: inherit; font-size: 12px; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.lab-actions a { margin-left: auto; background: transparent; color: var(--muted); }
#stimBtn { background: var(--accent); color: #1c1508; border-color: var(--accent); font-weight: 700; }
#stimBtn:hover { background: #ffda7f; }
.lab-actions #panelToggle { display: none; position: static; border-radius: 8px; }
#panel { padding: 14px 14px 22px; }
#panel h2 { color: #d4dfef; font-size: 13px; letter-spacing: 0; }
#panel .readout { margin: 0 0 12px; background: #111a29; }
.readout dl { margin-top: 0; font-size: 12px; }
#rNote { color: #bac9dd; }
.seg.wide button, .actions button, .lesionGrid button, .opts .opt { min-height: 42px; }
.speed .seg button, .checks label { min-height: 40px; }
.checks label { display: flex; align-items: center; gap: 4px; }
#reference { padding: 10px 0; border-top: 1px solid var(--line); }
#reference summary { cursor: pointer; color: #c3d0e3; font-size: 13px; }
#reference table { margin-top: 8px; }
button:focus-visible, .lab-actions a:focus-visible, #reference summary:focus-visible { outline: 2px solid #9adeff; outline-offset: -3px; }
@media (max-width: 760px) {
  #app { display: flex; flex-direction: column; }
  #stage { position: relative; inset: auto; min-height: 0; }
  #panel { position: relative; inset: auto; max-height: 43%; transform: none; border-radius: 0; }
  #panel.collapsed { display: none; }
  .seg.wide { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .lesionGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .lesionGrid button:last-child { grid-column: auto; }
  .seg.wide button, .actions button, .lesionGrid button, .opts .opt { min-height: 44px; }
  .lab-header { padding: 9px 12px; }
  .lab-header h1 { font-size: 16px; }
  .outcomes span { font-size: 11px; padding: 3px 5px; }
  .lab-footer { padding: 7px 8px; }
  .pathway { gap: 3px; }
  .pathway button { font-size: 11px; min-height: 44px; }
  .lab-actions button, .lab-actions a { min-height: 44px; padding: 0 7px; font-size: 11px; }
  .lab-actions #panelToggle { display: inline-flex; }
  .lab-actions #panelToggle[aria-expanded=true] { border-color: #6b819f; }
}

/* 场景切换始终紧邻示意图，时间轴可暂停检查任一传导阶段。 */
#stage { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.lab-header { background: #0c1320; }
#sceneSeg {
  padding: 8px 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid #1c2636;
  background: #0a101a;
}
#sceneSeg button { min-height: 38px; background: #111a29; }
#sceneSeg button.on { background: #24334a; border-color: #6782a4; color: #f2f6ff; }
#timeline {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 10px; color: var(--muted); font-size: 12px;
}
#timeline input { width: 100%; height: 30px; margin: 0; cursor: ew-resize; }
#timeline output { min-width: 76px; text-align: right; font-variant-numeric: tabular-nums; }
#panel { border-color: #263650; }
#panel h2 { font-size: 15px; }
#panel section:first-child:not([hidden]), #panel #readout { margin-top: 4px; }
#lesionSec summary { cursor: pointer; color: #c3d0e3; font-size: 13px; padding: 8px 0; }
#panel #quizSec { border-top: 0; padding-top: 0; }
#quizQ { font-size: 15px; }
#quizFb:empty { display: none; }
#quizNext:not(:disabled) { background: #25354e; border-color: #6782a4; }
@media (max-width: 760px) {
  #sceneSeg { padding: 4px 8px; }
  #sceneSeg button { min-height: 44px; }
  #panel { max-height: 39%; padding: 8px 10px 18px; border-top: 1px solid #344762; }
  #timeline { gap: 6px; font-size: 11px; }
  #timeline input { height: 42px; }
  #timeline output { min-width: 75px; font-size: 11px; }
  .lab-header { padding-block: 7px; }
  .lab-footer { padding-block: 5px; }
}
