/* 数字村志 — 主样式（移动端优先） */
:root {
    --color-primary: #f20027;
    --color-teal: #004d40;
    --color-teal-dark: #00352c;
    --bg-page: #f5f4f0;
    --text: #2a2a2a;
    --text-muted: #5c5c5c;
    --white: #fff;
    --header-h: 64px;
    --radius: 4px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--bg-page);
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

a {
    color: inherit;
    text-decoration: none;
}

/* —— Hero & 轮播 —— */
.hero {
    position: relative;
    background: url("/static/images/bg.png");
}

/* 轮播图区域（标题、指示点在图上） */
.hero-banner {
    position: relative;
    min-height: 52vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 80px 16px 28px;
    background: var(--color-teal);
}

.hero-carousel {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.hero-track {
    display: flex;
    height: 100%;
    will-change: transform;
    transition: transform 0.55s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .hero-track {
        transition: none;
    }
}

.hero-slide {
    flex: 0 0 100%;
    min-width: 100%;
    height: 100%;
    min-height: 52vh;
    background-color: var(--color-teal);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

/* 全站搜索：独立条带，位于轮播下方 */
.hero-search-band {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    width: 100%;
    display:none;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(0, 77, 64, 0.35) 0%,
        rgba(0, 0, 0, 0.45) 100%
    );
    pointer-events: none;
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.hero-arrow:hover,
.hero-arrow:focus-visible {
    background: rgba(255, 255, 255, 0.35);
    outline: none;
}

.hero-arrow--prev {
    left: 12px;
}

.hero-arrow--prev::after {
    content: "";
    width: 10px;
    height: 10px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: 4px;
}

.hero-arrow--next {
    right: 12px;
}

.hero-arrow--next::after {
    content: "";
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    margin-right: 4px;
}

.hero-dots {
    align-self: center;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin: 8px 0 4px;
    padding: 6px 10px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.2);
}

.hero-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.hero-dot[aria-selected="true"] {
    background: var(--color-primary);
    transform: scale(1.2);
}

.hero-foreground {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-top: 24px;
}

.hero-content {
    position: relative;
    width: 100%;
    text-align: center;
}

.hero-title {
    margin: 0;
    font-family: "Ma Shan Zheng", "KaiTi", "STKaiti", serif;
    font-size: clamp(1.75rem, 6vw, 3rem);
    font-weight: 400;
    color: var(--white);
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    line-height: 1.35;
}

.hero-search {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    background: url("/static/images/bg.png");
}

.hero-search-input {
    flex: 1;
    padding: 9px 14px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    line-height: 1.35;
    box-shadow: var(--shadow);
}

.hero-search-btn {
    padding: 9px 20px;
    border: none;
    border-radius: var(--radius);
    background: var(--color-primary);
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.hero-search-btn:hover {
    filter: brightness(1.05);
}


.sections {  
}
/* —— Sections —— */
.section {
    padding: 0 0 56px;
}

#village-records {
    background-color: #fff;
    background-image: url("/static/images/bg1.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: center center;
    padding: 40px 0 56px;
    min-height: min(100vh, 920px);
}

#vr {
    background-color: #fff;
    background-image: url("/static/images/bg2.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: center center;
}

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
    /* padding: 0 16px; */
    position: relative;
}

.section-tag {
    display: inline-block;
    padding: 10px 14px;
    background: var(--color-primary);
    color: var(--white);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.12);
}

.section-tag--right {
    float: right;
    margin-left: 16px;
}

.section-head {
    text-align: center;
    margin-bottom: 28px;
    clear: both;
    padding-top: 40px;
}

.book-cover-wrap {
    display: inline-block;
    width: clamp(40px, 8vw, 145px);
    aspect-ratio: 145 / 301;
    height: auto;
    margin-bottom: 8px;  
    opacity: 0.85;
}


.section-subtitle {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.12em;
}

.calligraphy-lg {
    font-family: "Ma Shan Zheng", "KaiTi", serif;
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    margin: 0 0 8px;
    line-height: 1.3;
}

