:root {
  --bg-deep: #070a12;
  --bg-card: rgba(18, 22, 36, 0.85);
  --bg-elevated: #12182a;
  --border: rgba(120, 140, 200, 0.12);
  --text: #e8ebf7;
  --muted: #8b93a8;
  --accent: #5b8cff;
  --accent-2: #7c5cff;
  --radius: 14px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font: "Noto Sans SC", "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* 搜索页：翻页/回顶由脚本或整页跳转触发，避免继承全局 smooth 产生「滑上去」 */
html.sotv-search-scroll {
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(91, 140, 255, 0.18), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(124, 92, 255, 0.12), transparent 45%),
    var(--bg-deep);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.container {
  width: min(1180px, 92vw);
  margin: 0 auto;
}

/* 提交搜索后、页面跳转前：屏幕中央遮罩 + 文案 + 进度，便于察觉 */
#sotv-search-loading {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
}
#sotv-search-loading.is-visible {
  display: flex;
}
.sotv-search-loading-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 18, 0.78);
  backdrop-filter: blur(6px);
}
.sotv-search-loading-panel {
  position: relative;
  z-index: 1;
  width: min(360px, 100%);
  padding: 1.75rem 1.5rem 1.6rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.sotv-search-loading-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  border: 3px solid rgba(91, 140, 255, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: sotv-search-spin 0.7s linear infinite;
}
@keyframes sotv-search-spin {
  to {
    transform: rotate(360deg);
  }
}
.sotv-search-loading-text {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.sotv-search-loading-hint {
  margin: 0 0 1.15rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}
.sotv-search-loading-bar {
  position: relative;
  height: 4px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(91, 140, 255, 0.15);
}
.sotv-search-loading-bar span {
  position: absolute;
  left: -40%;
  top: 0;
  height: 100%;
  width: 40%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: sotv-search-bar-move 1.15s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes sotv-search-bar-move {
  0% {
    left: -40%;
  }
  100% {
    left: 100%;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 10, 18, 0.72);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 0;
  min-width: 0;
}

.logo {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  background: linear-gradient(120deg, #fff, #a8b8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
}
/* 全局 a:hover 会加下划线，需覆盖 logo 链接 */
.logo:hover,
.logo:focus-visible {
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
  justify-content: flex-end;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar {
  display: none;
}

/* 顶栏导航：不用下划线；椭圆蒙层仅在悬停 / 键盘聚焦时显示 */
.nav a {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav a:not(.btn-nav) {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: transparent;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.nav a:not(.btn-nav):hover,
.nav a:not(.btn-nav):focus-visible {
  color: var(--text);
  text-decoration: none;
  background: rgba(91, 140, 255, 0.14);
}
.nav a:not(.btn-nav):focus:not(:focus-visible) {
  outline: none;
}

/* 当前页仅略提亮文字，不出现蒙层。首页链接需排除 user/index.php（否则 href 子串 index.php 会误匹配） */
body.page-home .nav > a[href*="index.php"]:not([href*="user/"]):not(.btn-nav),
body.page-user-center .nav > a[href*="user/index"]:not(.btn-nav) {
  color: var(--text);
}

.btn-nav {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff !important;
  font-weight: 600;
}
.btn-nav:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

/* 播放页顶栏：搜索紧挨「观看记录」；桌面内联 / 移动端「搜索」按钮展开 */
body.page-play .nav--play-with-search {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}
body.page-play .header-play-search-slot {
  position: relative;
  flex-shrink: 0;
  margin-right: 0.15rem;
}
body.page-play .header-play-search-toggle {
  display: none;
}
body.page-play .header-play-search {
  position: relative;
  max-width: min(36vw, 280px);
  margin: 0;
}
body.page-play .header-play-search .search-bar--header-mini {
  padding: 0.28rem 0.4rem;
  gap: 0.35rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
body.page-play .header-play-search .search-bar--header-mini input[type="search"] {
  font-size: 0.88rem;
  padding: 0.35rem 0.55rem;
  min-width: 0;
}
body.page-play .header-play-search .search-bar--header-mini button {
  padding: 0.38rem 0.85rem;
  font-size: 0.82rem;
  flex-shrink: 0;
}

/*
 * 播放页中窄屏：顶栏改为两行（品牌 | 工具栏），避免单行里 Logo 与「搜索」抢宽重叠。
 * 断点宽于「仅搜索按钮」模式，平板竖屏同样适用。
 */
@media (max-width: 960px) {
  body.page-play .header-inner {
    flex-wrap: wrap;
    align-items: center;
    row-gap: 0.65rem;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }
  body.page-play .logo {
    flex: 0 0 auto;
    max-width: calc(100% - 0.5rem);
    position: relative;
    z-index: 2;
  }
  body.page-play .nav--play-with-search {
    flex: 1 1 100%;
    min-width: 0;
    justify-content: flex-start;
    gap: 0.4rem;
    padding-top: 0.55rem;
    margin: 0;
    border-top: 1px solid rgba(120, 130, 180, 0.12);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  body.page-play .nav--play-with-search::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 768px) {
  body.page-play .header-play-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.85rem;
    min-height: 2.25rem;
    border-radius: 999px;
    border: 1px solid rgba(120, 140, 200, 0.25);
    background: rgba(91, 140, 255, 0.12);
    color: var(--text);
    font-weight: 500;
    font-size: 0.88rem;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
  }
  body.page-play .header-play-search-toggle:hover {
    background: rgba(91, 140, 255, 0.2);
  }
  body.page-play .header-play-search-slot:not(.is-open) .header-play-search {
    display: none;
  }
  body.page-play .header-play-search-slot.is-open .header-play-search {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 60;
    max-width: none;
    margin: 0;
    padding: 0.65rem 1rem 0.85rem;
    padding-top: calc(0.55rem + env(safe-area-inset-top, 0px));
    background: rgba(7, 10, 18, 0.98);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  }
  body.page-play .header-play-search-slot.is-open .header-play-search .search-bar--header-mini {
    max-width: min(1180px, 92vw);
    margin: 0 auto;
  }
}

@media (max-width: 420px) {
  .logo {
    font-size: 1.15rem;
    letter-spacing: 0.04em;
  }
  .nav {
    gap: 0.25rem;
  }
  .nav a:not(.btn-nav) {
    padding: 0.35rem 0.55rem;
  }
  .btn-nav {
    padding: 0.38rem 0.75rem;
    font-size: 0.92rem;
  }
}

/* 观看历史弹窗（导航「观看记录」） */
.sotv-watch-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
.sotv-watch-modal[hidden] {
  display: none !important;
}
.sotv-watch-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 18, 0.72);
  backdrop-filter: blur(6px);
}
.sotv-watch-modal__panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(560px, 90vh);
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sotv-watch-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sotv-watch-modal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #e85555;
  letter-spacing: 0.02em;
}
.sotv-watch-modal__close {
  margin: 0;
  padding: 0 0.35rem;
  border: none;
  background: transparent;
  color: #e85555;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
}
.sotv-watch-modal__close:hover {
  background: rgba(232, 85, 85, 0.12);
}
.sotv-watch-modal__body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0 0.25rem;
  display: flex;
  flex-direction: column;
}
.sotv-watch-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  /* 约 6 条记录高度，超出出现纵向滚动条 */
  max-height: min(24rem, 52vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 1;
  /* PC 端：与深色面板协调的滚动条（Firefox） */
  scrollbar-width: thin;
  scrollbar-color: rgba(115, 125, 165, 0.65) rgba(12, 16, 28, 0.65);
}
.sotv-watch-modal__list::-webkit-scrollbar {
  width: 8px;
}
.sotv-watch-modal__list::-webkit-scrollbar-track {
  background: rgba(10, 14, 26, 0.75);
  border-radius: 6px;
}
.sotv-watch-modal__list::-webkit-scrollbar-thumb {
  background: rgba(95, 105, 140, 0.55);
  border-radius: 6px;
}
.sotv-watch-modal__list::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 130, 175, 0.72);
}
.sotv-watch-modal__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
.sotv-watch-modal__item:last-child {
  border-bottom: none;
}
.sotv-watch-modal__link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
}
.sotv-watch-modal__link:hover {
  text-decoration: none;
  color: var(--accent);
}
.sotv-watch-modal__info {
  min-width: 0;
  flex: 1;
}
.sotv-watch-modal__name {
  font-size: 0.95rem;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.sotv-watch-modal__source {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
  word-break: break-word;
}
.sotv-watch-modal__time {
  flex-shrink: 0;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}
.sotv-watch-modal__del {
  flex-shrink: 0;
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: #c23a3a;
  color: #fff;
  font-weight: 600;
}
.sotv-watch-modal__del:hover {
  filter: brightness(1.08);
}
.sotv-watch-modal__empty {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.95rem;
}
.sotv-watch-modal__foot {
  flex-shrink: 0;
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--border);
}
.sotv-watch-modal__clear {
  width: 100%;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #d64545, #b83232);
  color: #fff;
}
.sotv-watch-modal__clear:hover {
  filter: brightness(1.06);
}

/* 全站弹窗公告（z-index 低于观看历史弹窗 10050） */
.sotv-announce-modal {
  position: fixed;
  inset: 0;
  z-index: 10045;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
.sotv-announce-modal[hidden] {
  display: none !important;
}
.sotv-announce-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 18, 0.78);
  backdrop-filter: blur(5px);
}
.sotv-announce-modal__panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: min(72vh, 520px);
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sotv-announce-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sotv-announce-modal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #e85555;
  letter-spacing: 0.02em;
}
.sotv-announce-modal__close {
  margin: 0;
  padding: 0 0.35rem;
  border: none;
  background: transparent;
  color: #e85555;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
}
.sotv-announce-modal__close:hover {
  background: rgba(232, 85, 85, 0.12);
}
.sotv-announce-modal__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.15rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: rgba(115, 125, 165, 0.65) rgba(12, 16, 28, 0.65);
}
.sotv-announce-modal__body::-webkit-scrollbar {
  width: 8px;
}
.sotv-announce-modal__body::-webkit-scrollbar-track {
  background: rgba(10, 14, 26, 0.75);
  border-radius: 6px;
}
.sotv-announce-modal__body::-webkit-scrollbar-thumb {
  background: rgba(95, 105, 140, 0.55);
  border-radius: 6px;
}
.sotv-announce-modal__foot {
  flex-shrink: 0;
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--border);
}
.sotv-announce-modal__ok,
.btn-announce-ok {
  width: 100%;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.sotv-announce-modal__ok:hover,
.btn-announce-ok:hover {
  filter: brightness(1.06);
}

.main-content {
  padding: 2rem 0 4rem;
}

.hero {
  text-align: center;
  padding: 3rem 0 2.5rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: 0.02em;
}

.hero p {
  color: var(--muted);
  margin: 0 0 2rem;
  font-size: 1.05rem;
}

/* 首页：热搜 — 桌面约 10 列一行；移动端 ≤640px 为 5 列（10 条占两行，海报更大） */
.hot-board-wrap {
  --hot-board-max-width: 1100px;
  --hot-heading-size: 1.12rem;
  --hot-title-size: 0.78rem;
  --hot-poster-radius: 10px;
  --hot-gap-row: 0.5rem;
  --hot-gap-col: 0.32rem;
  --hot-pic-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);

  margin: 2.25rem auto 0;
  max-width: min(var(--hot-board-max-width), 100%);
  text-align: left;
}
.hot-board-block--movie {
  margin-top: 1.35rem;
}
.hot-board-heading {
  font-size: var(--hot-heading-size);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.4rem;
}
.hot-board-source {
  font-size: 0.78rem;
  margin: 0 0 0.75rem;
}
.hot-board-track {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: var(--hot-gap-row) var(--hot-gap-col);
  padding: 0.1rem 0 0.15rem;
  overflow: visible;
}
.hot-board-card {
  min-width: 0;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hot-board-card:hover {
  transform: translateY(-3px);
  text-decoration: none;
  color: var(--text);
}
.hot-board-pic-wrap {
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: var(--hot-poster-radius);
  overflow: hidden;
  background: #1a2035;
  border: 1px solid var(--border);
  margin-bottom: 0.32rem;
  box-shadow: var(--hot-pic-shadow);
}
.hot-board-pic-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hot-board-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: var(--hot-title-size);
  line-height: 1.35;
  text-align: center;
  word-break: break-word;
}

