.index-wrap {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.index-main {
    flex: 1;
    min-width: 0;
    width: 100%;
}
#forum-index-content {
    width: 100%;
}

.index-sidebar {
    width: 200px;
    flex-shrink: 0;
}

.sidebar-group {
    margin-bottom: 20px;
    width: 100%;
}

.sidebar-group-header {
    background: var(--slate);
    color: #ffffff;
    padding: 9px 14px;
    border-radius: var(--radius) var(--radius) 0 0;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: -0.01em;
}

.sidebar-group-body {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}

.sidebar-links {
    list-style: none;
    padding: 4px 0;
}

.sidebar-links li {
    border-bottom: 1px solid var(--border-light);
}

.sidebar-links li:last-child {
    border-bottom: none;
}

.sidebar-links a {
    display: block;
    padding: 8px 14px;
    font-size: 15px;
    color: var(--blue);
    text-decoration: none;
    transition: background 0.1s;
}

.sidebar-links a:hover {
    background: var(--bg);
    text-decoration: none;
}

.sidebar-stats {
    padding: 10px 14px;
    font-size: 15px;
    color: var(--text-mid);
    line-height: 1.7;
}

.sidebar-stats strong {
    color: var(--text);
}

.category-group {
    margin-bottom: 20px;
    width: 100%;
}

.category-group-header {
    background: var(--slate);
    color: #ffffff;
    padding: 9px 14px;
    border-radius: var(--radius) var(--radius) 0 0;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: -0.01em;
}

.category-group-body {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}

.category-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border-light);
    min-height: 58px;
    transition: background 0.1s;
}

.category-row:last-child {
    border-bottom: none;
}

.category-row:hover {
    background: #f7f8fc;
}

