/**
 * 海芯威视官网 - 响应式样式
 * ========================
 * 移动端适配与响应式布局
 */

/* ========================
   Banner 响应式样式 - 使用最强选择器和 !important 覆盖
   ======================== */
@media screen and (max-width: 1024px) {
    html body .banner-carousel .banner-container .slide-content {
        width: 100% !important;
        padding: 0 30px !important;
    }
}

@media screen and (max-width: 900px) {
    html body .banner-carousel .banner-container .slide-content {
        flex-direction: column !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 30px 20px !important;
        gap: 20px !important;
    }

    html body .banner-carousel .banner-container .slide-text {
        max-width: 100% !important;
        margin-bottom: 0 !important;
    }

    html body .banner-carousel .banner-container .slide-text .product-name {
        font-size: 32px !important;
    }

    html body .banner-carousel .banner-container .slide-text .product-features {
        justify-content: center !important;
    }

    html body .banner-carousel .banner-container .slide-image img {
        max-height: 220px !important;
    }

    html body .banner-carousel .banner-container .nav-dots {
        bottom: 20px !important;
    }
}

@media screen and (max-width: 768px) {
    html body .banner-carousel {
        min-height: 500px !important;
        height: auto !important;
    }
    #main-content {
        overflow-x: hidden;
    }
    #main-menu {
        background: #ffff;
        box-shadow: 0 3px 5px #ccc;
    }
    
    .main-header {
        top:0;
        bottom: auto;
        position: fixed;
        width: 100vw;
        max-width: 100vw;
        left:0;
        right:0;
    }
    .main-header--hidden {
        display: none;
    }
    .main-header--scrolled .container {
        /* padding: 0; */
    }

    html body .banner-carousel .banner-container {
        height:420px !important;
    }

    html body .banner-carousel .banner-container .slide-text {
        margin-top:90px;
    }

    html body .banner-carousel .banner-carousel__container {
        height: auto !important;
        min-height: 500px !important;
    }


    html body .banner-carousel .banner-container .slide-content {
        width: 100% !important;
        padding: 40px 20px !important;
    }

    html body .banner-carousel .banner-container .slide-text .product-name {
        font-size: 26px !important;
        letter-spacing: 1px !important;
    }

    html body .banner-carousel .banner-container .slide-image img {
        max-height: 180px !important;
    }

    html body .banner-carousel .banner-carousel__control {
        width: 40px !important;
        height: 40px !important;
    }

    html body .banner-carousel .banner-container .nav-dots {
        bottom: 15px !important;
        gap: 10px !important;
    }

    html body .banner-carousel .banner-container .nav-dot {
        width: 10px !important;
        height: 10px !important;
    }
}

@media screen and (max-width: 480px) {
    html body .banner-carousel {
        min-height: 420px !important;
    }

    html body .banner-carousel .banner-carousel__container {
        min-height: 420px !important;
    }

    html body .banner-carousel .banner-container .slide-content {
        padding: 30px 15px !important;
    }

    html body .banner-carousel .banner-container .slide-text .product-name {
        font-size: 22px !important;
        margin-bottom: 15px !important;
    }

    html body .banner-carousel .banner-container .feature-tag {
        padding: 6px 16px !important;
        font-size: 12px !important;
    }

    html body .banner-carousel .banner-container .slide-image img {
        max-height: 150px !important;
    }

    html body .banner-carousel .banner-container .nav-dots {
        bottom: 12px !important;
        gap: 8px !important;
    }

    html body .banner-carousel .banner-container .nav-dot {
        width: 8px !important;
        height: 8px !important;
    }

    html body .banner-carousel .banner-carousel__control {
        width: 36px !important;
        height: 36px !important;
    }

    html body .banner-carousel .banner-carousel__control .icon {
        width: 18px !important;
        height: 18px !important;
    }
}

/* ========================
   平板设备 (768px - 1024px)
   ======================== */