@media (min-width: 1200px) {
  .hot-board-wrap {
    --hot-board-max-width: 1180px;
    --hot-heading-size: 1.18rem;
    --hot-title-size: 0.85rem;
  }
}

@media (max-width: 640px) {
  .hot-board-track {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .hot-board-wrap {
    --hot-title-size: 0.82rem;
    --hot-gap-col: 0.38rem;
    --hot-gap-row: 0.6rem;
    margin-top: 1.75rem;
  }
}

.search-bar-wrap {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  box-shadow: var(--shadow);
}

.search-bar input[type="search"] {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  padding: 0.65rem 0.85rem;
  outline: none;
}

.search-bar button {
  border: none;
  border-radius: calc(var(--radius) - 4px);
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

/* 空关键词校验：插在 .search-bar 与联想框之间，由 app.js 注入 */
.sotv-search-q-error {
  margin: 0.4rem 0 0;
  padding: 0 0.25rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #ff9a9a;
}
.search-bar input[type="search"].sotv-search-q-invalid {
  box-shadow: inset 0 0 0 1px rgba(255, 120, 120, 0.45);
  border-radius: calc(var(--radius) - 6px);
}

/* 无结果：与搜索条同宽、紧贴搜索区域下方居中 */
.search-empty-hint {
  max-width: 640px;
  margin: 0.75rem auto 2rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* PC：单行展示不换行（过长时可横向滚动） */
@media (min-width: 769px) {
  .search-empty-hint {
    max-width: none;
    width: 100%;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
}

.suggest-box {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: none;
  /* 约 6 条搜索历史高度，超出出现纵向滚动条 */
  max-height: calc(6 * 2.55rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 200;
  box-shadow: var(--shadow);
  color: var(--text);
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: rgba(115, 125, 165, 0.65) rgba(12, 16, 28, 0.65);
}
.suggest-box::-webkit-scrollbar {
  width: 8px;
}
.suggest-box::-webkit-scrollbar-track {
  background: rgba(10, 14, 26, 0.75);
  border-radius: 6px;
}
.suggest-box::-webkit-scrollbar-thumb {
  background: rgba(95, 105, 140, 0.55);
  border-radius: 6px;
}
.suggest-box::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 130, 175, 0.72);
}

.suggest-box.open {
  display: block;
}

/* 搜索历史（本地）：左关键词、右删除 */
.suggest-history-empty {
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.suggest-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.suggest-history-item:last-child {
  border-bottom: none;
}

.suggest-history-text {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  font-size: 0.92rem;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suggest-history-item:hover,
.suggest-history-active {
  background: rgba(91, 140, 255, 0.1);
}

.suggest-history-del {
  flex-shrink: 0;
  border: none;
  border-radius: 6px;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  background: #e53935;
  color: #fff;
}
.suggest-history-del:hover {
  filter: brightness(1.08);
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card-pic {
  aspect-ratio: 2/3;
  background: #1a2035;
  overflow: hidden;
}
.card-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 0.75rem 0.85rem 1rem;
}

.card-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.card-meta .api-tag {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(91, 140, 255, 0.12);
  border: 1px solid rgba(91, 140, 255, 0.25);
  vertical-align: middle;
}

/* 搜索结果：横版列表（左图右文） */
.search-result-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.search-result-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.85rem 1rem;
  padding: 1rem 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.85rem;
  transition: box-shadow 0.2s;
}
.search-result-item:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

/* 固定 2:3 竖版封面，放大显示；cover 裁剪避免拉伸变形 */
.sr-poster {
  flex-shrink: 0;
  width: 156px;
  aspect-ratio: 2 / 3;
  height: auto;
  border-radius: 10px;
  overflow: hidden;
  background: #1a2035;
  align-self: flex-start;
}
.sr-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
img.sotv-poster-img {
  background: #1a2035;
}
.sr-poster-empty {
  width: 100%;
  height: 100%;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.5rem;
  text-align: center;
}

.sr-main {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.sr-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: #ff5252;
  text-decoration: none;
  margin: 0 0 0.5rem;
  letter-spacing: 0.02em;
}
.sr-title:hover {
  text-decoration: underline;
  color: #ff8a80;
}

.sr-line {
  margin-bottom: 0.35rem;
}
.sr-label {
  color: var(--muted);
  font-size: 0.88rem;
}
.sr-label-accent {
  color: #ff5252;
  font-weight: 600;
}
.sr-value {
  color: #c5cbe0;
  font-size: 0.88rem;
}

.sr-actors-line {
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
}
.sr-actors {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 类型/上映、地区/更新：两列对齐，右列右对齐 */
.sr-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 0.85rem;
  row-gap: 0.4rem;
  margin-bottom: 0.35rem;
}
.sr-meta-cell {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.35rem;
}
.sr-meta-cell .sr-label {
  flex-shrink: 0;
}
.sr-meta-cell .sr-value {
  min-width: 0;
  word-break: break-word;
}
.sr-meta-cell--tr {
  justify-content: flex-end;
  text-align: right;
}
.sr-meta-cell--tr .sr-value {
  text-align: right;
}

.sr-source-line {
  margin-top: 0.15rem;
  margin-bottom: 0.25rem;
}

.sr-blurb {
  margin-top: 0.35rem;
}
.sr-blurb .sr-label {
  display: block;
  margin-bottom: 0.2rem;
}
.sr-blurb-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  white-space: normal;
}

.search-list-ad {
  margin: 0.5rem 0 1rem;
}

.search-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  margin: 1.75rem 0 0.5rem;
  padding: 1rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.search-pagination .pagination-link {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(91, 140, 255, 0.35);
  border-radius: 8px;
  background: rgba(91, 140, 255, 0.08);
  transition: background 0.15s, border-color 0.15s;
}
.search-pagination .pagination-link:hover:not(.is-disabled) {
  background: rgba(91, 140, 255, 0.18);
  border-color: rgba(91, 140, 255, 0.55);
}
.search-pagination .pagination-link.is-disabled {
  color: var(--muted);
  border-color: var(--border);
  background: transparent;
  cursor: not-allowed;
  opacity: 0.65;
}
.search-pagination .pagination-info {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0 0.35rem;
}

.search-pagination .pagination-num {
  min-width: 2.25rem;
  text-align: center;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.search-pagination .pagination-num.is-current {
  color: var(--text);
  background: rgba(91, 140, 255, 0.22);
  border-color: rgba(91, 140, 255, 0.5);
  cursor: default;
  font-weight: 600;
}

.search-pagination .pagination-jump {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.search-pagination .pagination-jump-label {
  font-size: 0.88rem;
  color: var(--muted);
  white-space: nowrap;
}

.search-pagination .pagination-jump-input {
  width: 4.25rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  box-sizing: border-box;
}

.search-pagination .pagination-jump-input:focus {
  outline: none;
  border-color: rgba(91, 140, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(91, 140, 255, 0.15);
}

.search-pagination .pagination-jump-btn {
  cursor: pointer;
}

@media (max-width: 640px) {
  .search-result-item {
    flex-direction: column;
    align-items: center;
    text-align: left;
  }
  .sr-poster {
    width: 168px;
  }
  .sr-main {
    width: 100%;
  }
  .sr-meta-grid {
    grid-template-columns: 1fr;
    row-gap: 0.35rem;
  }
  .sr-meta-cell--tr {
    justify-content: flex-start;
    text-align: left;
  }
  .sr-meta-cell--tr .sr-value {
    text-align: left;
  }
}

/* 搜索页：搜索框下方、温馨提示居中 */
.search-page-tip {
  text-align: center;
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.55;
}

.page-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-title-row h1 {
  margin: 0;
  font-size: 1.5rem;
}

.muted {
  color: var(--muted);
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 720px) {
  .detail-hero {
    grid-template-columns: 1fr;
  }
}

.detail-poster {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.detail-poster img {
  width: 100%;
  display: block;
}

.detail-info h1 {
  margin: 0 0 1rem;
  font-size: 1.65rem;
}

.meta-list {
  display: grid;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.meta-list strong {
  color: var(--text);
  font-weight: 500;
}

.blurb {
  color: var(--muted);
  line-height: 1.75;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff !important;
}
.btn:hover {
  filter: brightness(1.06);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text) !important;
}

.btn-danger {
  background: linear-gradient(135deg, #c23a3a, #9a2a2a) !important;
  color: #fff !important;
}
.btn-danger:hover {
  filter: brightness(1.08);
}

.admin-feedback-list-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  white-space: normal;
}
.admin-feedback-list-del-form {
  display: inline;
  margin: 0;
}
.admin-feedback-list-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
}

.ad-slot {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.ad-slot ins,
.ad-slot iframe {
  max-width: 100%;
}

.player-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16/9;
}

.player-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.episode-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.episode-pill {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.88rem;
  text-decoration: none;
}
.episode-pill:hover,
.episode-pill.is-active {
  border-color: var(--accent);
  background: rgba(91, 140, 255, 0.15);
  text-decoration: none;
}

/* 详情 / 播放页：多线路 + 分集网格 */
.play-list-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.play-list-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text);
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.play-source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.play-source-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.play-source-tab:hover {
  color: var(--text);
  border-color: rgba(91, 140, 255, 0.45);
}

.play-source-tab.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

.play-ep-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.play-ep-grid.is-collapsed {
  max-height: 10rem;
  overflow: hidden;
  position: relative;
}

.play-ep-grid.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5rem;
  background: linear-gradient(transparent, var(--bg-deep));
  pointer-events: none;
}

.play-ep-pill {
  padding: 0.42rem 0.72rem;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.86rem;
  text-decoration: none;
  min-width: 3.2rem;
  text-align: center;
}

.play-ep-pill:hover,
.play-ep-pill.is-active {
  border-color: var(--accent);
  background: rgba(91, 140, 255, 0.18);
  text-decoration: none;
}

.play-expand-btn {
  display: block;
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: rgba(91, 140, 255, 0.06);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.play-expand-btn:hover {
  background: rgba(91, 140, 255, 0.12);
}

/* —— 播放页：左播放器 + 右选集 —— */
.container--play {
  width: min(1280px, 94vw);
}

.play-page-layout {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 320px);
  gap: 1.25rem 1.5rem;
  align-items: start;
}

.play-main {
  min-width: 0;
}

.player-wrap--play {
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.play-disclaimer {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.85rem 0 0;
  line-height: 1.55;
}

.play-ep-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  margin-top: 1rem;
}

.play-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* 上一集 / 下一集：同款描边按钮，避免一暗一亮 */
.play-nav-btn--prev,
.play-nav-btn--next {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  color: var(--text);
}
.play-nav-btn--prev:hover:not(.is-disabled),
.play-nav-btn--next:hover:not(.is-disabled) {
  background: rgba(91, 140, 255, 0.12);
  border-color: rgba(91, 140, 255, 0.38);
  color: #f0f3ff;
}

.play-nav-btn.is-disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.play-ep-nav-title {
  text-align: center;
  padding: 0.65rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

/* 右侧栏：与全站深色卡片统一；桌面端高度由 play-progress.js 与左侧 .play-main 对齐 */
.play-sidebar {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
  align-self: start;
}

.play-line-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  flex-shrink: 0;
}

.play-line-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
}

.play-line-label::after {
  content: "：";
}

.play-line-select-wrap {
  flex: 1;
  min-width: 0;
}

.play-line-select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}
.play-line-select:focus {
  outline: none;
  border-color: rgba(91, 140, 255, 0.45);
  box-shadow: 0 0 0 2px rgba(91, 140, 255, 0.15);
}
.play-line-select option {
  background: var(--bg-elevated);
  color: var(--text);
}

.play-sidebar-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  flex-shrink: 0;
}

.play-sidebar-icon {
  font-size: 1rem;
  color: var(--muted);
}

.play-sidebar-count {
  font-weight: 600;
  color: var(--muted);
}

.play-ep-grid-sidebar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-content: start;
  overflow-y: auto;
  flex: 1 1 0;
  min-height: 0;
  padding: 2px 4px 2px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 140, 255, 0.35) transparent;
}

