/* ==========================================================
   声音花园 · 样式
   色板：晨雾白 #F2F6ED / 嫩叶绿 #8DB66B / 深叶绿 #315C3B
         湿润土壤 #6B4935 / 金盏黄 #F2BE4B / 牡丹粉 #D86C86 / 天空蓝 #A9D5DF
   ========================================================== */

:root {
  --mist: #F2F6ED;
  --mist-2: #E7EFE0;
  --leaf: #8DB66B;
  --leaf-deep: #315C3B;
  --soil: #6B4935;
  --gold: #F2BE4B;
  --pink: #D86C86;
  --sky: #A9D5DF;
  --ink: #2C3A33;
  --ink-soft: #5A6B60;
  --line: #C9D6C4;
  --card: rgba(252, 254, 250, .92);
  --danger: #B4543E;
  --display: "STKaiti", "KaiTi", "Songti SC", serif;
  --body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --shadow: 0 10px 40px rgba(49, 92, 59, .16);
  --r-lg: 18px;
  --r-md: 12px;
}

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

/* hidden 属性优先级最高，防止 display:flex/grid 覆盖导致浮层常显 */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  touch-action: manipulation;
}

.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ============ 品牌栏 ============ */

.brandbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 6px 18px;
  background: linear-gradient(180deg, #FBFDF8, #F4F8F0);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

/* 统一 logo：36px 圆形轮廓 + 三个同色小圆点（与全站一致） */
.brand-mark {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid rgba(49, 92, 59, .65);
  border-radius: 50%;
  background: #FBFDF8;
  box-shadow: inset -8px -2px 0 rgba(139, 182, 107, .14);
}

.brand-mark i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--leaf-deep);
}

.brand-mark i:nth-child(1) { left: 10px; top: 9px; }
.brand-mark i:nth-child(2) { left: 16px; top: 16px; }
.brand-mark i:nth-child(3) { left: 22px; top: 20px; }

.brand strong {
  font: 700 16px/1.25 var(--display);
  letter-spacing: .08em;
  white-space: nowrap;
}

.brand-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: .04em;
  white-space: nowrap;
}

/* ============ 主舞台 ============ */

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: var(--mist-2);
}

#garden {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.stage-head {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 0;
  pointer-events: none;
}

.stage-title h1 {
  font: 700 19px/1.3 var(--display);
  letter-spacing: .12em;
  color: var(--leaf-deep);
  text-shadow: 0 1px 0 rgba(255,255,255,.7);
}

.hint {
  margin-top: 2px;
  font-size: 13px;
  color: var(--ink-soft);
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
  max-width: 34em;
  transition: opacity .5s;
}

/* 一分钟环：距下一批花开的时间 */
.minuteclock {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
}

.mc-ring {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
}

.mc-ring svg { width: 100%; height: 100%; }

.mc-bg { fill: rgba(255,255,255,.7); stroke: #DCE7D4; stroke-width: 4; }
.mc-fg {
  fill: none;
  stroke: var(--leaf);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dasharray .25s linear;
}

.mc-ring b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--leaf-deep);
  font-variant-numeric: tabular-nums;
}

.mc-label {
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-soft);
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}

/* ---- 状态区 ---- */

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(49,92,59,.08);
  font-size: 13px;
  white-space: nowrap;
}

.chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.chip-sub { font-style: normal; font-size: 11px; color: var(--ink-soft); }

.pbar {
  position: relative;
  width: 110px;
  height: 7px;
  border-radius: 999px;
  background: #DCE7D4;
  overflow: hidden;
}

.pbar em {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--leaf), #6FA054);
  transition: width .5s linear;
}

/* ---- 圆形响度仪（独立浮层，五段色带对应五档声音） ---- */

.gauge-panel {
  position: absolute;
  top: 66px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 13px 15px 11px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(49, 92, 59, .16);
  backdrop-filter: blur(8px);
  z-index: 5;
}

.gauge-wrap {
  position: relative;
  width: 116px;
  height: 116px;
}

.gauge { width: 100%; height: 100%; display: block; }

.gauge-face { fill: rgba(255,255,255,.7); stroke: none; }
.gauge-ring { fill: none; stroke: var(--line); stroke-width: 1; }

.gauge-segs circle {
  fill: none;
  stroke: #DCE7D4;
  stroke-width: 9;
  transition: stroke .35s;
}

