/* 小M老師免費遊戲 — 手機版，電光藍玻璃風格。WebKit 安全：不用 nesting、@layer、color-mix、oklch、:has、text-wrap:pretty、font-weight:650。 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: #04153d;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  color: #f4f8ff;
  background-color: #04153d;
  background-image: linear-gradient(180deg, #04153d 0%, #0a3a8a 46%, #062056 100%);
  background-attachment: fixed;
  font-family: system-ui, -apple-system, "PingFang TC", "Noto Sans TC",
    "Heiti TC", "Microsoft JhengHei", "Noto Sans CJK TC", sans-serif;
  line-height: 1.45;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #7ef0ff;
}

.page {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 0 48px;
}

/* —— 首頁橫幅 —— */
.home-hero {
  margin: 0;
  padding: 0;
}

.home-hero h1 {
  margin: 0;
  font-size: 0;
  line-height: 0;
}

.banner-wrap,
.banner-wrap picture {
  display: block;
  width: 100%;
}

.banner {
  width: 100%;
  height: auto;
  display: block;
}

/* —— 區塊標題 —— */
.section {
  margin-top: 22px;
  padding: 0 16px;
}

.section h2 {
  margin: 0 4px 10px;
  color: #ffd84a;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 10px rgba(0, 16, 64, 0.45);
}

.section .sec-lead {
  margin: 0 4px 12px;
  color: #cfe4ff;
  font-size: 0.9rem;
  line-height: 1.6;
}

.list {
  display: block;
}

.row {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 12px 12px 12px 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(94, 225, 255, 0.38);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(0, 16, 72, 0.28);
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(126, 240, 255, 0.18);
}

.row .icon {
  width: 60px;
  height: 60px;
  -webkit-flex: 0 0 60px;
  flex: 0 0 60px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(0, 20, 70, 0.35);
}

.row .meta {
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  min-width: 0;
}

.row h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
}

.row .cat {
  margin: 2px 0 0;
  color: #7ef0ff;
  font-size: 0.78rem;
  font-weight: 600;
}

.row .blurb {
  margin: 4px 0 0;
  color: #d6e6ff;
  font-size: 0.8rem;
  line-height: 1.5;
}

.soon-tag {
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
  margin-right: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 216, 74, 0.16);
  border: 1px solid rgba(255, 216, 74, 0.45);
  color: #ffd84a;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.chevron {
  width: 8px;
  height: 14px;
  -webkit-flex: 0 0 8px;
  flex: 0 0 8px;
  color: #7ef0ff;
}

.site-foot {
  margin-top: 32px;
  padding: 0 20px;
  text-align: center;
  color: #b7cfff;
  font-size: 0.82rem;
}

.site-foot a {
  color: #7ef0ff;
}

/* —— 產品頁（App Store 結構） —— */
body.product .page {
  padding-top: 8px;
}

.nav {
  display: -webkit-flex;
  display: flex;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  -webkit-align-items: center;
  align-items: center;
  padding: 4px 16px 8px;
}

.nav-btn {
  display: -webkit-inline-flex;
  display: inline-flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(94, 225, 255, 0.4);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 16, 72, 0.25);
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.nav-btn svg {
  display: block;
}

.hero {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 14px;
  padding: 8px 16px 4px;
}

.app-icon {
  width: 112px;
  height: 112px;
  -webkit-flex: 0 0 112px;
  flex: 0 0 112px;
  border-radius: 26px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(0, 16, 72, 0.35);
  background: rgba(0, 20, 70, 0.35);
}

.hero-mid {
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  min-width: 0;
}

.hero-mid h1 {
  margin: 0;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.category {
  margin: 4px 0 10px;
  color: #9adfff;
  font-size: 0.88rem;
}

.play,
.play--soon {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #8fd2ff 0%, #1a7dff 55%, #0a4fd6 100%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 6px 14px rgba(0, 40, 140, 0.35);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  text-shadow: 0 1px 1px rgba(0, 40, 120, 0.35);
}

.play--soon {
  background: linear-gradient(180deg, #8aa4c8 0%, #3a5578 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  opacity: 0.9;
  pointer-events: none;
  cursor: default;
}

/* 資訊橫條：僅此處可左右滑 */
.facts-wrap {
  margin: 16px 0 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.facts-wrap::-webkit-scrollbar {
  display: none;
}

.facts {
  display: -webkit-flex;
  display: flex;
  width: -webkit-max-content;
  width: max-content;
  gap: 0;
  margin: 0;
  padding: 0 16px;
  list-style: none;
}

.facts li {
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
  min-width: 88px;
  padding: 0 14px;
  border-right: 1px solid rgba(126, 240, 255, 0.25);
  scroll-snap-align: start;
  text-align: center;
}

.facts li:last-child {
  border-right: 0;
}

.facts .label {
  display: block;
  color: #9adfff;
  font-size: 0.7rem;
}

.facts .value {
  display: block;
  margin-top: 2px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
}

/* 截圖畫廊：僅此處可左右滑。同一頁只出現一種方向與比例，卡片尺寸一致。 */
.shots-wrap {
  margin: 18px 0 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.shots-wrap::-webkit-scrollbar {
  display: none;
}

.shots {
  display: -webkit-flex;
  display: flex;
  width: -webkit-max-content;
  width: max-content;
  gap: 12px;
  padding: 0 16px 6px;
}

.shots img {
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
  border-radius: 18px;
  scroll-snap-align: start;
  object-fit: cover;
  background: rgba(0, 12, 48, 0.35);
  box-shadow: 0 8px 20px rgba(0, 16, 72, 0.32);
  max-width: none;
  max-height: none;
}

/* 直向 9:19.5，與 iPhone 390×844 相同 */
.shots--portrait img {
  width: 210px;
  height: 455px;
  -webkit-flex: 0 0 210px;
  flex: 0 0 210px;
}

/* 橫向 16:9，手機寬約露出 1.2 張 */
.shots--landscape img {
  width: 300px;
  height: 169px;
  -webkit-flex: 0 0 300px;
  flex: 0 0 300px;
}

.app-icon,
.row .icon {
  object-fit: cover;
}

.block {
  margin: 22px 0 0;
  padding: 0 20px;
}

.block h2 {
  margin: 0 0 8px;
  color: #ffd84a;
  font-size: 1.12rem;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0, 16, 64, 0.4);
}

.block p,
.block li {
  margin: 0;
  color: #e4eeff;
  font-size: 0.92rem;
  line-height: 1.7;
}

.block ul {
  margin: 0;
  padding-left: 1.15em;
}

.block li + li {
  margin-top: 8px;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(8, 24, 64, 0.92);
  border: 1px solid rgba(126, 240, 255, 0.45);
  color: #ffffff;
  font-size: 0.86rem;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  pointer-events: none;
}

#toast[hidden] {
  display: none !important;
}

@media (min-width: 431px) {
  body {
    background-image: linear-gradient(180deg, #03102e 0%, #082e70 50%, #04153d 100%);
  }
}
