/* ========================================================
   iPhone 移动端自适应风格 (iOS Mobile Mode)
   ======================================================== */

@media (max-width: 768px) {
  /* 手机端禁用 Canvas 动画，切换为省电静态背景 */
  #desktop-canvas {
    display: none !important;
  }

  body {
    background: #0d1117 url('../icons/ios-bg.jpg') center center / cover no-repeat fixed;
    background-image: radial-gradient(circle at 50% 20%, #4a2b6d 0%, #151828 50%, #0a0b10 100%);
  }

  /* 顶部状态栏调整为 iOS 风格 */
  #menubar {
    height: 44px;
    padding: 0 16px;
    background: rgba(0, 0, 0, 0.25);
    color: #ffffff;
    border-bottom: none;
  }

  .menubar-left .menubar-item:not(.menubar-apple-logo) {
    display: none; /* 移动端隐藏冗余的桌面下拉菜单项 */
  }

  .menubar-apple-logo svg {
    fill: #ffffff;
    width: 17px;
    height: 17px;
  }

  .menubar-clock {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
  }

  /* 移动端工作区铺满屏幕 */
  #desktop-stage {
    top: 44px;
    bottom: 84px;
    left: 0;
    right: 0;
  }

  /* 移动端窗口变为全屏 App 卡片模式 */
  .macos-window {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    border: none !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4) !important;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
  }

  .macos-window.focused, .macos-window.active-app {
    transform: translateY(0);
  }

  .macos-window.minimized {
    transform: translateY(100%) !important;
  }

  /* 隐藏边框手柄 */
  .window-resizer {
    display: none !important;
  }

  /* 窗口标题栏在移动端 */
  .window-titlebar {
    height: 48px;
    padding: 0 16px;
  }

  .traffic-light.minimize, .traffic-light.zoom {
    display: none; /* 移动端只保留关闭/返回红灯 */
  }

  .traffic-light.close {
    width: 16px;
    height: 16px;
  }

  /* 访达在移动端的布局 */
  .window-body {
    flex-direction: column;
  }

  .finder-sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    max-height: 110px;
    border-right: none;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 10px;
    gap: 6px;
  }

  .finder-section-title {
    display: none;
  }

  .finder-nav-item {
    white-space: nowrap;
    padding: 5px 12px;
    font-size: 13px;
  }

  .finder-table td:nth-child(3), .finder-table th:nth-child(3) {
    display: none; /* 手机端隐藏作者列，留出标题与时间空间 */
  }

  /* Safari 移动端布局 */
  .safari-tabs-bar {
    padding-left: 50px;
  }

  .safari-content-view {
    padding: 20px 18px;
  }

  .article-title {
    font-size: 22px;
  }

  /* 底部 Dock 变成 iPhone 经典底栏 */
  #dock-container {
    bottom: 16px;
    width: 90%;
    max-width: 360px;
  }

  #dock {
    width: 100%;
    justify-content: space-around;
    height: 68px;
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    padding: 6px 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  }

  .dock-item {
    transition: transform 0.1s ease;
  }

  .dock-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .dock-tooltip {
    display: none !important; /* 移动端不需要 hover 气泡 */
  }

  /* 移动端备忘录与计算器适配 */
  .notes-layout {
    flex-direction: column !important;
  }
  .notes-sidebar {
    width: 100% !important;
    max-height: 140px !important;
    border-right: none !important;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08) !important;
  }
  .notes-editor-pane {
    padding: 16px 18px !important;
  }
  .calc-window {
    display: flex;
    justify-content: center;
  }
  .calc-grid {
    max-width: 320px;
    margin: 0 auto;
  }

  /* 移动端 Spotlight 搜索框自适应 */
  .macos-spotlight {
    width: calc(100vw - 32px) !important;
    left: 16px !important;
    top: 60px !important;
  }

  /* 移动端关于窗口 */
  .about-window {
    width: 100vw !important;
    height: 100% !important;
    left: 0 !important;
    top: 0 !important;
  }
}
