:root {
  color-scheme: dark;
  --bg: #07080b;
  --bg-soft: #0c0e14;
  --panel: #11141c;
  --panel-2: #161a24;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f1e9;
  --muted: #a1a6b2;
  --dim: #6e7481;
  --accent: #f4c15d;
  --accent-2: #ff9a63;
  --accent-ink: #1b1305;
  --ok: #6fd8a2;
  --bad: #ff7b7b;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  --serif: "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", STSong, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

svg {
  display: block;
}

.page-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1000px 620px at 12% -12%, rgba(244, 193, 93, 0.14), transparent 62%),
    radial-gradient(780px 520px at 92% -6%, rgba(255, 122, 92, 0.1), transparent 58%),
    radial-gradient(900px 700px at 50% 110%, rgba(80, 110, 255, 0.07), transparent 60%),
    linear-gradient(180deg, #07080b 0%, #07080b 55%, #090a0f 100%);
}

.wrap {
  width: min(1240px, calc(100% - 48px));
  margin-inline: auto;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease, backdrop-filter 0.25s ease;
}

.site-header.is-scrolled {
  border-color: var(--line);
  background: rgba(7, 8, 11, 0.78);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--accent);
  background: linear-gradient(145deg, rgba(244, 193, 93, 0.16), rgba(244, 193, 93, 0.04));
  border: 1px solid rgba(244, 193, 93, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-mark svg {
  width: 26px;
  height: 26px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-text strong {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.brand-text small {
  margin-top: 4px;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.3em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
}

.nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav a.active {
  color: var(--accent);
  background: rgba(244, 193, 93, 0.09);
}

.header-search-form {
  display: flex;
  align-items: center;
  gap: 4px;
  width: min(400px, 32vw);
  margin-left: auto;
  padding: 3px 3px 3px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(18, 21, 29, 0.66);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search-form:focus-within {
  border-color: rgba(244, 193, 93, 0.55);
  background: rgba(18, 21, 29, 0.92);
  box-shadow: 0 0 0 3px rgba(244, 193, 93, 0.1);
}

.header-search-form .search-icon {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--dim);
}

.header-search-form .search-icon svg {
  width: 16px;
  height: 16px;
}

.header-search-form input {
  flex: 1;
  min-width: 0;
  padding: 7px 6px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.header-search-form input::placeholder {
  color: var(--dim);
}

.header-search-form button {
  flex-shrink: 0;
  padding: 7px 14px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, #f7cf74, #eda94f);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: filter 0.18s ease;
}

.header-search-form button:hover {
  filter: brightness(1.06);
}

.avatar-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.avatar-btn svg {
  width: 19px;
  height: 19px;
}

.avatar-btn:hover {
  border-color: rgba(244, 193, 93, 0.45);
  color: var(--text);
}

.avatar-btn.active {
  border-color: rgba(244, 193, 93, 0.55);
  background: rgba(244, 193, 93, 0.09);
  color: var(--accent);
}

/* ---------- mobile tab bar ---------- */

.tabbar {
  display: none;
}

.tabbar a,
.tabbar button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 0 3px;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.06em;
  transition: color 0.18s ease;
}

.tabbar a::after,
.tabbar button::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: transparent;
  transform: translateX(-50%);
  transition: background 0.18s ease;
}

.tabbar svg {
  width: 21px;
  height: 21px;
}

.tabbar a.active,
.tabbar button.active {
  color: var(--accent);
}

.tabbar a.active::after,
.tabbar button.active::after {
  background: var(--accent);
}

.tabbar a:active,
.tabbar button:active {
  transform: scale(0.94);
}


/* ---------- continue watching ---------- */

.home-resume-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 132px;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.home-resume-track::-webkit-scrollbar {
  height: 6px;
}

.resume-card {
  padding: 0;
  border: 0;
  background: transparent;
  scroll-snap-align: start;
  text-align: left;
}

.resume-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.resume-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resume-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.22);
  font-family: var(--serif);
  font-size: 34px;
}

.resume-ep {
  position: absolute;
  top: 6px;
  left: 6px;
  max-width: calc(100% - 12px);
  overflow: hidden;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(7, 8, 11, 0.72);
  color: #f6e7c8;
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

.resume-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
}

