/* ========================================
   Responsive Styles
   ======================================== */

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
    :root {
        --font-size-6xl: 48px;
        --font-size-5xl: 40px;
        --font-size-4xl: 32px;
        --font-size-3xl: 28px;
    }

    .container {
        padding: 0 var(--spacing-xl);
    }

    /* Header */
    .nav-list {
        gap: var(--spacing-lg);
    }

    /* Hero */
    .hero-stats {
        gap: var(--spacing-2xl);
    }

    /* Features */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Products */
    .products-grid {
        grid-template-columns: 1fr;
    }

    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-brand {
        grid-column: 1 / -1;
        max-width: 100%;
        margin-bottom: var(--spacing-xl);
    }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    :root {
        --font-size-6xl: 36px;
        --font-size-5xl: 32px;
        --font-size-4xl: 28px;
        --font-size-3xl: 24px;
        --font-size-2xl: 20px;
        --spacing-4xl: 64px;
        --spacing-3xl: 48px;
    }

    .container {
        padding: 0 var(--spacing-md);
    }

    .section {
        padding: var(--spacing-3xl) 0;
    }

    /* Header */
    .main-nav {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-dark);
        padding: var(--spacing-xl);
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav.active {
        display: flex;
    }

    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-lg);
        width: 100%;
    }

    .nav-list li {
        width: 100%;
    }

    .nav-list li a {
        display: block;
        padding: var(--spacing-md) 0;
        font-size: var(--font-size-lg);
        border-bottom: 1px solid var(--border-color);
    }

    .header-actions {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Hero */
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + var(--spacing-2xl)) 0 var(--spacing-2xl);
    }

    .hero-content {
        padding: var(--spacing-xl) var(--spacing-md);
    }

    .hero-title {
        font-size: var(--font-size-4xl);
    }

    .hero-description {
        font-size: var(--font-size-base);
    }

    .hero-actions {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-stats {
        flex-direction: column;
        gap: var(--spacing-xl);
    }

    .stat-value {
        font-size: var(--font-size-3xl);
    }

    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: var(--spacing-xl);
    }

    /* Products */
    .product-image {
        height: 160px;
    }

    .product-content {
        padding: var(--spacing-lg);
    }

    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    /* Partners */
    .partners-grid {
        gap: var(--spacing-xl);
    }

    .partner-logo {
        height: 30px;
    }

    /* CTA */
    .cta-actions {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .cta-actions .btn {
        width: 100%;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-lg);
        text-align: center;
    }

    .footer-bottom-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-lg);
    }

    /* Grid utilities */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Small Mobile (< 480px) */
@media (max-width: 479px) {
    :root {
        --font-size-6xl: 28px;
        --font-size-5xl: 26px;
        --font-size-4xl: 24px;
    }

    .hero-badge {
        font-size: var(--font-size-xs);
        padding: var(--spacing-xs) var(--spacing-md);
    }

    .btn-lg {
        padding: var(--spacing-md) var(--spacing-xl);
        font-size: var(--font-size-base);
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-section {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

/* ========================================
   Home Page Responsive Styles
   ======================================== */

/* Tablet */
@media (max-width: 1023px) {

    /* Solutions Grid */
    .solutions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Intelligence Layout */
    .intelligence-layout {
        grid-template-columns: 1fr;
        gap: var(--spacing-3xl);
    }

    .intelligence-features {
        position: static;
    }

    /* Companies Grid */
    .companies-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* News Section */
    .news-layout {
        grid-template-columns: 300px 1fr;
        gap: var(--spacing-2xl);
    }

    .news-scroll-wrapper {
        height: auto;
    }

    /* Footer Main Layout */
    .footer-main {
        grid-template-columns: 320px 1fr;
        gap: var(--spacing-2xl);
    }

    /* Footer Links Grid */
    .footer-links-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-lg);
    }

    .footer-links-grid .footer-section:nth-child(4),
    .footer-links-grid .footer-section:nth-child(5) {
        grid-column: span 1;
    }
}

/* Mobile */
@media (max-width: 767px) {

    /* Hero Banner */
    .hero-banner {
        min-height: 500px;
    }

    .hero-title {
        font-size: clamp(24px, 6vw, 32px);
        margin-bottom: var(--spacing-xl);
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }

    /* Solutions Grid */
    .solutions-grid {
        grid-template-columns: 1fr;
    }

    /* Intelligence Section */
    .intelligence-title {
        font-size: var(--font-size-2xl);
    }

    .feature-list {
        gap: var(--spacing-sm);
    }

    .feature-item {
        padding: var(--spacing-md);
    }

    .feature-item .feature-icon {
        width: 40px;
        height: 40px;
    }

    .feature-item .feature-icon svg {
        width: 20px;
        height: 20px;
    }

    .detail-card {
        padding: var(--spacing-xl);
    }

    .intelligence-image {
        height: 200px;
    }

    /* Companies Grid */
    .companies-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-md);
    }

    .company-logo {
        height: 60px;
        padding: var(--spacing-sm);
    }

    /* News Section */
    .news-layout {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .news-header {
        position: static;
        text-align: center;
    }

    .news-header .section-title {
        font-size: var(--font-size-xl);
    }

    .news-header .section-title br {
        display: none;
    }

    .news-scroll-wrapper {
        height: auto;
    }

    .news-scroll-row:nth-child(2) {
        /* display: none; */
        /* Keep both rows if possible, or hide one if too tall */
        margin-top: var(--spacing-md);
    }

    .news-card {
        padding: var(--spacing-lg);
    }

    .news-card .quote-icon {
        font-size: 28px;
    }

    /* Footer Main Layout - 移动端垂直布局 */
    .footer-main {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }

    /* Footer Form */
    .footer-form-section {
        padding: var(--spacing-xl) var(--spacing-lg);
        max-width: 100%;
    }

    .footer-form-title {
        font-size: var(--font-size-lg);
    }

    /* Footer Links Grid */
    .footer-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
    }

    /* 最后一列（Products + Chat with Us）居中 */
    .footer-links-grid .footer-section:last-child {
        grid-column: 1 / -1;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-links-grid .footer-section:last-child ul {
        align-items: center;
    }

    .qr-code {
        margin: var(--spacing-md) auto;
    }

    .social-links {
        justify-content: center;
    }
}

/* Small Mobile */
@media (max-width: 479px) {
    .hero-banner {
        min-height: 400px;
    }

    .companies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }

    .company-logo {
        height: 50px;
    }

    .news-scroll-wrapper {
        height: auto;
    }

    /* Footer 单列布局 */
    .footer-links-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-links-grid .footer-section {
        align-items: center;
    }

    .footer-links-grid .footer-section ul {
        align-items: center;
    }

    .footer-form-title {
        font-size: var(--font-size-base);
        text-align: center;
    }
}