/* 窄屏适配，全站的 @media 都集中在这里：≤1000 平板横屏，≤820 平板竖屏和大手机（单栏），≤560 手机 */
@media (hover: none) { .opt:hover, .hrow:hover { transform: none; } }

@media (max-width: 1000px) {
  .stage { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (max-width: 820px) {
  /* 顶栏两行：标题 · 计时 · 账号 / 导航（放不下横向滑）· 注音语速 */
  header { flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; }
  header h1 { order: 1; flex: 1; min-width: 0; }
  header .timer { order: 2; margin-left: auto !important; }
  header .acct { order: 3; }
  header::after { content: ""; order: 4; flex-basis: 100%; height: 0; }
  #nav { order: 5; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  #nav::-webkit-scrollbar { display: none; }
  header .audio-ctl { order: 6; margin-left: 0 !important; }
  .bar { width: 60px; }

  /* 场景页：不再撑满一屏，对话在上、教练栏在下，页面整体滚动 */
  #scene:not(.hidden) { height: auto; }
  .stage { grid-template-columns: 1fr; }
  .chatbox { height: 72dvh; min-height: 380px; }
  .coachbox { max-height: 60dvh; }
  .msg { max-width: 92%; }
  .brief-top { flex-wrap: wrap; row-gap: 4px; }
  .brief h2 { max-width: none; flex: 1; min-width: 0; }
  .brief .goal { order: 9; flex-basis: 100%; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

  .plan, .grid2, .modes { grid-template-columns: 1fr; }
  .adm-bar input { width: 100%; }
  .adm-detail { position: sticky; left: 0; width: calc(100vw - 34px); box-sizing: border-box; }   /* 用户表横向滑动时详情不跟着滑走 */
  .tiles.sm { grid-template-columns: repeat(2, 1fr); }
  .step { flex-wrap: wrap; }
  .step .sb { flex-basis: calc(100% - 34px); }
  .step > .btn, .step > .dd { margin-left: 32px; }

  .hero { grid-template-columns: 1fr; padding: 20px 16px; gap: 20px; }
  .hero-cal { max-width: 340px; width: 100%; margin: 0 auto; }
  .hero-h { font-size: 28px; }
  .hero-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .guest-pill small { display: none; }
  .guest-bar { flex-wrap: wrap; }
  .dtable { overflow-x: auto; }
}

@media (max-width: 560px) {
  .wide, .brief .tag, .brief .more-btn .lbl, .dbg-top small { display: none; }
  header { padding: 8px 12px; gap: 6px 10px; }
  header h1 { font-size: 18px; }
  header .timer { font-size: 12px; gap: 6px; }
  .bar { width: 44px; }
  .guest-reg { display: none; }   /* 游客菜单和横幅里都有注册入口，顶栏腾给标题 */
  #nav a { padding: 5px 8px; font-size: 13px; }

  main { padding: 16px 12px 32px; }
  #scene { padding: 8px 10px 12px; }
  .brief { padding: 8px 10px; }
  .brief h2 { font-size: 16px; }
  .brief .more-btn { padding: 4px 3px; }
  #endBtn { padding: 5px 10px; font-size: 13px; }
  .msgs { padding: 12px; }
  .msg { font-size: 15px; }
  .composer { padding: 8px; }
  /* iOS 输入框字号小于 16px 会在聚焦时整页放大 */
  input, textarea { font-size: 16px !important; }

  .paper { padding: 18px 16px; border-radius: 14px; }
  .section-h h2 { font-size: 20px; }
  .hero-h { font-size: 25px; }
  .hero-tiles { gap: 8px; }
  .rv-expr { font-size: 24px; overflow-wrap: anywhere; }
  .btn.grade { min-width: 0; flex: 1 1 40%; }
  .panel { padding: 12px 14px; }
  .award b { font-size: 17px; }
}