.resume-progress i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.resume-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.05));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.resume-play svg {
  width: 34px;
  height: 34px;
  color: #fff;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.55));
}

.resume-card:hover .resume-play,
.resume-card:focus-visible .resume-play {
  opacity: 1;
}

.resume-card:hover .resume-poster {
  transform: translateY(-3px);
  border-color: rgba(244, 193, 93, 0.45);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

.resume-card:focus-visible {
  outline: none;
}

.resume-card:focus-visible .resume-poster {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(244, 193, 93, 0.35);
}

.resume-title {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resume-meta {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 11px;
}

/* ---------- sections ---------- */

.section {
  padding: 40px 0;
  border-top: 1px solid var(--line);
}

/* 首页第一块直接贴着顶栏，不需要分割线 */
#app > .section:first-child {
  padding-top: 28px;
  border-top: 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(23px, 2.8vw, 32px);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.section-note {
  margin: 0;
  color: var(--dim);
  font-size: 13px;
}

/* ---------- curated ---------- */

.curated-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 14px;
}

.curated-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 3 / 4;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background:
    radial-gradient(120% 90% at 20% 0%, hsla(var(--hue), 70%, 62%, 0.34), transparent 62%),
    linear-gradient(165deg, hsl(var(--hue), 26%, 18%), hsl(var(--hue), 32%, 9%) 72%);
  color: #fff;
  text-align: left;
  isolation: isolate;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.curated-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 9px);
  opacity: 0.5;
}

.curated-card:hover {
  transform: translateY(-4px);
  border-color: rgba(244, 193, 93, 0.4);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45);
}

.curated-index {
  position: absolute;
  top: 14px;
  left: 16px;
  color: rgba(255, 255, 255, 0.3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.curated-title {
  font-family: var(--serif);
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 700;
  line-height: 1.2;
}

.curated-meta {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.curated-go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.18em;
  opacity: 0;
  transform: translateY(4px);
  transition: 0.2s ease;
}

.curated-card:hover .curated-go {
  opacity: 1;
  transform: none;
}

/* ---------- discover shelves ---------- */

.discover-body {
  display: grid;
  gap: 26px;
}

.shelf {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.shelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.shelf-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.shelf-head span {
  color: var(--dim);
  font-size: 12px;
}

.shelf-head-side {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.shelf-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
}

.shelf-more svg {
  width: 12px;
  height: 12px;
}

.shelf-more:hover {
  color: #ffdb8a;
}

.shelf-poster.shelf-more-poster {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  border-style: dashed;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.015);
}

.shelf-more-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
}

.shelf-more-arrow svg {
  width: 16px;
  height: 16px;
}

.shelf-more-poster b {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.shelf-more-poster small {
  color: var(--dim);
  font-size: 10px;
}

.shelf-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 132px;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
}

.shelf-track::-webkit-scrollbar {
  height: 6px;
}

.shelf-card {
  display: grid;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  scroll-snap-align: start;
  animation: fade-up 0.4s ease both;
}

.shelf-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.shelf-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shelf-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.22);
  font-family: var(--serif);
  font-size: 34px;
}

