/* Forum list */
.forum-list {
    list-style: none;
}
.forum-item {
    background: var(--color-card);
    border-radius: var(--radius-card);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.forum-item:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}
.forum-item-icon {
    flex-shrink: 0;
    padding-top: 2px;
}
.forum-item-main {
    flex: 1;
    min-width: 0;
}
.forum-item h3 {
    margin-bottom: 4px;
}
.forum-item h3 a {
    color: var(--color-brand);
    text-decoration: none;
}
.forum-item h3 a:hover {
    color: var(--color-accent);
}
.forum-item .desc {
    color: #666;
    font-size: 0.9rem;
}
.forum-item .meta {
    font-size: 0.8rem;
    color: var(--color-light);
    margin-top: 8px;
}
.forum-item .meta span {
    margin-right: 12px;
}
.forum-pages {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.forum-item-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 8px;
    min-width: 70px;
}
.forum-item-stats .topic-stat-item {
    white-space: nowrap;
}

/* Topic list */
.topic-list {
    list-style: none;
}
.topic-item {
    background: var(--color-card);
    border-radius: var(--radius-card);
    padding: 14px 16px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px;
    transition: box-shadow 0.2s;
}
.topic-item:hover {
    box-shadow: var(--shadow-card-hover);
}
.topic-icon {
    flex-shrink: 0;
    padding-top: 2px;
}
.topic-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.topic-icon-circle img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}
.topic-icon-circle-default {
    background: var(--color-muted);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}
.topic-item .topic-main {
    flex: 1;
    min-width: 0;
}
.topic-item .topic-title {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.3;
}
.topic-item .topic-title a {
    color: var(--color-brand);
    text-decoration: none;
}
.topic-item .topic-title a:hover {
    color: var(--color-accent);
}
.topic-sticky-badge {
    color: #e94560;
    font-weight: 600;
    margin-right: 4px;
}
.topic-item .topic-meta {
    font-size: 0.8rem;
    color: var(--color-light);
}
.topic-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}
.topic-author-link {
    color: #e94560;
    text-decoration: none;
}
.topic-author-link:hover {
    text-decoration: underline;
}
.topic-author-deleted {
    color: #999;
    font-style: italic;
}
.topic-author-name {
    color: #e94560;
}
.topic-author-guest {
    color: #999;
}
.topic-pages {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}
.topic-pages-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.topic-pages .topic-stats {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    margin-left: auto;
}
.topic-stats {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}
.topic-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 5px;
    border-radius: 4px;
    background: var(--color-bg);
    color: var(--color-brand);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.topic-page-link:hover {
    background: var(--color-accent);
    color: #fff;
}
.topic-page-dots {
    font-size: 0.75rem;
    color: var(--color-light);
    padding: 0 2px;
}
.topic-stat-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3px;
}
.topic-stat-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-light);
    line-height: 1.2;
}
.topic-stat-icon {
    width: 14px;
    height: 14px;
    color: var(--color-light);
    flex-shrink: 0;
}
.topic-stat-divider {
    width: 1px;
    height: 32px;
    background: var(--color-border, #ddd);
    margin: 0 8px;
    flex-shrink: 0;
}
.topic-stat-label {
    display: none;
}
.sticky {
    background: var(--color-sticky);
}

/* Topic body (posts) */
.topic-body {
    background: var(--color-card);
    border-radius: var(--radius-card);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
}
.topic-body h2 {
    margin-bottom: 12px;
}
.topic-body .post-meta {
    font-size: 0.85rem;
    color: var(--color-light);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}
.topic-body .post-content {
    font-size: 1rem;
    line-height: 1.7;
}
.topic-body .post-content p {
    margin-bottom: 1.25em;
}
.topic-body .post-content p:last-child {
    margin-bottom: 0;
}
.topic-body .post-content blockquote {
    margin: 1em 0;
    padding: 8px 12px;
    border-left: 3px solid #bbb;
    background: #fffef5;
    border-radius: 4px;
}
.topic-body .post-content ul,
.topic-body .post-content ol {
    margin: 0.5em 0 0.5em 1.5em;
    padding: 0;
}
.topic-body .post-content li {
    margin-bottom: 0.25em;
}
.topic-body .post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}
.topic-body .post-content a {
    color: var(--color-accent);
    overflow-wrap: break-word;
    word-break: break-all;
}
.topic-body .post-content a:hover {
    color: var(--color-accent-hover);
}



/* Responsive forum overrides */
@media (max-width: 600px) {
    .forum-item { padding: 12px; }
    .topic-item {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 6px 10px;
        padding: 10px 12px;
    }
    .topic-icon { grid-row: 1 / 3; grid-column: 1; }
    .topic-main { grid-row: 1; grid-column: 2; }
    .topic-pages { grid-row: 2; grid-column: 1 / 3; margin-top: 0; width: auto; }
    .topic-icon-circle { width: 36px; height: 36px; }
    .topic-icon-circle img { width: 20px; height: 20px; }
    .topic-stat-value { font-size: 0.8rem; }
    .topic-stat-icon { width: 14px; height: 14px; }
    .topic-stat-divider { height: 26px; margin: 0 6px; }
    .forum-item-stats .topic-stat-item { flex-direction: column; align-items: flex-end; }
    .topic-meta-row { gap: 8px; }
    .topic-body { padding: 14px; }
}
