/* ==========================================================================
   bbPress 论坛模板样式
   ========================================================================== */

/* --- 隐藏 bbPress 默认论坛角色标签（Keymaster/Participant 等） --- */
.bbp-author-role {
    display: none !important;
}

/* --- 隐藏默认的 bbPress 论坛图标 --- */
.bbp-forum-title::before {
    content: none !important;
}

/* --- 自定义版块图标样式 --- */
#bbpress-forums .bbp-forum-info .bbp-forum-content::before {
    content: '\f108';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 8px;
    color: var(--bt-primary);
}

/* --- 论坛主容器 --- */

/* --- 话题标签和描述 --- */
.bt-topic-meta-bar {
    margin-bottom: var(--bt-space-md);
}

.bt-topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bt-topic-tags a {
    display: inline-block;
    padding: 2px 10px;
    font-size: 0.75rem;
    color: var(--bt-primary);
    background: var(--bt-primary-bg, #e8f0fe);
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.2s;
}

.bt-topic-tags a:hover {
    background: var(--bt-primary);
    color: #fff;
}

.bt-topic-description {
    margin-top: var(--bt-space-sm);
    font-size: 0.875rem;
    color: var(--bt-text-secondary, #666);
    line-height: 1.6;
}

/* --- 回复分页（上方） --- */
.bt-reply-pagination--top {
    margin-bottom: var(--bt-space-md);
    padding-bottom: var(--bt-space-sm);
    border-bottom: 1px solid var(--bt-border, #e2e8f0);
}
.bt-bbpress {
    min-height: calc(100vh - var(--bt-header-height) - 200px);
    padding-bottom: var(--bt-space-3xl);
}

.bt-bbpress-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--bt-space-lg);
}

.bt-bbpress-content {
    margin-top: var(--bt-space-lg);
}

/* --- 论坛页面头部 --- */
.bt-forum-header {
    background: linear-gradient(135deg, #0d47a1 0%, #1a73e8 50%, #00bcd4 100%);
    color: #fff;
    padding: var(--bt-space-2xl) var(--bt-space-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.bt-forum-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    animation: heroPattern 25s linear infinite;
}

.bt-forum-header-content {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
}

.bt-forum-header-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: var(--bt-space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--bt-space-sm);
    line-height: 1.3;
}

.bt-forum-header-icon {
    flex-shrink: 0;
    opacity: 0.85;
}

.bt-forum-header-desc {
    font-size: 0.938rem;
    opacity: 0.9;
    line-height: 1.7;
    margin: 0;
}

/* --- 面包屑导航 --- */
.bt-breadcrumb {
    padding: var(--bt-space-md) 0;
    margin-top: var(--bt-space-lg);
}

.bt-breadcrumb-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--bt-space-xs);
    font-size: 0.813rem;
    color: var(--bt-text-muted);
}

.bt-breadcrumb-home {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--bt-text-secondary);
    text-decoration: none;
    transition: var(--bt-transition-fast);
}

.bt-breadcrumb-home:hover {
    color: var(--bt-primary);
}

.bt-breadcrumb-sep {
    display: inline-flex;
    align-items: center;
    color: var(--bt-text-muted);
    opacity: 0.5;
}

.bt-breadcrumb-item a {
    color: var(--bt-text-secondary);
    text-decoration: none;
    transition: var(--bt-transition-fast);
}

.bt-breadcrumb-item a:hover {
    color: var(--bt-primary);
}

/* --- 论坛列表（索引页） --- */
.bt-forum-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--bt-space-md);
}

.bt-forum-category {
    margin-bottom: var(--bt-space-md);
}

.bt-forum-category-header {
    display: flex;
    align-items: center;
    gap: var(--bt-space-sm);
    margin-bottom: var(--bt-space-md);
    padding-bottom: var(--bt-space-sm);
    border-bottom: 2px solid var(--bt-border);
}

.bt-forum-category-icon {
    color: var(--bt-primary);
    flex-shrink: 0;
}

.bt-forum-category-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--bt-text-primary);
    margin: 0;
}

.bt-forum-category-desc {
    font-size: 0.813rem;
    color: var(--bt-text-secondary);
    margin-left: auto;
}

.bt-forum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--bt-space-md);
}

/* --- 论坛卡片 --- */
.bt-forum-item {
    background: var(--bt-bg-primary);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-lg);
    overflow: hidden;
    transition: var(--bt-transition);
    position: relative;
}

.bt-forum-item:hover {
    border-color: var(--bt-primary-light);
    box-shadow: var(--bt-shadow-md);
    transform: translateY(-2px);
}

.bt-forum-item--new {
    border-color: var(--bt-primary);
}

.bt-forum-new-dot {
    position: absolute;
    top: var(--bt-space-md);
    right: var(--bt-space-md);
    width: 10px;
    height: 10px;
    background: var(--bt-primary);
    border-radius: var(--bt-radius-full);
    animation: bt-pulse 2s ease-in-out infinite;
}

