/* ==========================================================================
   青苗文途 · 全局样式表
   说明：全站统一样式，覆盖布局、导航、表单、文章、评论等模块
   ========================================================================== */

/* ---------- 全局样式：重置浏览器默认样式，统一盒模型 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------- CSS 变量：全站统一的绿色系配色与文本颜色 ---------- */
:root {
    --green-700: #2e7d32;
    --green-800: #1b5e20;
    --green-100: #edf7ed;
    --green-200: #d8f0db;
    --border: #dcefe0;
    --text: #344434;
    --muted: #6f7a6f;
}

/* ---------- 页面主体：字体、行高、底色与最小高度 ---------- */
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #edf7ed;
    position: relative;
    min-height: 100vh;
}

/* ---------- 页面装饰背景层：固定定位的绿色渐变光晕，不响应鼠标 ---------- */
.page-bg-layer {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(102, 187, 106, 0.14), transparent 30%),
        radial-gradient(circle at top right, rgba(76, 175, 80, 0.12), transparent 25%),
        radial-gradient(circle at bottom, rgba(235, 255, 237, 0.95), transparent 55%);
    pointer-events: none;
    z-index: -1;
}

/* ---------- 居中容器：限制最大宽度，保证大屏阅读体验 ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 页面顶部导航栏：吸顶显示 ---------- */
.page-header {
    background: linear-gradient(135deg, #2d7d31cc, #3f8d3fcc);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

/* ---------- 页头内部垂直内边距 ---------- */
header {
    padding: 18px 0;
}

/* ---------- 页头内部布局：Logo 与导航两端对齐 ---------- */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* ---------- 品牌 Logo 链接：图标与文字水平排列 ---------- */
.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    color: #fff;
    text-decoration: none;
}

/* ---------- 品牌 Logo 图标 ---------- */
.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
}

/* ---------- 站点名称 ---------- */
.logo-link h1 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

/* ---------- 站点标语 ---------- */
.logo-link p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.88);
}

/* ---------- 顶部导航菜单：横向排列 ---------- */
nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
}

/* ---------- 导航链接样式 ---------- */
nav ul li a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

/* ---------- 导航链接悬停效果 ---------- */
nav ul li a:hover {
    color: #e8f7e8;
}

/* ---------- 主内容区：上下留白 ---------- */
.main-content {
    padding: 40px 0 60px;
}

/* ---------- 首页 Hero 区域：左右两栏布局 ---------- */
.hero-card {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
    margin-top: 40px;
}

/* ---------- Hero 左侧主标题 ---------- */
.hero-left h2 {
    font-size: 2.6rem;
    color: #1b5e20;
    margin-bottom: 18px;
}

/* ---------- Hero 左侧说明文字 ---------- */
.hero-left p {
    font-size: 1.05rem;
    color: #4a4a4a;
    max-width: 700px;
    margin-bottom: 24px;
}

/* ---------- Hero 操作按钮组 ---------- */
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* ---------- 按钮通用样式（主按钮：绿色实底） ---------- */
.button,
button,
a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #2e7d32;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* ---------- 按钮悬停：加深绿色 ---------- */
.button:hover,
button:hover,
a.button:hover {
    background-color: #25662a;
}

/* ---------- 次要按钮：浅绿底 + 深绿描边 ---------- */
.button-secondary {
    background-color: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #c8e6c9;
}

/* ---------- 次要按钮悬停 ---------- */
.button-secondary:hover {
    background-color: #d0f0d8;
}

/* ---------- Hero 右侧配图：圆角裁剪 ---------- */
.hero-right img {
    width: 100%;
    border-radius: 18px;
    max-height: 520px;
    object-fit: cover;
}

/* ---------- 区块标题（居中） ---------- */
.section-header {
    margin-bottom: 30px;
    text-align: center;
}

/* ---------- 区块主标题 ---------- */
.section-header h2 {
    font-size: 2rem;
    color: #1b5e20;
    margin-bottom: 10px;
}

/* ---------- 区块副标题说明文字 ---------- */
.section-header p,
.section-header .page-note {
    color: #4a4a4a;
    font-size: 0.97rem;
}

/* ---------- 表单卡片容器：白色圆角卡片 ---------- */
.form-card:not(.form-logout) {
    max-width: 600px;
    margin: 40px auto 0;
    background-color: #fff;
    padding: 36px;
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(40, 87, 46, 0.12);
    border: 1px solid var(--border);
}



/* ---------- 表单卡片头部：居中显示 ---------- */
.form-card__header {
    text-align: center;
    margin-bottom: 26px;
}

