/* =============================================================
   Porton Newsroom — 新闻列表页样式
   仅包含「中间内容区」（标题 / 分类胶囊 / 子分类 / 工具栏 / 列表 / 加载更多）
   已剔除站点页头 header 与页脚 footer 的全部样式

   作用域：.porton-newsroom
   —— 所有选择器都挂在该根类下，不会影响站点其它区域
   ============================================================= */

/* ---------- 根容器（取代原 mockup 的 body + .main-wrapper） ---------- */
.porton-newsroom {
    --porton-blue: #004ea2;
    --porton-orange: #f39700;
    --porton-orange-hover: #d98500;
    --porton-nav-pill: linear-gradient(90deg, #0066ff 0%, #3399ff 100%);
    --porton-blue-light: #eef5fc;
    --porton-blue-subtle: #f4f8fd;
    --text-black: #000000;
    --text-main: #111827;
    --text-muted: #4b5563;
    --text-light: #6b7280;
    --bg-canvas: #ffffff;
    --bg-subtle: #f9fafb;
    --border-color: #e5e7eb;
    --border-hover: #cbd5e1;

    display: flex;
    justify-content: center;
    width: 100%;
    /* 上 50 / 下 100：分页与页脚之间留足呼吸，避免贴着 footer */
    padding: 50px 32px 100px;
    background-color: #ffffff;
    font-family: "Roboto", "PingFang SC", "Microsoft YaHei", -apple-system,
        BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-main);
    -webkit-tap-highlight-color: transparent;
}

/* ---------- 局部 reset（只作用于组件内部） ---------- */
.porton-newsroom,
.porton-newsroom * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-weight: normal !important;
}

/* ---------- 内容容器 ---------- */
.porton-newsroom .news-page-container {
    width: 100%;
    max-width: 1280px;
    padding: 0;
    background-color: #ffffff;
}

/* ---------- 页面标题 ---------- */
.porton-newsroom .page-header {
    margin-bottom: 28px;
}

.porton-newsroom .page-title {
    font-size: 36px;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: var(--text-black);
}

/* ---------- 分类胶囊（一级） ---------- */
.porton-newsroom .nav-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 28px;
}

.porton-newsroom .scroll-wrapper {
    width: 100%;
    padding: 4px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.porton-newsroom .scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.porton-newsroom .primary-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    white-space: nowrap;
}

.porton-newsroom .primary-pill {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    font-size: 15px;
    color: var(--text-muted);
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.porton-newsroom .primary-pill:hover:not(.active):not(.on) {
    color: var(--porton-blue);
    background-color: var(--porton-blue-light);
    border-color: var(--porton-blue);
}

/* active = JS/静态页用；on = 站点模板原有的选中类名，两者都认 */
.porton-newsroom .primary-pill.active,
.porton-newsroom .primary-pill.on {
    color: #ffffff !important;
    background-color: var(--porton-blue);
    border-color: var(--porton-blue);
}

/* ---------- 子分类胶囊（二级） ---------- */
.porton-newsroom .sub-nav-container {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding-left: 2px;
}

.porton-newsroom .sub-nav-group {
    display: none;
    align-items: center;
    gap: 8px;
    padding-right: 20px;
    white-space: nowrap;
}

.porton-newsroom .sub-nav-group.active {
    display: inline-flex;
}

.porton-newsroom .sub-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 18px;
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.porton-newsroom .sub-pill:hover:not(.active):not(.on) {
    color: var(--porton-blue);
    background-color: var(--porton-blue-subtle);
    border-color: var(--porton-blue);
}

/* active = JS/静态页用；on = 站点模板原有的选中类名，两者都认 */
.porton-newsroom .sub-pill.active,
.porton-newsroom .sub-pill.on {
    color: var(--porton-blue) !important;
    background-color: var(--porton-blue-light);
    border-color: var(--porton-blue);
}

/* ---------- 工具栏（结果计数 + 年份筛选） ---------- */
.porton-newsroom .list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 4px;
}

.porton-newsroom .result-counter {
    font-size: 14.5px;
    color: var(--text-light);
}

.porton-newsroom .year-filter-select {
    padding: 7px 32px 7px 18px;
    font-size: 14px;
    color: var(--text-main);
    background-color: #ffffff;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234B5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 15px;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.porton-newsroom .year-filter-select:hover {
    border-color: var(--porton-blue);
}

