/**
 * 种草单 — 书架 / 影单墙
 */

.shelf-page {
    --shelf-ink: var(--color-ink);
    --shelf-muted: var(--color-muted);
    --shelf-line: var(--color-line);
    --shelf-paper: var(--color-page);
    --shelf-wood: var(--color-primary);
    --shelf-accent: var(--color-primary);
    --shelf-book: var(--color-primary);
    --shelf-movie: var(--color-warning);
    --shelf-music: var(--color-success);
    font-family: var(--font-sans);
    color: var(--shelf-muted);
    background: var(--color-page);
    padding-bottom: 64px;
}

.shelf-brand {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--shelf-accent);
    margin: 0 0 8px;
}

.shelf-hero {
    position: relative;
    background:
        radial-gradient(ellipse 80% 60% at 10% 20%, rgba(2, 149, 182, 0.12), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 80%, rgba(196, 165, 116, 0.22), transparent 50%),
        linear-gradient(165deg, #f6f1e8 0%, #eef5f6 55%, #f3f8f9 100%);
    padding: 56px 0 40px;
    margin-bottom: 28px;
    overflow: hidden;
}

.shelf-hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--shelf-wood), var(--shelf-accent), transparent);
    opacity: 0.55;
}

.shelf-hero-title {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 2.75rem);
    color: var(--shelf-ink);
    margin: 0 0 10px;
    line-height: 1.2;
    animation: shelfFadeUp 0.7s ease both;
}

.shelf-hero-desc {
    max-width: 36em;
    margin: 0 0 20px;
    font-size: 1.05rem;
    animation: shelfFadeUp 0.7s 0.08s ease both;
}

.shelf-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    animation: shelfFadeUp 0.7s 0.16s ease both;
}

@keyframes shelfFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

.shelf-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--shelf-ink);
    color: #fff !important;
    border: none;
    border-radius: 2px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.2s;
}
.shelf-btn:hover { background: var(--shelf-accent); color: #fff !important; transform: translateY(-1px); }
.shelf-btn-ghost {
    background: transparent;
    color: var(--shelf-ink) !important;
    border: 1px solid var(--shelf-line);
}
.shelf-btn-ghost:hover { border-color: var(--shelf-accent); color: var(--shelf-accent) !important; background: transparent; }
.shelf-btn-sm { padding: 6px 14px; font-size: 0.9rem; }

.shelf-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--shelf-line);
}

.shelf-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.shelf-tab {
    padding: 6px 14px;
    color: var(--shelf-muted) !important;
    text-decoration: none !important;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.shelf-tab:hover, .shelf-tab.is-active {
    color: var(--shelf-ink) !important;
    border-bottom-color: var(--shelf-accent);
}
.shelf-tabs-inline { margin-bottom: 20px; }

.shelf-sort a {
    margin-right: 12px;
    color: var(--shelf-muted) !important;
    text-decoration: none !important;
    font-size: 0.9rem;
}
.shelf-sort a.is-active { color: var(--shelf-accent) !important; font-weight: 600; }

.shelf-search { display: flex; gap: 8px; margin-left: auto; }
.shelf-search input {
    border: 1px solid var(--shelf-line);
    padding: 6px 12px;
    min-width: 180px;
    background: #fff;
    border-radius: 2px;
}

.shelf-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 28px 20px;
}

.shelf-card {
    display: block;
    text-decoration: none !important;
    color: inherit !important;
    transition: transform 0.25s ease;
    animation: shelfFadeUp 0.6s ease both;
}
.shelf-card:nth-child(2) { animation-delay: 0.05s; }
.shelf-card:nth-child(3) { animation-delay: 0.1s; }
.shelf-card:nth-child(4) { animation-delay: 0.15s; }
.shelf-card:hover { transform: translateY(-4px); }

.shelf-card-cover {
    position: relative;
    aspect-ratio: 2 / 3;
    background: linear-gradient(145deg, #d8e4e0, #c5d4cf);
    background-size: cover;
    background-position: center;
    box-shadow:
        4px 0 0 rgba(0,0,0,0.06),
        8px 12px 24px rgba(26, 47, 42, 0.12);
    border-radius: 1px 4px 4px 1px;
}
.shelf-card-book .shelf-card-cover { box-shadow: 4px 0 0 var(--shelf-book), 8px 12px 24px rgba(26, 47, 42, 0.12); }
.shelf-card-movie .shelf-card-cover { box-shadow: 4px 0 0 var(--shelf-movie), 8px 12px 24px rgba(26, 47, 42, 0.12); }
.shelf-card-music .shelf-card-cover { box-shadow: 4px 0 0 var(--shelf-music), 8px 12px 24px rgba(26, 47, 42, 0.12); }

.shelf-type-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 2px 8px;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    background: rgba(26, 47, 42, 0.78);
    color: #fff;
}

.shelf-card-body { padding: 12px 2px 0; }
.shelf-card-title {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    color: var(--shelf-ink);
    margin: 0 0 4px;
    line-height: 1.35;
}
.shelf-card-meta, .shelf-card-stats {
    margin: 0;
    font-size: 0.85rem;
}
.shelf-card-stats { margin-top: 6px; opacity: 0.85; }
.shelf-card-stats span { margin-right: 10px; }

.shelf-empty {
    text-align: center;
    padding: 64px 20px;
    color: var(--shelf-muted);
    border: 1px dashed var(--shelf-line);
    background: rgba(255,255,255,0.5);
}