@keyframes bt-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

.bt-forum-item-link {
    display: flex;
    flex-direction: column;
    gap: var(--bt-space-sm);
    padding: var(--bt-space-lg);
    text-decoration: none;
    color: inherit;
}

.bt-forum-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--bt-space-md);
}

.bt-forum-item-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--bt-radius-md);
    background: var(--bt-primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bt-primary);
    flex-shrink: 0;
}

.bt-forum-item-text {
    flex: 1;
    min-width: 0;
}

.bt-forum-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bt-text-primary);
    margin: 0 0 var(--bt-space-xs);
    line-height: 1.4;
}

.bt-forum-item-link:hover .bt-forum-item-title {
    color: var(--bt-primary);
}

.bt-forum-item-desc {
    font-size: 0.813rem;
    color: var(--bt-text-secondary);
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- 论坛统计（第二行） --- */
.bt-forum-stats {
    display: flex;
    align-items: center;
    gap: var(--bt-space-md);
    flex-shrink: 0;
    padding-left: 68px; /* 与图标+间距对齐 */
}

.bt-forum-stat {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.bt-forum-stat-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bt-text-primary);
    line-height: 1.2;
}

.bt-forum-stat-label {
    font-size: 0.688rem;
    color: var(--bt-text-muted);
}

.bt-forum-freshness {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.bt-forum-freshness-label {
    font-size: 0.688rem;
    color: var(--bt-text-muted);
}

.bt-forum-freshness-time {
    font-size: 0.75rem;
    color: var(--bt-text-secondary);
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bt-forum-freshness-time a {
    color: var(--bt-text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
}

.bt-forum-freshness-time a:hover {
    color: var(--bt-primary);
    text-decoration: none;
}

/* 暂无话题样式 */
.bt-forum-no-topics {
    font-size: 0.75rem;
    color: var(--bt-text-muted);
}

/* --- 子版块 --- */
.bt-forum-subforums {
    padding: var(--bt-space-sm) var(--bt-space-lg) var(--bt-space-md);
    border-top: 1px solid var(--bt-border);
    font-size: 0.75rem;
    color: var(--bt-text-muted);
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: var(--bt-space-xs);
}

.bt-forum-subforums-label {
    color: var(--bt-text-secondary);
    font-weight: 500;
}

.bt-forum-subforums-sep {
    color: var(--bt-text-muted);
}

.bt-forum-subforums a {
    color: var(--bt-primary);
    text-decoration: none;
}

.bt-forum-subforums a:hover {
    text-decoration: underline;
}

/* --- 单个论坛头部 --- */
.bt-single-forum-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--bt-space-md);
    padding: var(--bt-space-lg);
    background: var(--bt-bg-primary);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-lg);
    margin-bottom: var(--bt-space-md);
}

.bt-single-forum-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--bt-text-primary);
    margin: 0 0 var(--bt-space-xs);
}

.bt-single-forum-desc {
    font-size: 0.875rem;
    color: var(--bt-text-secondary);
    margin: 0;
    line-height: 1.6;
}

.bt-single-forum-header-right {
    flex-shrink: 0;
}

.bt-btn-subscribed {
    background: var(--bt-primary-bg) !important;
    border-color: var(--bt-primary) !important;
    color: var(--bt-primary) !important;
}

/* --- 论坛操作栏 --- */
.bt-single-forum-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--bt-space-md);
    flex-wrap: wrap;
    gap: var(--bt-space-sm);
}

.bt-forum-action-hint {
    font-size: 0.813rem;
    color: var(--bt-text-muted);
    font-style: italic;
}

/* --- 话题列表 --- */
.bt-topic-list {
    background: var(--bt-bg-primary);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-lg);
    overflow: hidden;
}

/* --- 话题项 --- */

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

.bt-topic-item:hover {
    background: var(--bt-primary-bg);
}

.bt-topic-item--sticky {
    background: rgba(26, 115, 232, 0.03);
}

.bt-topic-item--sticky:hover {
    background: rgba(26, 115, 232, 0.06);
}

.bt-topic-item--super-sticky {
    background: rgba(26, 115, 232, 0.05);
    border-left: 3px solid var(--bt-primary);
}

.bt-topic-item--closed {
    opacity: 0.75;
}

.bt-topic-item--closed:hover {
    opacity: 0.9;
}

/* --- 话题图标 --- */
.bt-topic-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--bt-radius-md);
    background: var(--bt-bg-secondary);
    color: var(--bt-text-muted);
    flex-shrink: 0;
}

.bt-icon-super-sticky {
    color: var(--bt-accent);
}

.bt-icon-sticky {
    color: var(--bt-primary);
}

.bt-icon-closed {
    color: var(--bt-text-muted);
}

