/* ========== 卡片层：列表卡片 / 网格卡片 / 最新报道 / 时间轴 / 分页 ========== */

/* ---------- 布局 A：网格卡片（默认） ---------- */
#cardList[data-layout="grid"] {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

/* ---------- 布局 B：时间轴（按年份分组的网格） ---------- */
#cardList[data-layout="timeline"] {
    display: block;
    position: relative;
    padding: 0 0 0 60px;
    margin-bottom: 40px;
}

#cardList[data-layout="timeline"]::before {
    content: "";
    position: absolute;
    left: 20px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: #e2e8f0;
}

/* ---------- 布局 C：列表卡片（招标信息等长文条目） ---------- */
#cardList[data-layout="list"] {
    display: block;
    padding: 24px 40px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 3px 16px rgba(0, 0, 0, 0.12);
}

/* ========== 网格卡片 ========== */
.grid-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--line-light);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all 0.25s ease;
}

.grid-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card-hover);
}

.card-thumb-wrap {
    position: relative;
    flex-shrink: 0;
}

.card-thumb {
    width: 100%;
    height: 210px;
    object-fit: cover;
    display: block;
    background-color: #eee;
}

.card-body {
    flex: 1;
    padding: 20px;
}

.grid-card .card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--brand);
    margin: 0 0 8px;
    line-height: 1.45;
}

.grid-card .card-title a {
    color: inherit;
    text-decoration: none;
}

.grid-card .card-title a:hover {
    color: var(--brand-dark);
}

.grid-card .card-date {
    font-size: 14px;
    color: var(--muted-light);
    margin: 0 0 12px;
}

.grid-card .card-desc {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
}

/* ========== 最新报道（页面顶部大横幅） ========== */
.news-hero {
    grid-column: 1 / -1;
    height: 100%;
    display: flex;
    border-radius: 14px;
    overflow: hidden;
    background: #f5f6f8;
    box-shadow: var(--shadow-card);
    margin-bottom: 28px;
    transition: all 0.25s ease;
}

/* 与网格卡片一致的悬浮效果：上浮 5px + 阴影加深 */
.news-hero:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card-hover);
}

.news-hero-img {
    width: 55%;
}

.news-hero-img img {
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
    display: block;
}

.news-hero-body {
    width: 45%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 56px;
}

.news-hero-title {
    font-size: 28px;
    font-weight: 700;
    color: #111;
    line-height: 1.5;
    margin: 0 0 18px;
}

.news-hero-desc {
    display: -webkit-box;
    margin: 0 0 18px;
    overflow: hidden;
    color: #555;
    font-size: 16px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.news-hero-date {
    font-size: 14px;
    color: #999;
}

/* ========== 时间轴分组 ========== */
.timeline-year-group {
    position: relative;
    margin-bottom: 48px;
}

.timeline-year-group:last-child {
    margin-bottom: 0;
}

.timeline-year-group::before {
    content: "";
    position: absolute;
    left: -47px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--brand);
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px rgba(0, 173, 181, 0.12);
    z-index: 2;
}

.year-label {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.year-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}

/* 荣誉专利时间轴卡片：整体加高 50px —— 图片 +40px，文字区（上下内边距各 +5px）+10px */
.year-card-grid .card-thumb {
    height: 230px;
}

.year-card-grid .card-body {
    padding: 25px 20px;
}

/* ========== 列表卡片 ========== */
.award-card {
    width: 100%;
    display: flex;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 30px 0;
    gap: 40px;
}

.card-img-wrap {
    width: 25%;
}

.card-img-wrap img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 5px;
}

.card-text-wrap {
    width: 75%;
}

.award-card .card-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-strong);
    margin: 20px 0 35px;
    line-height: 1.3;
}

.award-card .card-title a {
    color: inherit;
    text-decoration: none;
}

.award-card .card-title a:hover {
    color: var(--brand);
}

.award-card .card-date {
    font-size: 15px;
    color: var(--muted);
    margin-bottom: 15px;
}

.award-card .card-field {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

/* ========== 分页组件（上一页 / 页码 / 下一页） ========== */
.pagination .page-btn {
    padding: 8px 16px;
    border: 1px solid #dce4f0;
    background: #fff;
    border-radius: 4px;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    line-height: 1.4;
    font-family: inherit;
}

.pagination .page-btn:hover:not(:disabled) {
    border-color: var(--brand);
    color: var(--brand);
}

.pagination .page-btn.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.pagination .page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========== 整卡跳转链接包裹层（数据项含 link 字段时生效） ========== */
a.card-link-wrap {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

a.hero-link-wrap {
    grid-column: 1 / -1;
}

/* ========== 加载 / 空数据 / 错误提示 ========== */
#cardList.card-tip {
    display: block;
    padding: 40px 20px;
    text-align: center;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    color: var(--muted-light);
    font-size: 15px;
}

/* ========== 固定高度网格（新闻动态 / 技术分享，带"最新报道"横幅的页面） ========== */
/* 统一用变量控制，横幅与卡片保持同一高度，改一处即可 */
#cardList.fixed-grid {
    --card-h: 350px;
}

#cardList.fixed-grid .grid-card {
    height: var(--card-h);
}

/* 最新报道必须给定确定高度，否则图片会按原始尺寸（1728x2160）撑开整行 */
#cardList.fixed-grid .news-hero {
    height: var(--card-h);
}

#cardList.fixed-grid .card-thumb {
    height: 180px;
}

#cardList.fixed-grid .card-body {
    padding: 18px 20px;
    overflow: hidden;
}

