/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo{
    text-align: center;
}
.nav-logo h2 {
    color: #fff;
    font-size: 1 rem;
    font-weight: 500;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* 汉堡菜单（移动端） */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.hamburger:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 3px 0;
    transition: 0.3s;
}

/* 主要内容区域 */
main {
    margin-top: 80px;
}

/* 为啥有个缓冲距离？ */

.section {
    padding: 0 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* 移动端内容区域优化 */
@media (max-width: 768px) {
    .container{
        width: 100%;
    }
    .section {
        padding: 3rem 0;
        min-height: auto;
    }
    
    .text-content {
        text-align: center;
    }
    
    .text-content p {
        margin-bottom: 1.2rem;
        font-size: 1.1rem;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 3rem;
    color: #2c3e50;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* 村庄简介部分 */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.text-content p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #555;
    line-height: 1.8;
    text-align: center;
}

.image-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 300px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* 最近动态部分 */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.news-item {
    background: #fff;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.news-item:hover {
    transform: translateX(10px);
}

.news-date {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.news-item h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.news-item p {
    color: #666;
    line-height: 1.6;
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #667eea;
        width: 100%;
        text-align: center;
        transition: 0.3s ease-in-out;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem 0;
        z-index: 999;
    }

    .nav-menu.active {
        left: 0;
    }

    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .container {
        padding: 0 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    /* 为移动端优化导航链接可点击区域 */
    .nav-link {
        padding: 15px 20px;
        margin: 5px 0;
        border-radius: 50px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 2rem;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .nav-logo h2 {
        font-size: 1.5rem;
    }
}

/* 移动端导航优化 */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 0;
        background: #667eea;
    }
    
    .nav-container {
        flex-direction: column;
        padding: 0 1rem;
    }
    
    .nav-logo {
        text-align: center;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .nav-logo h2 {
        font-size: 1.3rem;
        margin: 0;
        font-weight: 600;
    }
    
    .hamburger {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    
    .nav-menu {
        top: 70px;
        padding: 1.5rem 0;
        background-color: rgba(102, 126, 234, 0.98);
    }    
    .nav-link {
        display: block;
        padding: 1rem;
        margin: 0.5rem 1rem;
    }
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 入场动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeInUp 0.8s ease-out;
}

/* 村庄简介：文本与图库分行（保持） */
#village-intro .content-wrapper {
    grid-template-columns: 1fr;
}

/* 横向滑动画廊（更新对比度） */
.photo-gallery {
    margin-top: 0.25rem;       /* 原 1.5rem -> 上移 */
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0 10vw 1.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
}

.photo-gallery::-webkit-scrollbar { display: none; }

/* 移动端图库优化 */
@media (max-width: 768px) {
    .photo-gallery {
        padding-bottom: 2rem;
    }
    
    /* 增加图库指示条 */
    .photo-gallery::after {
        content: '← 左右滑动查看更多 →';
        position: absolute;
        bottom: 0.5rem;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.8rem;
        color: #666;
        white-space: nowrap;
    }
}

.gallery-item {
    flex: 0 0 auto;
    width: 340px;
    height: 210px;
    border-radius: 12px;
    overflow: hidden;
    background: #ddd;
    transition: transform 0.35s ease, box-shadow 0.35s ease, opacity 0.35s ease, filter 0.35s ease, border-color 0.35s ease;
    scroll-snap-align: center;
    transform: scale(0.88);
    opacity: 0.65;
    filter: saturate(0.85);
    aspect-ratio: 16 / 10;
    border: 2px solid rgba(255,255,255,0.85);
    box-shadow: 0 6px 18px rgba(0,0,0,0.10),
                0 0 0 1px rgba(0,0,0,0.06);
}

/* 加载消息样式 */
.loading-message {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
    font-size: 1.2rem;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    animation: pulse 1.5s ease-in-out infinite;
}

/* 加载容器样式 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* 加载动画样式 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

/* 旋转动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 优化新闻项样式 */
.news-item {
    display: block;
    background: #fff;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    border-left: 4px solid transparent;
}

.news-item:hover {
    transform: translateX(15px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-left-color: #667eea;
}

.news-item h3 {
    color: #2c3e50;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.4;
}

.news-item p {
    color: #666;
    line-height: 1.6;
    font-size: 1rem;
}

/* 新闻容器样式优化 */
#news-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 错误消息样式 */
.error-message {
    text-align: center;
    padding: 2rem;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* 无新闻数据消息样式 */
.no-news-message {
    text-align: center;
    padding: 4rem 2rem;
    color: #999;
    font-size: 1.2rem;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* 脉冲动画 */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
    }
}

.gallery-item.is-center {
    transform: scale(1.18);
    opacity: 1;
    filter: saturate(1);
    border-color: #ffffff;                                /* 中心项更亮的描边 */
    box-shadow: 0 16px 48px rgba(0,0,0,0.22),
                0 0 0 2px rgba(102,126,234,0.25);         /* 增加微弱高亮环 */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

/* 为触摸设备优化图片点击反馈 */
.gallery-item {
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
}

@media (max-width: 480px) {
    .photo-gallery { padding: 0 6vw 0.5rem; }
    .gallery-item { width: 86vw; height: auto; }
}

@media (min-width: 992px) {
    .gallery-item { width: 480px; height: 300px; }
}




/* 村庄特色部分 - 优化后 */
.features-list {
    width: 599px;
    margin: 0 auto;
    max-width: 1200px;
}

.feature-row {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    min-height: 180px;
    margin-bottom: 30px;
    padding: 0 10px;
}

/* 电脑端样式 */
@media (min-width: 769px) {
    /* 基础设置 - 统一过渡动画 */
    .feature-card,
    .feature-detail {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .feature-card {
        width: 100%;
        height: 175px;
        background: #fff;
        padding: 1.6rem 1rem;
        border-radius: 15px;
        text-align: center;
        box-shadow: 0 5px 20px rgba(0,0,0,0.2);
        transition: all 0.3s ease;
        z-index: 2;
        text-decoration: none;
        color: inherit;
        cursor: pointer;
        display: block;
    }
    
    .feature-detail {
        width: 400px;
        height: 175px;
        background-color: #fff;
        border-radius: 15px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.2);
        padding: 0.5rem;
        text-align: left;
        opacity: 0;
        transition: all 0.3s ease;
        z-index: 1;
    }
    
    /* 悬停/聚焦状态 - 实现滑动效果 */
    .feature-row:hover .feature-card,
    .feature-row:focus-within .feature-card{
        transform: translate(-100%, -50%);
        width: 80%;
    }
    
    .feature-row:hover .feature-detail,
    .feature-row:focus-within .feature-detail {
        transform: translate(10%, -50%);
        opacity: 1;
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
        margin: 0 auto 1rem;
        display: block;
    }
    
    .feature-card h3 {
        color: #2c3e50;
        margin-bottom: 1rem;
        font-size: 1.5rem;
    }
    
    .feature-card p {
        color: #666;
        line-height: 1.6;
    }
    
    .feature-detail p {
        font-size: 15.8px;
        text-align: left;
        margin: 1.2rem 2.8rem;
        line-height: 1.5;
        font-weight: bold;
    }
}

/* 移动端样式 */
@media (max-width: 768px) {
    /* 村庄特色部分移动优化 */
    .features-list {
        width: 100%;
        padding: 0 10px;
    }
    
    .feature-row {
        min-height: 150px;
        margin-bottom: 20px;
        padding: 0;
    }
    
    /* 基础设置 - 统一过渡动画 */
    .feature-card,
    .feature-detail {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .feature-card {
        width: 95%;
        height: 150px;
        background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
        padding: 1.2rem 0.8rem;
        border-radius: 20px;
        text-align: center;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        transition: all 0.3s ease;
        z-index: 2;
        text-decoration: none;
        color: inherit;
        cursor: pointer;
        display: block;
        border: 2px solid rgba(102, 126, 234, 0.2);
    }
    
    .feature-detail {
        width: 95%;
        height: 150px;
        background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
        border-radius: 20px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        padding: 0.8rem;
        text-align: left;
        opacity: 0;
        transition: all 0.3s ease;
        z-index: 1;
        border: 2px solid rgba(102, 126, 234, 0.2);
    }
    
    /* 触摸交互样式 */
    .feature-row.touched .feature-card {
        transform: translate(-110%, -50%);
        width: 70%;
        border-color: rgba(102, 126, 234, 0.5);
    }
    
    .feature-row.touched .feature-detail {
        transform: translate(5%, -50%);
        opacity: 1;
        border-color: rgba(102, 126, 234, 0.5);
    }
    
    /* 简化悬停效果，避免在移动设备上的误触 */
    .feature-row:hover .feature-card,
    .feature-row:focus-within .feature-card {
        transform: translate(-50%, -50%);
        width: 95%;
    }
    
    .feature-row:hover .feature-detail,
    .feature-row:focus-within .feature-detail {
        transform: translate(-50%, -50%);
        opacity: 0;
    }
    
    /* 显性声明非触摸状态的样式 */
    .feature-row:not(.touched) .feature-card {
        transform: translate(-50%, -50%);
        width: 95%;
    }
    
    .feature-row:not(.touched) .feature-detail {
        transform: translate(-50%, -50%);
        opacity: 0;
        pointer-events: none;
    }
    
    /* 移动端特色卡片优化 */
    .feature-icon {
        width: 45px;
        height: 45px;
        margin: 0 auto 0.8rem;
        display: block;
        border-radius: 50%;
        background-color: rgba(102, 126, 234, 0.1);
        padding: 8px;
    }
    
    .feature-card h3 {
        color: #2c3e50;
        margin-bottom: 0.8rem;
        font-size: 1.2rem;
        font-weight: 600;
    }
    
    .feature-detail p {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 0.4rem;
        text-align: left;
        padding-left: 0.3rem;
        color: #555;
    }
}

/* 新闻项目链接样式 */
.news-item {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
}

.news-item:hover {
    text-decoration: none;
    color: inherit;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* 轮播图移动端优化 */
@media (max-width: 768px) {
    .photo-gallery {
        padding: 0 4vw 0.5rem;
        gap: 0.5rem;
    }
    
    .gallery-item {
        width: 80vw;
        transform: scale(0.92);
    }
    
    .gallery-item.is-center {
        transform: scale(1.1);
    }
}

/* 为移动端添加触摸友好的样式 */
.gallery-item {
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}

/* 内容区域移动端优化 */
@media (max-width: 768px) {
    main {
        margin-top: 60px;
    }
    
    .section {
        padding: 2rem 0;
        min-height: auto;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .text-content p {
        font-size: 1rem;
        margin-bottom: 1rem;
        padding: 0 10px;
    }
    
    .news-item {
        padding: 1.5rem;
    }
    
    .news-item h3 {
        font-size: 1.2rem;
    }
    
    .feature-card h3 {
        font-size: 1.3rem;
    }
    
    .feature-detail p {
        font-size: 16px;
        margin: 0.3rem 0.3rem;
    }
}

/* 为小屏幕进一步优化 */
@media (max-width: 480px) {
    .section-title {
        font-size: 1.8rem;
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .feature-detail {
        width: 90%;
    }
}

/* 移动端字体优化 */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* 增加行高提高可读性 */
    p {
        line-height: 1.7;
    }
    
    /* 增加链接可点击区域 */
    a {
        display: inline-block;
    }
}

/* 移动端触摸交互支持 */
@media (max-width: 768px) {
    /* 在移动设备上，使用点击代替悬停 */
    .feature-row.touched .feature-card {
        transform: translate(-100%, -50%);
        width: 80%;
    }
    
    .feature-row.touched .feature-detail {
        transform: translate(10%, -50%);
        opacity: 1;
    }
    
    /* 简化悬停效果，避免在移动设备上的误触 */
    .feature-row:hover .feature-card,
    .feature-row:focus-within .feature-card {
        transform: translate(-50%, -50%);
        width: 100%;
    }
    
    .feature-row:hover .feature-detail,
    .feature-row:focus-within .feature-detail {
        transform: translate(-50%, -50%);
        opacity: 0;
    }
}

/* 返回顶部按钮样式 */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #667eea;
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background-color: #764ba2;
    transform: translateY(-3px);
}