.bt-icon-topic {
    color: var(--bt-text-secondary);
}

/* --- 话题标题 --- */
.bt-topic-col-title {
    min-width: 0;
}

.bt-topic-title-row {
    display: flex;
    align-items: center;
    gap: var(--bt-space-sm);
    flex-wrap: wrap;
}

.bt-topic-title {
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--bt-text-primary);
    text-decoration: none;
    line-height: 1.4;
    transition: var(--bt-transition-fast);
}

.bt-topic-title:hover {
    color: var(--bt-primary);
}

.bt-topic-voices {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.688rem;
    color: var(--bt-text-muted);
    background: var(--bt-bg-tertiary);
    padding: 1px 8px;
    border-radius: var(--bt-radius-full);
}

/* --- 话题标签 --- */
.bt-topic-badges {
    display: flex;
    gap: var(--bt-space-xs);
    margin-top: var(--bt-space-xs);
}

.bt-topic-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: var(--bt-radius-full);
    font-size: 0.688rem;
    font-weight: 600;
    line-height: 1.6;
}

.bt-topic-badge--super-sticky {
    background: rgba(255, 109, 0, 0.12);
    color: var(--bt-accent);
}

.bt-topic-badge--sticky {
    background: rgba(26, 115, 232, 0.1);
    color: var(--bt-primary);
}

.bt-topic-badge--closed {
    background: rgba(95, 99, 104, 0.1);
    color: var(--bt-text-secondary);
}

/* --- 话题元信息 --- */
.bt-topic-meta {
    display: flex;
    align-items: center;
    gap: var(--bt-space-md);
    margin-top: var(--bt-space-xs);
    font-size: 0.75rem;
    color: var(--bt-text-muted);
}

.bt-topic-meta-author {
    display: inline-flex;
    align-items: center;
    gap: var(--bt-space-xs);
}

.bt-topic-meta-author img {
    width: 20px;
    height: 20px;
    border-radius: var(--bt-radius-full);
}

.bt-topic-meta-author a {
    color: var(--bt-text-secondary);
    text-decoration: none;
}

.bt-topic-meta-author a:hover {
    color: var(--bt-primary);
}

.bt-topic-meta-date {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.bt-topic-meta-forum {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.bt-topic-meta-forum a {
    color: var(--bt-text-muted);
    text-decoration: none;
}

.bt-topic-meta-forum a:hover {
    color: var(--bt-primary);
}

/* --- 话题列：回复数 --- */
.bt-topic-col-replies {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.bt-topic-reply-count {
    font-size: 1rem;
    font-weight: 700;
    color: var(--bt-text-primary);
    line-height: 1.2;
}

.bt-topic-reply-label {
    font-size: 0.688rem;
    color: var(--bt-text-muted);
}

/* --- 话题列：最新活动 --- */
.bt-topic-col-freshness {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 2px;
}

.bt-topic-col-freshness a {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--bt-text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--bt-bg-tertiary);
    border-radius: var(--bt-radius-full);
    transition: var(--bt-transition-fast);
    white-space: nowrap;
}

.bt-topic-col-freshness a::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--bt-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.bt-topic-col-freshness a:hover {
    background: var(--bt-primary-bg);
    color: var(--bt-primary);
}

/* --- 话题分页 --- */
.bt-topic-pagination,
.bt-reply-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--bt-space-sm);
    margin-top: var(--bt-space-lg);
    padding: var(--bt-space-md) 0;
}

.bt-topic-pagination .page-numbers,
.bt-reply-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--bt-space-sm);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-md);
    background: var(--bt-bg-primary);
    color: var(--bt-text-secondary);
    font-size: 0.813rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--bt-transition-fast);
}

.bt-topic-pagination .page-numbers:hover,
.bt-reply-pagination .page-numbers:hover {
    border-color: var(--bt-primary);
    color: var(--bt-primary);
    background: var(--bt-primary-bg);
}

.bt-topic-pagination .page-numbers.current,
.bt-reply-pagination .page-numbers.current {
    background: var(--bt-primary);
    color: #fff;
    border-color: var(--bt-primary);
}

/* --- 话题导航（上一个/下一个） --- */
.bt-topic-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--bt-space-md);
    padding: var(--bt-space-md) var(--bt-space-lg);
    background: var(--bt-bg-primary);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-md);
    flex-wrap: wrap;
    gap: var(--bt-space-sm);
}

.bt-topic-nav-info {
    font-size: 0.813rem;
    color: var(--bt-text-secondary);
}

.bt-topic-nav-links {
    display: flex;
    gap: var(--bt-space-md);
}

.bt-topic-nav-prev a,
.bt-topic-nav-next a {
    display: inline-flex;
    align-items: center;
    gap: var(--bt-space-xs);
    font-size: 0.813rem;
    color: var(--bt-primary);
    text-decoration: none;
    transition: var(--bt-transition-fast);
}

