:root {
  /* 亳州学院校色：取自学校官网 style.css（.header → #003781，辅助色 #005f99，点缀金 #cc943a） */
  --brand: #003781;
  --brand-deep: #00295f;
  --brand-2: #005f99;
  --brand-tint: #eaf1f9;
  --brand-line: #cfdcec;

  /* 宣纸工作区（暖底）＋ 冷调墨色，和校蓝搭在一起才不脏 */
  --paper: #f7f4ee;
  --paper-2: #fffdf8;
  --ink: #1f2530;
  --ink-2: #55607a;
  --ink-3: #8b93a3;
  --line: #dcd8cf;
  --line-2: #ece8e0;

  /* 语义色：蓝=品牌与结构，红=动作高亮与警示，青=达标，金=点缀 */
  --cinnabar: #a8382b;
  --cinnabar-2: #c45a49;
  --bamboo: #3f6f5a;
  --gold: #cc943a;
  --gold-tint: #f4e9d3;

  /* 五禽五色：同一明度/饱和度区间，只换色相，摆在一起才像一套 */
  --wu-hu: #a8382b; /* 虎 · 赭赤 */
  --wu-lu: #3f6f5a; /* 鹿 · 竹青 */
  --wu-xiong: #a9743b; /* 熊 · 赭黄 */
  --wu-yuan: #4a4a48; /* 猿 · 墨灰 */
  --wu-niao: #2f6fa8; /* 鸟 · 天青（呼应校蓝） */
  --wu-neutral: #8b93a3; /* 起势 / 收势 */

  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 37, 48, 0.05), 0 8px 24px rgba(31, 37, 48, 0.07);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* 手机上地址栏会吃掉一段高度，用 dvh 才不会多出一条空白 */
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
}

button,
select,
input[type="range"] {
  touch-action: manipulation; /* 去掉手机上双击缩放带来的延迟 */
}

h1,
h2,
h3 {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.02em;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  padding: 7px 14px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.06s ease, color 0.15s ease;
}

button:hover:not(:disabled) {
  border-color: var(--ink-3);
  background: #fff;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

button.primary:hover:not(:disabled) {
  background: var(--brand-2);
  border-color: var(--brand-2);
}

button.big {
  padding: 12px 30px;
  font-size: 16px;
  letter-spacing: 0.14em;
}

button.danger {
  color: var(--cinnabar);
  border-color: #e3c9c2;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 1px;
}

select.ghost {
  border-radius: 10px;
  padding: 7px 8px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 9px 20px 10px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
  border-bottom: 3px solid var(--gold);
  flex-wrap: wrap;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}

.brandLogo {
  height: 34px;
  width: auto;
  display: block;
  /* 校徽是反白版，只放在深色底上；四周留出安全间距 */
  margin-right: 2px;
}

.brandText h1 {
  font-size: 17px;
  color: #fff;
}

.brandText p {
  margin: 0;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.04em;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 11px;
}

.tab {
  border: none;
  background: transparent;
  padding: 6px 18px;
  color: rgba(255, 255, 255, 0.82);
  border-radius: 8px;
}

.tab.is-active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(0, 20, 50, 0.22);
  font-weight: 600;
}

/* 顶栏标签在蓝底上：悬停要提亮而不是变白底，否则白字白底看不见 */
.tabs .tab:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  border-color: transparent;
  color: #fff;
}

.tabs .tab.is-active:hover:not(:disabled) {
  background: #fff;
  color: var(--brand);
}

.topActions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.topActions button.ghost,
.topActions select.ghost {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.topActions button.ghost:hover:not(:disabled),
.topActions select.ghost:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.55);
}

.topActions select.ghost option {
  color: var(--ink);
}

.topActions button:disabled {
  color: rgba(255, 255, 255, 0.45);
}

/* ---------- 布局 ---------- */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  padding: 16px 20px 24px;
  align-items: start;
  min-height: 0;
}

.stageWrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.stage {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  background: #1b1916;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.stage.mirror video,
.stage.mirror canvas {
  transform: scaleX(-1);
}

.stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #1b1916;
}

.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stage.empty video {
  visibility: hidden;
}

.stageBadges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 18, 16, 0.62);
  backdrop-filter: blur(8px);
  color: #f7f2e8;
  font-size: 13px;
}

.badge b {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.badge i {
  font-style: normal;
  color: #d8cfbe;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.badge.small {
  margin-left: auto;
  font-size: 11.5px;
  color: #ded6c6;
  font-variant-numeric: tabular-nums;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-3);
  align-self: center;
}

.dot.on {
  background: #78c08a;
  box-shadow: 0 0 0 4px rgba(120, 192, 138, 0.22);
}

.dot.warn {
  background: #e0a24b;
  box-shadow: 0 0 0 4px rgba(224, 162, 75, 0.22);
}

