/* AMuBBS - 帖子样式 */

/* 板块头部 */
.forum-header {
    display: flex; flex-direction: column; gap: 0;
    background: var(--primary);
    border-radius: var(--radius-lg);
    padding: 0; margin-bottom: var(--gap);
    border: none; overflow: hidden;
    position: relative;
}
.forum-header::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.forum-header-top {
    display: flex; align-items: center; gap: 16px;
    padding: 22px 24px; position: relative; z-index: 1;
}
.forum-header-icon {
    width: 52px; height: 52px; border-radius: 14px;
    background: rgba(255,255,255,.18); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700; flex-shrink: 0;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    border: 1px solid rgba(255,255,255,.15);
}
.forum-header-info { flex: 1; min-width: 0; }
.forum-header-info h1 { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: .2px; margin: 0; }
.forum-header .forum-description { font-size: 13px; color: rgba(255,255,255,.8); line-height: 1.6; margin-top: 4px; }
.forum-header-btn {
    flex-shrink: 0; background: #fff !important; color: var(--primary) !important;
    border: none !important; font-weight: 600; gap: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.forum-header-btn:hover { background: rgba(255,255,255,.92) !important; transform: translateY(-1px); }
.forum-stats-bar {
    display: flex; gap: 0; align-items: stretch;
    background: rgba(0,0,0,.12);
    padding: 0; position: relative; z-index: 1;
}
.forum-stat-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 2px;
    padding: 10px 12px;
    border-right: 1px solid rgba(255,255,255,.08);
}
.forum-stat-item:last-child { border-right: none; }
.forum-stat-value { font-size: 16px; font-weight: 700; color: #fff; }
.forum-stat-label { font-size: 11px; color: rgba(255,255,255,.65); }
.forum-stat-mods {
    flex-direction: row; gap: 8px;
    background: rgba(255,255,255,.06);
    border-right: none !important;
    position: relative;
}
.forum-stat-mods .mod-icon {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,.15); color: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.forum-stat-mods .mod-icon svg { width: 14px; height: 14px; }
.forum-stat-mods .forum-stat-label { font-size: 11px; color: rgba(255,255,255,.6); }
.forum-stat-mods .forum-stat-value { font-size: 13px; font-weight: 500; color: #fff; }
.forum-header .btn { align-self: flex-start; margin-top: 4px; }

/* 帖子列表 */
.thread-list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: transparent;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}
.thread-list-item:last-child { border-bottom: none; }
.thread-list-item:hover { background: var(--gray-50); }
.thread-list-item.is-top {
    background: rgba(59,130,246,.02);
}
.thread-list-body { flex: 1; min-width: 0; }
.thread-list-title {
    font-size: 15px; font-weight: 500; color: var(--text);
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    transition: color var(--transition); line-height: 1.5;
}
.thread-list-title.thread-unread { font-weight: 700; }
.thread-list-title.thread-read { color: var(--text-muted); font-weight: 400; }
.thread-list-title:hover { color: var(--primary); }
.thread-list-title .tag { font-size: 10px; vertical-align: middle; margin-right: 4px; }
.thread-list-info {
    display: flex; align-items: center; gap: 8px;
    margin-top: 6px; font-size: 12px; color: var(--text-muted);
}
.thread-list-info a { color: var(--text-secondary); }
.thread-list-info a:hover { color: var(--primary); }
.thread-list-info .tag { font-size: 10px; padding: 1px 8px; }
.thread-list-counts { display: flex; gap: 20px; flex-shrink: 0; text-align: center; }
.thread-list-counts .count-item { display: flex; flex-direction: column; align-items: center; min-width: 44px; }
.thread-list-counts .count-value { font-size: 14px; font-weight: 700; color: var(--text); }
.thread-list-counts .count-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.thread-pages { display: flex; gap: 2px; margin-top: 3px; }
.thread-pages a { display: inline-block; padding: 0 4px; font-size: 10px; color: var(--text-muted); background: var(--bg-secondary); border-radius: 3px; text-decoration: none; line-height: 16px; }
.thread-pages a:hover { color: var(--primary); background: var(--bg-hover); }
.thread-pages span { font-size: 10px; color: var(--text-muted); line-height: 16px; }
.thread-list-last {
    display: none; flex-direction: column; align-items: flex-end;
    font-size: 12px; color: var(--text-muted); min-width: 90px; gap: 2px;
}

/* 帖子详情 */
.thread-detail-header { margin-bottom: 0; padding: 0 8px; }
.thread-detail-header h1 {
    font-size: 23px; font-weight: 800; color: var(--text);
    line-height: 1.5; margin-bottom: 6px; letter-spacing: .2px;
}
.thread-detail-header h1 .tag { vertical-align: middle; margin-right: 6px; font-size: 11px; }
.thread-detail-meta {
    display: flex; align-items: center; gap: 14px;
    font-size: 13px; color: var(--text-muted); flex-wrap: wrap;
    padding-bottom: 12px; border-bottom: 1px solid var(--border-light);
}
.thread-detail-meta .author-link {
    display: flex; align-items: center; gap: 8px;
    color: var(--text); font-weight: 600;
    transition: color var(--transition);
}
.thread-detail-meta .author-link .author-name { font-size: 13px; }
.thread-detail-meta .author-link:hover { color: var(--primary); }
.thread-detail-meta .author-link img { box-shadow: 0 0 0 2px rgba(59,130,246,.1); }
.meta-stats {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto;
}
.meta-stat {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: var(--radius-full);
    background: var(--gray-50); font-size: 12px; color: var(--text-muted);
    border: 1px solid transparent;
}
.meta-stat svg { width: 13px; height: 13px; opacity: .55; flex-shrink: 0; }
.meta-edited { cursor: pointer; transition: all var(--transition); }
.meta-edited:hover { color: var(--primary); background: var(--primary-light); border-color: var(--primary); }
.meta-tag {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: var(--radius-full);
    font-size: 11px; font-weight: 500; line-height: 1.4;
}
.meta-group { background: var(--primary-light); color: var(--primary); }
.meta-level { background: color-mix(in srgb, var(--level-color, #999) 12%, transparent); color: var(--level-color, #999); }

/* 帖子正文 */
.thread-content {
    font-size: 15px; line-height: 1.9; color: var(--text);
    word-break: break-word; padding: 12px 8px;
}
.thread-content p { margin-bottom: 14px; }
.thread-content img { border-radius: var(--radius-lg); margin: 12px 0; max-width: 100%; height: auto; }
.post-content img { max-width: 100%; height: auto; }
.thread-content pre {
    background: var(--gray-800); border: none;
    padding: 16px 18px; border-radius: var(--radius-lg);
    overflow-x: auto; font-size: 13px; margin: 16px 0;
    font-family: var(--font-mono); line-height: 1.6; color: #e6e6e6;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.2);
}
.thread-content code {
    background: var(--gray-100); padding: 2px 7px;
    border-radius: 5px; font-size: 12px; font-family: var(--font-mono);
    color: #e11d48;
}
.thread-content pre code { background: none; padding: 0; color: inherit; font-size: 13px; }
.thread-content blockquote {
    border-left: 3px solid var(--primary); padding: 14px 20px;
    margin: 16px 0; color: var(--text-secondary);
    background: var(--gray-50); border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    overflow: hidden; overflow-wrap: break-word; word-break: break-word;
}
.thread-content a { color: var(--primary); }
.thread-content a:hover { text-decoration: underline; }

/* 帖子标签 */
.thread-tags { padding: 0 8px 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.thread-tags .tag {
    background: var(--gray-100); color: var(--gray-600);
    padding: 4px 12px; transition: all var(--transition); border-radius: var(--radius-full);
    font-size: 12px;
}
.thread-tags .tag:hover { background: var(--primary-light); color: var(--primary); }

/* 操作栏 */
.thread-actions {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 8px 0; border-top: 1px solid var(--border-light); flex-wrap: wrap;
}
.thread-actions .action-msg { font-size: 12px; color: var(--success); margin-left: auto; }

/* 点赞按钮 */
.like-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px;
    border: 1px solid var(--border); border-radius: var(--radius-full);
    background: none; cursor: pointer; font-size: 13px;
    color: var(--text-secondary); transition: all var(--transition);
}
.like-btn:hover { border-color: #f87171; color: #ef4444; background: #fef2f2; }
.like-btn.liked { border-color: #f87171; color: #ef4444; background: #fef2f2; }
.like-btn.liked svg { fill: #ef4444; stroke: #ef4444; }
.like-btn svg { width: 16px; height: 16px; }

/* 回复列表 */
.post-list-header {
    font-size: 14px; font-weight: 600; margin-bottom: 0;
    padding: 14px 18px; border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; gap: 8px;
    background: var(--gray-50);
    border-radius: 0; border: none;
}
.post-list-header::before { display: none; }
.post-item {
    display: flex; gap: 14px; padding: 18px;
    background: transparent; border-radius: 0;
    margin-bottom: 0; border: none;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}
.post-item:last-child { border-bottom: none; }
.post-item:hover { background: var(--gray-50); }
.post-author-info {
    flex-shrink: 0; display: flex; flex-direction: column;
    align-items: center; width: 60px;
}
.post-author-name {
    font-size: 11px; color: var(--text-secondary); text-align: center;
    margin-top: 6px; word-break: break-all; font-weight: 500;
}
.post-author-name a { color: var(--text-secondary); }
.post-author-name a:hover { color: var(--primary); }
.post-body { flex: 1; min-width: 0; }
.post-content { font-size: 14px; line-height: 1.8; color: var(--text); word-break: break-word; }
.post-footer {
    display: flex; align-items: center; gap: 12px;
    margin-top: 12px; font-size: 11px; color: var(--text-muted);
}
.post-floor {
    font-weight: 600; color: var(--primary);
    background: var(--primary-light); padding: 2px 10px;
    border-radius: var(--radius-full); font-size: 10px;
}
.btn-quote {
    margin-left: auto; padding: 5px 14px; font-size: 11px;
    border: 1px solid var(--border); border-radius: var(--radius-full);
    background: none; cursor: pointer; color: var(--text-muted);
    transition: all var(--transition);
}
.btn-quote:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* 回复表单 */
.reply-form h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }

/* 选择板块 */
.forum-select-group { margin-bottom: 16px; }
.forum-select-group h3 {
    font-size: 14px; font-weight: 600; color: var(--text);
    margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light);
}
.forum-select-list { display: flex; gap: 10px; flex-wrap: wrap; }
.forum-select-btn {
    display: inline-flex; align-items: center; padding: 8px 16px;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-full); color: var(--text); font-size: 13px;
    transition: all var(--transition);
}
.forum-select-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* 搜索页 */
.search-result-item {
    padding: 14px 18px; background: transparent;
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--gray-50); }
.search-result-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; display: block; transition: color var(--transition); }
.search-result-title:hover { color: var(--primary); }
.search-result-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.search-result-excerpt {
    font-size: 13px; color: var(--text-secondary); line-height: 1.7;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 暗色模式 */
html.dark .forum-header { background: color-mix(in srgb, var(--primary) 75%, #000); }
html.dark .forum-header::before { opacity: .4; }
html.dark .forum-stat-mods { background: rgba(255,255,255,.05); }
html.dark .forum-select-btn { background: var(--bg-card); }
html.dark .like-btn:hover { background: rgba(239,68,68,.1); }
html.dark .like-btn.liked { background: rgba(239,68,68,.1); }
html.dark .post-list-header { background: var(--bg-card); }
html.dark .thread-content img { box-shadow: none; }
html.dark .thread-detail-meta .author-link img { box-shadow: 0 0 0 2px rgba(59,130,246,.15); }
html.dark .meta-stat { background: var(--gray-800); }
html.dark .meta-edited:hover { background: rgba(59,130,246,.1); }
html.dark .meta-group { background: rgba(59,130,246,.15); }
html.dark .meta-level { background: color-mix(in srgb, var(--level-color, #999) 18%, transparent); }

/* 响应式 */

/* 小手机 ≤ 374px */
@media (max-width: 374px) {
    .thread-detail-header h1 { font-size: 16px; line-height: 1.35; }
    .thread-detail-meta { gap: 6px; font-size: 11px; }
    .meta-stat { font-size: 10px; padding: 2px 6px; gap: 3px; }
    .meta-stat svg { width: 11px; height: 11px; }
    .thread-content { font-size: 13px; line-height: 1.7; }
    .thread-content pre { padding: 10px; font-size: 11px; }
    .post-item { padding: 10px; gap: 8px; }
    .post-author-info { width: 32px; }
    .post-author-name { font-size: 9px; }
    .post-content { font-size: 12px; }
    .post-footer { font-size: 9px; }
    .thread-list-item { padding: 8px 10px; gap: 8px; }
    .thread-list-title { font-size: 13px; }
    .thread-list-counts { gap: 8px; }
    .thread-list-counts .count-value { font-size: 11px; }
    .thread-list-counts .count-item { min-width: 36px; }
    .forum-select-list { gap: 4px; }
    .forum-select-btn { padding: 6px 10px; font-size: 11px; }
}

/* 手机 ≤ 767px */
@media (max-width: 767px) {
    .thread-detail-header { margin-bottom: 14px; }
    .thread-detail-header h1 { font-size: 18px; line-height: 1.4; margin-bottom: 6px; }
    .thread-detail-header h1 .tag { font-size: 10px; margin-right: 4px; }
    .thread-detail-meta { gap: 6px 8px; font-size: 12px; padding-bottom: 8px; flex-wrap: wrap; align-items: center; }
    .meta-stats { margin-left: 0; flex-basis: 100%; gap: 4px; }
    .meta-stat { font-size: 11px; padding: 2px 8px; }
    .meta-tag { font-size: 10px; padding: 1px 6px; }
    .thread-detail-meta .author-link .author-name { font-size: 12px; }
    .thread-detail-meta .user-level-badge { font-size: 10px !important; padding: 1px 6px !important; }
    .thread-content { font-size: 14px; line-height: 1.8; padding: 10px 0; }
    .thread-content pre { padding: 12px; font-size: 12px; margin: 10px 0; }
    .thread-content blockquote { padding: 10px 14px; margin: 10px 0; }
    .thread-content img { margin: 8px 0; }
    .thread-tags { padding: 0 0 10px; gap: 4px; }
    .thread-tags .tag { padding: 4px 10px; font-size: 11px; min-height: 28px; display: inline-flex; align-items: center; }
    .thread-actions { gap: 6px; padding-top: 12px; }
    .like-btn { padding: 6px 12px; font-size: 12px; min-height: 34px; }
    .like-btn svg { width: 14px; height: 14px; }
    /* 回复列表 */
    .post-list-header { padding: 10px 12px; font-size: 13px; }
    .post-item { padding: 12px; gap: 10px; }
    .post-author-info { width: 40px; }
    .post-author-name { font-size: 10px; margin-top: 4px; }
    .post-content { font-size: 13px; line-height: 1.7; overflow: hidden; overflow-wrap: break-word; word-break: break-word; }
    .post-footer { margin-top: 8px; font-size: 10px; gap: 8px; }
    .post-floor { font-size: 9px; padding: 1px 8px; }
    .btn-quote { padding: 5px 12px; font-size: 11px; min-height: 28px; }
    /* 板块头部 */
    .forum-header-top { padding: 14px 16px; gap: 12px; }
    .forum-header-icon { width: 40px; height: 40px; font-size: 16px; border-radius: 10px; }
    .forum-header-info h1 { font-size: 16px; }
    .forum-header .forum-description { font-size: 12px; }
    .forum-stat-item { padding: 8px 16px; }
    .forum-stat-value { font-size: 14px; }
    .forum-stat-label { font-size: 10px; }
    .forum-stats-bar { flex-wrap: wrap; }
    .forum-stat-mods { padding: 6px 12px; flex: 1 1 100%; border-right: none; border-top: 1px solid rgba(255,255,255,.08); flex-direction: row; gap: 8px; justify-content: flex-start; }
    .forum-stat-mods .mod-icon { width: 22px; height: 22px; }
    .forum-stat-mods .mod-icon svg { width: 11px; height: 11px; }
    .forum-stat-mods .forum-stat-value { font-size: 11px; }
    .forum-stat-mods .forum-stat-label { font-size: 10px; }
    /* 帖子列表 */
    .thread-list-item { padding: 10px 12px; gap: 10px; }
    .thread-list-title { font-size: 14px; }
    .thread-list-info { margin-top: 4px; font-size: 11px; gap: 6px; }
    .thread-list-counts { gap: 12px; }
    .thread-list-counts .count-value { font-size: 12px; }
    .thread-list-counts .count-label { font-size: 9px; }
    /* 搜索 */
    .search-result-item { padding: 10px 12px; }
    .search-result-title { font-size: 13px; }
    .search-result-meta { font-size: 11px; }
    .search-result-excerpt { font-size: 12px; }
    /* 板块选择 */
    .forum-select-list { gap: 6px; }
    .forum-select-btn { padding: 8px 14px; font-size: 12px; min-height: 36px; }
}

/* 小平板 640px+ */
@media (min-width: 640px) {
    .thread-detail-header h1 { font-size: 24px; }
    .post-author-info { width: 64px; }
    .forum-header-top { padding: 24px 28px; }
}

/* 平板 768px+ */
@media (min-width: 768px) {
    .thread-list-last { display: flex; }
    .thread-list-item { padding: 14px 16px; }
}

/* 桌面 1024px+ */
@media (min-width: 1024px) {
    .thread-content { font-size: 15px; line-height: 1.9; }
    .post-content { font-size: 14px; }
}