.shelf-card:hover .shelf-poster {
  transform: translateY(-3px);
  border-color: rgba(244, 193, 93, 0.45);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

.shelf-card:focus-visible {
  outline: none;
}

.shelf-card:focus-visible .shelf-poster {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(244, 193, 93, 0.35);
}

.shelf-rate {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(8, 9, 12, 0.72);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.shelf-rank {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(8, 9, 12, 0.72);
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}

.shelf-tag {
  position: absolute;
  right: 6px;
  bottom: 6px;
  max-width: calc(100% - 12px);
  padding: 1px 6px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(8, 9, 12, 0.66);
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-meta {
  overflow: hidden;
  color: var(--dim);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-skeleton .shelf-head h3 {
  color: var(--muted);
}

.skeleton-item {
  display: grid;
  gap: 6px;
}

/* 和真实卡片的 片名 + 年份 两行文本同高，榜单回来时下面的内容不会跳 */
.skeleton-caption {
  display: grid;
  align-content: start;
  gap: 6px;
  height: 40px;
}

.skeleton-poster {
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.05) 20%, rgba(255, 255, 255, 0.1) 40%, rgba(255, 255, 255, 0.05) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

.skeleton-bar {
  display: block;
  height: 11px;
  border-radius: 4px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.05) 20%, rgba(255, 255, 255, 0.09) 40%, rgba(255, 255, 255, 0.05) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

.skeleton-name {
  width: 84%;
}

.skeleton-sub {
  width: 56%;
  height: 9px;
}

.skeleton-more {
  width: 62px;
  height: 12px;
  border-radius: 6px;
}

/* ---------- full board ---------- */

.board-page {
  padding: 16px 0 10px;
  animation: fade-up 0.35s ease both;
}

.board-head {
  margin-top: 12px;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 18px 14px;
  margin-top: 18px;
}

.board-skeleton {
  width: 100%;
}

.board-foot {
  display: flex;
  justify-content: center;
  margin: 26px 0 10px;
}

.board-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 12px;
}

.board-loading .spinner {
  width: 16px;
  height: 16px;
  border-width: 1.5px;
}

.board-done {
  color: var(--dim);
  font-size: 12px;
}

.board-empty {
  grid-column: 1 / -1;
  padding: 50px 20px;
}

/* ---------- how ---------- */

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.how-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.how-card b {
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.2em;
}

.how-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.how-card p {
  margin: 0;
  color: var(--dim);
  font-size: 13px;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 60px;
  padding: 34px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 12px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  justify-content: space-between;
}

.footer-inner p {
  margin: 0;
}

.noscript {
  padding: 40px 0;
  color: var(--bad);
}

/* ---------- search view ---------- */

.search-view {
  padding: 34px 0 20px;
  animation: fade-up 0.35s ease both;
}

.search-head {
  margin-bottom: 6px;
}

.search-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 700;
  line-height: 1.15;
}

.search-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 20px 0 6px;
}

.search-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.search-status strong {
  color: var(--text);
  font-weight: 600;
}

.source-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.2s ease;
}

.dot.ok {
  background: var(--ok);
}

.dot.noresult {
  background: rgba(255, 255, 255, 0.28);
}

.dot.error {
  background: var(--bad);
}

.search-tools {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 16px 0 22px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.filter-label {
  flex-shrink: 0;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.filter-scroll {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  transition: 0.16s ease;
}

.filter-chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.filter-chip.is-active {
  border-color: rgba(244, 193, 93, 0.6);
  background: rgba(244, 193, 93, 0.12);
  color: var(--accent);
}

.sort-wrap {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.sort-select {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  outline: none;
}

/* 模糊匹配提示 */

.fuzzy-note {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px dashed rgba(244, 193, 93, 0.28);
  border-radius: 12px;
  background: rgba(244, 193, 93, 0.045);
  color: var(--muted);
  font-size: 12px;
}

.fuzzy-note b {
  color: var(--accent);
  font-weight: 600;
}


/* ---------- poster grid ---------- */

.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 22px 18px;
}

.poster-card {
  position: relative;
  min-width: 0;
  animation: fade-up 0.32s ease both;
}

.poster-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 14px;
}

.poster-frame {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background:
    radial-gradient(90% 70% at 25% 10%, rgba(244, 193, 93, 0.16), transparent 60%),
    linear-gradient(160deg, #232837, #10121a);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.poster-card:hover .poster-frame {
  transform: translateY(-4px);
  border-color: rgba(244, 193, 93, 0.35);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 44px;
  color: rgba(255, 255, 255, 0.18);
  user-select: none;
}

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.62));
  opacity: 0.85;
  transition: opacity 0.25s ease;
}

.badge {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(8, 9, 12, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffe3a3;
  font-size: 10px;
  letter-spacing: 0.06em;
  backdrop-filter: blur(6px);
}

.play-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(8, 9, 12, 0.76);
  border: 1px solid rgba(244, 193, 93, 0.45);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.12em;
  opacity: 0;
  transform: translate(-50%, -40%);
  transition: 0.22s ease;
  backdrop-filter: blur(8px);
}

.play-hint svg {
  width: 12px;
  height: 12px;
}