.play-ep-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.35rem 0.2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.play-ep-cell:hover {
  border-color: rgba(91, 140, 255, 0.35);
  background: rgba(91, 140, 255, 0.08);
}

.play-ep-cell.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 18px rgba(91, 140, 255, 0.28);
}

.play-ep-cell.is-active::after {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.58rem;
  color: #ffe082;
  font-weight: 800;
  line-height: 1;
  z-index: 2;
}

/* 已看过（非当前集）：绿色描边 + 角标 */
.play-ep-pill--track {
  position: relative;
}

.play-ep-cell.is-played:not(.is-active),
.play-ep-pill.is-played:not(.is-active) {
  border-color: rgba(129, 199, 132, 0.55) !important;
  background: rgba(129, 199, 132, 0.07) !important;
  color: #c8e6c9;
}

.play-ep-cell.is-played:not(.is-active)::before,
.play-ep-pill.is-played:not(.is-active)::before {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.52rem;
  color: #81c784;
  font-weight: 800;
  line-height: 1;
  z-index: 1;
}

@media (max-width: 960px) {
  .play-page-layout {
    grid-template-columns: 1fr;
  }
  /* 窄屏侧栏无固定高度，flex:1 1 0 会导致集数网格高度为 0；改为按内容撑开 */
  .play-sidebar {
    position: static;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
  .play-ep-grid-sidebar {
    flex: none;
    min-height: auto;
    max-height: 360px;
    overflow-y: auto;
  }
}

/* 用户中心：顶栏标签，单页切换 */
.user-center {
  padding-bottom: 2rem;
}
.user-center-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.user-center-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.user-center-tab:hover {
  color: var(--text);
  border-color: rgba(91, 140, 255, 0.35);
}
.user-center-tab.is-active {
  color: #f0f3ff;
  background: rgba(91, 140, 255, 0.14);
  border-color: rgba(91, 140, 255, 0.4);
}
.user-panel[hidden] {
  display: none !important;
}
.user-center .user-center-form-panel {
  margin: 0 auto 1rem;
  max-width: 420px;
}
.user-center .user-center-form-panel--wide {
  max-width: 640px;
}

.user-search-sources-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
  align-items: start;
}
.user-search-sources-item {
  min-width: 0;
}
.user-search-sources-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  margin: 0;
  line-height: 1.5;
}
.user-search-sources-check {
  flex-shrink: 0;
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0;
  accent-color: var(--accent);
}
.user-search-sources-name {
  min-width: 0;
  word-break: break-word;
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 用户中心 · 留言反馈对话（列表限高 + 底部输入区固定，避免发送按钮被顶出屏外） */
.user-feedback-chat-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 560px;
  margin: 0 auto;
  max-height: min(72vh, 520px);
  min-height: 0;
}
.user-feedback-list {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(38vh, 260px);
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  scrollbar-width: thin;
  scrollbar-color: rgba(115, 125, 165, 0.65) rgba(12, 16, 28, 0.65);
}
.user-feedback-compose {
  flex: 0 0 auto;
}
.user-feedback-list::-webkit-scrollbar {
  width: 8px;
}
.user-feedback-list::-webkit-scrollbar-track {
  background: rgba(10, 14, 26, 0.75);
  border-radius: 6px;
}
.user-feedback-list::-webkit-scrollbar-thumb {
  background: rgba(95, 105, 140, 0.55);
  border-radius: 6px;
}
.user-feedback-msg {
  margin-bottom: 0.85rem;
  max-width: 92%;
}
.user-feedback-msg:last-child {
  margin-bottom: 0;
}
.user-feedback-msg--user {
  margin-left: auto;
  text-align: right;
}
.user-feedback-msg--admin {
  margin-right: auto;
  text-align: left;
}
.user-feedback-msg__meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.user-feedback-msg__body {
  display: inline-block;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.user-feedback-msg--user .user-feedback-msg__body {
  background: rgba(91, 140, 255, 0.22);
  border: 1px solid rgba(91, 140, 255, 0.35);
  color: var(--text);
}
.user-feedback-msg--admin .user-feedback-msg__body {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
}
.user-feedback-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  resize: vertical;
  min-height: 4.25rem;
  max-height: 8rem;
}

