/* 应用全局基础样式 */
* {
    box-sizing: border-box;
}

body, button, input, textarea {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    border: 0;
    outline: none;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* 页头样式 */
header {
    background-color: #e8e8e8; /* 浅灰色背景 */
    color: #777; /* 稍微加深文字颜色，保证在浅灰背景下的可读性 */
    padding: 5px 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.logo {
    font-size: 1.1em;
    font-weight: bold;
    position: absolute;
    left: 20px;
}

.slogan {
    font-size: 0.9em;
    padding: 10px 0;
}

/* 主内容区域样式 */
main {
    max-width: 1002px;
    margin: 20px auto 0 auto;
    padding: 17px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    font-family: 'Microsoft YaHei', '微软雅黑', sans-serif; /* 设置字体为微软雅黑 */
}

#messages {
    min-height: 300px; /* 预留空间用于显示留言 */
    background-color: #f9f9f9;
    margin-bottom: 20px;
    padding: 20px; /* 留言文字与灰色区域四周内边距均为 10px */
    overflow-y: auto;
}

.message {
    margin-bottom: 20px;
    text-align: left; /* 默认左对齐 */
    color: #808080; /* 中灰色 */
    border-bottom: 3px dashed #ccc; /* 留言之间用虚线分隔 */
    padding-bottom: 15px; /* 虚线与内容的间距 */
}

.message:last-child {
    border-bottom: none; /* 最后一条留言不显示分隔线 */
    padding-bottom: 0;
}

.message .message-nickname {
    text-align: center;
    font-weight: bold;
    font-size: 0.96em;
    margin-bottom: 15px; /* 设置标题与下方正文内容的间距 */
}

.message-footer {
    text-align: center;
    margin-top: 8px;
}

.delete-button {
    background-color: transparent;
    color: #ff4d4f;
    border: 1px solid #ff4d4f;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75em;
    transition: all 0.3s;
}

.delete-button:hover {
    background-color: #ff4d4f;
    color: white;
}

.message .message-content {
    margin-bottom: 16px;
    font-size: 0.95em;
    overflow-wrap: break-word;
    word-break: normal;
    white-space: pre-wrap;
    line-height: 1.5;
}

.message .message-content ul,
.message .message-content ol {
    margin: 10px 0 10px 20px;
    padding-left: 0;
}

.message .message-content li {
    margin: 5px 0;
    padding-left: 5px;
}

/* 行内格式样式 */
.message .message-content strong {
    font-weight: bold;
    color: #333;
}

.message .message-content em {
    font-style: italic;
}

.message .message-content del {
    text-decoration: line-through;
    color: #999;
}

.message .message-content code {
    background-color: #e8e8e8;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
}

.message .message-date {
    text-align: center; /* 时间居中 */
    font-size: 0.85em; /* 时间缩小，作为辅助信息 */
}

.pagination {
    text-align: center;
    margin: 20px 0;
}

.message-form {
    background-color: #f2f2f2;
    padding: 20px;
    position: relative; /* 如果需要相对定位的子元素 */
}

.message-form .captcha-tip {
    margin-bottom: 10px;
    font-style: italic;
}

.message-form input, .message-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.message-form textarea {
    resize: none;
    min-height: 80px;
    overflow-y: hidden;
}

.message-form button {
    width: 100%;
    padding: 8px;
    background-color: #5cb85c;
    color: white;
    font-size: 0.9em;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-bottom: 10px; /* 添加间隔 */
}

.message-form button:hover {
    background-color: #4cae4c;
}

input::placeholder, textarea::placeholder {
    font-size: 0.9em; /* 设置输入框内提示文字的字体大小 */
    color: #808080; /* 设置提示文字的颜色为中灰色 */
}

.captcha-tip {
    font-size: 0.9em; /* 设置悲观我唔惯字体大小 */
}

.pagination button {
    color: #808080; /* 中灰色 */
    background: none; /* 移除背景 */
    border: none; /* 移除边框 */
    cursor: pointer; /* 鼠标指针变为手型 */
    margin: 0 5px; /* 分页按钮之间的间距 */
    text-decoration: none; /* 移除下划线 */
}

.pagination button:hover {
    color: #505050; /* 鼠标悬停时颜色变深 */
}

.message div {
    text-align: center; /* 居中显示所有留言内容 */
    margin-bottom: 5px; /* 每个留言元素之间的间距 */
}

.message div:nth-child(2) {
    text-align: left; /* 留言内容左对齐 */
}

.page-button.active {
    font-weight: bold; /* 高亮当前页按钮 */
}

/* 留言信息样式，包括序号和时间 */
.message-info {
    text-align: center; /* 将序号和时间居中 */
}

.message-number {
    margin-left: 10px;
    font-weight: normal;
    font-size: 0.85em;
    color: inherit; /* 颜色继承自父元素，保持原样 */
    text-decoration: none; /* 去掉下划线，保持原样 */
}

.seo-info {
    margin-top: 30px;
    margin-bottom: 0; /* 移除底部外边距 */
    padding: 20px 20px 0 20px; /* 移除底部内边距 */
    border-top: 1px solid #eee;
    color: #999;
    font-size: 0.85em;
    line-height: 1.8;
}

.seo-info h3 {
    font-size: 1em; /* 与正文大小一致 */
    color: #777; /* 颜色稍微深一点 */
    margin-bottom: 12px;
    font-weight: bold;
}

.seo-info p {
    margin: 0;
    padding-bottom: 3px;
    text-align: justify;
}

/* 页脚样式 */
footer {
    max-width: 1036px;
    margin: 12px auto 0 auto;
    padding: 6px 17px;
    box-sizing: border-box;
    margin-bottom: 5px; /* 增加页脚与下方的外边距 */
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.footer-left {
    text-align: left;
    flex: 1;
}

.footer-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.footer-right {
    text-align: right;
    flex: 1;
}

footer span, footer a {
    color: #999;
    font-size: 0.8em;
    font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
    font-weight: normal;
}

footer a {
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #555;
}

footer .footer-center .footer-icon {
    width: 18px;
    height: 18px;
    fill: #999;
    color: #999;
    vertical-align: middle;
    transition: all 0.2s;
}

footer .footer-center .footer-icon path {
    fill: #999;
    transition: fill 0.2s;
}

footer .footer-center a:hover .footer-icon,
footer .footer-center a:hover .footer-icon path {
    fill: #555;
    color: #555;
}

footer .footer-center a {
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

/* 以下为适应手机屏幕显示设置 */   
@media screen and (max-width: 767px) {
    header {
        display: flex ;
        justify-content: space-between ;
        align-items: center ;
        padding: 16px ; /* 显著增加上下内边距，让页头更高大气 */
        flex-wrap: wrap; /* 允许换行以防内容过宽 */
    }

    main {
        margin: 10px auto; /* 减小边距 */
        padding: 10px; /* 减小内边距 */
    }

    .seo-info p {
    padding-bottom: 10px;
    }

    .logo, .slogan {
        position: static ; /* 取消绝对定位 */
        transform: none ; /* 取消位移变换 */
        display: block ; /* 设置为块级元素 */
        width: auto ; /* 取消固定宽度，允许元素根据内容自动调整宽度 */
        margin: 0 ; /* 取消外边距 */
        padding: 0 ; /* 取消内边距 */
    }

    .slogan {
        text-align: right ; /* 设置slogan文本靠右对齐 */
    }

    .logo {
        text-align: left ; /* 设置logo文本靠左对齐 */
        font-size: 1em;
    }

    .footer-container {
        flex-direction: column;
        gap: 10px;
    }

    .footer-left, .footer-center, .footer-right {
        text-align: center;
        flex: none;
    }
}