.calligraphy-lg.accent {
    color: var(--color-primary);
}

.body-text {
    margin: 16px 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 乡村志 */
.records-hero {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 16px 32px;
    text-align: center;
}

.records-ribbon {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.records-ribbon__img {
    display: block;
    width: auto;
    max-width: min(104px, 28vw);
    height: auto;
    max-height: min(52vh, 420px);
    margin: 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(242, 0, 39, 0.22));
}

.records-lead {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.85;
    letter-spacing: 0.02em;
}

.records-body {
    padding-top: 8px;
}

.records-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.records-title-block {
    text-align: center;
    background: url("/static/images/007.png") no-repeat center center;
    width: 453px;
    margin-bottom: 20px;
}

.records-section-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.14em;
}

.records-section-title-en {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    color: var(--text-muted);
    font-weight: 500;
}

.records-grid {
    display: flex;
    flex-direction: column;   
}

.records-text__img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.records-books-wrap {
    width: 100%;
    overflow: visible;
}

.records-books {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0 28px;
    margin: 0;
}

.records-books__img {
    display: block;
    width: 100%;
    max-width: min(620px, 100%);
    height: auto;
    object-fit: contain;
}

/* 村史资料 */
.section-history {
    padding-bottom: 48px;
}

.history-panel {
    /* background: #ececec;    */
    border-radius: 4px;
    position: relative;
}

.history-tag {
    margin: 0 0 18px;
    display: flex;
    justify-content: flex-start;
    position: absolute;
    top: 0;
    left: 0;
}

.history-tag__img {
    display: block;
    width: auto;
    max-width: min(104px, 30vw);
    height: auto;
    max-height: min(48vh, 380px);
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.12));
}

.history-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.history-feature-img {
    margin: 60px 0 0 80px;
    border-radius: 12px;
    overflow: hidden;    
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.history-feature-img img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: middle;
}

.history-feature-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 14px 0 10px 80px;
    line-height: 1.45;
    color: var(--text);
}

.history-feature-lead {
    margin: 0;
    margin-left: 80px;
    font-size: 1.2rem;
    line-height: 1.75;
    color: var(--text-muted);
}

.history-aside {
    min-width: 0;
}

.history-media-stack {
    border-bottom: 1px solid #ccc;
    margin-top: 48px;
}

.history-media {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #ccc;
    transition: background 0.15s ease;
}

.history-media:last-child {
    border-bottom: none;
}

.history-media:hover {
    background: rgba(255, 255, 255, 0.45);
}

.history-media__thumb {
    flex: 0 0 100px;
    width: 100px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--white);
}

.history-media__thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.history-media__body {
    flex: 1;
    min-width: 0;
}

.history-media__title {
    margin: 0 0 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    line-height: 1.35;
}

.history-media__excerpt {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.55;
    color: #666;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.history-news-list {
    list-style: none;
    margin: 16px 0 0;
    padding: 16px 0 0;
    border-top: 1px solid #ccc;
}

.history-news-list li {
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
    font-size: 0.88rem;
    line-height: 1.5;
}

.history-news-list li:last-child {
    border-bottom: none;
}

.history-news-link {
    display: block;
    color: #444;
    text-decoration: none;
}

.history-news-link:hover {
    color: var(--color-primary);
}

.history-news-cat {
    color: #777;
    margin-right: 2px;
}

/* VR — 村史馆 */
.section-vr {
    padding-bottom: 48px;
}

.vr-panel {
    padding: 80px 60px;
}

.vr-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
}

.vr-thumbs {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
    justify-content: center;
    max-width: 320px;
    margin: 0 auto;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.vr-thumb {     
    height: 160px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vr-thumb:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.vr-thumb img {
    display: block;
    width: 100%;  
    object-fit: cover;
}

.vr-main {
    min-width: 0;
    padding-right: 36px;
}

.vr-main-img {
    border-radius: 18px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.vr-main-img img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: middle;
}

.vr-main-title {
    font-size: 1.22rem;
    font-weight: 600;
    margin: 18px 0 10px;
    color: #333;
}

.vr-main-lead {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.85;
    color: var(--text-muted);
}

.vr-tag {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-shrink: 0;
}

.vr-tag__img {
    display: block;
    width: auto;
    max-width: min(108px, 32vw);
    height: auto;
    max-height: min(46vh, 400px);
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.12));
}

