* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f6fa; color: #222; }
a { text-decoration: none; color: inherit; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; background: #1f2233; color: #fff; }
.brand { font-size: 18px; font-weight: 700; }
.user { font-size: 14px; }

.cats { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 24px; background: #fff; border-bottom: 1px solid #eee; }
.cat { padding: 6px 16px; border-radius: 20px; background: #f0f1f5; font-size: 14px; color: #555; }
.cat.on { background: #2f6bff; color: #fff; }

.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.empty-tip { color: #999; padding: 40px 0; text-align: center; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.06); transition: transform .15s; display: block; }
.card:hover { transform: translateY(-4px); }
.cover { position: relative; height: 130px; background-size: cover; background-position: center; background-color: #ddd; display: flex; align-items: center; justify-content: center; }
.play-ico { color: #fff; font-size: 30px; opacity: .85; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.card-title { padding: 10px 12px; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.page { padding: 6px 12px; border-radius: 6px; background: #fff; border: 1px solid #e2e4ea; font-size: 14px; }
.page.on { background: #2f6bff; color: #fff; border-color: #2f6bff; }

.detail .back { color: #2f6bff; font-size: 14px; }
.detail-title { margin: 12px 0 16px; }
.player-box { background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; }
.hls-player { width: 100%; height: 100%; display: block; }
.preview-tip { color: #888; font-size: 14px; margin-top: 12px; }

.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-mask.show { display: flex; }
.modal { background: #fff; width: 320px; border-radius: 16px; padding: 28px 24px; text-align: center; animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-emoji { font-size: 40px; }
.modal h3 { margin: 12px 0 8px; }
.modal p { color: #777; font-size: 14px; margin-bottom: 20px; }
.btn-primary { width: 100%; padding: 12px; border: none; border-radius: 10px; background: linear-gradient(135deg,#ff8a00,#ff5e00); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.btn-text { margin-top: 10px; background: none; border: none; color: #999; cursor: pointer; font-size: 14px; }

.chat-fab { position: fixed; right: 22px; bottom: 22px; z-index: 900; padding: 12px 18px; border: none; border-radius: 30px; background: #2f6bff; color: #fff; font-size: 15px; cursor: pointer; box-shadow: 0 6px 18px rgba(47,107,255,.4); }
.chat-window { position: fixed; right: 22px; bottom: 22px; z-index: 950; width: 340px; max-width: calc(100vw - 24px); height: 460px; background: #fff; border-radius: 14px; overflow: hidden; display: none; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.chat-window.open { display: flex; }
.chat-header { background: #2f6bff; color: #fff; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.chat-close { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.chat-body { flex: 1; padding: 14px; overflow-y: auto; background: #f3f4f8; }
.chat-input { display: flex; border-top: 1px solid #eee; }
.chat-input input { flex: 1; border: none; padding: 12px 14px; outline: none; font-size: 14px; }
.chat-input button { border: none; background: #2f6bff; color: #fff; padding: 0 18px; cursor: pointer; }

.msg { margin-bottom: 12px; display: flex; flex-direction: column; }
.msg.mine { align-items: flex-end; }
.msg.theirs { align-items: flex-start; }
.bubble { max-width: 75%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; word-break: break-word; white-space: pre-wrap; }
.msg.mine .bubble { background: #2f6bff; color: #fff; border-bottom-right-radius: 3px; }
.msg.theirs .bubble { background: #fff; color: #333; border-bottom-left-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.msg-time { font-size: 11px; color: #aaa; margin-top: 3px; }