.poster-card:hover .play-hint {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.fav-btn {
  position: absolute;
  left: 9px;
  top: 9px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(8, 9, 12, 0.62);
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  line-height: 1;
  opacity: 0;
  transition: 0.18s ease;
  backdrop-filter: blur(6px);
}

.poster-card:hover .fav-btn,
.poster-card:focus-within .fav-btn,
.fav-btn.is-on {
  opacity: 1;
}

.fav-btn:hover {
  color: var(--accent);
  border-color: rgba(244, 193, 93, 0.5);
}

.fav-btn.is-on {
  color: var(--accent);
  background: rgba(244, 193, 93, 0.14);
  border-color: rgba(244, 193, 93, 0.45);
}

.poster-info {
  padding: 10px 3px 0;
}

.poster-title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.poster-sub {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--dim);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poster-remarks {
  margin: 3px 0 0;
  overflow: hidden;
  color: rgba(244, 193, 93, 0.72);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poster-remarks:empty {
  display: none;
}

/* skeleton */

.skeleton-card .poster-frame {
  background: linear-gradient(100deg, #141822 20%, #1d2230 38%, #141822 56%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton-line {
  height: 10px;
  margin-top: 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.skeleton-line.short {
  width: 55%;
}

/* ---------- errors / empty ---------- */

.empty {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 70px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  color: var(--text);
}

.empty p {
  margin: 0;
  max-width: 440px;
  font-size: 13px;
}

.empty .big {
  font-family: var(--serif);
  font-size: 40px;
  color: rgba(244, 193, 93, 0.4);
}

.error-box {
  margin-top: 26px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 12px;
}

.error-box summary {
  cursor: pointer;
  color: var(--dim);
  letter-spacing: 0.04em;
}

.error-box ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.error-box li {
  margin: 4px 0;
}

.error-box code {
  color: var(--bad);
  font-family: var(--mono);
  font-size: 11px;
}

/* ---------- detail ---------- */

.detail {
  padding: 12px 0 10px;
  animation: fade-up 0.35s ease both;
}

.detail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 2px 0;
}

.detail-title-main {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-width: 0;
}

.detail-title h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.detail-title .btn {
  flex-shrink: 0;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.detail-remarks {
  margin: 0;
  color: rgba(244, 193, 93, 0.8);
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: 0.18s ease;
}

.btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.curated-go svg {
  width: 12px;
  height: 12px;
}

.btn:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #f7cf74, #eda94f);
  color: var(--accent-ink);
  font-weight: 700;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ffdb8a, #f2b45a);
}

.btn-ghost {
  background: transparent;
}

.btn-ghost.is-on {
  border-color: rgba(244, 193, 93, 0.5);
  color: var(--accent);
  background: rgba(244, 193, 93, 0.1);
}

.btn-small {
  padding: 6px 11px;
  border-radius: 9px;
  font-size: 12px;
}

/* ---------- player ---------- */

.player-wrap {
  margin-top: 0;
}

.player-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #000;
  box-shadow: var(--shadow);
}

.player-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.player-frame {
  z-index: 2;
}

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background-color: #0a0b10;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.player-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 60% at 50% 45%, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.78));
}

.player-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* 试播期间的遮罩：按钮压暗，避免看起来「现在就该点」 */
.player-overlay.is-testing .play-big {
  opacity: 0.55;
  transform: scale(0.94);
}

.overlay-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.play-big {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 1px solid rgba(244, 193, 93, 0.6);
  border-radius: 50%;
  background: rgba(244, 193, 93, 0.14);
  color: var(--accent);
  backdrop-filter: blur(10px);
  transition: 0.2s ease;
}

.play-big svg {
  width: 26px;
  height: 26px;
  margin-left: 3px;
}

.player-overlay:hover .play-big {
  transform: scale(1.06);
  background: rgba(244, 193, 93, 0.22);
}

.overlay-inner b {
  font-size: 14px;
  letter-spacing: 0.08em;
}

.overlay-inner small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
}

.player-message {
  position: absolute;
  left: 14px;
  bottom: 52px;
  z-index: 4;
  max-width: min(70%, 460px);
  padding: 6px 11px;
  border-radius: 8px;
  background: rgba(8, 9, 12, 0.72);
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.player-message:empty {
  display: none;
}

/* 播放器状态条：寻找片源 → 对比速度 → 加载画面 → 正在播放 */
.player-stage {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 24px);
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(8, 9, 12, 0.7);
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.player-stage[hidden] {
  display: none;
}

.player-stage i {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: stage-pulse 1.2s ease-in-out infinite;
}

.player-stage.ok i {
  background: var(--ok);
  animation: none;
}

.player-stage.bad i {
  background: var(--bad);
  animation: none;
}

@keyframes stage-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

.player-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.35);
}