#cardList.fixed-grid .card-title,
#cardList.fixed-grid .card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 平板适配 ========== */
@media screen and (max-width: 1200px) {
    #cardList[data-layout="grid"] {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media screen and (max-width: 992px) {
    #cardList[data-layout="grid"] {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }
    .year-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }
    .award-card {
        flex-direction: column;
        gap: 24px;
    }
    .card-img-wrap,
    .card-text-wrap {
        width: 100%;
    }
    .award-card .card-title {
        font-size: 22px;
        margin: 0 0 20px;
    }
    .news-hero-body {
        padding: 32px 32px;
    }
    .news-hero-title {
        font-size: 24px;
    }
}

/* ========== 手机适配 ========== */
@media screen and (max-width: 768px) {
    #cardList[data-layout="grid"] {
        grid-template-columns: 1fr;
    }
    .grid-card,
    #cardList.fixed-grid .news-hero,
    .news-hero {
        height: auto;
    }
    .card-thumb {
        height: 190px;
    }
    .pagination .page-btn {
        padding: 6px 12px;
        font-size: 14px;
    }

    /* 最新报道改为上下堆叠 */
    .news-hero {
        flex-direction: column;
    }
    .news-hero-img {
        width: 100%;
    }
    .news-hero-img img {
        min-height: 0;
        height: 220px;
    }
    .news-hero-body {
        width: 100%;
        padding: 24px;
    }
    .news-hero-title {
        font-size: 20px;
    }
    .news-hero-desc {
        display: block;
        overflow: visible;
    }

    /* 时间轴缩进收窄 */
    #cardList[data-layout="timeline"] {
        padding-left: 40px;
    }
    #cardList[data-layout="timeline"]::before {
        left: 12px;
    }
    .timeline-year-group::before {
        left: -33px;
        width: 12px;
        height: 12px;
    }
    .year-label {
        font-size: 18px;
        margin-bottom: 16px;
    }
    .year-card-grid {
        grid-template-columns: 1fr;
    }

    /* 列表卡片 */
    #cardList[data-layout="list"] {
        padding: 18px 16px;
    }
    .award-card {
        padding: 20px 0;
    }
    .award-card .card-title {
        font-size: 20px;
    }

    /* 新闻页固定高度恢复为自适应 */
    #cardList.fixed-grid .grid-card {
        height: auto;
    }
    #cardList.fixed-grid .card-thumb {
        height: 190px;
    }
    #cardList.fixed-grid .card-title,
    #cardList.fixed-grid .card-desc {
        display: block;
        overflow: visible;
    }
}

/* ========== 带筛选侧栏的内容布局（新闻动态） ========== */
/* 外层占满整行，中间列严格等于 --wrap，与导航栏/其它页面内容区完全同宽；
   筛选面板放在中间列右侧的空白区，不占用、不挤压卡片宽度 */
.main-wrap.media-layout {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr var(--wrap) 1fr;
    align-items: start;
}

.media-main {
    grid-column: 2;
    min-width: 0;
}

/* ---------- 筛选面板 ---------- */
.filter-panel {
    grid-column: 3;
    /* 靠内容区一侧对齐，最宽 300px，右侧至少留 24px 余量 */
    width: min(calc(100% - 24px), 300px);
    padding-left: 28px;
    position: sticky;
    top: 96px;
    font-size: 15px;
}

.filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.filter-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-strong);
    letter-spacing: 1px;
    line-height: 1.3;
}

.filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--muted);
    background: var(--bg-soft);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.filter-toggle:hover {
    color: #fff;
    background: var(--brand);
}

.filter-body[hidden] {
    display: none;
}

.filter-group {
    padding: 20px 0;
    border-bottom: 1px solid var(--line-light);
}

.filter-group[hidden] {
    display: none;
}

.filter-group-title {
    margin-bottom: 14px;
    font-size: 17px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chip {
    padding: 6px 14px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.filter-chip:hover {
    color: var(--brand);
    border-color: var(--brand);
}

.filter-chip[aria-pressed="true"] {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.filter-select-wrap {
    position: relative;
}

.filter-select-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 14px;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid var(--muted-light);
    border-bottom: 1.5px solid var(--muted-light);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.filter-select {
    width: 100%;
    padding: 9px 34px 9px 12px;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.filter-chip:focus-visible,
.filter-select:focus-visible,
.filter-clear:focus-visible,
.filter-toggle:focus-visible {
    outline: 2px solid rgba(0, 173, 181, 0.45);
    outline-offset: 1px;
}

.filter-clear {
    display: block;
    width: 100%;
    margin-top: 24px;
    padding: 11px 0;
    font-family: inherit;
    font-size: 15px;
    color: #333;
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.filter-clear:hover:not(:disabled) {
    color: var(--brand);
    border-color: var(--brand);
}

.filter-clear:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ========== 筛选布局的响应式适配 ========== */
/* 视口变窄后右侧空白已放不下侧栏：改为上下堆叠，内容区仍与其它页面同宽 */
@media screen and (max-width: 1200px) {
    .main-wrap.media-layout {
        width: var(--wrap);
        grid-template-columns: minmax(0, 1fr);
    }
    .media-main {
        grid-column: 1;
    }
    .filter-panel {
        grid-column: 1;
        width: 100%;
        padding-left: 0;
        position: static;
        order: -1;
        margin-bottom: 24px;
    }
    .filter-panel .filter-options {
        gap: 8px;
    }
}

@media screen and (max-width: 992px) {
    .filter-title {
        font-size: 22px;
    }
    .filter-group {
        padding: 16px 0;
    }
}
