/* =====================================================================
   同音字消消乐 · 棋盘、字牌、模式选择

   棋盘用绝对定位摆放字牌，而不是 CSS Grid：
   下落补位要把字牌从「上一格」平滑移到「这一格」，
   绝对定位 + transform 才能做出真正的位移动画，
   Grid 只能换格子位置，看起来像瞬移（尤其是连击连消时）。
   ===================================================================== */

/* ============================ 模式选择（封面） ============================ */

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
  min-height: 52px;
  padding: 8px 11px;
  text-align: left;
  background: var(--paper-warm);
  border: 2.5px solid var(--paper-deep);
  border-radius: 14px;
  transition: transform var(--dur-fast) var(--ease-bounce),
              box-shadow var(--dur-fast),
              border-color var(--dur-fast),
              background var(--dur-fast);
  touch-action: manipulation;
}
.mode[aria-checked="true"] {
  background: #FFF4DD;
  border-color: var(--ink);
  box-shadow: 0 3px 0 var(--ink), 0 6px 12px rgba(90, 74, 58, 0.12);
  transform: translateY(-1px);
}
@media (hover: hover) {
  .mode:hover { border-color: var(--ink-soft); transform: translateY(-2px); }
}

.mode__name {
  font-family: var(--font-hand);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
}
.mode[aria-checked="true"] .mode__name { color: var(--pumpkin-deep); }

.mode__note {
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.setup__block .diff-list { margin-top: 2px; }

/* —— 显示拼音 开关 ——
   紧凑的胶囊形开关，放在难度切换上方；不占整行，靠右对齐让左侧留白。
   用 toggle 而非圆形打勾：打勾是「多选一」语义（难度卡片那种），
   而这是一个独立的二元开关。 */
.py-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  align-self: flex-end;
  padding: 3px 9px;
  border: 2px solid var(--paper-deep);
  border-radius: 999px;
  background: var(--paper-warm);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.py-switch__text {
  font-family: var(--font-hand);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}
/* 原生 checkbox 视觉隐藏，但保留可访问性与键盘操作 */
.py-switch__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
}
.py-switch__track {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 17px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-deep);
  transition: background var(--dur-fast);
}
.py-switch__knob {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  transition: transform var(--dur-fast) var(--ease-bounce);
}
.py-switch__input:checked + .py-switch__track { background: var(--sunny); }
.py-switch__input:checked + .py-switch__track .py-switch__knob { transform: translateX(15px); }
.py-switch__input:focus-visible + .py-switch__track {
  outline: 2.5px dashed var(--pumpkin);
  outline-offset: 3px;
}
.py-switch:has(.py-switch__input:checked) {
  border-color: var(--ink);
  background: #FFF4DD;
}
.py-switch:has(.py-switch__input:checked) .py-switch__text { color: var(--ink); }

/* ============================ 棋盘 ============================ */

.cr-shell {
  position: relative;
  width: min(100%, 660px);
  padding: clamp(7px, 1.6vmin, 14px);
  background: var(--paper-warm);
  border: 3px solid var(--ink);
  border-radius: clamp(18px, 3.2vmin, 28px);
  box-shadow: 0 7px 0 var(--paper-deep), 0 9px 0 var(--ink), var(--shadow-card);
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

/* —— 进度条：本局得分 / 目标分 —— */
.cr-target {
  position: relative;
  height: 10px;
  margin: 0 2px clamp(6px, 1.2vmin, 10px);
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  overflow: hidden;
}
.cr-target__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint-deep), var(--sunny-deep));
  transition: width var(--dur) var(--ease-soft);
}
.cr-target.is-near .cr-target__fill {
  background: linear-gradient(90deg, var(--sunny-deep), var(--pumpkin));
}

.cr-board {
  --cols: 6;
  --rows: 6;
  --gap: clamp(3px, 0.8vmin, 7px);
  position: relative;
  width: 100%;
  aspect-ratio: calc(var(--cols) / var(--rows));
  overflow: hidden;                 /* 补牌从棋盘上方落下时，先藏在外面 */
  /* 字牌是绝对定位，百分比按「棋盘」解析：
     width 的 100% 与 left 的 100% 都以 .cr-board 为基准，所以同一套变量两处通用 */
  --cell-w: calc((100% - var(--gap) * (var(--cols) - 1)) / var(--cols));
  --cell-h: calc((100% - var(--gap) * (var(--rows) - 1)) / var(--rows));
  /* 每格的步进 = 一格宽 + 一个间隔 */
  --step-x: calc(var(--cell-w) + var(--gap));
  --step-y: calc(var(--cell-h) + var(--gap));
}