/* ---------- 列表 ---------- */
.porton-newsroom .news-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 200px;
}

@keyframes portonFadeInSlide {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.porton-newsroom .news-item {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    padding: 24px;
    color: inherit;
    text-decoration: none;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    animation: portonFadeInSlide 0.25s ease forwards;
}

.porton-newsroom .news-item:hover {
    border-color: var(--border-hover);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.porton-newsroom .news-item:hover .news-title {
    color: var(--porton-blue);
}

/* JS 筛选后隐藏的项目 */
.porton-newsroom .news-item.is-hidden {
    display: none;
}

.porton-newsroom .news-thumb-wrapper {
    flex-shrink: 0;
    width: 200px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #ebf1f7;
    border-radius: 10px;
}

.porton-newsroom .news-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.porton-newsroom .news-item:hover .news-thumb {
    transform: scale(1.03);
}

.porton-newsroom .news-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.porton-newsroom .news-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 13.5px;
}

.porton-newsroom .news-tag {
    padding: 3px 12px;
    font-size: 12px;
    line-height: 1.2;
    color: var(--porton-blue);
    white-space: nowrap;
    background-color: var(--porton-blue-light);
    border-radius: 9999px;
}

.porton-newsroom .news-date {
    color: var(--text-light);
    white-space: nowrap;
}

.porton-newsroom .news-title {
    display: -webkit-box;
    margin-bottom: 10px;
    overflow: hidden;
    font-size: 20px;
    line-height: 1.4;
    letter-spacing: -0.2px;
    color: var(--text-main);
    transition: color 0.2s ease;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.porton-newsroom .news-summary {
    display: -webkit-box;
    overflow: hidden;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--text-muted);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ---------- 加载更多 ---------- */
.porton-newsroom .load-more-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 44px;
}

.porton-newsroom .btn-load-more {
    padding: 12px 38px;
    font-size: 15px;
    color: var(--porton-blue);
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.porton-newsroom .btn-load-more:hover:not(:disabled) {
    background-color: var(--porton-blue-light);
    border-color: var(--porton-blue);
}

.porton-newsroom .btn-load-more:disabled {
    color: var(--text-light);
    background-color: #f3f4f6;
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------- 分页（站点沿用 .new2page > .pagination 结构） ---------- */
.porton-newsroom .new2page {
    margin: 44px 0;
}

/* =============================================================
   响应式
   ============================================================= */
@media (max-width: 768px) {
    .porton-newsroom {
        padding: 24px 16px 60px;
    }

    .porton-newsroom .page-header {
        margin-bottom: 18px;
    }

    .porton-newsroom .page-title {
        font-size: 24px;
        line-height: 1.28;
        letter-spacing: -0.3px;
    }

    .porton-newsroom .nav-section {
        gap: 8px;
        margin-bottom: 20px;
    }

    .porton-newsroom .sub-nav-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .porton-newsroom .primary-nav {
        justify-content: flex-start;
        overflow-x: auto;
    }

    .porton-newsroom .primary-pill {
        flex: 0 0 auto;
        padding: 7px 16px;
        font-size: 14px;
    }

    .porton-newsroom .sub-pill {
        padding: 5px 13px;
        font-size: 12.5px;
    }

    .porton-newsroom .news-list {
        gap: 16px;
    }

    .porton-newsroom .news-item {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 16px;
        border-radius: 12px;
    }

    .porton-newsroom .news-thumb-wrapper {
        width: 100%;
        aspect-ratio: 16 / 9;
        border-radius: 8px;
    }

    .porton-newsroom .news-meta {
        gap: 8px;
        margin-bottom: 6px;
        font-size: 12px;
    }

    .porton-newsroom .news-tag {
        padding: 2px 8px;
        font-size: 11.5px;
    }

    .porton-newsroom .news-date {
        font-size: 11.5px;
    }

    .porton-newsroom .news-title {
        display: block;
        margin-bottom: 8px;
        overflow: visible;
        font-size: 17px;
        line-height: 1.4;
        -webkit-line-clamp: unset;
    }

    .porton-newsroom .news-summary {
        display: -webkit-box;
        overflow: hidden;
        font-size: 14px;
        line-height: 1.55;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }

    .porton-newsroom .load-more-wrapper {
        margin-top: 28px;
    }
    
    .porton-newsroom .new2page{
        margin: 20px 0;
    }
}
