/* ===== 移动端专用样式（手机浏览器 / 添加到主屏幕） ===== */

/* 真机全屏：去掉手机外壳 */
@media (max-width: 620px) {
  body.kid-mode {
    display: block;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .phone {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  .island { display: none; }
  .screen {
    padding-top: calc(10px + env(safe-area-inset-top));
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }
  .tabbar {
    height: calc(74px + env(safe-area-inset-bottom));
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  /* 触摸设备不要 hover 位移，避免点完卡住 */
  .task:hover,
  .reward:hover { transform: none; }
  .task:active { background: #FAFAF6; }

  /* 字体略大一点，孩子看得清 */
  .task .name { font-size: 15px; }
  .sec-title h3 { font-size: 16.5px; }

  /* 弹层在小屏上更贴合 */
  .sheet {
    max-height: 92vh;
    max-height: 92dvh;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    border-radius: 28px 28px 0 0;
  }
  .mic { width: 120px; height: 120px; }
  .mic-tip { font-size: 13px; }
}

/* 竖屏小手机（iPhone SE 等） */
@media (max-width: 380px) {
  .hello { font-size: 19px; }
  .hero { padding: 16px 16px 16px; border-radius: 26px; }
  .ring-wrap { padding: 10px 12px; gap: 12px; }
  .progress-txt b { font-size: 13.5px; }
  .reward { flex: 0 0 104px; }
}

/* 横屏时避免过矮 */
@media (max-height: 520px) and (orientation: landscape) {
  .mic-area { padding: 16px 0 8px; }
  .mic { width: 84px; height: 84px; }
}

/* ---------- 添加到主屏幕引导 ---------- */
.install-tip {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(43, 32, 20, .45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.install-tip.on { display: flex; animation: tipFade .22s; }
@keyframes tipFade { from { opacity: 0 } to { opacity: 1 } }

.it-card {
  width: 100%;
  max-width: 420px;
  background: #FFFCF6;
  border-radius: 26px;
  padding: 26px 22px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
  animation: tipUp .3s cubic-bezier(.2, .9, .3, 1.1);
}
@keyframes tipUp { from { transform: translateY(40px); opacity: .6 } to { none } }

.it-emoji {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: linear-gradient(150deg, #FFE07A, #FFBB2E);
  display: flex; align-items: center; justify-content: center;
  font-size: 27px;
  margin-bottom: 14px;
  box-shadow: 0 3px 0 rgba(178, 120, 10, .4);
}
.it-title { font-size: 18px; font-weight: 800; color: #2F2519; }
.it-body {
  font-size: 13.5px;
  color: #6B5B4B;
  line-height: 1.75;
  margin-top: 10px;
}
.it-body p { margin: 0 0 8px; }
.it-body b { color: #2F2519; }
.it-body .kbd {
  display: inline-block;
  background: #FFF1CE;
  color: #8A6428;
  border-radius: 6px;
  padding: 0 6px;
  font-weight: 800;
  font-size: 12.5px;
  margin: 0 2px;
}
.it-actions { display: flex; gap: 10px; margin-top: 20px; }
.it-actions .btn { flex: 1; padding: 11px 0; font-size: 14px; }

/* 网页里打开时（非主屏幕模式）的顶部提示条 */
.hint-bar {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 14px;
  background: #FFF4D9;
  border: 1px solid #FFE7A6;
  border-radius: 16px;
  font-size: 12px;
  color: #8A6428;
  font-weight: 700;
  line-height: 1.5;
}
.hint-bar.on { display: flex; }
.hint-bar .x {
  margin-left: auto;
  border: none;
  background: none;
  color: #B4894A;
  font-size: 15px;
  cursor: pointer;
  padding: 0 2px;
}

/* 输入框在 iOS 上不要缩放 */
input, select, textarea { font-size: 16px; }
