body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f6fa;
}

.navbar-brand { letter-spacing: -1px; }

.topic-item {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 10px;
    transition: box-shadow 0.15s;
    border: 1px solid #e8e9ef;
}
.topic-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }

/* Title line: badges + title on one row, only title truncates */
.title-line {
    display: flex;
    align-items: baseline;
    min-width: 0;
}
.title-line .badge {
    flex-shrink: 0;
    vertical-align: middle;
}

.topic-item .title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    margin-left: 0;
}
.topic-item .title:hover { color: #0d6efd; }

.badge-pinned { background: #dc3545; }
.badge-highlighted {
    background: linear-gradient(135deg, #e8a817, #c7890a);
    color: #fff;
    font-weight: 600;
}
.badge-category { background: #6c757d; }

/* Make pinned/highlighted badges match title text size and align properly */
.topic-item .badge {
    font-size: 0.7rem;
    padding: 0.15em 0.4em;
    line-height: 1.4;
    vertical-align: baseline;
}

.icon-highlighted {
    color: #fff;
    font-size: 0.85em;
    vertical-align: middle;
    margin-right: 1px;
}

/* Highlighted topic title */
.topic-item.highlighted {
    border-left: 3px solid #dc2626;
    background: linear-gradient(90deg, #fef2f2 0%, #fff 30%);
}
.topic-item.highlighted .title {
    color: #dc2626;
    font-weight: 700;
}
.topic-item.highlighted .title:hover {
    color: #b91c1c;
}

/* Detail page highlighted title */
.highlighted-title {
    color: #dc2626;
    font-weight: 700;
}
.highlighted-title:hover {
    color: #b91c1c;
}

/* Topic detail highlighted header */
.topic-highlighted-header {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.comment-tree { border-left: 2px solid #dee2e6; margin-left: 20px; padding-left: 16px; }

.avatar-sm { width: 36px; height: 36px; object-fit: cover; }

.admin-sidebar .nav-link { color: #333; border-radius: 6px; margin-bottom: 2px; }
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active { background: #e9ecef; }

.content-body img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    display: block;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
    margin: 8px 0;
}
.content-body img:hover {
    transform: scale(1.03);
}

/* Lightbox: click image to view full size */
.image-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.image-lightbox.show { display: flex; }
.image-lightbox img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
}
.content-body blockquote { border-left: 3px solid #dee2e6; padding-left: 12px; color: #666; }
.content-body pre { background: #f8f9fa; padding: 12px; border-radius: 6px; overflow-x: auto; }

/* File attachments */
.file-attachment {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 16px;
    margin: 8px 0;
    display: inline-block;
}
.file-attachment .file-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}
.file-attachment .file-link:hover { color: #0d6efd; }

/* Video attachments */
.video-attachment {
    margin: 12px 0;
}
.video-player {
    display: block;
    width: 100%;
    max-width: 720px;
    border-radius: 8px;
    background: #000;
    outline: none;
}

/* Upload toolbar */
.upload-toolbar .btn { margin-right: 6px; }

/* Upload progress */
.upload-progress { margin-top: -8px; }
