/* ---- 自定义投稿页面样式 (contribute-styles.css) ---- */

/* 全局容器和文章区域的基础样式，增加一些留白和阴影 */
.main {
    padding: 25px; /* 增加整体内边距 */
    background-color: #fefefe; /* 页面背景色 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* 柔和的阴影 */
    border-radius: 10px; /* 圆角边框 */
    margin: 20px auto; /* 自动边距实现水平居中，与上下内容分隔 */
    max-width: 900px; /* 限制最大宽度，避免过宽 */
}

/* 页面标题美化 */
.post-title {
    font-size: 2.5em; /* 增大标题字号 */
    color: #2c3e50; /* 深灰色标题 */
    text-align: center; /* 居中显示 */
    margin-bottom: 40px; /* 标题与内容区间隔 */
    padding-bottom: 15px; /* 下划线和标题的距离 */
    position: relative;
    letter-spacing: 1px; /* 增加字母间距 */
}

.post-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px; /* 下划线宽度 */
    height: 4px;
    background-color: #3498db; /* 醒目的蓝色下划线，可替换为主题主色 */
    border-radius: 2px;
}

/* 页面内容区（用于输出引导文字） */
.post-content {
    line-height: 1.8;
    color: #444;
    font-size: 1.05em;
    margin-bottom: 30px;
    padding: 0 10px; /* 左右增加一些内边距 */
}

/* 消息提示框（成功/错误） */
.alert {
    padding: 18px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 1em;
    line-height: 1.6;
    border: 1px solid transparent; /* 默认透明边框 */
    animation: fadeIn 0.5s ease-out; /* 淡入动画 */
}

.alert-success {
    background-color: #eaf7ed; /* 柔和的绿色背景 */
    color: #28a745; /* 绿色文字 */
    border-color: #c3e6cb;
}

.alert-danger {
    background-color: #fdeded; /* 柔和的红色背景 */
    color: #dc3545; /* 红色文字 */
    border-color: #f5c6cb;
}

/* 投稿表单整体样式 */
.contribute-form {
    padding: 30px;
    background-color: #fcfcfc; /* 更浅的背景色 */
    border: 1px solid #e0e0e0; /* 细边框 */
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03); /* 内部阴影，增加层次感 */
}

.contribute-form p {
    margin-bottom: 25px; /* 增加段落间距 */
}

/* 隐藏用于屏幕阅读器的标签 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* 输入框和文本域样式 */
.contribute-form .text,
.contribute-form .textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1.05rem;
    color: #555;
    box-sizing: border-box; /* 确保 padding 和 border 包含在宽度内 */
    transition: all 0.3s ease-in-out; /* 平滑过渡效果 */
    background-color: #fff;
}

.contribute-form .text:focus,
.contribute-form .textarea:focus {
    border-color: #3498db; /* 聚焦时边框变色 */
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2); /* 聚焦时柔和的蓝色光晕 */
    outline: none; /* 移除浏览器默认焦点轮廓 */
    background-color: #fdfefe;
}

/* placeholder 文本样式 */
.contribute-form .text::placeholder,
.contribute-form .textarea::placeholder {
    color: #aaa; /* 浅灰色，与背景形成对比 */
    opacity: 1; /* 确保在所有浏览器中完全显示 */
    transition: color 0.3s ease-in-out;
}

.contribute-form .text:focus::placeholder,
.contribute-form .textarea:focus::placeholder {
    color: transparent; /* 聚焦时隐藏placeholder文本 */
}


.contribute-form .textarea {
    min-height: 200px; /* 增加文本域的最小高度 */
    resize: vertical; /* 允许垂直调整大小 */
}

/* 提示信息样式 */
.contribute-form small {
    display: block;
    color: #777;
    font-size: 0.88em;
    margin-top: 8px;
    line-height: 1.4;
}

/* 提交按钮样式 */
.contribute-form .submit {
    display: block;
    width: 100%;
    padding: 16px 28px;
    background-color: #3498db; /* 主题蓝色 */
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1.2em; /* 增大字号 */
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out, transform 0.2s ease-in-out, box-shadow 0.3s ease-in-out;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15); /* 更明显的阴影 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* 轻微文字阴影 */
}

.contribute-form .submit:hover {
    background-color: #2980b9; /* 悬停时颜色变深 */
    transform: translateY(-3px); /* 悬停时轻微上浮 */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.contribute-form .submit:active {
    transform: translateY(0); /* 点击时恢复原位 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 响应式调整 - 针对小屏幕设备 */
@media (max-width: 768px) {
    .main {
        padding: 15px;
        margin: 15px auto;
        border-radius: 8px;
    }
    .post-title {
        font-size: 1.8em;
        margin-bottom: 25px;
        padding-bottom: 10px;
    }
    .post-title::after {
        width: 60px;
        height: 3px;
    }
    .contribute-form {
        padding: 20px;
    }
    .contribute-form p {
        margin-bottom: 20px;
    }
    /* 移除或调整 label 样式，因为它们现在是隐藏的 */
    .contribute-form label {
        /* font-size: 1em; */ /* 这一行可以移除，因为 label 已经隐藏 */
        /* margin-bottom: 8px; */ /* 这一行也可以移除 */
    }
    .contribute-form .text,
    .contribute-form .textarea {
        padding: 12px 15px;
        font-size: 1rem;
    }
    .contribute-form .textarea {
        min-height: 150px;
    }
    .contribute-form small {
        font-size: 0.8em;
    }
    .contribute-form .submit {
        padding: 14px 20px;
        font-size: 1.1em;
    }
    .alert {
        padding: 15px;
        margin-bottom: 20px;
        font-size: 0.9em;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 自定义投稿页面的同意协议样式 */
.contribute-form .contribute-agreement {
    display: flex; /* 使用 flexbox 布局 */
    align-items: center; /* 垂直居中对齐 */
    justify-content: flex-start; /* 水平靠左对齐 */
    /* 或者考虑text-align: center; 如果你希望这段文字整体居中 */
    padding: 10px 0; /* 适当的上下间距 */
    font-size: 0.9em; /* 适当调整字体大小 */
    color: #666; /* 文本颜色 */
    line-height: 1.5; /* 行高，确保文本清晰 */
    flex-wrap: nowrap; /* 强制不换行，这是关键 */
    white-space: nowrap; /* 再次强调不换行，特别是针对文本 */
    overflow: hidden; /* 隐藏溢出内容，如果真的太长会截断 */
    text-overflow: ellipsis; /* 如果溢出，显示省略号 */
    max-width: 100%; /* 确保不超过父容器宽度 */
}

/* 调整复选框与文字的间距 */
.contribute-form .contribute-agreement input[type="checkbox"] {
    margin-right: 8px; /* 复选框和文字之间的间距 */
    /* 垂直对齐调整，如果需要更精细控制 */
    vertical-align: middle;
}

/* 投稿规则链接的样式 */
.contribute-form .contribute-agreement a {
    color: #007aff; /* Apple风格的蓝色链接，或你主题的链接色 */
    text-decoration: none; /* 去掉下划线，或 hover 时显示 */
    margin: 0 4px; /* 链接两侧的间距 */
    white-space: nowrap; /* 确保链接文本不换行 */
}

.contribute-form .contribute-agreement a:hover {
    text-decoration: underline;
}

/* 如果复选框和文字不对齐，可以尝试这个 */
.contribute-form .contribute-agreement label {
    display: flex; /* 让label内部也使用flexbox */
    align-items: center; /* 确保label内部的文本和链接垂直居中 */
    white-space: nowrap; /* 确保label内的文本不换行 */
}