/* 移动端新闻显示修复 - Mobile News Display Fix */

/* 移动端新闻板块优化 */
@media screen and (max-width: 768px) {
    
    /* 整体新闻板块 */
    .news {
        padding: 0 4px;
    }
    
    /* 特色新闻卡片 */
    .news-featured {
        background: var(--white, #ffffff);
        border-radius: 16px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
        border: 1px solid #e1e5e9;
        margin-bottom: 24px;
        overflow: hidden;
        transition: all 0.3s ease;
        cursor: pointer;
    }
    
    .news-featured:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    }
    
    /* 新闻列表项 */
    .news-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .news-list li {
        background: var(--white, #ffffff);
        margin-bottom: 14px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
        border: 1px solid #e1e5e9;
        overflow: hidden;
        cursor: pointer;
    }
    
    .news-list li:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }
    
    /* 新闻内容布局 */
    .news-list .news-content {
        display: flex !important;
        flex-direction: column !important;
        padding: 16px 18px;
        min-height: 100px;
        position: relative;
        gap: 12px;
    }
    
    /* 文本区域 */
    .news-list .text {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .news-list .text h4 {
        color: #212529;
        font-size: 1.05rem;
        margin: 0;
        font-weight: 600;
        line-height: 1.4;
        word-break: break-word;
        /* 限制显示2行 */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .news-list .text p {
        color: #495057;
        font-size: 0.875rem;
        line-height: 1.5;
        margin: 0;
        word-break: break-word;
        /* 限制显示3行 */
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* 时间标签样式 */
    .news-list .time {
        color: #6B3AA0;
        font-weight: 600;
        font-size: 0.8rem;
        text-align: right;
        align-self: flex-end;
        background: #F3EDFA;
        padding: 4px 10px;
        border-radius: 16px;
        white-space: nowrap;
        border: 1px solid rgba(107, 58, 160, 0.2);
        margin-top: auto;
    }
    
    /* 新闻标题区域 */
    .index-title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 24px;
        padding: 0 4px;
    }
    
    .index-title h3 {
        font-size: 1.4rem;
        color: #212529;
        margin: 0;
        font-weight: 600;
    }
    
    .index-title .more {
        font-size: 0.875rem;
        color: #6B3AA0;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.2s ease;
    }
    
    .index-title .more:hover {
        color: #5A2E8A;
    }
}

/* 超小屏幕优化 (480px以下) */
@media screen and (max-width: 480px) {
    
    /* 调整间距和字体大小 */
    .news-list .news-content {
        padding: 14px 16px;
        min-height: 90px;
        gap: 10px;
    }
    
    .news-list .text h4 {
        font-size: 1rem;
        line-height: 1.3;
        -webkit-line-clamp: 2;
    }
    
    .news-list .text p {
        font-size: 0.8rem;
        line-height: 1.4;
        -webkit-line-clamp: 2;
    }
    
    .news-list .time {
        font-size: 0.75rem;
        padding: 3px 8px;
        border-radius: 12px;
    }
    
    .index-title h3 {
        font-size: 1.25rem;
    }
    
    .index-title .more {
        font-size: 0.8rem;
    }
}

/* 动画效果 */
@media screen and (max-width: 768px) {
    .news-list li.animate-in {
        opacity: 0;
        transform: translateY(20px);
        animation: slideInUp 0.6s ease-out forwards;
    }
    
    .news-list li:nth-child(1).animate-in { animation-delay: 0.1s; }
    .news-list li:nth-child(2).animate-in { animation-delay: 0.2s; }
    .news-list li:nth-child(3).animate-in { animation-delay: 0.3s; }
    .news-list li:nth-child(4).animate-in { animation-delay: 0.4s; }
    
    @keyframes slideInUp {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* 确保在所有移动设备上正确显示 */
@media screen and (max-width: 768px) {
    /* 覆盖可能的桌面端样式 */
    .news-list a {
        display: block !important;
        color: inherit !important;
        text-decoration: none !important;
    }
    
    /* 确保点击区域足够大 */
    .news-list li {
        min-height: 44px;
    }
    
    /* 优化触摸反馈 */
    .news-list li:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .news-featured:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
} 