/**
 * 移动端优化样式
 * Smail Medical 前台移动端适配
 */

/* ==================== 基础移动端优化 ==================== */

/* 确保正确的视口设置 */
@-ms-viewport {
    width: device-width;
}

/* 防止文本自动调整 */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* 点击高亮色 */
* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* ==================== 响应式布局 - 手机端 ==================== */

@media screen and (max-width: 768px) {
    /* 布局容器 */
    .layout,
    .main,
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 15px !important;
        box-sizing: border-box;
    }
    
    /* 侧边栏优化 */
    .aside,
    .sidebar {
        display: none !important;
    }
    
    /* 主内容区占满全屏 */
    .main {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* 头部优化 */
    .index_web_head,
    .web_head,
    header {
        position: relative !important;
        height: auto !important;
    }
    
    .head_layout {
        flex-direction: column !important;
        padding: 10px !important;
    }
    
    .logo_bar {
        margin-bottom: 10px !important;
    }
    
    .logo img {
        max-width: 150px !important;
        height: auto !important;
    }
    
    .head_contacts {
        display: none !important;
    }
    
    /* 导航菜单优化 */
    .head_nav,
    .nav_menu {
        display: block !important;
        width: 100% !important;
    }
    
    .head_nav ul,
    .nav_menu ul {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    
    .head_nav li,
    .nav_menu li {
        width: auto !important;
        margin: 5px !important;
    }
    
    .head_nav a,
    .nav_menu a {
        font-size: 14px !important;
        padding: 8px 12px !important;
    }
    
    /* 页面标题区优化 */
    .sys_sub_head,
    .page_header {
        padding: 20px 15px !important;
    }
    
    .pagnation_title,
    .page_title {
        font-size: 20px !important;
        line-height: 1.3 !important;
    }
    
    /* 产品页面优化 */
    .product-intro {
        padding: 15px !important;
    }
    
    .product-view {
        display: block !important;
        width: 100% !important;
    }
    
    .product-image {
        width: 100% !important;
        margin: 0 !important;
    }
    
    .product-image img {
        width: 100% !important;
        height: auto !important;
    }
    
    .product-image-info {
        display: none !important;
    }
    
    .image-additional-wrap {
        width: 100% !important;
        margin: 15px 0 !important;
    }
    
    .swiper-slide.image-item {
        min-width: 80px !important;
    }
    
    .swiper-slide.image-item img {
        width: 80px !important;
        height: 60px !important;
    }
    
    .product-summary {
        padding: 15px !important;
    }
    
    .product-meta {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }
    
    .product-meta h3 {
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }
    
    .product-btn-wrap {
        margin-top: 15px !important;
    }
    
    .product-btn-wrap a.email {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 12px !important;
        font-size: 16px !important;
    }
    
    /* 产品详情区优化 */
    .tab-content-wrap.product-detail {
        padding: 15px !important;
    }
    
    .tab-title-bar {
        margin-bottom: 15px !important;
    }
    
    .tab-title {
        font-size: 18px !important;
    }
    
    .tab-panel-content {
        font-size: 14px !important;
        line-height: 1.8 !important;
    }
    
    .tab-panel-content p {
        margin-bottom: 15px !important;
    }
    
    .tab-panel-content img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* 相关产品优化 */
    .goods-may-like {
        padding: 15px !important;
    }
    
    .index_title_bar {
        margin-bottom: 15px !important;
    }
    
    .good_title {
        font-size: 18px !important;
    }
    
    .product_item {
        width: 50% !important;
        padding: 5px !important;
    }
    
    .product_item img {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }
    
    .item_title {
        font-size: 14px !important;
        line-height: 1.4 !important;
        height: 40px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
    }
    
    .item_morebtn {
        font-size: 12px !important;
        padding: 8px 15px !important;
    }
    
    /* 询价表单优化 */
    .inquiry-form-wrap {
        padding: 15px !important;
    }
    
    .product_inquiry_title {
        font-size: 18px !important;
        margin-bottom: 15px !important;
    }
    
    .inquiry-form-wrap input,
    .inquiry-form-wrap textarea,
    .inquiry-form-wrap select {
        width: 100% !important;
        font-size: 16px !important;
        padding: 12px !important;
        margin-bottom: 15px !important;
    }
    
    .inquiry-form-wrap input[type="submit"] {
        width: 100% !important;
        padding: 15px !important;
        font-size: 18px !important;
    }
    
    /* 底部优化 */
    .web_footer,
    footer {
        padding: 20px 15px !important;
    }
    
    .foot_layout {
        flex-direction: column !important;
    }
    
    .foot_nav,
    .foot_contact,
    .foot_sns {
        width: 100% !important;
        margin: 10px 0 !important;
        text-align: center !important;
    }
    
    .foot_nav ul {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    
    .foot_nav li {
        margin: 5px 10px !important;
    }
    
    .foot_contact p {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }
    
    .foot_sns {
        margin-top: 20px !important;
    }
    
    .foot_sns li {
        display: inline-block !important;
        margin: 0 10px !important;
    }
    
    .foot_sns img {
        width: 32px !important;
        height: 32px !important;
    }
    
    /* 新闻列表优化 */
    .news_list li {
        padding: 15px !important;
        margin-bottom: 10px !important;
    }
    
    .news_title {
        font-size: 16px !important;
        line-height: 1.4 !important;
    }
    
    .news_date {
        font-size: 12px !important;
        color: #999 !important;
    }
    
    /* 新闻详情优化 */
    .news-detail {
        padding: 15px !important;
    }
    
    .news-title {
        font-size: 20px !important;
        line-height: 1.3 !important;
        margin-bottom: 15px !important;
    }
    
    .news-meta {
        font-size: 12px !important;
        color: #999 !important;
        margin-bottom: 20px !important;
    }
    
    .news-content {
        font-size: 14px !important;
        line-height: 1.8 !important;
    }
    
    .news-content img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* 分类列表优化 */
    .catalog_list li {
        padding: 12px 15px !important;
        font-size: 14px !important;
    }
    
    /* 按钮优化 */
    .btn,
    button,
    .button {
        min-height: 44px !important;
        min-width: 44px !important;
        font-size: 16px !important;
        padding: 12px 20px !important;
    }
    
    /* 表单元素优化 */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
        min-height: 44px !important;
        padding: 12px !important;
    }
    
    /* 图片优化 */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* 表格优化 */
    table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* 导航按钮优化 */
    .navigate_button_prev,
    .navigate_button_next,
    .swiper-button-prev,
    .swiper-button-next {
        width: 30px !important;
        height: 30px !important;
    }
    
    .navigate_button_prev:after,
    .navigate_button_next:after,
    .swiper-button-prev:after,
    .swiper-button-next:after {
        font-size: 16px !important;
    }
    
    /* 分页优化 */
    .pagination {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    
    .pagination a,
    .pagination span {
        min-width: 36px !important;
        min-height: 36px !important;
        font-size: 14px !important;
        margin: 2px !important;
        padding: 8px 12px !important;
    }
    
    /* 云缩放优化 */
    .cloud-zoom-big {
        display: none !important;
    }
    
    /* 隐藏桌面端特有元素 */
    .desktop-only,
    .pc-only {
        display: none !important;
    }
}

/* ==================== 平板端优化 ==================== */

@media screen and (min-width: 769px) and (max-width: 1024px) {
    .layout,
    .main,
    .container {
        max-width: 100% !important;
        padding: 0 20px !important;
    }
    
    .aside,
    .sidebar {
        width: 25% !important;
    }
    
    .main {
        width: 75% !important;
    }
    
    .product_item {
        width: 33.33% !important;
    }
}

/* ==================== 移动端底部固定导航 ==================== */

@media screen and (max-width: 768px) {
    .mobile-bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: #fff !important;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
        z-index: 9999 !important;
        display: flex !important;
        justify-content: space-around !important;
        padding: 10px 0 !important;
    }
    
    .mobile-bottom-nav a {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        font-size: 12px !important;
        color: #666 !important;
        text-decoration: none !important;
    }
    
    .mobile-bottom-nav a.active {
        color: #6B2D5B !important;
    }
    
    .mobile-bottom-nav i {
        font-size: 20px !important;
        margin-bottom: 4px !important;
    }
}

/* ==================== 移动端触摸优化 ==================== */

@media screen and (max-width: 768px) {
    /* 增加触摸目标大小 */
    a,
    button,
    input[type="submit"],
    .clickable {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 10px !important;
    }
    
    /* 优化滚动 */
    * {
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* 防止双击缩放 */
    * {
        touch-action: manipulation !important;
    }
}

/* ==================== 移动端性能优化 ==================== */

@media screen and (max-width: 768px) {
    /* 图片懒加载占位 */
    img[data-src] {
        background: #f5f5f5 !important;
        min-height: 100px !important;
    }
    
    /* 减少动画 */
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
