/* 响应式设计 - 贵州奕丰稼农业官网 */

/* 超小屏幕 (手机竖屏) - 小于576px */
@media (max-width: 575.98px) {
    /* 基础调整 */
    body {
        font-size: 0.9375rem; /* 15px */
        padding-top: 60px;
    }
    
    /* 导航栏 */
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .brand-text {
        font-size: 0.9rem;
    }
    
    .navbar-collapse {
        background-color: #1B5E20;
        padding: 1rem;
        border-radius: 8px;
        margin-top: 0.5rem;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    }
    
    .nav-link {
        padding: 0.75rem 1rem !important;
        margin: 0.25rem 0;
    }
    
    /* 英雄区域 */
    .hero-section {
        height: 80vh;
        min-height: 500px;
        margin-top: -60px;
    }
    
    .hero-content {
        padding: 1.5rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
    
    /* 内容区域 */
    .section {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 1.5rem;
        padding-bottom: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .section-title::after {
        width: 60px;
        height: 3px;
    }
    
    .section-text {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* 服务卡片 */
    .service-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .service-title {
        font-size: 1.125rem;
    }
    
    /* 统计数字 */
    .stat-item {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.875rem;
    }
    
    /* 产品卡片 */
    .product-card .card-img-top {
        height: 180px;
    }
    
    .product-card .card-body {
        padding: 1.25rem;
    }
    
    .product-price {
        font-size: 1.125rem;
    }
    
    /* 新闻卡片 */
    .news-card .card-img-top {
        height: 180px;
    }
    
    .news-card .card-body {
        padding: 1.25rem;
    }
    
    .news-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* 合作伙伴 */
    .partner-logo {
        height: 80px;
        padding: 0.75rem;
    }
    
    .partner-logo .logo-placeholder {
        font-size: 0.875rem;
    }
    
    /* 页脚 */
    .footer {
        padding: 2rem 0 1.5rem;
    }
    
    .footer-title {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }
    
    .footer-text {
        font-size: 0.875rem;
    }
    
    .footer-contact li {
        font-size: 0.875rem;
    }
    
    .footer-bottom {
        padding-top: 1rem;
        margin-top: 1.5rem;
    }
    
    .footer-bottom-links {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 1rem;
        margin-top: 0.75rem;
    }
    
    .footer-bottom-links li {
        margin-bottom: 0.5rem;
    }
    
    /* 返回顶部按钮 */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* 按钮调整 */
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    /* 表单调整 */
    .form-control {
        font-size: 0.9375rem;
        padding: 0.625rem 0.75rem;
    }
}

/* 小屏幕 (手机横屏/小平板) - 576px 到 767.98px */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* 基础调整 */
    body {
        padding-top: 70px;
    }
    
    /* 英雄区域 */
    .hero-section {
        height: 85vh;
        min-height: 550px;
        margin-top: -70px;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    /* 内容区域 */
    .section-title {
        font-size: 1.75rem;
    }
    
    /* 服务卡片 */
    .service-card {
        padding: 1.75rem;
    }
    
    /* 统计数字 */
    .stat-number {
        font-size: 2.5rem;
    }
    
    /* 产品卡片 */
    .product-card .card-img-top {
        height: 200px;
    }
    
    /* 合作伙伴 */
    .partner-logo {
        height: 90px;
    }
    
    /* 页脚 */
    .footer-bottom-links {
        justify-content: center;
    }
}

/* 中等屏幕 (平板) - 768px 到 991.98px */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* 基础调整 */
    body {
        padding-top: 76px;
    }
    
    /* 英雄区域 */
    .hero-section {
        margin-top: -76px;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    /* 导航栏 */
    .navbar-collapse {
        margin-top: 0;
    }
    
    /* 服务卡片 */
    .service-card {
        padding: 1.5rem;
    }
    
    .service-icon {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
    }
    
    /* 产品卡片 */
    .product-card .card-img-top {
        height: 220px;
    }
    
    /* 页脚列调整 */
    .footer .col-md-6 {
        margin-bottom: 1.5rem;
    }
}

/* 大屏幕 (桌面) - 992px 到 1199.98px */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* 英雄区域 */
    .hero-title {
        font-size: 3rem;
    }
    
    /* 容器最大宽度调整 */
    .container {
        max-width: 960px;
    }
    
    /* 服务卡片 */
    .service-card {
        padding: 1.75rem;
    }
}

/* 超大屏幕 (宽屏桌面) - 1200px 以上 */
@media (min-width: 1200px) {
    /* 容器最大宽度调整 */
    .container {
        max-width: 1140px;
    }
    
    /* 英雄区域 */
    .hero-title {
        font-size: 3.5rem;
    }
    
    /* 内容区域优化 */
    .section-text {
        max-width: 900px;
    }
}

/* 超宽屏幕 - 1400px 以上 */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    /* 英雄区域 */
    .hero-title {
        font-size: 4rem;
    }
    
    .hero-subtitle {
        font-size: 1.75rem;
    }
}

/* 打印样式 */
@media print {
    /* 隐藏不需要打印的元素 */
    .navbar,
    .hero-section,
    .hero-buttons,
    .footer,
    .back-to-top,
    .social-links,
    .btn {
        display: none !important;
    }
    
    /* 调整布局 */
    body {
        padding-top: 0;
        font-size: 12pt;
        color: #000000;
        background: #FFFFFF;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    /* 链接样式 */
    a {
        color: #000000;
        text-decoration: underline;
    }
    
    /* 图片调整 */
    img {
        max-width: 50% !important;
        height: auto;
    }
    
    /* 卡片调整 */
    .card {
        border: 1px solid #CCCCCC;
        box-shadow: none;
        break-inside: avoid;
    }
    
    /* 避免内容被分割 */
    .section {
        page-break-inside: avoid;
        padding: 1rem 0;
    }
    
    /* 页眉页脚 */
    @page {
        margin: 2cm;
    }
    
    @page :first {
        margin-top: 3cm;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --primary-green: #006400;
        --primary-green-dark: #004d00;
        --text-primary: #000000;
        --text-secondary: #333333;
    }
    
    .navbar {
        background-color: #004d00;
    }
    
    .btn-primary {
        background-color: #006400;
        border-color: #006400;
    }
    
    .btn-primary:hover {
        background-color: #004d00;
        border-color: #004d00;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero-content {
        animation: none;
    }
    
    .service-card:hover,
    .product-card:hover,
    .news-card:hover,
    .partner-logo:hover {
        transform: none;
    }
    
    .back-to-top:hover {
        transform: none;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #121212;
        --bg-section: #1e1e1e;
        --bg-card: #1e1e1e;
        --text-primary: #e0e0e0;
        --text-secondary: #b0b0b0;
        --border-color: #333333;
        --gray-100: #1e1e1e;
        --gray-200: #2d2d2d;
    }
    
    body {
        background-color: var(--bg-body);
        color: var(--text-primary);
    }
    
    .bg-light {
        background-color: var(--bg-section) !important;
    }
    
    .card {
        background-color: var(--bg-card);
        color: var(--text-primary);
    }
    
    .service-card,
    .product-card,
    .news-card {
        background-color: var(--bg-card);
        color: var(--text-primary);
    }
    
    .service-title,
    .product-card .card-title,
    .news-card .card-title {
        color: var(--primary-green-light);
    }
    
    .service-description,
    .product-card .card-text,
    .news-card .card-text {
        color: var(--text-secondary);
    }
    
    .partner-logo {
        background-color: var(--bg-card);
    }
    
    .partner-logo .logo-placeholder {
        color: var(--primary-green-light);
    }
    
    .form-control {
        background-color: var(--bg-card);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .form-control:focus {
        background-color: var(--bg-card);
        color: var(--text-primary);
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 增大触摸目标 */
    .nav-link {
        padding: 0.75rem 1rem !important;
        min-height: 44px;
    }
    
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }
    
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 移除悬停效果 */
    .service-card:hover,
    .product-card:hover,
    .news-card:hover,
    .partner-logo:hover {
        transform: none;
    }
    
    /* 添加活动状态 */
    .nav-link:active,
    .btn:active {
        opacity: 0.7;
    }
    
    /* 优化滚动 */
    .container {
        -webkit-overflow-scrolling: touch;
    }
}

/* 纵向屏幕优化 */
@media (orientation: portrait) {
    .hero-section {
        height: 90vh;
    }
    
    .hero-content {
        padding: 2rem;
    }
}

/* 横向屏幕优化 */
@media (orientation: landscape) and (max-height: 600px) {
    .hero-section {
        height: 120vh;
        min-height: 500px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .hero-buttons {
        margin-top: 1rem;
    }
}

/* 小高度屏幕优化 */
@media (max-height: 500px) {
    .hero-section {
        height: 150vh;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
}

/* 视网膜屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* 使用更高分辨率的图片 */
    .hero-section {
        background-image: url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?ixlib=rb-4.0.3&auto=format&fit=crop&w=3840&q=80');
    }
    
    /* 更细的边框 */
    .border {
        border-width: 0.5px;
    }
}

/* 性能优化：低端设备 */
@media (max-width: 767.98px) and (prefers-reduced-data: reduce) {
    /* 移除背景图片 */
    .hero-section {
        background-image: none !important;
        background-color: #2E7D32;
    }
    
    /* 移除不必要的动画 */
    * {
        animation: none !important;
        transition: none !important;
    }
    
    /* 简化阴影 */
    .card,
    .service-card,
    .product-card,
    .news-card {
        box-shadow: none !important;
        border: 1px solid #E0E0E0;
    }
    
    /* 简化渐变 */
    .service-icon,
    .stats-section {
        background: #2E7D32 !important;
    }
}