/* ============================================
   Android 三大金刚键 - 样式
   ============================================ */

@media (max-width: 768px) {
  
  /* ---------- 导航栏容器 ---------- */
  .android-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 99999;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.15);
  }

  .nav-bar-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
  }

  /* ---------- 导航按钮 ---------- */
  .nav-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-btn svg {
    fill: currentColor;
    width: 24px;
    height: 24px;
    transition: transform 0.15s ease;
  }

  .nav-btn:active {
    transform: scale(0.88);
    background: rgba(255, 255, 255, 0.08);
  }

  .nav-btn:focus-visible {
    outline: 2px solid #4a9eff;
    outline-offset: 2px;
  }

  /* 按钮按下波纹效果 */
  .nav-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
  }

  .nav-btn:active::after {
    width: 80px;
    height: 80px;
  }

  /* ---------- Tooltip 提示 ---------- */
  .nav-btn .tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
  }

  .nav-btn:active .tooltip {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }

  /* ---------- 双击返回提示 ---------- */
  .nav-back .double-tap-hint {
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: rgba(255, 60, 60, 0.9);
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 10px;
    opacity: 0;
    transition: all 0.25s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
    font-weight: 500;
    letter-spacing: 0.3px;
  }

  .nav-back .double-tap-hint.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }

  /* ---------- 主题适配 ---------- */
  /* 浅色主题 */
  .theme-light .android-nav-bar {
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid rgba(0, 0, 0, 0.04);
  }

  .theme-light .nav-btn {
    color: rgba(0, 0, 0, 0.7);
  }

  .theme-light .nav-btn:active {
    background: rgba(0, 0, 0, 0.04);
  }

  .theme-light .nav-btn::after {
    background: rgba(0, 0, 0, 0.06);
  }

  .theme-light .nav-btn .tooltip {
    background: rgba(255, 255, 255, 0.92);
    color: #1a1a2e;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  }

  /* ---------- 安全区域适配 ---------- */
  @supports (padding-bottom: env(safe-area-inset-bottom)) {
    .android-nav-bar {
      padding-bottom: env(safe-area-inset-bottom);
      height: calc(48px + env(safe-area-inset-bottom));
    }
  }

  /* ---------- 导航栏隐藏（全屏模式） ---------- */
  .android-nav-bar.hidden {
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }

  .android-nav-bar.visible {
    transform: translateY(0);
    transition: transform 0.3s ease;
  }

  /* ---------- 横屏适配 ---------- */
  @media (orientation: landscape) and (max-height: 500px) {
    .android-nav-bar {
      height: 36px;
    }

    .nav-btn {
      min-height: 32px;
      min-width: 32px;
      padding: 4px 16px;
    }

    .nav-btn svg {
      width: 18px;
      height: 18px;
    }

    @supports (padding-bottom: env(safe-area-inset-bottom)) {
      .android-nav-bar {
        height: calc(36px + env(safe-area-inset-bottom));
      }
    }
  }
}