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

:root {
    --primary-color: #333;
    --secondary-color: #555;
    --background-color: #f4f4f4;
    --text-color: #333;
    --container-width: 1200px;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
}

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 20px;
}

header {
    background: var(--primary-color);
    color: #fff;
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    margin: 0.5rem;
    font-size: clamp(1.5rem, 4vw, 2rem);
}

nav {
    display: flex;
    gap: 1rem;
    padding: 0.5rem;
    align-items: center;
}

nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    position: relative;
}

nav a:hover {
    background-color: var(--secondary-color);
}

/* 添加未读消息徽章样式 */
.unread-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e53935;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.welcome-message {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 2rem auto;
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(51,51,51,0.1);
}

/* 基础按钮样式 */
button {
    background: var(--primary-color);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 100px;
}

button:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

button:active {
    transform: translateY(0);
    box-shadow: none;
}

/* 编辑和删除按钮样式 */
.btn-edit, .btn-delete {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    min-width: 80px;
    border-radius: 4px;
}

.btn-edit {
    background: var(--primary-color);
    color: #fff;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
}

.btn-delete:hover {
    background-color: #c82333;
}

/* 管理员删除按钮样式 */
.is-admin .btn-delete {
    background-color: #6c757d;
}

.is-admin .btn-delete:hover {
    background-color: #5a6268;
}

/* 帖子操作按钮容器 */
.post-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* 评论操作按钮样式 */
.comment-actions {
    margin-left: 2.5rem;
    margin-top: 0.8rem;
    display: flex;
    gap: 0.8rem;
}

.btn-reply, 
.btn-delete-comment,
.btn-cancel-reply {
    background: none;
    border: none;
    color: #666;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    min-width: auto;
    transition: all 0.2s ease;
}

.btn-reply:hover, 
.btn-delete-comment:hover,
.btn-cancel-reply:hover {
    color: var(--primary-color);
    background: #f0f0f0;
    border-radius: 4px;
}

.btn-delete-comment {
    color: #dc3545;
}

.btn-delete-comment:hover {
    background: #fff5f5;
}

/* 移动端按钮样式优化 */
@media (max-width: 768px) {
    button {
        padding: 0.7rem 1.2rem;
        font-size: 0.95rem;
        min-width: 90px;
    }

    .btn-edit, .btn-delete {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        min-width: 70px;
    }

    .post-actions {
        gap: 0.6rem;
    }

    .comment-actions {
        gap: 0.6rem;
    }

    .btn-reply, 
    .btn-delete-comment,
    .btn-cancel-reply {
        padding: 0.3rem 0.6rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        min-width: 80px;
    }

    .btn-edit, .btn-delete {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        min-width: 60px;
    }

    .post-actions {
        gap: 0.5rem;
    }

    .comment-actions {
        gap: 0.5rem;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 10px;
    }

    header {
        flex-direction: column;
        text-align: center;
        padding: 0.8rem;
    }

    nav {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        margin-top: 0.5rem;
    }

    nav a, .btn-create-post {
        width: 100%;
        text-align: center;
        padding: 0.6rem;
    }

    .welcome-text {
        margin: 0.5rem 0;
        display: block;
        width: 100%;
    }

    .search-container {
        width: 100%;
        margin-top: 0.8rem;
        margin-left: 0;
    }

    .search-container form {
        width: 100%;
    }

    /* 首页内容区域响应式 */
    .content-wrapper {
        grid-template-columns: 1fr !important;
    }
    
    .sidebar {
        order: 2;
        margin-top: 1rem;
    }
    
    .main-content {
        order: 1;
    }

    /* 帖子详情页响应式 */
    .post-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    .post-footer {
        flex-direction: column;
        gap: 1rem;
    }

    .post-actions {
        width: 100%;
        justify-content: flex-start;
    }

    /* 评论区域响应式 */
    .comment-item {
        padding: 0.8rem 0.5rem;
    }

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

    .comment-replies {
        margin-left: 1rem;
        padding-left: 0.5rem;
    }

    /* 用户主页响应式 */
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .user-info {
        width: 100%;
    }

    .profile-content {
        grid-template-columns: 1fr;
    }

    /* 私信页面响应式 */
    .message-item {
        max-width: 90%;
    }

    .modal-content {
        margin: 20% auto;
        width: 90%;
        padding: 1.5rem;
    }
}

