/* ======================================================
   pages/news.css — 新闻页面样式（与 index 风格统一）
   ====================================================== */

/* ===== 动画 ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes newsSpin {
    to { transform: rotate(360deg); }
}

/* ===== 基础 ===== */
body.news-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #0f0c29 0%, #1a1a3e 25%, #f5f7fa 25%);
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding-bottom: 2rem;
}

.news-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

.hidden { display: none !important; }

/* ===== 背景装饰（与 index 一致的 3 个 orb） ===== */
.bg-decor {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 50%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.bg-decor .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: newsFloat 20s infinite ease-in-out;
}
.bg-decor .orb:nth-child(1) {
    width: 500px; height: 500px;
    background: rgba(233, 69, 96, 0.15);
    top: -200px; right: -150px;
}
.bg-decor .orb:nth-child(2) {
    width: 400px; height: 400px;
    background: rgba(83, 58, 253, 0.12);
    top: 50px; left: -100px;
    animation-delay: -7s;
}
.bg-decor .orb:nth-child(3) {
    width: 300px; height: 300px;
    background: rgba(59, 130, 246, 0.1);
    bottom: -100px; left: 50%;
    animation-delay: -12s;
}
@keyframes newsFloat {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
    33% { transform: translate(30px, -30px) scale(1.05); opacity: 0.3; }
    66% { transform: translate(-20px, 20px) scale(0.95); opacity: 0.5; }
}

/* ===== 头部 ===== */
.news-header {
    position: relative;
    text-align: center;
    padding: 2.5rem 0 1.5rem;
    animation: fadeInUp 0.6s ease;
}

.back-link {
    position: absolute;
    left: 0; top: 2.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s;
}
.back-link:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.page-title {
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: 2px;
    text-shadow: 0 2px 30px rgba(0,0,0,0.3);
}
.page-subtitle {
    color: rgba(255,255,255,0.65);
    font-size: 0.9rem;
    margin-top: 0.3rem;
    letter-spacing: 1px;
}

/* ===== 新闻卡片列表 ===== */
.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.news-card {
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.06);
    position: relative;
}

.news-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #e94560, #533afd);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
    border-color: rgba(233,69,96,0.15);
}
.news-card:hover::after {
    transform: scaleX(1);
}

/* 封面 */
.card-cover {
    width: 100%;
    min-height: 0;
    padding-top: 56.25%;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-color: #e8edf3;
    position: relative;
}
.card-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: linear-gradient(135deg, #f0f2f5, #e8edf3);
}

.card-body {
    flex: 1;
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 0.3rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-subtitle {
    font-size: 0.82rem;
    color: #777;
    margin: 0 0 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.card-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: #999;
}
.meta-source {
    font-weight: 600;
    color: #e94560;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.5rem;
    padding-bottom: 1rem;
    animation: fadeIn 0.6s ease;
}
.pg-btn {
    min-width: 36px;
    height: 36px;
    border: 1.5px solid #e0e4ea;
    border-radius: 10px;
    background: #fff;
    color: #555;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0 0.5rem;
}
.pg-btn:hover {
    border-color: #e94560;
    color: #e94560;
    background: rgba(233,69,96,0.05);
    transform: translateY(-1px);
}
.pg-btn-active {
    background: linear-gradient(135deg, #e94560, #c62828);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(233,69,96,0.3);
}
.pg-dots {
    color: #aaa;
    padding: 0 0.2rem;
}

/* ===== 文章详情 ===== */
.news-article {
    animation: fadeInUp 0.4s ease;
}

.article-wrap {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.06);
    margin:0 auto;
}

/* Hero 区域：封面图 + 标题叠加 */
.article-hero {
    position: relative;
    width: 100%;
    min-height: 320px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
}

.article-hero-noimg {
    min-height: 220px;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2b55 50%, #e94560 100%);
}

.article-hero-overlay {
    width: 100%;
    padding: 2rem 2rem 1.5rem;
    background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    color: #fff;
}

.article-hero-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 0.8rem;
}

.article-hero-meta .meta-item {
    white-space: nowrap;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-weight: 500;
}

.article-hero-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    margin: 0 0 0.4rem 0;
    line-height: 1.3;
}

.article-content {
    max-width:960px;
    margin:0 auto;
    padding: 1.5rem 2rem;
    font-size: 0.95rem;
    line-height: 1.85;
    color: #333;
}
.article-content img { max-width:100%; height:auto; border-radius:8px; }
.article-content table { max-width:100%; }
.article-content a {
    color: #e94560;
    text-decoration: underline;
}

/* 国内资讯（公众号文章）特殊处理：强制居中图片 */
.article-content.wx-content { overflow:hidden; }
.article-content.wx-content img {
    max-width:100% !important; height:auto !important; border-radius:8px;
    display:block !important; margin:0 auto !important; float:none !important;
}
.article-content.wx-content table {
    max-width:100%; margin:0 auto; display:table; float:none !important;
}
.article-content.bbs-content img {
    max-width:100%; height:auto; border-radius:8px;
}

/* 图片画廊 — 单列布局 */
.article-gallery {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1.5rem 1.5rem;
}
.gallery-item {
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f2f5;
    cursor: pointer;
}
.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    transition: opacity 0.2s;
}
.gallery-item img:hover {
    opacity: 0.92;
}

/* ===== 加载 & 空状态 ===== */
.loading-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 3rem 1rem;
    color: #999;
    font-size: 0.9rem;
}
.loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e0e4ea;
    border-top-color: #e94560;
    border-radius: 50%;
    animation: newsSpin 0.8s linear infinite;
}
.empty-msg {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
    font-size: 0.95rem;
}

