:root {
  font:
    15px/1.5 Inter,
    'PingFang SC',
    'Microsoft YaHei',
    system-ui,
    sans-serif;
  background: #f2f5ef;
  color: #213e36;
  --ink: #153c34;
  --line: #d8e0d6;
  --muted: #567067;
  --surface: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
select,
input[type='checkbox'] {
  cursor: pointer;
}
button,
a,
select {
  touch-action: manipulation;
}
button {
  border: 1px solid #c8d4c8;
  background: #fff;
  border-radius: 6px;
  padding: 5px 10px;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid #ca8646;
  outline-offset: 2px;
}
button[aria-pressed='true'],
.primary {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
a {
  color: #165545;
  text-underline-offset: 3px;
}
[hidden] {
  display: none !important;
}
nav,
.tabs,
.viewbar > div,
.play-row,
.stations,
.items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
nav {
  font-size: 13px;
  gap: 16px;
}
main {
  max-width: 1440px;
  margin: auto;
  padding: 24px clamp(14px, 3.8vw, 64px);
}
.heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: clamp(25px, 2.8vw, 37px);
  line-height: 1.2;
}
h2,
.field strong {
  font-size: 17px;
}
.tabs {
  background: #e4ebe2;
  border-radius: 7px;
  padding: 3px;
}
.tabs button,
.tabs a {
  background: transparent;
  border: 0;
  font-size: 14px;
  padding: 5px 11px;
  text-decoration: none;
}
.tabs button[aria-pressed='true'] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px #1d493217;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 315px);
  gap: 16px;
  align-items: start;
}
.board,
.card,
footer {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
}
.board-head,
.viewbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 15px;
}
.board-head p,
.card p,
footer p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.58;
}
.board-head > span {
  font-size: 12px;
  color: var(--muted);
}
.canvas-wrap {
  position: relative;
  background: radial-gradient(ellipse at 48% 38%, #fbfbf5, #e7ece1);
  height: clamp(330px, 63vh, 690px);
  overflow: hidden;
}
.canvas-wrap canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  display: block;
}
#loading,
#empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #f6f8f2ed;
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 8px;
  display: grid;
  gap: 5px;
  text-align: center;
  font-size: 13px;
  min-width: 170px;
}
progress {
  width: 100%;
  accent-color: var(--ink);
}
.viewbar {
  border-bottom: 1px solid var(--line);
}
.viewbar button {
  font-size: 12px;
}
.card {
  padding: 15px;
  margin-bottom: 10px;
}
.card > * + * {
  margin-top: 9px;
}
.field,
.select-row label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.select-row {
  display: grid;
  grid-template-columns: 93px minmax(0, 1fr);
  gap: 8px;
}
.select-row label,
.range,
.play-row label,
.field,
fieldset label {
  font-size: 13px;
}
select {
  background: #fafcf8;
  border: 1px solid #c8d4c8;
  border-radius: 6px;
  padding: 6px 8px;
  max-width: 100%;
  min-width: 0;
}
.field select {
  width: 100%;
}
#partName,
#partInfo {
  display: block;
}
.items a,
.stations button,
#muscleAction,
#boneAction {
  font-size: 13px;
}
.items a,
.stations button {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.items a {
  text-decoration: none;
}
.stations button[aria-pressed='true'] {
  border-color: var(--ink);
}
.guide {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.guide button, #focusBone, #relatedParts button { min-height: 35px; font-size: 13px; }
.guide output { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
#relatedPanel { border-top: 1px solid var(--line); padding-top: 9px; }
#relatedPanel h3 { margin: 0 0 6px; font-size: 14px; }
#focusBone { margin-top: 7px; }
.range {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 45px;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
}
input {
  accent-color: #287564;
}
input[type='range'] {
  width: 100%;
}
.range output {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
fieldset {
  border: none;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 15px;
  padding: 6px 15px 12px;
}
fieldset legend {
  padding-top: 7px;
  font-weight: 600;
  font-size: 13px;
}
fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
fieldset label:has(input:disabled) {
  opacity: 0.4;
}
fieldset i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.bone {
  background: #e5d1a5;
}
.muscle {
  background: #bd6153;
}
.fascia {
  background: #4daea1;
}
.nerve {
  background: #e9b928;
}
.vessel {
  background: linear-gradient(to right, #be3935 50%, #4c7fc4 50%);
}
footer {
  margin-top: 16px;
  padding: 10px 15px;
  font-size: 13px;
}
footer summary {
  cursor: pointer;
}
footer p {
  margin: 7px 0;
}
.play-row button {
  font-size: 13px;
}
@media (max-width: 800px) {
  main {
    padding: 12px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 255px;
    gap: 9px;
  }
  .card {
    padding: 11px;
  }
  .tabs button,
  .tabs a {
    padding: 5px 7px;
  }
  .canvas-wrap {
    height: 55vh;
  }
}
@media (max-width: 620px) {
  nav {
    gap: 9px;
    font-size: 12px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .workspace > * {
    width: 100%;
  }
  .canvas-wrap {
    height: 43svh;
    min-height: 250px;
  }
  .viewbar {
    flex-wrap: wrap;
  }
  .heading {
    margin-bottom: 10px;
  }
  .tabs {
    gap: 0;
  }
  .tabs button,
  .tabs a {
    font-size: 12px;
    padding: 5px 7px;
  }
  .card {
    margin: 0 0 7px;
  }
  fieldset {
    gap: 4px 9px;
  }
}
