/**
 * ============================================================
 * CtrlEat Official Shopping Website
 * ============================================================
 * CtrlEat 正式版购物网站
 * 版权归天河星雨工作室[thxymc Studio] thxymc.com所有
 * Copyright © 2026 thxymc.com. All rights reserved.
 * 网页由天河星雨工作室制作 thxymc.com
 * ！！未经允许禁止公开源码！！
 * ============================================================
 */

.community-topbar {
    min-height: 68px;
    padding: 0 6vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 20;
}

.community-topbar .brand {
    color: #16a34a;
    font-size: 1.35rem;
    font-weight: 900;
    text-decoration: none;
}

.community-topbar nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.community-topbar nav a,
.community-hero > a,
.community-primary-link,
.community-mini-link {
    color: #334155;
    font-weight: 800;
    text-decoration: none;
}

.community-topbar nav a.active {
    color: #16a34a;
}

.community-page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 26px 0 60px;
}

.community-hero,
.community-panel,
.community-alert {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
}

.community-hero {
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.community-hero span,
.community-hero p,
.community-panel .panel-head p,
.community-post-card span,
.community-comment span,
.community-rule-list span {
    color: #64748b;
    font-weight: 700;
}

.community-hero h1,
.community-panel h2 {
    margin: 4px 0 8px;
    color: #0f172a;
}

.community-primary-link,
.community-mini-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    white-space: nowrap;
}

.community-mini-link {
    min-height: 36px;
    padding: 0 13px;
    background: #dcfce7;
    color: #166534;
}

.community-layout,
.community-detail-grid,
.community-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr);
    gap: 18px;
    align-items: start;
}

.community-list-layout,
.community-create-layout {
    display: block;
}

.community-panel {
    padding: 18px;
}

.community-alert {
    padding: 12px 14px;
    margin-bottom: 14px;
    font-weight: 800;
}

.community-alert.success {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.community-alert.error {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.community-empty {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: #64748b;
    font-weight: 800;
    text-align: center;
}

.community-post-list,
.community-comment-list,
.community-admin-comments,
.community-rule-list {
    display: grid;
    gap: 12px;
}

.community-post-card {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    color: #0f172a;
    text-decoration: none;
    background: #f8fafc;
}

.community-post-card.no-image {
    grid-template-columns: 1fr;
}

.community-post-card > img,
.community-post-detail > img,
.community-admin-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

.community-post-card > img {
    aspect-ratio: 1;
}

.community-post-card strong,
.community-comment strong,
.community-rule-list strong {
    display: block;
    margin-bottom: 4px;
}

.community-post-badges,
.community-tag-filter,
.community-active-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
}

.community-active-filter {
    margin-top: 12px;
}

.community-active-filter span,
.community-active-filter a,
.community-tag-filter a,
.community-tag-badge,
.community-pin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: .82rem;
    font-weight: 900;
    text-decoration: none;
}