/* 管理后台 · 留言对话（用户左、管理员右） */
.admin-feedback-thread {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-sizing: border-box;
  max-width: 640px;
  height: 400px;
  max-height: min(58vh, 520px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  scrollbar-width: thin;
  scrollbar-color: rgba(115, 125, 165, 0.65) rgba(12, 16, 28, 0.65);
}
.admin-feedback-thread::-webkit-scrollbar {
  width: 8px;
}
.admin-feedback-thread::-webkit-scrollbar-track {
  background: rgba(10, 14, 26, 0.75);
  border-radius: 6px;
}
.admin-feedback-thread::-webkit-scrollbar-thumb {
  background: rgba(95, 105, 140, 0.55);
  border-radius: 6px;
}
.admin-feedback-thread::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 130, 175, 0.72);
}
.admin-feedback-msg {
  max-width: min(90%, 26rem);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.admin-feedback-msg--user {
  align-self: flex-start;
  text-align: left;
}
.admin-feedback-msg--admin {
  align-self: flex-end;
  text-align: right;
}
.admin-feedback-msg__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}
.admin-feedback-msg--admin .admin-feedback-msg__head {
  justify-content: flex-end;
  flex-wrap: wrap;
}
.admin-feedback-msg__del-form {
  margin: 0;
  flex-shrink: 0;
}
.admin-feedback-del-btn {
  padding: 0.22rem 0.55rem;
  font-size: 0.76rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(194, 58, 58, 0.28);
  color: #f0b0b0;
  font-weight: 600;
  font: inherit;
}
.admin-feedback-del-btn:hover {
  background: rgba(194, 58, 58, 0.48);
  color: #fff;
}
.admin-feedback-msg__meta {
  font-size: 0.82rem;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}
