.resource-community {
    --community-blue: #206bc4;
    --community-soft: #eef5ff;
    --community-line: var(--color-line, #dce4ef);
    --community-ink: var(--color-ink, #182433);
    --community-surface: var(--color-surface, #fff);
    text-align: left;
    grid-column: 1 / -1;
}
[data-theme="dark"] .resource-community {
    --community-blue: #8bb9ff;
    --community-soft: #1d304c;
}
.community-summary {
    display: grid;
    grid-template-columns: 140px minmax(170px, 280px) minmax(160px, 1fr);
    gap: 2rem;
    align-items: center;
    margin: 1.25rem 0;
    padding: 1.4rem;
    border: 1px solid var(--community-line);
    border-radius: 8px;
    background: linear-gradient(110deg, var(--community-soft), var(--community-surface));
}
.community-score { display: grid; gap: .25rem; text-align: center; }
.community-score strong { font-size: 2.8rem; line-height: 1.1; color: var(--community-ink); }
.community-stars { color: var(--community-blue); font-size: 1.2rem; letter-spacing: .08em; }
.community-score small, .community-summary-note, .community-hint { color: var(--color-muted, #61708c); }
.community-distribution { display: grid; gap: .4rem; }
.community-distribution-row { display: grid; grid-template-columns: 35px 1fr 30px; gap: .5rem; align-items: center; font-size: .82rem; }
.community-distribution progress { width: 100%; height: 8px; border: 0; border-radius: 4px; overflow: hidden; accent-color: var(--community-blue); }
.community-distribution progress::-webkit-progress-bar { background: var(--community-line); }
.community-distribution progress::-webkit-progress-value { background: var(--community-blue); border-radius: 4px; }
.community-summary-note { margin: 0; line-height: 1.6; font-size: .9rem; }
.community-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: .4rem;
    min-height: 34px;
    padding: .4rem .75rem;
    border: 1px solid var(--community-line, var(--color-line));
    border-radius: 5px;
    background: var(--community-surface, var(--color-surface));
    color: var(--community-ink, var(--color-ink));
    font: inherit;
    font-size: .82rem;
    text-decoration: none;
    cursor: pointer;
}
.community-button--primary { color: #fff; background: #206bc4; border-color: #206bc4; }
.community-button--danger { color: #fff; background: #bc3543; border-color: #bc3543; }
.community-like { color: var(--community-blue); border-color: transparent; background: var(--community-soft); }
.community-like.is-selected { border-color: var(--community-blue); }
.community-like i { font-size: 1rem; }
.resource-detail-card__top:has(.community-resource-actions) { row-gap:1rem; }
.community-resource-actions { grid-column:1 / -1; display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:.6rem; padding-top:.85rem; border-top:1px solid var(--color-line); }
.community-resource-like, .community-comment-link { display:inline-flex; align-items:center; justify-content:center; gap:.5rem; box-sizing:border-box; min-height:38px; padding:.45rem .8rem; border:1px solid color-mix(in srgb,#206bc4 25%,var(--color-line)); border-radius:6px; font:inherit; font-size:.82rem; font-weight:600; text-decoration:none; cursor:pointer; }
.community-resource-like { color:var(--color-primary-dark,#206bc4); background:var(--color-surface-soft); }
.community-resource-like i { font-size:1.15rem; }
.community-resource-like-count { display:grid; place-items:center; min-width:1.4rem; height:1.4rem; padding:0 .25rem; box-sizing:border-box; border-radius:4px; background:var(--color-surface); font-size:.74rem; }
.community-resource-like.is-selected { color:#fff; background:#206bc4; border-color:#206bc4; }
.community-resource-like.is-selected .community-resource-like-count { color:#fff; background:rgba(255,255,255,.18); }
.community-comment-link { color:var(--color-ink); background:var(--color-surface); }
.community-comment-link:hover, .community-resource-like:hover { border-color:#4299e1; box-shadow:0 2px 8px rgb(32 107 196 / .12); text-decoration:none; }
.community-comment-link:focus-visible { outline:2px solid #4299e1; outline-offset:3px; }
.community-compose, .community-inline-reply { scroll-margin-top:var(--resource-scroll-offset,220px); }
.community-button--text { color: var(--color-muted); border: 0; padding-left: 0; background: transparent; }
.community-button:disabled { opacity: .5; cursor: default; }
.community-button:focus-visible, .community-star:focus-visible, .community-compose summary:focus-visible { outline: 2px solid #4299e1; outline-offset: 3px; }
.community-compose { margin: 1rem 0; border: 1px solid var(--community-line); border-radius: 6px; }
.community-compose summary { padding: .7rem .9rem; cursor: pointer; color: var(--community-blue); font-weight: 650; }
.community-editor { display: grid; gap: .7rem; padding: 0 .9rem .9rem; }
.community-editor label { display: grid; gap: .4rem; font-size: .9rem; font-weight: 600; }
.community-editor textarea, .community-tools select {
    box-sizing: border-box;
    width: 100%;
    padding: .6rem .7rem;
    border: 1px solid var(--community-line);
    border-radius: 5px;
    background: var(--community-surface);
    color: var(--community-ink);
    font: inherit;
    font-size: .87rem;
}
.community-editor textarea { resize: vertical; min-height: 90px; }
.community-editor textarea:focus, .community-tools select:focus { outline: 2px solid color-mix(in srgb, var(--community-blue) 30%, transparent); border-color: var(--community-blue); }
.community-editor > .community-button { justify-self: start; }
.community-rating { display: flex; gap: .25rem; }
.community-star { border: 0; background: transparent; color: var(--color-muted); padding: .15rem .25rem; font-size: 2rem; cursor: pointer; opacity: .5; }
.community-star.is-selected { color: var(--community-blue); opacity: 1; }
.community-tools { display: flex; flex-wrap: wrap; gap: .65rem; margin: 1.1rem 0; }
.community-tools select { width: auto; max-width: 100%; min-height: 36px; }
.community-message { padding: 1.15rem 0; border-top: 1px solid var(--community-line); }
.community-bubble, .community-thread-bubble {
    box-sizing: border-box;
    max-width: 86%;
    padding: 1rem 1.15rem;
    border: 1px solid var(--community-line);
    border-radius: 3px 12px 12px 12px;
    background: var(--community-surface);
}
.community-thread-bubble { margin-top: .8rem; background: var(--color-surface-soft); }
.community-thread-bubble--creator, .community-message>.community-reply {
    margin: .8rem 0 0 auto;
    max-width: 86%;
    padding: 1rem 1.15rem;
    border: 1px solid color-mix(in srgb, var(--community-blue) 35%, var(--community-line));
    border-radius: 12px 3px 12px 12px;
    background: var(--community-soft);
}
.community-inline-reply { margin-top: .6rem; }
.community-reply-link {
    padding: .2rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--community-blue);
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
}
.community-reply-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.community-reply-link:focus-visible { outline: 2px solid var(--community-blue); outline-offset: 3px; }
.community-editor--reply { margin: .65rem 0 0 auto; max-width: 86%; padding: .9rem; border: 1px solid var(--community-line); border-radius: 8px; background: var(--community-surface); }
.community-editor[hidden] { display: none; }
.community-editor--reply>div:first-child { font-size: .82rem; font-weight: 600; }
.community-editor-toolbar { display: flex; gap: .3rem; margin-top: .5rem; padding: .35rem; background: var(--community-soft); border: 1px solid var(--community-line); border-bottom: 0; border-radius: 5px 5px 0 0; }
.community-format { display: grid; place-items: center; width: 32px; height: 30px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--community-ink); cursor: pointer; font-size: 1rem; }
.community-format:hover, .community-format:focus-visible { background: var(--community-surface); outline: 1px solid var(--community-blue); }
.community-rich-input { min-height: 96px; max-height: 260px; overflow-y: auto; overflow-wrap: anywhere; padding: .75rem; border: 1px solid var(--community-line); border-radius: 0 0 5px 5px; color: var(--community-ink); background: var(--community-surface); font-size: .9rem; font-weight: 400; line-height: 1.65; }
.community-rich-input:focus { outline: 2px solid color-mix(in srgb, var(--community-blue) 25%, transparent); border-color: var(--community-blue); }
.community-rich-input:empty::before { content: attr(data-placeholder); color: var(--color-muted); pointer-events: none; }
.community-rich-text { overflow-wrap: anywhere; line-height: 1.7; margin-top: .55rem; font-size: .92rem; }
.community-rich-text p, .community-rich-text div { margin: .3rem 0; }
.community-rich-text ul, .community-rich-text ol, .community-rich-input ul { padding-left: 1.4rem; }
.community-editor--reply>.community-button { justify-self: end; }
.community-visibility { display:grid; gap:.4rem; font-size:.82rem; }
.community-visibility select { box-sizing:border-box; width:100%; min-height:38px; border:1px solid var(--community-line); border-radius:5px; padding:.5rem; background:var(--community-surface); color:var(--community-ink); font:inherit; }
.community-visibility select:focus-visible { outline:2px solid var(--community-blue); outline-offset:2px; }
.community-privacy-badge { display:inline-flex; align-items:center; gap:.3rem; margin-top:.45rem; padding:.15rem .45rem; border-radius:4px; color:var(--color-muted); background:var(--community-surface); font-size:.7rem; font-weight:600; }
.community-privacy-badge.is-private { color:var(--community-blue); border:1px solid var(--community-line); }
@media(max-width:620px) {
    .community-bubble, .community-thread-bubble, .community-message>.community-reply, .community-editor--reply { max-width: 96%; padding: .8rem; }
    .community-message-heading { flex-wrap: wrap; }
    .community-editor--reply { box-sizing: border-box; }
}
.community-message-heading, .community-identity { display: flex; align-items: center; gap: .65rem; }
.community-message-heading { justify-content: space-between; margin-bottom: .4rem; }
.community-message-heading time { color: var(--color-muted); font-size: .78rem; }
.community-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--community-soft); color: var(--community-blue); font-weight: 700; }
.community-message-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; margin: .6rem 0; font-size: .92rem; }
.community-reply { margin: .8rem 0 0 2.7rem; padding: 1rem; border-left: 3px solid var(--community-blue); border-radius: 0 6px 6px 0; background: var(--community-soft); font-size: .86rem; }
.community-empty { padding: 1rem; background: var(--color-surface-soft); border-radius: 6px; color: var(--color-muted); }
.community-feedback { color: var(--color-ink); font-size: .86rem; margin: 0; }
.community-pagination { display: flex; justify-content: flex-end; align-items: center; gap: .75rem; padding-top: 1rem; }
.community-dialog { width: min(420px, calc(100% - 2rem)); box-sizing: border-box; padding: 1.4rem; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface); color: var(--color-ink); }
.community-dialog::backdrop { background: rgb(10 23 40 / .55); }
.community-dialog .community-button { margin-right: .4rem; }
.resources-page .marketplace-resource-card { border-radius: 8px; border-color: var(--color-line); box-shadow: 0 3px 14px rgb(24 45 78 / .05); }
.resources-page .marketplace-resource-card__image-link { overflow: hidden; background: var(--color-surface-soft); }
.resources-page .marketplace-resource-card__content { padding: 1rem; }
.resources-page .marketplace-resource-card__title { line-height: 1.45; }
@media (max-width: 760px) {
    .community-summary { grid-template-columns: 100px minmax(0, 1fr); gap: 1rem; padding: 1rem; }
    .community-summary-note { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
    .community-message-heading { align-items: flex-start; gap: .3rem; }
    .community-message-heading time { font-size: .7rem; }
    .community-reply { margin-left: .6rem; }
    .community-tools select { width: 100%; }
    .community-score strong { font-size: 2.1rem; }
}