.bt-topic-nav-prev a:hover,
.bt-topic-nav-next a:hover {
    color: var(--bt-primary-dark);
}

/* --- 话题头部 --- */
.bt-topic-header {
    background: var(--bt-bg-primary);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-lg);
    padding: var(--bt-space-lg);
    margin-bottom: var(--bt-space-lg);
}

.bt-topic-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--bt-space-md);
    margin-bottom: var(--bt-space-md);
}

.bt-topic-header-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--bt-text-primary);
    margin: 0;
    line-height: 1.4;
}

.bt-topic-header-badges {
    display: flex;
    gap: var(--bt-space-xs);
    flex-shrink: 0;
}

.bt-topic-header-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--bt-space-md);
}

.bt-topic-header-author {
    display: flex;
    align-items: center;
    gap: var(--bt-space-sm);
}

.bt-topic-header-author img {
    width: 48px;
    height: 48px;
    border-radius: var(--bt-radius-full);
}

.bt-topic-header-author-info {
    display: flex;
    flex-direction: column;
}

.bt-topic-header-author-name {
    font-weight: 600;
    color: var(--bt-text-primary);
    font-size: 0.938rem;
}

.bt-topic-header-author-name a {
    color: inherit;
    text-decoration: none;
}

.bt-topic-header-author-name a:hover {
    color: var(--bt-primary);
}

.bt-topic-header-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--bt-text-muted);
}

.bt-topic-header-stats {
    display: flex;
    gap: var(--bt-space-lg);
}

.bt-topic-header-stat {
    display: inline-flex;
    align-items: center;
    gap: var(--bt-space-xs);
    font-size: 0.813rem;
    color: var(--bt-text-secondary);
}

/* --- 回复列表 --- */
.bt-reply-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.bt-reply-item {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: var(--bt-space-md);
    padding: var(--bt-space-lg);
    background: var(--bt-bg-primary);
    border: 1px solid var(--bt-border);
    border-bottom: none;
    transition: var(--bt-transition-fast);
}

.bt-reply-item:first-child {
    border-radius: var(--bt-radius-lg) var(--bt-radius-lg) 0 0;
}

.bt-reply-item:last-child {
    border-bottom: 1px solid var(--bt-border);
    border-radius: 0 0 var(--bt-radius-lg) var(--bt-radius-lg);
}

.bt-reply-item:only-child {
    border-radius: var(--bt-radius-lg);
    border-bottom: 1px solid var(--bt-border);
}

.bt-reply-item:hover {
    background: var(--bt-bg-secondary);
}

.bt-reply-item--topic {
    background: var(--bt-bg-primary);
    border-left: 3px solid var(--bt-primary);
}

.bt-reply-item--even {
    background: var(--bt-bg-secondary);
}

/* --- 回复序号 --- */
.bt-reply-number-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bt-text-muted);
    background: var(--bt-bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--bt-radius-full);
}

.bt-reply-number-label--op {
    color: var(--bt-accent, #f59e0b);
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* --- 回复作者 --- */
.bt-reply-author {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding-top: var(--bt-space-xs);
    min-width: 0;
}

.bt-reply-author-avatar img {
    width: 48px;
    height: 48px;
    border-radius: var(--bt-radius-full);
    border: 2px solid var(--bt-border);
    object-fit: cover;
}

.bt-reply-author-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 100%;
    overflow: hidden;
}

.bt-reply-author-name {
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--bt-text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bt-reply-author-name a {
    color: inherit;
    text-decoration: none;
}

.bt-reply-author-name a:hover {
    color: var(--bt-primary);
}

.bt-reply-author-role {
    font-size: 0.688rem;
    color: var(--bt-primary);
    background: var(--bt-primary-bg);
    padding: 1px 8px;
    border-radius: var(--bt-radius-full);
    line-height: 1.6;
    white-space: nowrap;
}

.bt-reply-date {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.688rem;
    color: var(--bt-text-muted);
    white-space: nowrap;
}

/* --- 回复内容 --- */
.bt-reply-content {
    min-width: 0;
}

.bt-reply-content-inner {
    font-size: 0.938rem;
    line-height: 1.8;
    color: var(--bt-text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.bt-reply-content-inner p {
    margin: 0 0 var(--bt-space-md);
}

.bt-reply-content-inner p:last-child {
    margin-bottom: 0;
}

.bt-reply-content-inner img {
    max-width: 100%;
    height: auto;
    border-radius: var(--bt-radius-md);
}

.bt-reply-content-inner pre {
    background: var(--bt-bg-tertiary);
    padding: var(--bt-space-md);
    border-radius: var(--bt-radius-md);
    overflow-x: auto;
    font-size: 0.813rem;
    line-height: 1.6;
    margin: var(--bt-space-md) 0;
}

.bt-reply-content-inner code {
    font-family: var(--bt-font-mono);
    font-size: 0.875em;
    background: var(--bt-bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--bt-radius-sm);
}

.bt-reply-content-inner pre code {
    background: none;
    padding: 0;
}

.bt-reply-content-inner blockquote {
    border-left: 3px solid var(--bt-primary);
    padding: var(--bt-space-sm) var(--bt-space-md);
    margin: var(--bt-space-md) 0;
    background: var(--bt-primary-bg);
    border-radius: 0 var(--bt-radius-md) var(--bt-radius-md) 0;
    color: var(--bt-text-secondary);
    font-style: italic;
}

/* --- 回复操作 --- */
.bt-reply-actions {
    display: flex;
    align-items: center;
    gap: var(--bt-space-sm);
    margin-top: var(--bt-space-md);
    padding-top: var(--bt-space-sm);
    border-top: 1px solid var(--bt-border);
}

.bt-reply-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--bt-text-muted);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: var(--bt-radius-full);
    transition: var(--bt-transition-fast);
}

.bt-reply-action:hover {
    color: var(--bt-primary);
    background: var(--bt-primary-bg);
}

/* --- 回复表单 --- */
.bt-reply-form-wrapper {
    margin-top: var(--bt-space-xl);
}

.bt-reply-form {
    background: var(--bt-bg-primary);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-lg);
    overflow: hidden;
}

.bt-reply-form--closed {
    padding: var(--bt-space-lg);
}

.bt-reply-form--login {
    padding: var(--bt-space-2xl);
    text-align: center;
}

.bt-reply-form-closed-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--bt-space-sm);
    color: var(--bt-text-muted);
    font-size: 0.875rem;
}

