body.qm-community-modal-open,
body.qm-community-share-open {
    overflow: hidden;
}

.qm-community-share-sheet,
.qm-community-report-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--qm-transition-fast, var(--qm-duration-fast) ease), visibility var(--qm-transition-fast, var(--qm-duration-fast) ease);
}

.qm-community-share-sheet.is-open,
.qm-community-report-modal.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.qm-community-share-sheet__backdrop,
.qm-community-report-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.48);
    backdrop-filter: none;
}

.qm-community-share-sheet__dialog,
.qm-community-report-modal__dialog {
    position: relative;
    width: min(100%, 480px);
    max-height: min(760px, calc(100vh - 40px));
    overflow-y: auto;
    padding: 0;
    border: 1px solid rgba(29, 41, 57, 0.1);
    border-radius: var(--qm-radius-modal, 14px);
    background: var(--qm-color-surface, #fff);
    color: var(--qm-color-text, #1a1a1a);
    box-shadow: var(--qm-shadow-2xl, 0 24px 56px rgba(29, 41, 57, 0.16));
    transform: translateY(12px) scale(0.985);
    transition: transform var(--qm-transition-fast, var(--qm-duration-fast) ease);
}

.qm-community-report-modal__dialog {
    width: min(100%, 540px);
}

.is-open > .qm-community-share-sheet__dialog,
.is-open > .qm-community-report-modal__dialog {
    transform: translateY(0) scale(1);
}

.qm-community-share-sheet__dialog:focus,
.qm-community-report-modal__dialog:focus {
    outline: none;
}

.qm-community-share-sheet__header,
.qm-community-report-modal__header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 20px 20px 16px;
}

.qm-community-share-sheet__heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.qm-community-share-sheet__heading-icon,
.qm-community-report-modal__header-icon {
    display: inline-flex;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--qm-radius-icon, 6px);
    background: var(--qm-primary-rgba-10, rgba(217, 38, 29, 0.1));
    color: var(--qm-primary, #d9261d);
    font-size: 16px;
}

.qm-community-share-sheet__title,
.qm-community-report-modal__heading h2 {
    margin: 0;
    color: inherit;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.35;
}

.qm-community-share-sheet__desc,
.qm-community-report-modal__heading p {
    margin: 3px 0 0;
    color: var(--qm-color-text-secondary, #666666);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
}

.qm-community-share-sheet__close,
.qm-community-report-modal__close {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    border: 0;
    border-radius: var(--qm-radius-icon, 6px);
    background: var(--qm-color-surface-muted, #f5f5f5);
    color: var(--qm-color-text-secondary, #666666);
    cursor: pointer;
    transition: background-color var(--qm-transition-fast, var(--qm-duration-fast) ease), color var(--qm-transition-fast, var(--qm-duration-fast) ease);
}

.qm-community-share-sheet__close:hover,
.qm-community-report-modal__close:hover {
    background: var(--qm-primary-rgba-10, rgba(217, 38, 29, 0.1));
    color: var(--qm-primary, #d9261d);
}

.qm-community-share-sheet__preview {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    margin: 0 20px;
    padding: 12px;
    border: 1px solid var(--qm-color-border, #e6e6e6);
    border-radius: var(--qm-radius-card, 10px);
    background: var(--qm-color-surface-muted, #f5f5f5);
}

.qm-community-share-sheet__preview-icon {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    border-radius: var(--qm-radius-icon, 6px);
    background: var(--qm-color-surface, #fff);
    color: var(--qm-primary, #d9261d);
}

.qm-community-share-sheet__preview-content {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
}

.qm-community-share-sheet__preview-title,
.qm-community-share-sheet__preview-url {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qm-community-share-sheet__preview-title {
    color: var(--qm-color-text, #1a1a1a);
    font-size: 13px;
    font-weight: 700;
}

.qm-community-share-sheet__preview-url {
    color: var(--qm-color-text-secondary, #666666);
    font-size: 12px;
}

.qm-community-share-sheet__section-label {
    margin: 17px 20px 10px;
    color: var(--qm-color-text-secondary, #666666);
    font-size: 12px;
    font-weight: 600;
}

.qm-community-share-sheet__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0 20px;
}

.qm-community-share-sheet__action {
    display: flex;
    min-width: 0;
    min-height: 84px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--qm-color-border, #e6e6e6);
    border-radius: var(--qm-radius-card, 10px);
    background: var(--qm-color-surface, #fff);
    color: var(--qm-color-text, #1a1a1a);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--qm-transition-fast, var(--qm-duration-fast) ease), border-color var(--qm-transition-fast, var(--qm-duration-fast) ease), background-color var(--qm-transition-fast, var(--qm-duration-fast) ease);
}

.qm-community-share-sheet__action[data-channel] {
    color: var(--qm-color-text, #1a1a1a);
}

.qm-community-share-sheet__action:hover {
    border-color: var(--qm-primary-rgba-30, rgba(217, 38, 29, 0.3));
    background: var(--qm-primary-rgba-04, rgba(217, 38, 29, 0.04));
    transform: translateY(-2px);
}

.qm-community-share-sheet__action-icon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: var(--qm-radius-icon, 6px);
    background: var(--qm-color-surface-muted, #f5f5f5);
    font-size: 19px;
}

.qm-community-share-sheet__action-icon i {
    font-size: 19px;
}

.qm-community-share-sheet__action[data-channel="qq"] .qm-community-share-sheet__action-icon {
    background: rgba(22, 119, 255, 0.1);
    color: #1677ff;
}

.qm-community-share-sheet__action[data-channel="wechat"] .qm-community-share-sheet__action-icon {
    background: rgba(7, 193, 96, 0.1);
    color: #079f52;
}

.qm-community-share-sheet__action[data-channel="copy"] .qm-community-share-sheet__action-icon {
    background: var(--qm-primary-rgba-10, rgba(217, 38, 29, 0.1));
    color: var(--qm-primary, #d9261d);
}

.qm-community-share-sheet__action.loading,
.qm-community-share-sheet__link-copy.loading {
    opacity: 0.58;
    pointer-events: none;
    transform: none;
}

.qm-community-share-sheet__link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    gap: 8px;
    margin: 16px 20px 0;
}

.qm-community-share-sheet__link-input {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 11px;
    overflow: hidden;
    border: 1px solid var(--qm-color-border, #e6e6e6);
    border-radius: var(--qm-radius-field, 10px);
    outline: 0;
    background: var(--qm-color-surface-muted, #f5f5f5);
    color: var(--qm-color-text-secondary, #666666);
    font-size: 12px;
    text-overflow: ellipsis;
}

.qm-community-share-sheet__link-copy {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--qm-radius-icon, 6px);
    background: var(--qm-primary, #d9261d);
    color: #fff;
    cursor: pointer;
}

.qm-community-share-sheet__hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 12px 20px 18px;
    color: var(--qm-color-text-secondary, #666666);
    font-size: 12px;
    line-height: 1.5;
}

.qm-community-share-sheet__hint i {
    color: #079f52;
}

.qm-community-report-modal__heading {
    min-width: 0;
    flex: 1 1 auto;
}

.qm-community-report-modal__target {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    margin: 0 20px 17px;
    padding: 10px 12px;
    border: 1px solid var(--qm-color-border, #e6e6e6);
    border-radius: var(--qm-radius-card, 10px);
    background: var(--qm-color-surface-muted, #f5f5f5);
}

.qm-community-report-modal__target > span {
    display: inline-flex;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    border-radius: var(--qm-radius-icon, 6px);
    background: var(--qm-color-surface, #fff);
    color: var(--qm-primary, #d9261d);
}

.qm-community-report-modal__target div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.qm-community-report-modal__target small {
    color: var(--qm-color-text-secondary, #666666);
    font-size: 11px;
}

.qm-community-report-modal__target strong {
    overflow: hidden;
    color: var(--qm-color-text, #1a1a1a);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qm-community-report-modal__form {
    padding: 0 20px;
}

.qm-community-report-modal__fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.qm-community-report-modal__fieldset legend,
.qm-community-report-modal__details-label {
    display: block;
    margin: 0 0 9px;
    color: var(--qm-color-text, #1a1a1a);
    font-size: 13px;
    font-weight: 700;
}

.qm-community-report-modal__details-label {
    margin-top: 16px;
}

.qm-community-report-modal__details-label span {
    color: var(--qm-color-text-secondary, #666666);
    font-size: 11px;
    font-weight: 500;
}

.qm-community-report-modal__reasons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.qm-community-report-modal__reasons label {
    min-width: 0;
    margin: 0;
    cursor: pointer;
}

.qm-community-report-modal__reasons input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.qm-community-report-modal__reasons span {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--qm-color-border, #e6e6e6);
    border-radius: var(--qm-radius-control, 6px);
    background: var(--qm-color-surface, #fff);
    color: var(--qm-color-text-secondary, #666666);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    transition: border-color var(--qm-transition-fast, var(--qm-duration-fast) ease), background-color var(--qm-transition-fast, var(--qm-duration-fast) ease), color var(--qm-transition-fast, var(--qm-duration-fast) ease);
}

.qm-community-report-modal__reasons input:checked + span {
    border-color: var(--qm-primary, #d9261d);
    background: var(--qm-primary-rgba-08, rgba(217, 38, 29, 0.08));
    color: var(--qm-primary, #d9261d);
}

.qm-community-report-modal__reasons input:focus-visible + span,
.qm-community-share-sheet button:focus-visible,
.qm-community-report-modal button:focus-visible,
.qm-community-share-sheet input:focus-visible,
.qm-community-report-modal textarea:focus-visible {
    outline: 2px solid var(--qm-primary-rgba-35, rgba(217, 38, 29, 0.35));
    outline-offset: 2px;
}

.qm-community-report-modal__details {
    display: block;
    width: 100%;
    min-height: 82px;
    resize: vertical;
    padding: 10px 12px;
    border: 1px solid var(--qm-color-border, #e6e6e6);
    border-radius: var(--qm-radius-field, 10px);
    outline: 0;
    background: var(--qm-color-surface, #fff);
    color: var(--qm-color-text, #1a1a1a);
    font: inherit;
    font-size: 13px;
    line-height: 1.55;
}

.qm-community-report-modal__details:focus {
    border-color: var(--qm-primary-rgba-50, rgba(217, 38, 29, 0.5));
}

.qm-community-report-modal__details::placeholder {
    color: var(--qm-color-text-secondary, #666666);
}

.qm-community-report-modal__meta {
    display: flex;
    min-height: 25px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-top: 5px;
    color: var(--qm-color-text-secondary, #666666);
    font-size: 11px;
}

.qm-community-report-modal__status.is-error {
    color: var(--qm-primary, #d9261d);
}

.qm-community-report-modal__counter {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.qm-community-report-modal__actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 10px;
}

.qm-community-report-modal__cancel,
.qm-community-report-modal__submit {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--qm-radius-control, 6px);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.qm-community-report-modal__cancel {
    border: 1px solid var(--qm-color-border, #e6e6e6);
    background: var(--qm-color-surface, #fff);
    color: var(--qm-color-text, #1a1a1a);
}

.qm-community-report-modal__submit {
    border: 1px solid var(--qm-primary, #d9261d);
    background: var(--qm-primary, #d9261d);
    color: #fff;
}

.qm-community-report-modal__submit:disabled,
.qm-community-report-modal__submit.loading {
    opacity: 0.5;
    cursor: not-allowed;
}

.qm-community-report-modal__notice {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 12px 20px 16px;
    border-top: 1px solid rgba(29, 41, 57, 0.08);
    color: var(--qm-color-text-secondary, #666666);
    font-size: 11px;
    line-height: 1.5;
}

.qm-community-topic__menu-panel .qm-topic-action--report.is-reported {
    color: var(--qm-color-text-secondary, #666666);
    pointer-events: none;
}

html.dark .qm-community-share-sheet__dialog,
html.dark .qm-community-report-modal__dialog {
    border-color: rgba(255, 255, 255, 0.1);
    background: var(--qm-color-surface, var(--qm-bg-dark));
    color: var(--qm-color-text, #fff);
    box-shadow: var(--qm-shadow-2xl);
}

html.dark .qm-community-share-sheet__preview,
html.dark .qm-community-report-modal__target,
html.dark .qm-community-share-sheet__link-input {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

html.dark .qm-community-share-sheet__preview-icon,
html.dark .qm-community-report-modal__target > span,
html.dark .qm-community-share-sheet__action,
html.dark .qm-community-report-modal__reasons span,
html.dark .qm-community-report-modal__details,
html.dark .qm-community-report-modal__cancel {
    border-color: rgba(255, 255, 255, 0.12);
    background-color: rgba(255, 255, 255, 0.04);
}

html.dark .qm-community-share-sheet__action[data-channel] {
    color: var(--qm-color-text, #fff);
}

html.dark .qm-community-report-modal__reasons input:checked + span {
    border-color: var(--qm-primary-light, #e46d66);
    background: var(--qm-primary-rgba-16, rgba(217, 38, 29, 0.16));
    color: #fff;
}

html.dark .qm-community-report-modal__notice {
    border-top-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 576px) {
    .qm-community-share-sheet,
    .qm-community-report-modal {
        align-items: flex-end;
        padding: 0;
    }

    .qm-community-share-sheet__dialog,
    .qm-community-report-modal__dialog {
        width: 100%;
        max-height: min(88vh, 760px);
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: var(--qm-radius-modal, 14px) var(--qm-radius-modal, 14px) 0 0;
        transform: translateY(24px);
    }

    .qm-community-share-sheet__header,
    .qm-community-report-modal__header {
        padding: 16px 16px 14px;
    }

    .qm-community-share-sheet__preview,
    .qm-community-report-modal__target {
        margin-right: 16px;
        margin-left: 16px;
    }

    .qm-community-share-sheet__section-label {
        margin-right: 16px;
        margin-left: 16px;
    }

    .qm-community-share-sheet__actions,
    .qm-community-report-modal__form {
        padding-right: 16px;
        padding-left: 16px;
    }

    .qm-community-share-sheet__link-row {
        margin-right: 16px;
        margin-left: 16px;
    }

    .qm-community-share-sheet__hint,
    .qm-community-report-modal__notice {
        padding-right: 16px;
        padding-left: 16px;
    }

    .qm-community-report-modal__reasons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .qm-community-share-sheet,
    .qm-community-report-modal,
    .qm-community-share-sheet__dialog,
    .qm-community-report-modal__dialog,
    .qm-community-share-sheet__action {
        transition: none;
    }
}
