:root {
    --p-blue: #063f44;
    --p-green: #158791;
    --white-100: #ffffff;
    --white-80: rgba(255, 255, 255, 0.8);
    --news-title: #595959;
    --news-summary: #707070;
    --placeholder-bg: #f0f4f4;
    --bezier-smooth: cubic-bezier(0.4, 0, 0.2, 1);

    --news-title-size: clamp(0.9rem, 1.8vw, 1.25rem);
    --news-summary-size: clamp(0.75rem, 0.9vw, 0.9rem);
    --tag-font-size: clamp(0.65rem, 1.2vw, 0.8rem);
    --card-padding: clamp(1rem, 3vw, 2rem);
}

@media (min-width: 2000px) {
    :root {
        font-size: clamp(16px, 0.8vw + 14px, 20px);
    }
}

body#detail-page-context {
    background-color: #f8fcfc;
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ================================================================
   统一容器：上方导航和筛选栏使用与新闻列表相同的左内边距
   ================================================================ */
.detail-container {
    width: 92%;
    max-width: 110rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
    position: relative;
}

/* 新闻列表保持原有的左右内边距，绝对不动！ */
.news-list-main {
    width: 92%;
    max-width: clamp(1100px, 92vw, 3200px);
    margin: 0 auto;
    padding: 4rem 1.5rem 8rem 1.5rem;
    box-sizing: border-box;
}

.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 3vw, 4rem);
    max-width: 100%;
    margin: 0;
}

@media screen and (min-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .news-content {
        padding: 1.5rem;
    }
    .news-title-text {
        font-size: 1.1rem;
    }
}

/* --- [1] Hero Section --- */
#detail-page-context .hero-section {
    min-height: 20rem;
    background-color: #05191b;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

#detail-page-context .hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    filter: brightness(0.75);
}

#detail-page-context .hero-inner {
    position: relative;      /* 关键：保证子元素在层叠上下文中 */
    z-index: 10;             /* 关键：确保在背景图之上 */
    width: 92% !important;
    max-width: 110rem !important;
    padding: 0 1.5rem !important;
    margin: 0 auto !important;
}

#detail-page-context .hero-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* ========== 关键：导航文字左内边距归零，让容器的 padding 生效 ========== */
#detail-page-context .hero-breadcrumb {
    font-size: clamp(0.95rem, 1.2vw, 1.5rem);
    color: rgba(255, 255, 255, 0.5);
    margin-left: 0 !important;
    padding-left: 0 !important;

}

#detail-page-context .hero-breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

#detail-page-context .hero-breadcrumb .current {
    color: var(--p-green);
    font-weight: 600;
}

#detail-page-context .lang-switcher-wrap {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0 1.2rem;
    height: 2.4rem;
    border-radius: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#detail-page-context .lang-btn {
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 300;
}

#detail-page-context .lang-btn.active {
    color: #fff;
}

#detail-page-context .hero-title {
    font-size: clamp(2.2rem, 2.5vw, 6.5rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    margin: 0;
}

/* --- [2] 筛选吸顶栏 --- */
.filter-sticky-bar {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(15px);
    overflow: hidden;
}

.filter-sticky-bar .detail-container {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.8rem;
    scrollbar-width: none;
    padding: 0 1.5rem;   /* 与新闻列表完全一致 */
    width: 92%;
    max-width: 110rem;
    margin: 0 auto;
    box-sizing: border-box;
}

.filter-sticky-bar .detail-container::-webkit-scrollbar {
    display: none;
}

/* ========== 关键：第一个筛选按钮左内边距归零，让容器的 padding 生效 ========== */
.filter-sticky-bar .filter-btn:first-child {
    margin-left: 0 !important;
}

.filter-sticky-bar::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.6) 40%,
            rgba(255, 255, 255, 0.98) 100%);
    pointer-events: none;
    z-index: 10;
}

.filter-sticky-bar.hide-right-mask::after {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.8rem;
    flex: 0 0 auto;
}

.filter-btn {
    flex: 0 0 auto;
    background: #e9eeee;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: normal;
    color: var(--p-blue);
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap;
}

.filter-btn.active {
    background: var(--p-green);
    color: #fff;
}

.search-wrapper {
    position: relative;
    flex: 0 0 auto;
    width: 260px;
    margin-left: 0.5rem;
}

#news-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 1rem 0.5rem 2.2rem;
    border: 1px solid #e1e8e8;
    border-radius: 2rem;
    background: #f5f8f8;
    font-size: 0.9rem;
    color: var(--p-blue);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.4;
    font-size: 0.85rem;
}

/* --- [3] 新闻卡片设计（没动任何东西） --- */
.news-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(6, 63, 68, 0.06);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.4s var(--bezier-smooth), box-shadow 0.4s var(--bezier-smooth);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(6, 63, 68, 0.1);
}

.news-img-box::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, transparent 100%);
    z-index: 2;
    opacity: 0.8;
    transition: opacity 0.4s var(--bezier-smooth);
}

.news-card:hover .news-img-box::before {
    opacity: 1;
}

.news-card:hover .news-img-box img {
    transform: scale(1.08) rotate(1deg);
}

.news-img-box {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: var(--placeholder-bg);
}

.news-img-box img {
    opacity: 0;
    transform: scale(1.02);
    object-fit: cover;
    object-position: center;
    width: 100%;
    height: 100%;
    transition: opacity 0.8s var(--bezier-smooth),
                transform 0.8s var(--bezier-smooth);
    will-change: opacity, transform;
}

.news-img-box img.loaded {
    opacity: 1 !important;
    transform: scale(1) !important;
}

.news-img-box:not(:has(img.loaded))::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: img-shimmer 1.5s infinite;
}

