/* 响应式布局最终修复 */

/* ========================================
   移动端导航修复
   ======================================== */

@media (max-width: 768px) {
    /* 导航栏移动端修复 */
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        height: 60px;
    }
    
    .nav-content {
        height: 60px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* 导航链接移动端样式 */
    .nav-links {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background: linear-gradient(135deg, rgba(139, 111, 71, 0.98) 0%, rgba(107, 93, 66, 0.98) 100%);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        transition: left 0.3s ease;
        overflow-y: auto;
        z-index: 999;
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-links a {
        display: block;
        padding: 0.75rem 1rem;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* 移动菜单按钮显示 */
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    /* 内容区域补偿导航栏高度 */
    .content-wrapper {
        margin-top: 60px !important;
    }
    
    /* Hero区域修复 */
    .hero {
        min-height: calc(100vh - 60px);
        height: calc(100vh - 60px);
    }
}

/* ========================================
   布局组件响应式修复
   ======================================== */

/* 服务网格响应式 */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
}

/* 优势网格响应式 */
@media (max-width: 768px) {
    .advantages-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
}

/* 产品卡片响应式 */
@media (max-width: 768px) {
    .product-cards {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
}

/* 团队网格响应式 */
@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
}

/* 首页介绍卡片响应式 */
@media (max-width: 768px) {
    .intro-content {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
}

/* ========================================
   文字大小响应式调整
   ======================================== */

@media (max-width: 768px) {
    /* 标题调整 */
    .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }
    
    .hero-description {
        font-size: 1rem !important;
    }
    
    .section-title {
        font-size: 2rem !important;
    }
    
    /* 按钮组调整 */
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem !important;
    }
    
    .hero-subtitle {
        font-size: 1.2rem !important;
    }
    
    .section-title {
        font-size: 1.75rem !important;
    }
    
    /* 小屏幕内边距调整 */
    section {
        padding: 60px 0 !important;
    }
    
    .container {
        padding: 0 15px;
    }
}

/* ========================================
   平板设备优化
   ======================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    /* 服务网格 - 平板两列 */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 优势网格 - 平板两列 */
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 产品卡片 - 平板两列 */
    .product-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 团队网格 - 平板两列 */
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   表单响应式优化
   ======================================== */

@media (max-width: 768px) {
    /* 表单布局 */
    .contact-form {
        padding: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* 表单输入框 */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select,
    textarea {
        width: 100%;
        padding: 12px 15px;
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    
    /* 提交按钮 */
    button[type="submit"] {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }
}

/* ========================================
   页脚响应式优化
   ======================================== */

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .footer-links a {
        padding: 0.5rem;
    }
}

/* ========================================
   特殊组件修复
   ======================================== */

/* 标签页按钮移动端滚动 */
@media (max-width: 768px) {
    .tab-buttons {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
        gap: 0.5rem;
    }
    
    .tab-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .tab-buttons::-webkit-scrollbar {
        height: 4px;
    }
    
    .tab-buttons::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 2px;
    }
}

/* 统计数据网格 */
@media (max-width: 768px) {
    .stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   动画和过渡优化
   ======================================== */

/* 移动端减少动画 */
@media (max-width: 768px) {
    * {
        animation-duration: 0.3s !important;
    }
    
    .hero-content {
        animation: none;
    }
    
    /* 移动端禁用悬停效果 */
    .service-card:hover,
    .intro-card:hover,
    .product-card:hover,
    .team-member:hover {
        transform: none !important;
    }
}

/* ========================================
   横向模式优化
   ======================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
    }
    
    .hero-title {
        font-size: 2rem !important;
    }
    
    .hero-subtitle {
        font-size: 1.2rem !important;
    }
    
    .hero-buttons {
        flex-direction: row;
    }
    
    .nav-links {
        height: calc(100vh - 50px);
    }
}