/* ==========================================================================
   SnapSheet Official Website - Responsive Media Queries
   ========================================================================== */

/* Tablet Optimization (<= 992px) */
@media (max-width: 992px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .privacy-banner {
    flex-direction: column;
    text-align: center;
    padding: 32px 24px;
    gap: 24px;
  }

  .privacy-banner-content p {
    margin: 0 auto;
  }
}

/* Mobile & Small Tablet (<= 768px) */
@media (max-width: 768px) {
  /* 1. Header & Navigation Fixes - 消除挤压与折行 */
  .site-header {
    height: 60px;
  }

  .nav-container {
    height: 60px;
    padding: 0 16px;
  }

  .brand {
    font-size: 1.15rem;
    gap: 8px;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
  }

  .nav-actions {
    gap: 8px;
  }

  /* 彻底隐藏 Header 中的桌面端大按钮，避免小屏被挤成大绿球 */
  .desktop-only {
    display: none !important;
  }

  .theme-toggle-btn {
    width: 36px;
    height: 36px;
  }

  .mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    transition: all var(--transition-fast);
  }

  .mobile-toggle:active {
    background: var(--bg-card-subtle);
    transform: scale(0.95);
  }

  /* 汉堡图标动态过渡 */
  .mobile-toggle svg {
    transition: transform var(--transition-normal);
  }

  .mobile-toggle[aria-expanded="true"] svg {
    transform: rotate(90deg);
  }

  /* 2. 移动端抽屉菜单 (Full Width Floating Drawer) */
  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 24px;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    z-index: 99;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li {
    width: 100%;
    list-style: none;
  }

  .nav-link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 10px 4px;
    font-size: 1.05rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
  }

  .nav-link:active {
    color: var(--primary);
  }

  /* 抽屉底部全宽下载按钮 */
  .mobile-nav-cta {
    display: block;
    margin-top: 18px;
    width: 100%;
  }

  .mobile-nav-cta .btn-primary,
  .mobile-nav-cta .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: var(--radius-md);
  }

  /* 3. Hero 区域移动端调优 */
  .hero-section {
    padding: 36px 0 30px;
  }

  .hero-pill {
    margin-bottom: 18px;
    padding: 5px 12px;
    font-size: 0.8rem;
    max-width: 96%;
  }

  /* 小屏下只显示简短药丸文本，杜绝折行 */
  .pill-text-desktop {
    display: none;
  }

  .pill-text-mobile {
    display: inline;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero-title {
    font-size: 2.1rem;
    line-height: 1.22;
    margin-bottom: 14px;
    letter-spacing: -0.025em;
  }

  .hero-desc {
    font-size: 0.98rem;
    line-height: 1.55;
    margin-bottom: 28px;
    padding: 0 8px;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 36px;
    gap: 12px;
  }

  .hero-cta-group a {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .hero-badges {
    flex-direction: column;
    align-items: flex-start;
    max-width: 280px;
    margin: 0 auto 40px;
    gap: 10px;
    font-size: 0.85rem;
  }

  /* 4. 模拟器 Showcase 移动端优化 */
  .showcase-wrapper {
    border-radius: var(--radius-lg);
    margin: 0 4px;
  }

  .showcase-header {
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    align-items: stretch;
  }

  .window-dots {
    display: none; /* 移动端省略 macOS 窗口三色圆点，节省垂直空间 */
  }

  .showcase-tabs {
    width: 100%;
    display: flex;
  }

  .showcase-tabs .tab-btn {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    font-size: 0.82rem;
  }

  .showcase-body {
    padding: 14px 12px;
    min-height: auto;
  }

  .table-demo-container {
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
  }

  .interactive-table th,
  .interactive-table td {
    padding: 10px 10px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  /* 移动端防止 iOS Safari 点击 input 放大页面（需保证 >= 16px 或通过样式规避） */
  .interactive-table td input {
    font-size: 16px;
    transform: scale(0.85);
    transform-origin: left center;
    width: 118%;
  }

  .demo-hint {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    font-size: 0.78rem;
    margin-top: 10px;
  }

  /* 5. 特性卡片与区块优化 */
  .features-section {
    padding: 56px 0;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .feature-card {
    padding: 24px 20px;
  }

  .privacy-highlight-section {
    padding: 20px 0 50px;
  }

  .faq-section {
    padding: 40px 0 60px;
  }

  .faq-question {
    padding: 16px 18px;
    font-size: 0.98rem;
  }

  .faq-answer {
    padding: 0 18px 16px;
    font-size: 0.9rem;
  }

  .cta-section {
    padding: 56px 0;
  }

  /* 6. 页脚与安全区适配 */
  .site-footer {
    padding: 40px 0 calc(24px + env(safe-area-inset-bottom));
  }

  .footer-top {
    flex-direction: column;
    gap: 32px;
  }

  .footer-nav {
    flex-wrap: wrap;
    gap: 32px;
    width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .legal-container {
    margin: 28px auto 50px;
    padding: 0 16px;
  }

  .legal-title {
    font-size: 1.7rem;
  }
}

/* Very Small Mobile Screens (<= 380px) */
@media (max-width: 380px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .brand span {
    font-size: 1.05rem;
  }

  .hero-desc {
    font-size: 0.92rem;
  }

  .interactive-table th,
  .interactive-table td {
    padding: 8px 6px;
  }
}
