/* 响应式布局文件 - 支持PC、平板、手机三端适配 */

/* 桌面端默认样式 (≥1200px) */
@media (min-width: 1200px) {
  .container {
    max-width: 1400px;
  }
  
  .grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .masonry-grid {
    column-count: 4;
  }
  
  .hero-carousel .hero-slide h2 {
    font-size: 3rem;
  }
}

/* 平板端样式 (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
  .container {
    max-width: 960px;
    padding: 0 2rem;
  }
  
  nav .nav-links {
    gap: 1.5rem;
  }
  
  nav .nav-links a {
    font-size: 14px;
  }
  
  .grid-3x3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .masonry-grid {
    column-count: 3;
    column-gap: 1.5rem;
  }
  
  .hero-carousel .hero-slide h2 {
    font-size: 2.5rem;
  }
  
  .hero-carousel .hero-slide p {
    font-size: 1rem;
  }
  
  .page-title {
    font-size: 2.5rem;
  }
  
  .detail-text {
    max-width: 100%;
    padding: 1.5rem;
  }
  
  .style-filters {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .style-filters button {
    font-size: 14px;
    padding: 0.5rem 1.25rem;
  }
}

/* 手机端样式 (≤767px) */
@media (max-width: 767px) {
  .container {
    max-width: 100%;
    padding: 0 1rem;
  }
  
  /* 导航栏移动端适配 */
  nav {
    padding: 0.75rem 1rem;
  }
  
  nav .logo {
    font-size: 1rem;
  }
  
  nav .nav-links {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    flex-direction: column;
    padding: 2rem 1rem;
    gap: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }
  
  nav .nav-links.active {
    display: flex;
  }
  
  nav .nav-links a {
    font-size: 1.125rem;
    width: 100%;
    text-align: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
  }
  
  nav .nav-links a:last-child {
    border-bottom: none;
  }
  
  /* 汉堡菜单按钮 */
  .mobile-menu-btn {
    display: block;
    width: 28px;
    height: 24px;
    position: relative;
    cursor: pointer;
  }
  
  .mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: #333;
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
  }
  
  .mobile-menu-btn span:nth-child(1) {
    top: 0;
  }
  
  .mobile-menu-btn span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
  }
  
  .mobile-menu-btn span:nth-child(3) {
    bottom: 0;
  }
  
  .mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 50%;
  }
  
  .mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg);
    bottom: 50%;
  }
  
  /* 首页轮播图适配 */
  .hero-carousel {
    height: 100vh;
  }
  
  .hero-carousel .hero-slide h2 {
    font-size: 1.75rem;
    padding: 0 1rem;
  }
  
  .hero-carousel .hero-slide p {
    font-size: 0.875rem;
    padding: 0 1rem;
    max-width: 90%;
  }
  
  .scroll-indicator {
    bottom: 2rem;
  }
  
  /* 页面标题适配 */
  .page-title {
    font-size: 2rem;
    margin-top: 5rem;
  }
  
  .page-subtitle {
    font-size: 1rem;
  }
  
  /* 3x3网格改为单列 */
  .grid-3x3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .detail-item {
    height: 400px;
  }
  
  .detail-text {
    position: static;
    max-width: 100%;
    padding: 1rem;
    margin-top: 1rem;
    opacity: 1;
    transform: none;
  }
  
  .detail-item:hover .detail-text {
    transform: none;
  }
  
  /* 瀑布流改为单列 */
  .masonry-grid {
    column-count: 1;
    column-gap: 0;
  }
  
  .masonry-item {
    margin-bottom: 1.5rem;
  }
  
  /* 筛选标签适配 */
  .style-filters {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }
  
  .style-filters button {
    font-size: 13px;
    padding: 0.5rem 1rem;
    flex: 0 1 auto;
  }
  
  /* 页脚适配 */
  footer {
    padding: 2rem 1rem;
    margin-top: 3rem;
  }
  
  footer p {
    font-size: 12px;
  }
}

/* 超小屏幕适配 (≤480px) */
@media (max-width: 480px) {
  .hero-carousel .hero-slide h2 {
    font-size: 1.5rem;
  }
  
  .page-title {
    font-size: 1.75rem;
  }
  
  .detail-item {
    height: 350px;
  }
  
  .style-filters button {
    font-size: 12px;
    padding: 0.4rem 0.875rem;
  }
}

/* 横屏适配 */
@media (max-width: 767px) and (orientation: landscape) {
  .hero-carousel {
    height: auto;
    min-height: 100vh;
  }
  
  .hero-carousel .hero-slide {
    padding: 3rem 1rem;
  }
  
  nav .nav-links {
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }
}

/* 打印样式 */
@media print {
  nav,
  .scroll-indicator,
  .style-filters,
  footer {
    display: none;
  }
  
  .hero-carousel,
  .grid-3x3,
  .masonry-grid {
    page-break-inside: avoid;
  }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .detail-item .detail-text {
    position: static;
    opacity: 1;
    transform: none;
    margin-top: 1rem;
  }
  
  .masonry-item img {
    transition: none;
  }
  
  nav .nav-links a:hover {
    background-color: rgba(179, 84, 60, 0.05);
  }
}

/* 减少动画偏好设置 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}