.admin-feedback-msg--admin .admin-feedback-msg__meta {
  flex: 0 1 auto;
}
.admin-feedback-msg__body {
  display: inline-block;
  max-width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
  box-sizing: border-box;
  vertical-align: top;
}
.admin-feedback-msg--user .admin-feedback-msg__body {
  background: rgba(91, 140, 255, 0.12);
  border: 1px solid rgba(91, 140, 255, 0.28);
}
.admin-feedback-msg--admin .admin-feedback-msg__body {
  background: rgba(124, 92, 255, 0.14);
  border: 1px solid rgba(124, 92, 255, 0.32);
}

/* 用户中心 · 搜索记录 / 观看记录表格（桌面横向；移动端见下方 media） */
.user-center-table-wrap {
  -webkit-overflow-scrolling: touch;
}
.user-center-table-wrap table.user-search-history-table,
.user-center-table-wrap table.user-watch-history-table {
  width: 100%;
}
.user-search-history-table td:first-child {
  word-break: normal;
  overflow-wrap: anywhere;
}
.user-search-history-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.user-search-history-th-go,
.user-search-history-go {
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
  min-width: 4.75rem;
  width: auto;
}
.user-search-history-go .btn {
  padding: 0.38rem 0.85rem;
  font-size: 0.86rem;
  white-space: nowrap;
  display: inline-block;
  box-sizing: border-box;
  min-width: 3.25rem;
  text-align: center;
}
.user-watch-history-table th,
.user-watch-history-table td {
  word-break: normal;
  overflow-wrap: anywhere;
}
.user-watch-history-table td:nth-child(3) {
  max-width: 14rem;
}
.user-watch-history-table td:last-child {
  white-space: nowrap;
  width: 1%;
}
.user-watch-resume-cell {
  vertical-align: middle;
}
.user-watch-resume-btn {
  padding: 0.38rem 0.95rem;
  font-size: 0.86rem;
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
}