@media (max-width: 1024px) {
    :root {
        --container-padding: 1.5rem;
    }

    /* 产品网格 */
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .products-grid--page {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 关于我们 */
    .about-section__grid {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }

    .about-section__visual {
        order: -1;
    }

    .about-section__experience {
        bottom: var(--space-4);
        left: var(--space-4);
    }

    .about-section__contact-card {
        display: none;
    }

    /* 新闻网格 */
    .news-grid {
        grid-template-columns: 1fr;
    }

    .news-card--featured {
        grid-template-columns: 1fr;
    }

    /* 新闻特色区域 */
    .news-featured {
        grid-template-columns: 1fr;
    }

    .news-featured__content {
        padding: var(--space-6);
    }

    .news-grid--page {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 快速导航 */
    .quick-nav__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 页脚 */
    .footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 产品页面布局 */
    .products-page__layout {
        grid-template-columns: 1fr;
    }

    .products-sidebar {
        display: none;
    }

    /* 产品详情 */
    .product-detail__layout {
        grid-template-columns: 1fr;
    }

    /* 联系页面 */
    .contact-layout {
        grid-template-columns: 1fr;
    }

    .contact-map-wrapper {
        order: -1;
    }

    .map-container--large {
        height: 300px;
    }
}

/* ========================
   手机设备 (< 768px)
   ======================== */
@media (max-width: 768px) {
    :root {
        --container-padding: 1rem;
        
        /* 调整字号 */
        --text-5xl: 2rem;
        --text-4xl: 1.75rem;
        --text-3xl: 1.5rem;
        --text-2xl: 1.25rem;
    }
    .top-bar {display: none;}
    .logo {
        flex:1;
    }

    /* 顶部信息栏 */
    .top-bar__content {
        flex-direction: column;
        gap: var(--space-2);
        text-align: center;
    }

    .top-bar__contact {
        flex-direction: column;
        gap: var(--space-2);
    }

    /* 主导航 */
    .main-nav {
        height: 64px;
    }

    .nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: auto;
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-4);
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        overflow-y: auto;
    }

    .nav-menu--open {
        transform: translateX(0);
    }

    .nav-menu__item {
        width: 100%;
    }

    .nav-menu__link {
        padding: var(--space-4);
        font-size: var(--text-base);
    }

    /* 子菜单 */
    .nav-submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: transparent;
        backdrop-filter: none;
        border: none;
        padding-left: var(--space-4);
        display: none;
    }

    .nav-menu__item--has-submenu--open .nav-submenu {
        display: block;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .header-actions .btn {
        display: none;
    }

    /* Hero区域 */
    .hero {
        min-height: auto;
        padding: var(--space-10) 0;
    }

    .hero__title {
        font-size: var(--text-4xl);
    }

    .hero__actions {
        flex-direction: column;
    }

    .hero__stats {
        flex-direction: column;
        gap: var(--space-6);
    }

    .hero__scroll-indicator {
        display: none;
    }

    /* 快速导航 */
    .quick-nav {
        padding: var(--space-10) 0;
    }

    .quick-nav__grid {
        grid-template-columns: 1fr;
    }

    .quick-nav__card {
        padding: var(--space-4);
    }

    /* 产品网格 */
    .products-section {
        padding: var(--space-10) 0;
    }

    .products-grid,
    .products-grid--page,
    .products-grid--related {
        grid-template-columns: 1fr;
    }

    /* 分类标签 */
    .category-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .category-tabs::-webkit-scrollbar {
        display: none;
    }

    .category-tab {
        white-space: nowrap;
    }

    /* 关于我们 */
    .about-section {
        padding: var(--space-10) 0;
    }

    .about-section__features {
        grid-template-columns: 1fr;
    }

    .about-section__experience {
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: var(--space-4);
    }

    /* 新闻区块 */
    .news-section {
        padding: var(--space-10) 0;
    }

    .news-card__content {
        padding: var(--space-4);
    }

    .news-item {
        padding: var(--space-4);
    }

    /* CTA区块 */
    .cta-section {
        padding: var(--space-16) 0;
    }

    .cta-section__title {
        font-size: var(--text-3xl);
    }

    .cta-section__actions {
        flex-direction: column;
    }

    /* 页脚 */
    .footer__top {
        padding: var(--space-10) 0;
    }

    .footer__grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer__bottom-content {
        flex-direction: column;
        gap: var(--space-2);
        text-align: center;
    }

    /* 页面标题 */
    .page-header {
        padding: var(--space-10) 0;
    }

    .page-header__title {
        font-size: var(--text-3xl);
    }

    /* 产品工具栏 */
    .products-toolbar {
        flex-direction: column;
        gap: var(--space-4);
    }

    .products-filter,
    .products-sort {
        width: 100%;
    }

    .products-filter__select,
    .products-sort__select {
        width: 100%;
    }

    /* 产品详情 */
    .product-info__actions {
        flex-direction: column;
    }

    .product-tabs__nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .product-tabs__btn {
        white-space: nowrap;
    }

    .specs-table {
        font-size: var(--text-sm);
    }

    .specs-table th,
    .specs-table td {
        padding: var(--space-3);
    }

    /* 支持页面 */
    .support-quick-links {
        grid-template-columns: 1fr;
    }

    .document-card {
        flex-direction: column;
    }

    .document-card__icon {
        width: 48px;
        height: 48px;
    }

    /* 新闻页面 */
    .news-filter {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .news-filter__btn {
        white-space: nowrap;
    }

    .news-featured {
        grid-template-columns: 1fr;
    }

    /* 企业文化 */
    .culture-values {
        grid-template-columns: repeat(2, 1fr);
    }

    .activity-list {
        grid-template-columns: 1fr;
    }

    /* 新闻页面 */
    .news-grid--page {
        grid-template-columns: 1fr;
    }

    .news-filter {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: var(--space-2);
    }

    .news-filter::-webkit-scrollbar {
        display: none;
    }

    .news-filter__btn {
        white-space: nowrap;
    }

    /* 关于我们页面 */
    .about-intro__stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .advantages-grid {
        grid-template-columns: 1fr;
    }

    .timeline__item {
        padding-left: var(--space-6);
    }

    .timeline__year {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        margin-bottom: var(--space-2);
    }

    /* 联系页面 */
    .contact-cards {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* 分页 */
    .pagination {
        flex-direction: column;
        gap: var(--space-4);
        align-items: center;
    }
}

/* ========================
   小屏手机 (< 480px)
   ======================== */
@media (max-width: 480px) {
    :root {
        --container-padding: 0.75rem;
    }

    .hero__title {
        font-size: var(--text-3xl);
    }

    .hero__description {
        font-size: var(--text-base);
    }

    .section-header__title {
        font-size: var(--text-2xl);
    }

    .product-card__title {
        font-size: var(--text-base);
    }

    .news-card__title {
        font-size: var(--text-lg);
    }

    .page-header__title {
        font-size: var(--text-2xl);
    }

    .cta-section__title {
        font-size: var(--text-2xl);
    }

    .about-intro__stats {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .culture-values {
        grid-template-columns: 1fr;
    }
}

/* ========================
   大屏设备 (> 1440px)
   ======================== */
@media (min-width: 1440px) {
    :root {
        --container-max: 1400px;
    }
}

/* ========================
   触摸设备优化
   ======================== */
@media (pointer: coarse) {
    .product-card:hover,
    .quick-nav__card:hover,
    .news-card:hover,
    .activity-card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    .nav-menu__link:hover {
        background: transparent;
    }
}

/* ========================
   打印样式
   ======================== */
@media print {
    .top-bar,
    .main-header,
    .hero__scroll-indicator,
    .cta-section,
    .main-footer {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: 2rem 0;
    }

    .products-section,
    .about-section,
    .news-section {
        padding: 2rem 0;
    }

    .product-card,
    .news-card {
        break-inside: avoid;
    }
}

/* ========================
   深色模式支持
   ======================== */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg-primary: #0f172a;
        --color-bg-secondary: #1e293b;
        --color-bg-tertiary: #334155;
        
        --color-text-primary: #f1f5f9;
        --color-text-secondary: #94a3b8;
        --color-text-tertiary: #64748b;
        
        --color-border: #334155;
        --color-border-light: #1e293b;
        
        --glass-bg: rgba(15, 23, 42, 0.8);
        --glass-border: rgba(255, 255, 255, 0.1);
    }

    .product-card,
    .news-card,
    .news-item,
    .quick-nav__card {
        background: #1e293b;
    }

    .spec-tag {
        background: #334155;
    }
}

/* ========================
   减少动画偏好
   ======================== */
@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;
    }

    .scroll-line {
        animation: none;
    }
}


