/**
 * 泰兴市苏中液压件成套厂 - 移动端优化样式
 * 针对 txszyyj.cn 手机端显示问题
 */

/* ==================== 基础移动端适配 ==================== */
@media only screen and (max-width: 768px) {
    /* 容器调整 */
    .ui.container {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* 字体优化 */
    body {
        font-size: 14px;
        line-height: 1.6;
    }
    
    h1 { font-size: 24px !important; }
    h2 { font-size: 20px !important; }
    h3 { font-size: 18px !important; }
    h4 { font-size: 16px !important; }
    
    /* 按钮触摸区域 */
    .ui.button,
    .ui.label,
    a.ui.label,
    .card .content a {
        min-height: 44px;
        min-width: 44px;
        line-height: 44px;
        padding: 0 16px;
    }
    
    /* 链接触摸优化 */
    a {
        padding: 8px 0;
        display: inline-block;
    }
}

/* ==================== 导航菜单优化 ==================== */
@media only screen and (max-width: 768px) {
    /* 汉堡菜单按钮 */
    .mobile-menu-toggle {
        display: block !important;
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 1001;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 10px;
        cursor: pointer;
    }
    
    .mobile-menu-toggle i {
        font-size: 24px;
        color: #333;
    }
    
    /* 侧边栏菜单 */
    .mobile-sidebar {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100%;
        background: #fff;
        z-index: 1000;
        transition: right 0.3s ease;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
        overflow-y: auto;
    }
    
    .mobile-sidebar.active {
        right: 0;
    }
    
    .mobile-sidebar .menu-item {
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
        color: #333;
        text-decoration: none;
        font-size: 16px;
    }
    
    .mobile-sidebar .menu-item:hover {
        background: #f5f5f5;
    }
    
    /* 隐藏原导航 */
    .sz-head .ui.menu {
        display: none !important;
    }
    
    /* 顶部简化 */
    .sz-head {
        padding: 10px;
    }
    
    .sz-head img {
        max-height: 50px !important;
    }
}

/* ==================== 产品网格优化 ==================== */
@media only screen and (max-width: 768px) {
    /* 产品卡片单列显示 */
    .ui.five.cards,
    .ui.four.cards,
    .ui.three.cards {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .ui.five.cards > .card,
    .ui.four.cards > .card,
    .ui.three.cards > .card {
        width: 100% !important;
        margin-bottom: 15px !important;
    }
    
    /* 产品图片优化 */
    .card .image img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
    
    /* 产品标题 */
    .card .header {
        font-size: 16px !important;
        white-space: normal !important;
        word-wrap: break-word;
    }
    
    /* 产品描述 */
    .card .meta {
        font-size: 13px;
    }
}

/* ==================== 首页布局优化 ==================== */
@media only screen and (max-width: 768px) {
    /* 首页大标题区域 */
    .ui.vertical.masthead {
        padding: 40px 15px !important;
    }
    
    .ui.vertical.masthead h1 {
        font-size: 22px !important;
    }
    
    /* 内容区块 */
    .ui.vertical.segment {
        padding: 20px 10px !important;
    }
    
    /* 两列布局改为单列 */
    .ui.two.column.grid .column,
    .ui.three.column.grid .column,
    .ui.four.column.grid .column,
    .ui.five.column.grid .column {
        width: 100% !important;
        padding: 10px 0 !important;
    }
    
    /* 图片全宽 */
    .ui.image img {
        width: 100%;
        height: auto;
    }
    
    /* 按钮全宽 */
    .ui.huge.button {
        width: 100%;
        margin: 10px 0;
    }
}

/* ==================== 产品详情页优化 ==================== */
@media only screen and (max-width: 768px) {
    /* 产品图片 */
    .product-img {
        max-width: 100%;
        height: auto;
    }
    
    /* 产品信息 */
    .ui.grid.stackable > .column {
        width: 100% !important;
    }
    
    /* 标签云 */
    .ui.label {
        margin: 3px;
        font-size: 13px;
    }
}

/* ==================== 表单优化 ==================== */
@media only screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important; /* 防止 iOS 缩放 */
        padding: 12px !important;
        width: 100% !important;
    }
    
    .ui.form .field {
        margin-bottom: 15px;
    }
}

/* ==================== 页脚优化 ==================== */
@media only screen and (max-width: 768px) {
    .ui.inverted.footer .ui.grid .column {
        width: 100% !important;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .ui.inverted.footer .ui.link.list {
        text-align: center;
    }
    
    .ui.inverted.footer .ui.link.list .item {
        display: inline-block;
        margin: 5px 10px;
    }
}

/* ==================== 面包屑优化 ==================== */
@media only screen and (max-width: 768px) {
    .ui.breadcrumb {
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ==================== 小屏幕额外优化 ==================== */
@media only screen and (max-width: 480px) {
    body {
        font-size: 13px;
    }
    
    h1 { font-size: 20px !important; }
    h2 { font-size: 18px !important; }
    h3 { font-size: 16px !important; }
    
    .ui.container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    
    .card .header {
        font-size: 14px !important;
    }
    
    /* 标签更小 */
    .ui.label {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* ==================== 加载动画优化 ==================== */
@media only screen and (max-width: 768px) {
    /* 减少动画以提升性能 */
    .ui.segment {
        animation: none !important;
    }
}
