/* 移动端适配和用户体验优化 */

/* 基础响应式设置 */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* 移动端触摸优化 */
@media (max-width: 768px) {
    /* 增大触摸目标 */
    .nav-link,
    .btn,
    .product-card,
    .filter-btn,
    .timeline-item {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 优化滚动性能 */
    .product-grid,
    .timeline,
    .equipment-grid,
    .honors-grid {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* 防止水平滚动 */
    body {
        overflow-x: hidden;
        position: relative;
    }
    
    /* 优化字体大小 */
    html {
        font-size: 14px;
    }
    
    /* 优化间距 */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* 导航栏移动端优化 */
    .nav-container {
        position: relative;
        padding: 0 15px;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        padding: 80px 20px 40px;
        margin: 0;
        flex-direction: column;
        backdrop-filter: blur(10px);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-item {
        margin: 0;
        margin-bottom: 15px;
        width: 100%;
    }
    
    .nav-link {
        padding: 15px 20px;
        border-radius: 8px;
        transition: all 0.3s ease;
        font-size: 16px;
        font-weight: 500;
        color: white !important;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(5px);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: rgba(255, 255, 255, 0.2);
        transform: translateX(5px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
    
    /* 汉堡菜单优化 */
    .hamburger {
        display: block;
        position: absolute;
        top: 50%;
        right: 15px;
        transform: translateY(-50%);
        width: 30px;
        height: 25px;
        cursor: pointer;
        z-index: 1001;
        padding: 5px;
        border-radius: 4px;
        transition: background 0.3s ease;
    }
    
    .hamburger:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .hamburger span {
        display: block;
        width: 100%;
        height: 3px;
        background: white;
        margin: 4px 0;
        transition: all 0.3s ease;
        border-radius: 2px;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* 遮罩层 */
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(3px);
    }
    
    .overlay.active {
        display: block;
    }
    
    /* 轮播图移动端优化 */
    .hero-slider {
        height: 400px;
    }
    
    .slide {
        height: 400px;
    }
    
    .slide-content h2 {
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .slide-content p {
        font-size: 1rem;
        margin-bottom: 25px;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 0.9rem;
        min-width: 120px;
    }
    
    /* 产品网格移动端优化 */
    .product-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 10px;
    }
    
    .product-card {
        padding: 20px;
        margin: 0 10px;
        border-radius: 12px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    }
    
    .product-image {
        height: 200px;
        margin-bottom: 20px;
    }
    
    .product-info h3 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .product-specs {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    
    /* 产品筛选器优化 */
    .filter-container {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
        margin: 20px 10px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-buttons {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }
    
    .filter-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
        border-radius: 20px;
        min-width: 80px;
    }
    
    /* 搜索框优化 */
    .search-box {
        width: 100%;
        max-width: none;
    }
    
    .search-box input {
        padding: 12px 45px 12px 15px;
        font-size: 1rem;
    }
    
    .search-box button {
        right: 10px;
        padding: 8px 12px;
        font-size: 1rem;
    }
    
    /* 技术参数表优化 */
    .tech-table {
        font-size: 0.8rem;
        margin: 20px 10px;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .tech-table th,
    .tech-table td {
        padding: 8px 10px;
        min-width: 80px;
    }
    
    /* 关于页面时间轴优化 */
    .timeline {
        padding: 20px 10px;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 50px;
        padding-right: 10px;
        margin-bottom: 30px;
        transform: none !important;
    }
    
    .timeline-item:nth-child(even) {
        padding-left: 50px;
        padding-right: 10px;
    }
    
    .timeline-item::before {
        left: 20px;
        transform: translateX(-50%);
    }
    
    .timeline-content {
        padding: 20px;
        border-radius: 12px;
    }
    
    .timeline-date {
        position: static;
        margin-bottom: 10px;
        font-size: 0.9rem;
    }
    
    .timeline-item:nth-child(even) .timeline-date {
        text-align: left;
    }
    
    /* 企业文化网格优化 */
    .culture-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 10px;
    }
    
    .culture-item {
        padding: 25px 20px;
        border-radius: 12px;
    }
    
    .culture-icon {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }
    
    .culture-item h3 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    /* 生产设备网格优化 */
    .equipment-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 10px;
    }
    
    .equipment-item {
        border-radius: 12px;
        overflow: hidden;
    }
    
    .equipment-image {
        height: 200px;
    }
    
    .equipment-info {
        padding: 20px;
    }
    
    /* 荣誉资质网格优化 */
    .honors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 20px 10px;
    }
    
    .honor-item {
        padding: 20px 15px;
        border-radius: 10px;
    }
    
    .honor-icon {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .honor-item h4 {
        font-size: 0.9rem;
    }
    
    /* 联系表单优化 */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px 10px;
    }
    
    .contact-form {
        padding: 25px 20px;
        border-radius: 12px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 12px 15px;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    .contact-info {
        padding: 25px 20px;
        border-radius: 12px;
    }
    
    .contact-item {
        margin-bottom: 20px;
        padding: 15px;
        border-radius: 8px;
    }
    
    .contact-item i {
        font-size: 1.2rem;
        margin-right: 15px;
    }
    
    /* 页脚优化 */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 40px 20px;
        text-align: center;
    }
    
    .footer-section {
        margin-bottom: 30px;
    }
    
    .footer-section h3 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .footer-section ul li {
        margin-bottom: 8px;
    }
    
    .footer-section a {
        font-size: 0.9rem;
    }
    
    .footer-bottom {
        padding: 20px;
        text-align: center;
    }
    
    .footer-bottom p {
        font-size: 0.8rem;
        line-height: 1.6;
    }
    
    /* 返回顶部按钮优化 */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        border-radius: 50%;
        box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
    }
    
    /* 模态框优化 */
    .modal-content {
        margin: 10% auto;
        padding: 25px;
        width: 95%;
        max-width: 500px;
        border-radius: 12px;
    }
    
    .modal-header {
        padding-bottom: 15px;
        margin-bottom: 20px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .close {
        font-size: 24px;
        top: 15px;
        right: 20px;
    }
    
    /* 通知消息优化 */
    .notification {
        top: 70px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateX(0) translateY(-100px);
        border-radius: 8px;
        padding: 12px 15px;
    }
    
    .notification.show {
        transform: translateX(0) translateY(0);
    }
    
    /* 加载动画优化 */
    .loading {
        padding: 30px 20px;
    }
    
    .spinner {
        width: 40px;
        height: 40px;
        border-width: 4px;
    }
    
    /* 图片懒加载优化 */
    .lazy-image {
        min-height: 150px;
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
    }
    
    @keyframes loading {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }
    
    /* 性能优化 */
    .product-card,
    .timeline-item,
    .culture-item,
    .equipment-item,
    .honor-item {
        will-change: transform;
        transform: translateZ(0);
    }
    
    /* 减少动画以提升性能 */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
    
    /* 深色模式支持 */
    @media (prefers-color-scheme: dark) {
        .product-card,
        .timeline-content,
        .culture-item,
        .equipment-item,
        .honor-item,
        .contact-form,
        .contact-info {
            background: #2a2a2a;
            color: #ffffff;
        }
        
        .tech-table {
            background: #2a2a2a;
            color: #ffffff;
        }
        
        .tech-table th {
            background: #3a3a3a;
        }
        
        .tech-table tr:nth-child(even) {
            background: #333333;
        }
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
    
    .hero-slider {
        height: 350px;
    }
    
    .slide {
        height: 350px;
    }
    
    .slide-content h2 {
        font-size: 1.8rem;
    }
    
    .slide-content p {
        font-size: 0.9rem;
    }
    
    .honors-grid {
        grid-template-columns: 1fr;
    }
    
    .product-image {
        height: 180px;
    }
    
    .equipment-image {
        height: 180px;
    }
    
    .nav-menu {
        width: 260px;
    }
    
    .filter-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-width: 70px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

/* 平板横屏优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .culture-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .equipment-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .honors-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 20px;
    }
    
    .timeline-item:nth-child(even) {
        padding-left: 70px;
        padding-right: 20px;
    }
    
    .timeline-item::before {
        left: 30px;
    }
    
    .timeline-date {
        position: static;
        margin-bottom: 10px;
    }
    
    .timeline-item:nth-child(even) .timeline-date {
        text-align: left;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
}

/* 键盘导航支持 */
.keyboard-navigation *:focus {
    outline: 2px solid #1e3c72 !important;
    outline-offset: 2px !important;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .product-card,
    .timeline-content,
    .culture-item,
    .equipment-item,
    .honor-item,
    .contact-form,
    .contact-info {
        border: 2px solid currentColor;
    }
    
    .nav-link,
    .btn,
    .filter-btn {
        border: 2px solid currentColor;
    }
    
    .tech-table th,
    .tech-table td {
        border: 2px solid currentColor;
    }
}

/* 打印样式优化 */
@media print {
    .nav-container,
    .back-to-top,
    .hamburger,
    .overlay,
    .notification,
    .modal {
        display: none !important;
    }
    
    .hero-slider,
    .slide {
        height: auto !important;
        background: none !important;
        color: black !important;
    }
    
    .product-card,
    .timeline-content,
    .culture-item,
    .equipment-item,
    .honor-item,
    .contact-form,
    .contact-info {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        background: white !important;
        color: black !important;
    }
    
    .tech-table {
        background: white !important;
        color: black !important;
    }
    
    .tech-table th {
        background: #f5f5f5 !important;
        color: black !important;
    }
    
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt !important;
        line-height: 1.5 !important;
    }
    
    .container {
        max-width: none !important;
        padding: 0 !important;
    }
    
    .section {
        padding: 20px 0 !important;
        margin: 0 !important;
    }
    
    .section-title {
        color: black !important;
        font-size: 18pt !important;
        margin-bottom: 15px !important;
    }
    
    a {
        color: black !important;
        text-decoration: underline !important;
    }
    
    img {
        max-width: 100% !important;
        height: auto !important;
    }
}