/* ===================================
   Splatoon 3 Hub - 响应式样式
   =================================== */

/* 大屏幕 (1400px+) */
@media (min-width: 1400px) {
  .container {
    max-width: 1400px;
  }

  .section-title {
    font-size: 56px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }
}

/* 大屏 (1920px+) */
@media (min-width: 1920px) {
  .container {
    max-width: 1400px;
  }

  .section-title {
    font-size: 64px;
  }

  .official-hero {
    min-height: auto;
    padding: 60px 0;
  }

  .official-hero .hero-background,
  .hero-background {
    background-size: cover;
    background-position: center center;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }

  /* 确保Hero背景正确显示 */
  #hero .hero-background {
    background-size: cover;
    background-position: center center;
  }
}

/* 超大屏 (2560px+) */
@media (min-width: 2560px) {
  .container {
    max-width: 1400px;
  }

  .section-title {
    font-size: 72px;
  }

  .section-subtitle {
    font-size: 24px;
  }

  .official-hero {
    min-height: auto;
    padding: 80px 0;
  }

  .official-hero .hero-background,
  .hero-background {
    background-size: cover;
    background-position: center center;
  }

  /* Hero区域大屏优化 */
  #hero {
    min-height: auto;
  }

  #hero .hero-background {
    background-size: cover;
    background-position: center center;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }

  /* 快速入口卡片大屏优化 */
  .quick-entry-card {
    padding: 56px 40px;
  }

  .card-icon {
    font-size: 72px;
  }

  /* 导航栏大屏优化 */
  .official-nav-inner {
    padding: 12px 24px;
  }

  .official-nav-menu a {
    font-size: 17px;
    padding: 14px 20px;
  }
}

/* 中等屏幕 (1024px - 1399px) */
@media (max-width: 1399px) {
  .container {
    max-width: 1200px;
  }
}

/* 平板横屏 (768px - 1023px) */
@media (max-width: 1023px) {
  .navbar-nav {
    gap: 4px;
  }

  .navbar-nav a {
    padding: 6px 12px;
    font-size: 13px;
  }

  .section-title {
    font-size: 40px;
  }

  .section-subtitle {
    font-size: 16px;
  }

  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .gallery-hero {
    height: 300px;
  }

  .gallery-hero h1 {
    font-size: 42px;
  }

  .gallery-hero p {
    font-size: 20px;
  }
}

/* 平板竖屏 (576px - 767px) */
@media (max-width: 767px) {
  /* 导航栏 */
  .menu-toggle {
    display: block;
  }

  .navbar-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-darker);
    flex-direction: column;
    padding: 20px;
    gap: 8px;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
  }

  .navbar-nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .navbar-nav a {
    padding: 12px 16px;
    font-size: 16px;
  }

  /* 主要内容 */
  main {
    padding-top: 60px;
  }

  /* 标题 */
  .section-title {
    font-size: 32px;
  }

  .section-subtitle {
    font-size: 14px;
    margin-bottom: 32px;
  }

  /* 网格布局 */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  /* 卡片 */
  .card {
    padding: 20px;
  }

  /* 按钮 */
  .btn {
    padding: 10px 24px;
    font-size: 14px;
  }

  /* 页脚 */
  .footer-content {
    flex-direction: column;
  }

  /* 画廊 */
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .gallery-hero {
    height: 250px;
  }

  .gallery-hero h1 {
    font-size: 36px;
  }

  .gallery-hero p {
    font-size: 18px;
  }

  .gallery-intro {
    font-size: 16px;
  }

  .filter-btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  /* 移除跨列效果 */
  .gallery-item:nth-child(3n),
  .gallery-item:nth-child(5n) {
    grid-column: span 1;
    grid-row: span auto;
  }

  .gallery-item[data-orientation="portrait"],
  .gallery-item[data-orientation="landscape"],
  .gallery-item[data-orientation="square"] {
    grid-row: span auto;
  }
}

/* 手机横屏 (480px - 575px) */
@media (max-width: 575px) {
  .container {
    padding: 0 16px;
  }

  .navbar-logo {
    font-size: 20px;
  }

  .section-title {
    font-size: 28px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .gallery-hero h1 {
    font-size: 28px;
  }

  .gallery-hero p {
    font-size: 16px;
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* 小屏手机 (360px - 479px) */
@media (max-width: 479px) {
  .navbar-logo {
    font-size: 18px;
  }

  .section-title {
    font-size: 24px;
  }

  .card-title {
    font-size: 18px;
  }

  .btn {
    padding: 8px 20px;
    font-size: 13px;
  }

  .gallery-hero {
    height: 200px;
    padding: 20px;
  }

  .gallery-hero h1 {
    font-size: 24px;
  }

  .gallery-hero p {
    font-size: 14px;
  }

  .gallery-filters {
    gap: 8px;
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: 12px;
  }
}

/* 超小屏幕 (< 360px) */
@media (max-width: 359px) {
  .container {
    padding: 0 12px;
  }

  .section-title {
    font-size: 20px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* 打印样式 */
@media print {
  .navbar,
  .loading-overlay,
  .lightbox,
  .filter-btn,
  footer {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .gallery-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 600px) {
  .navbar {
    padding: 8px 0;
  }

  .navbar-nav a {
    padding: 4px 12px;
    font-size: 12px;
  }

  main {
    padding-top: 50px;
  }

  .gallery-hero {
    height: 200px;
  }

  .lightbox-img {
    max-height: 70vh;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .gallery-item:hover {
    transform: none;
  }

  .gallery-item:active {
    transform: scale(0.98);
  }

  .btn:hover {
    transform: none;
  }

  .btn:active {
    transform: scale(0.95);
  }

  /* 始终显示图片信息，无需悬停 */
  .gallery-info {
    position: static;
    transform: none;
    background: rgba(0, 0, 0, 0.8);
    padding: 12px;
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
  :root {
    --bg-card: rgba(255, 255, 255, 0.15);
    --bg-card-hover: rgba(255, 255, 255, 0.25);
  }

  .card,
  .gallery-item {
    border-width: 2px;
  }
}

/* 深色模式增强 */
@media (prefers-color-scheme: dark) {
  /* 已经是深色主题，保持不变 */
}

/* 浅色模式支持 */
@media (prefers-color-scheme: light) {
  :root {
    --bg-dark: #f5f5f5;
    --bg-darker: #e0e0e0;
    --bg-card: rgba(0, 0, 0, 0.03);
    --bg-card-hover: rgba(0, 0, 0, 0.08);
    --text-primary: #1a1a2e;
    --text-secondary: rgba(26, 26, 46, 0.7);
    --text-muted: rgba(26, 26, 46, 0.5);
  }

  .navbar {
    background: rgba(245, 245, 245, 0.8);
  }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 省电模式 */
@media (prefers-reduced-data: reduce) {
  .gallery-img {
    image-rendering: pixelated;
  }
}

/* 高分辨率屏幕 */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
  /* 可以加载更高分辨率图片 */
  .gallery-img {
    image-rendering: -webkit-optimize-contrast;
  }
}