.player-loading[hidden] {
  display: none;
}

/* 加载中先不画 media，避免和浏览器原生的缓冲转圈叠在一起 */
.player-shell.is-loading .player-media {
  visibility: hidden;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.player-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  padding: 12px 2px 0;
}

.player-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.skip-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.skip-info {
  color: var(--dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.skip-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.skip-auto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  font-size: 12px;
  cursor: pointer;
}

.skip-auto input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

/* ---------- episodes ---------- */

.episodes {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.018);
}

.ep-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.ep-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
}

.ep-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
}

.ep-head p {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
}

.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.ep-btn {
  padding: 9px 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: 0.15s ease;
}

.ep-btn:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.ep-btn.active {
  border-color: rgba(244, 193, 93, 0.7);
  background: rgba(244, 193, 93, 0.14);
  color: var(--accent);
  font-weight: 600;
}

/* ---------- watch layout / source panel ---------- */

.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: 16px;
  align-items: start;
}

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

.source-panel {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.018);
  scrollbar-width: thin;
}

.sp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sp-head .kicker {
  margin: 0;
}

.sp-head h2 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.sp-retest {
  min-width: 68px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.sp-retest:hover:not(:disabled) {
  border-color: rgba(244, 193, 93, 0.45);
  color: var(--accent);
}

.sp-retest:disabled {
  color: var(--dim);
  cursor: default;
  font-variant-numeric: tabular-nums;
}

.sp-retest:disabled::before {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
  animation: stage-pulse 1s ease-in-out infinite;
  vertical-align: 1px;
}

.sp-note {
  min-height: 14px;
  margin: 8px 0 10px;
  color: var(--dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.sp-list {
  display: flex;
  flex-direction: column;
  padding-bottom: 4px;
}

.sp-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 4px;
  border-top: 1px solid var(--line);
}

.sp-row:first-child {
  border-top: 0;
}

.sp-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.sp-dot.ok {
  background: var(--ok);
}

.sp-dot.busy {
  background: var(--accent);
  animation: stage-pulse 1.2s ease-in-out infinite;
}

.sp-dot.bad {
  background: var(--bad);
}

.sp-dot.idle {
  background: rgba(255, 255, 255, 0.16);
}

.sp-load {
  margin-left: 4px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.16s ease;
}

.sp-load:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.sp-load:disabled {
  opacity: 0.5;
  cursor: default;
}

.sp-line {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  transition: 0.16s ease;
}

.sp-line:hover {
  background: rgba(255, 255, 255, 0.035);
}

.sp-line.is-active {
  background: rgba(244, 193, 93, 0.1);
}

.sp-source-row {
  color: var(--muted);
  font-size: 11px;
}

.sp-line-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-line-source {
  flex-shrink: 0;
  max-width: 56px;
  overflow: hidden;
  color: var(--dim);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-line-state {
  flex-shrink: 0;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sp-line-state.ok {
  color: var(--ok);
}

.sp-line-state.warn,
.sp-line-state.busy {
  color: var(--accent);
}

.sp-line-state.bad {
  color: var(--bad);
}

.sp-line-badge {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* ---------- library ---------- */

.library {
  padding: 36px 0 20px;
  animation: fade-up 0.35s ease both;
}

.page-head {
  margin-bottom: 26px;
}

.page-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 52px);
}

.page-head p {
  margin: 8px 0 0;
  color: var(--dim);
  font-size: 13px;
}

.lib-block {
  margin-top: 34px;
}

.lib-block h2 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 24px;
}

.lib-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lib-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: 0.18s ease;
}

.lib-row:hover {
  border-color: rgba(244, 193, 93, 0.3);
  background: rgba(255, 255, 255, 0.035);
}

.lib-thumb {
  position: relative;
  width: 46px;
  height: 66px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(160deg, #262b3a, #12141c);
}

.lib-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lib-thumb span {
  display: grid;
  place-items: center;
  height: 100%;
  font-family: var(--serif);
  font-size: 20px;
  color: rgba(255, 255, 255, 0.2);
}

.lib-main {
  min-width: 0;
  flex: 1;
}

.lib-main h3 {
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-main p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--dim);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  font-size: 14px;
  transition: 0.16s ease;
}

.icon-btn:hover {
  color: var(--bad);
  border-color: rgba(255, 123, 123, 0.35);
}

/* ---------- sources ---------- */

.sources-page {
  padding: 36px 0 20px;
  animation: fade-up 0.35s ease both;
}

.source-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.022);
  color: var(--muted);
  font-size: 12px;
}