@media (max-width: 640px) {
  .user-center .user-center-table-wrap {
    overflow-x: visible;
  }
  /* 移动端：卡片式纵向排列，不再横向滑动 */
  .user-center .user-search-history-table,
  .user-center .user-watch-history-table {
    border-collapse: separate;
    border-spacing: 0;
  }
  .user-center .user-search-history-table thead,
  .user-center .user-watch-history-table thead {
    display: none;
  }
  .user-center .user-search-history-table tbody,
  .user-center .user-watch-history-table tbody {
    display: block;
  }

  /* 搜索记录：首行关键词，次行左侧时间 + 右侧搜索 */
  .user-center .user-search-history-table tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.85rem 0.65rem;
    margin: 0;
    border-bottom: 1px solid var(--border);
  }
  .user-center .user-search-history-table tbody td {
    display: block;
    border: none;
    padding: 0;
  }
  .user-center .user-search-history-table tbody td:first-child {
    flex: 0 0 100%;
    width: 100%;
    font-size: 0.95rem;
    line-height: 1.45;
  }
  .user-center .user-search-history-table tbody td.user-search-history-time {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    font-size: 0.82rem;
  }
  .user-center .user-search-history-table tbody td.user-search-history-go {
    flex: 0 0 auto;
    min-width: 0;
    text-align: right;
  }

  /* 观看记录：影片 → 播放源 → 集数 → 底部时间与继续看 */
  .user-center .user-watch-history-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.4rem 0.75rem;
    align-items: start;
    padding: 0.85rem 0.65rem;
    margin: 0;
    border-bottom: 1px solid var(--border);
  }
  .user-center .user-watch-history-table tbody td {
    display: block;
    border: none;
    padding: 0;
    max-width: none !important;
  }
  .user-center .user-watch-history-table tbody td:nth-child(1) {
    grid-column: 1 / -1;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.45;
  }
  .user-center .user-watch-history-table tbody td:nth-child(3) {
    grid-column: 1 / -1;
    font-size: 0.88rem;
    line-height: 1.45;
  }
  .user-center .user-watch-history-table tbody td:nth-child(2) {
    grid-column: 1 / -1;
    font-size: 0.88rem;
    line-height: 1.45;
  }
  .user-center .user-watch-history-table tbody td:nth-child(4) {
    grid-column: 1;
    min-width: 0;
    font-size: 0.8rem;
    align-self: center;
  }
  .user-center .user-watch-history-table tbody td:nth-child(5) {
    grid-column: 2;
    justify-self: end;
    align-self: center;
    width: auto !important;
  }

  .user-center .user-search-history-table tbody tr.user-history-empty,
  .user-center .user-watch-history-table tbody tr.user-history-empty {
    display: block;
  }
  .user-center .user-search-history-table tbody tr.user-history-empty td,
  .user-center .user-watch-history-table tbody tr.user-history-empty td {
    display: block;
    width: 100%;
    text-align: center;
    padding: 1.25rem 0.5rem;
    font-size: 0.88rem;
  }
}

