/* ===================== 基础 ===================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --pink: #f97316;
  --pink-dark: #ea580c;
  --blue: #00aeec;
  --text: #18191c;
  --text2: #61666d;
  --text3: #9499a0;
  --bg: #f4f5f7;
  --card: #ffffff;
  --line: #e3e5e7;
  --radius: 8px;
}

html, body { height: 100%; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; }

/* ===================== 顶栏 ===================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-mark { width: 32px; height: 32px; }
.logo-full { height: 34px; width: auto; display: block; }
.logo-text { font-size: 20px; font-weight: 700; color: var(--pink); letter-spacing: 1px; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--text);
  border-radius: 6px;
  white-space: nowrap;
}
.nav-link:hover { color: var(--pink); background: #fff3f7; }
.nav-link.active { color: var(--pink); font-weight: 600; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.15s ease;
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-item {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
  white-space: nowrap;
}
.dropdown-item:hover { background: #fff3f7; color: var(--pink); }

.search {
  flex: 1;
  max-width: 360px;
  display: flex;
  align-items: center;
  background: #f1f2f3;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0 6px 0 14px;
  transition: border-color 0.2s, background 0.2s;
}
.search:focus-within { border-color: var(--pink); background: #fff; }
.search input { flex: 1; border: none; outline: none; background: transparent; padding: 7px 0; }
.search button { border: none; background: none; font-size: 16px; padding: 4px 8px; }

.user-area { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-menu { position: relative; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 20px;
}
.user-chip:hover { background: #f4f5f7; }
.user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-badge { font-size: 12px; color: #b8860b; background: #fff7e0; padding: 1px 8px; border-radius: 10px; }

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: none;
}
.user-dropdown.show { display: block; }
.user-dropdown .dropdown-item { display: block; }
.dropdown-sep { height: 1px; background: var(--line); margin: 4px 8px; }

/* ===================== 主容器 ===================== */
#app { max-width: 1320px; margin: 0 auto; padding: 20px; min-height: calc(100vh - 56px); }

/* ===================== 通用 ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 14px;
  line-height: 1.2;
  transition: all 0.15s;
}
.btn-primary { background: var(--pink); color: #fff; }
.btn-primary:hover { background: var(--pink-dark); }
.btn-outline { background: #fff; color: var(--text2); border-color: var(--line); }
.btn-outline:hover { color: var(--pink); border-color: var(--pink); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--pink); }
textarea.input { resize: vertical; }

.page-header { margin: 8px 0 20px; }
.page-title { font-size: 24px; font-weight: 700; }
.page-subtitle { color: var(--text3); margin-top: 4px; }

.section { margin: 28px 0; }
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 14px;
}
.section-title .more { margin-left: auto; font-size: 13px; color: var(--text3); font-weight: 400; }
.section-title .more:hover { color: var(--pink); }

/* ===================== 首页 ===================== */
.banner {
  position: relative;
  height: 220px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
  color: #fff;
}
.banner-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 70%); }
.banner-content { position: absolute; left: 32px; top: 50%; transform: translateY(-50%); max-width: 60%; }
.banner-tag { display: inline-block; background: var(--pink); padding: 2px 10px; border-radius: 4px; font-size: 12px; margin-bottom: 10px; }
.banner-title { display: block; font-size: 24px; font-weight: 700; margin-bottom: 8px; text-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.banner-info { font-size: 13px; opacity: 0.9; margin-bottom: 14px; }
.banner-play { background: var(--pink); }

.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; margin-bottom: 8px; }
.zone-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  transition: all 0.15s;
}
.zone-item:hover { border-color: var(--pink); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(251,114,153,0.15); }
.zone-icon { display: block; font-size: 26px; margin-bottom: 6px; }
.zone-name { font-size: 13px; color: var(--text2); }

/* ===================== 视频卡片 / 网格 ===================== */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

.video-card {
  display: block;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.video-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1); }
