/* 首页：轮播、栏目显现、首屏宣传图、新闻、党建/通知及栏目分页。 */

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform .65s cubic-bezier(.22, .68, 0, 1);
}

.carousel-slide {
    position: relative;
    display: block;
    flex: 0 0 100%;
    min-width: 0;
}

.will-reveal {
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity .6s ease, transform .6s ease;
}

.will-reveal.is-visible {
    opacity: 1;
    transform: none;
}

.hero {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1920 / 962;
    color: #fff;
    background: #b51c14;
}

.hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* PC 首屏按浏览器可视高度铺满；图片等比覆盖，超出的两侧在容器内裁切。 */
@media (min-width: 1101px) {
    .hero {
        height: 100vh;
        height: 100dvh;
        aspect-ratio: auto;
    }
}

/* 只在首页脚本就绪后启用：内容向上覆盖首屏，宣传图保持在后方。 */
.home-motion-ready {
    scroll-behavior: auto;
}

.home-motion-ready .hero {
    position: sticky;
    top: 0;
    z-index: 0;
    touch-action: pinch-zoom;
}

.home-motion-ready .news-section,
.home-motion-ready .party-section,
.home-motion-ready .committee-section,
.home-motion-ready .site-footer {
    position: relative;
    z-index: 1;
}

.home-motion-ready .news-section,
.home-motion-ready .committee-section {
    background: #fff;
}

.hero .carousel-track {
    transition: transform 1.5s ease;
}

.hero .carousel-track.is-resetting {
    transition: none;
}

.hero .carousel-slide {
    overflow: hidden;
}

.hero .is-active .hero__image {
    animation: hero-zoom-out 5s linear both;
}

@keyframes hero-zoom-out {
    from {
        transform: scale(1.1);
    }
    to {
        transform: scale(1);
    }
}

@media (max-width: 1100px) {
    .home-motion-ready .hero {
        top: 5rem;
    }
}