.form-panel {
  max-width: 420px;
  margin: 2rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.form-panel h2 {
  margin: 0 0 1.25rem;
  text-align: center;
}

.form-row {
  margin-bottom: 1rem;
}

.form-row label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1rem;
}

/* 复选框/单选勿用全宽，否则与文字严重错位 */
.form-row input[type="checkbox"],
.form-row input[type="radio"] {
  width: auto;
  max-width: none;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.form-row label:has(> input[type="checkbox"]),
.form-row label:has(> input[type="radio"]) {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  line-height: 1.5;
}

.form-row label:has(> input[type="checkbox"]) > input[type="checkbox"],
.form-row label:has(> input[type="radio"]) > input[type="radio"] {
  margin-top: 0.28em;
}

.form-row textarea {
  min-height: 100px;
  resize: vertical;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}
.alert-error {
  background: rgba(255, 80, 80, 0.12);
  border: 1px solid rgba(255, 80, 80, 0.35);
  color: #ffb4b4;
}
.alert-ok {
  background: rgba(80, 200, 120, 0.12);
  border: 1px solid rgba(80, 200, 120, 0.35);
  color: #b8f0c8;
}

.table-wrap {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.data th,
table.data td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table.data th {
  color: var(--muted);
  font-weight: 600;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
}

.admin-side {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 1.5rem;
}

.admin-side a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--muted);
  border-radius: 8px;
  margin-bottom: 0.25rem;
  text-decoration: none;
}
.admin-side a:hover,
.admin-side a.active {
  background: rgba(91, 140, 255, 0.12);
  color: var(--text);
}