.source-toolbar b {
  color: var(--accent);
  font-weight: 600;
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.018);
  transition: opacity 0.18s ease;
}

.source-row.is-off {
  opacity: 0.5;
}

.switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  transition: 0.18s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.switch input:checked + span {
  background: rgba(244, 193, 93, 0.7);
}

.switch input:checked + span::after {
  transform: translateX(16px);
  background: #1b1305;
}

.source-main {
  min-width: 0;
  flex: 1;
}

.source-main strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.source-main code {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-main p {
  margin: 3px 0 0;
  color: var(--dim);
  font-size: 11px;
}

.tag {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.source-state {
  width: 58px;
  flex-shrink: 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
}

.source-state.ok {
  color: var(--ok);
}

.source-state.bad {
  color: var(--bad);
}

.source-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.source-actions button {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  font-size: 11px;
  transition: 0.15s ease;
}

.source-actions button:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.source-actions button:disabled {
  opacity: 0.3;
  cursor: default;
}

.source-actions button:disabled:hover {
  color: var(--dim);
  border-color: var(--line);
}

.add-source {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 10px;
  margin-top: 22px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.add-source input {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-soft);
  outline: none;
  font-size: 13px;
}

.add-source input:focus {
  border-color: rgba(244, 193, 93, 0.45);
}

.add-source button {
  padding: 9px 18px;
  border: 1px solid rgba(244, 193, 93, 0.4);
  border-radius: 9px;
  background: rgba(244, 193, 93, 0.12);
  color: var(--accent);
  font-size: 13px;
}

.source-tip {
  margin: 10px 0 0;
  grid-column: 1 / -1;
  color: var(--dim);
  font-size: 11px;
}

.tvbox-import {
  margin-top: 14px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.tvbox-head strong {
  font-size: 14px;
  font-weight: 500;
}

.tvbox-head p {
  margin: 6px 0 0;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.6;
}

.tvbox-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 14px;
}

.tvbox-input input {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-soft);
  outline: none;
  font-size: 13px;
}

.tvbox-input input:focus {
  border-color: rgba(244, 193, 93, 0.45);
}

.tvbox-input button,
.tvbox-submit {
  padding: 9px 18px;
  border: 1px solid rgba(244, 193, 93, 0.4);
  border-radius: 9px;
  background: rgba(244, 193, 93, 0.12);
  color: var(--accent);
  font-size: 13px;
}

.tvbox-input button:disabled {
  opacity: 0.5;
  cursor: default;
}

.tvbox-submit:disabled {
  opacity: 0.45;
  cursor: default;
}

.tvbox-presets {
  margin-top: 14px;
}

.tvbox-presets-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--dim);
  font-size: 11px;
}

.tvbox-presets-head span {
  opacity: 0.65;
}

.tvbox-preset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 112px;
  overflow-y: auto;
  padding-right: 4px;
}

.tvbox-preset {
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.tvbox-preset:hover {
  border-color: rgba(244, 193, 93, 0.4);
  color: var(--text);
}

.tvbox-preset.is-active {
  border-color: rgba(244, 193, 93, 0.55);
  background: rgba(244, 193, 93, 0.12);
  color: var(--accent);
}

.tvbox-preset.is-unknown {
  opacity: 0.55;
}

.tvbox-result {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.tvbox-empty {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
}

.tvbox-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.tvbox-bar b {
  color: var(--accent);
  font-weight: 600;
}

.tvbox-actions {
  display: flex;
  gap: 6px;
}

.tvbox-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
}

.tvbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
}

.tvbox-row.is-exists {
  opacity: 0.45;
  cursor: default;
}

