/*
 * header.css - 网站头部样式文件
 * 包含网站标题、导航菜单和搜索框的样式
 * 响应式设计，适配不同屏幕尺寸
 */

/* 基础样式（所有设备共享） */
/**
 * 头部容器样式
 * 包含网站标题、导航菜单和搜索框
 */
.header-container {
    padding: 20px;
    text-align: center;
    max-width: 1200px; /* 限制最大宽度，避免大屏过宽 */
    margin: 0 auto; /* 居中容器 */
}

/**
 * 网站标题样式
 * 显示网站名称，设置为内联块级元素
 */
.site-title {
    font-size: 28px;
    margin-bottom: 10px;
    text-decoration: none;
    color: #333;
    display: inline-block;
}

/**
 * 网站标题强调样式
 * 为标题中的strong元素设置粗体
 */
.site-title strong {
    font-weight: 700;
}

/**
 * 导航容器样式
 * 使用flex布局，居中显示导航项
 */
.nav-container {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap; /* 所有设备默认允许换行，避免溢出 */
    flex-direction: row;
    align-content: center;
}

/**
 * 导航项样式
 * 定义导航链接的基础样式
 */
.nav-item {
    color: #666;
    text-decoration: none;
    font-size: 15px;
    padding: 3px 0; /* 基础点击区域 */
}

/**
 * 导航项悬停样式
 * 鼠标悬停时的效果
 */
.nav-item:hover {
    color: #000;
    text-decoration: underline;
}

/**
 * 导航分隔符样式
 * 用于分隔导航项
 */
.separator {
    color: #999;
    font-size: 18px;
    line-height: 1;
}

/**
 * 搜索容器样式
 * 包含搜索输入框
 */
.search-container {
}

/**
 * 搜索输入框样式
 * 自定义搜索框外观
 */
#search-input {
    border: none;
    padding: 3px 8px;
    border-radius: 0;
    width: 80px;
    font-size: 15px;
    color: #666;
    background: transparent;
}

/**
 * 搜索输入框聚焦样式
 * 输入框获得焦点时的效果
 */
#search-input:focus {
    outline: none;
    background: transparent;
}

/**
 * 搜索输入框占位符样式
 * 设置占位符文本的颜色和透明度
 */
#search-input::placeholder {
    color: #999;
    opacity: 1;
}

/**
 * 手机端占位符字体缩小
 * 适配小屏幕设备的搜索框占位符
 */
@media (max-width: 768px) {
    #search-input::placeholder {
        font-size: 13px;
    }
}

/**
 * 1. 手机端适配（≤768px，小屏设备）
 * 优化小屏幕设备的显示效果，增大字体和触摸区域
 */
@media (max-width: 768px) {
    .header-container {
        padding: 15px 8px; /* 最小内边距，节省空间 */
    }
    .site-title {
        font-size: 28px; /* 增大标题字体 */
        font-weight: 800; /* 增加标题粗细 */
        margin-bottom: 4px; /* 减少标题与导航区域的间距 */
    }
    .nav-container {
        gap: 6px; /* 最小间距 */
        padding: 0 4px;
        margin-top: 4px; /* 减少标题与导航区域的间距 */
    }
    .nav-item {
        font-size: 15px; /* 增大导航区域字体 */
        padding: 4px 0; /* 增大触摸区域（≥48px高度） */
    }
    .separator {
        font-size: 15px; /* 按比例缩小 */
    }
    #search-input {
        width: 60px; /* 最短搜索框 */
        font-size: 15px; /* 增大搜索框字体 */
        padding: 4px 6px; /* 增大触摸区域 */
        border: none;
        border-radius: 0;
        background: transparent;
    }
}

/**
 * 2. 平板端适配（769px-1024px，中屏设备）
 * 为平板设备提供中等尺寸的布局
 */
@media (min-width: 769px) and (max-width: 1024px) {
    .header-container {
        padding: 18px 15px; /* 中等内边距 */
    }
    .site-title {
        font-size: 26px; /* 中等标题 */
        margin-bottom: 9px;
    }
    .nav-container {
        gap: 10px; /* 中等间距 */
    }
    .nav-item {
        font-size: 14px; /* 中等字体 */
        padding: 3px 0;
    }
    .separator {
        font-size: 17px; /* 中等分隔符 */
    }
    #search-input {
        width: 70px; /* 中等搜索框 */
        font-size: 14px;
        border: none;
        border-radius: 0;
        background: transparent;
    }
}

/**
 * 3. 电脑端适配（≥1025px，大屏设备）
 * 为大屏设备提供更宽松的布局和更大的字体
 */
@media (min-width: 1025px) {
    .header-container {
        padding: 22px 30px; /* 宽松内边距，利用大屏空间 */
    }
    .site-title {
        font-size: 30px; /* 放大标题，增强视觉焦点 */
        margin-bottom: 12px;
    }
    .nav-container {
        gap: 15px; /* 宽松间距，避免拥挤 */
    }
    .nav-item {
        font-size: 16px; /* 较大字体，阅读舒适 */
    }
    .separator {
        font-size: 19px; /* 稍大分隔符，增强区分度 */
    }
    #search-input {
        width: 90px; /* 较宽搜索框，提升输入体验 */
        font-size: 16px;
        border: none;
        border-radius: 0;
        background: transparent;
    }
}