/* 更小屏幕的额外样式 */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.3rem;
    }

    .post-title {
        font-size: 1.4rem;
    }

    .btn-send-message {
        width: 100%;
        justify-content: center;
    }

    .form {
        padding: 1rem;
    }

    input, button, textarea, select {
        padding: 0.6rem;
        font-size: 0.95rem;
    }

    .comment-actions, .post-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .btn-reply, .btn-delete-comment {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .post-card {
        padding: 0.8rem;
    }
    
    .conversation-item a {
        flex-wrap: wrap;
    }
    
    .conversation-time {
        width: 100%;
        text-align: right;
        margin-top: 0.5rem;
    }
}

/* 在现有样式的基础上添加 */
.welcome-text {
    color: #fff;
    padding: 0.5rem 1rem;
    margin-right: 1rem;
}

/* 个人中心样式 */
.profile-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
}

.profile-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.avatar-section input[type="file"] {
    display: none;
}

.btn-change-avatar {
    background: var(--primary-color);
    color: #fff;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.btn-change-avatar:hover {
    background: var(--secondary-color);
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    transition: transform 0.3s;
}

.avatar:hover {
    transform: scale(1.05);
}

.user-info {
    flex: 1;
}

.user-info h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.user-info p {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.profile-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-section {
    background: #f8f8f8;
    padding: 1.5rem;
    border-radius: 8px;
}

.profile-section h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(51,51,51,0.1);
}

/* 添加全宽样式 */
.profile-section.full-width {
    width: 100%;
}

/* 登录和注册页面样式 */
.login-container, .register-container {
    max-width: 450px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-container h1, .register-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.login-footer, .register-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.login-footer a, .register-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.login-footer a:hover, .register-footer a:hover {
    text-decoration: underline;
}

/* 响应式设计增强 */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 10px;
    }

    header {
        flex-direction: column;
        text-align: center;
        padding: 0.8rem;
    }

    nav {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        margin-top: 0.5rem;
    }

    nav a, .btn-create-post {
        width: 100%;
        text-align: center;
        padding: 0.6rem;
    }

    .welcome-text {
        margin: 0.5rem 0;
        display: block;
        width: 100%;
    }

    .search-container {
        width: 100%;
        margin-top: 0.8rem;
        margin-left: 0;
    }

    .search-container form {
        width: 100%;
    }

    /* 首页内容区域响应式 */
    .content-wrapper {
        grid-template-columns: 1fr !important;
    }
    
    .sidebar {
        order: 2;
        margin-top: 1rem;
    }
    
    .main-content {
        order: 1;
    }

    /* 帖子详情页响应式 */
    .post-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    .post-footer {
        flex-direction: column;
        gap: 1rem;
    }

    .post-actions {
        width: 100%;
        justify-content: flex-start;
    }

    /* 评论区域响应式 */
    .comment-item {
        padding: 0.8rem 0.5rem;
    }

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

    .comment-replies {
        margin-left: 1rem;
        padding-left: 0.5rem;
    }

    /* 用户主页响应式 */
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .user-info {
        width: 100%;
    }

    .profile-content {
        grid-template-columns: 1fr;
    }

    /* 私信页面响应式 */
    .message-item {
        max-width: 90%;
    }

    .modal-content {
        margin: 20% auto;
        width: 90%;
        padding: 1.5rem;
    }
    
    /* 登录注册页面响应式 */
    .login-container, .register-container {
        max-width: 100%;
        padding: 1.5rem;
    }
    
    /* 发布帖子页面响应式 */
    .post-form {
        padding: 1rem;
        max-width: 100%;
    }
    
    .post-form .form-group {
        margin-bottom: 1rem;
    }
    
    /* TinyMCE编辑器响应式 */
    .tox-tinymce {
        height: 300px !important;
        border-radius: 4px !important;
    }
    
    /* TinyMCE工具栏响应式 */
    .tox-toolbar__group {
        flex-wrap: wrap !important;
    }
    
    /* TinyMCE弹窗响应式 */
    .tox-dialog {
        width: 95% !important;
        max-width: 95vw !important;
        max-height: 95vh !important;
    }
    
    .tox-dialog__body-content {
        max-height: 50vh !important;
    }
}