.bt-reply-form-header {
    padding: var(--bt-space-md) var(--bt-space-lg);
    border-bottom: 1px solid var(--bt-border);
    background: var(--bt-bg-secondary);
}

.bt-reply-form-title {
    display: flex;
    align-items: center;
    gap: var(--bt-space-sm);
    font-size: 1rem;
    font-weight: 600;
    color: var(--bt-text-primary);
    margin: 0;
}

.bt-reply-form-user {
    display: flex;
    align-items: center;
    gap: var(--bt-space-sm);
    padding: var(--bt-space-md) var(--bt-space-lg);
    border-bottom: 1px solid var(--bt-border);
    font-size: 0.813rem;
    color: var(--bt-text-secondary);
}

.bt-reply-form-user img {
    width: 36px;
    height: 36px;
    border-radius: var(--bt-radius-full);
}

.bt-reply-form-username {
    font-weight: 600;
    color: var(--bt-text-primary);
}

.bt-reply-form-field {
    padding: var(--bt-space-md) var(--bt-space-lg);
}

.bt-reply-form-field--editor {
    padding: 0 var(--bt-space-lg);
}

.bt-reply-form-field--checkbox {
    padding: var(--bt-space-sm) var(--bt-space-lg);
}

.bt-reply-form-field label {
    display: block;
    font-size: 0.813rem;
    font-weight: 500;
    color: var(--bt-text-primary);
    margin-bottom: var(--bt-space-xs);
}

.bt-reply-form-field .description {
    font-size: 0.8125rem;
    color: var(--bt-text-muted);
    margin: 0 0 var(--bt-space-xs);
}

.bt-reply-form-input,
.bt-reply-form-select {
    width: 100%;
    padding: 10px var(--bt-space-md);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-md);
    font-size: 0.938rem;
    color: var(--bt-text-primary);
    background: var(--bt-bg-secondary);
    outline: none;
    transition: var(--bt-transition-fast);
}

.bt-reply-form-input:focus,
.bt-reply-form-select:focus {
    border-color: var(--bt-primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* --- 回复表单文本域 --- */
.bt-reply-form-textarea {
    width: 100% !important;
    min-height: 300px;
    padding: var(--bt-space-md);
    border: none;
    border-radius: 0;
    font-size: 0.938rem;
    font-family: var(--bt-font-family);
    color: var(--bt-text-primary);
    background: var(--bt-bg-primary);
    outline: none;
    resize: none !important;
    line-height: 1.8;
    box-sizing: border-box;
}

.bt-reply-form-textarea::placeholder {
    color: var(--bt-text-muted);
}

.bt-reply-form-textarea:focus {
    background: var(--bt-bg-primary);
}

/* 隐藏回帖表单的 bbPress 默认 Quicktags 工具栏，但保留可视化/文本标签切换器 */
.bt-reply-form-field--editor #qt_bbp_reply_content_toolbar,
.bt-reply-form-field--editor .quicktags-toolbar {
    display: none !important;
}

/* --- 回复表单单选框 --- */
.bt-reply-form-checkbox {
    display: inline-flex;
    align-items: center;
    gap: var(--bt-space-sm);
    cursor: pointer;
    font-size: 0.813rem;
    color: var(--bt-text-secondary);
    user-select: none;
}

.bt-reply-form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--bt-primary);
    cursor: pointer;
}

