/* 资讯页面样式 */
.news-header {
    text-align: center;
    padding: 3rem 0 2rem;
}

.news-header h2 {
    font-size: 2.5rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.news-header p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

/* 分类筛选 */
.news-category-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.category-btn {
    background: #f5f5f5;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.category-btn:hover {
    background: #eee;
}

.category-btn.active {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

/* 新闻列表 */
.news-container {
    margin-bottom: 3rem;
}

.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 0 auto;
}

.news-card {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.news-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid #f0f0f0;
}

.news-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-card-category {
    display: inline-block;
    background-color: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 1rem;
    margin-bottom: 0.8rem;
}

.news-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.news-card-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.news-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.news-card-date {
    font-size: 0.8rem;
    color: #999;
}

.news-card-price {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
}

/* 阅读按钮 */
.read-btn {
    display: block;
    width: 100%;
    padding: 0.8rem 0;
    margin-top: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    border-radius: 0.5rem;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.read-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--primary-color-rgb), 0.3);
}

/* 支付弹窗样式 */
.pay-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    overflow: auto;
    justify-content: center;
    align-items: center;
}

.pay-modal.show {
    display: flex;
}

.pay-modal-content {
    background-color: white;
    margin: auto;
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.8rem;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--primary-color);
}

.pay-modal h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.news-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.qr-code-container {
    margin: 1.5rem auto;
    width: 200px;
    height: 200px;
}

.qr-code-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 1px solid #eee;
    padding: 0.5rem;
}

.price-info {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1rem 0;
    color: var(--primary-color);
}

.pay-tips {
    font-size: 0.9rem;
    color: #888;
    margin-top: 1rem;
}

/* 分页 */
.news-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    gap: 1rem;
}

.page-btn {
    background: #f5f5f5;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.page-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    font-size: 0.9rem;
    font-weight: 500;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 3rem 0;
    width: 100%;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading p {
    margin-top: 1rem;
    color: #666;
}

/* 错误提示 */
.error-message {
    text-align: center;
    padding: 2rem;
    color: #ff4d4f;
    background-color: #fff1f0;
    border-radius: 0.5rem;
    margin: 2rem 0;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .news-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .news-header h2 {
        font-size: 2rem;
    }
    
    .news-card-img {
        height: 150px;
    }
    
    .news-card-content {
        padding: 1rem;
    }
    
    .news-card-title {
        font-size: 1.1rem;
    }
    
    .category-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .news-list {
        grid-template-columns: 1fr;
    }
}

/* 新增主题色RGB变量供背景透明度使用 */
:root {
    --primary-color-rgb: 255, 77, 79;
} 