.coachBar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(20, 18, 16, 0.62);
  backdrop-filter: blur(8px);
  color: #f2ece0;
  font-size: 13px;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.coachBar.ok {
  background: rgba(35, 74, 58, 0.74);
}

.coachBar.warn {
  background: rgba(122, 74, 24, 0.78);
}

/* 达标瞬间的提示：只在达标那一刻闪现一次，不长期占屏幕 */
.passFlash {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) scale(0.86);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 26px;
  border-radius: 14px;
  background: rgba(35, 74, 58, 0.86);
  border: 1px solid rgba(203, 224, 210, 0.5);
  color: #f2f8f4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.passFlash b {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 30px;
  letter-spacing: 0.18em;
  line-height: 1.1;
}

.passFlash span {
  font-size: 12.5px;
  color: #cfe3d6;
  letter-spacing: 0.04em;
}

.passFlash.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.screen {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 40, 95, 0.93) 0%, rgba(0, 22, 51, 0.95) 100%);
  color: #f4efe4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 28px;
  backdrop-filter: blur(3px);
}

.startLogo {
  height: 52px;
  width: auto;
  display: block;
  margin-bottom: 4px;
}

#startScreen h2 + p {
  color: var(--gold);
  letter-spacing: 0.08em;
}

.screen.hidden,
.hidden {
  display: none !important;
}

.screen h2 {
  font-size: 24px;
  letter-spacing: 0.16em;
}

.screen p {
  margin: 0;
  max-width: 560px;
  color: #ddd5c6;
  font-size: 13.5px;
}

.screen .tips {
  text-align: left;
  color: #cfc7b8;
  font-size: 13px;
  margin: 0;
  padding-left: 20px;
  max-width: 560px;
}

.screen .tiny {
  color: #9d968a;
}

/* 校准/准备：不能挡住画面，只压暗上下两条，中间留出来让人看自己站得对不对 */
.screen.live {
  background: linear-gradient(
    180deg,
    rgba(20, 18, 16, 0.74) 0%,
    rgba(20, 18, 16, 0.12) 30%,
    rgba(20, 18, 16, 0.1) 56%,
    rgba(20, 18, 16, 0.8) 100%
  );
  backdrop-filter: none;
  justify-content: space-between;
  padding: 18px 20px 22px;
}

.screen.live .screenTop,
.screen.live .screenBottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.screen.live h2,
.screen.live p,
.screen.live .countdown {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.9);
}

.screen.live .countdown {
  font-size: 46px;
}

.screen.live .bar {
  width: min(420px, 60%);
}

.screen.live .screenTop p {
  max-width: 640px;
}

.tiny {
  font-size: 11.5px;
  color: var(--ink-3);
  margin: 8px 0 0;
}

.bar {
  width: min(420px, 70%);
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.bar.learnBar {
  width: 100%;
  height: 5px;
  background: #eee7d8;
  margin: 10px 0 4px;
}

.checkLine {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}

.checkLine input[type="checkbox"] {
  accent-color: var(--cinnabar);
  width: 15px;
  height: 15px;
}

.selectLine {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  font-size: 12.5px;
  color: var(--ink-2);
}

.selectLine span {
  flex: none;
}

.selectLine select {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 12.5px;
  padding: 5px 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
}

.bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cinnabar), var(--gold));
  transition: width 0.12s linear;
}

.countdown {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 64px;
  line-height: 1;
  color: var(--gold);
}

.stageFoot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
}

/* 画面下方那块：把"练的时候要瞄一眼"的信息填满，别让下面空一大片 */
.underStage {
  gap: 10px;
}

.underStage .scoreCard {
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
}

.underStage .scoreRing {
  width: 78px;
  height: 78px;
}

.underStage .scoreRing span {
  font-size: 26px;
}

.underStage .scoreRing small {
  bottom: 12px;
}

.underStage .scoreMeta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 12px;
}

.underStage .scoreMeta b {
  font-size: 19px;
}

.chip {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink-2);
}

.chip.good {
  border-color: #cbe0d2;
  background: #f1f8f3;
  color: var(--bamboo);
}

.chip.bad {
  border-color: #eccfc7;
  background: #fdf3f0;
  color: var(--cinnabar);
}

/* ---------- 侧栏 ---------- */
.side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 4px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.cardHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card h3 {
  font-size: 14.5px;
  color: var(--ink);
  margin-bottom: 10px;
}

/* 卡片标题下的一条细线：蓝→金，作为全站统一的装饰语言 */
.card h3::after {
  content: "";
  display: block;
  width: 26px;
  height: 2px;
  margin-top: 6px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--gold));
}

.cardHead h3::after {
  margin-top: 5px;
}

.cardHead h3 {
  margin-bottom: 0;
}

