/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", sans-serif;
}
body {
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}
a {
    text-decoration: none;
    color: inherit;
}
ul {
    list-style: none;
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 头部导航 semantic header+nav */
header {
    background-color: #2c7c41;
    color: white;
    position: sticky;
    top: 0;
    z-index: 99;
}
nav {
    width: 90%;
    margin: 0 auto;
    padding: 1rem 0;
}
nav ul {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
}
nav a {
    padding: 0.5rem 0;
    font-weight: 500;
}
nav a:hover {
    color: #c7f0d4;
}

/* 主体 main */
main {
    width: 90%;
    max-width: 1200px;
    margin: 2rem auto;
}
section {
    margin-bottom: 3rem;
}
h2 {
    color: #2c7c41;
    margin-bottom: 1rem;
    border-left: 4px solid #2c7c41;
    padding-left: 0.8rem;
}

/* 卡片布局（景点/美食卡片） */
.card-wrap {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 1.5rem;
}
.card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: 0.3s;
}
.card:hover {
    transform: translateY(-6px);
}
.card-text {
    padding: 1rem;
}

/* 轮播容器 */
.slider {
    width: 100%;
    height: 420px;
    overflow: hidden;
    position: relative;
    border-radius: 12px;
    margin-bottom: 2rem;
}
.slider-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s;
}
.slider-item.active {
    opacity: 1;
}
.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.7);
    border: none;
    cursor: pointer;
    font-size: 18px;
}
.slider-prev { left: 16px; }
.slider-next { right: 16px; }

/* 返回顶部按钮 */
#backTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #2c7c41;
    color: white;
    border: none;
    cursor: pointer;
    display: none;
    font-size: 16px;
}

/* 页脚 */
footer {
    background-color: #2c7c41;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

/* ========== 响应式 手机适配（作业要求 responsive） ========== */
@media (max-width:768px){
    nav ul {
        flex-direction: column;
        gap: 0.8rem;
    }
    .card-wrap {
        grid-template-columns: 1fr;
    }
    .slider {
        height: 260px;
    }
}