/* —— 字牌 —— */
.cr-tile {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--cell-w);
  height: var(--cell-h);
  padding: 0;
  border: none;
  background: none;
  border-radius: clamp(8px, 2vmin, 14px);
  container-type: size;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  /* 位置用 left/top 的百分比：这两个百分比都按棋盘的宽 / 高解析，
     所以能让「第 c 列、第 r 行」精确落到格子上。
     （不能用 transform 里的百分比——那里按字牌自身尺寸算，会全部挤到左上角。） */
  left: calc(var(--c) * var(--step-x));
  top: calc(var(--r) * var(--step-y));
  transition: left var(--dur) var(--ease-soft), top var(--dur) var(--ease-soft),
              opacity var(--dur) var(--ease-soft);
}
/* 下落：加速一点的缓动，看起来像被重力拉下去 */
.cr-tile.is-falling {
  transition: left 0.26s cubic-bezier(0.3, 1.25, 0.5, 1),
              top 0.26s cubic-bezier(0.3, 1.25, 0.5, 1),
              opacity 0.2s;
}

.cr-tile__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: clamp(2px, 1.6cqmin, 3px) solid var(--ink);
  border-radius: inherit;
  background: var(--tile-c, var(--orange-soft));
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.10), 0 3px 0 rgba(90, 74, 58, 0.38);
  transition: box-shadow var(--dur-fast), transform var(--dur-fast) var(--ease-bounce), background var(--dur-fast);
  overflow: hidden;
}

.cr-tile__ch {
  font-family: "Kaiti SC", Kaiti, STKaiti, "Songti SC", serif;
  font-size: min(44cqh, 44cqw, 52px);
  font-weight: 700;
  line-height: 1;
  color: var(--ink-tile);
  transform: translateY(-4%);
}

/* 拼音默认不显示，勾选「显示拼音」后才常驻在字下方。
   不显示时字号收一档，字牌看起来更干净、也更接近普通消消乐；
   显示时字往上收、拼音落到底部，两者不打架。 */
.cr-tile__py {
  position: absolute;
  left: 50%;
  bottom: clamp(1px, 6cqh, 8px);
  transform: translateX(-50%);
  font-family: var(--font-num);
  font-size: min(17cqh, 17cqw, 17px);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(68, 53, 42, 0.74);
  transition: color var(--dur-fast), transform var(--dur-fast) var(--ease-bounce),
              opacity var(--dur-fast);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
}

/* 汉字默认居中占满；开了拼音就往上收一点让位 */
.cr-tile__ch {
  transition: transform var(--dur-fast) var(--ease-soft), font-size var(--dur-fast) var(--ease-soft);
}

body.show-pinyin .cr-tile__py { opacity: 1; }
body.show-pinyin .cr-tile__ch { transform: translateY(-11%); font-size: min(38cqh, 38cqw, 44px); }

/* 选中时无论开关都要看得到读音：选中是「我要判断这两个能不能换」的时刻 */
.cr-tile.is-picked .cr-tile__py { opacity: 1; color: var(--pumpkin-deep); }
.cr-tile.is-picked .cr-tile__ch { transform: translateY(-11%); font-size: min(38cqh, 38cqw, 44px); }

/* 选中：抬起 + 亮出拼音，方便读一下再决定往哪换 */
.cr-tile.is-picked { z-index: 4; }
.cr-tile.is-picked .cr-tile__face {
  background: #FFF6E2;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08), 0 4px 0 var(--ink), 0 8px 16px rgba(90, 74, 58, 0.22);
  outline: 3px solid var(--pumpkin);
  outline-offset: 1px;
  transform: translateY(-2px) scale(1.03);
}


/* 选中的牌，它四个邻居轻轻亮一下：告诉小朋友「可以跟这些换」 */
.cr-tile.is-neighbor .cr-tile__face {
  outline: 2.5px dashed rgba(224, 122, 63, 0.75);
  outline-offset: -1px;
}

/* 提示：一对要交换的牌子一起呼吸。
   注意动画作用在「牌面」上，不能作用在 .cr-tile：
   字牌的位置靠 transform: translate(--c, --r) 摆放，动 transform 会把它挪走。 */
.cr-tile.is-hint { z-index: 5; }
.cr-tile.is-hint .cr-tile__face {
  outline: 4px solid var(--pumpkin);
  outline-offset: 1px;
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.10),
    0 0 0 7px rgba(245, 213, 71, 0.55),
    0 4px 0 rgba(90, 74, 58, 0.38);
  animation: crHintPulse 1.1s var(--ease-soft) infinite;
}
@keyframes crHintPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-4px) scale(1.04); }
}

