/* ============================================
   璠德（FUNDÉ）官方网站 - 响应式样式
   ============================================ */

/* 超大屏幕 (1400px+) */
@media (min-width: 1400px) {
    :root {
        --container-max-width: 1400px;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 大屏幕 (1200px - 1399px) */
@media (max-width: 1399px) {
    :root {
        --container-max-width: 1140px;
    }
}

/* 中等屏幕 (992px - 1199px) */
@media (max-width: 1199px) {
    :root {
        --container-max-width: 960px;
        --font-size-4xl: 2.25rem;
    }

    /* 栅格调整 */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .about-content {
        gap: 2rem;
    }

    .contact-content {
        gap: 2rem;
    }
}

/* 平板 (768px - 991px) */
@media (max-width: 991px) {
    :root {
        --container-max-width: 720px;
        --header-height: 60px;
        --header-height-scrolled: 55px;
    }

    /* Hero区域调整 */
    .hero {
        height: 500px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.125rem;
    }

    /* 特性区域 */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    /* 产品布局 */
    .products-layout {
        grid-template-columns: 1fr;
    }

    .products-sidebar {
        position: static;
        margin-bottom: 2rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 关于我们 */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-image {
        order: -1;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    /* 新闻区域 */
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 联系我们 */
    .contact-content {
        grid-template-columns: 1fr;
    }

    /* 页脚 */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* 小平板 (576px - 767px) */
@media (max-width: 767px) {
    :root {
        --container-max-width: 540px;
        --header-height: 55px;
        --header-height-scrolled: 50px;
    }

    /* 移动端导航 */
    .header-top {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ffffff;
        padding: 1rem;
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        z-index: 999;
        overflow-y: auto;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-menu ul {
        flex-direction: column;
        width: 100%;
    }

    .nav-menu a {
        width: 100%;
        justify-content: space-between;
        padding: 1rem;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding-left: 2rem;
        background-color: var(--gray-50);
    }

    .dropdown-menu a {
        padding: 0.75rem 1rem;
    }

    /* Hero区域 */
    .hero {
        height: 450px;
        margin-top: var(--header-height);
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    /* 区域标题 */
    .section-header h2 {
        font-size: 1.75rem;
    }

    .section-header p {
        font-size: 1rem;
    }

    /* 特性区域 */
    .features {
        padding: 3rem 0;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* 产品区域 */
    .products {
        padding: 3rem 0;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-card {
        display: flex;
        flex-direction: column;
    }

    /* 关于我们 */
    .about {
        padding: 3rem 0;
    }

    .about-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* 新闻区域 */
    .news {
        padding: 3rem 0;
    }

    .news-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .news-tab {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    /* 联系我们 */
    .contact {
        padding: 3rem 0;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* 页脚 */
    .footer {
        padding: 3rem 0 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* 手机 (<576px) */
@media (max-width: 575px) {
    :root {
        --container-max-width: 100%;
        --container-padding: 0.75rem;
        --header-height: 50px;
        --header-height-scrolled: 45px;
    }

    /* 字体调整 */
    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.9375rem;
    }

    /* 按钮调整 */
    .btn {
        padding: 0.625rem 1.5rem;
        font-size: 0.875rem;
    }

    .btn-lg {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }

    /* Logo调整 */
    .logo-text .name {
        font-size: 1.25rem;
    }

    .logo-text .tagline {
        font-size: 0.6875rem;
    }

    /* Hero区域 */
    .hero {
        height: 400px;
    }

    .hero-buttons {
        gap: 0.75rem;
    }

    /* Section */
    .section {
        padding: 2.5rem 0;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .section-header p {
        font-size: 0.9375rem;
    }

    /* 特性卡片 */
    .feature-card {
        padding: 1.25rem;
    }

    .feature-icon {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .feature-card h3 {
        font-size: 1rem;
    }

    .feature-card p {
        font-size: 0.8125rem;
    }

    /* 产品卡片 */
    .product-card {
        border-radius: var(--border-radius-md);
    }

    .product-info {
        padding: 1rem;
    }

    .product-title {
        font-size: 1rem;
    }

    .product-desc {
        font-size: 0.8125rem;
    }

    /* 产品侧边栏 */
    .products-sidebar {
        padding: 1rem;
    }

    /* 新闻卡片 */
    .news-content {
        padding: 1rem;
    }

    .news-title {
        font-size: 1rem;
    }

    /* 联系表单 */
    .contact-form {
        padding: 1.25rem;
    }

    .form-input,
    .form-textarea {
        font-size: 0.9375rem;
    }

    /* 信息卡片 */
    .info-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }

    .info-icon {
        margin-bottom: 0.75rem;
    }

    /* 回到顶部按钮 */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

/* 横屏模式优化 */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        height: 350px;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .section {
        padding: 2rem 0;
    }
}

/* 打印样式 */
@media print {
    .header,
    .hero,
    .contact,
    .footer,
    .back-to-top {
        display: none;
    }

    .section {
        padding: 1rem 0;
        page-break-inside: avoid;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --primary-dark: #000080;
        --gray-600: #404040;
        --gray-800: #000000;
    }

    .btn-primary {
        border: 2px solid #0000ff;
    }

    .form-input:focus,
    .form-textarea:focus {
        border-width: 3px;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: #1a1a1a;
        --gray-100: #2d2d2d;
        --gray-200: #404040;
        --gray-300: #525252;
        --gray-400: #737373;
        --gray-500: #a3a3a3;
        --gray-600: #d4d4d4;
        --gray-700: #e5e5e5;
        --gray-800: #f5f5f5;
        --gray-900: #ffffff;
    }

    body {
        background-color: #0a0a0a;
    }

    .header {
        background-color: #1a1a1a;
        border-bottom-color: var(--gray-300);
    }

    .hero {
        background: linear-gradient(135deg, #000080 0%, #0000ff 50%, #4080ff 100%);
    }

    .feature-card,
    .products-sidebar,
    .product-card,
    .news-card,
    .footer {
        background-color: #1a1a1a;
        border-color: var(--gray-300);
    }

    .form-input,
    .form-textarea {
        background-color: var(--gray-100);
        color: var(--gray-800);
        border-color: var(--gray-300);
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    :root {
        --transition-fast: 100ms ease-in-out;
        --transition-base: 200ms ease-in-out;
    }

    .product-card:hover,
    .feature-card:hover,
    .news-card:hover {
        transform: none;
    }

    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-menu a,
    .category-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Retina屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .logo img,
    .product-image img,
    .news-image img {
        image-rendering: -webkit-optimize-contrast;
    }
}
