/* ============================================================================
   案例和资讯页系列移动端专项优化
   适用于：Cases, CaseDetail, News, NewsDetail
   ============================================================================ */

/* 超小屏优化（< 640px）*/
@media (max-width: 639px) {
    /* 案例页面 - 头部 */
    .cases-header {
        padding: 70px 0 50px;
    }

    .cases-header h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
        line-height: 1.2;
    }

    .cases-header .subtitle {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }

    /* 案例统计 */
    .cases-stats {
        gap: 1.5rem;
        margin-top: 1.5rem;
    }

    .case-stat-number {
        font-size: 2rem;
    }

    .case-stat-label {
        font-size: 0.85rem;
    }

    /* 案例筛选器 */
    .cases-filter,
    .news-categories {
        padding: 1rem 0;
        top: 70px;
    }

    .filter-nav,
    .categories-nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.5rem;
        padding: 0 1rem;
        scrollbar-width: none;
    }

    .filter-nav::-webkit-scrollbar,
    .categories-nav::-webkit-scrollbar {
        display: none;
    }

    .filter-btn,
    .category-btn {
        flex-shrink: 0;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* 案例网格 */
    .cases-grid,
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 0 1rem;
    }

    .cases-content,
    .news-content {
        padding: 40px 0;
    }

    /* 案例卡片 */
    .case-card,
    .news-card {
        border-radius: 12px;
        overflow: hidden;
    }

    .case-card-image,
    .news-card-image {
        height: 180px;
    }

    .case-card-content,
    .news-card-content {
        padding: 1rem;
    }

    .case-card-title,
    .news-card-title {
        font-size: 1.05rem;
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }

    .case-card-meta,
    .news-card-meta {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .case-card-desc,
    .news-card-desc {
        font-size: 0.85rem;
        line-height: 1.5;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* 案例详情页 */
    .case-header {
        padding: 70px 0 40px;
    }

    .case-header-content {
        padding: 0 1rem;
    }

    .case-title {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }

    .case-meta {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.85rem;
    }

    .case-content-wrapper {
        padding: 20px 1rem;
    }

    .case-content-card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .case-content-body {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    /* 案例图片 */
    .case-gallery {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .case-gallery-item {
        height: 200px;
    }

    /* 案例CTA */
    .case-cta-section {
        padding: 30px 1rem;
    }

    .case-cta-content {
        padding: 1.5rem;
    }

    /* 资讯页面 - 头部 */
    .news-header {
        padding: 70px 0 50px;
    }

    .news-header h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }

    .news-header p {
        font-size: 0.95rem;
        padding: 0 1rem;
    }

    /* 资讯卡片 */
    .news-card-image {
        height: 160px;
    }

    .news-card-tag {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .news-card-date {
        font-size: 0.75rem;
    }

    /* 资讯详情页 */
    .news-detail-wrapper {
        padding: 20px 1rem;
    }

    .news-detail-card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .news-detail-title {
        font-size: 1.4rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }

    .news-detail-meta {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .news-detail-body {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .news-detail-body p {
        margin-bottom: 1rem;
    }

    .news-detail-body img {
        height: auto;
        max-height: 300px;
        border-radius: 8px;
    }

    /* 分享按钮 */
    .news-share {
        margin: 30px 0;
        padding: 0 1rem;
    }

    /* 相关资讯 */
    .related-news {
        padding: 20px 1rem 40px;
    }

    .related-news-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .related-news-item {
        padding: 0.75rem;
    }

    .related-news-item h4 {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    /* 面包屑 */
    .breadcrumb-section {
        padding: 0.75rem 0;
    }

    .breadcrumb {
        font-size: 0.85rem;
        padding: 0 1rem;
    }

    .breadcrumb-item {
        padding: 0.15rem 0.3rem;
    }

    /* 分页 */
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0 1rem;
    }

    .pagination-item {
        min-width: 40px;
        min-height: 40px;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    /* 案例/资讯标签 */
    .case-tags,
    .news-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .tag {
        padding: 0.25rem 0.75rem;
        font-size: 0.8rem;
        border-radius: 15px;
    }
}

/* 小屏优化（640px - 767px）*/
@media (min-width: 640px) and (max-width: 767px) {
    .cases-grid,
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .case-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .case-card-image,
    .news-card-image {
        height: 200px;
    }

    .cases-stats {
        gap: 2rem;
    }

    .case-stat-number {
        font-size: 2.5rem;
    }
}

/* 平板优化（768px - 1023px）*/
@media (min-width: 768px) and (max-width: 1023px) {
    .cases-header,
    .news-header {
        padding: 100px 0 70px;
    }

    .cases-grid,
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .case-gallery {
        grid-template-columns: repeat(3, 1fr);
    }

    .filter-nav,
    .categories-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* 横屏优化 */
@media (max-width: 1024px) and (orientation: landscape) {
    .cases-header,
    .news-header,
    .case-header {
        padding: 50px 0 40px;
    }

    .cases-content,
    .news-content {
        padding: 30px 0;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .case-card,
    .news-card,
    .filter-btn,
    .category-btn,
    .related-news-item {
        min-height: 48px;
        min-width: 48px;
    }

    .case-card:active,
    .news-card:active {
        transform: scale(0.98);
    }

    .case-card:hover,
    .news-card:hover {
        transform: none;
    }
}

/* 动画优化（移动端禁用复杂动画）*/
@media (max-width: 767px) {
    .case-card,
    .news-card {
        transition: none;
    }

    .case-card:hover .case-card-image img,
    .news-card:hover .news-card-image img {
        transform: none;
    }

    /* 简化加载动画 */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .case-card,
    .news-card {
        animation: fadeInUp 0.3s ease-out;
    }
}

/* 图片加载优化 */
@media (max-width: 767px) {
    .case-card-image,
    .news-card-image,
    .case-gallery-item {
        background: #f0f0f0;
        min-height: 180px;
    }

    img[loading="lazy"] {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
    }

    img[loading="lazy"].loaded {
        background: none;
        animation: none;
    }
}

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

/* Hero背景优化 */
@media (max-width: 767px) {
    .cases-header,
    .news-header,
    .case-header {
        background-size: cover;
        background-position: center 70%;
    }
}

/* 案例详情 - 数据展示 */
@media (max-width: 767px) {
    .case-stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .case-stat-card {
        padding: 1rem;
        text-align: center;
    }

    .case-stat-value {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .case-stat-label {
        font-size: 0.85rem;
    }
}

/* 案例详情 - 引用块 */
@media (max-width: 767px) {
    .case-quote {
        padding: 1rem;
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .case-quote::before {
        font-size: 2rem;
        left: 0.5rem;
        top: 0.5rem;
    }
}

/* 资讯详情 - 作者信息 */
@media (max-width: 767px) {
    .news-author {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .news-author-avatar {
        width: 60px;
        height: 60px;
    }

    .news-author-info h4 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .news-author-info p {
        font-size: 0.85rem;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    .case-card,
    .news-card,
    .filter-btn,
    .category-btn {
        transition: none;
        animation: none;
    }

    @keyframes fadeInUp {
        animation-duration: 0.01ms !important;
    }

    @keyframes loading {
        animation-duration: 0.01ms !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .case-card,
    .news-card,
    .case-content-card,
    .news-detail-card {
        border: 2px solid #000000;
    }

    .filter-btn,
    .category-btn {
        border-width: 2px;
    }

    .tag {
        border-width: 2px;
    }
}

/* 打印样式 */
@media print {
    .cases-header,
    .news-header,
    .case-header {
        page-break-after: always;
    }

    .case-card,
    .news-card,
    .case-content-card,
    .news-detail-card {
        break-inside: avoid;
    }

    .case-gallery {
        page-break-inside: avoid;
    }

    .filter-nav,
    .categories-nav,
    .news-share {
        display: none;
    }
}

/* 字体加载优化 */
.font-loading .cases-header h1,
.font-loading .news-header h1,
.font-loading .case-title,
.font-loading .news-detail-title {
    font-family: system-ui, -apple-system, sans-serif;
}

/* 横向滚动提示 */
@media (max-width: 767px) {
    .filter-nav::after,
    .categories-nav::after {
        content: '→';
        position: fixed;
        right: 20px;
        bottom: 80px;
        width: 50px;
        height: 50px;
        background: rgba(0,123,255,0.9);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        z-index: 100;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .filter-nav.scrolled::after,
    .categories-nav.scrolled::after {
        opacity: 1;
    }
}

/* 触摸反馈 */
@media (hover: none) and (pointer: coarse) {
    .case-card:active::after,
    .news-card:active::after {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(0,123,255,0.1);
        animation: touch-ripple 0.6s ease-out;
    }
}

@keyframes touch-ripple {
    0% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
    }
}

/* 搜索框优化 */
@media (max-width: 767px) {
    .search-box {
        margin: 0 1rem 1rem;
    }

    .search-input {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .search-button {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* 时间轴样式（案例详情）*/
@media (max-width: 767px) {
    .case-timeline {
        padding-left: 1.5rem;
    }

    .case-timeline-item {
        padding-left: 1rem;
        margin-bottom: 1.5rem;
    }

    .case-timeline-dot {
        width: 12px;
        height: 12px;
        left: -1.5rem;
    }

    .case-timeline-date {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .case-timeline-content {
        font-size: 0.9rem;
    }
}

/* 视频嵌入优化 */
@media (max-width: 767px) {
    .case-video,
    .news-video {
        aspect-ratio: 16/9;
        max-height: 300px;
        border-radius: 12px;
    }
}

/* 目录导航（资讯详情）*/
@media (max-width: 767px) {
    .article-toc {
        display: none;
    }
}