/* 换了也没用：两张一起抖一下 */
.cr-tile.is-wrong .cr-tile__face {
  background: #FBE3E8;
  animation: crShake 0.36s var(--ease-soft);
}
@keyframes crShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  50%      { transform: translateX(4px); }
  75%      { transform: translateX(-2px); }
}

/* 消掉：先鼓起一圈，再缩没 */
.cr-tile.is-gone {
  pointer-events: none;
  z-index: 6;
  animation: crGone 0.34s var(--ease-soft) forwards;
  animation-delay: var(--pop-delay, 0s);
}
@keyframes crGone {
  0%   { opacity: 1; }
  40%  { opacity: 1; filter: brightness(1.25); }
  100% { opacity: 0; }
}
.cr-tile.is-gone .cr-tile__face {
  box-shadow: 0 0 0 6px rgba(245, 213, 71, 0.55), inset 0 -4px 0 rgba(0, 0, 0, 0.08);
  animation: crGoneFace 0.34s var(--ease-soft) forwards;
  animation-delay: var(--pop-delay, 0s);
}
@keyframes crGoneFace {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.16); }
  100% { transform: scale(0.5); }
}

/* 连击数字：在棋盘中央炸一下 */
.cr-multi {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 8;
  margin: 0;
  transform: translate(-50%, -50%) scale(0.6);
  font-family: var(--font-num);
  font-size: clamp(30px, 6vmin, 54px);
  font-weight: 800;
  color: var(--pumpkin-deep);
  text-shadow: 0 2px 0 #fff, 0 4px 0 rgba(90, 74, 58, 0.28);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.cr-multi.is-show { animation: crMultiPop 0.75s var(--ease-bounce) forwards; }
@keyframes crMultiPop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.5) rotate(-6deg); }
  35%  { opacity: 1; transform: translate(-50%, -62%) scale(1.12) rotate(2deg); }
  70%  { opacity: 1; transform: translate(-50%, -66%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -84%) scale(0.92); }
}

/* 棋盘整体：错的时候轻轻晃一下 */
.cr-board.is-bump { animation: crBump 0.34s var(--ease-soft); }
@keyframes crBump {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(3px); }
}

/* 键盘可达性：只在键盘聚焦时显示描边 */
.cr-tile:focus-visible .cr-tile__face {
  outline: 3px dashed var(--pumpkin);
  outline-offset: 2px;
}

@media (hover: hover) {
  .cr-tile:not(.is-gone):hover .cr-tile__face { transform: translateY(-2px); }
}

/* ============================ 消除反馈条 ============================ */

.cr-feedback {
  min-height: 1.5em;
  margin: 0;
  font-family: var(--font-hand);
  font-size: var(--fs-sm);
  line-height: 1.45;
  text-align: center;
  color: var(--ink-soft);
  transition: color var(--dur-fast);
}
.cr-feedback.is-ok { color: #4E9A6E; }
.cr-feedback.is-no { color: #C4576C; }
.cr-feedback.is-hint { color: var(--pumpkin-deep); font-weight: 700; }
.cr-feedback b { color: var(--pumpkin-deep); }

/* 判定口径常驻在棋盘下方 */
.cr-rule {
  margin: 0;
  padding: 5px 10px;
  max-width: 100%;
  border: 2px dashed rgba(90, 74, 58, 0.22);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.72);
  font-family: var(--font-hand);
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: center;
}
.cr-rule b { color: var(--pumpkin-deep); }

/* ============================ 本局字族一览 ============================ */

.side-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 2px 0 var(--ink-soft);
  font-family: var(--font-num);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink);
  min-width: 0;
}
.legend-item__sound { white-space: nowrap; }
.legend-item::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--pumpkin);
}

/* ============================ 封面：窄屏压缩 ============================ */

@media (max-width: 760px) {
  .screen--start .setup { gap: 9px; }
  .screen--start .setup__block { gap: 8px; padding: 11px; }
  .screen--start .mode { min-height: 46px; padding: 6px 10px; }
  .screen--start .diff-list { gap: 7px; }
  .screen--start .diff { min-height: 52px; padding: 6px 10px; }
  .screen--start .btn--lg { min-height: 58px; }
  .screen--start .fineprint { display: none; }
  .screen--start .mode-toggle { gap: 7px; }
}