.tvbox-row input {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.tvbox-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tvbox-row code {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
}

.tvbox-flag {
  flex-shrink: 0;
  color: var(--dim);
  font-size: 10px;
}

.settings-section-head {
  margin: 24px 0 14px;
}

.settings-section-head h2,
.preference-panel h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.settings-section-head p,
.preference-panel > p {
  margin: 6px 0 0;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.6;
}

.preference-panel {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.018);
}

.preference-panel .source-row {
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: none;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 100;
  max-width: min(90vw, 420px);
  padding: 10px 18px;
  border: 1px solid rgba(244, 193, 93, 0.35);
  border-radius: 999px;
  background: rgba(14, 16, 22, 0.94);
  color: var(--text);
  font-size: 12px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: 0.24s ease;
  backdrop-filter: blur(12px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- misc ---------- */

.loading-view {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: 46vh;
  color: var(--dim);
  font-size: 13px;
  text-align: center;
}

.loading-view .spinner {
  width: 34px;
  height: 34px;
}

/* 详情页骨架：从榜单点进来、需要重新搜片源时，先给出版式 */
.detail-loading {
  padding: 16px 0 10px;
}

.detail-loading .loading-back,
.detail-loading .loading-player-shell,
.detail-loading .loading-player-bar i,
.detail-loading .loading-chip,
.detail-loading .loading-panel-head,
.detail-loading .loading-panel-row,
.detail-loading .loading-title,
.detail-loading .loading-meta i,
.detail-loading .loading-fav {
  background: linear-gradient(100deg, #141822 20%, #1d2230 38%, #141822 56%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

.loading-back {
  display: block;
  width: 74px;
  height: 30px;
  margin-bottom: 12px;
  border-radius: 999px;
}

.loading-player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.loading-player-shell.has-poster {
  background: #0a0b10;
  animation: none;
}

.loading-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.loading-player-shell.has-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 70% at 50% 45%, rgba(8, 9, 12, 0.2), rgba(8, 9, 12, 0.86));
}

.loading-player-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 20px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12.5px;
  text-align: center;
}

.loading-player-overlay p {
  margin: 0;
}

.loading-player-overlay .spinner {
  width: 20px;
  height: 20px;
  border-width: 1.5px;
}

.loading-player-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  padding: 12px 2px 0;
}

.loading-player-bar i {
  display: block;
  height: 36px;
  border-radius: 10px;
}

.loading-player-bar i:first-child {
  flex: 1 1 420px;
}

.loading-player-bar i:last-child {
  flex: 0 1 190px;
  min-width: 120px;
}

.loading-head-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.loading-title {
  display: block;
  width: min(46%, 320px);
  height: 28px;
  border-radius: 8px;
}

.loading-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.loading-meta i {
  display: block;
  width: 54px;
  height: 13px;
  border-radius: 6px;
}

.loading-meta i:nth-child(2) {
  width: 38px;
}

.loading-meta i:nth-child(3) {
  width: 76px;
}

.loading-fav {
  flex: 0 0 88px;
  height: 38px;
  border-radius: 999px;
}

.loading-chip {
  display: block;
  width: 66px;
  height: 32px;
  border-radius: 10px;
}

.loading-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.loading-panel-head {
  display: block;
  width: 44%;
  height: 14px;
  border-radius: 6px;
}

.loading-panel-row {
  display: block;
  height: 38px;
  border-radius: 10px;
}

.detail-loading-text {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  color: var(--dim);
  font-size: 12.5px;
}

.detail-loading-text .spinner {
  width: 16px;
  height: 16px;
  border-width: 1.5px;
}


@keyframes fade-up {
  from {
    transform: translateY(10px);
  }
  to {
    transform: none;
  }
}