.shelf-pager { margin-top: 32px; text-align: center; }

/* Detail */
.shelf-hero-detail { padding-bottom: 48px; }
.shelf-detail-head {
    display: flex;
    gap: 32px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.shelf-detail-cover {
    width: 160px;
    aspect-ratio: 2 / 3;
    flex-shrink: 0;
    background: linear-gradient(145deg, #d8e4e0, #c5d4cf);
    background-size: cover;
    background-position: center;
    box-shadow: 6px 10px 28px rgba(26, 47, 42, 0.18);
    animation: shelfFadeUp 0.6s ease both;
}
.shelf-detail-info { flex: 1; min-width: 220px; }
.shelf-meta-line { margin: 0 0 16px; }
.shelf-meta-line a { color: var(--shelf-accent); }
.shelf-private-tag {
    display: inline-block;
    padding: 1px 8px;
    font-size: 0.75rem;
    background: rgba(26, 47, 42, 0.1);
    border-radius: 2px;
}
.shelf-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.shelf-engage {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 32px;
    padding: 14px 0;
    border-bottom: 1px solid var(--shelf-line);
}
.shelf-engage-btn {
    border: 1px solid var(--shelf-line);
    background: #fff;
    padding: 8px 14px;
    border-radius: 2px;
    color: var(--shelf-ink);
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.shelf-engage-btn em {
    font-style: normal;
    font-size: 0.85rem;
    margin-left: 4px;
    color: var(--shelf-muted);
}
.shelf-engage-btn:hover, .shelf-engage-btn.is-on {
    border-color: var(--shelf-accent);
    color: var(--shelf-accent);
    background: rgba(2, 149, 182, 0.06);
}
.shelf-engage-btn.is-on i.fa-heart { color: #c0392b; }
.shelf-engage-count { margin-left: auto; font-size: 0.9rem; }

.shelf-item-wall {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.shelf-item {
    display: flex;
    gap: 20px;
    padding: 22px 0;
    border-bottom: 1px solid var(--shelf-line);
    animation: shelfFadeUp 0.5s ease both;
}
.shelf-item-cover {
    position: relative;
    width: 72px;
    flex-shrink: 0;
    aspect-ratio: 2 / 3;
    background: linear-gradient(145deg, #e0e8e4, #cfdad5);
    background-size: cover;
    background-position: center;
    box-shadow: 2px 4px 12px rgba(26, 47, 42, 0.1);
}
.shelf-item-index {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
    line-height: 22px;
    text-align: center;
    background: var(--shelf-ink);
    color: #fff;
}
.shelf-item-title {
    font-family: var(--font-sans);
    font-size: 1.35rem;
    margin: 0 0 4px;
    color: var(--shelf-ink);
}
.shelf-item-title a { color: inherit !important; text-decoration: none !important; }
.shelf-item-title a:hover { color: var(--shelf-accent) !important; }
.shelf-item-creator { margin: 0 0 6px; font-size: 0.92rem; }
.shelf-item-note {
    margin: 0 0 6px;
    font-style: italic;
    color: var(--shelf-ink);
    opacity: 0.85;
    border-left: 2px solid var(--shelf-wood);
    padding-left: 12px;
}
.shelf-item-meta { margin: 0; font-size: 0.82rem; }

.shelf-section-title {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    color: var(--shelf-ink);
    margin: 40px 0 16px;
}

.shelf-comment {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--shelf-line);
}
.shelf-comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #e8efed;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.shelf-comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.shelf-comment-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.shelf-comment-head time { font-size: 0.8rem; color: var(--shelf-muted); }
.shelf-comment-form textarea {
    width: 100%;
    border: 1px solid var(--shelf-line);
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 2px;
    resize: vertical;
}
.shelf-comment-empty, .shelf-comment-login { padding: 20px 0; color: var(--shelf-muted); }

/* Member manage */
.shelf-mine-list { margin-top: 8px; }
.shelf-mine-row {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--shelf-line);
}
.shelf-mine-cover {
    width: 56px;
    height: 84px;
    flex-shrink: 0;
    background: #d8e4e0 center/cover;
    box-shadow: 2px 3px 8px rgba(0,0,0,0.08);
}
.shelf-mine-info { flex: 1; min-width: 0; }
.shelf-mine-info h3 { margin: 0 0 6px; font-size: 1.1rem; }
.shelf-mine-info h3 a { color: var(--shelf-ink); }
.shelf-mine-ops { white-space: nowrap; }

.shelf-item-manage { list-style: none; margin: 0; padding: 0; }
.shelf-item-manage-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--shelf-line);
}
.shelf-item-manage-cover {
    width: 40px;
    height: 60px;
    background: #d8e4e0 center/cover;
    flex-shrink: 0;
}
.shelf-item-manage-body { flex: 1; min-width: 0; }
.shelf-item-note-sm { margin: 4px 0 0; font-size: 0.85rem; color: var(--shelf-muted); }
.shelf-item-manage-ops { white-space: nowrap; }
.shelf-parse-box { margin-bottom: 24px; }

@media (max-width: 767px) {
    .shelf-hero { padding: 36px 0 28px; }
    .shelf-detail-cover { width: 120px; }
    .shelf-search { margin-left: 0; width: 100%; }
    .shelf-search input { flex: 1; min-width: 0; }
    .shelf-mine-row, .shelf-item-manage-row { flex-wrap: wrap; }
    .shelf-engage-count { margin-left: 0; width: 100%; }
}
