/* ============================================================================
   响应式设计系统 - 全站移动端适配基础
   ============================================================================ */

/* 断点系统（与TailwindCSS保持一致）
   sm: 640px   (小型设备 - 手机)
   md: 768px   (中型设备 - 平板)
   lg: 1024px  (大型设备 - 笔记本)
   xl: 1280px  (超大设备 - 台式机)
   2xl: 1536px (超超大设备)
*/

/* ============================================================================
   通用响应式工具类
   ============================================================================ */

/* 容器限制 - 替换固定宽度 */
.responsive-container {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* 移动端优化 */
@media (max-width: 639px) {
    .responsive-container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ============================================================================
   修复固定宽度元素
   ============================================================================ */

/* Banner区域 */
.ui-banner,
.page-banner,
.download-container,
.ui-container-bg,
.service-banner {
    min-width: auto !important;
    width: 100%;
    margin-top: 70px; /* 补偿Header高度 */
}

@media (min-width: 1060px) {
    .ui-banner,
    .page-banner,
    .download-container,
    .ui-container-bg,
    .service-banner {
        margin-top: 80px;
    }
}

/* 内容容器 */
.about-container,
.page-door .part-2 .con,
.login-container,
.service-box {
    max-width: 1134px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* ============================================================================
   Header & Navigation 响应式优化
   ============================================================================ */

/* 移动端Header */
@media (max-width: 1060px) {
    .header-nav {
        height: 60px;
    }

    .header-logo-text.jxq-logo a {
        height: 32px;
        width: 112px;
    }

    .header-menu {
        display: none !important;
    }

    .header-hamburger {
        display: block !important;
    }

    .header-side {
        display: none;
    }

    /* Mega Menu在移动端隐藏 */
    .products-case-wide,
    .solution-case-wide {
        display: none !important;
    }
}

/* 超小屏Header */
@media (max-width: 639px) {
    .header-nav {
        height: 56px;
    }

    .header-logo-text.jxq-logo a {
        height: 28px;
        width: 98px;
    }
}

/* ============================================================================
   Footer 响应式优化
   ============================================================================ */

/* Footer网格响应式 */
.footer-links {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 32px !important;
    padding: 48px 24px !important;
}

@media (max-width: 767px) {
    .footer-links {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        padding: 40px 16px !important;
    }

    .footer__big-phone {
        font-size: 20px;
    }

    .footer__qrscan {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .footer__qrscan-img {
        width: 120px;
        height: 120px;
    }
}

/* Footer版权区响应式 */
@media (max-width: 767px) {
    .footer-copyright .footer__msg {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        text-align: left !important;
    }
}

/* ============================================================================
   文本响应式字体大小
   ============================================================================ */

/* 使用clamp()实现流畅字体缩放 */
.text-responsive-sm {
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.text-responsive-base {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
}

.text-responsive-lg {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
}

.text-responsive-xl {
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.text-responsive-2xl {
    font-size: clamp(2rem, 5vw, 3rem);
}

.text-responsive-3xl {
    font-size: clamp(2.5rem, 6vw, 4rem);
}

.text-responsive-4xl {
    font-size: clamp(3rem, 8vw, 6rem);
}

/* ============================================================================
   响应式网格系统
   ============================================================================ */

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

@media (max-width: 639px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* 案例网格 */
.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

@media (max-width: 767px) {
    .case-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* 新闻网格 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

@media (max-width: 767px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ============================================================================
   移动端按钮和交互元素优化
   ============================================================================ */

/* 触摸友好尺寸 */
@media (max-width: 767px) {
    .touch-friendly {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 20px;
    }

    /* 底部Banner优化 */
    .bottom-banner {
        height: 56px;
        padding: 0 12px;
    }

    .bottom-banner a {
        font-size: 12px;
    }

    .bottom-banner img {
        width: 20px;
        height: 20px;
    }
}

/* ============================================================================
   移动端底部Banner响应式优化
   ============================================================================ */

.bottom-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #e5e7eb;
    z-index: 999;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 48px;
}

.bottom-banner a.footer-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #64748B;
    text-decoration: none;
    transition: color 0.2s;
}

.bottom-banner a.footer-btn:hover,
.bottom-banner a.footer-btn:active {
    color: var(--pro-primary);
}

.bottom-banner img {
    width: 24px;
    height: 24px;
}

.bottom-banner span {
    font-size: 13px;
    font-weight: 500;
}

/* 移动端隐藏底部Banner（桌面端） */
@media (min-width: 1061px) {
    .bottom-banner {
        display: none;
    }
}

@media (max-width: 1060px) {
    .mino-wrapper {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }

    .bottom-banner {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

@media (max-height: 500px) and (orientation: landscape) and (max-width: 1060px) {
    .mino-wrapper {
        padding-bottom: calc(44px + env(safe-area-inset-bottom, 0px));
    }
}

/* ============================================================================
   右侧悬浮窗响应式优化
   ============================================================================ */

/* 移动端隐藏右侧悬浮窗 */
@media (max-width: 1060px) {
    .right-float-window {
        display: none !important;
    }

    .online-service-btn,
    .home-btn,
    .pay-service-btn,
    .phone-card,
    .wechat-code {
        display: none !important;
    }
}

/* ============================================================================
   图片响应式优化
   ============================================================================ */

.responsive-img {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: cover;
}

.object-cover {
    object-fit: cover;
}

.object-contain {
    object-fit: contain;
}

/* ============================================================================
   分隔和间距响应式
   ============================================================================ */

/* 移动端减少垂直间距 */
@media (max-width: 767px) {
    .section-mobile-sm {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .section-mobile-md {
        padding-top: 56px;
        padding-bottom: 56px;
    }

    .section-mobile-lg {
        padding-top: 72px;
        padding-bottom: 72px;
    }
}

/* ============================================================================
   表单响应式优化
   ============================================================================ */

@media (max-width: 767px) {
    .responsive-form .ui-form-item {
        margin-bottom: 16px;
    }

    .responsive-form .ui-input {
        font-size: 16px; /* 防止iOS自动缩放 */
        padding: 12px 16px;
    }

    .responsive-form .ui-button {
        width: 100%;
        padding: 14px 24px;
    }
}

/* ============================================================================
   骨架屏和加载状态
   ============================================================================ */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================================================
   辅助类
   ============================================================================ */

/* 隐藏元素（移动端/桌面端）.mobile-only {
    display: none !important;
}

@media (max-width: 767px) {
    .mobile-only {
        display: block !important;
    }
    .desktop-only {
        display: none !important;
    }
}

/* 文本省略 */
.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-ellipsis-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-ellipsis-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 平滑滚动 */
.smooth-scroll {
    scroll-behavior: smooth;
}

/* ============================================================================
   打印样式
   ============================================================================ */

@media print {
    .bottom-banner,
    .right-float-window,
    .online-service-btn,
    .home-btn,
    .pay-service-btn {
        display: none !important;
    }

    body {
        background: white !important;
    }
}

/* ============================================================================
   高对比度模式（辅助功能）
   ============================================================================ */

@media (prefers-contrast: high) {
    :root {
        --pro-primary: #0000FF;
        --pro-text-main: #000000;
        --pro-bg-light: #FFFFFF;
    }
}

/* ============================================================================
   减少动画模式（辅助功能）
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
