﻿/* 响应式设计 */

/* 大屏幕 (1200px 及以上) */
@media (min-width: 1200px) {
    .container {
        max-width: 1600px;
    }
}

/* 中等屏幕 (992px - 1199px) */
@media (max-width: 1199px) {
    .hero-text h1 {
        font-size: 3rem;
    }
    
    .hero-text h2 {
        font-size: 2.5rem;
    }
    
    .hero-text h4 {
        font-size: 2rem;
    }
}

/* 平板横屏 (768px - 991px) */
@media (max-width: 991px) {
    .nav-menu {
        position: fixed !important;
        top: 75px !important;
        left: -100% !important;
        flex-direction: column !important;
        background: #C6AA76 !important;
        width: 100% !important;
        height: calc(100vh - 75px) !important;
        transition: left 0.3s ease !important;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
        padding: 20px 0 !important;
        /* 新增：确保层级最高、背景统一，避免各页面样式导致内容不可见 */
        z-index: 1001 !important;
        overflow-y: auto !important;
        display: flex !important;
    }
    
    .nav-menu.active {
        left: 0 !important;
    }
    
    /* 强制显示汉堡菜单，避免被后续页面样式覆盖 */
    .hamburger {
        display: flex !important;
    }
    
    /* 新增：防止小屏出现横向滚动条 */
    html, body {
        overflow-x: hidden;
    }
    
    /* 新增：保证抽屉菜单里的链接在所有页面都可见 */
    .nav-menu a,
    .nav-menu .nav-link {
        color: #fff !important;
        padding: 15px 20px !important;
        display: block !important;
        text-align: center !important;
    }

    .nav-menu li {
        margin: 10px 0 !important;
        width: 100% !important;
    }

    /* 下拉菜单在移动端默认折叠，仅在父级 .dropdown.open 时展开 */
    .nav-menu .dropdown-menu {
        position: static !important;
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transform: none !important;
        box-shadow: none !important;
        background-color: rgba(255, 255, 255, 0.1) !important;
        margin-top: 10px !important;
        padding: 10px 0 !important;
    }
    
    .nav-menu .dropdown.open > .dropdown-menu {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .nav-menu .dropdown-menu a {
        color: #fff !important;
        padding: 10px 15px !important;
    }
    
    .nav-menu .dropdown-menu a:hover {
        background-color: rgba(255, 255, 255, 0.2) !important;
        color: #fff !important;
    }

    /* 移动端优化：避免导航超出屏幕宽度 */
    .navbar .container {
        padding: 12px 15px;
    }

    .nav-controls {
        gap: 12px;
    }

    /* 移动端隐藏音乐开关，减少导航占位 */
    .music-control,
    .music-toggle {
        display: none !important;
    }

    /* 缩小品牌 Logo，保证导航元素在同一行内不超出 */
    .brand-logo {
        max-width: 150px;
    }
    
    /* 汉堡菜单激活状态的 X 形态 (通用样式) */
    .hamburger.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    /* 主视觉区域调整为单列 */
    .hero-layout {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 80px;
        padding: 40px 0;
    }
    
    .hero-right {
        padding-left: 0;
    }
    
    .hero-text h1 {
        font-size: 2.8rem;
    }
    
    .hero-text h2 {
        font-size: 2.3rem;
    }
    
    .hero-text h4 {
        font-size: 2rem;
    }
    
    /* 公司介绍和生产工艺调整为单列 */
    .intro-layout,
    .process-layout {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    
    .intro-layout {
        text-align: center;
    }
    
    .process-layout {
        text-align: center;
    }
    
    /* 产品中心调整为单列 */
    .product-layout {
        grid-template-columns: 1fr;
        gap: 60px;
        text-align: center;
    }
    
    .product-left h2 {
        font-size: 2.8rem;
    }
    
    .product-nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .nav-item {
        max-width: none;
        min-width: 120px;
    }
    
    /* 页脚调整 */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .footer-right {
        text-align: center;
    }
}

/* 移动端下拉菜单的强制折叠规则，覆盖各页面自身样式 */
@media (max-width: 991px) {
    /* 默认折叠所有二级菜单，仅在父级 .dropdown.open 时展开 */
    .dropdown-menu {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        height: 0 !important;
        overflow: hidden !important;
        transform: none !important;
        box-shadow: none !important;
    }

    .nav-menu.active .dropdown.open > .dropdown-menu {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        height: auto !important;
        overflow: visible !important;
    }

    .nav-menu:not(.active) .dropdown-menu {
        display: none !important;
    }
}

/* 平板竖屏 (576px - 767px) */
@media (max-width: 767px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding-top: 80px;
        min-height: auto;
        padding-bottom: 60px;
    }
    
    .hero-layout {
        gap: 60px;
        padding: 20px 0;
    }
    
    .golden-towel {
        max-width: 280px;
    }
    
    .podium {
        max-width: 220px;
    }
    
    .plant-img {
        max-width: 200px;
    }
    
    .product-3d {
        max-width: 350px;
    }
    
    .hero-text h1 {
        font-size: 2.2rem;
    }
    
    .hero-text h2 {
        font-size: 1.8rem;
    }
    
    .hero-text h3 {
        font-size: 1.4rem;
    }
    
    .hero-text h4 {
        font-size: 1.6rem;
    }
    
    .hero-text h5 {
        font-size: 1.4rem;
    }
    
    .company-intro,
    .production-process,
    .product-center,
    .product-categories {
        padding: 80px 0;
    }
    
    .intro-content h3,
    .process-content h3 {
        font-size: 2.2rem;
    }
    
    .product-left h2 {
        font-size: 2.2rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .category-image {
        height: 220px;
    }
    
    .building-photo,
    .production-photo {
        height: 350px;
    }
    
    .social-links {
        gap: 20px;
    }
    
    .social-icon {
        width: 45px;
        height: 45px;
    }
    
    .social-icon img {
        width: 22px;
        height: 22px;
    }

    /* 手机端隐藏首页 Banner 文字和蓝色毛巾产品区域左侧文字，避免撑开页面 */
    body.home-page .banner-text-overlay,
    body.home-page .product-left-text {
        display: none !important;
    }
    
    /* 在小屏幕下，确保汉堡菜单激活的 X 形态更明显 */
    .hamburger.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px) !important;
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0 !important;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px) !important;
    }
}