/* --- 回复表单提交 --- */
.bt-reply-form-submit {
    display: flex;
    align-items: center;
    gap: var(--bt-space-sm);
    padding: var(--bt-space-md) var(--bt-space-lg);
    border-top: 1px solid var(--bt-border);
    background: var(--bt-bg-secondary);
}

/* --- 未登录提示 --- */
.bt-reply-form-login-prompt {
    max-width: 400px;
    margin: 0 auto;
}

.bt-reply-form-login-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--bt-space-md);
    background: var(--bt-primary-bg);
    border-radius: var(--bt-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bt-primary);
}

.bt-reply-form-login-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bt-text-primary);
    margin-bottom: var(--bt-space-sm);
}

.bt-reply-form-login-desc {
    font-size: 0.875rem;
    color: var(--bt-text-secondary);
    margin-bottom: var(--bt-space-lg);
    line-height: 1.6;
}

.bt-reply-form-login-actions {
    display: flex;
    gap: var(--bt-space-md);
    justify-content: center;
}

/* --- 空状态 --- */
.bt-bbpress-empty {
    text-align: center;
    padding: var(--bt-space-3xl) var(--bt-space-lg);
    background: var(--bt-bg-primary);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-lg);
}

.bt-bbpress-empty-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto var(--bt-space-lg);
    background: var(--bt-bg-secondary);
    border-radius: var(--bt-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bt-text-muted);
}

.bt-bbpress-empty-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--bt-text-primary);
    margin-bottom: var(--bt-space-sm);
}

.bt-bbpress-empty-desc {
    font-size: 0.875rem;
    color: var(--bt-text-secondary);
    margin-bottom: var(--bt-space-lg);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ==========================================================================
   bbPress 响应式设计
   ========================================================================== */

/* 平板 (<= 768px) */
@media (max-width: 768px) {
    .bt-forum-header {
        padding: var(--bt-space-xl) var(--bt-space-md);
    }

    .bt-forum-header-title {
        font-size: 1.375rem;
    }

    .bt-forum-grid {
        grid-template-columns: 1fr;
    }

    .bt-forum-stats {
        width: 100%;
        padding-left: 0;
        padding-top: var(--bt-space-sm);
        border-top: 1px solid var(--bt-border);
        margin-top: var(--bt-space-sm);
    }

    .bt-forum-freshness {
        display: none;
    }

    .bt-single-forum-header {
        flex-direction: column;
    }

    .bt-topic-list-header {
        display: none;
    }

    .bt-topic-item {
        grid-template-columns: 36px 1fr;
        grid-template-rows: auto auto;
        gap: var(--bt-space-sm);
        padding: var(--bt-space-md);
    }

    .bt-topic-col-replies {
        grid-column: 1;
        grid-row: 1;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: var(--bt-space-xs);
    }

    .bt-topic-col-freshness {
        grid-column: 2;
        grid-row: 2;
        align-items: flex-start;
    }

    .bt-topic-icon {
        width: 32px;
        height: 32px;
    }

    .bt-topic-icon svg {
        width: 18px;
        height: 18px;
    }

    .bt-reply-item {
        grid-template-columns: 1fr;
        gap: var(--bt-space-sm);
        padding: var(--bt-space-md);
    }

    .bt-reply-author {
        flex-direction: row;
        text-align: left;
        padding-top: 0;
        gap: var(--bt-space-sm);
    }

    .bt-reply-author-avatar img {
        width: 36px;
        height: 36px;
    }

    .bt-reply-author-info {
        flex-direction: row;
        align-items: center;
        gap: var(--bt-space-sm);
    }

    .bt-reply-form-textarea {
        min-height: 140px;
    }

    .bt-topic-header {
        padding: var(--bt-space-md);
    }

    .bt-topic-header-title {
        font-size: 1.125rem;
    }

    .bt-topic-header-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .bt-topic-header-author img {
        width: 36px;
        height: 36px;
    }

    .bt-topic-nav {
        flex-direction: column;
        text-align: center;
    }

    .bt-topic-nav-links {
        flex-direction: column;
        gap: var(--bt-space-sm);
    }
}

/* 小屏手机 (<= 480px) */
@media (max-width: 480px) {
    .bt-forum-header-title {
        font-size: 1.125rem;
    }

    .bt-forum-header-desc {
        font-size: 0.813rem;
    }

    .bt-forum-item-link {
        padding: var(--bt-space-md);
    }

    .bt-forum-item-icon {
        width: 44px;
        height: 44px;
    }

    .bt-forum-item-icon svg {
        width: 22px;
        height: 22px;
    }

    .bt-topic-item {
        padding: var(--bt-space-sm) var(--bt-space-md);
    }

    .bt-topic-title {
        font-size: 0.875rem;
    }

    .bt-topic-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--bt-space-xs);
    }

    .bt-reply-form {
        border-radius: var(--bt-radius-md);
    }

    .bt-reply-form--login {
        padding: var(--bt-space-lg);
    }

    .bt-reply-form-login-actions {
        flex-direction: column;
    }

    .bt-reply-form-login-actions .bt-btn {
        width: 100%;
        justify-content: center;
    }

    .bt-reply-form-submit {
        flex-direction: column;
    }

    .bt-reply-form-submit .bt-btn {
        width: 100%;
        justify-content: center;
    }

    .bt-bbpress-empty {
        padding: var(--bt-space-xl) var(--bt-space-md);
    }

    .bt-bbpress-empty-icon {
        width: 72px;
        height: 72px;
    }

    .bt-bbpress-empty-icon svg {
        width: 36px;
        height: 36px;
    }
}