.hint {
  font-size: 11.5px;
  color: var(--ink-3);
}

.brief {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--ink-2);
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.segmented {
  display: flex;
  gap: 3px;
  background: #eceae4;
  border-radius: 9px;
  padding: 3px;
}

.seg {
  border: none;
  background: transparent;
  padding: 4px 12px;
  font-size: 12.5px;
  border-radius: 7px;
  color: var(--ink-2);
}

.seg.is-active {
  background: var(--paper-2);
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(31, 37, 48, 0.1);
}

.poseGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.poseBtn {
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--wu, var(--wu-neutral));
  background: #fdfbf6;
  border-radius: 10px;
  padding: 8px 6px 7px;
  text-align: center;
  line-height: 1.25;
}

.poseBtn .animal {
  display: block;
  font-size: 10.5px;
  color: var(--wu, var(--ink-3));
  letter-spacing: 0.1em;
}

.poseBtn .name {
  display: block;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 15px;
  margin-top: 1px;
}

.poseBtn.is-active {
  border-color: var(--brand);
  border-left-color: var(--wu, var(--brand));
  background: var(--brand-tint);
  box-shadow: inset 0 0 0 1px rgba(0, 55, 129, 0.18);
  font-weight: 600;
}

.poseBtn.done {
  border-color: #cbe0d2;
  background: #f2f8f4;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.checklist li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-2);
}

.checklist .mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 10px;
  color: transparent;
}

.checklist li.ok .mark {
  background: var(--bamboo);
  border-color: var(--bamboo);
  color: #fff;
}

.checklist li.mid .mark {
  background: #e9c27a;
  border-color: #d9ac57;
  color: #4a3410;
}

.checklist li.ok {
  color: var(--ink);
}

.checklist li.pending {
  color: var(--ink-3);
}

.checklist li.pending .value {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.checklist .tagKey {
  font-style: normal;
  font-size: 10px;
  color: var(--gold);
  border: 1px solid #e6d8bb;
  border-radius: 4px;
  padding: 0 3px;
  margin-left: 4px;
  vertical-align: 1px;
}

.checklist .value {
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.scoreCard {
  display: flex;
  align-items: center;
  gap: 16px;
}

.scoreRing {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: conic-gradient(var(--cinnabar) 0deg, #eee7d8 0deg);
}

.scoreRing::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--paper-2);
}

.scoreRing span {
  position: relative;
  z-index: 1;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 30px;
  line-height: 1;
  color: var(--score-color, var(--brand));
}

.scoreRing small {
  position: absolute;
  bottom: 15px;
  z-index: 1;
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.14em;
}

.scoreMeta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  flex: 1;
}

.scoreMeta div {
  display: flex;
  flex-direction: column;
}

.scoreMeta label {
  font-size: 11px;
  color: var(--ink-3);
}

.scoreMeta b {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.advice {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.advice li {
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--brand-tint);
  border-left: 3px solid var(--brand-2);
  color: var(--ink-2);
}

.advice li.good {
  border-left-color: var(--bamboo);
  background: #f2f8f4;
}

.advice li.bad {
  border-left-color: var(--cinnabar);
  background: #fdf3f0;
}

.advice li.muted,
.muted {
  color: var(--ink-3);
  border-left-color: var(--line);
  background: transparent;
}

.ranking {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ranking li {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
}

.ranking .name {
  font-family: "Noto Serif SC", "Songti SC", serif;
  white-space: nowrap;
}

.ranking .track {
  height: 6px;
  border-radius: 3px;
  background: #eee7d8;
  overflow: hidden;
}

.ranking .track i {
  display: block;
  height: 100%;
  background: var(--wu, var(--bamboo));
  width: 0;
}

.ranking li.top .name {
  color: var(--wu, var(--cinnabar));
  font-weight: 600;
}

.ranking li.top .track i {
  background: var(--wu, var(--cinnabar));
}

.ranking .num {
  text-align: right;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
}

.featGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}

.featGrid div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
  border-bottom: 1px dashed var(--line-2);
  padding-bottom: 3px;
}