@media (max-width: 600px) {
    .home-motion-ready .hero {
        top: 4.5rem;
    }
    .hero .carousel-track {
        transition-duration: .65s;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero .is-active .hero__image {
        animation: none;
    }
}

.hero__controls {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero__arrow {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: clamp(3.125rem, 4.270833vw, 5.125rem);
    height: clamp(3.125rem, 4.270833vw, 5.125rem);
    padding: 0;
    color: #fff;
    background: transparent;
    border: 0;
    border-radius: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
}

.hero__arrow--prev {
    left: calc(3.125% - 1px);
}

.hero__arrow--next {
    right: calc(3.125% - 1px);
}

.hero__arrow img {
    width: 100%;
    height: 100%;
}

.hero__arrow--next img {
    transform: scaleX(-1);
}

.hero__counter {
    position: absolute;
    right: 6.25%;
    bottom: 5.2%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    line-height: 1.3;
    pointer-events: auto;
}

.hero__counter button {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 2rem;
    padding: 0;
    color: #fff;
    background: none;
    border: 0;
}

.hero__counter .icon {
    width: 0.75rem;
    height: 1rem;
}

.hero__counter button:disabled {
    opacity: .65;
}

.section-heading {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.875rem;
}

.section-heading h2 {
    display: flex;
    align-items: center;
    gap: 1.125rem;
    font-size: 1.625rem;
    font-weight: 600;
    line-height: 2.3125rem;
    min-width: 0;
    max-width: calc(100% - 8.125rem);
}

.section-heading__text {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-heading h2::after {
    width: 4.75rem;
    height: 1px;
    background: linear-gradient(90deg, #b9d9f4, transparent);
    content: "";
}

.section-heading--center {
    justify-content: center;
}

.section-heading--center h2::before {
    width: 4.75rem;
    height: 1px;
    background: linear-gradient(270deg, #b9d9f4, transparent);
    content: "";
}

.section-heading--center h2 {
    max-width: calc(100% - 17.5rem);
}

.section-heading--center .more-link {
    position: absolute;
    right: 0;
}

.more-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.625rem;
    color: var(--color-muted);
    font-size: 1rem;
    line-height: 1.375rem;
}

.more-link__icon {
    flex: 0 0 2.1875rem;
    width: 2.1875rem;
    height: 0.9375rem;
}

.more-link:hover {
    color: var(--color-blue);
}

.news-section {
    padding-block: 3.5rem 4.3125rem;
}

.news-layout {
    display: grid;
    grid-template-columns: minmax(0, 780fr) minmax(0, 420fr);
    align-items: stretch;
}

.news-feature {
    --news-caption-width: min(33rem, calc(100% - 5.875rem));
    position: relative;
    min-width: 0;
    overflow: hidden;
    background: #edf3f6;
}

.news-feature .carousel-track.is-resetting {
    transition: none;
}

.news-feature__image {
    width: 100%;
    aspect-ratio: 780 / 518;
    object-fit: cover;
}

.news-feature__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: var(--news-caption-width);
    height: 3.5rem;
    padding: 1rem 3.625rem;
    color: #fff;
    background: linear-gradient(90deg, #3794db 0%, #09b7a5 43.65%, #0263b5 100%);
    font-size: 1rem;
    line-height: 1.5rem;
}

.news-feature__caption span {
    display: -webkit-box;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.news-feature__controls {
    position: absolute;
    left: var(--news-caption-width);
    bottom: 0;
    display: flex;
    width: 5.875rem;
    height: 2.875rem;
}

.news-feature__controls button {
    display: grid;
    place-items: center;
    width: 2.9375rem;
    height: 2.875rem;
    padding: 0;
    color: var(--color-accent);
    background: #edf7ff;
    border: 0;
}

.news-feature__controls img {
    width: 0.875rem;
    height: 1.625rem;
}

.news-list {
    display: grid;
    grid-template-rows: repeat(5, minmax(0, 1fr));
    min-width: 0;
    padding: 1.3125rem 1.25rem;
    background: #edf6fd;
}

.news-list__link {
    position: relative;
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr) 5rem;
    align-items: center;
    gap: 0.625rem;
    height: 100%;
    min-height: 5.25rem;
    padding: 0.5rem 0.875rem;
    transition: color .2s ease, background .2s ease;
}

.news-list__link:hover,
.news-list__link:focus-visible {
    color: #fff;
    background: linear-gradient(90deg, #3794db 0%, #09b7a5 43.65%, #0263b5 100%);
    border-radius: 1.875rem 0 1.875rem 0;
}

.news-list li:not(:last-child) .news-list__link::after {
    position: absolute;
    right: 1.125rem;
    bottom: 0;
    left: 1.125rem;
    border-bottom: 1px dotted #d8e6ee;
    content: "";
}

.news-date {
    color: var(--color-blue);
    text-align: center;
}

.news-date__day {
    display: block;
    font-size: 1.375rem;
    line-height: 1.625rem;
}

.news-date__month {
    display: block;
    font-size: 0.75rem;
    line-height: 1rem;
    white-space: nowrap;
}

.news-list__link:hover .news-date,
.news-list__link:focus-visible .news-date {
    color: inherit;
}

.news-list__title {
    display: -webkit-box;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
    font-size: 1rem;
    line-height: 1.625rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-height: 2lh;
}

.news-list__thumb {
    width: 5rem;
    height: 3.75rem;
    object-fit: cover;
}

/* 党建工作 / 通知公告 */
.party-section {
    padding-block: 3.6875rem 5rem;
    background: var(--color-pale);
}

.party-layout {
    display: grid;
    grid-template-columns: minmax(0, 674fr) minmax(0, 472fr);
    gap: 3.375rem;
}

.party-content {
    display: grid;
    grid-template-columns: minmax(0, 382fr) minmax(0, 274fr);
    gap: 1.25rem;
}

.party-previews {
    min-width: 0;
}

.party-feature {
    display: block;
    min-width: 0;
    background: var(--brand-gradient);
}

.party-feature img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.party-feature__caption {
    display: block;
    min-height: 4.375rem;
    padding: 0.75rem 0.875rem;
    color: #fff;
    font-size: 1rem;
    line-height: 1.4375rem;
}

/* 行数限制放在无内边距的内层，避免第三行从卡片底部露出。 */
.party-feature__caption > span {
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-height: 2lh;
}

.party-list {
    display: grid;
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 1.125rem;
    min-width: 0;
}

.party-list a {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 0.875rem;
    background: #fff;
    transition: color .2s ease;
}

.party-list a:is(:hover, :focus-visible) {
    color: var(--color-blue);
}

/* 悬停与键盘聚焦均使用蓝湖的加粗标题，固定行高避免卡片跳动。 */
.news-list__link:is(:hover, :focus-visible) .news-list__title,
.news-feature a:is(:hover, :focus-visible) .news-feature__caption span,
.party-feature:is(:hover, :focus-visible) .party-feature__caption,
.party-list a:is(:hover, :focus-visible) .party-list__title,
.notice-list a:is(:hover, :focus-visible) .notice-list__title,
.committee-list a:is(:hover, :focus-visible) .committee-list__title {
    font-weight: 600;
}

.party-list__title {
    display: -webkit-box;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
    font-size: 1rem;
    line-height: 1.375rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-height: 2lh;
}

.party-list time {
    display: block;
    margin-top: 0.5rem;
    color: var(--color-blue);
    font-size: 0.875rem;
    line-height: 1.25rem;
    text-align: right;
}

.notice-list {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    min-height: 28.25rem;
    background: #fff;
}

.notice-list a {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding: 0.875rem 3.875rem 0.875rem 1.375rem;
}

.notice-list time {
    margin-bottom: 0.375rem;
    color: var(--color-blue);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.notice-list__title {
    display: -webkit-box;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
    font-size: 1rem;
    line-height: 1.375rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-height: 2lh;
}

.notice-list__arrow {
    position: absolute;
    top: 50%;
    right: 1.4375rem;
    display: grid;
    place-items: center;
    width: 2.125rem;
    height: 2.125rem;
    transform: translateY(-50%);
}

.notice-list__arrow img {
    width: 2.125rem;
    height: 2.125rem;
}

.notice-list a:is(:hover, :focus-visible) {
    color: var(--color-blue);
    background: #f7fbff;
}

/* 关工委 / 老科协 */
.committee-section {
    padding-block: 4.25rem 1.1875rem;
}

.committee-section .section-heading {
    margin-bottom: 1.75rem;
}

.committee-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.75rem;
}

.committee-layout > section,
.committee-list li {
    min-width: 0;
}

.committee-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.40625rem;
}

.committee-list a {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-width: 0;
    min-height: 3.5rem;
    padding: 0.875rem 1.625rem;
    background: var(--color-pale);
    border-radius: 0 1rem 0 1rem;
    font-size: 1rem;
    line-height: 1.5rem;
    transition: color .2s ease, background .2s ease;
}

.committee-list a:is(:hover, :focus-visible) {
    color: #fff;
    background: var(--brand-gradient);
}

.committee-list__title {
    position: relative;
    overflow: hidden;
    min-width: 0;
    padding-left: 0.9375rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.committee-list__title::before {
    position: absolute;
    top: 0.625rem;
    left: 0;
    width: 0.3125rem;
    height: 0.3125rem;
    background: var(--color-accent);
    border-radius: 50%;
    content: "";
}

.committee-list a:is(:hover, :focus-visible) .committee-list__title::before {
    background: #fff;
}

.committee-list time {
    flex: 0 0 auto;
    margin-left: auto;
    font-weight: 600;
}

.section-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3125rem;
    height: 1.75rem;
    margin-top: 0.625rem;
}

.section-dots button {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 0.375rem;
    height: 1.75rem;
    padding: 0;
    background: transparent;
    border: 0;
}

.section-dots button::before {
    width: 0.375rem;
    height: 0.375rem;
    background: #aeb2ab;
    border-radius: 50%;
    content: "";
}

.section-dots button[aria-current="page"],
.section-dots button[aria-current="page"]::before {
    width: 0.9375rem;
}

.section-dots button[aria-current="page"]::before {
    background: linear-gradient(90deg, #3393da, #3ddbf4);
    border-radius: 0.1875rem;
}

.section-dots button:focus-visible {
    outline-offset: 0.3125rem;
}

@media (max-width: 1100px) {
    .news-list {
        padding: 0.875rem 0.625rem;
    }

    .news-list__link {
        grid-template-columns: 2.75rem minmax(0, 1fr) 4rem;
        gap: 0.5rem;
        min-height: 4.75rem;
        padding-inline: 0.5rem;
    }

    .news-list__thumb {
        width: 4rem;
        height: 3rem;
    }

    .party-layout {
        gap: 2.25rem;
    }

    .party-content {
        gap: 1rem;
    }

    .party-list {
        gap: 0.75rem;
    }

    .party-list a {
        padding: 0.625rem;
    }

    .notice-list {
        min-height: 26.25rem;
    }

    .committee-list a {
        gap: 1rem;
        padding-inline: 1.125rem;
    }
}

@media (max-width: 960px) {
    .news-layout {
        grid-template-columns: 1fr;
    }

    .news-feature__image {
        max-height: 29.375rem;
    }

    .news-list {
        padding: 1rem;
    }

    .news-list__link {
        grid-template-columns: 3.625rem minmax(0, 1fr) 5rem;
        gap: 0.875rem;
        min-height: 5.5rem;
        padding: 0.75rem;
    }

    .news-list__thumb {
        width: 5rem;
        height: 3.75rem;
    }

    .party-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .party-content {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .party-feature img {
        max-height: 22.5rem;
    }

    .notice-list {
        min-height: 25rem;
    }

    .committee-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.25rem;
    }

    .committee-list {
        gap: 0.875rem;
    }
}

@media (max-width: 600px) {
    .hero__arrow {
        display: none;
    }

    .hero__counter {
        right: 1rem;
        bottom: 0.375rem;
        gap: 0.3125rem;
        font-size: 0.875rem;
    }

    .hero__counter button {
        width: 2.75rem;
        height: 2.75rem;
    }

    .news-section,
    .party-section,
    .committee-section {
        padding-block: 2rem;
    }

    .section-heading {
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .section-heading h2 {
        gap: 0.75rem;
        font-size: 1.375rem;
        line-height: 2rem;
    }

    .section-heading h2::after,
    .section-heading--center h2::before {
        width: 1.875rem;
    }

    .section-heading--center {
        justify-content: space-between;
    }

    .section-heading--center h2::before {
        display: none;
    }

    .section-heading--center .more-link {
        position: static;
    }

    .section-heading--center h2 {
        max-width: calc(100% - 6.875rem);
    }

    .more-link {
        gap: 0.375rem;
        font-size: 0.875rem;
    }

    .news-feature__caption {
        width: 100%;
        height: auto;
        min-height: 3.75rem;
        padding: 0.625rem 1rem;
        font-size: 0.9375rem;
        line-height: 1.3125rem;
    }

    .news-feature__caption span {
        -webkit-line-clamp: 2;
    }

    .news-feature__controls {
        display: none;
    }

    .news-list {
        padding: 0.5rem;
    }

    .news-list__link {
        grid-template-columns: 2.75rem minmax(0, 1fr) 4rem;
        gap: 0.625rem;
        min-height: 5.875rem;
        padding: 0.75rem 0.5rem;
    }

    .news-list__title {
        font-size: 1rem;
        line-height: 1.5625rem;
    }

    .news-list__thumb {
        width: 4rem;
        height: 3rem;
    }

    .news-date__day {
        font-size: 1.4375rem;
    }

    .news-date__month {
        font-size: 0.6875rem;
    }

    .party-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .party-feature img {
        aspect-ratio: 5 / 4;
        max-height: 20rem;
        object-position: center 42%;
    }

    .party-feature__caption {
        min-height: 4.125rem;
        padding: 0.625rem 1rem;
    }

    .party-list {
        gap: 0.625rem;
    }

    .party-list a {
        min-height: 5.875rem;
        padding: 0.875rem 1rem;
    }

    .notice-list {
        min-height: 27.5rem;
    }

    .notice-list a {
        padding-left: 1rem;
    }

    .committee-list a {
        flex-wrap: wrap;
        gap: 0.375rem;
        min-height: 5.375rem;
        padding: 0.875rem 1rem;
    }

    .committee-list__title {
        width: 100%;
    }

    .committee-list time {
        font-size: 0.8125rem;
        font-weight: 400;
    }

    /* 手机端扩大触摸区；桌面仍按 15/6px 图形和 5px 间距还原。 */
    .section-dots {
        gap: 0;
        height: 2.75rem;
    }

    .section-dots button,
    .section-dots button[aria-current="page"] {
        width: 2rem;
        height: 2.75rem;
    }
}

/* 单列首页的四个栏目交替使用浅灰蓝 / 白色区块，列表采用相反底色。 */
@media (max-width: 960px) {
    .party-section,
    .committee-section {
        padding-block: 0;
        background: #fff;
    }

    .party-layout,
    .committee-layout {
        row-gap: 0;
    }

    .party-layout > section,
    .committee-layout > section {
        margin-inline: calc(-1 * var(--safe-area));
        padding: 2rem var(--safe-area);
        background: #fff;
    }

    .party-layout > section:first-child,
    .committee-layout > section:first-child {
        background: var(--color-pale);
    }

    .notice-list {
        background: var(--color-pale);
    }

    .committee-layout > section:first-child .committee-list a {
        background-color: #fff;
    }
}

@media (prefers-reduced-motion: reduce) {
    .will-reveal {
        opacity: 1;
        transform: none;
    }
}

/* V3 桌面布局；移动端沿用上方 V2 的断点与排版。 */
.hero__arrow--prev { left: var(--safe-area); }
.hero__arrow--next { right: var(--safe-area); }
@media (min-width: 1101px) {
    .notice-list > li:not(:last-child) { border-bottom: 1px solid #555; }
    .hero__arrow { width: 5.125rem; height: 5.125rem; }
    .hero__counter { right: var(--safe-area); font-size: 1.5rem; }
    .news-date__month { font-size: .875rem; }
    .news-list__link { grid-template-columns: 4rem minmax(0, 1fr) 5rem; min-height: 0; }
    .news-section { padding-block: 20px 4.25rem; }
    .news-feature__caption { width: min(33rem, calc(100% - 5.875rem)); }
}