@media (max-width: 760px) and (max-height: 780px) {
  .screen--start .hero__card { width: min(150px, 34vw); padding: 10px; }
  .screen--start .start-grid { gap: 12px; }
}

@media (max-width: 400px) {
  .screen--start .hero__card { width: min(130px, 32vw); padding: 8px; border-radius: 22px; }
  .screen--start .mode { min-height: 42px; padding: 5px 8px; }
  .screen--start .mode__note { display: none; }
  .screen--start .diff { min-height: 46px; padding: 5px 8px; gap: 8px; }
  .screen--start .diff__mini { width: 30px; height: 30px; }
  .screen--start .setup__block { padding: 9px; gap: 6px; }
}

@media (max-width: 400px) and (max-height: 700px) {
  .screen--start { padding-top: 8px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  /* 这一档寸土寸金：模式与难度卡片本身也各收一点 */
  .screen--start .mode { min-height: 38px; padding: 4px 8px; }
  .screen--start .diff { min-height: 42px; padding: 4px 8px; }
  .screen--start .diff-list { gap: 5px; }
  .screen--start .setup__block { gap: 6px; padding: 8px; }
  .start-grid { gap: 9px; }
  .screen--start .hero__card { width: min(112px, 30vw); padding: 7px; border-radius: 18px; }
  .screen--start .app-title { font-size: clamp(28px, 9vw, 36px); }
  .screen--start .subtitle { margin-top: 0; font-size: var(--fs-sm); }
  .screen--start .setup { gap: 7px; }
  .screen--start .setup__block { padding: 8px; gap: 5px; }
  .screen--start .diff-list { gap: 5px; }
  .screen--start .diff { min-height: 44px; padding: 4px 8px; }
  .screen--start .btn--lg { min-height: 52px; font-size: var(--fs-md); }
}

@media (max-height: 480px) and (orientation: landscape) {
  .screen--start { padding-top: 6px; padding-bottom: 4px; }
  .start-grid { gap: 14px; grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr); align-items: center; }
  .screen--start .hero__card { width: min(130px, 22vw); padding: 8px; border-radius: 20px; }
  .screen--start .app-title { font-size: clamp(24px, 4.4vh, 32px); }
  .screen--start .subtitle { display: none; }
  .screen--start .setup { gap: 5px; }
  .screen--start .setup__block { padding: 7px; gap: 5px; }
  .screen--start .mode { min-height: 34px; padding: 3px 8px; }
  .screen--start .mode__note { display: none; }
  .screen--start .diff-list { gap: 4px; }
  .screen--start .diff { min-height: 34px; padding: 3px 8px; }
  .screen--start .diff__mini { width: 24px; height: 24px; }
  .screen--start .diff__meta { display: none; }
  .screen--start .btn--lg { min-height: 38px; padding: 5px 14px; font-size: var(--fs-sm); }
  .screen--start .eyebrow,
  .screen--start .fineprint { display: none; }
  .screen--start .setup__label-note { display: none; }
}

/* ============================ 游戏页：矮屏压缩 ============================ */

@media (max-height: 780px) {
  .stats { margin-top: 0; }
  .stage__caption { display: none; }
  .hint--play { display: none; }
  .side-card { gap: 9px; padding: 11px; }
  .side-actions .btn { min-height: 44px; font-size: var(--fs-sm); }
  .cr-feedback { font-size: var(--fs-xs); min-height: 1.2em; }
}

@media (max-height: 660px) {
  .screen--play { padding-top: 4px; padding-bottom: 10px; }
  .stat { padding: 3px 5px 4px; border-width: 2.5px; }
  .stat__label { font-size: 11px; }
  .stat__value { font-size: 19px; }
  .side-card { gap: 7px; padding: 8px 9px; border-width: 2.5px; }
  .side-card__head { display: none; }
  .seg { padding: 3px; }
  .seg__btn { min-height: 38px; font-size: var(--fs-xs); }
  .side-actions .btn { min-height: 38px; padding: 5px 8px; font-size: var(--fs-xs); border-width: 2px; }
  .cr-feedback { display: none; }
  .stage { gap: 6px; }
  /* 判定口径不隐藏：它是玩法本身，只压缩留白与字号 */
  .cr-rule { padding: 3px 8px; font-size: 11px; line-height: 1.4; border-width: 1.5px; }
  .side-legend { display: none; }
  .cr-target { height: 8px; margin-bottom: 6px; }
}

