.lib-hero {
    background: linear-gradient(135deg,#2d0a2e 0%,#5a1a4a 60%,#3a0d3e 100%);
    padding: 40px 24px 32px;
    text-align: center;
    color: #fff;
}
.lib-hero h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; font-family: 'Playfair Display', serif; }
.lib-hero p  { font-size: 14px; color: rgba(255,255,255,0.72); }

.lib-cats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 18px 20px 0;
    max-width: 900px;
    margin: 0 auto;
}
.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
    transition: all 0.18s;
    background: rgba(255,255,255,0.06);
}
.cat-chip:hover   { background: rgba(255,255,255,0.14); color:#fff; border-color:rgba(255,255,255,0.4); }
.cat-chip.active  { background: rgba(192,132,252,0.3); color:#fff; border-color:#c084fc; }
.cat-chip .cnt    { font-size:11px; opacity:0.7; }

.lib-wrap {
    max-width: 960px;
    margin: 28px auto;
    padding: 0 16px;
}
.lib-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #6b21a8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f3e8ff;
}
[data-theme="dark"] .lib-section-title { color:#c084fc; border-color:#3a1a50; }

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 18px;
}
.art-card {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #f0e6f6;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s cubic-bezier(.34,1.2,.64,1), box-shadow 0.22s;
}
.art-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(100,20,120,0.12); }
[data-theme="dark"] .art-card { background:#1e0a2e; border-color:#3a1a50; }
[data-theme="dark"] .art-card:hover { box-shadow: 0 12px 32px rgba(192,132,252,0.12); }

.art-cover {
    height: 148px;
    background: linear-gradient(135deg,#4a0e6e,#9a3a8a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    flex-shrink: 0;
}
.art-cover img { width:100%; height:100%; object-fit:cover; }

.art-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.art-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: #f3e8ff;
    color: #7e22ce;
    margin-bottom: 8px;
    align-self: flex-start;
}
[data-theme="dark"] .art-cat-badge { background:#3a1a50; color:#c084fc; }
.official-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fef9c3;
    color: #854d0e;
    margin-right: 4px;
}
[data-theme="dark"] .official-badge { background:#3d2a00; color:#fcd34d; }

.art-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e0a2e;
    line-height: 1.4;
    margin-bottom: 7px;
    flex: 1;
}
[data-theme="dark"] .art-title { color:#f3e8ff; }
.art-excerpt { font-size: 12px; color: #7c4d99; line-height: 1.5; margin-bottom: 10px; }
[data-theme="dark"] .art-excerpt { color:#b18ed4; }

.art-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #a78cc0;
    margin-top: auto;
}
.art-author { display: flex; align-items: center; gap: 5px; }
.art-avatar {
    width: 20px; height: 20px; border-radius: 50%;
    background: linear-gradient(135deg,#c060a0,#8B2635);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; color: #fff; font-weight: 700; overflow: hidden;
    flex-shrink: 0;
}
.art-avatar img { width:100%; height:100%; object-fit:cover; }

.lib-empty {
    text-align: center;
    padding: 60px 20px;
    color: #a78cc0;
}
.lib-empty .big-icon { font-size: 52px; margin-bottom: 12px; }
.lib-empty p { font-size: 15px; }