.gauge-segs circle.active { stroke: var(--gold); }
.gauge-segs circle.active.good { stroke: #5E9A4C; }

.gauge-needle {
  stroke: var(--leaf-deep);
  stroke-width: 3;
  stroke-linecap: round;
}

#dbVal {
  font-size: 27px;
  font-weight: 700;
  color: var(--leaf-deep);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.db-center {
  position: absolute;
  left: 50%; top: 56%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.db-unit {
  font-size: 12px;
  font-style: normal;
  color: var(--ink-soft);
  line-height: 1;
}

.gauge-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.gauge-side i {
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  line-height: 1.35;
}

/* ---- 工具栏 ---- */

.toolbar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  transition: opacity .6s, transform .6s;
  max-width: calc(100% - 24px);
}

.toolbar.idle {
  opacity: .14;
}

.toolbar.idle:hover { opacity: 1; }

.tbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  font: 600 14px/1 var(--body);
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}

.tbtn svg { width: 17px; height: 17px; fill: currentColor; flex: 0 0 auto; }
.tbtn:hover { background: rgba(141, 182, 107, .16); }
.tbtn:active { transform: translateY(1px); }

.tbtn.primary {
  background: var(--leaf-deep);
  color: #F7FBF3;
}

.tbtn.primary:hover { background: #3C7048; }

.tbtn.locked {
  background: rgba(180, 84, 62, .1);
  color: var(--danger);
  position: relative;
  overflow: hidden;
}

.tbtn.locked::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: rgba(180, 84, 62, .18);
  transition: width .1s linear;
}

.tbtn.locked.holding::after { width: 100%; transition: width 2s linear; }

.tsep { width: 1px; height: 22px; background: var(--line); flex: 0 0 1px; }

.testbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  background: rgba(169, 213, 223, .25);
  border: 1px solid rgba(107, 155, 168, .35);
  font-size: 13px;
  color: #33565F;
}

.testbox label { font-weight: 600; white-space: nowrap; }
.testbox b { font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }

.testbox input[type="range"] {
  width: 130px;
  accent-color: #3D7A8C;
}

/* ---- 提示气泡 ---- */

.toasts {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 40;
}

.toast {
  padding: 9px 16px;
  border-radius: 10px;
  background: rgba(44, 58, 51, .88);
  color: #F2F6ED;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: toastIn .3s ease;
  max-width: min(86vw, 480px);
  text-align: center;
}

.toast.out { opacity: 0; transition: opacity .4s; }

@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* ============ 覆盖层与面板 ============ */

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(180deg, rgba(242,246,237,.30), rgba(242,246,237,.55));
  z-index: 30;
  overflow-y: auto;
}

.overlay-dim { background: rgba(38, 52, 44, .45); }
.overlay-clear { background: radial-gradient(circle at 50% 55%, rgba(255,252,240,.35), rgba(242,246,237,.15)); pointer-events: none; }

.panel {
  background: var(--card);
  border: 1px solid rgba(201, 214, 196, .9);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  width: min(560px, 100%);
  backdrop-filter: blur(10px);
}

.panel h2 {
  font: 700 20px/1.35 var(--display);
  letter-spacing: .06em;
  color: var(--leaf-deep);
}

.panel-sub { margin-top: 4px; font-size: 13.5px; color: var(--ink-soft); }

/* ---- 开始面板 ---- */

.mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0 16px;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 15px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: rgba(255,255,255,.75);
  font-family: var(--body);
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.mode-card svg { width: 26px; height: 26px; color: var(--leaf); flex: 0 0 auto; }
.mode-card b { font-size: 16px; color: var(--ink); white-space: nowrap; }
.mode-card span { font-size: 12.5px; line-height: 1.55; color: var(--ink-soft); }

.mode-card[aria-checked="true"] {
  border-color: var(--leaf-deep);
  background: rgba(141, 182, 107, .14);
  box-shadow: 0 4px 14px rgba(49, 92, 59, .12);
}

.mode-card[aria-checked="true"] svg,
.mode-card[aria-checked="true"] b { color: var(--leaf-deep); }

.field { margin-bottom: 14px; }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

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

.fchip {
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: rgba(255,255,255,.7);
  font: 600 13px/1 var(--body);
  color: var(--ink);
  cursor: pointer;
  transition: all .15s;
}

.fchip:hover { border-color: var(--leaf); }
.fchip[aria-pressed="true"], .fchip.active {
  background: var(--leaf-deep);
  border-color: var(--leaf-deep);
  color: #F7FBF3;
}

