/* css/base.css */

/* 1. 全局重置与基础设定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* 所有的 HTML 页面都会继承这里的字体和默认正文颜色 */
    font-family: 'Noto Sans SC', "Microsoft YaHei", sans-serif;
    color: #444; /* 默认正文颜色 */
    line-height: 1.6;
    min-height: 100vh; /* 确保页面至少占满屏幕高度 */
    /* ***注意：body 的背景颜色和图片不再在这里设置，而是在各个页面的专属CSS中设置 *** */
}

/* 链接去下划线，保持颜色继承 */
a {
    text-decoration: none;
    color: inherit;
}

/* 2. 通用页面布局容器 */
.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden; /* 防止内容超出导致横向滚动条 */
}

/* 3. 顶部导航栏 (Top Bar) - 所有页面都共用这个HTML结构和大部分样式 */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    color: #5C5446;
    font-weight: 500;
    font-size: 1.1em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05); /* 底部细分隔线 */
    white-space: nowrap; /* 防止导航项换行 */
    overflow-x: auto; /* 小屏幕下允许横向滚动导航 */
    /* ***注意：导航栏的背景颜色不再在这里设置，而是在各页面的专属CSS中根据页面背景调整 *** */
    position: sticky; /* 导航栏粘性定位 */
    top: 0;
    z-index: 100; /* 确保导航栏在最上层 */
}

.branding {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.2em;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: #6D4C3A; /* 品牌文字颜色 */
}

.main-nav {
    display: flex;
    gap: 30px; /* 导航项之间间距 */
}

.main-nav a {
    text-decoration: none;
    color: #5C5446;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: #6D4C3A; /* 鼠标悬停时的颜色 */
}

/* 导航项激活状态 (当前页面) */
.main-nav a.active {
    color: #6D4C3A;
    font-weight: 700; /* 激活项加粗 */
}

/* 导航项激活状态下划线效果 */
.main-nav a.active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background-color: #6D4C3A;
    transform: scaleX(1); /* 激活项下划线显示 */
    transition: transform 0.3s ease;
}
.main-nav a:not(.active)::after {
    transform: scaleX(0); /* 非激活项下划线默认不显示 */
    transition: transform 0.3s ease;
}

/* 响应式导航栏 */
@media (max-width: 768px) {
    .top-bar {
        flex-wrap: wrap; /* 允许换行 */
        justify-content: center;
        padding: 15px 20px;
    }
    .branding {
        margin-bottom: 10px;
        width: 100%;
        text-align: center;
    }
    .main-nav {
        width: 100%;
        justify-content: center;
        font-size: 0.9em;
        gap: 15px;
    }
}

/* 4. 通用页脚 */
.page-footer {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 0.9em;
    margin-top: auto; /* 将页脚推到底部 */
}
