/**
 * 响应式样式表 - Responsive Styles
 * 适配：桌面端、平板端、移动端
 */

/* ========================================
   大屏桌面端 - Large Desktop (1440px+)
   ======================================== */
@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }
}

/* ========================================
   平板端 - Tablet (768px - 1024px)
   ======================================== */
@media (max-width: 1024px) {
  :root {
    --space-2xl: 40px;
    --space-3xl: 56px;
  }

  /* 首页模块 */
  .diary-grid,
  .route-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  /* 关于博主 */
  .about-inner {
    flex-direction: column;
    text-align: center;
  }

  .about-image {
    flex: none;
    max-width: 300px;
  }

  .about-tags {
    justify-content: center;
  }

  /* 列表页 */
  .list-grid,
  .search-results-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 详情页 */
  .detail-inner {
    grid-template-columns: 1fr;
  }

  .detail-sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

  /* 路线概览 */
  .route-overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 景点信息 */
  .spot-info-cards {
    grid-template-columns: repeat(1, 1fr);
  }

  /* 相册网格 */
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* 页脚 */
  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   移动端 - Mobile (< 768px)
   ======================================== */
@media (max-width: 768px) {
  :root {
    --font-size-2xl: 24px;
    --font-size-3xl: 28px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 40px;
  }

  /* 容器 */
  .container,
  .container-fluid {
    padding: 0 var(--space-md);
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  /* 头部导航 - 移动端隐藏 */
  .nav {
    display: none;
  }

  /* 为底部菜单栏留出空间 */
  body {
    padding: 70px 0;
  }

  /* 底部固定菜单栏 */
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg-white);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 var(--space-md);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
    flex: 1;
    height: 100%;
  }

  .mobile-nav-item i {
    font-size: 20px;
  }

  .mobile-nav-item span {
    font-size: 11px;
    font-weight: 500;
  }

  .mobile-nav-item.active,
  .mobile-nav-item:hover {
    color: var(--primary-color);
  }

  /* 轮播图 */
  .hero-carousel {
    height: 100vh;
    min-height: 500px;
  }

  .carousel-title {
    font-size: var(--font-size-2xl);
  }

  .carousel-desc {
    font-size: var(--font-size-sm);
  }

  .carousel-arrow {
    width: 44px;
    height: 44px;
    font-size: var(--font-size-base);
  }

  .carousel-arrow.prev {
    left: 16px;
  }

  .carousel-arrow.next {
    right: 16px;
  }

  .carousel-indicators {
    bottom: 24px;
  }

  .carousel-indicator {
    width: 24px;
    height: 3px;
  }

  .carousel-indicator.active {
    width: 36px;
  }

  /* 首页模块 */
  .diary-grid,
  .route-grid,
  .spot-grid {
    grid-template-columns: 1fr;
  }
  
  .album-grid{
          /* 重置为 flex 布局，关闭换行 */
                display: flex;
                flex-wrap: nowrap;
                /* 开启横向滚动 */
                overflow-x: auto;
                /* 隐藏滚动条（多浏览器兼容） */
                -ms-overflow-style: none; /* IE/Edge */
                scrollbar-width: none; /* Firefox */
                /* 优化滑动体验：平滑滚动 + 底部内边距 */
                scroll-behavior: smooth;
                padding-bottom: 10px;
                /* 取消 grid 的 gap，改用 margin 控制间距 */
                gap: 0;
  }
  
  .album-item {
                flex-shrink: 0; /* 关键：防止 flex 子项被挤压 */
                width: 280px; /* 移动端图片宽度，可自定义 */
                margin-right: 12px; /* 替代 grid 的 gap */
            }
            
            /* 隐藏 Chrome/Safari 滚动条 */
            .album-grid::-webkit-scrollbar {
                display: none;
            }

            /* 最后一个图片项去掉右边距 */
            .album-item:last-child {
                margin-right: 0;
            }

/* 禁用全局横向弹性回弹（iOS） */
html {
  overscroll-behavior-x: none; /* 禁止横向滚动溢出到页面 */
  touch-action: pan-y;         /* 仅允许纵向滑动，禁止横向滑动 */
}

  /*.album-item:nth-child(3n+1) {
    grid-row: span 1;
  }*/

  /* 关于博主 */
  .about-image {
    max-width: 100%;
  }

  .about-image img {
    height: 300px;
  }

  /* 自媒体关注 */
  .social-platforms {
    flex-wrap: wrap;
    gap: var(--space-lg);
  }

  .social-platform-icon {
    width: 56px;
    height: 56px;
    font-size: var(--font-size-lg);
  }

  /* 筛选栏 */
  .filter-bar {
    padding: var(--space-md) 0;
  }

  .filter-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .filter-group {
    flex-wrap: wrap;
  }

  .filter-options {
    flex-wrap: wrap;
  }

  /* 列表页 */
  .list-grid,
  .search-results-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    padding: 32px 0;
  }

  .page-title {
    font-size: var(--font-size-xl);
  }

  /* 搜索头部 */
  .search-header {
    padding: 60px 0 32px;
  }

  /* 相册详情头部 */
  .album-detail-header {
    padding: 60px 0 32px;
  }

  /* 分页 */
  .pagination {
    flex-wrap: wrap;
  }

  /* 详情页 */
  .detail-header {
    padding: 60px 0 32px;
  }

  .detail-title {
    font-size: var(--font-size-xl);
  }

  .detail-meta {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .detail-content {
    padding: var(--space-lg);
  }

  .detail-cover {
    height: 240px;
  }

  .detail-sidebar {
    grid-template-columns: 1fr;
  }

  /* 路线详情 */
  .route-detail-hero {
    height: 300px;
  }

  .route-detail-hero-title {
    font-size: var(--font-size-xl);
  }

  .route-detail-hero-meta {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

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

  .route-itinerary {
    padding: var(--space-lg);
  }

  .itinerary-day {
    flex-direction: column;
    gap: var(--space-md);
  }

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

  .route-cost-list {
    grid-template-columns: 1fr;
  }

  .route-actions {
    flex-direction: column;
    padding: var(--space-lg);
  }

  /* 相册详情 */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .gallery-item:nth-child(5n+1) {
    grid-column: span 2;
    grid-row: span 2;
  }

  /* 景点详情 */
  .spot-detail-hero {
    height: 300px;
  }

  .spot-info-cards {
    grid-template-columns: 1fr;
  }

  /* 灯箱 */
  .lightbox-nav {
    display: none;
  }

  .lightbox-close {
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.5);
  }

  /* 页脚 */
  .footer-inner {
  grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer-column{
      display: none;
  }
  
  .footer-logo{
      justify-content: center;
  }

  .footer-brand {
    max-width: 100%;
  }

  .footer-social {
    justify-content: center;
  }

  /* 返回顶部 */
  .back-to-top {
    width: 44px;
    height: 44px;
    bottom: 90px;
    right: 20px;
  }
}

/* ========================================
   小屏移动端 - Small Mobile (< 480px)
   ======================================== */
@media (max-width: 480px) {
  :root {
    --font-size-xl: 20px;
    --font-size-2xl: 22px;
  }

  /* 路线概览 */
  .route-overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 每日行程图片 */
  .itinerary-day-images {
    grid-template-columns: 1fr;
  }

  /* 相册网格 */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-item:nth-child(5n+1) {
    grid-column: span 2;
    grid-row: span 1;
  }

  /* 二维码弹窗 */
  .qr-code {
    width: 160px;
    height: 160px;
  }

  .contact-qr-code {
    width: 150px;
    height: 150px;
  }
}

/* ========================================
   横屏模式 - Landscape Mode
   ======================================== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-carousel {
    height: 100vh;
    min-height: 400px;
  }

  .carousel-content {
    padding: 0 var(--space-xl);
  }

  .carousel-title {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-sm);
  }

  .carousel-desc {
    font-size: var(--font-size-xs);
    margin-bottom: var(--space-md);
  }
}

/* ========================================
   打印样式 - Print Styles
   ======================================== */
@media print {
  .header,
  .footer,
  .back-to-top,
  .filter-bar,
  .detail-sidebar,
  .pagination,
  .carousel-arrow,
  .carousel-indicators {
    display: none !important;
  }

  .detail-section {
    padding: 0;
  }

  .detail-inner {
    grid-template-columns: 1fr;
  }

  .detail-main {
    box-shadow: none;
  }

  .detail-content {
    padding: 0;
  }
}

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

  .carousel-slide-bg {
    transform: none !important;
  }

  .card:hover,
  .diary-card:hover,
  .route-card:hover,
  .spot-card:hover,
  .album-item:hover {
    transform: none;
  }
}

/* ========================================
   深色模式支持 - Dark Mode Support
   ======================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --bg-white: #1a1a1a;
    --bg-light: #242424;
    --bg-gray: #2a2a2a;
    --border-color: #333333;
    --border-light: #3a3a3a;
  }

  .header {
    background: rgba(26, 26, 26, 0.95);
  }

  .card,
  .diary-card,
  .route-card,
  .spot-card,
  .album-list-card,
  .diary-list-card,
  .route-list-card,
  .spot-list-card,
  .search-result-card {
    background: #242424;
  }

  .sidebar-widget,
  .detail-main {
    background: #242424;
  }

  .filter-option {
    background: #2a2a2a;
  }

  .pagination-btn {
    background: #242424;
    border-color: #3a3a3a;
  }
}
