/* 响应式设计样式文件 - 济南芯智创联智能科技有限公司 */

/* 大屏幕 (1200px以上) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-content h1 {
        font-size: 65px;
    }
    
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 大屏幕 (992px - 1199px) */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }

    .hero-content h1 {
        font-size: 50px;
    }

    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 中等屏幕 (768px - 991px) */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
        padding: 0 15px;
    }

    .hero-content h1 {
        font-size: 42px;
    }

    .hero-subtitle {
        font-size: 28px;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 产品详情页响应式 */
    .product-detail-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .product-gallery {
        order: 1;
    }

    .product-info {
        order: 2;
    }

    .thumbnail-gallery {
        justify-content: center;
    }
}

/* 小屏幕 (576px - 767px) */
@media (max-width: 767px) {
    .container {
        max-width: 540px;
        padding: 0 10px;
    }

    .nav-container {
        padding: 10px 15px;
    }

    .nav-logo img {
        height: 35px;
    }

    .hero-section {
        min-height: 500px;
    }

    .hero-content h1 {
        font-size: 36px;
        margin-bottom: 15px;
    }

    .hero-subtitle {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .hero-services {
        font-size: 16px;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .service-card {
        padding: 30px 20px;
    }

    .advantages-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .advantage-number {
        font-size: 40px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* 页脚响应式 */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-section {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    /* 产品详情页响应式 */
    .breadcrumb {
        font-size: 14px;
    }

    .product-title {
        font-size: 24px;
    }

    .price-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .btn-large {
        width: 100%;
    }

    /* 标签页响应式 */
    .description-tabs {
        flex-wrap: wrap;
        gap: 10px;
    }

    .tab-btn {
        flex: 1;
        min-width: 120px;
    }

    /* 相关产品响应式 */
    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* 移动端菜单样式 */
.mobile-menu-container {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1001;
}

.mobile-menu-btn {
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.menu-icon {
    display: block;
    width: 25px;
    height: 2px;
    background: #333;
    position: relative;
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 2px;
    background: #333;
    left: 0;
}

.menu-icon::before {
    top: -8px;
}

.menu-icon::after {
    top: 8px;
}

/* 超小屏幕 (575px以下) */
@media (max-width: 575px) {
    .mobile-menu-container {
        display: block;
    }
    
    .container {
        padding: 0 15px;
    }

    /* 头部区域优化 */
    .hero-section {
        min-height: 500px;
        height: auto;
    }

    .hero-content h1 {
        font-size: 28px;
        line-height: 1.3;
    }

    .hero-subtitle {
        font-size: 18px;
        line-height: 1.4;
    }

    .hero-services {
        font-size: 14px;
    }

    /* 导航菜单优化 */
    .nav-container {
        padding: 10px 15px;
    }

    .nav-logo img {
        height: 35px;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 1000;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        margin: 12px 0;
    }

    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        padding: 10px;
        cursor: pointer;
    }

    /* 产品网格优化 */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* 通用样式优化 */
    .section-header h2 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .section-divider {
        height: 2px;
        width: 50px;
        background: #007bff;
        margin: 0 auto 20px;
    }

    /* 按钮优化 */
    .btn {
        padding: 10px 20px;
        font-size: 14px;
        border-radius: 6px;
    }

    /* 页脚优化 */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-section {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    /* 表单元素优化 */
    input, textarea, select {
        font-size: 16px !important;
    }

    /* 触摸目标大小优化 */
    a, button, input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* 产品详情页响应式 */
    .main-image-container {
        height: 300px;
    }

    .thumbnail-item {
        width: 60px;
        height: 60px;
        border: 2px solid transparent;
        cursor: pointer;
    }

    .product-specifications h3,
    .product-features h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .spec-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* 标签页响应式 */
    .tab-btn {
        min-width: 100px;
        font-size: 12px;
        padding: 8px 12px;
    }

    /* 相关产品响应式 */
    .related-products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* 分页响应式 */
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
    }

    .page-link {
        padding: 6px 12px;
        font-size: 14px;
        min-width: 36px;
    }

    /* 模态框响应式 */
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
        max-width: none;
    }

    .modal-header {
        padding: 15px;
        border-bottom: 1px solid #e0e0e0;
    }

    .modal-body {
        padding: 20px;
    }

    .form-input,
    .form-textarea {
        padding: 10px 12px;
        border: 1px solid #ddd;
        border-radius: 4px;
    }
}

/* 手机横屏模式 */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: 400px;
    }

    .hero-content h1 {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 20px;
    }

    .main-image-container {
        height: 250px;
    }
    
    .nav-logo img,
    .service-icon img,
    .social-links img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #ffffff;
        --background-color: #1a1a1a;
        --card-bg: #2d2d2d;
        --primary-color: #007bff;
    }

    body {
        color: var(--text-color);
        background-color: var(--background-color);
    }

    .navbar {
        background: rgba(45, 45, 45, 0.95);
    }

    .nav-link {
        color: var(--text-color);
    }

    .service-card,
    .product-card {
        background: var(--card-bg);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }

    .service-card h3,
    .product-title {
        color: var(--text-color);
    }

    .service-card p,
    .product-description {
        color: #cccccc;
    }

    .footer {
        background: #2d2d2d;
    }
    
    .footer,
    .action-buttons,
    .description-tabs {
        display: block !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    .container {
        max-width: none;
        padding: 0;
    }

    .product-detail-content {
        display: block;
    }

    .product-gallery {
        float: right;
        width: 40%;
    }

    .product-info {
        width: 55%;
    }

    .page-break {
        page-break-before: always;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
    
    .service-card,
    .product-card,
    .advantage-item {
        transform: none !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --text-color: #000000;
        --background-color: #ffffff;
        --primary-color: #0000ff;
    }

    .btn-primary {
        background: var(--primary-color);
        border: 2px solid var(--primary-color);
        color: #fff;
    }

    .nav-link.active {
        text-decoration: underline;
        text-underline-offset: 4px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .product-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.5);
    }

    .product-view-btn {
        opacity: 1;
        transform: translateY(0);
    }

    .service-card:hover,
    .product-card:hover {
        transform: none;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    
    .category-btn,
    .page-link,
    .tab-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .thumbnail-item {
        min-width: 60px;
        min-height: 60px;
    }
}

/* 折叠屏幕设备 */
@media (max-width: 400px) {
    .hero-content h2 {
        font-size: 24px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .section-header h2 {
        font-size: 24px;
    }

    .advantage-number {
        font-size: 32px;
    }

    .product-title {
        font-size: 18px;
    }

    .price-section .price {
        font-size: 18px;
    }

    .breadcrumb {
        font-size: 12px;
    }
}

/* 超宽屏幕设备 */
@media (min-width: 1600px) {
    .container {
        max-width: 1500px;
    }

    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 产品详情页图片响应式 */
@media (max-width: 991px) {
    .main-image-container {
        height: 400px;
    }

    .thumbnail-gallery {
        overflow-x: auto;
        justify-content: flex-start;
    }

    .thumbnails-container {
        display: flex;
        gap: 10px;
    }

    .thumbnail-item {
        flex-shrink: 0;
    }
}

@media (max-width: 767px) {
    .main-image-container {
        height: 300px;
    }

    .thumbnail-item {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .main-image-container {
        height: 250px;
    }

    .thumbnail-item {
        width: 40px;
        height: 40px;
    }
}

/* 表单响应式 */
@media (max-width: 767px) {
    .form-group {
        margin-bottom: 15px;
    }

    .form-label {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .form-input,
    .form-textarea {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 12px;
    }
    
    input[type="tel"],
    input[type="password"],
    textarea {
        font-size: 16px !important;
    }
}

/* 移动端优化：防止横向滚动 */
@media (max-width: 767px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    .container {
        width: 100%;
    }
}

/* 产品分类筛选响应式 */
@media (max-width: 575px) {
    .categories-filter {
        overflow-x: auto;
        white-space: nowrap;
    }

    .category-btn {
        display: inline-block;
        margin: 0 5px;
    }
}

/* 相关产品网格响应式 */
@media (max-width: 991px) {
    .related-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .related-products-grid {
        grid-template-columns: 1fr;
    }
}

/* 移动端底部菜单样式 */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
}

.mobile-nav-item {
    flex: 1;
    text-align: center;
}

.mobile-nav-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    padding: 8px 5px;
    transition: color 0.3s ease;
}

.mobile-nav-item a:hover,
.mobile-nav-item a:focus {
    color: #007bff;
}

.mobile-nav-item img {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    object-fit: contain;
}

.mobile-nav-item span {
    font-size: 12px;
    font-weight: 500;
}

/* 在移动设备上显示底部菜单 */
@media (max-width: 767px) {
    .mobile-bottom-nav {
        display: flex;
    }
    
    /* 为底部菜单留出空间 */
    body {
        padding-bottom: 60px;
    }
    
    .footer {
        margin-bottom: 60px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .mobile-nav-item span {
        font-size: 11px;
    }
    
    .mobile-nav-item img {
        width: 22px;
        height: 22px;
    }
    
    .mobile-nav-item a {
        padding: 6px 3px;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-bottom-nav {
        padding: 6px 0;
    }
    
    .mobile-nav-item img {
        width: 20px;
        height: 20px;
    }
    
    .mobile-nav-item span {
        font-size: 10px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .mobile-bottom-nav {
        background: #2d2d2d;
        border-top-color: #404040;
    }
    
    .mobile-nav-item a {
        color: #cccccc;
    }
    
    .mobile-nav-item a:hover,
    .mobile-nav-item a:focus {
        color: #4dabf7;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .mobile-bottom-nav {
        border-top: 2px solid #000;
        background: #fff;
    }
    
    .mobile-nav-item a {
        color: #000;
    }
    
    .mobile-nav-item a:hover,
    .mobile-nav-item a:focus {
        color: #0000ff;
        text-decoration: underline;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .mobile-nav-item a {
        min-height: 60px;
        min-width: 60px;
    }
    
    .mobile-nav-item img {
        margin-bottom: 6px;
    }
}