/* Artifact Catalog */
.art-catalog-page {
    padding: 16px 16px 100px;
    max-width: 1000px;
    margin: 0 auto;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.art-catalog-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.art-catalog-title {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    color: var(--green);
}
.art-catalog-desc {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 16px;
}
.art-catalog-filters {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}
.art-filter-btn {
    padding: 6px 14px;
    border-radius: 16px;
    background: none;
    border: 1px solid var(--line);
    color: var(--muted);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.art-filter-btn:hover { border-color: var(--green-dim); color: var(--text); }
.art-filter-btn.active {
    background: rgba(var(--green-rgb),0.1);
    border-color: var(--green);
    color: var(--green);
}

.art-catalog-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.art-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.art-section-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.art-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.art-section-hint {
    font-size: 12px;
    color: var(--muted);
}

.art-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.art-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius, 12px);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.15s;
    box-shadow: var(--shadow, none);
}
.art-card:hover { border-color: var(--green-dim); }

.art-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.art-card-lang {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(var(--green-rgb),0.08);
    border: 1px solid var(--line);
    color: var(--green);
    text-transform: uppercase;
    font-weight: 700;
}
.art-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.art-card-preview {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--muted);
    max-height: 80px;
    overflow: hidden;
    margin: 0;
    position: relative;
}
.art-card-preview::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 30px;
    background: linear-gradient(transparent, var(--panel));
}
.art-card-preview code {
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

.art-card-file-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 84px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
}

.art-card-file-preview-image {
    padding: 0;
    overflow: hidden;
}

.art-card-file-preview-image img {
    display: block;
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    background: rgba(255,255,255,0.04);
}

.art-card-file-icon {
    font-size: 28px;
    flex: 0 0 auto;
}

.art-card-file-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.art-card-file-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.art-card-file-sub {
    font-size: 11px;
    color: var(--muted);
    word-break: break-word;
}

.art-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--muted);
}

.art-card-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.art-card-btn {
    padding: 4px 10px;
    border-radius: 6px;
    background: none;
    border: 1px solid var(--line);
    color: var(--muted);
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}
.art-card-btn:hover {
    border-color: var(--green-dim);
    color: var(--green);
}

.art-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.art-empty-icon { font-size: 48px; margin-bottom: 12px; }
.art-empty-text { font-size: 14px; margin-bottom: 8px; }
.art-empty-hint { font-size: 12px; opacity: 0.7; }

/* Preview modal */
.art-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.art-preview-modal {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius, 12px);
    width: 100%;
    max-width: 900px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.art-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    color: var(--text);
}
.art-preview-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}
.art-preview-close:hover { color: var(--text); }
.art-preview-frame {
    flex: 1;
    border: none;
    /* iframe fallback — user HTML/SVG usually assumes white; artifact CSS can override */
    background: #fff;
    min-height: 400px;
}

@media (max-width: 600px) {
    .art-section-grid { grid-template-columns: 1fr; }
}