.cover { position: relative; aspect-ratio: 16 / 9; background: #2b2d31; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,0.25), transparent 40%); opacity: 0; transition: opacity 0.15s; }
.video-card:hover .cover-shade { opacity: 1; }
.duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 4px;
}
.meta { padding: 10px 12px 12px; }
.title {
  font-size: 14px;
  line-height: 1.45;
  height: 2.9em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 6px;
}
.info { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text3); }
.info .up { color: var(--text3); }
.info .up:hover { color: var(--pink); }
.info .sep { color: #ccd0d7; }

/* ===================== 列表页 ===================== */
.list-head { margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
  display: inline-block;
  padding: 5px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 13px;
  color: var(--text2);
  transition: all 0.12s;
}
.chip:hover { color: var(--pink); border-color: var(--pink); }
.chip.active { background: var(--pink); color: #fff; border-color: var(--pink); }

.sort-bar { display: flex; gap: 6px; margin: 8px 0 18px; }
.sort-btn {
  padding: 6px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 13px;
  color: var(--text2);
}
.sort-btn.active { background: var(--pink); color: #fff; border-color: var(--pink); }
.load-more { text-align: center; margin: 24px 0; }

/* ===================== 播放页 ===================== */
.play-page { display: flex; gap: 20px; align-items: flex-start; }
.play-main { flex: 1; min-width: 0; }
.play-side { width: 320px; flex-shrink: 0; }

/* 播放器 */
#player-box { margin-bottom: 16px; }
.player-stage {
  position: relative;
  width: 100%;
  padding-top: 56.25%;  /* 16:9 全浏览器兼容 */
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.player-video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
  z-index: 0;
}
.video-frame-canvas { position: fixed; left: 0; top: 0; pointer-events: none; border-radius: var(--radius); z-index: 50; }
.danmaku-canvas { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 55; }

.player-controls {
  position: fixed;
  left: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 10px 8px;
  background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent);
  color: #fff;
  flex-wrap: wrap;
  z-index: 60;
  transition: opacity 0.35s ease;
}
.player-controls.controls-hidden { opacity: 0; pointer-events: none; }
.ctl-btn {
  border: none;
  background: none;
  color: #fff;
  font-size: 15px;
  padding: 3px 6px;
  border-radius: 4px;
  min-width: 28px;
}
.ctl-btn:hover { background: rgba(255,255,255,0.2); }
.dm-toggle.on { color: #7cf29b; font-weight: 700; }
.dm-toggle.off { color: #999; text-decoration: line-through; }
.ctl-time { font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ctl-sep { width: 1px; height: 16px; background: rgba(255,255,255,0.3); margin: 0 4px; }
.ctl-select {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 12px;
  outline: none;
}
.ctl-select option { color: #18191c; }
.ctl-range { width: 56px; accent-color: var(--pink); }

.progress {
  position: relative;
  flex: 1;
  min-width: 120px;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  cursor: pointer;
  margin: 0 2px;
}
.progress-buffered { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,0.35); border-radius: 2px; width: 0; }
.progress-played { position: absolute; left: 0; top: 0; bottom: 0; background: var(--pink); border-radius: 2px; width: 0; }
.progress-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}

/* 发送弹幕栏 */
.danmaku-sendbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 10px 12px;
  flex-wrap: wrap;
}
.danmaku-sendbar .ctl-btn { color: var(--text2); font-size: 15px; }
.danmaku-sendbar .ctl-btn:hover { background: #f4f5f7; }
.dm-input {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  outline: none;
}
.dm-input:focus { border-color: var(--pink); }
.dm-colors { display: flex; gap: 5px; align-items: center; }
.dm-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.12s;
}
.dm-color:hover { transform: scale(1.2); }
.dm-color.active { border-color: var(--pink); box-shadow: 0 0 0 2px rgba(251,114,153,0.4); }
.dm-send { background: var(--pink); color: #fff; border: none; border-radius: 6px; padding: 8px 18px; font-size: 14px; }
.dm-send:hover { background: var(--pink-dark); }

/* 弹幕设置栏 */
.danmaku-settings {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 8px 12px;
  flex-wrap: wrap;
}
.dm-set-label { font-size: 13px; color: var(--text2); font-weight: 600; }
.danmaku-settings .ctl-btn { color: var(--text2); font-size: 14px; }
.danmaku-settings .ctl-btn:hover { background: #f4f5f7; }
.danmaku-settings .ctl-select {
  background: #f1f2f3;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 4px;
}
.danmaku-settings .ctl-range { width: 70px; accent-color: var(--pink); }

/* 视频信息 */
.video-title { font-size: 20px; font-weight: 700; line-height: 1.4; margin-bottom: 8px; }
.video-meta { display: flex; align-items: center; gap: 6px; color: var(--text3); font-size: 13px; margin-bottom: 12px; }
.video-meta .sep { color: #ccd0d7; }
.partition-link { color: var(--blue); }
.partition-link:hover { text-decoration: underline; }

.video-actions { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 16px;
  color: var(--text2);
  transition: all 0.15s;
}
.action-btn:hover { color: var(--pink); border-color: var(--pink); }
.action-btn.active { color: var(--pink); border-color: var(--pink); background: #fff3f7; }
.action-icon { font-size: 16px; }

.author-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
}
.author-avatar { display: block; }
.author-info { flex: 1; min-width: 0; }
.author-name { font-weight: 600; }
.author-name:hover { color: var(--pink); }
.author-bio { color: var(--text3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.desc-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.desc-label { font-weight: 600; margin-bottom: 6px; }
.desc-text { color: var(--text2); white-space: pre-wrap; word-break: break-word; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag { color: var(--blue); font-size: 13px; }
.tag:hover { text-decoration: underline; }

/* 侧栏 */
.side-author { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.side-author-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.side-author-name { font-weight: 600; font-size: 16px; }
.side-author-bio { color: var(--text3); font-size: 13px; margin-bottom: 12px; }
.side-related { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.side-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.side-related .video-card { margin-bottom: 12px; }
.side-related .video-card:last-child { margin-bottom: 0; }
.side-related .cover { aspect-ratio: 16 / 9; }
.side-related .title { font-size: 13px; height: 2.7em; }

/* ===================== 评论 ===================== */
.comments-section { margin-top: 24px; }
.comment-input { display: flex; gap: 10px; margin-bottom: 20px; }
.comment-sort { display: flex; gap: 8px; margin-bottom: 12px; }
.comment-sort-btn {
  border: none;
  background: transparent;
  color: var(--text3);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 14px;
}
.comment-sort-btn.active { background: var(--pink); color: #fff; }
.comment-sort-btn:not(.active):hover { color: var(--pink); }
.comment-ta {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  outline: none;
  resize: vertical;
  min-height: 38px;
}
.comment-ta:focus { border-color: var(--pink); }

.comments-list { display: flex; flex-direction: column; gap: 4px; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.comment-name { font-weight: 600; color: var(--text2); }
.comment-name:hover { color: var(--pink); }
.comment-time { color: var(--text3); font-size: 12px; }
.comment-text { word-break: break-word; }
.comment-foot { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.comment-like, .comment-reply-btn {
  border: none;
  background: none;
  color: var(--text3);
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
}
.comment-like:hover, .comment-reply-btn:hover { color: var(--pink); }
.comment-like.active { color: var(--pink); }
.comment-reply { margin-left: 42px; border-left: 2px solid var(--line); padding-left: 14px; }
.comment-empty { color: var(--text3); text-align: center; padding: 30px 0; }
.reply-box { display: flex; gap: 8px; margin-top: 10px; }
.reply-box .comment-ta { min-height: 34px; }

/* ===================== 投稿 ===================== */
.upload-form { max-width: 720px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.form-field { margin-bottom: 18px; }
.form-label { display: block; font-weight: 600; margin-bottom: 6px; }
.file-input { display: block; width: 100%; padding: 8px; border: 1px dashed var(--line); border-radius: 6px; background: #fafbfc; }

/* ===================== 个人主页 ===================== */
.profile-head {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 22px; font-weight: 700; display: flex; align-items: center; }
.uid-badge { font-size: 12px; font-weight: 400; color: var(--text3); background: var(--bg); border: 1px solid var(--line); padding: 1px 8px; border-radius: 10px; margin-left: 10px; }
.profile-bio { color: var(--text3); margin: 4px 0 10px; }
.profile-stats { display: flex; gap: 20px; color: var(--text2); font-size: 13px; }
.profile-actions { display: flex; gap: 10px; }

/* ===================== 排行榜 ===================== */
.rank-list { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rank-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); transition: background 0.12s; }
.rank-row:last-child { border-bottom: none; }
.rank-row:hover { background: #fafbfc; }
.rank-no { width: 28px; text-align: center; font-weight: 700; color: var(--text3); font-size: 16px; flex-shrink: 0; }
.rank-no.top1 { color: #ff4d4f; }
.rank-no.top2 { color: #ff7a45; }
.rank-no.top3 { color: #ffc53d; }
.rank-cover { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.rank-body { flex: 1; min-width: 0; }
.rank-title { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-meta { color: var(--text3); font-size: 12px; margin-top: 4px; }
.rank-val { color: var(--text2); font-size: 13px; flex-shrink: 0; }

/* ===================== 头像 ===================== */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
  user-select: none;
}

/* ===================== 弹窗 ===================== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal {
  width: 380px;
  max-width: 92vw;
  background: #fff;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { border: none; background: none; font-size: 24px; color: var(--text3); line-height: 1; }
.modal-close:hover { color: var(--text); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tab {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  font-size: 14px;
}
.auth-tab.active { background: var(--pink); color: #fff; border-color: var(--pink); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-hint { color: var(--text3); font-size: 12px; text-align: center; }
.hidden { display: none; }

/* ===================== Toast ===================== */
#toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast-item {
  background: rgba(24, 25, 28, 0.92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.2s ease;
}
.toast-success { background: rgba(39, 174, 96, 0.95); }
.toast-error { background: rgba(235, 87, 87, 0.95); }
.toast-warn { background: rgba(242, 153, 74, 0.95); }
.toast-item.out { opacity: 0; transition: opacity 0.3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ===================== 空状态 / 加载 ===================== */
.empty { text-align: center; padding: 80px 20px; color: var(--text3); }
.empty-icon { font-size: 52px; margin-bottom: 12px; }
.empty-text { font-size: 15px; }

.loading { text-align: center; padding: 80px 20px; color: var(--text3); }
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--pink);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== 响应式 ===================== */
@media (max-width: 960px) {
  .play-page { flex-direction: column; }
  .play-side { width: 100%; }
  .topbar-inner { gap: 12px; }
  .nav-link { padding: 6px 8px; }
  .logo-text { display: none; }
  .search { max-width: 220px; }
}
@media (max-width: 640px) {
  #app { padding: 12px; }
  .nav .nav-link[data-link] { display: none; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .player-controls { gap: 4px; padding: 14px 6px 6px; }
  .ctl-range { width: 40px; }
}

/* ===================== 顶栏图标 / 通知 / 主题 ===================== */
.icon-btn { border: none; background: none; font-size: 17px; padding: 6px 8px; border-radius: 6px; cursor: pointer; position: relative; color: var(--text2); }
.icon-btn:hover { background: #f4f5f7; }
body.dark .icon-btn { color: #fff; }
.notif-bell { color: var(--pink); }
body.dark .notif-bell { color: var(--pink); }
.notif-wrap { position: relative; }
.notif-badge {
  position: absolute; top: -2px; right: -4px; background: #ff4d4f; color: #fff;
  font-size: 10px; min-width: 16px; height: 16px; line-height: 16px; text-align: center;
  border-radius: 8px; padding: 0 4px;
}
.notif-panel {
  position: absolute; top: 100%; right: 0; margin-top: 6px; width: 320px; max-height: 420px;
  overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); display: none; z-index: 150;
}
.notif-panel.show { display: block; }
.notif-loading, .notif-empty { padding: 20px; text-align: center; color: var(--text3); }
.notif-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #fafbfc; }
.notif-icon { font-size: 18px; flex-shrink: 0; }
.notif-body { flex: 1; min-width: 0; }
.notif-line { font-size: 13px; }
.notif-video { font-size: 12px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ===================== 播放器错误层 ===================== */
.player-error {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; background: #16171a; color: #fff; text-align: center;
  padding: 20px; z-index: 5;
}
.pe-icon { font-size: 40px; }
.pe-title { font-size: 18px; font-weight: 700; }
.pe-msg { font-size: 13px; color: #b0b3b8; }
.pe-actions { display: flex; gap: 10px; margin-top: 8px; }
.pe-hint { font-size: 12px; color: #7d828a; max-width: 440px; }

/* ===================== 播放页工具栏 ===================== */
.video-toolbar { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.video-toolbar .btn.active { color: var(--pink); border-color: var(--pink); background: #fff3f7; }

/* ===================== 自动连播 ===================== */
.autoplay-overlay {
  position: absolute; right: 16px; bottom: 64px; z-index: 6;
  background: rgba(20, 21, 24, 0.92); color: #fff;
  border-radius: 10px; padding: 14px 16px; width: 300px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.ap-title { font-size: 13px; color: #b0b3b8; margin-bottom: 4px; }
.ap-next {
  display: block; font-size: 15px; font-weight: 600; color: #fff;
  text-decoration: none; margin-bottom: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ap-next:hover { color: var(--pink); }
.ap-count { font-size: 12px; color: #7d828a; margin-bottom: 10px; }
.ap-btns { display: flex; gap: 8px; justify-content: flex-end; }

/* ===================== 全屏模式 ===================== */
body.is-fullscreen { background: #000; }
body.is-fullscreen .topbar,
body.is-fullscreen .video-title,
body.is-fullscreen .video-meta,
body.is-fullscreen .video-toolbar,
body.is-fullscreen .video-actions,
body.is-fullscreen .author-bar,
body.is-fullscreen .desc-box,
body.is-fullscreen .comments-section,
body.is-fullscreen .play-side,
body.is-fullscreen .danmaku-sendbar {
  display: none !important;
}
body.is-fullscreen .play-main { padding: 0; margin: 0; max-width: none; }
body.is-fullscreen .player-stage.fs-mode {
  position: fixed;
  left: 0; top: 0;
  width: 100vw;
  height: 100vh;
  padding-top: 0 !important;
  border-radius: 0;
  z-index: 0;
  background: #000;
}

/* ===================== 转载页 ===================== */
.import-caps { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.caps-ok { background: #e8f8ef; color: #1a7f43; border: 1px solid #b7e4c7; }
.caps-warn { background: #fff7e6; color: #9c6b00; border: 1px solid #ffe1a8; }
.import-tips { margin-top: 20px; padding: 14px; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--text2); line-height: 2; }
.import-tips-title { font-weight: 700; color: var(--text); }

/* ===================== 弹幕屏蔽 ===================== */
.dm-block { font-size: 15px; }
.blocklist-row { display: flex; gap: 8px; margin-bottom: 12px; }
.blocklist-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.blocklist-chip { display: inline-flex; align-items: center; gap: 4px; background: #fff3f7; color: var(--pink); border: 1px solid #ffd0e0; border-radius: 14px; padding: 3px 10px; font-size: 13px; }
.chip-x { cursor: pointer; font-weight: 700; }
.chip-x:hover { color: #ff4d4f; }
.blocklist-empty { color: var(--text3); font-size: 13px; }

/* ===================== 深色模式 ===================== */
body.dark { --bg: #17181c; --card: #1f2126; --text: #eceef1; --text2: #b6bcc4; --text3: #7d848d; --line: #303236; }
body.dark .topbar { background: #1f2126; border-color: #303236; }
body.dark .search { background: #17181c; border-color: #303236; }
body.dark .search input { color: #eceef1; }
body.dark .nav-link:hover, body.dark .dropdown-item:hover, body.dark .icon-btn:hover, body.dark .user-chip:hover { background: #2a2d33; }
body.dark .dropdown-menu, body.dark .user-dropdown, body.dark .notif-panel, body.dark .modal { background: #1f2126; border-color: #303236; color: #eceef1; }
body.dark .video-card, body.dark .zone-item, body.dark .author-bar, body.dark .desc-box,
body.dark .side-author, body.dark .side-related, body.dark .action-btn, body.dark .rank-list,
body.dark .upload-form, body.dark .profile-head, body.dark .danmaku-sendbar, body.dark .chip,
body.dark .sort-btn { background: #1f2126; border-color: #303236; color: #eceef1; }
body.dark .input, body.dark .comment-ta, body.dark .dm-input { background: #17181c; color: #eceef1; }
body.dark .rank-row:hover, body.dark .notif-item:hover { background: #2a2d33; }
body.dark .btn-outline { background: #1f2126; border-color: #40444b; color: #b6bcc4; }
body.dark .auth-tab { background: #17181c; border-color: #303236; color: #eceef1; }
body.dark .auth-tab.active { background: var(--pink); color: #fff; }
body.dark .import-tips { background: #1a1b1f; }
body.dark .action-btn.active, body.dark .video-toolbar .btn.active { background: rgba(249,115,22,.14); }
body.dark .blocklist-chip { background: rgba(249,115,22,.14); }
body.dark .modal-close:hover { color: #fff; }

/* ===================== 回到顶部 ===================== */
#back-top {
  position: fixed; right: 28px; bottom: 32px; z-index: 200;
  width: 42px; height: 42px; border: none; border-radius: 50%;
  background: var(--pink); color: #fff; font-size: 20px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
}
#back-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
#back-top:hover { background: var(--pink-dark); }

/* ===================== SVG 图标 ===================== */
.ico { display: block; }
.ico-wrap { line-height: 0; }
.zone-icon .ico { color: var(--pink); }
.sec-title, .dd-label { display: inline-flex; align-items: center; gap: 6px; }
.sec-title .ico { color: var(--pink); }
.dropdown-item .ico-wrap { color: var(--text2); }
.dropdown-item:hover .ico-wrap { color: var(--pink); }
.chip .ico-wrap { color: var(--text3); }
.chip.active .ico-wrap { color: var(--pink); }
