
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: #101116;
    color: #f5f5f5;
    font-family: "Microsoft YaHei", sans-serif;
    display: flex;
    flex-direction: column;
}

/* 顶部导航 */
.site-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8%;
    border-bottom: 1px solid #292a32;
    flex-shrink: 0;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 3px;
    color: #f5f5f5;
    text-decoration: none;
}

.site-nav a {
    color: #c5c5ce;
    text-decoration: none;
    margin-left: 28px;
    font-size: 14px;
    transition: color .3s;
}

.site-nav a:hover {
    color: white;
}

/* 页面主体 */
.page-content {
    flex: 1;
    min-height: 75vh;
    display: grid;
    place-items: center;
    padding: 60px 20px;
    text-align: center;
}

/* 首页内容 */
.home-hero {
    width: 100%;
    display: grid;
    justify-items: center;
    align-content: center;
    row-gap: 28px;
}

.home-hero h1 {
    font-size: clamp(38px, 7vw, 68px);
    letter-spacing: 8px;
    line-height: 1.4;
    margin: 0;
}

.home-hero .subtitle {
    color: #a5a6b2;
    font-size: 17px;
    line-height: 2;
    margin: 0;
}

.home-hero .welcome {
    display: inline-block;
    padding: 13px 32px;
    border: 1px solid #77788b;
    border-radius: 30px;
    color: #e6e6ed;
    text-decoration: none;
    transition: .3s;
    line-height: 1.5;
    margin: 0;
}

.home-hero .welcome:hover {
    background: #fff;
    color: #101116;
}

/* 底部 */
.site-footer {
    padding: 25px;
    text-align: center;
    color: #777985;
    font-size: 13px;
    line-height: 1.8;
    flex-shrink: 0;
}

/* 手机屏幕适配 */
@media (max-width: 600px) {
    .site-header {
        padding: 0 5%;
    }

    .logo {
        font-size: 19px;
    }

    .site-nav a {
        margin-left: 10px;
        font-size: 12px;
    }

    .page-content {
        padding: 45px 16px;
    }

    .home-hero {
        row-gap: 24px;
    }

    .home-hero .subtitle {
        font-size: 15px;
    }
}

/* 注册与登录页面 */
.content-page {
    width: 100%;
}

.content-heading {
    margin-bottom: 30px;
}

.content-heading .section-label {
    color: #999bb0;
    font-size: 12px;
    letter-spacing: 4px;
    margin-bottom: 12px;
}

.content-heading h1 {
    font-size: 36px;
    margin-bottom: 14px;
}

.content-heading > p:last-child {
    color: #a5a6b2;
    line-height: 1.8;
}

.register-panel {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 32px;
    background: #191a22;
    border: 1px solid #30313b;
    border-radius: 14px;
    text-align: left;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 9px;
    color: #dedee6;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #3b3c49;
    border-radius: 7px;
    outline: none;
    background: #111218;
    color: #f5f5f5;
    font-size: 14px;
}

.form-group input:focus {
    border-color: #999bb0;
}

.form-group input::placeholder {
    color: #777985;
}

.register-button {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 7px;
    background: #e5e5ed;
    color: #171820;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: .3s;
}

.register-button:hover {
    background: #ffffff;
}

.login-tip {
    margin-top: 24px;
    color: #999ba8;
    font-size: 13px;
    text-align: center;
}

.login-tip a {
    color: #e5e5ed;
    text-decoration: none;
}

.login-tip a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .content-heading h1 {
        font-size: 28px;
    }

    .register-panel {
        padding: 24px 18px;
    }
}

/* 登录状态导航样式 */
.site-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.site-nav a {
    margin-left: 0;
}

.site-nav span {
    color: #c5c5ce;
    font-size: 14px;
    white-space: nowrap;
}

.logout-form {
    display: inline-flex;
    margin: 0;
}

.nav-logout-button {
    padding: 7px 15px;
    border: 1px solid #555665;
    border-radius: 20px;
    background: transparent;
    color: #c5c5ce;
    font-size: 13px;
    cursor: pointer;
    transition: .3s;
}

.nav-logout-button:hover {
    background: #e5e5ed;
    color: #171820;
}

