﻿/* ----- 全局重置 & 基础 (与列表页一致) ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f5f7fa;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-container {
    max-width: 1000px;
    width: 100%;
    background: transparent;
}

/* ----- 返回链接 (风格延续) ----- */
.back-link {
    display: inline-block;
    margin-bottom: 24px;
    font-size: 0.95rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
    padding: 6px 0;
}

    .back-link:hover {
        color: #1d4ed8;
        text-decoration: underline;
    }

    .back-link::before {
        content: "← ";
    }

/* ----- 新闻卡片 (主容器) ----- */
.news-detail-card {
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    border: 1px solid #edf2f7;
    transition: box-shadow 0.2s;
}

/* ----- 轮播区 (上方) ----- */
.carousel-wrapper {
    position: relative;
    width: 100%;
    background: #eef2f6;
    overflow: hidden;
}

/* 主图容器 */
.carousel-main {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 比例 */
    background: #dce2ec;
    cursor: pointer;
    overflow: hidden;
}

    .carousel-main img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: opacity 0.4s ease;
        background: #dce2ec;
    }

/* 左右箭头 (PC & 触屏) */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.6rem;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    touch-action: manipulation;
    user-select: none;
}

    .carousel-btn:hover {
        background: rgba(0, 0, 0, 0.55);
    }

    .carousel-btn:active {
        transform: translateY(-50%) scale(0.94);
    }

    .carousel-btn.prev {
        left: 16px;
    }

    .carousel-btn.next {
        right: 16px;
    }

/* 缩略图导航 (轮播点增强) */
.carousel-thumbnails {
    display: flex;
    gap: 10px;
    padding: 14px 20px 20px;
    background: #ffffff;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    border-top: 1px solid #f0f4fa;
}

    .carousel-thumbnails::-webkit-scrollbar {
        height: 4px;
        background: #e9edf3;
    }

    .carousel-thumbnails::-webkit-scrollbar-thumb {
        background: #b9c4d4;
        border-radius: 20px;
    }

.thumb-item {
    flex: 0 0 80px;
    height: 56px;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border 0.2s, transform 0.15s;
    background: #dce2ec;
    position: relative;
    flex-shrink: 0;
}

    .thumb-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .thumb-item.active {
        border-color: #2563eb;
        transform: scale(0.96);
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
    }

    .thumb-item:hover {
        transform: scale(0.96);
        opacity: 0.9;
    }

/* ----- 文字内容 (下方) 与列表页一致 ----- */
.news-content {
    padding: 24px 28px 30px;
}

.news-title {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
    color: #0b1a33;
    margin-bottom: 12px;
}

.news-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    color: #64748b;
    font-size: 0.95rem;
    border-bottom: 1px solid #f0f4fa;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.news-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .news-date::before {
        content: "📅";
        font-size: 1rem;
        opacity: 0.7;
    }

.news-source {
    background: #f1f5f9;
    padding: 4px 16px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #334155;
}

/* 正文 */
.news-body {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #1e293b;
}

    .news-body p {
        margin-bottom: 1.2rem;
    }

        .news-body p:last-child {
            margin-bottom: 0;
        }

/* ----- 全屏遮罩 (点击图片放大) ----- */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 30px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s ease;
}

    .fullscreen-overlay.open {
        display: flex;
        opacity: 1;
    }

    .fullscreen-overlay img {
        max-width: 95%;
        max-height: 90%;
        object-fit: contain;
        border-radius: 12px;
        box-shadow: 0 20px 60px rgba(0,0,0,0.5);
        transition: transform 0.2s;
        background: #1e293b;
    }

    .fullscreen-overlay .close-hint {
        position: absolute;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%);
        color: rgba(255,255,255,0.5);
        font-size: 0.9rem;
        background: rgba(0,0,0,0.3);
        padding: 6px 18px;
        border-radius: 40px;
        backdrop-filter: blur(4px);
        pointer-events: none;
        letter-spacing: 0.3px;
    }

/* ----- 响应式适配 (与列表页一致) ----- */
@media (max-width: 640px) {
    .news-content {
        padding: 18px 16px 22px;
    }

    .news-title {
        font-size: 1.4rem;
    }

    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

        .carousel-btn.prev {
            left: 10px;
        }

        .carousel-btn.next {
            right: 10px;
        }

    .thumb-item {
        flex: 0 0 64px;
        height: 44px;
    }

    .carousel-thumbnails {
        padding: 10px 12px 14px;
        gap: 6px;
    }

    .fullscreen-overlay {
        padding: 12px;
    }

        .fullscreen-overlay img {
            max-width: 98%;
            max-height: 92%;
        }
}

@media (max-width: 420px) {
    .news-title {
        font-size: 1.2rem;
    }

    .news-body {
        font-size: 0.98rem;
    }

    .carousel-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

/* ===== 标签区域 (新增) ===== */
.news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f4fa;
}

    .news-tags .tag {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background: #eef2ff;
        color: #2563eb;
        font-size: 0.8rem;
        font-weight: 500;
        padding: 4px 14px 4px 12px;
        border-radius: 30px;
        border: 1px solid #dbe7fe;
        transition: background 0.15s, transform 0.1s;
        text-decoration: none;
    }

        .news-tags .tag:hover {
            background: #dbe7fe;
            transform: scale(0.96);
        }

        .news-tags .tag::before {
            content: "#";
            opacity: 0.7;
            font-weight: 400;
        }
        /* 不同分类可赋予不同颜色 (可选) */
        .news-tags .tag.sport {
            background: #fee2e2;
            color: #b91c1c;
            border-color: #fecaca;
        }

        .news-tags .tag.finance {
            background: #fef3c7;
            color: #92400e;
            border-color: #fde68a;
        }

        .news-tags .tag.car {
            background: #d1fae5;
            color: #065f46;
            border-color: #a7f3d0;
        }

        .news-tags .tag.scenery {
            background: #dbeafe;
            color: #1e40af;
            border-color: #bfdbfe;
        }

        .news-tags .tag.tech {
            background: #e0e7ff;
            color: #3730a3;
            border-color: #c7d2fe;
        }

/* 工具类 */
.hidden {
    display: none;
}

.footer-note {
    margin-top: 32px;
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
    width: 100%;
}