.category-left {
    width: 200px;
    flex-shrink: 0;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.category-name {
    font-size: 15px;
    font-weight: bold;
    color: var(--blue);
    text-decoration: none;
    display: block;
}

.category-name:hover {
    color: var(--blue-dark);
    text-decoration: underline;
}

.category-desc {
    font-size: 15px;
    color: var(--text-dim);
    margin-top: 2px;
}

.category-right {
    flex: 1;
    min-width: 0;
    border-left: 1px solid var(--border-light);
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.category-recent-thread {
    padding: 4px 0;
    border-bottom: 1px solid var(--border-light);
}

.category-recent-thread:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.category-recent-thread:first-child {
    padding-top: 0;
}

.category-last-title {
    font-size: 15px;
    color: var(--blue);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    font-weight: bold;
}

.category-last-title:hover {
    text-decoration: underline;
}

.category-last-meta {
    font-size: 15px;
    color: var(--text-dim);
}

.category-last-meta a {
    color: var(--blue);
    font-weight: bold;
}

.category-stats-col {
    width: 90px;
    flex-shrink: 0;
    border-left: 1px solid var(--border-light);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    font-size: 15px;
    color: var(--text-dim);
    text-align: right;
}

.category-stats-col strong {
    color: var(--text);
    font-size: 15px;
}

.thread-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.thread-list-title {
    font-size: 18px;
    font-weight: bold;
}

.thread-table {
    width: 100%;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.thread-table-head {
    display: flex;
    padding: 6px 14px;
    gap: 10px;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: bold;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.thread-row {
    display: flex;
    align-items: flex-start;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    gap: 10px;
    transition: background 0.1s;
}

.thread-row:last-child {
    border-bottom: none;
}

.thread-row:hover {
    background: #f7f8fc;
}

.thread-row.pinned {
    background: #fffbeb;
}

.thread-row.pinned:hover {
    background: #fef3c7;
}

.thread-row.locked {
    opacity: 0.82;
}

.thread-info {
    flex: 1;
    min-width: 0;
}

.thread-title-link {
    font-size: 15px;
    font-weight: bold;
    color: var(--text);
    text-decoration: none;
    display: block;
    word-break: break-word;
}

.thread-title-link:hover {
    color: var(--blue);
}

.thread-meta {
    font-size: 15px;
    color: var(--text-dim);
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.thread-meta a {
    color: var(--blue);
    font-weight: bold;
}

.thread-header-box {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 14px;
}

.thread-header-title {
    font-size: 19px;
    font-weight: bold;
    color: var(--text);
    margin-bottom: 6px;
}

.thread-header-meta {
    font-size: 15px;
    color: var(--text-dim);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.thread-header-meta a {
    color: var(--blue);
}

.thread-header-actions {
    margin-top: 10px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.post-list {
    display: flex;
    flex-direction: column;
}

.post-card {
    display: flex;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-top: none;
}

.post-card:first-child {
    border-top: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}

.post-card:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
}

.post-card:only-child {
    border-top: 1px solid var(--border);
    border-radius: var(--radius);
}

.post-card.deleted {
    opacity: 0.6;
}

.post-author-col {
    width: 140px;
    flex-shrink: 0;
    padding: 12px 12px;
    border-right: 1px solid var(--border-light);
    background: var(--index-author-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3px;
}

.post-author-name {
    font-size: 15px;
    font-weight: bold;
    color: var(--blue);
    word-break: break-word;
    text-decoration: none;
}

.post-author-name:hover {
    color: var(--blue-dark);
    text-decoration: underline;
}

.post-author-rank {
    font-size: 11px;
    color: var(--text-dim);
    font-style: italic;
}

.post-author-count {
    font-size: 11px;
    color: var(--text-dim);
}

.post-author-badge {
    margin-top: 3px;
}

.post-body-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 14px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg);
    gap: 8px;
    flex-wrap: wrap;
}

.post-timestamp {
    font-size: 12px;
    color: var(--text-dim);
    flex: 1;
}

.post-edited {
    font-size: 11px;
    color: var(--text-light);
    font-style: italic;
    display: block;
}

.post-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.post-body-text {
    padding: 12px 14px;
    font-size: 15px;
    color: var(--text);
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    flex: 1;
}

.post-body-text.deleted-text {
    color: var(--text-dim);
    font-style: italic;
}

.post-quote {
    border-left: 3px solid var(--blue);
    background: var(--bg);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 15px;
    color: var(--text-mid);
}

.post-quote-author {
    font-weight: bold;
    font-size: 15px;
    color: var(--blue);
    margin-bottom: 4px;
}

.reply-box {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
}

.reply-box-title {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 12px;
    color: var(--text);
}

.reply-quote-preview {
    background: var(--bg);
    border-left: 3px solid var(--blue);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 15px;
    color: var(--text-mid);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.auth-wrap {
    max-width: 440px;
    margin: 0 auto;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.auth-panel {
    display: block;
}

.profile-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.profile-header {
    background: var(--slate);
    padding: 20px 20px 16px;
    color: #ffffff;
}

.profile-username {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 4px;
}

.profile-rank {
    font-size: 15px;
    opacity: 0.88;
}

.profile-body {
    padding: 16px 20px;
}

.profile-stat-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.profile-stat {
    font-size: 15px;
    color: var(--text-mid);
}

.profile-stat strong {
    color: var(--text);
}

.profile-bio {
    font-size: 15px;
    color: var(--text);
    margin-top: 10px;
    white-space: pre-wrap;
}

.msg-list {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.msg-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    gap: 10px;
    cursor: pointer;
    transition: background 0.1s;
}

.msg-row:last-child {
    border-bottom: none;
}

.msg-row:hover {
    background: var(--bg);
}

.msg-row.unread {
    background: #eff6ff;
}

.msg-row.unread:hover {
    background: var(--blue-dim);
}

.msg-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--blue);
    flex-shrink: 0;
}

.msg-info {
    flex: 1;
    min-width: 0;
}

.msg-subject {
    font-size: 15px;
    font-weight: bold;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-row.unread .msg-subject {
    color: var(--blue);
}

.msg-meta {
    font-size: 15px;
    color: var(--text-dim);
    margin-top: 2px;
}

.msg-time {
    font-size: 15px;
    color: var(--text-dim);
    flex-shrink: 0;
}

.msg-view {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.msg-view-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.msg-view-subject {
    font-size: 17px;
    font-weight: bold;
    margin-bottom: 4px;
}

.msg-view-meta {
    font-size: 15px;
    color: var(--text-dim);
}

.msg-view-body {
    padding: 16px;
    font-size: 15px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.msg-view-actions {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.compose-box {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

@media (max-width: 1024px) {
    .index-wrap {
        flex-direction: column;
    }

    .index-sidebar {
        width: 100%;
        order: -1;
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }

    .index-main {
        order: 0;
        width: 100%;
    }

    .sidebar-group-body {
        flex: 1;
        min-width: 160px;
        margin-bottom: 0;
    }

    .category-right {
        display: none;
    }

    .category-stats-col {
        display: none;
    }
}

@media (max-width: 600px) {
    .post-card {
        flex-direction: column;
    }

    .post-author-col {
        width: 100%;
        flex-direction: row;
        text-align: left;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding: 8px 14px;
        gap: 10px;
        justify-content: flex-start;
    }

    .post-author-badge {
        margin-top: 0;
    }

    .thread-replies,

    .thread-last-post {
        display: none;
    }

    .thread-table-head-last {
        display: none;
    }

    .sidebar-group-body {
        min-width: 140px;
    }
}

.inline-code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1px 5px;
    color: var(--text);
}

.markup-quote {
    display: inline;
    color: var(--text-dim);
    font-style: italic;
    border-left: 3px solid var(--border);
    padding-left: 8px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.markup-help {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.markup-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: bold;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 5px 10px;
    color: var(--text-mid);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background 0.1s, border-color 0.1s, color 0.1s, box-shadow 0.1s;
    line-height: 1;
}

.markup-tag:hover {
    background: var(--blue-dim);
    border-color: var(--blue-border);
    color: var(--blue-dark);
}

.markup-tag:active,
.markup-tag.active {
    background: var(--blue);
    border-color: var(--blue-dark);
    color: #ffffff;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.markup-tag:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.markup-tag strong {
    font-weight: 900;
    font-size: 13px;
    pointer-events: none;
}

.markup-tag em {
    font-style: italic;
    font-size: 13px;
    pointer-events: none;
}

.markup-tag del {
    text-decoration: line-through;
    font-size: 13px;
    pointer-events: none;
}

.markup-tag code {
    font-family: var(--font-mono);
    font-size: 11px;
    background: none;
    border: none;
    padding: 0;
    pointer-events: none;
}

.markup-tag.active strong,
.markup-tag.active em,
.markup-tag.active del,
.markup-tag.active code {
    color: #ffffff;
}

.thread-table-head-thread {
    flex: 1;
}

.thread-table-head-replies {
    width: 90px;
    flex-shrink: 0;
    text-align: left;
}

.thread-table-head-last {
    width: 100px;
    flex-shrink: 0;
    text-align: left;
}

.thread-empty {
    border: none;
    border-radius: 0;
}

.search-input-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.search-input-wrap .form-input {
    flex: 1;
}

.msg-read-spacer {
    width: 8px;
    flex-shrink: 0;
}

.profile-admin-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-action-btn {
    margin-top: 10px;
}

.profile-badge-wrap {
    margin-top: 6px;
}

.profile-recent-post {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 8px;
}

.profile-recent-post-meta {
    font-size: 15px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.profile-recent-post-body {
    font-size: 15px;
    color: var(--text);
}

.profile-recent-title {
    font-size: 16px;
    margin-bottom: 10px;
}

.profile-edit-form {
    margin-top: 14px;
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.category-desc-para {
    color: var(--text-dim);
    font-size: 15px;
    margin-bottom: 12px;
}

.reply-area {
    margin-top: 16px;
}

.thread-locked-notice,
.thread-login-notice {
    color: var(--text-dim);
    text-align: center;
    padding: 12px;
}

.quote-preview-body {
    font-size: 15px;
    color: var(--text-mid);
}

.post-edit-wrap {
    padding: 10px 14px;
}

.post-edit-actions {
    margin-top: 8px;
}

.markup-code-tag {
    font-size: 11px;
    background: none;
    border: none;
    padding: 0;
}

.thread-stats {
    font-size: 15px;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-shrink: 0;
    width: 90px;
    gap: 2px;
    white-space: nowrap;
}

.thread-stat-item {
    line-height: 1.5;
}

.thread-stat-item strong {
    color: var(--text);
    font-size: 15px;
}

.thread-last-post {
    font-size: 15px;
    color: var(--text-dim);
    text-align: left;
    flex-shrink: 0;
    width: 100px;
    line-height: 1.5;
}

.thread-last-post a {
    color: var(--blue);
    font-weight: bold;
}

.reply-preview-hint {
    font-size: 15px;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.reply-preview-body {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-quote-body {
    font-size: 15px;
    color: var(--text-mid);
    white-space: pre-wrap;
    word-break: break-word;
}

.compose-preview-hint {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 14px;
}

.compose-preview-title-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 14px;
}

.compose-preview-label {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.compose-preview-title-text {
    font-size: 18px;
    font-weight: bold;
    color: var(--text);
}

.compose-preview-body-box {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
}

.compose-preview-body-label {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.compose-preview-body-text {
    padding: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 15px;
    color: var(--text);
    line-height: 1.65;
}

.notif-thread {
    background: #cfe8ff;
    border-left: 3px solid var(--blue);
}

.notif-category {
    background: #cfe8ff;
}

.notif-category .category-name {
    color: var(--blue-dark);
    font-weight: bold;
}

.notif-nav {
    color: var(--blue-dark) !important;
    font-weight: bold;
}

.notif-msg-row {
    background: #cfe8ff;
}

.msg-row-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-left: 10px;
}
