.cm-page {
    --cm-ink: #e8e4dc;
    --cm-muted: #a8b0c0;
    --cm-line: rgba(232, 228, 220, 0.12);
    --cm-gold: #c9a254;
    --cm-panel: rgba(12, 16, 24, 0.72);
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 18px 64px;
    color: var(--cm-ink);
}

.cm-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 22px;
}

.cm-hero h1 {
    margin: 0 0 6px;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    letter-spacing: 0.02em;
}

.cm-hero p {
    margin: 0;
    color: var(--cm-muted);
    max-width: 46ch;
    line-height: 1.45;
}

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

.cm-btn {
    appearance: none;
    border: 1px solid rgba(201, 162, 84, 0.45);
    background: rgba(201, 162, 84, 0.12);
    color: var(--cm-ink);
    border-radius: 10px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
}

.cm-btn:hover { border-color: var(--cm-gold); background: rgba(201, 162, 84, 0.2); }
.cm-btn-primary { background: linear-gradient(180deg, #d4b06a, #a8843a); color: #16120c; border-color: transparent; }
.cm-btn-ghost { background: transparent; border-color: var(--cm-line); color: var(--cm-muted); }
.cm-btn:disabled { opacity: 0.5; cursor: default; }

.cm-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--cm-line);
    padding-bottom: 10px;
}

.cm-tab {
    border: 0;
    background: transparent;
    color: var(--cm-muted);
    padding: 8px 12px;
    border-radius: 8px;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.cm-tab[aria-selected="true"] {
    color: var(--cm-ink);
    background: rgba(201, 162, 84, 0.14);
}

.cm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.cm-card {
    border: 1px solid var(--cm-line);
    border-radius: 16px;
    overflow: hidden;
    background: var(--cm-panel);
    cursor: pointer;
    text-align: left;
    padding: 0;
    color: inherit;
    font: inherit;
    display: flex;
    flex-direction: column;
}

.cm-card:hover { border-color: rgba(201, 162, 84, 0.4); }

.cm-card-img {
    aspect-ratio: 16 / 10;
    width: 100%;
    object-fit: cover;
    background: #0a0d14;
    display: block;
}

.cm-card-meta {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cm-card-user {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.cm-card-user img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.3);
}

.cm-card-user strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cm-card-caption {
    color: var(--cm-muted);
    font-size: 0.9rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.cm-card-stats {
    display: flex;
    gap: 12px;
    color: var(--cm-muted);
    font-size: 0.82rem;
}

.cm-empty, .cm-error, .cm-status {
    padding: 28px 16px;
    text-align: center;
    color: var(--cm-muted);
    border: 1px dashed var(--cm-line);
    border-radius: 14px;
}

.cm-error { color: #f0b4b4; border-color: rgba(220, 100, 100, 0.35); }

.cm-more {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.cm-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 16px;
}

.cm-modal[hidden] { display: none !important; }

.cm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 10, 0.72);
    backdrop-filter: blur(4px);
}

.cm-modal-panel {
    position: relative;
    width: min(920px, 100%);
    max-height: min(90vh, 900px);
    overflow: auto;
    background: #121722;
    border: 1px solid var(--cm-line);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.cm-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: transparent;
    color: var(--cm-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}

.cm-modal-img {
    width: 100%;
    max-height: 52vh;
    object-fit: contain;
    background: #0a0d14;
    border-radius: 12px;
}

.cm-modal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 8px;
    padding-right: 36px;
}

.cm-modal-head img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.cm-modal-caption {
    margin: 0 0 12px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.cm-modal-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.cm-comments {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.cm-comment {
    border-top: 1px solid var(--cm-line);
    padding-top: 10px;
}

.cm-comment strong { margin-right: 6px; }
.cm-comment span { color: var(--cm-muted); font-size: 0.85rem; }
.cm-comment p { margin: 4px 0 0; line-height: 1.4; }

.cm-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cm-form textarea,
.cm-form input[type="file"],
.cm-form select {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--cm-line);
    background: rgba(0, 0, 0, 0.25);
    color: var(--cm-ink);
    padding: 10px 12px;
    font: inherit;
}

.cm-form textarea { min-height: 88px; resize: vertical; }

.cm-hint {
    margin: 0;
    color: var(--cm-muted);
    font-size: 0.85rem;
}

.cm-badge-hidden {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(240, 180, 100, 0.15);
    color: #e0c08a;
    font-size: 0.75rem;
}

@media (max-width: 640px) {
    .cm-page { padding: 18px 12px 48px; }
    .cm-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}