/* ==========================================================================
   bbPress 话题模式标签、附件下载、付费锁定样式
   ========================================================================== */

/* --- 话题模式标签 --- */
.bt-topic-mode-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--bt-radius-full);
    font-size: 0.688rem;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}

.bt-topic-mode-tag--free {
    background: rgba(52, 199, 89, 0.12);
    color: #34c759;
}

.bt-topic-mode-tag--subscribe-view {
    background: rgba(0, 122, 255, 0.12);
    color: #007aff;
}

.bt-topic-mode-tag--subscribe-download {
    background: rgba(255, 149, 0, 0.12);
    color: #ff9500;
}

/* --- 话题列表类型列 --- */
.bt-topic-col-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--bt-space-xs);
    min-width: 40px;
}

.bt-topic-list-header .bt-topic-col-type {
    flex-direction: row;
    justify-content: center;
}

/* 更新话题列表表头和项的网格布局以包含类型列 */
.bt-topic-list-header {
    display: grid;
    grid-template-columns: 60px 1fr 80px 180px;
    gap: var(--bt-space-md);
    padding: var(--bt-space-sm) var(--bt-space-lg);
    background: var(--bt-bg-tertiary);
    border-bottom: 2px solid var(--bt-primary);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bt-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bt-topic-item {
    display: grid;
    grid-template-columns: 60px 1fr 80px 180px;
    gap: var(--bt-space-md);
    padding: var(--bt-space-md) var(--bt-space-lg);
    border-bottom: 1px solid var(--bt-border);
    transition: var(--bt-transition-fast);
    align-items: center;
}

/* --- 附件指示器 --- */
.bt-topic-attachment-indicator {
    display: inline-flex;
    align-items: center;
    color: var(--bt-primary);
    flex-shrink: 0;
}

/* --- 话题头部附加统计 --- */
.bt-topic-header-stat--version {
    color: var(--bt-primary);
}

.bt-topic-header-stat--downloads {
    color: var(--bt-accent);
}

.bt-topic-header-stat--filesize {
    color: var(--bt-text-muted);
}

/* --- 附件下载区域 --- */
.bt-topic-attachment {
    display: flex;
    align-items: center;
    gap: var(--bt-space-md);
    padding: var(--bt-space-md) var(--bt-space-lg);
    margin-top: var(--bt-space-lg);
    background: var(--bt-bg-secondary);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-lg);
}

.bt-attachment-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: var(--bt-radius-md);
    flex-shrink: 0;
}

.bt-attachment-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.bt-attachment-name {
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--bt-text-primary);
    word-break: break-all;
}

.bt-attachment-size {
    font-size: 0.75rem;
    color: var(--bt-text-muted);
}

.bt-attachment-version {
    font-size: 0.75rem;
    color: var(--bt-primary);
    font-weight: 500;
}

.bt-download-btn {
    flex-shrink: 0;
}

/* --- 话题内付费锁定 --- */
.bt-paid-lock-topic {
    margin-top: var(--bt-space-lg);
    text-align: center !important;
}