/* 宽而矮（800×600 一类）：改成左右两列，操作栏搬到右侧 */
@media (min-width: 700px) and (max-width: 859px) and (max-height: 700px) {
  .play-grid {
    flex: 1;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 232px;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "stage stats"
      "stage side";
    gap: 6px 14px;
  }
  .stage { gap: 6px; }
  .stats { gap: 6px; }
  .side { gap: 6px; }
  .side-card { padding: 8px 9px; gap: 7px; }
  .seg__btn { min-height: 36px; }
  .side-actions { grid-template-columns: 1fr; gap: 6px; }
  .side-actions .btn { min-height: 38px; }
}

/* 单列 + 矮屏：操作栏压成一行两键，给棋盘腾出空间 */
@media (max-width: 859px) and (max-height: 700px) {
  .screen--play { padding: 4px 12px max(8px, env(safe-area-inset-bottom)); }
  .play-grid { gap: 8px; }
  .stats { gap: 6px; }
  .stat { padding: 4px 5px 5px; }
  .stat__value { font-size: 20px; }
  .side-card { padding: 8px 9px; gap: 7px; }
  .side-card__head { display: none; }
  .seg { padding: 3px; }
  .seg__btn { min-height: 38px; font-size: var(--fs-xs); }
  .side-actions { gap: 6px; }
  .side-actions .btn { min-height: 40px; padding: 5px 8px; font-size: var(--fs-sm); }
}

/* 入场动画里的 translateY 会把内容顶出视口，游戏页只淡入不位移 */
.screen--play.view-enter { animation: crFadeIn var(--dur) var(--ease-soft) both; }
@keyframes crFadeIn {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

/* 庆祝弹窗里跨行的「最佳记录」占满整行 */
.celeb__stat--wide {
  flex: 1 1 100%;
  margin-top: 10px;
  min-width: 0 !important;
}

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

@media (max-width: 760px) {
  .cr-shell { box-shadow: 0 5px 0 var(--paper-deep), 0 7px 0 var(--ink), var(--shadow-soft); }
  .cr-tile__ch { font-size: min(42cqh, 42cqw, 44px); }
  .cr-feedback { font-size: var(--fs-sm); }
}

@media (max-width: 400px) {
  .mode { min-height: 48px; padding: 6px 9px; }
  .mode__name { font-size: 15px; }
  .mode__note { font-size: 10px; }
}

@media (max-height: 620px) and (orientation: landscape) {
  .mode { min-height: 44px; padding: 5px 9px; }
  .mode__note { display: none; }
}

/* 顶栏品牌名：5 个字，窄屏缩一档避免截断 */
@media (max-width: 640px) {
  .brand__name { font-size: 16px; letter-spacing: 0; }
}
@media (max-width: 430px) {
  .brand { gap: 6px; }
  .brand__name { font-size: 15px; }
  .brand__logo { width: 36px; height: 36px; font-size: 13px; }
}
@media (max-width: 380px) {
  .brand__name { font-size: 14px; }
}

/* 极矮横屏（568×320 一类）：判定条压到最小，棋盘优先 */
@media (max-height: 380px) {
  .cr-rule {
    margin-top: 2px;
    padding: 2px 6px;
    font-size: 10px;
    line-height: 1.3;
    border-width: 1.5px;
    border-radius: 8px;
    text-align: left;
    max-height: 2.6em;
    overflow: hidden;
  }
  .cr-target { height: 6px; margin-bottom: 4px; }
}

/* =====================================================================
   超窄又矮（320×568 一类）：到这一档才收插画与次要信息。
   必须放在文件最后，否则会被上面 max-width:400px 的规则盖掉。
   ===================================================================== */
@media (max-width: 340px) and (max-height: 620px) {
  .screen--start .hero { display: none; }
  .screen--start .diff__meta { display: none; }
  .screen--start .diff { min-height: 38px; padding: 4px 8px; }
  .screen--start .app-title { font-size: 30px; }
  .screen--start { padding-top: 6px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .screen--start .setup__block { padding: 7px; gap: 5px; }
  .screen--start .mode { min-height: 34px; }
  .screen--start .btn--lg { min-height: 48px; font-size: var(--fs-md); }
}

/* =====================================================================
   矮横屏（568×320 一类）：左右两列布局下高度极度紧张，
   标签行和次要说明都可以收掉，给开始按钮让位。
   ===================================================================== */
@media (max-height: 400px) and (orientation: landscape) {
  .screen--start .setup__label { display: none !important; }
  .screen--start .setup__block { padding: 6px 7px; gap: 5px; }
  .screen--start .diff { min-height: 32px; padding: 3px 8px; }
  .screen--start .btn--lg { min-height: 36px; padding: 4px 14px; font-size: var(--fs-sm); }
}
