/* ==========================================
   ANTEATER 食蚁兽品牌官网 - 移动端适配优化
   ========================================== */

/* ==========================================
   移动端响应式图片优化
   ========================================== */
@media screen and (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Hero区域图片优化 */
    .hero-visual {
        height: auto;
        max-height: 400px;
    }
    
    .hero-image {
        max-width: 300px;
        margin: 0 auto;
    }
    
    /* 产品图片优化 */
    .product-image,
    .product-visual {
        aspect-ratio: 3/4;
    }
    
    /* 新闻图片优化 */
    .news-image {
        aspect-ratio: 16/10;
    }
    
    /* 故事图片优化 */
    .story-image-main {
        aspect-ratio: 4/3;
    }
    
    /* 产品视觉容器优化 */
    .product-visual-inner {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 哲学视觉容器优化 */
    .philosophy-visual {
        aspect-ratio: 16/9;
        max-height: 400px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 文章图片容器优化 */
    .article-image {
        aspect-ratio: 16/9;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 24px 0 !important;
    }
}

/* ==========================================
   小屏幕图片优化
   ========================================== */
@media screen and (max-width: 480px) {
    .hero-image {
        max-width: 250px;
    }
}

/* ==========================================
   基础移动端样式重置
   ========================================== */
@media screen and (max-width: 768px) {
    /* 全局重置 */
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    html {
        font-size: 14px;
    }
    
    body {
        padding-top: 68px; /* 导航栏高度 */
        overflow-x: hidden;
    }
    
    /* 修复iOS Safari 100vh问题 */
    .mobile-menu,
    .hero {
        min-height: -webkit-fill-available;
    }
}

/* ==========================================
   移动端导航栏优化
   ========================================== */
@media screen and (max-width: 768px) {
    .nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(252, 250, 247, 0.98) !important;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        height: 68px !important;
    }
    
    .nav.scrolled {
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    }
    
    .nav-inner {
        height: 68px !important;
        padding: 0 16px !important;
        max-width: 100% !important;
    }
    
    .nav-logo {
        flex: 1;
    }
    
    .nav-logo svg,
    .nav-logo-img {
        height: 24px !important;
        width: auto;
    }
    
    .nav-links {
        display: none !important;
    }
    
    .nav-actions {
        flex: 0 0 auto;
    }
    
    .nav-hamburger {
        display: flex !important;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 10px;
        margin-right: -10px;
    }
    
    .nav-hamburger span {
        width: 22px;
        height: 2px;
        background: #0D0D0D;
        transition: all 0.3s ease;
        display: block;
    }
    
    .nav-hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}

/* ==========================================
   移动端菜单优化
   ========================================== */
@media screen and (max-width: 768px) {
    .mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #FCFAF7;
        z-index: 999;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 32px;
        transform: translateY(-100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-menu.active {
        transform: translateY(0);
    }
    
    .mobile-menu a {
        font-size: 20px;
        color: #0D0D0D;
        text-decoration: none;
        font-family: 'Cormorant Garamond', serif;
        font-weight: 400;
        letter-spacing: 3px;
        padding: 12px 24px;
        transition: color 0.3s;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-menu a:hover,
    .mobile-menu a:active {
        color: #C8A882;
    }
}

/* ==========================================
   移动端容器和间距
   ========================================== */
@media screen and (max-width: 768px) {
    .container {
        padding: 0 16px !important;
        max-width: 100% !important;
    }
    
    .section {
        padding: 60px 0 !important;
    }
    
    .section-label {
        font-size: 10px !important;
        letter-spacing: 4px !important;
        margin-bottom: 16px !important;
    }
    
    .section-title {
        font-size: clamp(26px, 6vw, 36px) !important;
        margin-bottom: 16px !important;
        line-height: 1.3 !important;
    }
    
    .section-desc {
        font-size: 14px !important;
        line-height: 1.8 !important;
    }
}

/* ==========================================
   移动端Hero区域
   ========================================== */
@media screen and (max-width: 768px) {
    .hero {
        padding: 100px 0 60px !important;
        min-height: auto !important;
        background-size: cover !important;
        background-position: center !important;
    }
    
    .hero-content {
        text-align: center !important;
        max-width: 100% !important;
        padding: 0 16px;
    }
    
    .hero-title {
        font-size: clamp(32px, 8vw, 48px) !important;
        line-height: 1.2 !important;
        margin-bottom: 20px !important;
    }
    
    .hero-subtitle {
        font-size: 14px !important;
        margin-bottom: 32px !important;
        letter-spacing: 2px !important;
    }
    
    .hero-desc {
        font-size: 14px !important;
        line-height: 1.8 !important;
        margin-bottom: 32px !important;
    }
    
    .hero-actions {
        flex-direction: column !important;
        gap: 16px !important;
        align-items: center !important;
    }
    
    .hero-actions .btn {
        width: 100% !important;
        max-width: 280px !important;
        justify-content: center !important;
    }
}

/* ==========================================
   移动端网格布局
   ========================================== */
@media screen and (max-width: 768px) {
    /* 产品网格 */
    .products-grid,
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }
    
    /* 新闻网格 */
    .news-grid {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }
    
    /* 价值网格 */
    .values-grid,
    .value-props-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
    
    /* 联系网格 */
    .contact-grid,
    .contact-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
    
    /* 门店网格 */
    .store-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
    
    /* 品牌网格 */
    .brand-grid {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }
    
    /* 相关新闻网格 */
    .related-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
    
    /* 页脚网格 */
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }
}

/* ==========================================
   移动端卡片样式
   ========================================== */
@media screen and (max-width: 768px) {
    .product-card,
    .news-card,
    .value-card,
    .testimonial-card,
    .team-card,
    .store-card,
    .contact-card,
    .related-card {
        padding: 20px !important;
        margin: 0 !important;
    }
    
    .product-image,
    .news-image,
    .news-visual {
        aspect-ratio: 4/3 !important;
        margin-bottom: 16px !important;
    }
    
    .product-info,
    .news-info {
        padding: 0 !important;
    }
    
    .product-name,
    .news-title,
    .value-title,
    .related-card-title {
        font-size: 16px !important;
        line-height: 1.4 !important;
        margin-bottom: 8px !important;
    }
    
    .product-category,
    .news-tag,
    .value-label {
        font-size: 10px !important;
        letter-spacing: 2px !important;
    }
    
    .product-price,
    .news-date {
        font-size: 14px !important;
    }
    
    .product-desc,
    .news-desc,
    .news-excerpt {
        font-size: 13px !important;
        line-height: 1.7 !important;
    }
}

/* ==========================================
   移动端表单样式
   ========================================== */
@media screen and (max-width: 768px) {
    .contact-form,
    .newsletter-form {
        flex-direction: column !important;
        gap: 16px !important;
    }
    
    .form-group {
        width: 100% !important;
    }
    
    .form-input,
    .form-textarea {
        width: 100% !important;
        padding: 14px 16px !important;
        font-size: 14px !important;
    }
    
    .form-textarea {
        min-height: 120px !important;
    }
    
    .btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 14px 24px !important;
        font-size: 12px !important;
    }
    
    .newsletter-form .btn {
        width: 100% !important;
    }
}

