/* ==========================================================
   版块列表页 (Forum Display - forumdisplay.php) 专属样式
   包含：版块头图、过滤下拉栏、图文/列表双模切换卡片等
   ========================================================== */

/* 1. 版块头图横幅 */
.forum-hero { display: flex; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: 24px; }
.forum-hero__img { width: 450px; flex-shrink: 0; background: var(--bg-body); position: relative; }
.forum-hero__img img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.forum-hero__default-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)); opacity: 0.8; }
.forum-hero__info { flex: 1; padding: 32px 40px; display: flex; flex-direction: column; justify-content: center; }
.forum-hero__title { font-size: 1.8rem; font-weight: 800; color: var(--text-main); margin-bottom: 12px; }
.forum-hero__stats { display: flex; gap: 20px; font-size: 0.95rem; color: var(--text-muted); margin-bottom: 16px; }
.forum-hero__stats strong { color: #ef4444; }
.forum-hero__desc { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 24px; background: rgba(0,0,0,0.02); padding: 12px 16px; border-radius: var(--radius-sm); border-left: 4px solid var(--border-color); }
[data-theme="dark"] .forum-hero__desc { background: rgba(255,255,255,0.02); }
.forum-hero__actions { display: flex; gap: 12px; }

/* 2. 主题分类/类别标签 (Pills) */
.thread-types-pills { display: flex; flex-wrap: wrap; gap: 12px; background: var(--bg-surface); padding: 16px 20px; border-radius: var(--radius-md); border: 1px solid var(--border-color); margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.thread-type-pill { display: inline-flex; align-items: center; padding: 6px 16px; border-radius: 20px; font-size: 0.95rem; font-weight: 500; color: var(--text-muted); background: var(--bg-body); border: 1px solid transparent; transition: var(--transition); }
.thread-type-pill:hover { color: var(--primary-color); background: rgba(59,130,246,0.05); }
.thread-type-pill.active { color: var(--primary-color); background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.2); font-weight: 600; }
.thread-type-pill .count { margin-left: 6px; background: var(--bg-surface); padding: 2px 8px; border-radius: 12px; font-size: 0.8rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

/* 3. 过滤与下拉工具栏 */
.forum-filters { display: flex; align-items: center; background: var(--bg-surface); padding: 12px 20px; border-radius: var(--radius-md); border: 1px solid var(--border-color); margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.forum-filters::after { display: none !important; }
.forum-filters__left { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.dropdown { position: relative; }
.dropdown summary { cursor: pointer; color: var(--text-muted); font-weight: 600; font-size: 0.95rem; list-style: none; user-select: none; transition: var(--transition); }
.dropdown summary:hover { color: var(--primary-color); }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; top: calc(100% + 12px); left: 0; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: var(--shadow-hover); padding: 8px 0; min-width: 140px; z-index: 100; }
.dropdown-menu a { display: block; padding: 10px 20px; color: var(--text-main); font-size: 0.95rem; transition: background 0.2s; white-space: nowrap; }
.dropdown-menu a:hover { background: var(--bg-body); color: var(--primary-color); }

.forum-filters__right { margin-left: auto; }
.mode-switch { display: inline-flex; align-items: center; background: var(--bg-body); padding: 4px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); }
.mode-switch-btn { border: none; background: transparent; padding: 6px 14px; border-radius: 4px; color: var(--text-muted); cursor: pointer; transition: var(--transition); font-size: 1.1rem; }
.mode-switch-btn:hover { color: var(--primary-hover); }
.mode-switch-btn.active { background: var(--bg-surface); color: var(--primary-color); box-shadow: var(--shadow-sm); font-weight: bold; }

/* 4. 图文双模自适应帖子列表容器 */
.thread-container.is-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.thread-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-sm); overflow: hidden; transition: var(--transition); display: flex; flex-direction: column; }
.thread-container.is-grid .thread-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: transparent; }

.thread-card__img { 
    display: block; 
    width: 100%; 
    aspect-ratio: 1 / 1; 
    background: var(--bg-body); 
    position: relative; 
    overflow: hidden; 
    flex-shrink: 0;
    min-height: 120px; 
}
@supports not (aspect-ratio: 1 / 1) {
    .thread-card__img { height: 0; padding-bottom: 100%; }
}
.thread-card__img img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; display: block; }
.thread-container.is-grid .thread-card:hover .thread-card__img img { transform: scale(1.05); }