.custom-min {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px 0 4px;
  border-radius: 999px;
  border: 1.5px dashed var(--line);
  background: rgba(255,255,255,.5);
}

.custom-min:focus-within { border-color: var(--leaf); border-style: solid; }

.custom-min input {
  width: 62px;
  border: none;
  background: transparent;
  font: 600 13px var(--body);
  color: var(--ink);
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.custom-min input::-webkit-outer-spin-button,
.custom-min input::-webkit-inner-spin-button { -webkit-appearance: none; }

.custom-min i { font-style: normal; font-size: 12px; color: var(--ink-soft); }

.resume-link {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1.5px dashed var(--gold);
  background: rgba(242, 190, 75, .12);
  color: #8A6A1F;
  font: 600 13.5px var(--body);
  cursor: pointer;
  text-align: left;
}

.resume-link:hover { background: rgba(242, 190, 75, .22); }

.test-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--ink);
  margin-bottom: 16px;
  cursor: pointer;
}

.test-toggle input { width: 17px; height: 17px; accent-color: var(--leaf-deep); }

button.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: var(--r-md);
  background: var(--leaf-deep);
  color: #F7FBF3;
  font: 700 15.5px var(--body);
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .2s, transform .1s;
}

button.primary:hover { background: #3C7048; }
button.primary:active { transform: translateY(1px); }
button.primary svg { width: 16px; height: 16px; fill: currentColor; }
button.primary.big { width: 100%; }
button.primary.alt { background: #B4543E; }
button.primary.alt:hover { background: #C4664F; }

.privacy {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.setup-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--line);
}

.linkbtn {
  border: none;
  background: none;
  color: var(--ink-soft);
  font: 600 13px var(--body);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(90,107,96,.4);
  padding: 6px 4px;
}

.linkbtn:hover { color: var(--leaf-deep); }

/* ---- 校准面板 ---- */

.calib-panel { width: min(430px, 100%); text-align: center; }

.calib-ring {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 18px auto 10px;
}

.calib-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.ring-bg { fill: none; stroke: #DCE7D4; stroke-width: 8; }
.ring-fg {
  fill: none;
  stroke: var(--gold);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 364.4;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .2s linear;
}

.calib-ring b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 40px/1 var(--body);
  color: var(--leaf-deep);
  font-variant-numeric: tabular-nums;
}

.calib-hint { font-size: 15px; color: var(--ink); min-height: 1.6em; margin-bottom: 14px; }

.calib-meter {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #DCE7D4;
  overflow: hidden;
  margin-bottom: 18px;
}

.calib-meter em {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--sky), var(--leaf));
  transition: width .18s linear;
}

.calib-meter i {
  position: absolute;
  top: -2px; bottom: -2px;
  left: 30%;
  width: 3px;
  border-radius: 2px;
  background: var(--soil);
}

button.ghost {
  height: 42px;
  padding: 0 18px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: rgba(255,255,255,.6);
  color: var(--ink);
  font: 600 14px var(--body);
  cursor: pointer;
}

button.ghost:hover { border-color: var(--leaf); color: var(--leaf-deep); }

/* ---- 倒计时 ---- */

.cd-num {
  font: 700 108px/1 var(--body);
  color: var(--leaf-deep);
  text-shadow: 0 2px 0 rgba(255,255,255,.8);
  animation: cdPop 1s ease-out infinite;
}

.cd-sub {
  position: absolute;
  margin-top: 150px;
  font: 600 15px var(--display);
  letter-spacing: .2em;
  color: var(--ink-soft);
}

@keyframes cdPop {
  0% { transform: scale(1.25); opacity: .2; }
  30% { transform: scale(1); opacity: 1; }
  100% { transform: scale(.96); opacity: .85; }
}

/* ---- 总结面板 ---- */

.summary-panel { width: min(470px, 100%); }

.stats {
  list-style: none;
  margin: 16px 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.stats li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  font-size: 14px;
  background: rgba(255,255,255,.6);
}

.stats li + li { border-top: 1px solid var(--line); }
.stats li span { color: var(--ink-soft); }
.stats li b { font-variant-numeric: tabular-nums; font-size: 16px; color: var(--leaf-deep); }