/* ==========================================
   移动端页脚样式
   ========================================== */
@media screen and (max-width: 768px) {
    .footer {
        padding: 48px 0 24px !important;
    }
    
    .footer-grid {
        margin-bottom: 32px !important;
    }
    
    .footer-logo-img {
        height: 28px !important;
    }
    
    .footer-brand-text {
        font-size: 12px !important;
        line-height: 1.8 !important;
    }
    
    .footer-col-title {
        font-size: 11px !important;
        letter-spacing: 2px !important;
        margin-bottom: 16px !important;
    }
    
    .footer-links li {
        margin-bottom: 10px !important;
    }
    
    .footer-links a {
        font-size: 13px !important;
        padding: 8px 0 !important;
        display: inline-block !important;
    }
    
    .footer-bottom {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding-top: 24px !important;
        gap: 16px !important;
    }
    
    .footer-copy {
        font-size: 11px !important;
    }
    
    .footer-social {
        justify-content: center !important;
    }
}

/* ==========================================
   移动端页面Hero
   ========================================== */
@media screen and (max-width: 768px) {
    .page-hero {
        padding: 100px 0 48px !important;
    }
    
    .page-hero-title {
        font-size: clamp(28px, 7vw, 40px) !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
    }
    
    .page-hero-subtitle {
        font-size: 12px !important;
        letter-spacing: 3px !important;
    }
}

