/* Community topic detail, aligned with the mobile community feed. */
body.qm-community-topic-detail-page {
    background: #f4f4f4;
    color: var(--qm-color-text);
    letter-spacing: 0;
}

.qm-community-topic-detail {
    --topic-page: #f4f4f4;
    --topic-card: #fefefd;
    --topic-ink: #343433;
    --topic-muted: #666666;
    --topic-faint: #b4aeb4;
    --topic-line: rgba(52, 52, 51, 0.08);
    --topic-violet: #ae81ef;
    --topic-lime: #cefb48;
    min-height: 72vh;
    padding: 22px 0 48px;
    overflow-x: clip;
    background: var(--topic-page);
    color: var(--topic-ink);
    letter-spacing: 0;
}

.qm-community-topic-detail,
.qm-community-topic-detail * {
    box-sizing: border-box;
}

.qm-community-topic-detail a {
    text-decoration: none;
}

.qm-topic-detail-shell {
    max-width: 1360px;
}

.qm-topic-detail-mobile-toolbar {
    display: none;
}

.qm-topic-detail-back {
    margin: 0 0 14px;
}

.qm-topic-detail-back a {
    display: inline-flex;
    min-height: 34px;
    padding: 4px 6px;
    align-items: center;
    gap: 7px;
    border-radius: var(--qm-radius-size-1);
    color: var(--topic-muted);
    font-size: 13px;
}

.qm-topic-detail-back a:hover {
    background: rgba(52, 52, 51, 0.05);
    color: var(--topic-ink);
}

.qm-topic-detail-layout:not(.has-vote-sidebar) {
    justify-content: center;
}

.qm-topic-detail-layout:not(.has-vote-sidebar) .qm-topic-detail-content-col {
    width: min(100%, 920px);
}

.qm-community-topic-detail .qm-topic-detail-card,
.qm-community-topic-detail .qm-topic-detail-comments,
.qm-community-topic-detail .qm-topic-sidebar--vote {
    border: 0;
    border-radius: var(--qm-radius-size-1) !important;
    background: var(--topic-card);
    box-shadow: none;
}

.qm-topic-detail-card {
    width: 100%;
    overflow: visible;
}

.qm-topic-detail-card__body {
    padding: 24px 28px 28px;
}

.qm-topic-detail-header {
    position: relative;
    display: flex;
    min-height: 44px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.qm-community-topic-detail .qm-community-topic__author {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    color: inherit;
}

.qm-community-topic-detail .qm-community-topic__avatar {
    display: block;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: var(--qm-radius-circle);
    background: rgba(52, 52, 51, 0.06);
    object-fit: cover;
}

.qm-community-topic-detail .qm-community-topic__author-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.qm-community-topic-detail .qm-community-topic__name-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
}