@keyframes shimmer {
  from {
    background-position: 140% 0;
  }
  to {
    background-position: -40% 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- responsive ---------- */

@media (max-width: 1160px) {
  .watch-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 窄屏上先看播放器，片源面板排到下面 */
  .watch-main {
    order: -1;
  }

  .source-panel {
    position: static;
    max-height: 320px;
  }
}

@media (max-width: 900px) {
  .wrap {
    width: calc(100% - 32px);
  }

  .header-inner {
    height: 66px;
    gap: 16px;
  }

  .brand-text small {
    display: none;
  }

  .header-search-form {
    width: min(300px, 38vw);
  }

  .how-grid {
    grid-template-columns: 1fr;
  }

  .detail-title {
    gap: 12px;
  }

  .detail-meta {
    gap: 6px 12px;
  }

  .player-bar {
    gap: 8px;
  }

  .player-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  .loading-player-bar i:first-child {
    flex-basis: 260px;
  }

  .add-source {
    grid-template-columns: 1fr;
  }

  .tvbox-input {
    grid-template-columns: 1fr;
  }

  .tvbox-row code {
    display: none;
  }
}

@media (max-width: 640px) {
  .wrap {
    width: calc(100% - 24px);
  }

  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .header-inner {
    height: 62px;
    gap: 10px;
  }

  .nav {
    display: none;
  }

  .avatar-btn {
    display: none;
  }

  .tabbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    padding: 7px 10px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(7, 8, 11, 0.9);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
  }

  body.is-detail {
    padding-bottom: 0;
  }

  body.is-detail .tabbar {
    display: none;
  }

  .header-search-form {
    flex: 1;
    width: auto;
    min-width: 0;
    padding: 2px 2px 2px 10px;
  }

  .header-search-form input {
    padding: 7px 4px;
    font-size: 14px;
  }

  .header-search-form button {
    padding: 7px 11px;
  }

  .site-footer {
    padding-bottom: 8px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-text strong {
    font-size: 18px;
  }

  .home-resume-track {
    grid-auto-columns: 108px;
    gap: 10px;
  }

  .shelf-track {
    grid-auto-columns: 108px;
    gap: 10px;
  }

  .shelf-head h3 {
    font-size: 15px;
  }

  .shelf-head-side > span {
    display: none;
  }

  .board-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px 10px;
  }

  .discover-body {
    gap: 22px;
  }

  .section {
    padding: 30px 0;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .curated-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .curated-card {
    padding: 14px;
  }

  .curated-title {
    font-size: 18px;
  }

  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 18px 12px;
  }

  .poster-title {
    font-size: 13px;
  }

  .search-tools {
    gap: 8px;
  }

  .filter-label {
    font-size: 10px;
    letter-spacing: 0.1em;
  }

  .sort-wrap .filter-label {
    display: none;
  }

  .sort-select {
    padding: 6px 9px;
  }

  .detail {
    padding-top: 12px;
  }

  .detail-title {
    gap: 10px;
    margin-top: 10px;
  }

  .detail-title h1 {
    font-size: 20px;
  }

  .btn {
    padding: 8px 14px;
    font-size: 12px;
  }

  .player-shell {
    border-radius: 13px;
  }

  .player-message {
    bottom: 10px;
    left: 10px;
  }

  .player-bar > label {
    display: none;
  }

  .player-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    width: 100%;
    margin-left: 0;
  }

  .player-actions #prevEp,
  .player-actions #nextEp {
    flex: 1;
  }

  .player-actions .btn {
    justify-content: center;
  }

  .skip-panel {
    gap: 8px 10px;
  }

  .skip-info {
    width: 100%;
  }

  .skip-actions {
    width: 100%;
    margin-left: 0;
  }

  .episodes {
    padding: 16px;
  }

  .ep-grid {
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    max-height: 250px;
  }

  .detail-loading {
    padding-top: 12px;
  }

  .loading-back {
    width: 66px;
    height: 26px;
    margin-bottom: 10px;
  }

  .loading-player-shell {
    border-radius: 13px;
  }

  .loading-player-bar {
    padding-top: 10px;
  }

  .loading-player-bar i {
    height: 32px;
  }

  .loading-player-bar i:last-child {
    flex-basis: 150px;
  }

  .loading-title {
    width: 66%;
    height: 24px;
  }

  .loading-fav {
    flex-basis: 76px;
    height: 34px;
  }

  .detail-loading-text {
    margin-top: 12px;
  }

  .library,
  .sources-page {
    padding-top: 24px;
  }

  .source-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .source-main {
    flex: 1 1 60%;
  }

  .source-state {
    width: auto;
    margin-left: 50px;
  }

  .source-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .lib-row {
    gap: 10px;
    padding: 10px;
  }

  .lib-thumb {
    width: 40px;
    height: 58px;
  }

  .fav-btn {
    opacity: 0.75;
  }
}

@media (hover: none) {
  .fav-btn {
    opacity: 0.75;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
