.library-section { min-width:0; scroll-margin-top:24px; }
.library-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 16px; }
.library-heading h2 { margin:0; font-size:21px; }
.library-heading p { margin:6px 0 0; color:var(--text-muted); font-size:13px; line-height:1.7; }
.library-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:20px 16px; }
.library-card { min-width:0; position:relative; }
.library-card a { display:block; color:var(--text); text-decoration:none; }
.library-poster { position:relative; aspect-ratio:2/3; overflow:hidden; border:1px solid var(--line); border-radius:10px; background:var(--page); }
.library-poster:empty::after { content:'暂无封面'; position:absolute; inset:0; display:grid; place-items:center; color:var(--text-muted); font-size:12px; }
.library-poster img { width:100%; height:100%; object-fit:cover; }
.library-card strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin:10px 0 5px; font-size:14px; }
.library-card small { display:block; color:var(--text-muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.member-page .library-remove { min-height:32px; padding:5px 0; background:transparent; color:var(--text-muted); font-size:12px; font-weight:400; }
.library-empty { grid-column:1/-1; padding:36px 20px; border:1px dashed var(--line); border-radius:10px; color:var(--text-muted); font-size:14px; line-height:1.8; text-align:center; }
.library-pagination { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:10px; margin-top:18px; }
.library-pagination:empty { display:none; }
.library-page-status { color:var(--text-muted); font-size:12px; }
.header-history-link { display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; color:inherit; flex-shrink:0; }
.header-history { position:relative; display:flex; flex-shrink:0; width:44px; height:44px; }
.header-history-popup { display:none; position:absolute; z-index:45; top:calc(100% + 8px); right:0; width:280px; max-width:calc(100vw - 32px); padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--surface-raised); color:var(--text); box-shadow:var(--shadow); }
.header-history-popup::before { content:''; position:absolute; top:-10px; left:0; right:0; height:10px; }
.header-history-popup > strong { font-size:13px; }
.header-history-popup ul { list-style:none; padding:8px 0; margin:0; }
.header-history-popup li a { display:flex; align-items:center; gap:9px; min-height:36px; color:var(--text-muted); font-size:13px; }
.header-history-popup li a::before { content:''; width:5px; height:5px; flex-shrink:0; border-radius:50%; background:var(--accent); }
.header-history-popup li span { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.header-history-popup a:hover { color:var(--accent); }
.header-history-popup a:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.header-history-empty { padding:12px 0; color:var(--text-muted); font-size:13px; }
.header-history-all { display:flex; align-items:center; justify-content:space-between; min-height:36px; padding-top:8px; border-top:1px solid var(--line); color:var(--text-muted); font-size:12px; }
.video-action.video-favorite { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:42px; padding:9px 16px; border:1px solid color-mix(in srgb,var(--accent) 30%,var(--line)); border-radius:9px; background:color-mix(in srgb,var(--accent) 7%,var(--surface)); color:var(--text); font-size:13px; font-weight:600; transition:background .15s,border-color .15s; }
.video-favorite svg { flex-shrink:0; }
.video-action.video-favorite:hover { opacity:1; border-color:var(--accent); background:color-mix(in srgb,var(--accent) 13%,var(--surface)); }
.video-action.video-favorite[aria-pressed=true] { color:var(--accent); border-color:var(--accent); }
.video-favorite[aria-pressed=true] svg { fill:currentColor; }
@media (min-width:821px) and (hover:hover) and (pointer:fine) {
    .header-history:hover .header-history-popup,.header-history:focus-within .header-history-popup { display:block; }
}
@media(max-width:820px) {
    .library-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px 10px; }
    .library-heading { align-items:flex-start; }
    .library-heading h2 { font-size:19px; }
}
@media(prefers-reduced-motion:reduce) { .video-action.video-favorite { transition:none; } }