/* 手机横屏 (480px - 575px) */
@media (max-width: 575px) {
    .navbar {
        padding: 12px 0;
    }
    
    .nav-brand .logo {
        height: 40px;
    }
    
    .brand-text {
        font-size: 1.3rem;
    }
    
    .hero-text h1 {
        font-size: 1.8rem;
    }
    
    .hero-text h2 {
        font-size: 1.5rem;
    }
    
    .hero-text h3 {
        font-size: 1.2rem;
    }
    
    .hero-text h4 {
        font-size: 1.3rem;
    }
    
    .hero-text h5 {
        font-size: 1.2rem;
    }
    
    .golden-towel {
        max-width: 220px;
    }
    
    .podium {
        max-width: 180px;
    }
    
    .plant-img {
        max-width: 160px;
    }
    
    .intro-content h3,
    .process-content h3 {
        font-size: 1.8rem;
    }
    
    .intro-item h4 {
        font-size: 1.2rem;
    }
    
    .product-left h2 {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
    
    .product-nav {
        gap: 12px;
    }
    
    .nav-item {
        padding: 12px 20px;
        font-size: 1rem;
        min-width: 100px;
    }
    
    .product-3d {
        max-width: 280px;
    }
    
    .geo-circle {
        right: -10%;
        max-width: 120px;
    }
    
    .geo-tube {
        left: -15%;
        max-width: 90px;
    }
}

/* 手机竖屏 (最大 479px) */
@media (max-width: 479px) {
    .container {
        padding: 0 12px;
    }
    
    .hero {
        padding-top: 70px;
        padding-bottom: 40px;
    }
    
    .hero-layout {
        gap: 40px;
        padding: 15px 0;
    }
    
    .hero-text h1 {
        font-size: 1.6rem;
        margin-bottom: 8px;
    }
    
    .hero-text h2 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .hero-text h3 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .hero-text h4 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .hero-text h5 {
        font-size: 1rem;
    }
    
    .golden-towel {
        max-width: 180px;
    }
    
    .podium {
        max-width: 140px;
    }
    
    .plant-img {
        max-width: 130px;
    }
    
    .plant-decoration {
        margin-bottom: 20px;
    }
    
    .company-intro,
    .production-process,
    .product-center,
    .product-categories {
        padding: 60px 0;
    }
    
    .intro-layout,
    .process-layout {
        gap: 40px;
    }
    
    .intro-content h3,
    .process-content h3 {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }
    
    .intro-list {
        gap: 25px;
    }
    
    .intro-item h4 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .process-subtitle {
        font-size: 1.1rem;
        margin-bottom: 25px;
    }
    
    .product-layout {
        gap: 40px;
    }
    
    .product-left h2 {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }
    
    .product-nav {
        gap: 10px;
    }
    
    .nav-item {
        padding: 10px 15px;
        font-size: 0.9rem;
        min-width: 80px;
    }
    
    .product-3d {
        max-width: 220px;
    }
    
    .geo-circle {
        right: -5%;
        max-width: 100px;
    }
    
    .geo-tube {
        left: -10%;
        max-width: 70px;
    }
    
    .building-photo,
    .production-photo {
        height: 280px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .category-image {
        height: 200px;
    }
    
    .footer-content {
        gap: 30px;
    }
    
    .footer-text {
        font-size: 1rem;
    }
    
    .footer-links {
        gap: 15px;
    }
    
    .footer-link {
        font-size: 0.9rem;
    }
    
    .social-links {
        gap: 15px;
    }
    
    .social-icon {
        width: 40px;
        height: 40px;
    }
    
    .social-icon img {
        width: 20px;
        height: 20px;
    }
}

/* 超小手机屏幕 (最大 360px) */
@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }
    
    .hero-text h1 {
        font-size: 1.4rem;
    }
    
    .hero-text h2 {
        font-size: 1.2rem;
    }
    
    .hero-text h3 {
        font-size: 0.9rem;
    }
    
    .hero-text h4 {
        font-size: 1rem;
    }
    
    .hero-text h5 {
        font-size: 0.9rem;
    }
    
    .golden-towel {
        max-width: 160px;
    }
    
    .podium {
        max-width: 120px;
    }
    
    .plant-img {
        max-width: 110px;
    }
    
    .intro-content h3,
    .process-content h3 {
        font-size: 1.3rem;
    }
    
    .product-left h2 {
        font-size: 1.3rem;
    }
    
    .nav-item {
        padding: 8px 12px;
        font-size: 0.8rem;
        min-width: 70px;
    }
    
    .product-3d {
        max-width: 200px;
    }
    
    .category-image {
        height: 180px;
    }
    
    .building-photo,
    .production-photo {
        height: 250px;
    }
}