@media (max-width: 600px) {
    .site-nav {
        gap: 10px;
    }

    .site-nav span {
        font-size: 12px;
    }

    .nav-logout-button {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* 社区评论 */
.post-comments {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e8e8e8;
}

.post-comments h3 {
    font-size: 16px;
    margin-bottom: 14px;
}

.comment-item {
    padding: 12px;
    margin-bottom: 10px;
    background: #f7f8fa;
    border-radius: 8px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.comment-author strong {
    font-size: 14px;
}

.comment-author span,
.comment-item small {
    color: #888;
    font-size: 12px;
}

.comment-item p {
    margin: 6px 0;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.empty-comments,
.comment-login-tip {
    color: #888;
    font-size: 14px;
    margin: 12px 0;
}

.comment-form {
    margin-top: 14px;
}

.comment-form textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    font: inherit;
}

.comment-submit-button {
    margin-top: 10px;
    padding: 9px 18px;
    border: none;
    border-radius: 6px;
    background: #333;
    color: #fff;
    cursor: pointer;
}

.comment-submit-button:hover {
    opacity: 0.85;
}

@media (max-width: 600px) {
    .comment-form textarea {
        font-size: 14px;
    }
}

/* 评论区域字体颜色修复 */
.post-comments,
.post-comments h3,
.comment-item,
.comment-item p,
.comment-author strong,
.comment-login-tip,
.empty-comments {
    color: #333333 !important;
}

.comment-author span,
.comment-item small,
.empty-comments {
    color: #777777 !important;
}

.comment-form textarea {
    color: #333333 !important;
    background: #ffffff !important;
}

.comment-form textarea::placeholder {
    color: #999999 !important;
    opacity: 1;
}

.comment-submit-button {
    color: #ffffff !important;
}
/* 删除评论按钮 */
.comment-delete-form {
    display: inline-block;
    margin-top: 8px;
}

.comment-delete-button {
    padding: 5px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    color: #b33;
    font-size: 12px;
    cursor: pointer;
}

.comment-delete-button:hover {
    background: #fff1f1;
}
/* 评论回复区域 */
.comment-reply {
    margin: 12px 0 8px 24px;
    padding: 12px 14px;
    background: #f5f7fa;
    border-left: 3px solid #8da5c2;
    border-radius: 6px;
}

.comment-reply p {
    color: #333;
    margin: 8px 0;
    line-height: 1.7;
}

.comment-reply small {
    color: #888;
    font-size: 12px;
}

/* 回复输入框 */
.reply-form {
    margin-top: 12px;
    padding: 10px;
    background: #fafafa;
    border-radius: 6px;
}

.reply-form textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 55px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: vertical;
    color: #333;
    background: #fff;
}

.reply-form button {
    margin-top: 8px;
}
/* 无限层级评论缩进 */
.comment-item {
    margin-bottom: 18px;
}

.comment-reply {
    margin-top: 14px;
    margin-left: 20px;
    padding-left: 14px;
    border-left: 2px solid #e2e8f0;
}

.comment-reply .comment-reply {
    margin-left: 14px;
}

.reply-form {
    margin-top: 10px;
}
/* 评论点赞按钮 */
.comment-like-form {
    display: inline-block;
    margin: 8px 8px 8px 0;
}

.comment-like-button {
    border: 1px solid #d8dce5;
    background: #fff;
    color: #475569;
    padding: 5px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.comment-like-button:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.comment-like-count {
    display: inline-block;
    margin: 8px 8px 8px 0;
    color: #64748b;
    font-size: 13px;
}
/* 网站页脚完善 */
.site-footer {
    margin-top: 50px;
    padding: 30px 20px;
    text-align: center;
    background: #f5f5f5;
    border-top: 1px solid #e5e5e5;
    color: #777;
    font-size: 14px;
    line-height: 1.8;
}

.site-footer p {
    margin: 5px 0;
}

.site-footer a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* =========================
   文章列表样式
========================= */

.article-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.article-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid #e8eaf0;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.article-cover {
    width: 100%;
    height: 210px;
    overflow: hidden;
    background: #f1f3f5;
}

.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-card-content {
    padding: 20px;
}

.article-category {
    display: inline-block;
    margin: 0 0 10px;
    padding: 4px 10px;
    border-radius: 20px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 12px;
}

.article-card-content h2 {
    margin: 0 0 12px;
    color: #222;
    font-size: 20px;
    line-height: 1.5;
}

.article-summary {
    color: #666;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 18px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 12px;
}

.empty-state {
    margin-top: 30px;
    padding: 50px 20px;
    text-align: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .article-list {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .article-cover {
        height: 190px;
    }

    .article-card-content {
        padding: 16px;
    }
}

/* 修复文章页面文字颜色 */
.article-card,
.article-card-content,
.article-card-content h2,
.article-card-content p,
.article-meta,
.empty-state,
.empty-state h2,
.empty-state p {
    color: #333 !important;
}

.article-card {
    background: #fff !important;
}

.article-summary {
    color: #666 !important;
}

.article-meta {
    color: #888 !important;
}

.article-category {
    color: #4f46e5 !important;
}

/* =========================
   文章详情页面
========================= */

.article-detail {
    max-width: 900px;
    margin: 30px auto;
    padding: 35px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    color: #333;
}

.article-detail-title {
    margin: 18px 0;
    color: #222 !important;
    font-size: 32px;
    line-height: 1.5;
}

.article-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    color: #888 !important;
    font-size: 13px;
}

.article-detail-cover {
    margin: 25px 0;
    overflow: hidden;
    border-radius: 10px;
}

.article-detail-cover img {
    display: block;
    width: 100%;
    max-height: 480px;
    object-fit: cover;
}

.article-detail-summary {
    margin: 25px 0;
    padding: 18px;
    border-left: 4px solid #64748b;
    background: #f8fafc;
    color: #666 !important;
    line-height: 1.9;
}

.article-detail-body {
    margin-top: 30px;
    color: #333 !important;
    font-size: 16px;
    line-height: 2.1;
    overflow-wrap: anywhere;
}

.article-detail-back {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.article-detail-back a {
    color: #4f46e5 !important;
    text-decoration: none;
}

.article-detail-back a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .article-detail {
        margin: 15px auto;
        padding: 20px;
    }

    .article-detail-title {
        font-size: 25px;
    }

    .article-detail-body {
        font-size: 15px;
    }
}
.article-card-content h2 a {
    color: #222 !important;
    text-decoration: none;
}

.article-card-content h2 a:hover {
    color: #4f46e5 !important;
}

/* 文章发布提示 */
.article-message {
    margin: 15px 0;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.7;
}

.article-message-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857 !important;
}

.article-message-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c !important;
}
/* 文章编辑入口 */
.article-edit-entry {
    margin: 15px 0 25px;
}

.article-edit-entry a {
    display: inline-block;
    padding: 9px 20px;
    background: #4f46e5;
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
}

.article-edit-entry a:hover {
    background: #4338ca;
}
.article-delete-button {
    display: inline-block;
    margin-left: 8px;
    padding: 9px 20px;
    border: 0;
    border-radius: 6px;
    background: #dc2626;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.article-delete-button:hover {
    background: #b91c1c;
}