/* 移动端专用响应式样式文件 */
/* Mobile-specific responsive styles */

/* ========================================= */
/* 移动端导航优化 */
/* ========================================= */

/* 移动端导航菜单样式 */
@media screen and (max-width: 768px) {
    /* 导航栏移动端优化 */
    .site-header {
        position: relative;
        z-index: 1000;
    }
    
    /* 汉堡菜单按钮 */
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #333;
        cursor: pointer;
        padding: 8px;
    }
    
    .mobile-menu-toggle:hover {
        color: #faac4c;
    }
    
    /* 移动端菜单容器 */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: #fff;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        z-index: 1001;
        overflow-y: auto;
    }
    
    .mobile-menu.active {
        left: 0;
    }
    
    /* 移动端菜单遮罩 */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* 移动端菜单项 */
    .mobile-menu-item {
        display: block;
        padding: 15px 20px;
        color: #333;
        text-decoration: none;
        border-bottom: 1px solid #eee;
        transition: background-color 0.3s ease;
    }
    
    .mobile-menu-item:hover {
        background-color: #f8f9fa;
        color: #faac4c;
    }
    
    /* 隐藏桌面端导航 */
    .desktop-nav {
        display: none;
    }
}

/* ========================================= */
/* 移动端交互优化 */
/* ========================================= */

@media screen and (max-width: 768px) {
    /* 触摸友好的按钮大小 */
    .btn,
    .button,
    .hy-button {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 24px;
        font-size: 16px;
    }
    
    /* 表单元素触摸优化 */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    textarea,
    select {
        min-height: 44px;
        font-size: 16px; /* 防止iOS缩放 */
        padding: 12px 16px;
        border-radius: 8px;
    }
    
    /* 链接触摸区域优化 */
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    
    /* 卡片点击区域优化 */
    .product-card,
    .news-card {
        cursor: pointer;
        transition: transform 0.2s ease;
    }
    
    .product-card:active,
    .news-card:active {
        transform: scale(0.98);
    }
}

/* ========================================= */
/* 移动端滚动优化 */
/* ========================================= */

@media screen and (max-width: 768px) {
    /* 平滑滚动 */
    html {
        scroll-behavior: smooth;
    }
    
    /* 防止水平滚动 */
    body {
        overflow-x: hidden;
    }
    
    /* 滚动条样式 */
    ::-webkit-scrollbar {
        width: 4px;
    }
    
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #faac4c;
        border-radius: 2px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #e67e22;
    }
}

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

@media screen and (max-width: 768px) {
    /* 减少动画以提升性能 */
    .reduce-motion * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    /* 图片懒加载优化 */
    img[loading="lazy"] {
        opacity: 0;
        transition: opacity 0.3s;
    }
    
    img[loading="lazy"].loaded {
        opacity: 1;
    }
    
    /* 视频移动端优化 */
    video {
        max-width: 100%;
        height: auto;
        object-fit: cover;
    }
    
    /* 移动端视频容器 */
    .video-container {
        position: relative;
        width: 100%;
        height: 0;
        padding-bottom: 56.25%; /* 16:9 宽高比 */
        overflow: hidden;
    }
    
    .video-container video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* ========================================= */
/* 移动端文本优化 */
/* ========================================= */

@media screen and (max-width: 768px) {
    /* 文本可读性优化 */
    body {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* 标题层级优化 */
    h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.3rem;
        line-height: 1.4;
    }
    
    h4 {
        font-size: 1.1rem;
        line-height: 1.4;
    }
    
    /* 段落文本优化 */
    p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }
    
    /* 长文本换行 */
    .text-content {
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }
}

/* ========================================= */
/* 移动端布局工具类 */
/* ========================================= */

@media screen and (max-width: 768px) {
    /* 移动端显示/隐藏 */
    .mobile-show {
        display: block !important;
    }
    
    .mobile-hide {
        display: none !important;
    }
    
    /* 移动端间距调整 */
    .mobile-p-4 {
        padding: 1rem !important;
    }
    
    .mobile-p-6 {
        padding: 1.5rem !important;
    }
    
    .mobile-m-4 {
        margin: 1rem !important;
    }
    
    .mobile-m-6 {
        margin: 1.5rem !important;
    }
    
    /* 移动端文本对齐 */
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-text-left {
        text-align: left !important;
    }
    
    /* 移动端宽度控制 */
    .mobile-w-full {
        width: 100% !important;
    }
    
    .mobile-max-w-none {
        max-width: none !important;
    }
}

/* ========================================= */
/* 移动端特殊效果 */
/* ========================================= */

@media screen and (max-width: 768px) {
    /* 移动端卡片阴影 */
    .mobile-card-shadow {
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    /* 移动端按钮效果 */
    .mobile-btn-effect {
        position: relative;
        overflow: hidden;
    }
    
    .mobile-btn-effect::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        background: rgba(255,255,255,0.3);
        border-radius: 50%;
        transform: translate(-50%, -50%);
        transition: width 0.3s, height 0.3s;
    }
    
    .mobile-btn-effect:active::before {
        width: 200px;
        height: 200px;
    }
    
    /* 移动端加载动画 */
    .mobile-loading {
        display: inline-block;
        width: 20px;
        height: 20px;
        border: 2px solid #f3f3f3;
        border-top: 2px solid #faac4c;
        border-radius: 50%;
        animation: mobile-spin 1s linear infinite;
    }
    
    @keyframes mobile-spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
}

/* ========================================= */
/* 移动端错误和提示样式 */
/* ========================================= */

@media screen and (max-width: 768px) {
    /* 移动端提示框 */
    .mobile-alert {
        position: fixed;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100% - 40px);
        padding: 12px 16px;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        z-index: 1002;
    }
    
    .mobile-alert-success {
        background: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }
    
    .mobile-alert-error {
        background: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }
    
    .mobile-alert-warning {
        background: #fff3cd;
        color: #856404;
        border: 1px solid #ffeaa7;
    }
    
    /* 移动端表单验证 */
    .mobile-form-error {
        color: #dc3545;
        font-size: 0.875rem;
        margin-top: 4px;
    }
    
    .mobile-form-success {
        color: #28a745;
        font-size: 0.875rem;
        margin-top: 4px;
    }
}

/* ========================================= */
/* 移动端打印样式 */
/* ========================================= */

@media print {
    .mobile-menu,
    .mobile-menu-toggle,
    .mobile-menu-overlay {
        display: none !important;
    }
    
    .hero-section {
        height: auto !important;
        min-height: auto !important;
    }
    
    .hero-image-container {
        height: 200px !important;
    }
}