/* ========================
   联系页面响应式
   ======================== */
@media (max-width: 1024px) {
    .contact-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-layout {
        grid-template-columns: 1fr;
    }

    .contact-map-wrapper {
        order: -1;
    }

    .map-container--large {
        height: 300px;
    }
}

/* ========================
   关于我们页面响应式
   ======================== */
@media (max-width: 1024px) {
    .about-intro__grid {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }

    .about-intro__image {
        order: -1;
    }

    .about-intro__stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .timeline::before {
        left: 60px;
    }

    .timeline__item {
        padding-left: 100px;
    }

    .timeline__year {
        width: 50px;
        font-size: var(--text-lg);
    }
}

/* ========================
   企业文化页面响应式
   ======================== */
@media (max-width: 1024px) {
    .culture-values {
        grid-template-columns: repeat(2, 1fr);
    }

    .activity-list {
        grid-template-columns: 1fr;
    }
}

/* ========================
   新闻页面响应式
   ======================== */
@media (max-width: 1024px) {
    .news-featured {
        grid-template-columns: 1fr;
    }

    .news-featured__main .news-card__image {
        aspect-ratio: 16/9;
    }

    .news-list-page {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .news-list-page {
        grid-template-columns: 1fr;
    }

    .news-filter {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: var(--space-2);
    }

    .news-filter::-webkit-scrollbar {
        display: none;
    }

    .news-filter__btn {
        white-space: nowrap;
    }

    .products-page__layout {
        grid-template-columns: 1fr;
    }
}

/* ========================
   深色模式支持扩展
   ======================== */
@media (prefers-color-scheme: dark) {
    .contact-card,
    .contact-form-wrapper,
    .contact-map-wrapper,
    .timeline__content,
    .advantage-card,
    .culture-value,
    .activity-card {
        background: #1e293b;
    }

    .about-stat {
        background: #1e293b;
    }

    .form-input,
    .form-select,
    .form-textarea {
        background: #334155;
        border-color: #475569;
        color: #f1f5f9;
    }

    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        border-color: var(--color-primary);
    }
}


/* ========================
   关于我们页面 - 联系我们区域响应式
   ======================== */
@media (max-width: 1024px) {
    .about-contact__grid {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }

    .about-contact__info {
        max-width: 100%;
    }

    .about-contact__map {
        order: -1;
    }

    .about-contact__map .map-container {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .about-contact {
        padding: var(--space-16) 0;
    }

    .about-contact__title {
        font-size: var(--text-2xl);
    }

    .contact-detail__icon {
        width: 40px;
        height: 40px;
    }

    .contact-detail__icon svg {
        width: 20px;
        height: 20px;
    }
}
