/* ============================================
   修仙天机阁 · 响应式样式（移动优先）
   ============================================
   断点约定（与实现对应）：

   · 手机   ≤768px
     → 单列布局、折叠导航（汉堡菜单）、字体与间距收紧

   · 平板   769px ~ 1024px
     → 双列 / 过渡栅格（见下方 max-width: 1024px 与 style.css 桌面默认之间的中间态）

   · 电脑   ≥1025px
     → 多列布局、完整横向导航（默认写在 css/style.css）

   说明：部分规则使用 max-width: 1024px 覆盖「平板 + 手机」，
   更窄的 max-width: 768px 规则会进一步覆盖手机端。
   ============================================ */

/* --- 平板及以下（≤1024px）：首页等板块栅格收紧 --- */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .entry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- 手机（≤768px）：单列、折叠导航、触控区域加大 --- */
@media (max-width: 768px) {
  .nav-search {
    display: none;
  }
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }
  .nav-container {
    padding: 0.6rem 1rem;
  }
  .logo {
    min-height: 44px;
    align-items: center;
  }
  .logo-text {
    font-size: 1.1rem;
  }
  .logo-en {
    display: none;
  }
  .section-title-gu {
    padding: 0 1.5rem;
  }
  .title-corner {
    letter-spacing: 0.1em;
  }
  .hero {
    min-height: 55vh;
    padding: 2.5rem 1rem;
  }
  .hero-tag {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
  }
  .hero-desc {
    font-size: 0.95rem;
    padding: 0 0.5rem;
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
  }
  .hero-actions .btn {
    width: 100%;
    text-align: center;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .section {
    padding: 2.5rem 1rem;
  }
  .section-title {
    font-size: 1.35rem;
  }
  .section-desc {
    margin-bottom: 1.5rem;
  }
  .page-banner {
    padding: 2rem 1rem;
  }
  .page-banner-title {
    font-size: 1.5rem;
  }
  .filter-bar {
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
  }
  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
  .card-grid,
  .anime-card-list {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .card-content {
    padding: 1.5rem;
  }
  .carousel-section {
    padding: 2rem 1rem;
  }
  .carousel {
    border-radius: 12px;
    margin: 0 -0.25rem;
  }
  .carousel-track-wrap {
    aspect-ratio: 16 / 10;
  }
  .carousel-slide-inner {
    padding: 1.5rem;
  }
  .carousel-caption h3 {
    font-size: 1.25rem;
  }
  .carousel-caption p {
    font-size: 0.85rem;
  }
  .carousel-btn {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
    min-width: 44px;
    min-height: 44px;
  }
  .carousel-btn-prev {
    left: 0.5rem;
  }
  .carousel-btn-next {
    right: 0.5rem;
  }
  .carousel-dots {
    bottom: 0.75rem;
  }
  .section-entry {
    padding: 2rem 1rem;
  }
  .entry-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .entry-card {
    padding: 1.25rem 1rem;
    min-height: 72px;
    flex-direction: row;
    text-align: left;
    align-items: center;
    gap: 1rem;
  }
  .entry-card-border {
    top: 10%;
    bottom: 10%;
  }
  .entry-icon {
    font-size: 1.75rem;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .entry-card h3 {
    flex: 1;
    margin-bottom: 0.15rem;
  }
  .entry-card p {
    margin-bottom: 0;
    font-size: 0.8rem;
  }
  .entry-arrow {
    flex-shrink: 0;
  }
  .site-footer {
    padding: 2rem 1rem 1rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
  }
  .footer-brand-block .footer-desc {
    margin-bottom: 0;
  }
  .footer-bottom {
    padding-top: 1rem;
  }
  .footer-copy {
    font-size: 0.75rem;
    line-height: 1.5;
  }
}

/* --- 小屏手机（≤480px）：进一步收紧轮播比例等 --- */
@media (max-width: 480px) {
  .carousel-track-wrap {
    aspect-ratio: 4 / 3;
  }
}

/* 移动端展开菜单（需 JS 配合） */
.nav-links.is-open {
  display: flex;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  background: rgba(13, 10, 20, 0.98);
  padding: 0.75rem 1rem;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.nav-links.is-open li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-links.is-open li:last-child {
  border-bottom: none;
}
.nav-links.is-open .nav-link {
  display: flex;
  padding: 0.85rem 0.5rem;
  min-height: 48px;
  align-items: center;
}

/* ============================================
   子页（novel / anime / game / tech 等）· 与首页断点一致
   ============================================ */

/* --- 平板及以下（≤1024px）：双列卡片等 --- */
@media (max-width: 1024px) {
  .section-grid,
  .hot-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-novel .content-grid {
    grid-template-columns: 1fr;
  }
}

/* --- 手机（≤768px）：单列、移动端导航 --- */
@media (max-width: 768px) {
  .quick-side-nav {
    display: none;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--card-bg);
    flex-direction: column;
    padding: 20px;
    gap: 10px;
  }

  .nav-menu.active {
    display: flex;
  }

  .mobile-menu-btn {
    display: block;
  }

  .top-login-btn {
    display: none;
  }

  .banner {
    min-height: 260px;
    padding: 1.5rem 0.75rem 1.35rem;
  }

  .banner-content {
    padding: 1.1rem 1rem 1.25rem;
    max-width: 100%;
  }

  .banner h1,
  .banner-content h1 {
    font-size: 1.65rem;
  }

  .banner-content p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }

  .section-grid,
  .hot-grid {
    grid-template-columns: 1fr;
  }

  .footer-links {
    flex-direction: column;
    gap: 15px;
  }

  .page-header h1 {
    font-size: 1.75rem;
  }

  .search-box {
    margin-left: 0;
    width: 100%;
  }

  .search-box input {
    flex: 1;
    min-width: 0;
  }

  .content-grid {
    grid-template-columns: 1fr;
    padding: 30px 16px;
  }

  .page-novel .content-card {
    flex-direction: column;
  }

  .page-novel .card-cover {
    width: 100%;
    height: 200px;
  }

  .rank-item {
    flex-wrap: wrap;
  }

  .coming-soon {
    margin: 40px 16px;
    padding: 40px 16px;
  }
}