/* 更小屏幕的额外样式 */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.3rem;
    }

    .post-title {
        font-size: 1.4rem;
    }

    .btn-send-message {
        width: 100%;
        justify-content: center;
    }

    .form {
        padding: 1rem;
    }

    input, button, textarea, select {
        padding: 0.6rem;
        font-size: 0.95rem;
    }

    .comment-actions, .post-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .btn-reply, .btn-delete-comment {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .post-card {
        padding: 0.8rem;
    }
    
    .conversation-item a {
        flex-wrap: wrap;
    }
    
    .conversation-time {
        width: 100%;
        text-align: right;
        margin-top: 0.5rem;
    }
    
    /* 个人中心在小屏幕上的优化 */
    .avatar {
        width: 120px;
        height: 120px;
    }
    
    .profile-container {
        padding: 1rem;
    }
    
    .profile-section {
        padding: 1rem;
    }
    
    /* 修正删除帖子按钮在小屏幕上的样式 */
    .btn-delete {
        width: auto;
    }
    
    /* TinyMCE在超小屏幕上的优化 */
    .tox-toolbar-overlord, .tox-toolbar__primary {
        flex-wrap: wrap !important;
    }
    
    .tox-statusbar {
        display: none !important; /* 在超小屏幕上隐藏状态栏 */
    }
    
    /* 调整编辑器内部内容区域 */
    .tox-edit-area {
        height: 250px !important;
    }
    
    /* 更多小屏幕优化 */
    .post-form button[type="submit"] {
        margin-top: 1.5rem;
        height: 44px; /* 增加按钮高度，方便触摸 */
    }
    
    select, input {
        font-size: 16px !important; /* 防止iOS上的自动缩放 */
    }
}