.bt-paid-lock-topic p,
.bt-paid-lock-topic .bt-paid-lock-desc {
    text-align: center !important;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.bt-content-preview {
    font-size: 0.938rem;
    line-height: 1.8;
    color: var(--bt-text-primary);
    padding-bottom: var(--bt-space-md);
    border-bottom: 1px dashed var(--bt-border);
    margin-bottom: var(--bt-space-lg);
}

/* --- 响应式：话题列表类型列 --- */
@media (max-width: 768px) {
    .bt-topic-list-header {
        grid-template-columns: 40px 1fr 80px 180px;
    }

    .bt-topic-item {
        grid-template-columns: 40px 1fr 80px 180px;
    }

    .bt-topic-col-type {
        display: none;
    }

    .bt-topic-attachment {
        flex-wrap: wrap;
    }

    .bt-download-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .bt-topic-col-type {
        display: none;
    }

    .bt-topic-attachment {
        flex-direction: column;
        align-items: stretch;
    }

    .bt-attachment-info {
        align-items: center;
    }
}

/* ==========================================================================
   回复表单字数提示样式
   ========================================================================== */

/* --- 字数提示 --- */
.bt-reply-form-hint {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--bt-space-sm);
    padding: var(--bt-space-sm) var(--bt-space-md);
    background: var(--bt-surface-alt, #f8f9fa);
    border-radius: var(--bt-radius-sm);
    font-size: 0.8125rem;
}

.bt-reply-form-char-count {
    font-weight: 500;
    color: var(--bt-text-secondary);
}

.bt-reply-form-char-count span {
    font-weight: 600;
}

.bt-reply-form-char-tip {
    color: var(--bt-text-tertiary);
}

/* --- 内联提示（复用 auth-alert 样式，论坛页面不加载 auth.css） --- */
.bt-auth-alert {
    display: flex;
    align-items: center;
    gap: var(--bt-space-sm);
    padding: var(--bt-space-md);
    border-radius: var(--bt-radius-md);
    margin-bottom: var(--bt-space-md);
    font-size: 0.875rem;
    line-height: 1.5;
    animation: btAuthFadeIn 0.3s ease;
}

.bt-auth-alert svg {
    flex-shrink: 0;
}

.bt-auth-alert-error {
    background: #fff5f5;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.bt-auth-alert-success {
    background: #f1fff4;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

[data-theme="dark"] .bt-auth-alert-error {
    background: rgba(255, 23, 68, 0.1);
    border-color: rgba(255, 23, 68, 0.2);
    color: #ff5252;
}

[data-theme="dark"] .bt-auth-alert-success {
    background: rgba(0, 200, 83, 0.1);
    border-color: rgba(0, 200, 83, 0.2);
    color: #69f0ae;
}

/* ==========================================================================
   话题图片/视频展示
   ========================================================================== */

.bt-topic-images {
    margin-top: var(--bt-space-md);
}

.bt-topic-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--bt-space-sm);
}

/* 单张图片时居中显示 */
.bt-topic-images-grid:has(> :only-child) {
    display: flex;
    justify-content: flex-start;
}

.bt-topic-image-item {
    position: relative;
    border-radius: var(--bt-radius-md);
    overflow: hidden;
    cursor: pointer;
    background: var(--bt-bg-secondary, #f8f9fa);
    aspect-ratio: 16 / 9;
}

.bt-topic-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--bt-transition, 0.2s);
}

.bt-topic-image-item:hover img {
    transform: scale(1.02);
}

/* 单张图片时更大显示 */
.bt-topic-images-grid:has(> :only-child) .bt-topic-image-item {
    max-width: 400px;
    aspect-ratio: auto;
}

.bt-topic-images-grid:has(> :only-child) .bt-topic-image-item img {
    aspect-ratio: auto;
    max-height: 400px;
}

/* 回复中的图片 */
.bt-reply-images {
    margin-top: var(--bt-space-sm);
}

.bt-reply-images .bt-topic-images-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.bt-reply-images .bt-topic-image-item {
    aspect-ratio: 1;
}

/* 视频播放器 */
.bt-topic-video {
    margin-top: var(--bt-space-md);
    border-radius: var(--bt-radius-md);
    overflow: hidden;
    background: #000;
}

.bt-topic-video video {
    width: 100%;
    max-height: 500px;
    display: block;
}

/* ==========================================================================
   图片灯箱
   ========================================================================== */

.bt-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.bt-lightbox.active {
    display: flex;
}

.bt-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: zoom-out;
}

.bt-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
}

.bt-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--bt-radius-sm);
}

.bt-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 10000;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.bt-lightbox-close svg {
    display: block;
    width: 24px;
    height: 24px;
    stroke: #ffffff !important;
    stroke-width: 2;
    fill: none;
    pointer-events: none;
}

.bt-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.bt-lightbox-close:hover svg {
    stroke: #ffffff !important;
}

.bt-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 10000;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.bt-lightbox-nav svg {
    display: block;
    width: 24px;
    height: 24px;
    stroke: #ffffff !important;
    stroke-width: 2;
    fill: none;
    pointer-events: none;
}

.bt-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.bt-lightbox-nav:hover svg {
    stroke: #ffffff !important;
}

.bt-lightbox-prev {
    left: 20px;
}

.bt-lightbox-next {
    right: 20px;
}

.bt-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    z-index: 2;
}

/* 响应式 */
@media (max-width: 768px) {
    .bt-topic-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .bt-topic-images-grid:has(> :only-child) .bt-topic-image-item {
        max-width: 100%;
    }

    .bt-lightbox-nav {
        width: 36px;
        height: 36px;
    }

    .bt-lightbox-prev {
        left: 10px;
    }

    .bt-lightbox-next {
        right: 10px;
    }
}
