/* ============================================================
   SkyFlex LED — Global Responsive Layer (loaded last)
   全站移动端适配：桌面 → 平板 (≤1024) → 手机 (≤768) → 小屏 (≤576)
   ============================================================ */

/* ---------- Desktop → Tablet (≤1024) ---------- */
@media (max-width: 1024px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .section {
        padding: 64px 0;
    }

    /* Footer: 5 cols → 2 cols (brand spans) */
    .footer-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid-5 .footer-col-brand {
        grid-column: 1 / -1;
    }

    /* Product detail: hero side-by-side stays, related grids 3 → 2 */
    .product-cases-grid,
    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Cases filters: allow wrap */
    .cases-filters {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Apps related grids 3 → 2 */
    .applications-cases-grid,
    .applications-products-grid,
    .applications-news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Home products 3 → 2 */
    .products-grid-3col {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- Tablet → Phone (≤768) ---------- */
@media (max-width: 768px) {
    /* 通用 */
    h1 {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.6rem;
    }
    .section {
        padding: 48px 0;
    }

    /* ===== Header / 导航抽屉（深色） ===== */
    .menu-toggle {
        display: flex;
    }
    .header-cta {
        display: none;
    }

    .site-header .header-inner {
        padding: 0 18px;
    }
    .site-logo .logo-image {
        max-height: 34px;
        width: auto;
    }

    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 78%;
        max-width: 340px;
        height: 100vh;
        height: 100dvh;
        background: #0d1220;
        padding: 90px 28px 40px;
        transition: right 0.35s ease;
        overflow-y: auto;
        z-index: 999;
        box-shadow: -12px 0 40px rgba(0, 0, 0, 0.55);
    }
    .main-navigation.active {
        right: 0;
    }
    .main-navigation #primary-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin: 0;
        padding: 0;
        list-style: none;
    }
    .main-navigation #primary-menu > li {
        width: 100%;
        margin: 0;
    }
    .main-navigation #primary-menu > li > a {
        display: block;
        padding: 13px 0;
        color: #ffffff;
        font-size: 1.05rem;
        font-weight: 600;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .main-navigation #primary-menu > li > a:hover {
        color: #3ea6ff;
    }

    /* 移动端隐藏 Mega Menu 面板（点击 Products 直接跳产品页） */
    .products-mega-menu {
        display: none !important;
    }

    /* ===== 首页 Hero ===== */
    .home .hero-slider,
    .page-template-front-page .hero-slider {
        min-height: 460px;
    }
    .home .hero-content,
    .page-template-front-page .hero-content {
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%);
        text-align: center;
        padding: 0 22px;
    }
    .home .hero-title,
    .page-template-front-page .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    .home .hero-desc,
    .page-template-front-page .hero-desc {
        font-size: 1rem;
        line-height: 1.7;
    }
    .home .hero-dots,
    .page-template-front-page .hero-dots {
        bottom: 14px;
    }
    .home .hero-arrow,
    .page-template-front-page .hero-arrow {
        width: 40px;
        height: 40px;
    }

    /* 首页场景手风琴：纵向铺开 */
    .home .scenario-gallery,
    .page-template-front-page .scenario-gallery {
        height: auto;
        flex-direction: column;
        gap: 12px;
    }
    .home .scenario-item,
    .page-template-front-page .scenario-item {
        flex-basis: auto !important;
        height: 180px;
        min-width: 0 !important;
    }
    .home .scenario-item .scenario-item-title,
    .page-template-front-page .scenario-item .scenario-item-title {
        font-size: 1rem;
    }

    /* 首页产品 / News 卡：单列 */
    .home .products-grid-3col,
    .page-template-front-page .products-grid-3col,
    .home .news-grid,
    .page-template-front-page .news-grid {
        grid-template-columns: 1fr;
    }

    /* 首页 CTA */
    .home .cta-section,
    .page-template-front-page .cta-section {
        padding: 56px 20px;
    }
    .home .cta-btn,
    .page-template-front-page .cta-btn {
        padding: 14px 34px;
        font-size: 0.95rem;
    }

    /* ===== 产品列表页 ===== */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .product-card-image {
        aspect-ratio: 16 / 9;
    }

    /* ===== 产品详情页 ===== */
    .product-hero .container > div {
        grid-template-columns: 1fr !important;
        align-items: stretch;
    }
    .product-hero {
        padding: 40px 0 56px;
    }
    .product-hero .fade-in + .fade-in {
        margin-top: 28px;
    }
    .product-main-img {
        aspect-ratio: 16 / 9;
    }
    .product-thumbs {
        margin-top: 12px;
        gap: 8px;
    }
    .product-thumbs-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .product-thumbs-list::-webkit-scrollbar {
        display: none;
    }
    .product-thumb {
        flex: 0 0 auto !important;
        width: 84px;
        height: 52px;
    }
    .product-title {
        font-size: 1.5rem;
    }
    .product-desc {
        font-size: 0.98rem;
    }

    .product-intro .container,
    .product-feature .container,
    .product-specs .container,
    .product-cases .container,
    .product-faq .container {
        padding-top: 0;
        padding-bottom: 0;
    }
    .product-intro,
    .product-feature,
    .product-specs,
    .product-cases,
    .product-faq {
        padding: 48px 0;
    }

    .product-feature-grid {
        grid-template-columns: 1fr !important;
        gap: 24px;
    }
    .product-feature-grid + .product-feature-grid {
        margin-top: 40px;
    }
    .product-feature-img-box {
        aspect-ratio: 4 / 3;
    }
    .product-feature-text p {
        font-size: 0.98rem;
    }

    .product-specs-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
    }
    .product-specs-table table {
        min-width: 560px;
        width: 100%;
    }

    .product-cases-grid,
    .related-products-grid {
        grid-template-columns: 1fr;
    }

    /* ===== Cases 列表 / 详情 ===== */
    .cases-hero {
        min-height: 56vh;
    }
    .cases-hero-title {
        font-size: 2.6rem;
    }
    .cases-filters {
        flex-wrap: wrap;
        gap: 10px;
    }
    .cases-grid {
        grid-template-columns: 1fr;
    }
    .case-detail-hero {
        grid-template-columns: 1fr;
        padding-top: 36px;
    }
    .case-detail-hero-left {
        padding: 0 0 28px;
    }
    .case-detail-title {
        font-size: 1.6rem;
    }
    .case-detail-intro,
    .case-detail-gallery {
        padding: 36px 0 20px;
    }
    .case-detail-cta {
        padding: 56px 20px 64px;
    }

    /* ===== Applications 列表 / 详情 ===== */
    .applications-hero {
        min-height: 56vh;
        padding: 120px 0 48px;
    }
    .applications-hero-title {
        font-size: 2.4rem;
    }
    .applications-cases-grid,
    .applications-products-grid,
    .applications-news-grid {
        grid-template-columns: 1fr;
    }
    .applications-overview-body {
        padding: 0;
    }

    /* ===== News / Blog ===== */
    .news-hero {
        min-height: 420px;
  }
    .news-hero-title {
        font-size: 2.4rem;
    }
    .news-detail-container {
        padding-top: 3rem !important;
        padding-left: 20px;
        padding-right: 20px;
    }
    .news-detail-title {
        font-size: 1.5rem;
    }
    .news-detail-body {
        width: 100%;
    }
    .news-timeline {
        padding-left: 0;
    }
    .news-timeline-item {
        flex-direction: column;
        gap: 10px;
    }
    .news-timeline-date {
        width: 100%;
        text-align: left;
    }
    .news-timeline-thumb {
        width: 100%;
    }

    /* ===== About ===== */
    .about-hero {
        min-height: 46vh;
    }
    .about-hero-title {
        font-size: 2.4rem;
    }
    .about-profile-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .about-services-grid {
        grid-template-columns: 1fr;
    }
    .about-cta {
        padding: 56px 20px;
    }

    /* ===== Contact ===== */
    .page-header {
        min-height: 300px;
        padding: 110px 0 40px;
    }
    .contact-form .form-group input,
    .contact-form .form-group textarea,
    .contact-form .form-group select {
        width: 100%;
    }

    /* ===== Footer ===== */
    .footer-grid-5 {
        grid-template-columns: 1fr;
        gap: 34px;
    }
    .footer-grid-5 .footer-col-brand {
        grid-column: auto;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}

/* ---------- Phone → Small (≤576) ---------- */
@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .home .hero-slider,
    .page-template-front-page .hero-slider {
        min-height: 420px;
    }
    .home .hero-title,
    .page-template-front-page .hero-title {
        font-size: 1.7rem;
    }

    .cases-hero {
        min-height: 60vh;
    }
    .cases-hero-title {
        font-size: 2.2rem;
    }

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

    .footer-grid-5 {
        gap: 28px;
    }
    .footer-col-brand .footer-social-icons {
        justify-content: flex-start;
    }
}

/* 触摸设备禁用 hover-only 交互（防止粘滞悬浮态） */
@media (hover: none) {
    .cases-card .cases-card-caption {
        transform: translateY(0);
        opacity: 1;
    }
    .product-card:hover {
        transform: none;
    }
}