/* ==========================================
   移动端文章样式
   ========================================== */
@media screen and (max-width: 768px) {
    .article-hero {
        padding: 100px 0 40px !important;
    }
    
    .article-title {
        font-size: clamp(26px, 6vw, 36px) !important;
        line-height: 1.3 !important;
    }
    
    .article-subtitle {
        font-size: 14px !important;
        line-height: 1.7 !important;
    }
    
    .article-meta {
        margin-bottom: 16px !important;
    }
    
    .article-tag {
        font-size: 9px !important;
        padding: 3px 10px !important;
        letter-spacing: 1.5px !important;
    }
    
    .article-date {
        font-size: 11px !important;
    }
    
    .article-section {
        padding: 40px 0 !important;
    }
    
    .article-content {
        max-width: 100% !important;
    }
    
    .article-lead {
        font-size: 15px !important;
        line-height: 1.9 !important;
        margin-bottom: 24px !important;
        padding-bottom: 24px !important;
    }
    
    .article-text {
        font-size: 14px !important;
        line-height: 1.9 !important;
        margin-bottom: 20px !important;
    }
    
    .article-quote {
        font-size: 18px !important;
        padding: 20px 24px !important;
        margin: 24px 0 !important;
        line-height: 1.7 !important;
    }
    
    .article-image {
        margin: 24px -16px !important;
    }
    
    .article-subheading {
        font-size: 18px !important;
        margin: 28px 0 16px !important;
    }
    
    .article-list {
        padding-left: 20px !important;
    }
    
    .article-list li {
        font-size: 14px !important;
        line-height: 1.8 !important;
        margin-bottom: 10px !important;
    }
    
    .related-section {
        padding: 48px 0 !important;
    }
    
    .related-title {
        font-size: 20px !important;
        margin-bottom: 24px !important;
    }
}

/* ==========================================
   移动端FAQ手风琴
   ========================================== */
@media screen and (max-width: 768px) {
    .faq-item {
        margin-bottom: 12px !important;
    }
    
    .faq-question {
        padding: 16px 20px !important;
        font-size: 14px !important;
        line-height: 1.5 !important;
    }
    
    .faq-answer {
        padding: 0 20px 16px !important;
        font-size: 13px !important;
        line-height: 1.8 !important;
    }
    
    .faq-icon {
        font-size: 18px !important;
        min-width: 20px !important;
    }
}

/* ==========================================
   移动端时间线
   ========================================== */
@media screen and (max-width: 768px) {
    .timeline-item {
        padding-left: 24px !important;
        margin-bottom: 32px !important;
    }
    
    .timeline-year {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }
    
    .timeline-content {
        font-size: 13px !important;
        line-height: 1.7 !important;
    }
}

/* ==========================================
   移动端CTA区域
   ========================================== */
@media screen and (max-width: 768px) {
    .cta-section {
        padding: 60px 0 !important;
    }
    
    .cta-content {
        padding: 40px 24px !important;
    }
    
    .cta-title {
        font-size: 24px !important;
        margin-bottom: 16px !important;
    }
    
    .cta-text {
        font-size: 14px !important;
        line-height: 1.8 !important;
        margin-bottom: 24px !important;
    }
}

/* ==========================================
   移动端评价轮播
   ========================================== */