/* 新闻资讯 */
.section-news {
    padding-bottom: 48px;
}

.news-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px; 
    border-radius: 4px;
}

.news-tag {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.news-tag__img {
    display: block;
    width: auto;
    max-width: min(104px, 30vw);
    height: auto;
    max-height: min(48vh, 420px);
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.12));
}

.news-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.section-news .news-tall {
    height: 600px;
}

.section-news .news-tall,
.section-news .news-wide,
.section-news .news-small {
    margin: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    background: transparent; 
}

.section-news .news-tall img,
.section-news .news-wide img,
.section-news .news-small img {
    width: 100%;
    display: block;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

.section-news .news-tall img {
    aspect-ratio: 3 / 4;
}

.section-news .news-wide img {
    aspect-ratio: 16 / 9;
}

.section-news .news-small img {
    aspect-ratio: 1;
}

.section-news .news-tall figcaption,
.section-news .news-wide figcaption,
.section-news .news-small figcaption {
    position: static;
    margin: 0;
    padding: 10px 4px 0;
    background: none;
    color: #4a4a4a;
    font-size: 1.2rem;
    line-height: 1.45;
}

.section-news .news-wide figcaption {
    text-align: left;
}

.section-news .news-tall figcaption,
.section-news .news-small figcaption {
    text-align: center;
}

.news-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-small-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* —— Desktop —— */
@media (min-width: 768px) {
    .hero-banner {
        min-height: 60vh;
        padding-bottom: 36px;
    }

    .hero-slide {
        min-height: 60vh;
    }

    .hero-arrow {
        display: flex;
    }

    .hero-content {
        text-align: left;
        margin-right: auto;
        margin-left: 0;
        margin-bottom: 20vh;
    }

    .hero-foreground {
        align-items: flex-start;
    }

    .hero-search-band {
        padding: 4px 16px;
    }

    .hero-search {
        flex-direction: row;
        align-items: stretch;
    }

    .hero-search-btn {
        white-space: nowrap;
    }

    .records-grid {
        flex-direction: row;
        align-items: flex-start;   
    }

    .records-text {
        flex: 0 0 45%;       
    }

    .records-books-wrap {
        flex: 1;
        min-width: 0;
    }

    .records-books {
        justify-content: flex-end;
        padding: 12px 0 28px;
    }

    .history-layout {
        flex-direction: row;
        gap: 28px;
        align-items: flex-start;
    }

    .history-feature {
        flex: 1.2;
    }

    .history-aside {
        flex: 0 0 min(440px, 44%);
        /* max-width: 380px; */
    }

    .vr-panel {
        padding: 80px 60px;
    }

    .vr-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 28px;
    }

    .vr-thumbs {
        flex-direction: column;
        flex: 0 0 auto;
        width: 240px;
    
        margin: 0;
        overflow: visible;
        justify-content: flex-start;
        gap: 12px;
    }

    .vr-thumb {
        flex: 0 0 auto;
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .vr-main {
        flex: 1;
        min-width: 0;
        padding-right: 80px;
    }

    .vr-tag {
        position: absolute;
        top: 0;
        right: 0;
    }

    .news-panel {
        flex-direction: row;
        align-items: flex-start;
        gap: 24px;
    }

    .news-tag {
        justify-content: flex-start;
        align-self: stretch;
    }

    .news-grid {
        flex-direction: row;
        align-items: stretch;
        gap: 16px;
        margin-top: 80px;
    }

    .news-tall {
        flex: 0 0 40%;
        /* max-width: 320px; */
    }

    .section-news .news-tall img {
        height: 100%;
        min-height: 380px;
        object-fit: cover;
    }

    .news-right {
        flex: 1;
        min-width: 0;
    }
}