.featGrid b {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.statList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.statList b {
  float: right;
  font-variant-numeric: tabular-nums;
}

.sliderRow {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  margin: 6px 0;
  font-size: 12.5px;
  color: var(--ink-2);
}

.sliderRow input[type="range"] {
  width: 100%;
  accent-color: var(--cinnabar);
}

.sliderRow output {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  font-size: 12px;
}

.records {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.records li {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12.5px;
  background: #fdfbf6;
}

.records .recTop {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.records .recName {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 14px;
}

.records .recScore {
  color: var(--cinnabar);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.records .recMeta {
  color: var(--ink-3);
  font-size: 11.5px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: rgba(28, 25, 21, 0.92);
  color: #f4efe4;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  z-index: 50;
  max-width: min(560px, 80vw);
  text-align: center;
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .side {
    max-height: none;
    overflow: visible;
  }
  .poseGrid {
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  }
}

/* ---------- 触屏设备：可点区域与字体（与屏宽无关，横屏手机也吃得到）---------- */
/* 触屏设备，或者窗口本来就窄（两者都会让"手指点"成为主要操作方式） */
@media (pointer: coarse), (max-width: 900px) {
  button {
    min-height: 44px;
    padding: 10px 14px;
  }

  button.big {
    min-height: 52px;
  }

  select,
  input,
  .selectLine select {
    font-size: 16px; /* 小于 16px 时 iOS 聚焦会自动放大页面 */
    min-height: 40px;
  }

  .sliderRow input[type="range"] {
    min-height: 30px;
  }
}

/* ---------- 手机竖屏：页头压缩 ---------- */
@media (max-width: 700px) {
  /* 没开摄像头时画面框只有 16:9 那么高（手机竖屏约 200px），而开始页内容有 300+px，
     "开启摄像头"按钮正好在被裁掉的那一段里，点不到。
     处理：① 空画面框给足高度；② 浮层内容可滚动兜底。 */
  .stage.empty {
    min-height: min(78dvh, 420px);
  }

  #startScreen,
  #loadScreen,
  .screen {
    overflow-y: auto;
  }

  #startScreen,
  #loadScreen {
    justify-content: flex-start;
    padding: 18px;
    gap: 12px;
  }

  .startLogo {
    height: 44px;
  }

  .screen h2 {
    font-size: 20px;
  }

  .screen .tips {
    font-size: 12.5px;
  }

  /* 准备校准 / 正在校准要能看到画面，所以保持在画面框内，但内容要压得下 */
  .screen.live {
    padding: 12px 14px 14px;
    gap: 6px;
    overflow-y: auto;
  }

  .screen.live .countdown {
    font-size: 34px;
  }

  .screen.live .screenTop p,
  .screen.live p {
    font-size: 12.5px;
  }

  .topbar {
    padding: calc(6px + env(safe-area-inset-top)) 10px 7px;
    gap: 6px 8px;
    border-bottom-width: 2px;
  }

  .brand {
    min-width: 0;
    gap: 8px;
    flex: 1 1 auto;
  }

  .brandLogo {
    height: 26px;
  }

  .brandText h1 {
    font-size: 14.5px;
  }

  /* 副标题在手机上没有空间，去掉（信息在开始页里还有） */
  .brandText p {
    display: none;
  }

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

  .tab {
    flex: 1;
    min-height: 38px;
    padding: 5px 4px;
    font-size: 13px;
    text-align: center;
  }

  .topActions {
    gap: 6px;
  }

  .topActions button.ghost,
  .topActions select.ghost {
    padding: 6px 8px;
    font-size: 16px; /* 小于 16px 时 iOS 聚焦会放大整页 */
    max-width: 42vw;
  }

  .layout {
    padding: 10px 10px 20px;
    gap: 10px;
  }

  .scoreChain,
  .stage,
  .card {
    border-radius: 12px;
  }

  .checklist li {
    font-size: 13.5px;
    line-height: 1.5;
  }

  .advice li {
    font-size: 13.5px;
  }

  .side {
    gap: 10px;
  }

  .card {
    padding: 12px 13px;
  }
}

/* ---------- 横屏手机 / 矮窗口：改成左右两栏，画面限高 ---------- */
@media (max-height: 560px) {
  /* 横屏手机同样会遇到"画面框太矮、开始页被裁"的问题：内容压紧 + 允许滚动 */
  #startScreen,
  #loadScreen {
    justify-content: flex-start;
    overflow-y: auto;
    padding: 10px 14px;
    gap: 8px;
  }

  .stage.empty {
    min-height: 62dvh;
  }

  /* 横屏高度太紧：开始页的站位提示列表收起来，保证"开启摄像头"按钮一定露出来 */
  #startScreen .tips {
    display: none;
  }

  #startScreen p {
    font-size: 12px;
  }

  .startLogo {
    height: 34px;
  }

  .screen h2 {
    font-size: 18px;
  }

  .screen .tips {
    font-size: 12px;
  }

  #startScreen .tiny,
  #loadScreen .tiny {
    margin-top: 2px;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 34vw);
    align-items: start;
    padding: 8px 10px 12px;
    gap: 10px;
  }

  .side {
    max-height: calc(100dvh - 132px);
    overflow-y: auto;
  }

  .topbar {
    padding-top: calc(4px + env(safe-area-inset-top));
    padding-bottom: 5px;
    gap: 4px 8px;
  }

  .brandLogo {
    height: 24px;
  }

  .brandText p {
    display: none;
  }
}