@media screen and (max-width: 768px) {
    .testimonial-quote {
        font-size: 16px !important;
        line-height: 1.8 !important;
    }
    
    .testimonial-name {
        font-size: 14px !important;
    }
    
    .testimonial-role {
        font-size: 12px !important;
    }
}

/* ==========================================
   移动端品牌故事
   ========================================== */
@media screen and (max-width: 768px) {
    .story-grid {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }
    
    .story-content {
        text-align: center !important;
        padding: 0 16px !important;
    }
    
    .story-quote {
        font-size: 18px !important;
        line-height: 1.7 !important;
        margin-bottom: 20px !important;
    }
    
    .philosophy-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
    
    .philosophy-visual,
    .philosophy-content {
        text-align: center !important;
    }
}

/* ==========================================
   移动端产品详情
   ========================================== */
@media screen and (max-width: 768px) {
    .product-detail-grid {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }
    
    .product-gallery {
        margin-bottom: 24px !important;
    }
    
    .product-thumbnails {
        gap: 8px !important;
    }
    
    .product-thumb {
        width: 60px !important;
        height: 60px !important;
    }
    
    .product-actions {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .product-price {
        font-size: 24px !important;
    }
    
    .product-tabs {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    .product-tab {
        padding: 10px 16px !important;
        font-size: 12px !important;
    }
}

/* ==========================================
   移动端筛选和排序
   ========================================== */
@media screen and (max-width: 768px) {
    .products-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
    }
    
    .filters-bar {
        width: 100% !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    .filter-btn {
        padding: 8px 14px !important;
        font-size: 12px !important;
    }
    
    .sort-dropdown {
        width: 100% !important;
    }
}

/* ==========================================
   移动端滚动条美化
   ========================================== */
@media screen and (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }
    
    ::-webkit-scrollbar-track {
        background: transparent;
    }
    
    ::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }
}

/* ==========================================
   小屏幕优化 (max-width: 480px)
   ========================================== */
@media screen and (max-width: 480px) {
    body {
        padding-top: 60px;
    }
    
    .nav {
        height: 60px !important;
    }
    
    .nav-inner {
        height: 60px !important;
    }
    
    .section {
        padding: 48px 0 !important;
    }
    
    .hero {
        padding: 80px 0 48px !important;
    }
    
    .hero-title {
        font-size: 28px !important;
    }
    
    .btn {
        padding: 12px 20px !important;
        font-size: 11px !important;
    }
    
    .product-name,
    .news-title {
        font-size: 15px !important;
    }
    
    .footer {
        padding: 40px 0 20px !important;
    }
    
    .article-title {
        font-size: 24px !important;
    }
}

/* ==========================================
   触摸友好优化
   ========================================== */
@media screen and (max-width: 768px) {
    /* 增大点击区域 */
    a,
    button,
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 移除hover效果的副作用 */
    a:hover,
    button:hover,
    .btn:hover {
        opacity: 0.9;
    }
    
    /* 禁用文本选择优化触摸 */
    .nav-link,
    .mobile-menu a {
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* 平滑滚动 */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 禁用触摸延迟 */
    * {
        touch-action: manipulation;
    }
}

/* ==========================================
   安全区域适配 (iPhone X及以后)
   ========================================== */
@supports (padding: max(0px)) {
    @media screen and (max-width: 768px) {
        .mobile-menu {
            padding-top: max(0px, env(safe-area-inset-top));
            padding-bottom: max(0px, env(safe-area-inset-bottom));
            padding-left: max(0px, env(safe-area-inset-left));
            padding-right: max(0px, env(safe-area-inset-right));
        }
        
        .footer {
            padding-left: max(16px, env(safe-area-inset-left));
            padding-right: max(16px, env(safe-area-inset-right));
        }
    }
}

/* ==========================================
   性能优化
   ========================================== */
@media screen and (max-width: 768px) {
    /* 减少动画 */
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    /* 简化阴影 */
    .product-card,
    .news-card,
    .value-card {
        box-shadow: none !important;
    }
    
    /* 简化背景 */
    .page-hero {
        background-attachment: scroll !important;
    }
}
