/* 响应式设计样式 */

/* 大屏幕设备 (1200px及以上) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* 中等屏幕设备 (768px - 1199px) */
@media (max-width: 1199px) and (min-width: 768px) {
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 平板设备 (768px及以下) */
@media (max-width: 768px) {
    /* 导航栏响应式 */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #1e3c72;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-dropdown .dropdown-content {
        position: static;
        display: none;
        background: #2a5298;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        margin-top: 0;
        border-radius: 8px;
        margin: 8px 16px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        overflow: hidden;
    }

    .nav-dropdown.active .dropdown-content {
        display: block;
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .dropdown-content a {
        color: #fff;
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-weight: 500;
    }

    .dropdown-content a:last-child {
        border-bottom: none;
    }

    .dropdown-content a:hover {
        background-color: #ffd700;
        color: #1e3c72;
    }

    /* 英雄区域响应式 */
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 100px 0 60px;
        min-height: auto;
    }

    .hero-content {
        max-width: 100%;
        margin-bottom: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image {
        flex: none;
    }

    /* 产品分类响应式 */
    .categories {
        padding: 60px 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* 产品网格响应式 */
    .featured-products {
        padding: 60px 0;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* 关于我们响应式 */
    .about-section {
        padding: 60px 0;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-text h2 {
        font-size: 2rem;
    }

    /* 联系信息响应式 */
    .contact-info {
        padding: 40px 0;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-item {
        padding: 1.5rem;
    }

    /* 页脚响应式 */
    .footer {
        padding: 40px 0 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* 产品详情页响应式 */
    .product-detail {
        padding: 100px 0 60px;
    }

    .product-detail-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .product-detail-info h1 {
        font-size: 2rem;
    }

    /* 管理后台响应式 */
    .admin-panel {
        padding: 100px 0 60px;
    }

    .admin-header h1 {
        font-size: 2rem;
    }

    .admin-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .admin-tab {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .admin-form {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .products-table {
        overflow-x: auto;
    }

    .products-table table {
        min-width: 600px;
    }
}

/* 手机设备 (480px及以下) */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    /* 导航栏 */
    .nav-container {
        padding: 0 15px;
    }

    .nav-logo a {
        font-size: 1.2rem;
    }

    .nav-logo i {
        font-size: 1.5rem;
    }

    /* 英雄区域 */
    .hero {
        padding: 80px 0 40px;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.3;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 250px;
        text-align: center;
    }

    /* 产品分类 */
    .categories {
        padding: 40px 0;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .category-card {
        padding: 1.5rem;
    }

    .category-icon {
        width: 60px;
        height: 60px;
    }

    .category-icon i {
        font-size: 1.5rem;
    }

    .category-card h3 {
        font-size: 1.3rem;
    }

    /* 产品网格 */
    .featured-products {
        padding: 40px 0;
    }

    .product-card {
        margin-bottom: 1rem;
    }

    .product-info {
        padding: 1rem;
    }

    .product-title {
        font-size: 1.2rem;
    }

    .product-price {
        font-size: 1.3rem;
    }

    /* 关于我们 */
    .about-section {
        padding: 40px 0;
    }

    .about-text h2 {
        font-size: 1.8rem;
    }

    .about-text p {
        font-size: 1rem;
    }

    .feature-item {
        gap: 0.75rem;
    }

    .feature-item i {
        font-size: 1.2rem;
    }

    /* 联系信息 */
    .contact-info {
        padding: 30px 0;
    }

    .contact-item {
        padding: 1rem;
    }

    .contact-item i {
        font-size: 2rem;
    }

    .contact-item h4 {
        font-size: 1.1rem;
    }

    /* 页脚 */
    .footer {
        padding: 30px 0 15px;
    }

    .footer-section h3,
    .footer-section h4 {
        font-size: 1.2rem;
    }

    .social-links {
        justify-content: center;
    }

    .social-links a {
        width: 35px;
        height: 35px;
    }

    /* 产品详情页 */
    .product-detail {
        padding: 80px 0 40px;
    }

    .product-detail-info h1 {
        font-size: 1.8rem;
    }

    .product-detail-price {
        font-size: 1.5rem;
    }

    .product-specifications {
        padding: 1.5rem;
    }

    /* 管理后台 */
    .admin-panel {
        padding: 80px 0 40px;
    }

    .admin-header {
        padding: 1.5rem 0;
    }

    .admin-header h1 {
        font-size: 1.8rem;
    }

    .admin-content {
        padding: 0 15px;
    }

    .admin-form {
        padding: 1rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px;
        font-size: 0.9rem;
    }

    .btn-submit {
        width: 100%;
        padding: 12px;
    }

    .products-table th,
    .products-table td {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .product-image-small {
        width: 50px;
        height: 50px;
    }

    .btn-edit,
    .btn-delete {
        padding: 4px 8px;
        font-size: 0.8rem;
        margin-right: 0.25rem;
    }
}

/* 超小屏幕设备 (320px及以下) */
@media (max-width: 320px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .category-card {
        padding: 1rem;
    }

    .product-info {
        padding: 0.75rem;
    }

    .admin-form {
        padding: 0.75rem;
    }

    .products-table th,
    .products-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 500px) {
    .hero {
        min-height: auto;
        padding: 80px 0 40px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }
}

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

/* 打印样式 */
@media print {
    .navbar,
    .nav-toggle,
    .hero-buttons,
    .admin-tabs,
    .btn-edit,
    .btn-delete,
    .social-links,
    .footer {
        display: none !important;
    }

    .hero,
    .product-detail {
        padding: 20px 0;
    }

    .hero-title,
    .section-title,
    .product-detail-info h1 {
        color: #000 !important;
    }

    .product-card,
    .category-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 减少动画效果（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-image img,
    .product-image img {
        transition: none;
    }

    .category-card:hover,
    .product-card:hover {
        transform: none;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000;
        color: #fff;
        border: 2px solid #000;
    }

    .btn-secondary {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }

    .nav-link:hover,
    .category-link:hover {
        color: #000;
        text-decoration: underline;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #fff;
    }

    .category-card,
    .product-card,
    .admin-form,
    .products-table {
        background: #2d2d2d;
        color: #fff;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        background: #2d2d2d;
        color: #fff;
        border-color: #555;
    }

    .products-table th {
        background: #1e3c72;
    }

    .products-table tr:hover {
        background: #3d3d3d;
    }
} 