/* ---------- 表单标题 ---------- */
.form-card__header h2 {
    margin-bottom: 8px;
    color: var(--green-800);
    font-size: 1.8rem;
}

/* ---------- 表单说明文字 ---------- */
.form-card__header p {
    color: var(--muted);
}

/* ---------- 认证表单：字段纵向排列 ---------- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---------- 表单字段组：标签 + 输入控件纵向排列 ---------- */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ---------- 字段标签 ---------- */
.field-group label {
    font-weight: 600;
    color: var(--green-800);
}

/* ---------- 输入控件通用样式（输入框 / 下拉 / 文本域） ---------- */
.field-group input,
.field-group select,
.field-group textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 1rem;
    color: var(--text);
    background: #fbfefb;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ---------- 文件上传区域 ---------- */
.file-upload-group {
    margin-top: 16px;
}

/* ---------- 文件选择框外观容器：模拟样式化选择框 ---------- */
.file-input-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
    min-height: 56px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f7fff7;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ---------- 文件选择框悬停：边框变绿 ---------- */
.file-input-wrapper:hover {
    border-color: var(--green-700);
}

/* ---------- 隐藏原生文件输入框：铺满容器以捕获点击 ---------- */
.file-input-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ---------- 选择框内显示的文件名文字 ---------- */
.file-input-text {
    pointer-events: none;
    z-index: 1;
    width: 100%;
    color: var(--text);
    font-weight: 600;
}



/* ---------- 上传说明提示条 ---------- */
.file-upload-note {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ---------- 输入控件聚焦：绿色描边 + 光晕 ---------- */
/*noinspection ALL*/
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
    outline: none;
    border-color: var(--green-700);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.13);
}

/* ---------- 表单整体错误 / 单字段错误提示 ---------- */
.form-errors,
.field-error {
    color: #c62828;
    font-size: 0.92rem;
}

/* ---------- 密码强度提示框 ---------- */
.password-hint {
    background: #f4fbf4;
    border: 1px solid var(--green-200);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--muted);
}

/* ---------- 提示框标题 ---------- */
.password-hint p {
    font-weight: 600;
    margin-bottom: 6px;
}

/* ---------- 提示条件列表 ---------- */
.password-hint ul {
    padding-left: 18px;
}

/* ---------- 已满足的条件：绿色 ---------- */
.password-hint li.valid {
    color: var(--green-700);
}

/* ---------- 未满足的条件：红色 ---------- */
.password-hint li.invalid {
    color: #c62828;
}

/* ---------- Cloudflare Turnstile 人机验证容器 ---------- */
.turnstile-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

/* ---------- 认证表单提交按钮：占满整行 ---------- */
.auth-submit {
    width: 100%;
    margin-top: 4px;
}

/* ---------- 认证页底部切换链接（如「去注册 / 忘记密码」） ---------- */
.auth-link {
    text-align: center;
    color: var(--muted);
}

/* ---------- 切换链接颜色 ---------- */
.auth-link a {
    color: var(--green-700);
    font-weight: 600;
}

/* ---------- 作者信息头部：头像与信息横排 ---------- */
.author-header {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
}

/* ---------- 作者头像 ---------- */
.author-avatar {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 18px;
    border: 4px solid #e8f5e9;
    background-color: #f1f8f1;
}

/* ---------- 作者数据统计（文章数、粉丝等） ---------- */
.profile-stats {
    display: flex;
    gap: 24px;
    margin: 24px 0;
    color: #4a4a4a;
}

/* ---------- 统计数字加粗 ---------- */
.profile-stats span {
    font-weight: 600;
}

/* ---------- 空状态提示：无数据时的虚线占位卡片 ---------- */
.empty-state {
    text-align: center;
    padding: 36px 24px;
    background-color: #f9faf8;
    border: 1px dashed #c8e6c9;
    border-radius: 14px;
    color: #4a4a4a;
    margin-top: 20px;
}

/* ---------- 空状态插图 ---------- */
.empty-state img {
    width: 100px;
    opacity: 0.85;
    margin-bottom: 18px;
}

/* ---------- 建设中页面：占满高度并居中 ---------- */
.coming-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- 建设中提示卡片 ---------- */
.coming-card {
    max-width: 560px;
    width: 100%;
    padding: 50px 36px;
    text-align: center;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
    border: 1px solid #e7f3e8;
}

/* ---------- 建设中卡片插图 ---------- */
.coming-card img {
    width: 120px;
    margin-bottom: 24px;
}

/* ---------- 建设中卡片标题 ---------- */
.coming-card h2 {
    font-size: 2.2rem;
    color: #1b5e20;
    margin-bottom: 18px;
}