/* ===== 跑马灯 (首页用，保留在此) ===== */
.marquee-section {
    margin-bottom: 1.2rem;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
    animation: fadeInUp 0.6s ease 0.05s both;
}
.marquee-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #f0f2f5;
}
.marquee-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #e94560;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.marquee-badge {
    background: linear-gradient(135deg, #e94560, #f96bee);
    color: #fff;
    font-size: 0.65rem;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}
.marquee-more {
    font-size: 0.78rem;
    color: #533afd;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.marquee-more:hover { color: #e94560; }

.marquee-body {
    height: 38px;
    overflow: hidden;
    position: relative;
}
.marquee-track {
    position: absolute;
    width: 100%;
    transition: top 0.5s ease;
}
.marquee-item {
    height: 38px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    font-size: 0.85rem;
    color: #444;
    gap: 0.5rem;
    cursor: default;
}
.marquee-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #e94560;
    flex-shrink: 0;
}
.marquee-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.marquee-date {
    color: #bbb;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    body.news-page {
        background: linear-gradient(180deg, #0f0c29 0%, #1a1a3e 22%, #f5f7fa 22%);
    }
    .news-container { padding: 0 1rem; }
    .news-header { padding: 2rem 0 1rem; }
    .page-title { font-size: 1.6rem; }
    .page-subtitle { font-size: 0.85rem; }
    .news-list { grid-template-columns: 1fr; gap: 16px; }
    .card-cover { width: 100%; min-height: 0; padding-top: 56.25%; }
    .card-body { padding: 0.8rem 1rem; }
    .card-title { font-size: 0.92rem; }
    .article-hero { min-height: 240px; }
    .article-hero-title { font-size: 1.2rem; }
    .article-hero-overlay { padding: 1.2rem; }
    .article-content { padding: 1rem 1.2rem; }
}

@media (max-width: 480px) {
    .news-container { padding: 0 0.75rem; }
    body.news-page {
        background: linear-gradient(180deg, #0f0c29 0%, #1a1a3e 20%, #f5f7fa 20%);
    }
    .news-header { padding: 2rem 0 1rem; }
    .page-title { font-size: 1.3rem; }
    .page-subtitle { font-size: 0.8rem; }
    .news-card { flex-direction: column; }
    .card-cover {
        width: 100%;
        min-height: 0;
        padding-top: 56.25%;
        max-height: none;
    }
    .card-body { padding: 0.8rem 1rem; }
    .card-meta { gap: 0.5rem; }
    .article-hero { min-height: 200px; }
    .article-hero-title { font-size: 1.1rem; }
    .article-hero-meta { gap: 0.5rem; }
    .back-link {
        position: relative;
        top: auto;
        left: auto;
        margin-bottom: 0.5rem;
    }
    .header-center { text-align: left; }
    .news-header { text-align: left; }
}

/* ===== 底部版权 ===== */
.news-footer {
    text-align: center;
    padding: 2rem 0 1rem;
    color: #aaa;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}
.news-footer a.footer-link {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.news-footer a.footer-link:hover {
    color: #3b82f6;
    text-decoration: underline;
}
.news-footer .footer-beian {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}
.news-footer .footer-beian a.footer-link {
    margin: 0 0.3rem;
}

/* 瀑布流加载 */
.feed-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: #999;
    font-size: 0.85rem;
}
.feed-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 1.5rem 1.5rem;
}

/* ===== 列表搜索框 ===== */
#listSearchInput:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* ===== 社交操作栏 ===== */
.article-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 1.5rem 0.5rem;
    flex-wrap: wrap;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: #fff;
    color: #555;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.action-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}
.action-btn.action-like.liked {
    background: #fff0f0;
    border-color: #ff6b6b;
    color: #e53935;
}
.action-btn.action-like.liked span {
    color: #e53935;
}
.action-btn:active {
    transform: scale(0.95);
}
.action-btn.action-original {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.83rem;
}
.action-btn.action-original:hover {
    background: #eff6ff;
    border-color: #3b82f6;
}

/* ===== 评论区 ===== */
.article-comments {
    padding: 0 1.5rem 1.5rem;
}
.comments-loading, .comments-empty {
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    padding: 1rem;
}
.comment-item {
    padding: 0.8rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.comment-item:last-child {
    border-bottom: none;
}
.comment-author {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.3rem;
}
.comment-date {
    font-weight: 400;
    color: #999;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}
.comment-body {
    font-size: 0.88rem;
    color: #444;
    line-height: 1.6;
}

/* ===== 评论表单 ===== */
.comment-form {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.comment-input, .comment-textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.comment-input:focus, .comment-textarea:focus {
    border-color: #3b82f6;
}
.comment-textarea {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}
.comment-submit {
    align-self: flex-end;
    padding: 0.5rem 1.2rem;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}
.comment-submit:hover {
    background: #2563eb;
}

@media (max-width: 480px) {
    .article-actions {
        padding: 0.8rem 1rem 0.3rem;
        gap: 0.5rem;
    }
    .action-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    .article-comments {
        padding: 0 1rem 1rem;
    }
}

/* ===== 图片查看器（Lightbox） ===== */
.image-viewer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.92);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.image-viewer-img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}
.image-viewer-close {
    position: fixed;
    top: 16px;
    right: 20px;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 100000;
    line-height: 1;
    font-family: Arial, sans-serif;
}
.image-viewer-close:hover {
    opacity: 1;
}
