/* iPhone 16 Pro 專用響應式樣式 */

/* iPhone 16 Pro 尺寸: 393x852 像素 */
@media only screen and (max-width: 430px) {
  /* 確保內容適配螢幕寬度 */
  * {
    max-width: 100vw;
  }

  /* 針對 iPhone 16 Pro 的安全區域調整 */
  body {
    padding-top: max(env(safe-area-inset-top), 0px);
    padding-bottom: max(env(safe-area-inset-bottom), 0px);
  }

  /* 調整主容器以適配 iPhone 16 Pro */
  #root {
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }

  /* 優化觸控目標大小 */
  button, 
  a,
  input[type="button"],
  input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
  }

  /* 調整字體大小以適應較小螢幕 */
  body {
    font-size: 16px;
    line-height: 1.5;
  }

  /* 防止橫向滾動 */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
}

/* iPhone 16 Pro 橫向模式 */
@media only screen and (max-height: 430px) and (orientation: landscape) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* 針對高解析度顯示器 (Retina) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* 確保文字清晰 */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* 針對 notch/Dynamic Island 的額外調整 */
@supports (padding: max(0px)) {
  body {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* 深色模式優化 */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

/* 防止文字選擇造成的版面移位 */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

input, textarea, select {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
