/* 整体布局美化 */
.content {
    max-width: 800px;  /* 缩小最大宽度，让内容更集中 */
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
}

/* 文章发布区域美化 */
.article-form {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.article-form input,
.article-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eef0f2;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.article-form input:focus,
.article-form textarea:focus {
    border-color: #983636;
    box-shadow: 0 0 0 3px rgba(152, 54, 54, 0.1);
    outline: none;
}

/* 图片上传区域美化 */
.image-upload-container {
    margin: 15px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    position: relative;
}

.preview-image-container {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    background: #fff;
    display: inline-block;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background-color 0.3s;
    padding: 0;
    line-height: 0;
    z-index: 100;
    pointer-events: auto;
    opacity: 1;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.remove-image:hover {
    background: rgba(255, 0, 0, 0.9);
    transform: scale(1.1);
}

.image-upload-btn {
    display: inline-block;
    padding: 8px 15px;
    background-color: #983636;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* 文章列表区域美化 */
.articles-container {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* 文章卡片美化 */
.article-card {
    background: white;
    border-radius: 16px;
    padding: 25px 30px;
    margin-bottom: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

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

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #983636;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-card:hover::before {
    opacity: 1;
}

/* 文章头部美化 */
.article-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.article-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.article-title h3 {
    margin: 0;
    font-size: 1.5em;
    color: #2c3e50;
    font-weight: 600;
    flex: 1;
    padding-right: 20px;
    line-height: 1.4;
}

/* 文章元信息美化 */
.article-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 0.9em;
    margin-top: 8px;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.article-meta i {
    color: #983636;
    font-size: 1.1em;
}

/* 文章内容区域美化 */
.article-content {
    color: #2c3e50;
    line-height: 1.8;
    font-size: 1.05em;
    margin: 20px 0;
    padding: 0 5px;
}

.article-content p {
    margin-bottom: 15px;
    text-align: justify;
}

/* 文章图片网格美化 */
.article-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.article-image {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-image:hover img {
    transform: scale(1.05);
}

/* 文章操作区域美化 */
.article-actions {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* 操作按钮基础样式 */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    background: #f8f9fa;
    color: #555;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    min-width: 120px;
}

/* 点赞按钮特殊样式 */
.like-btn {
    background: #fff1f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.like-btn:hover {
    background: #ff4d4f;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.2);
}

.like-btn.liked {
    background: #ff4d4f;
    color: white;
}

/* 评论按钮特殊样式 */
.comment-btn {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

.comment-btn:hover {
    background: #1890ff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.2);
}

/* 删除按钮样式 */
.article-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    color: #999;
    border-radius: 50%;
    font-size: 22px;  /* 增大字体大小 */
    font-weight: 300;  /* 调整字重 */
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    line-height: 1;
}

.article-delete-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 77, 79, 0.1);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.article-delete-btn:hover {
    color: #ff4d4f;
}

.article-delete-btn:hover::before {
    transform: scale(1);
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .article-delete-btn {
        width: 28px;
        height: 28px;
        font-size: 20px;
    }
}

/* 按钮图标样式 */
.action-btn i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.action-btn:hover i {
    transform: scale(1.1);
}

/* 响应式优化 */
@media screen and (max-width: 768px) {
    .article-actions {
        gap: 12px;
        flex-wrap: wrap;
    }

    .action-btn {
        padding: 8px 16px;
        font-size: 14px;
        min-width: auto;
    }

    .article-delete-btn {
        padding: 6px 16px;
        font-size: 14px;
    }

    .action-btn i,
    .article-delete-btn i {
        font-size: 14px;
    }
}

/* 空状态提示 */
.no-articles {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 1.1em;
}

.no-articles i {
    font-size: 3em;
    color: #983636;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 评论区域美化 */
.comments-container {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

/* 评论表单样式 */
.comment-form {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #eee;
}

.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    resize: vertical;
    min-height: 100px;
    font-size: 15px;
    background: white;
    transition: all 0.3s ease;
}

.comment-form textarea:focus {
    border-color: #983636;
    box-shadow: 0 0 0 3px rgba(152, 54, 54, 0.1);
    outline: none;
}

.comment-form .submit-btn {
    margin-top: 15px;
    width: auto;
    padding: 10px 25px;
    float: right;
}

/* 单个评论样式 */
.comment {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.comment:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* 评论头部信息 */
.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.comment-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.comment-author {
    font-weight: 600;
    color: #983636;  /* 使用主题色 */
    font-size: 15px;
}

.comment-date {
    color: #8c8c8c;
    font-size: 13px;
}

/* 评论内容 */
.comment-content {
    color: #4a5568;  /* 更柔和的文字颜色 */
    line-height: 1.6;
    font-size: 15px;
    margin-bottom: 15px;
}

/* 评论操作区 */
.comment-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

/* 回复按钮 */
.reply-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 15px;
    background: transparent;
    border: 1px solid #983636;  /* 使用主题色 */
    color: #983636;  /* 使用主题色 */
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reply-button:hover {
    background: rgba(152, 54, 54, 0.1);
    transform: translateY(-1px);
}

/* 回复区域 */
.replies {
    margin-left: 40px;
    margin-top: 20px;
    padding-left: 20px;
    border-left: 2px solid #983636;  /* 使用主题色 */
}

.reply {
    background: #fafafa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #eee;
}

.reply .comment-author {
    color: #983636;  /* 使用主题色 */
    font-size: 14px;
}

.reply .comment-content {
    color: #4a5568;  /* 更柔和的文字颜色 */
    font-size: 14px;
}

/* 回复表单 */
.reply-form {
    margin: 15px 0;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.reply-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    resize: vertical;
    min-height: 80px;
    font-size: 14px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.reply-form textarea:focus {
    border-color: #983636;
    box-shadow: 0 0 0 2px rgba(152, 54, 54, 0.1);
    outline: none;
}

.reply-form .submit-btn {
    background: #983636;
    color: white;
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 6px;
    margin-top: 0;
}

.reply-form .submit-btn:hover {
    background: #7a2c2c;
}

/* 无评论状态 */
.no-comments {
    text-align: center;
    padding: 30px 20px;
    color: #8c8c8c;
    font-size: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 20px 0;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .comment {
        padding: 15px;
    }

    .replies {
        margin-left: 20px;
        padding-left: 15px;
    }

    .comment-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .comment-actions {
        flex-wrap: wrap;
    }
}

/* 认证区域美化 */
.auth-section {
    max-width: 400px;
    margin: 40px auto;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 登录和注册表单美化 */
.login-form,
.register-form {
    text-align: center;
}

.login-form h2,
.register-form h2 {
    color: #2c3e50;
    font-size: 1.8em;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

.login-form h2::after,
.register-form h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: #983636;
    border-radius: 2px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eef0f2;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus {
    border-color: #983636;
    background: white;
    box-shadow: 0 0 0 3px rgba(152, 54, 54, 0.1);
    outline: none;
}

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

/* 登录注册按钮美化 */
.auth-section .submit-btn {
    width: 100%;
    padding: 12px;
    background: #983636;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.auth-section .submit-btn:hover {
    background: #7a2c2c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(152, 54, 54, 0.2);
}

/* 切换表单链接美化 */
.auth-switch {
    text-align: center;
    color: #666;
    margin-top: 20px;
    font-size: 0.9em;
}

.auth-switch a {
    color: #983636;
    text-decoration: none;
    font-weight: 500;
    margin-left: 5px;
    transition: all 0.3s ease;
}

.auth-switch a:hover {
    color: #7a2c2c;
    text-decoration: underline;
}

/* 用户工具栏样式 */
.user-toolbar {
    display: none; /* 默认隐藏 */
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info i {
    font-size: 24px;
    color: #983636;
}

#currentUsername {
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
}

/* 退出按钮样式 */
.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border: 2px solid #983636;
    color: #983636;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn i {
    font-size: 16px;
}

.logout-btn:hover {
    background: #983636;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(152, 54, 54, 0.2);
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .user-toolbar {
        padding: 12px 15px;
    }
    
    .user-info i {
        font-size: 20px;
    }
    
    #currentUsername {
        font-size: 14px;
    }
    
    .logout-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* 发布按钮样式 */
.submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: #983636;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    display: block;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(152, 54, 54, 0.2);
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    background: #7a2c2c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(152, 54, 54, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(152, 54, 54, 0.2);
}

/* 添加点涟漪效果 */
.submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease-out, height 0.6s ease-out;
}

.submit-btn:active::after {
    width: 300px;
    height: 300px;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .submit-btn {
        padding: 12px 16px;
        font-size: 15px;
    }
}

/* 评论删除按钮样式 */
.comment-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    color: #999;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    line-height: 1;
}

.comment-delete-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 77, 79, 0.1);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.comment-delete-btn:hover {
    color: #ff4d4f;
}

.comment-delete-btn:hover::before {
    transform: scale(1);
}

/* 调整评论头部布局 */
.comment-meta,
.reply-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.comment-info,
.reply-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .comment-delete-btn {
        width: 24px;
        height: 24px;
        font-size: 18px;
    }
}

/* 加载动画样式 */
.loading-spinner {
    text-align: center;
    padding: 40px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #983636;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 删除动画 */
.deleting {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* 错误消息样式 */
.error-message {
    text-align: center;
    padding: 20px;
    color: #ff4d4f;
    background: #fff2f0;
    border-radius: 8px;
    margin: 20px 0;
}

.error-message a {
    color: #983636;
    text-decoration: underline;
    margin-left: 5px;
}

/* 无数据状态 */
.no-data {
    text-align: center;
    padding: 30px 20px;
    color: #8c8c8c;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

/* 禁用状态的按钮样式 */
.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 模态框样式 */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-modal.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 5px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.image-modal.active .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #983636;
}