.summary-note {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row .primary { flex: 1 1 auto; }

/* ---- 通用模态 ---- */

.modal-panel { width: min(430px, 100%); }
.modal-panel p { margin: 10px 0 18px; font-size: 14px; line-height: 1.7; color: var(--ink); }

/* ============ 设置抽屉 ============ */

.scrim {
  position: absolute;
  inset: 0;
  background: rgba(38, 52, 44, .3);
  z-index: 45;
}

.drawer {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(380px, 92vw);
  background: #FBFDF8;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(49, 92, 59, .18);
  z-index: 50;
  display: flex;
  flex-direction: column;
  animation: drawerIn .28s ease;
}

@keyframes drawerIn { from { transform: translateX(30px); opacity: 0; } }

.drawer-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 { font: 700 17px/1.3 var(--display); letter-spacing: .06em; color: var(--leaf-deep); }

.iconbtn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.iconbtn svg { width: 16px; height: 16px; }
.iconbtn:hover { border-color: var(--leaf); }

.drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 18px 18px;
}

.drawer-body fieldset {
  border: none;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}

.drawer-body legend {
  font: 700 13px var(--body);
  letter-spacing: .1em;
  color: var(--leaf-deep);
  padding-bottom: 8px;
}

.radio-row { display: flex; gap: 14px; }

.radio-row label, .check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  padding: 5px 0;
}

.radio-row input, .check-row input {
  width: 17px; height: 17px;
  accent-color: var(--leaf-deep);
}

.field-note {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.slider-row {
  display: grid;
  grid-template-columns: 92px 1fr 52px;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13.5px;
}

.slider-row output {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 600;
  color: var(--leaf-deep);
}

.slider-row input[type="range"] { width: 100%; accent-color: var(--leaf-deep); }

.select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
}

.select-row select {
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: #fff;
  font: 600 13.5px var(--body);
  color: var(--ink);
}

.drawer-foot {
  padding: 14px 0 6px;
  font-size: 12px;
  color: var(--ink-soft);
}

.drawer-foot p { margin-top: 8px; line-height: 1.6; }

/* ============ 焦点与无障碍 ============ */

:focus-visible {
  outline: 3px solid #2C6E49;
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ============ 响应式 ============ */

@media (max-width: 860px) {
  .brand-note { display: none; }
  .stage-head { padding: 12px 14px 0; flex-direction: column; }
  .status { justify-content: flex-start; }
  .chip { height: 28px; font-size: 12px; padding: 0 10px; }
  .pbar { width: 84px; }
  .gauge-panel { top: 54px; right: 12px; padding: 9px 10px 8px; gap: 5px; }
  .gauge-wrap { width: 80px; height: 80px; }
  #dbVal { font-size: 19px; }
  .db-unit { font-size: 9px; }
  .gauge-side { display: none; }
  .stage-title h1 { font-size: 16px; }
  .hint { font-size: 12.5px; }
  .toolbar { bottom: 12px; gap: 2px; padding: 6px; }
  .tbtn { height: 40px; padding: 0 12px; font-size: 13px; }
  .tbtn span { display: none; }
  .tbtn svg { width: 19px; height: 19px; }
  #btnPauseText, .tbtn.primary span { display: inline; }
  .testbox { height: 40px; }
  .testbox input[type="range"] { width: 92px; }
  .panel { padding: 20px 18px; }
  .mode-cards { grid-template-columns: 1fr; gap: 9px; }
  .mode-card { flex-direction: row; align-items: center; gap: 12px; }
  .mode-card span br { display: none; }
}

/* 手机端：设置面板改为底部抽屉 */
@media (max-width: 640px) {
  .drawer {
    top: auto;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    max-height: 82dvh;
    border-left: none;
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    animation: sheetIn .3s ease;
  }

  @keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } }

  .slider-row { grid-template-columns: 84px 1fr 46px; }
  .tbtn span { display: none; }
  #btnPauseText { display: inline; }
  .brandbar { padding: 5px 12px; }
  .brand strong { font-size: 14px; }
  .cd-num { font-size: 84px; }
}

@media (max-width: 400px) {
  .tbtn { padding: 0 10px; }
  .testbox label { display: none; }
}

/* 大屏投影：整体更清晰的字号 */
@media (min-width: 1700px) {
  .stage-title h1 { font-size: 22px; }
  .hint { font-size: 15px; }
  .chip { font-size: 14px; height: 34px; }
  .tbtn { font-size: 15px; }
}

/* ============ 减少动态效果 ============ */

@media (prefers-reduced-motion: reduce) {
  .cd-num { animation: none; }
  .toolbar, .pbar em, .smeter em, .calib-meter em { transition-duration: .1s; }
  .toast { animation: none; }
  .drawer { animation: none; }
}