/* 首页布局 */
.content-wrapper {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

/* 侧边栏样式 */
.sidebar {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.category-list h2, .stats-box h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.category-list ul, .stats-box ul {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.category-list a:hover {
    background-color: #f0f0f0;
}

.post-count {
    color: #666;
    font-size: 0.9rem;
}

.stats-box {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.stats-box li {
    margin-bottom: 0.5rem;
    color: #666;
}

/* 帖子列表样式 */
.main-content section {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-content h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.post-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: transform 0.3s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.post-meta {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.author {
    font-weight: bold;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.author a:hover {
    color: #0066cc;
    text-decoration: underline;
}

/* 添加帖子作者私信按钮样式 */
.btn-message-author {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
    margin-left: 0.5rem;
}

.btn-message-author:hover {
    background-color: var(--secondary-color);
    text-decoration: none;
}

.btn-message-author .icon-message::before {
    content: "\1F4AC";
    font-size: 0.9rem;
}

.date {
    color: #666;
    font-size: 0.9rem;
}

.post-preview {
    color: #666;
    margin: 0.5rem 0;
}

.post-stats {
    display: flex;
    gap: 1rem;
    color: #666;
    font-size: 0.9rem;
}

/* 添加浏览量图标样式 */
.icon-view::before {
    content: "\1F441"; /* 眼睛的Unicode编码 */
    margin-right: 0.3rem;
}

.icon-comment::before {
    content: "\1F4AC"; /* 评论气泡的Unicode编码 */
    margin-right: 0.3rem;
}

.btn-create-post {
    background: var(--primary-color);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-create-post:hover {
    background: var(--secondary-color);
}

/* 发帖表单样式 */
.post-form {
    max-width: 800px;
    margin: 0 auto;
}

.post-form textarea {
    min-height: 200px;
    }
    
/* TinyMCE 编辑器移动端适配 */
.tox-tinymce {
    border-radius: 4px !important;
    border: 1px solid #ddd !important;
}

/* 调整TinyMCE弹窗在移动设备上的样式 */
.tox-dialog {
    max-width: 95vw !important;
}

.tox-dialog__body-content {
    max-height: 60vh !important;
}

select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #fff;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(51,51,51,0.1);
}

/* 帖子详情页样式 */
.post-detail {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.post-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #666;
}

.category {
    background: var(--primary-color);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.post-content {
    line-height: 1.8;
    margin-bottom: 2rem;
    word-break: break-word;
}

/* 富文本内容样式 */
.post-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 4px;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.post-content table th,
.post-content table td {
    border: 1px solid #ddd;
    padding: 0.5rem;
}

.post-content table th {
    background-color: #f1f1f1;
}

.post-content pre {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

.post-content blockquote {
    border-left: 4px solid #ddd;
    padding-left: 1rem;
    color: #666;
    margin: 1rem 0;
}

.post-content ul,
.post-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin: 1.5rem 0 1rem;
    color: var(--primary-color);
}

.post-content p {
    margin: 1rem 0;
}

.post-content a {
    color: #0066cc;
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.post-actions {
    display: flex;
    gap: 1rem;
}

.btn-edit, .btn-delete {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-edit {
    background: var(--primary-color);
    color: #fff;
    border: none;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-delete:hover {
    background-color: #c82333;
}

/* 管理员删除按钮样式 */
.is-admin .btn-delete {
    background-color: #6c757d;
}

.is-admin .btn-delete:hover {
    background-color: #5a6268;
}

/* 评论区样式 */
.comments-section {
    margin-top: 3rem;
}

.comment-form {
    margin: 1rem 0 2rem;
}

.comment-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1rem;
    resize: vertical;
}

.comment-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.comment-content {
    margin-left: 2.5rem;
    line-height: 1.6;
}

/* 评论操作按钮样式 */
.comment-actions {
    margin-left: 2.5rem;
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.btn-reply, 
.btn-delete-comment,
.btn-cancel-reply {
    background: none;
    border: none;
    color: #666;
    font-size: 0.9rem;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    width: auto;
}

.btn-reply:hover, 
.btn-delete-comment:hover,
.btn-cancel-reply:hover {
    color: var(--primary-color);
    background: #f0f0f0;
    border-radius: 4px;
}

.btn-delete-comment {
    color: #dc3545;
}

/* 回复信息样式 */
.reply-info {
    background-color: #f5f5f5;
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 评论回复区域 */
.comment-replies {
    margin-left: 2.5rem;
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #eee;
}

.reply-item {
    padding: 0.5rem 0;
    border-bottom: 1px dashed #eee;
}

.reply-item:last-child {
    border-bottom: none;
}

.reply-to {
    font-size: 0.9rem;
    color: #666;
    margin-right: 0.5rem;
}

.btn-load-more-replies {
    background: none;
    border: none;
    color: var(--primary-color);
    margin-left: 2.5rem;
    margin-top: 0.5rem;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    width: auto;
}

.btn-load-more-replies:hover {
    text-decoration: underline;
    background: #f5f5f5;
    border-radius: 4px;
}

.login-to-comment {
    text-align: center;
    padding: 2rem;
    background: #f8f8f8;
    border-radius: 4px;
}

.login-to-comment a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

/* 栏目页面样式 */
.category-detail {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.category-description {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f8f8;
    border-radius: 4px;
}

.no-posts {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    gap: 0.5rem;
}

.pagination a, 
.pagination .current-page {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
}

.pagination .current-page {
    background-color: var(--primary-color);
    color: #fff;
}

.pagination a:hover {
    background-color: #f0f0f0;
}

/* 搜索框样式 */
.search-container {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.search-container form {
    display: flex;
    width: 300px;
}

.search-container input {
    flex-grow: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.search-container button {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.search-container button:hover {
    background: var(--secondary-color);
}

/* 搜索结果页样式 */
.search-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.search-header h2 {
    color: var(--primary-color);
}

.search-header p {
    color: #666;
}

/* 我的发帖样式 */
.my-posts {
    margin-top: 1rem;
}

.my-posts .post-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.my-posts .post-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.my-posts .post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.my-posts .category {
    background: var(--primary-color);
    color: #fff;
    padding: 0.2rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.my-posts .date {
    color: #666;
    font-size: 0.9rem;
}

.my-posts h4 {
    margin: 0.5rem 0;
}

.my-posts h4 a {
    color: #333;
    text-decoration: none;
}

.my-posts h4 a:hover {
    color: var(--primary-color);
}

.my-posts .post-preview {
    color: #666;
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.my-posts .post-stats {
    color: #666;
    font-size: 0.9rem;
}

.my-posts .post-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.my-posts .btn-edit,
.my-posts .btn-delete {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    min-width: 80px;
    text-align: center;
}

.my-posts .btn-edit {
    background: var(--primary-color);
    color: white;
    border: none;
    text-decoration: none;
    display: inline-block;
}

.my-posts .btn-delete {
    background: #ff4444;
    color: white;
    border: none;
    width: auto;
}

.no-posts {
    text-align: center;
    padding: 2rem;
    background: #f8f8f8;
    border-radius: 8px;
}

.no-posts p {
    color: #666;
    margin-bottom: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
}

@media (max-width: 768px) {
    .search-container form {
        width: 100%;
    }
} 

/* 添加全宽样式 */
.profile-section.full-width {
    width: 100%;
}

@media (max-width: 768px) {
    .profile-content {
        grid-template-columns: 1fr;
    }
    .profile-section.full-width {
        width: 100%;
    }
}

/* 用户主页相关样式 */
.user-bio {
    margin: 1rem 0;
    line-height: 1.6;
    color: #555;
}

.user-stats {
        margin-top: 1rem;
    padding: 0.5rem;
    background: #f8f8f8;
    border-radius: 4px;
}

.user-stats p {
    margin: 0.5rem 0;
    color: #555;
}

/* 添加用户操作区域和私信按钮样式 */
.user-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.btn-send-message {
    background: var(--primary-color);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s;
}

.btn-send-message:hover {
    background: var(--secondary-color);
}

.icon-message::before {
    content: "\1F4AC"; /* 消息气泡的Unicode编码 */
    margin-right: 0.3rem;
}

.comments-list {
    margin-top: 1rem;
}

.comments-list .comment-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
}

.comments-list .comment-content {
    margin-bottom: 0.5rem;
}

.comments-list .comment-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #777;
}

.no-comments {
    padding: 2rem;
    text-align: center;
    color: #777;
}

/* 移动端侧边栏样式 */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background-color: #fff;
    z-index: 1000;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transition: left 0.3s ease;
}

.mobile-sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.sidebar-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 5px;
    width: auto;
}

.close-sidebar:hover {
    color: var(--primary-color);
}

.mobile-category-list,
.mobile-stats-box {
    margin-bottom: 20px;
}

.mobile-category-list h2,
.mobile-stats-box h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--primary-color);
}

.mobile-category-list ul,
.mobile-stats-box ul {
    list-style: none;
    padding: 0;
}

.mobile-category-list li {
    margin-bottom: 10px;
}

.mobile-category-list a {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.mobile-category-list a:hover {
    background-color: #f0f0f0;
}

.mobile-stats-box li {
    margin-bottom: 8px;
    color: #666;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: white;
    cursor: pointer;
    padding: 5px 10px;
    width: auto;
}

.mobile-menu-btn:hover {
    background-color: var(--secondary-color);
    border-radius: 4px;
}

/* 桌面版侧边栏默认显示 */
.desktop-sidebar {
    display: block;
}

/* 响应式设计增强 */
@media (max-width: 768px) {
    /* 隐藏桌面版侧边栏 */
    .desktop-sidebar {
        display: none;
    }
    
    /* 显示移动端菜单按钮 */
    .mobile-menu-btn {
        display: block;
        order: -1; /* 确保在导航条最左侧 */
        margin-right: 10px;
    }
    
    /* 调整头部布局 */
    header {
        flex-direction: column;
        text-align: center;
        padding: 0.8rem;
    }

    nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* 确保菜单按钮位于左侧 */
    nav .mobile-menu-btn {
        margin-right: auto;
    }
    
    /* 内容区域占据整个宽度 */
    .content-wrapper {
        grid-template-columns: 1fr !important;
    }
    
    .main-content {
        width: 100%;
    }
    
    /* 搜索框占满宽度 */
    .search-container {
        width: 100%;
        margin-top: 0.8rem;
    }
    
    .search-container form {
        display: flex;
        width: 100%;
    }
    
    .search-container input {
        flex-grow: 1;
    }
}

/* 更小屏幕的额外样式 */
@media (max-width: 480px) {
    .mobile-sidebar {
        width: 260px;
    }
    
    /* 确保菜单按钮始终可见 */
    .mobile-menu-btn {
        font-size: 1.3rem;
        padding: 8px 12px;
    }
    
    /* 侧边栏内容调整 */
    .mobile-category-list h2,
    .mobile-stats-box h3 {
        font-size: 1.2rem;
    }
    
    .mobile-category-list a {
        padding: 10px 8px;
        font-size: 0.95rem;
    }
}

/* 移动端侧边栏样式增强 */
.mobile-nav-links {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.mobile-nav-links ul {
    list-style: none;
    padding: 0;
}

.mobile-nav-links li {
    margin-bottom: 10px;
}

.mobile-nav-links a {
    display: flex;
    align-items: center;
    padding: 10px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.mobile-nav-links a:hover {
    background-color: #f0f0f0;
}

.mobile-nav-links i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

.mobile-nav-links .unread-badge {
    position: relative;
    top: -2px;
    margin-left: 5px;
}

.sidebar-header h3 {
    font-size: 1.2rem;
    margin: 0;
    color: var(--primary-color);
}

/* 增强侧边栏样式 */
.mobile-sidebar {
    width: 280px;
    padding: 15px;
    background-color: #fff;
    z-index: 1001;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.mobile-category-list h2,
.mobile-stats-box h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .mobile-sidebar {
        width: 260px;
    }
    
    .mobile-nav-links a {
        padding: 12px 10px;
        font-size: 0.95rem;
    }
    
    .mobile-nav-links i {
        font-size: 1.1rem;
    }
}

/* 移动端导航优化 */
@media (max-width: 768px) {
    /* 隐藏非必要导航项 */
    .header-nav-item-mobile-hidden {
        display: none !important;
    }
    
    /* 调整导航布局 */
    header nav {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        width: 100%;
    }
    
    /* 汉堡菜单按钮始终位于左侧 */
    .mobile-menu-btn {
        order: -1;
        margin-right: 10px;
    }
    
    /* 主标题和导航条居中 */
    header h1 {
        width: 100%;
        text-align: center;
        margin: 0.5rem 0;
    }
    
    /* 优化搜索框 */
    .search-container {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* 移动端未读消息样式 */
    .unread-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        min-width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }
}

/* 移动端超小屏幕额外优化 */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.3rem;
    }
    
    .mobile-menu-btn {
        padding: 8px;
    }
    
    /* 导航按钮紧凑布局 */
    nav a {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
}