.thread-card__nopic { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 900; color: rgba(0,0,0,0.1); background: linear-gradient(135deg, var(--border-color), var(--bg-body)); }
[data-theme="dark"] .thread-card__nopic { color: rgba(255,255,255,0.1); }

.thread-card__info { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; }
.thread-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 8px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.thread-title a { color: var(--text-main); }
.thread-title a:hover { color: var(--primary-color); }

.thread-pin { display: inline-block; background: #ef4444; color: #fff; font-size: 0.7rem; padding: 2px 4px; border-radius: 4px; vertical-align: middle; margin-right: 4px; font-weight: normal; }

.thread-stats { display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; color: var(--text-muted); margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--border-color); }
.thread-stats-left { display: flex; align-items: center; gap: 12px; }
.thread-stats-right { display: flex; align-items: center; justify-content: flex-end; color: var(--text-muted); }
.thread-stats-item { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; line-height: 1; }
.thread-stats-item i { top: 0 !important; vertical-align: middle !important; margin: 0 !important; width: 1.15em !important; height: 1.15em !important; opacity: 0.7; display: block !important; }

/* 列表模式特有布局 */
.thread-container.is-grid .thread-author { display: none; }
.thread-container.is-list .thread-author { display: inline-flex; align-items: center; gap: 4px; margin-right: 12px; color: var(--text-muted); vertical-align: middle; line-height: 1; }
.thread-container.is-list .thread-author i { top: 0 !important; vertical-align: middle !important; margin: 0 !important; width: 1.15em !important; height: 1.15em !important; opacity: 0.7; display: block !important; }
.thread-container.is-list .thread-author a { color: var(--text-muted); font-size: 0.85rem; }
.thread-container.is-list .thread-author a:hover { color: var(--primary-color); }

.thread-container.is-list { display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.thread-container.is-list .thread-card { flex-direction: row; padding: 16px 20px; border: none; border-bottom: 1px solid var(--border-color); border-radius: 0; box-shadow: none; gap: 20px; align-items: center; }
.thread-container.is-list .thread-card:last-child { border-bottom: none; }
.thread-container.is-list .thread-card:hover { background: var(--bg-body); transform: none; }
.thread-container.is-list .thread-card__img { width: 140px; height: 100px; padding-bottom: 0; border-radius: var(--radius-sm); flex-shrink: 0; }
.thread-container.is-list .thread-card__img::before { display: none; } 
.thread-container.is-list .thread-card__info { padding: 0; justify-content: center; }
.thread-container.is-list .thread-title { font-size: 1.1rem; margin-bottom: 12px; }
.thread-container.is-list .thread-stats { border-top: none; padding-top: 0; margin-top: 0; justify-content: space-between; width: 100%; }

/* ==========================================================
   响应式控制 (版块列表页专属)
   ========================================================== */
@media (max-width: 1200px) {
    .thread-container.is-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 992px) {
    .thread-container.is-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

@media (max-width: 900px) {
    .forum-hero { flex-direction: column; align-items: center; text-align: center; }
    .forum-hero__img { width: 100%; min-height: 200px; aspect-ratio: 21/9; }
    .forum-hero__info { padding: 24px 20px; width: 100%; box-sizing: border-box; }
    .forum-hero__stats { justify-content: center; flex-wrap: wrap; }
    .forum-hero__actions { justify-content: center; flex-wrap: wrap; }
    .forum-hero__desc { text-align: left; }
}

@media (max-width: 768px) {
    .forum-hero, .thread-types-pills, .forum-filters {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-shadow: none !important; 
    }
    .thread-container.is-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 12px; }
    /* 修复面包屑贴边问题，因为这是在 wp 容器里，所以给 pt 增加 padding */
    .wp.pt { padding-left: 16px !important; padding-right: 16px !important; }
}

@media (max-width: 600px) {
    .forum-filters { flex-wrap: wrap; gap: 12px; }
    .forum-filters__left { flex-wrap: wrap; gap: 8px; }
}