/* 爆款视频库 / 一键复刻 / 参考素材 / AI 帮我想(js/viral-lib.js)—— AI 一键成片与爆款复刻共用 */
.vl-modal { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; padding: 20px; }
.vl-mbg { position: absolute; inset: 0; background: rgba(8, 9, 14, .6); backdrop-filter: blur(3px); }
.vl-mbox { position: relative; z-index: 1; width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--bg-white, #fff); border: 1px solid var(--border, #e8e2d6); border-radius: 16px; padding: 20px 22px; box-shadow: var(--shadow-lg, 0 30px 80px rgba(0, 0, 0, .35)); color: var(--text, inherit); }
.vl-modal.sm .vl-mbox { width: min(560px, 100%); }
.vl-modal.lib .vl-mbox { width: min(1180px, 100%); }
.vl-modal.pv .vl-mbox { width: min(980px, 100%); }
.vl-mx { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--bg-warm, #f5f2ec); color: var(--text-secondary, #777); cursor: pointer; z-index: 2; }
.vl-mx:hover { color: var(--accent, #c8791f); }
.vl-h3 { font-size: 16px; font-weight: 700; color: var(--strong, var(--text)); margin: 0 40px 12px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vl-h3 > i { color: var(--accent, #c8791f); }
.vl-dim { color: var(--text-hint, #999); font-size: 12px; font-weight: 400; line-height: 1.6; }
.vl-err { color: var(--danger, #e5484d); font-size: 13px; }
.vl-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vl-row.end { justify-content: flex-end; }
.vl-grow { flex: 1; }
.vl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border-radius: 10px; border: 1px solid var(--border, #e8e2d6); background: var(--bg-warm, #f5f2ec); color: var(--text, inherit); font-size: 13px; cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s; }
.vl-btn:hover { border-color: rgba(232, 176, 75, .5); }
.vl-btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.vl-btn.lg { padding: 10px 22px; font-size: 14.5px; font-weight: 700; }
.vl-btn.primary { background: var(--gold-grad, linear-gradient(135deg, #f0c060, #d99a2b)); border-color: transparent; color: #1b1406; font-weight: 600; }
.vl-btn.ghost { background: transparent; }
.vl-btn.danger { color: var(--danger, #e5484d); }
.vl-btn:disabled { opacity: .55; cursor: not-allowed; }
.vl-inp, .vl-sel { width: 100%; box-sizing: border-box; padding: 8px 11px; border-radius: 9px; border: 1px solid var(--border, #e8e2d6); background: var(--bg-warm, #faf8f3); color: var(--text, inherit); font: inherit; font-size: 13px; }
.vl-inp:focus, .vl-sel:focus { outline: none; border-color: rgba(232, 176, 75, .6); }
.vl-inp.sm, .vl-sel { padding: 5px 8px; font-size: 12px; }
textarea.vl-inp { resize: vertical; line-height: 1.6; font-size: 14px; }
.vl-lab { display: block; margin: 12px 0 6px; font-size: 13px; font-weight: 600; color: var(--strong, var(--text)); }
.vl-lab.inline { display: inline; margin: 0 4px 0 6px; }
.vl-chk { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; cursor: pointer; }
.vl-chip { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border, #e8e2d6); background: var(--bg-warm, #f5f2ec); color: var(--text-secondary, #777); font-size: 12px; cursor: pointer; }
.vl-chip.on { color: var(--accent, #c8791f); border-color: rgba(232, 176, 75, .45); background: var(--primary-light, #fff4e0); }
.vl-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.vl-seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--bg-warm, #f5f2ec); border: 1px solid var(--border, #e8e2d6); }
.vl-seg button { border: 0; background: transparent; color: var(--text-secondary, #777); font-size: 12.5px; padding: 4px 10px; border-radius: 7px; cursor: pointer; }
.vl-seg button.on { background: var(--primary-light, #fff4e0); color: var(--accent, #c8791f); font-weight: 600; }

/* 参考素材选择器 */
.vl-refs { display: flex; flex-direction: column; gap: 8px; }
.vl-drop { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px dashed var(--border, #ddd); border-radius: 12px; cursor: pointer; font-size: 13px; color: var(--text-secondary, #666); flex-wrap: wrap; transition: border-color .15s, background .15s; }
.vl-drop > i { font-size: 20px; color: var(--accent, #c8791f); }
.vl-drop:hover, .vl-drop.over { border-color: rgba(232, 176, 75, .7); background: var(--primary-light, #fff7e8); }
.vl-struct { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid rgba(232, 176, 75, .45); background: var(--primary-light, #fff7e8); font-size: 13px; }
.vl-struct > i { color: var(--accent, #c8791f); font-size: 16px; }
.vl-struct b { color: var(--accent, #c8791f); margin-right: 4px; }
.vl-linkrow { display: flex; align-items: center; gap: 8px; }
.vl-linkrow > i { color: var(--text-hint, #999); }
.vl-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.vl-item { position: relative; display: flex; gap: 10px; padding: 8px; border: 1px solid var(--border, #e8e2d6); border-radius: 12px; background: var(--bg-warm, #faf8f3); }
.vl-item.up { opacity: .75; }
.vl-ith { position: relative; flex: 0 0 72px; height: 72px; border-radius: 8px; overflow: hidden; background: rgba(0, 0, 0, .2); display: flex; align-items: center; justify-content: center; color: var(--text-hint, #999); }
.vl-ith img { width: 100%; height: 100%; object-fit: cover; }
.vl-ith span { position: absolute; right: 3px; bottom: 3px; font-size: 10px; background: rgba(0, 0, 0, .6); color: #fff; padding: 0 4px; border-radius: 4px; }
.vl-ith em { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .45); color: #fff; font-style: normal; }
.vl-itb { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.vl-tip { font-size: 11px; color: var(--text-hint, #999); line-height: 1.45; }
.vl-x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 10px; cursor: pointer; }
.vl-x:hover { background: var(--danger, #e5484d); }
.vl-refs.compact .vl-items { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* AI 帮我想 */
.vl-ideas { margin-top: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(232, 176, 75, .35); background: var(--primary-light, #fff8ec); font-size: 13px; }
.vl-ideas.loading { color: var(--accent, #c8791f); }
.vl-ideas.err { color: var(--danger, #e5484d); }
.vl-ideas-h { display: flex; align-items: center; gap: 8px; color: var(--accent, #c8791f); font-weight: 600; margin-bottom: 8px; }
.vl-ideas-h .vl-btn:first-of-type { margin-left: auto; }
.vl-igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.vl-idea { padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border, #e8e2d6); background: var(--bg-white, #fff); cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, transform .15s; }
.vl-idea:hover { border-color: rgba(232, 176, 75, .6); transform: translateY(-1px); }
.vl-idea.on { border-color: var(--accent, #c8791f); box-shadow: inset 0 0 0 1px var(--accent, #c8791f); }
.vl-idea b { font-size: 13.5px; color: var(--strong, var(--text)); line-height: 1.45; }
.vl-hook { font-size: 12px; color: var(--text-secondary, #666); }

/* 爆款库 */
.vl-lib { margin-top: 12px; }
.vl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.vl-card { border: 1px solid var(--border, #e8e2d6); border-radius: 14px; overflow: hidden; background: var(--bg-warm, #faf8f3); cursor: pointer; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.vl-card:hover { border-color: rgba(232, 176, 75, .5); transform: translateY(-2px); }
.vl-cv { position: relative; aspect-ratio: 3 / 4; background: #000; display: flex; align-items: center; justify-content: center; color: #555; font-size: 24px; overflow: hidden; }
.vl-cv img { width: 100%; height: 100%; object-fit: cover; }
.vl-cat, .vl-dur, .vl-nov { position: absolute; font-size: 11px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .62); color: #fff; }
.vl-cat { left: 8px; top: 8px; color: #f6cf7a; }
.vl-dur { right: 8px; bottom: 8px; }
.vl-nov { left: 8px; bottom: 8px; }
.vl-cb { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.vl-cb b { font-size: 13.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--strong, var(--text)); }
.vl-formula { font-size: 12px; color: var(--text-secondary, #666); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vl-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--text-hint, #999); }
.vl-meta a { color: var(--accent, #c8791f); }
.vl-acts { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }
.vl-acts .vl-btn { flex: 1; }
.vl-empty { text-align: center; padding: 40px 10px; color: var(--text-secondary, #777); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.vl-empty > i { font-size: 30px; color: var(--text-hint, #aaa); }
.vl-pv { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 18px; }
.vl-pvv video { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; }
.vl-pvv.land { grid-column: 1 / -1; }
.vl-pv:has(.vl-pvv.land) { grid-template-columns: 1fr; }
.vl-fbox { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--primary-light, #fff7e8); border: 1px solid rgba(232, 176, 75, .35); font-size: 13px; font-weight: 600; line-height: 1.6; }
.vl-fbox small { display: block; font-size: 11px; color: var(--accent, #c8791f); font-weight: 600; letter-spacing: .5px; margin-bottom: 2px; }
.vl-fbox.sm { font-size: 12.5px; font-weight: 500; margin-top: 0; }
.vl-beats { display: flex; gap: 3px; margin-top: 10px; }
.vl-beat { min-width: 0; padding: 6px 7px; border-radius: 7px; background: var(--bg-warm, #f5f2ec); border: 1px solid var(--border, #e8e2d6); font-size: 11.5px; display: flex; flex-direction: column; }
.vl-beat span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--strong, var(--text)); font-weight: 600; }
.vl-beat em { font-style: normal; color: var(--text-hint, #999); font-size: 10.5px; }
.vl-alib { max-height: 60vh; overflow: auto; }
.vl-agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.vl-ait { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: #000; }
.vl-ait.on { border-color: var(--accent, #c8791f); }
.vl-ait img, .vl-ait video { width: 100%; height: 100%; object-fit: cover; }
.vl-ait span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10.5px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); padding: 8px 5px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 一键复刻对话框 */
.vl-qc .vl-topic { display: flex; gap: 8px; align-items: stretch; }
.vl-qc .vl-topic .vl-btn { flex: 0 0 auto; }
.vl-steps { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-hint, #999); margin: 4px 0 2px; flex-wrap: wrap; }
.vl-steps span.on { color: var(--accent, #c8791f); font-weight: 600; }
.vl-steps i { font-size: 10px; }

@media (max-width: 720px) {
    .vl-mbox { padding: 16px 14px; }
    .vl-pv { grid-template-columns: 1fr; }
    .vl-qc .vl-topic { flex-direction: column; }
    .vl-items, .vl-refs.compact .vl-items { grid-template-columns: 1fr; }
    .vl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