/* ---------- 建设中卡片说明文字 ---------- */
.coming-card p {
    color: #5d6d5d;
    margin-bottom: 28px;
    font-size: 1rem;
}

/* ==========================================================================
   旧版头部样式（历史页面保留使用，新页面已使用 .page-header）
   ========================================================================== */
header {
    background-color: #4CAF50;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ---------- 站点标题：行内显示 ---------- */
header h1 {
    display: inline-block;
}

/* ---------- 站点标题链接：白色 ---------- */
header h1 a {
    color: white;
    text-decoration: none;
}

/* ---------- 旧版导航：右浮动 ---------- */
nav {
    float: right;
    margin-top: 10px;
}

/* ---------- 旧版导航列表：去除项目符号 ---------- */
nav ul {
    list-style: none;
}

/* ---------- 旧版导航项：行内显示，左间距 ---------- */
nav ul li {
    display: inline;
    margin-left: 20px;
}

/* ---------- 旧版导航链接：白色加粗 ---------- */
nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

/* ---------- 旧版导航链接悬停：显示下划线 ---------- */
nav ul li a:hover {
    text-decoration: underline;
}

/* ---------- 主内容区（旧版） ---------- */
main {
    padding: 40px 0;
}

/* ---------- 文章列表容器 ---------- */
.post-list {
    margin-top: 30px;
}

/* ---------- 文章列表项卡片 ---------- */
.post-item {
    background-color: white;
    padding: 30px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ---------- 文章标题 ---------- */
.post-item h3 {
    margin-bottom: 10px;
}

/* ---------- 文章标题链接：深灰、无下划线 ---------- */
.post-item h3 a {
    color: #333;
    text-decoration: none;
}

/* ---------- 文章标题悬停：变绿 ---------- */
.post-item h3 a:hover {
    color: #4CAF50;
}

/* ---------- 文章元信息（作者、发布时间等） ---------- */
.post-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

/* ---------- 元信息中的链接 ---------- */
.post-meta a {
    color: #4CAF50;
    text-decoration: none;
}

/* ---------- 元信息链接悬停 ---------- */
.post-meta a:hover {
    text-decoration: underline;
}

/* ---------- 文章附件区：顶部用分割线隔开 ---------- */
.post-files {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* ---------- 评论入口 ---------- */
.post-comments {
    margin-top: 15px;
    font-size: 14px;
}

/* ---------- 评论入口链接 ---------- */
.post-comments a {
    color: #666;
    text-decoration: none;
}

/* ---------- 评论入口链接悬停：变绿 ---------- */
.post-comments a:hover {
    color: #4CAF50;
}

/* ---------- 文章详情容器：白色卡片 ---------- */
.post-detail {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ---------- 详情页标题 ---------- */
.post-detail h2 {
    margin-bottom: 20px;
}

/* ---------- 文章操作区（编辑 / 删除等） ---------- */
.post-actions {
    margin: 20px 0;
}

/* ---------- 操作链接 ---------- */
.post-actions a {
    color: #4CAF50;
    text-decoration: none;
    margin-right: 20px;
}

/* ---------- 操作链接悬停 ---------- */
.post-actions a:hover {
    text-decoration: underline;
}

/* ---------- 文章正文内容：加大行距便于阅读 ---------- */
.post-content {
    margin: 30px 0;
    line-height: 1.8;
}

/* ---------- 附件区标题 ---------- */
.post-files h3 {
    margin: 30px 0 15px;
}

/* ---------- 附件列表：去除项目符号 ---------- */
.post-files ul {
    list-style: none;
}

/* ---------- 附件列表项 ---------- */
.post-files li {
    margin-bottom: 10px;
}

/* ---------- 附件下载链接 ---------- */
.post-files a {
    color: #4CAF50;
    text-decoration: none;
}

/* ---------- 附件链接悬停 ---------- */
.post-files a:hover {
    text-decoration: underline;
}

/* ---------- 评论区：顶部用分割线隔开 ---------- */
.comments {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

/* ---------- 评论标题 ---------- */
.comments h3 {
    margin-bottom: 20px;
}

/* ---------- 评论表单 ---------- */
.comments form {
    margin-bottom: 30px;
}

/* ---------- 评论输入框：纵向可拉伸 ---------- */
.comments textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 10px;
}

/* ---------- 评论提交按钮 ---------- */
.comments button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

/* ---------- 评论提交按钮悬停 ---------- */
.comments button:hover {
    background-color: #45a049;
}

/* ---------- 评论列表 ---------- */
.comment-list {
    margin-top: 30px;
}

/* ---------- 单条评论卡片 ---------- */
.comment-item {
    background-color: #f9f9f9;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 4px;
}

/* ---------- 评论元信息（作者、时间） ---------- */
.comment-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

/* ---------- 评论作者链接 ---------- */
.comment-meta a {
    color: #4CAF50;
    text-decoration: none;
}

/* ---------- 评论作者链接悬停 ---------- */
.comment-meta a:hover {
    text-decoration: underline;
}

/* ---------- 作者主页：白色卡片 ---------- */
.author-profile {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ---------- 作者主页标题 ---------- */
.author-profile h2 {
    margin-bottom: 20px;
}

/* ---------- 作者数据统计卡片 ---------- */
.author-stats {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

/* ---------- 统计项文字 ---------- */
.author-stats p {
    margin-bottom: 10px;
}

/* ---------- 作者主页小节标题 ---------- */
.author-profile h3 {
    margin: 30px 0 20px;
}

/* ---------- 表单字段组（旧版通用表单） ---------- */
.form-group {
    margin-bottom: 20px;
}

/* ---------- 表单标签：块级显示并加粗 ---------- */
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* ---------- 表单输入控件（旧版） ---------- */
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* ---------- 文件输入控件 ---------- */
.form-group input[type="file"] {
    padding: 3px;
}

/* ---------- 表单提交按钮（旧版） ---------- */
button[type="submit"] {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

/* ---------- 表单提交按钮悬停 ---------- */
button[type="submit"]:hover {
    background-color: #45a049;
}

/* ---------- 登录 / 注册页面：居中卡片式表单 ---------- */
form:not(.form-logout) {
    background-color: white;
    padding: 40px;
    border-radius: 18px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.08);
    max-width: 560px;
    margin: 0 auto;
    border: 1px solid rgba(76, 175, 80, 0.16);
}

/* ---------- 表单标题：居中 ---------- */
form h2 {
    margin-bottom: 30px;
    text-align: center;
    color: #1b5e20;
}

/* ---------- 表单底部提示文字（如「还没有账号？」） ---------- */
form p {
    margin-top: 20px;
    text-align: center;
}

/* ---------- 提示文字中的链接 ---------- */
form p a {
    color: #4CAF50;
    text-decoration: none;
}

/* ---------- 提示链接悬停 ---------- */
form p a:hover {
    text-decoration: underline;
}

/* ---------- 页脚：深色背景 ---------- */
footer {
    background-color: #333;
    color: white;
    padding: 30px 0;
    margin-top: 40px;
}

/* ---------- 页脚文字：居中 ---------- */
footer p {
    text-align: center;
    margin-bottom: 10px;
}

/* ---------- 页脚文字（重复定义，保留兼容） ---------- */
footer p {
    text-align: center;
    margin-bottom: 8px;
}

/* ---------- 页脚末行文字（版权信息）：更小更淡 ---------- */
footer p:last-child {
    margin-bottom: 0;
    font-size: 14px;
    color: #ccc;
}

/* ---------- 页脚链接 ---------- */
footer a {
    color: #4CAF50;
    text-decoration: none;
}

/* ---------- 页脚链接悬停 ---------- */
footer a:hover {
    text-decoration: underline;
}

/* ---------- 响应式设计：小屏幕（≤768px）适配 ---------- */
@media (max-width: 768px) {
    header nav {
        float: none;
        text-align: center;
        margin-top: 20px;
    }

    header nav ul li {
        display: block;
        margin: 10px 0;
    }

    .post-detail,
    .author-profile,
    form {
        padding: 20px;
    }
}

/* ---------- 隐藏文本域（供特定页面场景使用） ---------- */
.hidden-textarea {
    display: none;
}

/* ---------- 分页导航：水平居中排列 ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 30px;
}

/* ---------- 分页页码链接：白底描边按钮 ---------- */
.pagination .page-link {
    display: inline-block;
    min-width: 36px;
    padding: 8px 12px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    text-align: center;
    font-size: 14px;
    transition: all 0.2s;
}

/* ---------- 分页链接悬停：边框和文字变绿 ---------- */
.pagination .page-link:hover {
    border-color: #4CAF50;
    color: #4CAF50;
}

/* ---------- 当前页：绿色实底，不可点击 ---------- */
.pagination .page-link.current {
    background-color: #4CAF50;
    border-color: #4CAF50;
    color: white;
    cursor: default;
}

/* ---------- 分页省略号（…） ---------- */
.pagination .page-ellipsis {
    color: #999;
    padding: 8px 4px;
}
