/* 论坛三页统一样式 */

:root {
    --primary-color: #0d9488;
    --text-primary: #0b1224;
    --text-secondary: #5c6578;
}

.forum-container {
    max-width: 1200px;
    margin: 0 auto 2.5rem;
    padding: 0 20px 2rem;
    position: relative;
    z-index: 1;
}

.forum-posts .forum-post-card,
.forum-posts .post-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.forum-posts .forum-post-card:hover,
.forum-posts .post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(13, 148, 136, 0.08);
}

.forum-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(14px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-post {
    background: linear-gradient(135deg, #0d9488, #4f46e5);
    color: white !important;
    padding: 10px 24px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
    box-shadow: 0 4px 18px rgba(13, 148, 136, 0.3);
}

.btn-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(13, 148, 136, 0.35);
}

.btn-admin {
    background: white;
    color: #0d9488;
    padding: 10px 20px;
    border-radius: 20px;
    border: 2px solid #0d9488;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-admin:hover {
    background: linear-gradient(135deg, #0d9488, #4f46e5);
    color: white;
    border-color: transparent;
}

.forum-categories {
    display: flex;
    gap: 12px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.category-tag {
    padding: 8px 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(15, 23, 42, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 0.875rem;
}

.category-tag:hover,
.category-tag.active {
    background: linear-gradient(135deg, #0d9488, #4f46e5);
    color: white;
    border-color: transparent;
}

.forum-posts {
    display: grid;
    gap: 1rem;
}

.post-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(14px);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.post-card:hover {
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, 0.3);
    box-shadow: 0 16px 40px rgba(13, 148, 136, 0.1);
}

.post-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

.post-category.stationery { background: #fff3e0; color: #f57c00; }
.post-category.cultural { background: #e8f5e9; color: #388e3c; }
.post-category.book { background: #e3f2fd; color: #1976d2; }
.post-category.general { background: #f3e5f5; color: #7b1fa2; }

.post-title {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-weight: 600;
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-content {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
    font-size: 0.875rem;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    font-size: 0.8125rem;
    color: #94a3b8;
    flex-wrap: wrap;
    gap: 8px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar,
.author-avatar-large {
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}

.author-avatar { width: 32px; height: 32px; font-size: 0.875rem; }
.author-avatar-large { width: 40px; height: 40px; font-size: 1.1rem; }

.post-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.stat-item svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    flex-shrink: 0;
    opacity: 0.75;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 15px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.875rem;
}

.page-btn:hover:not(:disabled),
.page-btn.active {
    background: linear-gradient(135deg, #0d9488, #4f46e5);
    color: white;
    border-color: transparent;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.empty-state {
    text-align: center;
    padding: 3.5rem 20px;
    color: #94a3b8;
}

.empty-icon {
    margin-bottom: 1.25rem;
    color: #0d9488;
    opacity: 0.55;
}

.empty-icon svg {
    width: 48px;
    height: 48px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

/* 发帖 / 详情 */
.new-post-container,
.detail-container {
    max-width: 900px;
    margin: 0 auto 2.5rem;
    padding: 0 20px 2rem;
    position: relative;
    z-index: 1;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(14px);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.back-btn:hover {
    transform: translateX(-4px);
    border-color: rgba(34, 211, 238, 0.3);
    color: #0f766e;
}

.new-post-card,
.post-detail-card {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(14px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
}

.post-detail-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.post-detail-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.4;
    font-weight: 700;
}

.post-detail-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: #94a3b8;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.post-detail-content {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.post-detail-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.post-detail-tags span {
    padding: 5px 14px;
    background: rgba(34, 211, 238, 0.1);
    border-radius: 999px;
    font-size: 0.8125rem;
    color: #0f766e;
    border: 1px solid rgba(34, 211, 238, 0.2);
}

.post-detail-stats {
    display: flex;
    gap: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    color: #94a3b8;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.post-detail-stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* 评论区 */
.comments-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(14px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.comments-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.comment-item {
    background: rgba(248, 250, 252, 0.9);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 12px;
    border: 1px solid rgba(15, 23, 42, 0.05);
    transition: border-color 0.3s ease;
}

.comment-item:hover {
    border-color: rgba(34, 211, 238, 0.2);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 12px;
}

.comment-author {
    font-weight: 600;
    color: #0f766e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-author-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #14b8a6, #6366f1);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.comment-time {
    font-size: 0.75rem;
    color: #94a3b8;
}

.comment-content {
    color: var(--text-secondary);
    line-height: 1.7;
    padding-left: 34px;
    font-size: 0.9375rem;
}

.comment-reply-btn {
    color: #0f766e;
    cursor: pointer;
    font-size: 0.8125rem;
    margin-left: 8px;
}

.comment-replies {
    margin-left: 34px;
    margin-top: 10px;
    padding-left: 14px;
    border-left: 2px solid rgba(34, 211, 238, 0.2);
}

.reply-item {
    background: white;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.comment-form {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(248, 250, 252, 0.9);
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.comment-form-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9375rem;
}

.form-input,
.form-select,
.form-textarea,
.comment-input,
.comment-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 10px;
    font-size: 0.9375rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: white;
}

.form-textarea,
.comment-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.comment-input:focus,
.comment-textarea:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.btn-submit,
.btn-comment {
    background: linear-gradient(135deg, #0d9488, #4f46e5);
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
}

.btn-submit:hover,
.btn-comment:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(13, 148, 136, 0.3);
}

.btn-cancel {
    padding: 10px 25px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
}

.no-comments {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
    font-style: italic;
}

/* 管理弹窗 */
.admin-panel,
.login-modal,
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 11, 20, 0.55);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.admin-panel.show,
.login-modal.show,
.modal.show {
    display: flex;
}

.admin-panel-content,
.login-box,
.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 2rem;
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.15);
}

.login-box { max-width: 400px; }

.login-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.login-error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: none;
}

.login-error.show { display: block; }

.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.post-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.btn-delete {
    background: #ef4444;
    color: white;
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8125rem;
}

@media (max-width: 640px) {
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .forum-toolbar {
        justify-content: center;
    }
}
