/* ========== 论坛全局样式（适配干净页面，无多余空白） ========== */
.sf-forum-container {
    max-width: 100%;
    margin: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    font-family: inherit;
    color: inherit;
    line-height: 1.5;
}

/* 两栏布局，间隙与主题一致 */
.sf-two-columns {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.sf-main-content {
    flex: 2;
    min-width: 0;
}

/* 侧边栏宽度与主题一致（约280px） */
.sf-sidebar {
    width: 280px;
    flex-shrink: 0;
}

/* 头部区域 */
.sf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color_border, #f6dfdf);
}

.sf-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: inherit;
}

/* 按钮样式（与主题按钮融合） */
.sf-btn {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: #f5f7fa;
    border: 1px solid #dce5f0;
    border-radius: 0.25rem;
    text-decoration: none;
    color: #2c3e50;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sf-btn-primary {
    background: var(--color_link, #ed5565);
    border-color: var(--color_hover, #da4453);
    color: #fff;
}

.sf-btn-primary:hover {
    background: var(--color_hover, #da4453);
    border-color: var(--color_link, #ed5565);
}

/* 帖子列表表格 */
.sf-topics-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.sf-topics-table th,
.sf-topics-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #edf2f7;
}

.sf-topics-table th {
    background: transparent;
    font-weight: 600;
    border-bottom: 2px solid var(--color_border, #f6dfdf);
}

.sf-topics-table tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* 置顶/精华标签 */
.sf-sticky,
.sf-essence {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-right: 0.375rem;
    font-weight: normal;
}

.sf-sticky {
    background: #fff4e6;
    color: #e67e22;
}

.sf-essence {
    background: #fff8e7;
    color: #f39c12;
}

/* 帖子详情页 */
.sf-single-topic .sf-topic-header {
    border-bottom: 1px solid var(--color_border, #f6dfdf);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
}

.sf-topic-header h2 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
}

.sf-meta {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.sf-topic-content {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0.5rem;
    border: 1px solid var(--color_border, #f6dfdf);
}

/* 回复列表 */
.sf-reply-item {
    margin: 1rem 0;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color_border, #f6dfdf);
}

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

.sf-reply-meta {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.sf-reply-content {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0.5rem 0;
}

/* 操作按钮 */
.sf-like-btn,
.sf-report-btn,
.sf-edit-btn,
.sf-delete-btn {
    background: none;
    border: none;
    color: #4a6fa5;
    cursor: pointer;
    margin-right: 1rem;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
}

.sf-like-btn:hover,
.sf-report-btn:hover,
.sf-edit-btn:hover {
    background: #f0f4f9;
}

.sf-delete-btn {
    color: #e74c3c;
}

/* 管理员操作区域 */
.sf-admin-actions {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

/* 表单元素 */
.sf-input,
.sf-edit-textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #cbd5e0;
    border-radius: 0.25rem;
    font-size: 0.9rem;
}

.sf-input:focus,
.sf-edit-textarea:focus {
    border-color: var(--color_link, #ed5565);
    outline: none;
}

/* 侧边栏小工具（与主题小工具风格一致） */
.sf-widget {
    background: var(--color_bg, #f8f1f2);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 4px rgba(205, 220, 230, 0.5);
    transition: box-shadow 0.2s;
}

.sf-widget:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sf-widget-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color_border, #f6dfdf);
    color: inherit;
}

.sf-widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sf-widget-list li {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.sf-widget-list li a {
    text-decoration: none;
    color: var(--color_link, #ed5565);
}

.sf-widget-list li a:hover {
    color: var(--color_hover, #da4453);
    text-decoration: underline;
}

.sf-reply-count,
.sf-reply-excerpt {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-top: 0.25rem;
}

/* 分页 */
.sf-pagination {
    margin-top: 1.5rem;
    text-align: center;
}

.page-numbers,
.sf-pagination .page-numbers {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    margin: 0 0.2rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    text-decoration: none;
    color: #2c3e50;
}

.page-numbers.current,
.sf-pagination .page-numbers.current {
    background: var(--color_link, #ed5565);
    border-color: var(--color_hover, #da4453);
    color: #fff;
}

/* 错误提示 */
.sf-error {
    background: #fee2e2;
    border-left: 4px solid #e53e3e;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    color: #c53030;
    margin-bottom: 1rem;
}

/* 回复编辑内联表单 */
.sf-edit-reply-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #e2e8f0;
}

/* 深色模式适配 */
.dark .sf-forum-container {
    color: #c1c4c9;
}

.dark .sf-header {
    border-bottom-color: var(--color_border_dark, #4a3235);
}

.dark .sf-topics-table th {
    border-bottom-color: var(--color_border_dark, #4a3235);
}

.dark .sf-topics-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.dark .sf-sticky {
    background: #3a2a1a;
    color: #e67e22;
}

.dark .sf-essence {
    background: #3a2e1a;
    color: #f39c12;
}

.dark .sf-topic-content,
.dark .sf-admin-actions {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color_border_dark, #4a3235);
}

.dark .sf-reply-item {
    border-bottom-color: var(--color_border_dark, #4a3235);
}

.dark .sf-widget {
    background: #21252c;
    box-shadow: 0 0 4px #070b10;
}

.dark .sf-widget-title {
    border-bottom-color: var(--color_border_dark, #4a3235);
}

.dark .sf-widget-list li a {
    color: var(--color_link_dark, #da4d5b);
}

.dark .sf-widget-list li a:hover {
    color: var(--color_hover_dark, #ed5565);
}

.dark .sf-input,
.dark .sf-edit-textarea {
    background: #2c3138;
    border-color: #3a3f45;
    color: #c1c4c9;
}

/* 响应式：移动设备 */
@media (max-width: 768px) {
    .sf-two-columns {
        flex-direction: column;
        gap: 1rem;
    }
    .sf-sidebar {
        width: 100%;
    }
    .sf-topics-table th,
    .sf-topics-table td {
        padding: 0.5rem 0.25rem;
    }
    .sf-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* 修复：发布新帖按钮文字颜色为白色 */
.sf-btn-primary,
.sf-btn-primary:link,
.sf-btn-primary:visited {
    color: #ffffff !important;
}

/* 移除侧边栏的粉色背景（改为透明） */
.sf-widget {
    background: transparent !important;
    box-shadow: none;
    border: 1px solid var(--color_border, #f6dfdf);
}

/* 深色模式下侧边栏同样透明 */
.dark .sf-widget {
    background: transparent !important;
    border-color: var(--color_border_dark, #4a3235);
}