/* style.css */
/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局样式 */
body {
    font-family: "阿里巴巴普惠体", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9; /* 淡米色背景 */
}

/* 导航栏 */
nav {
    background-color: #2c3e50; /* 深灰蓝 */
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

nav a {
    color: #ecf0f1; /* 浅灰白 */
    text-decoration: none;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    transition: background-color 0.3s ease;
}

nav a:hover {
    background-color: #34495e; /* 稍亮的深灰蓝 */
    border-radius: 4px;
}

/* 主要内容区域 */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* 页面标题 */
h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    border-bottom: 2px solid #bdc3c7; /* 浅灰边框 */
    padding-bottom: 0.5rem;
}

/* 景点区块 */
.attraction-block, .poetry-block, .biography-block {
    background-color: #ffffff; /* 白色卡片 */
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* 轻微阴影 */
}

/* 景点标题 */
.attraction-block h2, .poetry-block h2, .biography-block h2 {
    color: #3498db; /* 蓝色标题 */
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

/* 景点图片 - 原有样式保持不变，用于非Flex布局的区块 */
.attraction-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 1rem; /* 居中并底部留白 */
    border-radius: 4px;
}

/* --- 新增样式：用于图文左右布局的区块 --- */
.attraction-flex {
    display: flex; /* 启用 Flexbox 布局 */
    flex-direction: row; /* 子元素水平排列 */
    align-items: flex-start; /* 子元素顶部对齐 */
    gap: 1.5rem; /* 图片和文字之间的间距 */
}

.attraction-image-left {
    max-width: 200px; /* 设置图片最大宽度，可根据需要调整 */
    height: auto; /* 保持宽高比 */
    border-radius: 4px;
    flex-shrink: 0; /* 防止图片在空间不足时被压缩 */
}

.attraction-text {
    flex: 1; /* 文字部分占据剩余空间 */
}

.attraction-text h2 {
    margin-top: 0; /* 重置标题顶部外边距，使其紧贴容器顶部 */
}

/* 关联链接 */
.linked-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: #e74c3c; /* 红色链接 */
    text-decoration: none;
    font-weight: bold;
}

.linked-link:hover {
    text-decoration: underline;
}

/* 诗词内容 */
.poetry-content {
    font-family: "思源宋体", serif; /* 古典字体 */
    font-size: 1.1rem;
    line-height: 1.8;
    white-space: pre-line; /* 保留换行 */
    margin-bottom: 1rem;
}

.author-info {
    font-style: italic;
    color: #7f8c8d; /* 灰色 */
}

/* 诗人简介内容 */
.biography-content {
    font-size: 1.05rem;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 2rem 0;
    color: #7f8c8d; /* 灰色 */
    font-size: 0.9rem;
    margin-top: 3rem;
    border-top: 1px solid #ecf0f1; /* 浅色边框 */
}

/* --- 新增样式：用于诗词页面的侧边栏 --- */
#other-attractions {
    width: 30%; /* 设置侧边栏宽度 */
    float: right; /* 浮动到右侧 */
    margin-left: 20px; /* 与主要内容区留出间隙 */
    background-color: #f1f2f6; /* 轻微不同的背景色以区分 */
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* 较浅的阴影 */
}

#other-attractions h2 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    text-align: center; /* 标题居中 */
}

#other-attractions ul {
    list-style-type: none; /* 去掉默认列表符号 */
    padding-left: 0.5rem; /* 调整左侧内边距 */
}

#other-attractions li {
    margin-bottom: 0.5rem;
}

#other-attractions a {
    color: #3498db; /* 链接颜色 */
    text-decoration: none;
    display: block; /* 使整个区域可点击 */
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

#other-attractions a:hover {
    background-color: #d6eaf8; /* 悬停背景色 */
}

/* 清除浮动，防止影响后续元素 */
.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* 响应式调整 */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    main {
        padding: 0 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .attraction-block h2, .poetry-block h2, .biography-block h2 {
        font-size: 1.5rem;
    }

    /* 在小屏幕上，取消侧边栏的浮动，使其变为块级元素 */
    #other-attractions {
        width: auto;
        float: none;
        margin-left: 0;
        margin-top: 1.5rem; /* 在主要内容下方 */
    }

    /* 在小屏幕上，取消图文左右布局，使其变为上下布局 */
    .attraction-flex {
        flex-direction: column;
        gap: 1rem;
    }

    .attraction-image-left {
        max-width: 100%; /* 图片宽度占满容器 */
        margin: 0 auto; /* 图片居中 */
    }
}