.qm-community-topic-detail .qm-community-topic__name {
    max-width: 190px;
    overflow: hidden;
    color: var(--topic-ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qm-community-topic-detail .qm-community-topic__badges {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 4px;
}

.qm-community-topic-detail .qm-community-topic__time {
    color: var(--topic-faint);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.2;
}

.qm-community-topic-detail .qm-community-topic__header-actions {
    display: flex;
    min-width: 40px;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.qm-community-topic-detail .qm-community-topic__menu {
    position: relative;
    z-index: 45;
}

.qm-community-topic-detail .qm-community-topic__menu > summary {
    display: inline-flex;
    width: 40px;
    height: 28px;
    padding: 0;
    align-items: center;
    justify-content: flex-end;
    border: 0;
    border-radius: var(--qm-radius-size-1);
    background: transparent;
    color: var(--topic-muted);
    cursor: pointer;
    font-size: 15px;
    list-style: none;
}

.qm-community-topic-detail .qm-community-topic__menu > summary::before {
    position: absolute;
    top: -6px;
    right: -4px;
    width: 44px;
    height: 40px;
    content: "";
}

.qm-community-topic-detail .qm-community-topic__menu > summary::-webkit-details-marker {
    display: none;
}

.qm-community-topic-detail .qm-community-topic__menu > summary:hover {
    color: var(--topic-ink);
}

.qm-community-topic-detail .qm-community-topic__menu-panel {
    position: absolute;
    z-index: 60;
    top: 38px;
    right: 0;
    display: flex;
    width: max-content;
    min-width: 150px;
    max-width: min(240px, calc(100vw - 32px));
    padding: 6px;
    flex-direction: column;
    gap: 3px;
    border: 1px solid var(--topic-line);
    border-radius: var(--qm-radius-size-1);
    background: var(--topic-card);
    box-shadow: var(--qm-shadow-xl);
}

.qm-community-topic-detail .qm-community-topic__menu-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qm-community-topic-detail .qm-community-topic__menu-group--secondary {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--topic-line);
}

.qm-community-topic-detail .qm-community-topic__menu-panel .qm-topic-action {
    display: flex;
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    border: 0;
    border-radius: var(--qm-radius-size-1);
    background: transparent;
    color: var(--qm-color-text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    text-align: left;
}

.qm-community-topic-detail .qm-community-topic__menu-panel .qm-topic-action:hover {
    background: rgba(52, 52, 51, 0.055);
    color: var(--topic-ink);
}

.qm-community-topic-detail .qm-community-topic__menu-panel .qm-topic-action--danger {
    color: var(--qm-primary);
}

.qm-community-topic-detail .qm-community-topic__menu-panel .qm-topic-action i {
    width: 16px;
    flex: 0 0 16px;
    text-align: center;
}

.qm-community-topic-detail .qm-community-topic__status-list {
    display: flex;
    max-width: 220px;
    min-height: 18px;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-wrap: wrap;
}

.qm-community-topic-detail .qm-community-topic__status {
    display: inline-flex;
    min-height: 18px;
    padding: 2px 7px;
    align-items: center;
    justify-content: center;
    border-radius: var(--qm-radius-size-1);
    background: rgba(52, 52, 51, 0.08);
    color: var(--qm-color-text-secondary);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.qm-community-topic-detail .qm-community-topic__status--sticky {
    background: #d9c4ff;
    color: #49346c;
}

.qm-community-topic-detail .qm-community-topic__status--featured {
    background: #d6fb72;
    color: var(--qm-color-text);
}

.qm-community-topic-detail .qm-community-topic__status--recommended {
    background: #bdeaf2;
    color: #174953;
}

.qm-community-topic-detail .qm-community-topic__status--locked {
    background: #ffe0b7;
    color: #704713;
}

.qm-topic-detail-heading {
    margin-top: 20px;
}

.qm-community-topic-detail .qm-topic-detail-title {
    margin: 0;
    color: var(--topic-ink);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.qm-community-topic-detail .qm-community-topic__board {
    display: inline-flex;
    min-height: 24px;
    margin-right: 8px;
    padding: 3px 9px 3px 6px;
    align-items: center;
    border-radius: var(--qm-radius-pill);
    background: var(--topic-ink);
    color: var(--topic-card);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    vertical-align: 4px;
    white-space: nowrap;
}

.qm-community-topic-detail .qm-community-topic__board > span {
    display: inline-flex;
    width: 16px;
    height: 16px;
    margin-right: 4px;
    align-items: center;
    justify-content: center;
    border-radius: var(--qm-radius-circle);
    background: rgba(255, 255, 255, 0.16);
    font-size: 10px;
}

.qm-community-topic-detail .qm-topic-detail-subtitle {
    display: -webkit-box;
    max-width: 720px;
    margin: 8px 0 0;
    overflow: hidden;
    color: var(--topic-muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.qm-topic-detail-tags {
    display: flex;
    margin-top: 12px;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.qm-topic-detail-tags > span {
    display: inline-flex;
    min-height: 24px;
    padding: 3px 8px;
    align-items: center;
    border-radius: var(--qm-radius-size-1);
    background: rgba(52, 52, 51, 0.055);
    color: var(--topic-muted);
    font-size: 11px;
}

.qm-topic-detail-lock-notice {
    display: inline-flex;
    min-height: 34px;
    margin-top: 16px;
    padding: 7px 10px;
    align-items: center;
    gap: 7px;
    border: 0;
    border-radius: var(--qm-radius-size-1);
    background: #fff2c7;
    color: #8b6507;
    font-size: 12px;
    line-height: 1.5;
}

.qm-topic-detail-lock-notice i {
    font-size: 11px;
}

.qm-topic-detail-prose {
    width: 100%;
    min-width: 0;
    margin-top: 24px;
    color: var(--qm-color-text);
    font-size: 16px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.qm-topic-detail-prose > :first-child {
    margin-top: 0;
}

.qm-topic-detail-prose > :last-child {
    margin-bottom: 0;
}

.qm-topic-detail-prose :is(p, ul, ol, blockquote, pre, table, figure) {
    margin-top: 0;
    margin-bottom: 1.25em;
}

.qm-topic-detail-prose :is(h1, h2, h3, h4) {
    margin: 1.65em 0 0.7em;
    color: var(--topic-ink);
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 0;
}

.qm-topic-detail-prose h2 {
    padding-left: 10px;
    border-left: 4px solid var(--topic-lime);
    font-size: 22px;
}

.qm-topic-detail-prose h3 {
    font-size: 18px;
}

.qm-topic-detail-prose :is(img, video, canvas, svg, iframe, embed, object) {
    max-width: 100% !important;
}

.qm-topic-detail-prose :is(img, video) {
    display: block;
    width: auto;
    height: auto;
    max-height: 720px;
    margin: 16px auto;
    border-radius: var(--qm-radius-size-2);
    object-fit: contain;
}

.qm-topic-detail-prose iframe {
    width: 100%;
    border: 0;
    border-radius: var(--qm-radius-size-1);
}

.qm-topic-detail-prose blockquote {
    padding: 12px 14px;
    border-left: 3px solid var(--topic-violet);
    border-radius: 0 var(--qm-radius-size-1) var(--qm-radius-size-1) 0;
    background: rgba(174, 129, 239, 0.08);
}

.qm-topic-detail-copyright {
    display: flex;
    margin-top: 28px;
    padding: 12px 0;
    align-items: flex-start;
    gap: 10px;
    border-top: 1px solid var(--topic-line);
    color: var(--topic-muted);
    font-size: 11px;
    line-height: 1.55;
}

.qm-topic-detail-copyright strong {
    flex: 0 0 auto;
    color: var(--qm-color-text-secondary);
    font-size: 11px;
}

.qm-community-topic-detail .qm-topic-detail-footer {
    display: block;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--topic-line);
}

.qm-community-topic-detail .qm-community-topic__footer-left {
    display: grid;
    width: 100%;
    min-width: 0;
    align-items: center;
    column-gap: 18px;
    grid-template-columns: minmax(0, 1fr) max-content max-content;
    color: var(--topic-muted);
}

.qm-community-topic-detail .qm-topic-stat {
    display: inline-flex;
    min-width: 0;
    min-height: 34px;
    padding: 4px 2px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    border-radius: var(--qm-radius-size-1);
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    line-height: 1;
}

.qm-community-topic-detail .qm-topic-stat:first-child {
    justify-content: flex-start;
}

.qm-community-topic-detail span.qm-topic-stat {
    cursor: default;
}

.qm-community-topic-detail .qm-topic-stat:nth-child(n + 2) {
    justify-self: end;
}

.qm-community-topic-detail .qm-topic-stat__icon {
    display: block;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    object-fit: contain;
}

.qm-community-topic-detail .qm-topic-stat--view .qm-topic-stat__icon {
    padding: 1px;
    border-radius: var(--qm-radius-circle);
    background: rgba(255, 255, 255, 0.88);
}

.qm-community-topic-detail .qm-topic-stat__num {
    font-size: 12px;
    font-weight: 400;
}

.qm-community-topic-detail .qm-topic-stat--like.active {
    color: #6754c6;
}

.qm-topic-detail-comments-row {
    max-width: 920px;
    margin-right: auto;
    margin-left: auto;
}

.qm-topic-detail-comments {
    width: 100%;
}

.qm-topic-detail-comments__body {
    padding: 20px 24px 24px;
}

.qm-community-topic-detail .qm-comments-locked-notice {
    display: flex;
    min-height: 36px;
    margin-bottom: 14px;
    padding: 8px 10px;
    align-items: center;
    gap: 7px;
    border-radius: var(--qm-radius-size-1);
    background: #fff2c7;
    color: #8b6507;
    font-size: 12px;
    line-height: 1.5;
}

.qm-community-topic-detail .qm-comments-locked-notice i {
    font-size: 11px;
}

.qm-community-topic-detail .qm-topic-detail-comments.is-locked :is(#qm-comment-form-anchor, #respond, .qm-comment-form) {
    display: none !important;
}

.qm-community-topic-detail .qm-topic-detail-comments.is-locked.has-no-comments :is(.qm-comments-toolbar, .qm-comments-list-wrapper) {
    display: none !important;
}

.qm-community-topic-detail .qm-topic-detail-comments.is-locked.has-no-comments .qm-topic-detail-comments__body {
    display: flex;
    flex-direction: column;
}

.qm-community-topic-detail .qm-topic-detail-comments.is-locked.has-no-comments #comments {
    order: 1;
}

.qm-community-topic-detail .qm-topic-detail-comments.is-locked.has-no-comments .qm-comments-locked-notice {
    order: 2;
}

.qm-community-topic-detail .qm-topic-detail-comments.is-locked.has-no-comments .qm-topic-detail-comments-empty {
    order: 3;
}

.qm-topic-detail-comments-empty {
    display: flex;
    min-height: 150px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    border-radius: var(--qm-radius-size-1);
    background: rgba(52, 52, 51, 0.035);
    color: var(--topic-muted);
    font-size: 13px;
}

.qm-topic-detail-comments-empty i {
    color: var(--topic-faint);
    font-size: 30px;
}

.qm-topic-detail-empty {
    padding: 56px 12px;
    color: var(--topic-muted);
    text-align: center;
}

.qm-community-topic-detail :is(a, button, summary):focus-visible {
    outline: 3px solid rgba(174, 129, 239, 0.5);
    outline-offset: 2px;
}

@media (min-width: 992px) {
    .qm-community-topic-detail .qm-topic-sidebar--vote {
        position: sticky;
        top: calc(var(--qm-header-height, 60px) + 20px);
    }
}

@media (max-width: 767.98px) {
    html,
    body.qm-community-topic-detail-page {
        background: #f4f4f4 !important;
    }

    body.qm-community-topic-detail-page {
        padding-bottom: 0 !important;
        color: var(--qm-color-text);
    }

    body.qm-community-topic-detail-page #qm-header,
    body.qm-community-topic-detail-page .site-footer,
    body.qm-community-topic-detail-page #qm-bottom-nav {
        display: none !important;
    }

    .qm-community-topic-detail {
        min-height: 100vh;
        padding: 0 0 28px;
    }

    .qm-topic-detail-shell {
        width: 100%;
        max-width: none;
        padding-top: 62px;
        padding-right: 12px;
        padding-left: 12px;
    }

    .qm-topic-detail-mobile-toolbar {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 70;
        display: grid;
        width: 100%;
        height: 52px;
        margin: 0;
        padding: 0 12px;
        align-items: center;
        grid-template-columns: 40px minmax(0, 1fr) 40px;
        background: rgba(244, 244, 244, 0.94);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .qm-topic-detail-mobile-toolbar > a,
    .qm-topic-detail-mobile-toolbar > span {
        display: inline-flex;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        border-radius: var(--qm-radius-circle);
        color: var(--topic-ink);
    }

    .qm-topic-detail-mobile-toolbar > strong {
        overflow: hidden;
        color: var(--topic-ink);
        font-size: 16px;
        font-weight: 700;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .qm-topic-detail-back {
        display: none;
    }

    .qm-topic-detail-layout {
        --bs-gutter-x: 0;
        --bs-gutter-y: 12px;
    }

    .qm-community-topic-detail .qm-topic-detail-card,
    .qm-community-topic-detail .qm-topic-detail-comments,
    .qm-community-topic-detail .qm-topic-sidebar--vote {
        border-radius: var(--qm-radius-size-3) !important;
    }

    .qm-topic-detail-card__body {
        padding: 13px 12px 12px;
    }

    .qm-topic-detail-header {
        min-height: 40px;
        gap: 8px;
    }

    .qm-community-topic-detail .qm-community-topic__avatar {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .qm-community-topic-detail .qm-community-topic__author {
        gap: 9px;
    }

    .qm-community-topic-detail .qm-community-topic__name {
        max-width: 150px;
        font-size: 15px;
    }

    .qm-community-topic-detail .qm-community-topic__badges {
        display: inline-flex;
        flex: 0 0 auto;
        overflow: visible;
    }

    .qm-community-topic-detail .qm-community-topic__badges > :not(.qm-level-badge):not(.qm-level-badge-sm) {
        display: none;
    }

    .qm-community-topic-detail .qm-community-topic__header-actions {
        min-width: 40px;
        gap: 3px;
    }

    .qm-community-topic-detail .qm-community-topic__status-list {
        max-width: 188px;
        gap: 3px;
        flex-wrap: nowrap;
    }

    .qm-community-topic-detail .qm-community-topic__status {
        padding-right: 6px;
        padding-left: 6px;
    }

    .qm-community-topic-detail .qm-community-topic__menu-panel {
        top: 40px;
        min-width: 142px;
    }

    .qm-topic-detail-heading {
        margin-top: 16px;
    }

    .qm-community-topic-detail .qm-topic-detail-title {
        font-size: 21px;
        line-height: 1.5;
    }

    .qm-community-topic-detail .qm-community-topic__board {
        min-height: 22px;
        margin-right: 7px;
        padding: 2px 8px 2px 5px;
        font-size: 10px;
        vertical-align: 3px;
    }

    .qm-community-topic-detail .qm-community-topic__board > span {
        width: 15px;
        height: 15px;
    }

    .qm-community-topic-detail .qm-topic-detail-subtitle {
        margin-top: 6px;
        font-size: 12px;
        line-height: 1.55;
    }

    .qm-topic-detail-tags {
        margin-top: 10px;
    }

    .qm-topic-detail-lock-notice {
        min-height: 32px;
        margin-top: 13px;
        padding: 6px 9px;
        font-size: 11px;
    }

    .qm-topic-detail-prose {
        margin-top: 18px;
        font-size: 16px;
        line-height: 1.85;
    }

    .qm-topic-detail-prose h2 {
        font-size: 20px;
    }

    .qm-topic-detail-prose h3 {
        font-size: 17px;
    }

    .qm-topic-detail-prose :is(img, video) {
        width: auto !important;
        max-width: 100% !important;
        max-height: 68vh;
        margin: 12px auto;
        border-radius: var(--qm-radius-size-2);
    }

    .qm-topic-detail-copyright {
        margin-top: 22px;
        padding: 10px 0;
        flex-direction: column;
        gap: 3px;
    }

    .qm-community-topic-detail .qm-topic-detail-footer {
        margin-top: 10px;
    }

    .qm-community-topic-detail .qm-community-topic__footer-left {
        column-gap: 16px;
    }

    .qm-topic-detail-comments-row {
        max-width: none;
    }

    .qm-topic-detail-comments__body {
        padding: 14px 12px 18px;
    }
}

html.dark body.qm-community-topic-detail-page,
body.dark.qm-community-topic-detail-page,
html.dark .qm-community-topic-detail,
body.dark .qm-community-topic-detail {
    --topic-page: #18171a;
    --topic-card: #232225;
    --topic-ink: #f1f1f0;
    --topic-muted: #aaa4ad;
    --topic-faint: #807a83;
    --topic-line: rgba(255, 255, 255, 0.09);
    background: var(--topic-page) !important;
    color: var(--topic-ink);
}

html.dark .qm-topic-detail-card,
html.dark .qm-topic-detail-comments,
html.dark .qm-topic-sidebar--vote,
body.dark .qm-topic-detail-card,
body.dark .qm-topic-detail-comments,
body.dark .qm-topic-sidebar--vote {
    background: var(--topic-card);
}

html.dark .qm-community-topic-detail .qm-community-topic__menu-panel,
body.dark .qm-community-topic-detail .qm-community-topic__menu-panel {
    border-color: var(--topic-line);
    background: var(--topic-card);
    box-shadow: var(--qm-shadow-xl);
}

html.dark .qm-community-topic-detail .qm-community-topic__menu-panel .qm-topic-action,
body.dark .qm-community-topic-detail .qm-community-topic__menu-panel .qm-topic-action {
    color: var(--qm-text-secondary);
}

html.dark .qm-community-topic-detail .qm-community-topic__menu-panel .qm-topic-action:hover,
body.dark .qm-community-topic-detail .qm-community-topic__menu-panel .qm-topic-action:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--topic-ink);
}

html.dark .qm-community-topic-detail .qm-community-topic__board,
body.dark .qm-community-topic-detail .qm-community-topic__board {
    background: var(--topic-ink);
    color: var(--topic-card) !important;
}

html.dark .qm-topic-detail-tags > span,
body.dark .qm-topic-detail-tags > span {
    background: rgba(255, 255, 255, 0.07);
}

html.dark .qm-topic-detail-lock-notice,
body.dark .qm-topic-detail-lock-notice,
html.dark .qm-community-topic-detail .qm-comments-locked-notice,
body.dark .qm-community-topic-detail .qm-comments-locked-notice {
    background: rgba(255, 207, 76, 0.13);
    color: #e9c85d;
}

html.dark .qm-topic-detail-prose,
body.dark .qm-topic-detail-prose {
    color: var(--qm-text-secondary);
}

html.dark .qm-topic-detail-copyright strong,
body.dark .qm-topic-detail-copyright strong {
    color: var(--qm-text-secondary);
}

@media (max-width: 767.98px) {
    html.dark .qm-topic-detail-mobile-toolbar,
    body.dark .qm-topic-detail-mobile-toolbar {
        background: rgba(24, 23, 26, 0.94);
    }
}

/* Community-styled comments. */
body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined {
    --qm-comment-strong: var(--topic-ink);
    --qm-comment-muted: var(--topic-muted);
    --qm-comment-card-border: var(--topic-line);
    --qm-comment-fill-bg: rgba(52, 52, 51, 0.045);
    width: 100%;
    color: var(--topic-ink);
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comments-header {
    min-height: 24px;
    margin: 0 0 14px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-direction: row !important;
    gap: 0 !important;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comments-title {
    width: auto;
    min-height: 24px;
    align-items: center;
    gap: 6px !important;
    color: var(--topic-ink) !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.3;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comments-title > i {
    display: none !important;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comments-count {
    color: var(--topic-muted) !important;
    font-size: 11px;
    font-weight: 400;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-form.qm-comment-form-top {
    margin: 0 0 14px;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-editor-shell {
    display: grid;
    padding: 0;
    align-items: start;
    gap: 12px;
    grid-template-columns: 48px minmax(0, 1fr);
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-editor-side {
    display: flex;
    width: 48px;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    gap: 6px;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-editor-avatar,
body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-editor-avatar img {
    width: 44px !important;
    height: 44px !important;
    border-radius: var(--qm-radius-circle) !important;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-editor-name {
    max-width: 48px;
    overflow: hidden;
    color: var(--topic-muted);
    font-size: 11px;
    line-height: 1.3;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-editor-main {
    width: 100%;
    min-width: 0;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-input-wrapper {
    overflow: visible;
    border: 0 !important;
    border-radius: var(--qm-radius-size-1) !important;
    background: var(--qm-comment-fill-bg) !important;
    box-shadow: none !important;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-input-wrapper:focus-within {
    background: rgba(52, 52, 51, 0.055) !important;
    box-shadow: 0 0 0 2px rgba(174, 129, 239, 0.22) !important;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-field-float textarea {
    min-height: 104px;
    padding: 12px 12px 8px;
    border: 0 !important;
    border-radius: var(--qm-radius-size-1) !important;
    background: transparent !important;
    color: var(--topic-ink) !important;
    font-size: 14px;
    line-height: 1.65;
    box-shadow: none !important;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-field-float textarea::placeholder {
    color: var(--topic-muted);
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-input-wrapper > .qm-comment-toolbar {
    min-height: 42px;
    margin: 0;
    padding: 0 8px 8px;
    gap: 6px;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-input-wrapper > .qm-comment-toolbar :is(.qm-comment-toolbar-left, .qm-comment-toolbar-right) {
    gap: 2px;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-input-wrapper > .qm-comment-toolbar :is(.qm-comment-inline-action, .qm-comment-tool-btn) {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: var(--qm-radius-circle) !important;
    background: transparent !important;
    color: var(--topic-muted) !important;
    box-shadow: none !important;
}

/* 工具栏按钮在模板里是「图标 + 文字」，但这套设计在移动端是圆形图标钮：
   文字标签塞进 34px 圆里会外溢、和隔壁按钮叠在一起（实测每个标签溢出 3~17px）。
   工具钮都自带图标，按设计只留图标即可 —— 按钮上都有 aria-label，不影响无障碍阅读。 */
body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-input-wrapper > .qm-comment-toolbar :is(.qm-comment-inline-action, .qm-comment-tool-btn):not(.qm-comment-send-btn) > span {
    display: none;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-input-wrapper > .qm-comment-toolbar :is(.qm-comment-inline-action, .qm-comment-tool-btn):hover {
    background: rgba(52, 52, 51, 0.07) !important;
    color: var(--topic-ink) !important;
}

/* 「提交评论」只有文字、没有图标，压成 34px 圆会变成一个空圆 —— 让它按文字自适应，
   保留药丸形状，和左边的圆钮属同一套。 */
body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-input-wrapper > .qm-comment-toolbar .qm-comment-send-btn.qm-comment-send-btn-text {
    width: auto !important;
    min-width: 0 !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 16px !important;
    border: 0 !important;
    border-radius: var(--qm-radius-pill) !important;
    background: var(--topic-lime) !important;
    color: var(--qm-color-text) !important;
    box-shadow: none !important;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-input-wrapper > .qm-comment-toolbar .qm-comment-send-btn.qm-comment-send-btn-text:hover {
    background: #bfea3d !important;
    color: var(--qm-color-text) !important;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-input-wrapper > .qm-comment-toolbar .qm-comment-char-count {
    margin-right: 4px;
    color: var(--topic-faint);
    font-size: 10px;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comments-toolbar {
    min-height: 34px;
    margin: 16px 0 8px;
    padding: 0;
    align-items: center;
    gap: 8px;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comments-sort {
    display: inline-flex;
    min-height: 32px;
    padding: 2px;
    align-items: center;
    gap: 2px;
    border-radius: var(--qm-radius-size-1);
    background: rgba(52, 52, 51, 0.05);
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined :is(.qm-comment-sort-btn, .qm-comment-filter-btn) {
    min-height: 28px;
    padding: 4px 9px;
    border: 0 !important;
    border-radius: var(--qm-radius-size-1) !important;
    background: transparent !important;
    color: var(--topic-muted) !important;
    font-size: 11px;
    font-weight: 600;
    box-shadow: none !important;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined :is(.qm-comment-sort-btn.active, .qm-comment-filter-btn.active) {
    background: var(--topic-ink) !important;
    color: var(--topic-card) !important;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comments-empty {
    min-height: 134px;
    padding: 26px 10px;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--topic-muted) !important;
    box-shadow: none !important;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comments-empty i {
    color: var(--topic-faint);
    font-size: 28px;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comments-empty p {
    margin: 10px 0 0;
    color: var(--topic-muted);
    font-size: 12px;
    line-height: 1.6;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comments-list-wrapper {
    margin-top: 4px;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .comment-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .comment-list > .qm-comment-item {
    margin: 0 !important;
    padding: 16px 0 !important;
    border-top: 1px solid var(--topic-line) !important;
    border-bottom: 0 !important;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-body {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-avatar,
body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-avatar img {
    width: 40px !important;
    height: 40px !important;
    border-radius: var(--qm-radius-circle) !important;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-header {
    margin-bottom: 7px;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined :is(.qm-comment-author-name, .qm-comment-author-name a) {
    color: var(--topic-ink) !important;
    font-size: 14px;
    font-weight: 700;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-text {
    color: var(--qm-color-text);
    font-size: 14px;
    line-height: 1.75;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-actions {
    margin-top: 10px;
    gap: 12px;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-date,
body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined :is(.qm-comment-like-btn, .qm-comment-reply-btn, .qm-qa-accept-btn, .qm-comment-report-btn, .qm-comment-block-btn, .qm-comment-delete-btn) {
    color: var(--topic-muted) !important;
    font-size: 11px;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .comment-list .children {
    margin: 8px 0 0 18px;
    padding: 0 0 0 12px;
    border-left: 2px solid var(--topic-line);
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .comment-list .children > .qm-comment-item {
    margin: 0 !important;
    padding: 12px 0 0 !important;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .comment-list .children > .qm-comment-item:first-child {
    padding-top: 0 !important;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined :is(li.depth-2, li.depth-3, li.depth-4, li.depth-5) > .qm-comment-body {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 8px;
}

body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined :is(li.depth-2, li.depth-3, li.depth-4, li.depth-5) .qm-comment-avatar,
body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined :is(li.depth-2, li.depth-3, li.depth-4, li.depth-5) .qm-comment-avatar img {
    width: 30px !important;
    height: 30px !important;
}

@media (max-width: 767.98px) {
    body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-editor-shell {
        gap: 10px;
        grid-template-columns: minmax(0, 1fr);
    }

    body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-editor-side {
        width: 100%;
        height: 40px;
        justify-content: flex-start;
        flex-direction: row;
        gap: 9px;
    }

    body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-editor-avatar,
    body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-editor-avatar img {
        width: 40px !important;
        height: 40px !important;
    }

    body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-editor-name {
        max-width: 180px;
        color: var(--topic-ink);
        font-size: 13px;
        font-weight: 600;
        text-align: left;
    }

    body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-field-float textarea {
        min-height: 92px;
        font-size: 14px;
    }
}

html.dark body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined,
body.dark.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined {
    --qm-comment-fill-bg: rgba(255, 255, 255, 0.055);
}

html.dark body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-input-wrapper,
body.dark.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-input-wrapper {
    background: var(--qm-comment-fill-bg) !important;
}

html.dark body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-input-wrapper:focus-within,
body.dark.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.07) !important;
}

html.dark body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined :is(.qm-comments-title, .qm-comment-field-float textarea, .qm-comment-author-name, .qm-comment-author-name a),
body.dark.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined :is(.qm-comments-title, .qm-comment-field-float textarea, .qm-comment-author-name, .qm-comment-author-name a) {
    color: var(--topic-ink) !important;
}

html.dark body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-text,
body.dark.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comment-text {
    color: var(--qm-text-secondary);
}

html.dark body.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comments-sort,
body.dark.qm-community-topic-detail-page .qm-topic-detail-comments #comments.qm-comments-refined .qm-comments-sort {
    background: rgba(255, 255, 255, 0.06);
}