.admin-main {
  padding: 1.5rem 2rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.stat-card .num {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0.25rem 0 0;
}

.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}
.site-footer-content {
  max-width: min(52rem, 100%);
  margin: 0 auto;
}
.site-footer-line {
  margin: 0;
}
.site-footer-disclaimer {
  font-size: 0.82rem;
  line-height: 1.65;
}
.site-footer-brand {
  margin-top: 0.65rem;
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}
.site-footer-nav {
  font-size: 0.86rem;
}
.site-footer-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0 0.2rem;
}
.site-footer-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.site-footer-dot {
  display: inline-block;
  padding: 0 0.15rem;
  color: var(--muted);
  opacity: 0.75;
  user-select: none;
}

/* 全站前台：页脚固定在视口底部浮动条（原仅首页，现与所有使用 includes/header+footer 的页面一致） */
body .site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  padding: 0.55rem 1rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
  margin: 0;
  border-top: 1px solid var(--border);
  background: rgba(7, 10, 18, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.35);
}
body .site-footer-disclaimer {
  font-size: 0.75rem;
  line-height: 1.5;
}
body .site-footer-brand {
  margin-top: 0.35rem;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
}
body .site-footer-nav {
  font-size: 0.78rem;
}
body .main-content {
  padding-bottom: calc(4rem + 7rem);
}

/* 搜索 / 详情 / 播放：页脚不固定，随页面滚动 */
body.page-search .site-footer,
body.page-detail .site-footer,
body.page-play .site-footer {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  padding: 2rem 0;
  margin: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}
body.page-search .site-footer-disclaimer,
body.page-detail .site-footer-disclaimer,
body.page-play .site-footer-disclaimer {
  font-size: 0.82rem;
  line-height: 1.65;
}
body.page-search .site-footer-brand,
body.page-detail .site-footer-brand,
body.page-play .site-footer-brand {
  margin-top: 0.65rem;
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
}
body.page-search .site-footer-nav,
body.page-detail .site-footer-nav,
body.page-play .site-footer-nav {
  font-size: 0.86rem;
}
body.page-search .main-content,
body.page-detail .main-content,
body.page-play .main-content {
  padding: 2rem 0 4rem;
}

.search-row-ad {
  grid-column: 1 / -1;
}