@keyframes img-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.news-tags {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    z-index: 10;
}

.tag-capsule {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: var(--p-blue);
    color: #fff;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-size: var(--tag-font-size);
    font-weight: 300;
    line-height: 1;
}

.news-date-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(6, 63, 68, 0.9);
    color: #fff;
    padding: 0.6rem 1.2rem;
    font-size: calc(var(--tag-font-size) * 1.1);
    font-weight: 300;
    z-index: 10;
    border-top-left-radius: 8px;
}

.news-content {
    padding: var(--card-padding);
    flex: 1;
    text-align: left;
}

.news-title-text {
    font-size: var(--news-title-size);
    font-weight: 500;
    color: var(--news-title);
    line-height: 1.4;
    letter-spacing: 0.02em;
    margin: 0;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s var(--bezier-smooth);
}

.news-news-summary {
    font-size: var(--news-summary-size, 0.85rem);
    font-weight: 400;
    color: var(--news-summary);
    line-height: 1.6;
    margin-top: 6px;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card:hover .news-title-text {
    color: var(--p-green);
}

/* --- [4] 桌面大屏搜索框靠右 --- */
@media (min-width: 1200px) {
    .filter-sticky-bar .detail-container {
        justify-content: space-between;
        overflow-x: visible;
    }

    .search-wrapper {
        margin-left: auto;
        flex-shrink: 0;
    }
}

/* ==========================================================================
   5. 分辨率适配 - 标准分辨率档位
   ========================================================================== */

@media screen and (min-width: 1201px) and (max-width: 1599px) {
    .detail-container,
    .filter-sticky-bar .detail-container,
    #detail-page-context .hero-inner {
        width: 92% !important;
        max-width: 110rem !important;
        padding: 0 1.5rem !important;
        margin: 0 auto !important;
    }

    .news-list-main {
        width: 92% !important;
        max-width: 110rem !important;
        margin: 0 auto !important;
    }
}

@media screen and (min-width: 1600px) and (max-width: 2239px) {
    .detail-container,
    .filter-sticky-bar .detail-container,
    #detail-page-context .hero-inner {
        width: 92% !important;
        max-width: 110rem !important;
        padding: 0 1.5rem !important;
        margin: 0 auto !important;
    }

    .news-list-main {
        width: 92% !important;
        max-width: 110rem !important;
        margin: 0 auto !important;
    }
}

@media screen and (min-width: 2240px) and (max-width: 3199px) {
    .detail-container,
    .filter-sticky-bar .detail-container,
    #detail-page-context .hero-inner {
        width: 90% !important;
        max-width: clamp(110rem, 88vw, 140rem) !important;
        padding: 0 1.5rem !important;
        margin: 0 auto !important;
    }

    .news-list-main {
        width: 90% !important;
        max-width: clamp(110rem, 88vw, 140rem) !important;
        margin: 0 auto !important;
    }

    .filter-btn {
        font-size: 1rem !important;
        padding: 0.7rem 1.5rem !important;
    }

    #news-search-input {
        font-size: 1.05rem !important;
        padding: 0.6rem 1.2rem 0.6rem 2.5rem !important;
    }

    .search-icon {
        font-size: 1rem !important;
        left: 1rem !important;
    }

    #detail-page-context .lang-btn {
        font-size: 1rem !important;
    }

    #detail-page-context .hero-breadcrumb {
        font-size: 1.1rem !important;
    }

    .search-wrapper {
        width: 320px !important;
    }
}

@media screen and (min-width: 3200px) {
    .detail-container,
    .filter-sticky-bar .detail-container,
    #detail-page-context .hero-inner {
        width: 88% !important;
        max-width: clamp(140rem, 82vw, 200rem) !important;
        padding: 0 1.5rem !important;
        margin: 0 auto !important;
    }

    .news-list-main {
        width: 88% !important;
        max-width: clamp(140rem, 82vw, 200rem) !important;
        margin: 0 auto !important;
    }

    .filter-btn {
        font-size: 1.2rem !important;
        padding: 0.8rem 1.8rem !important;
    }

    #news-search-input {
        font-size: 1.2rem !important;
        padding: 0.7rem 1.5rem 0.7rem 3rem !important;
    }

    .search-icon {
        font-size: 1.2rem !important;
        left: 1.2rem !important;
    }

    #detail-page-context .lang-btn {
        font-size: 1.15rem !important;
    }

    #detail-page-context .hero-breadcrumb {
        font-size: 1.3rem !important;
    }

    .search-wrapper {
        width: 400px !important;
    }

    .filter-sticky-bar .detail-container {
        gap: 1.2rem !important;
    }
}

/* ==========================================================================
   6. 平板 & 移动端适配
   ========================================================================== */

@media (max-width: 1024px) {
    .filter-sticky-bar .detail-container {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
        gap: 0.8rem;
        justify-content: space-between;
    }

    .filter-sticky-bar {
        padding: 0.6rem 0;
    }

    #detail-page-context .hero-section {
        min-height: 15rem;
    }

    .search-wrapper {
        width: 180px;
        flex-shrink: 0;
    }
}

@media screen and (max-height: 500px) and (orientation: landscape) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .news-list-main {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

#scroll-sentinel {
    height: 50px;
    clear: both;
    margin-top: 20px;
}

.hero-bg {
    opacity: 0;
    transition: opacity 1.2s ease, transform 1.2s ease;
    transform: scale(1.05);
    background-size: cover;
    background-position: center;
}

.hero-bg.loaded {
    opacity: 1;
    transform: scale(1);
}

/* 默认隐藏状态（通过 class 控制） */
.news-card {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    will-change: transform, opacity;
}

/* 激活淡入状态 */
.news-card.animating {
    opacity: 1;
    transform: translateY(0);
}