.community-active-filter span,
.community-tag-filter a,
.community-tag-badge {
    color: var(--tag-color, #166534);
    background: color-mix(in srgb, var(--tag-color, #16a34a) 12%, #fff);
    border: 1px solid color-mix(in srgb, var(--tag-color, #16a34a) 28%, #fff);
}

.community-active-filter a,
.community-tag-filter a.active,
.community-pin-badge {
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
}

.community-tag-badge img,
.community-tag-filter img,
.community-tag-select img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    border-radius: 4px;
}

.community-tag-badge[role="link"] {
    cursor: pointer;
}

.community-tag-select {
    border: 1px solid #dbeafe;
    border-radius: 14px;
    padding: 14px;
    background: #f8fafc;
}

.community-tag-select legend {
    padding: 0 8px;
    color: #334155;
    font-weight: 900;
}

.community-tag-select > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.community-tag-select label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tag-color, #16a34a) 10%, #fff);
    border: 1px solid color-mix(in srgb, var(--tag-color, #16a34a) 28%, #fff);
    color: var(--tag-color, #166534);
    font-weight: 900;
}

.community-post-card p,
.community-post-detail p,
.community-comment p,
.community-admin-content {
    margin: 0;
    color: #334155;
    line-height: 1.75;
}

.community-post-card em,
.community-admin-table em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-style: normal;
    font-weight: 900;
    font-size: .82rem;
    white-space: nowrap;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-approved {
    background: #dcfce7;
    color: #166534;
}

.status-hidden {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-deleted {
    background: #fee2e2;
    color: #991b1b;
}

.community-form,
.community-admin-settings,
.community-admin-status-form,
.community-ban-form,
.community-reward-form,
.community-tag-admin-form {
    display: grid;
    gap: 14px;
}

.community-form label,
.community-admin-filter label,
.community-admin-status-form label,
.community-reward-form label,
.community-tag-admin-form label {
    display: grid;
    gap: 7px;
    color: #334155;
    font-weight: 800;
}

.community-form input,
.community-form textarea,
.community-admin-filter input,
.community-admin-filter select,
.community-admin-status-form input,
.community-ban-form input,
.community-reward-form input,
.community-reward-form select,
.community-tag-admin-form input,
.community-tag-admin-form select,
.community-tag-admin-list input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
}

.community-form textarea {
    resize: vertical;
}

.community-form button,
.community-actions button,
.community-admin-filter button,
.community-admin-status-form button,
.community-ban-form button,
.community-reward-form button,
.community-row-actions button,
.community-rule-list button,
.community-admin-comments button,
.community-tag-admin-form button,
.community-tag-admin-list button {
    min-height: 42px;
    border: 0;
    border-radius: 12px;
    padding: 0 14px;
    background: #16a34a;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.community-create-card {
    width: min(760px, 100%);
    margin: 0 auto;
}

.community-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.community-actions form {
    display: inline-flex;
}

.community-actions .danger,
.community-admin-status-form .danger,
.community-ban-form .danger,
.community-rule-list .danger {
    background: #dc2626;
}

.community-comment {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.community-comment > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.community-comment form,
.community-admin-comments form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.community-comment button,
.community-admin-comments button {
    min-height: 34px;
    background: #0f172a;
}

.community-admin-filter {
    display: grid;
    grid-template-columns: 180px 180px minmax(220px, 1fr) auto auto;
    gap: 12px;
    align-items: end;
}

.community-reset-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #334155;
    font-weight: 900;
    text-decoration: none;
}

.community-admin-table-wrap {
    overflow-x: auto;
}

.community-admin-table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.community-admin-table th {
    padding: 0 12px 4px;
    text-align: left;
    color: #64748b;
    font-size: .82rem;
    font-weight: 900;
    white-space: nowrap;
}

.community-admin-table td {
    padding: 13px 12px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.community-admin-table tr.active td {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.community-admin-table td:first-child {
    border-left: 1px solid #e2e8f0;
    border-radius: 14px 0 0 14px;
}

.community-admin-table td:last-child {
    border-right: 1px solid #e2e8f0;
    border-radius: 0 14px 14px 0;
}

.community-admin-table strong,
.community-admin-table span {
    display: block;
}

.community-admin-table span {
    margin-top: 4px;
    color: #64748b;
    font-size: .82rem;
    font-weight: 700;
}

.community-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.community-row-actions a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 10px;
    background: #16a34a;
    color: #fff;
    font-weight: 900;
    text-decoration: none;
}

.community-row-actions form {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.community-row-actions button {
    min-height: 34px;
    border-radius: 10px;
}

.community-admin-image {
    margin-bottom: 14px;
}

.community-admin-status-form,
.community-ban-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.community-admin-status-form > div {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.community-admin-comments article,
.community-rule-list article {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.community-reward-form {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    align-items: end;
}

.community-tag-admin-form {
    grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
    align-items: end;
}

.community-tag-admin-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.community-tag-admin-list form {
    display: grid;
    grid-template-columns: 1.1fr 1fr 90px 1.2fr 90px 120px auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.community-tag-admin-list form + form {
    margin-top: -8px;
    grid-template-columns: 1fr;
    justify-items: end;
    border-top: 0;
    background: #fff;
}

.community-tag-admin-list .danger {
    background: #dc2626;
}

.community-rule-list {
    margin-top: 16px;
}

.community-rule-list article {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.community-tag-manager-grid {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.community-tag-create-card,
.community-tag-list-card,
.community-admin-card {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
}

.community-tag-create-card h3,
.community-tag-list-card h3,
.community-admin-card h3 {
    margin: 0;
    color: #0f172a;
}

.community-tag-create-card,
.community-tag-edit-form,
.community-admin-card label,
.community-danger-card label {
    display: grid;
    gap: 8px;
    color: #334155;
    font-weight: 800;
}

.community-tag-create-card label,
.community-tag-edit-form label {
    display: grid;
    gap: 7px;
    color: #334155;
    font-weight: 800;
}

.community-tag-create-card {
    align-content: start;
    gap: 14px;
}

.community-tag-create-card input,
.community-tag-create-card select,
.community-tag-edit-form input,
.community-tag-edit-form select,
.community-admin-card input,
.community-admin-card select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 9px 11px;
    font: inherit;
    background: #fff;
}

.community-tag-create-card input[type="color"],
.community-tag-edit-form input[type="color"] {
    min-height: 42px;
    padding: 4px;
}

.community-admin-card .admin-check-row,
.community-tag-create-card .admin-check-row,
.community-tag-edit-form .admin-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.community-admin-card .admin-check-row input,
.community-tag-create-card .admin-check-row input,
.community-tag-edit-form .admin-check-row input {
    width: auto;
    min-height: auto;
}

.community-tag-form-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
}

.community-tag-admin-list {
    gap: 14px;
}

.community-tag-admin-item {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
}

.community-tag-edit-form {
    display: grid;
    grid-template-columns: 52px minmax(130px, 1fr) minmax(130px, 1fr) 84px minmax(150px, 1.2fr) 90px 110px minmax(110px, auto) auto;
    gap: 10px;
    align-items: end;
}

.community-tag-admin-list .community-tag-edit-form {
    grid-template-columns: 52px minmax(130px, 1fr) minmax(130px, 1fr) 84px minmax(150px, 1.2fr) 90px 110px minmax(110px, auto) auto;
    padding: 0;
    border: 0;
    background: transparent;
}

.community-tag-delete-form {
    display: flex;
    justify-content: flex-end;
}

.community-tag-admin-list .community-tag-delete-form,
.community-tag-admin-list form + .community-tag-delete-form {
    display: flex;
    justify-content: flex-end;
    grid-template-columns: none;
    margin-top: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.community-tag-id {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #e2e8f0;
    color: #334155;
    font-weight: 900;
}

.community-tag-preview {
    display: flex;
    align-items: center;
    min-height: 42px;
}

.community-detail-admin-panel {
    overflow: hidden;
}

.community-admin-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
    gap: 18px;
    align-items: start;
}

.community-detail-stack {
    display: grid;
    gap: 16px;
}

.community-admin-card {
    background: #fff;
}

.community-admin-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.community-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.community-info-grid.compact {
    grid-template-columns: 1fr;
}

.community-info-grid div {
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.community-info-grid dt {
    margin: 0 0 5px;
    color: #64748b;
    font-size: .82rem;
    font-weight: 900;
}

.community-info-grid dd {
    margin: 0;
    color: #0f172a;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.community-info-grid small {
    color: #64748b;
    font-weight: 700;
}

.community-current-tags {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.community-current-tags > strong {
    color: #334155;
    font-size: .9rem;
}

.community-muted-badge,
.community-status-badge,
.community-pin-state,
.community-danger-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: max-content;
    max-width: 100%;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: .82rem;
    font-weight: 900;
}

.community-muted-badge {
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.community-pin-state {
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.community-pin-state.active {
    color: #92400e;
    background: #fef3c7;
    border-color: #fde68a;
}

.community-pin-state.expired {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fecaca;
}

.community-danger-badge {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.community-tag-badge.inactive {
    opacity: .62;
    filter: grayscale(.4);
}

.community-help-text {
    margin: 2px 0 0;
    color: #92400e;
    font-weight: 800;
    font-size: .9rem;
}

.community-admin-status-form textarea,
.community-ban-form textarea,
.community-admin-filter textarea,
.community-tag-create-card textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 11px 12px;
    font: inherit;
    resize: vertical;
    background: #fff;
}

.community-admin-status-form,
.community-ban-form {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.community-inline-action-form {
    margin-top: 10px;
}

.community-action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.community-save-btn,
.community-secondary-btn {
    min-height: 42px;
    border: 0;
    border-radius: 12px;
    padding: 0 14px;
    font-weight: 900;
    cursor: pointer;
}

.community-save-btn {
    background: #16a34a;
    color: #fff;
}

.community-secondary-btn {
    background: #e2e8f0;
    color: #334155;
}

.community-secondary-btn:disabled,
.community-save-btn:disabled,
.community-admin-card button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.community-danger-card {
    border-color: #fecaca;
    background: #fff7f7;
}

.community-danger-card form + form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #fecaca;
}

.community-admin-tag-select {
    background: #fff;
}

.community-admin-card .community-admin-tag-select label,
.community-admin-tag-select label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.community-admin-card .community-admin-tag-select input[type="checkbox"],
.community-admin-tag-select input[type="checkbox"] {
    width: 16px;
    min-height: auto;
    flex: 0 0 auto;
}

.community-admin-card .community-admin-tag-select label:has(input:checked),
.community-admin-tag-select label:has(input:checked) {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--tag-color, #16a34a) 30%, #fff) inset;
    background: color-mix(in srgb, var(--tag-color, #16a34a) 18%, #fff);
}

[data-community-image-hint] {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.5;
}

[data-community-image-hint].is-error {
    color: #dc2626;
}

.community-image-grid,
.community-admin-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.community-image-grid img,
.community-admin-image-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    border-radius: 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: block;
}

@media (max-width: 900px) {
    .community-topbar,
    .community-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .community-page {
        width: min(100% - 22px, 1180px);
    }

    .community-layout,
    .community-detail-grid,
    .community-admin-grid,
    .community-admin-detail-layout,
    .community-tag-manager-grid,
    .community-admin-filter,
    .community-reward-form,
    .community-tag-admin-form,
    .community-tag-admin-list form,
    .community-tag-edit-form,
    .community-info-grid,
    .community-tag-form-row {
        grid-template-columns: 1fr;
    }

    .community-post-card {
        grid-template-columns: 88px minmax(0, 1fr);
        max-width: 100%;
        overflow: hidden;
    }

    .community-post-card,
    .community-post-card *,
    .community-post-body,
    .community-comment,
    .community-comment *,
    .community-detail-card,
    .community-detail-card * {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

}

@media (max-width: 560px) {
    .community-page {
        width: min(100% - 16px, 1180px);
        margin-top: 12px;
    }

    .community-topbar,
    .community-hero,
    .community-panel,
    .community-post-card,
    .community-admin-card,
    .community-danger-card {
        border-radius: 16px;
        padding: 12px;
    }

    .community-hero h1 {
        font-size: 1.45rem;
    }

    .community-post-card {
        grid-template-columns: 1fr;
    }

    .community-post-card > img {
        aspect-ratio: 16 / 10;
    }

    .community-comment > div:first-child,
    .community-rule-list article {
        align-items: flex-start;
        flex-direction: column;
    }

    .community-tag-badge,
    .community-pin-badge,
    .community-post-status {
        font-size: 0.72rem;
        min-height: 24px;
        padding: 0 8px;
    }
}
