/* =========================================================
   QY MOVIE · 网页版
   浅色毛玻璃 + 蓝色主色，支持深色主题与响应式
   ========================================================= */

:root {
  --bg: #f5f7fc;
  --glow-1: rgba(96, 165, 250, .20);
  --glow-2: rgba(147, 197, 253, .22);
  --glow-3: rgba(196, 181, 253, .16);
  --sidebar-bg: rgba(255, 255, 255, .62);
  --topbar-bg: rgba(248, 250, 255, .72);
  --panel: rgba(255, 255, 255, .68);
  --panel-strong: rgba(255, 255, 255, .9);
  --panel-solid: #ffffff;
  --input-bg: rgba(255, 255, 255, .82);
  --chip-bg: rgba(255, 255, 255, .62);
  --border: #e4ebf7;
  --border-strong: #d8e3f4;
  --text: #182235;
  --text-2: #485874;
  --muted: #8492a9;
  --primary: #3b82f6;
  --primary-2: #2563eb;
  --primary-soft: rgba(59, 130, 246, .10);
  --primary-ring: rgba(59, 130, 246, .18);
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, .08);
  --success: #16a34a;
  --warning: #d97706;
  --hover: rgba(59, 130, 246, .07);
  --shadow-sm: 0 2px 12px rgba(45, 70, 120, .05);
  --shadow-md: 0 18px 48px -26px rgba(38, 64, 118, .28);
  --shadow-lg: 0 32px 80px -34px rgba(30, 58, 110, .36);
  --skeleton-a: #eef3fb;
  --skeleton-b: #fafcff;
  --radius: 20px;
  --radius-sm: 13px;
  --sidebar-w: 236px;
  --font: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC",
          -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --glow-1: rgba(59, 130, 246, .20);
  --glow-2: rgba(14, 116, 144, .15);
  --glow-3: rgba(109, 40, 217, .16);
  --sidebar-bg: rgba(13, 20, 34, .72);
  --topbar-bg: rgba(12, 19, 32, .68);
  --panel: rgba(21, 31, 50, .66);
  --panel-strong: rgba(28, 40, 62, .92);
  --panel-solid: #172033;
  --input-bg: rgba(25, 36, 58, .78);
  --chip-bg: rgba(22, 33, 53, .6);
  --border: rgba(132, 162, 212, .16);
  --border-strong: rgba(132, 162, 212, .28);
  --text: #eaf0fc;
  --text-2: #b9c5da;
  --muted: #8b9ab5;
  --primary: #4f8dfb;
  --primary-2: #3b82f6;
  --primary-soft: rgba(79, 141, 251, .16);
  --primary-ring: rgba(79, 141, 251, .24);
  --danger-soft: rgba(229, 72, 77, .16);
  --hover: rgba(96, 165, 250, .10);
  --shadow-sm: 0 2px 14px rgba(0, 0, 0, .18);
  --shadow-md: 0 22px 60px -28px rgba(0, 0, 0, .6);
  --shadow-lg: 0 36px 90px -34px rgba(0, 0, 0, .74);
  --skeleton-a: #162135;
  --skeleton-b: #1d2b44;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(1000px 700px at 8% -12%, var(--glow-1), transparent 62%),
    radial-gradient(1100px 800px at 102% -4%, var(--glow-2), transparent 58%),
    radial-gradient(900px 900px at 82% 108%, var(--glow-3), transparent 62%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.player-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

h1, h2, h3, h4, p {
  margin: 0;
}

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

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

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(59, 130, 246, .22);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

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

.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;
}

/* ---------- 背景光斑 ---------- */

.bg-glow {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: .75;
}

.glow-1 {
  width: 420px;
  height: 420px;
  top: -150px;
  left: 12%;
  background: var(--glow-1);
}

.glow-2 {
  width: 520px;
  height: 520px;
  top: 6%;
  right: -180px;
  background: var(--glow-2);
}

.glow-3 {
  width: 460px;
  height: 460px;
  bottom: -200px;
  left: 38%;
  background: var(--glow-3);
}

/* ---------- 顶部加载条 ---------- */

#loading-bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 300;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}

#loading-bar.is-active {
  opacity: 1;
}

#loading-bar span {
  display: block;
  width: 34%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--primary), #7db2ff, transparent);
  animation: loading-slide 1.1s ease-in-out infinite;
}

@keyframes loading-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(420%); }
}

/* ---------- 布局 ---------- */

.app {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

.main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-w);
}

/* ---------- 侧边栏 ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  padding: 22px 14px 18px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  margin-bottom: 24px;
  border-radius: 16px;
}

.brand:hover .brand-mark {
  transform: translateY(-1px) rotate(-2deg);
  box-shadow: 0 12px 24px -14px rgba(59, 130, 246, .8);
}

.brand-mark {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-soft), rgba(255, 255, 255, .7));
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease;
}

[data-theme="dark"] .brand-mark {
  background: linear-gradient(135deg, rgba(79, 141, 251, .2), rgba(25, 36, 58, .9));
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-mark img.is-broken {
  display: none;
}

.brand-fallback {
  display: none;
  color: var(--primary);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.brand-mark img.is-broken + .brand-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.brand-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: .015em;
}

.brand-text small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
}

.nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.nav-group + .nav-group {
  margin-top: 22px;
}

.nav-label {
  padding: 0 14px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .14em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 14px;
  margin-bottom: 4px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 550;
  border-radius: 13px;
  transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.nav-item svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:hover {
  background: var(--hover);
  color: var(--text);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, #4b8df8, #2f76ef);
  box-shadow: 0 12px 24px -12px rgba(47, 118, 239, .95);
}

.nav-item.active:hover {
  color: #fff;
  background: linear-gradient(135deg, #4b8df8, #2f76ef);
}

.sidebar-foot {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border);
}

.foot-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.foot-stat {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 9px 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.foot-stat strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.foot-stat span {
  color: var(--muted);
  font-size: 11px;
}

.foot-note {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 4px 0;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .03em;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .12);
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 78px;
  padding: 14px 30px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
}

.page-head {
  flex: 0 1 auto;
  min-width: 132px;
  max-width: 260px;
  padding-right: 4px;
}

.page-head h1 {
  overflow: hidden;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -.02em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-head p {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-pill {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.site-pill:hover,
.site-pill:focus-within {
  border-color: var(--border-strong);
  box-shadow: 0 4px 18px -10px rgba(59, 130, 246, .55);
}

.site-pill::after {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.site-pill-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
}

.site-pill select {
  width: 132px;
  height: 100%;
  padding: 0 18px 0 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  appearance: none;
  cursor: pointer;
  background: transparent;
  border: 0;
  outline: 0;
}

.search-pill {
  display: flex;
  flex: 1 1 260px;
  align-items: center;
  max-width: 560px;
  height: 44px;
  min-width: 150px;
  padding: 0 5px 0 15px;
  margin-left: auto;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.search-pill:focus-within {
  background: var(--panel-strong);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ring);
}

.search-pill > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--muted);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-pill input {
  flex: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 10px;
  color: var(--text);
  font-size: 13.5px;
  background: transparent;
  border: 0;
  outline: 0;
}

.search-pill input::placeholder {
  color: var(--muted);
}

.search-pill input::-webkit-search-cancel-button {
  cursor: pointer;
}

.search-submit {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 20px;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  background: linear-gradient(135deg, #4b8df8, #2f76ef);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 18px -10px rgba(47, 118, 239, .9);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.search-submit:hover {
  filter: saturate(1.15) brightness(1.04);
  box-shadow: 0 12px 24px -12px rgba(47, 118, 239, .95);
  transform: translateY(-1px);
}

.search-submit:active {
  transform: translateY(0);
}

.top-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.icon-btn {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--text-2);
  cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  place-items: center;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  color: var(--primary);
  background: var(--panel-strong);
  border-color: var(--primary-ring);
  transform: translateY(-1px);
}

.theme-btn .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-btn .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-btn .icon-moon {
  display: none;
}

/* ---------- 主内容 ---------- */

.view {
  flex: 1;
  width: 100%;
  max-width: 1600px;
  padding: 26px 30px 52px;
  margin: 0 auto;
  outline: none;
}

.app-foot {
  width: 100%;
  max-width: 1600px;
  padding: 0 30px 26px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

/* ---------- 通用控件 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 18px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease,
              border-color .18s ease, color .18s ease, filter .18s ease;
}

.btn svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #4b8df8, #2f76ef);
  border-color: transparent;
  box-shadow: 0 12px 26px -14px rgba(47, 118, 239, .95);
}

.btn-primary:hover {
  filter: saturate(1.12) brightness(1.03);
  box-shadow: 0 16px 30px -14px rgba(47, 118, 239, .98);
}

.btn-ghost {
  background: var(--panel-strong);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
  color: var(--primary);
  border-color: var(--primary-ring);
}

.btn-soft {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: transparent;
}

.btn-soft:hover {
  background: var(--primary-ring);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #ef6267, #dc3d43);
  border-color: transparent;
  box-shadow: 0 10px 24px -14px rgba(220, 61, 67, .9);
}

.btn-danger-soft {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: transparent;
}

.btn-danger-soft:hover {
  background: rgba(229, 72, 77, .16);
}

.btn-ghost-dark {
  color: rgba(255, 255, 255, .88);
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .16);
}

.btn-ghost-dark:hover {
  color: #fff;
  background: rgba(255, 255, 255, .14);
}

.btn-sm {
  height: 34px;
  padding: 0 13px;
  font-size: 12px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-block {
  width: 100%;
}

.icon-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.icon-text-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-text-btn:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: transform .18s ease, background .18s ease, color .18s ease,
              border-color .18s ease, box-shadow .18s ease;
}

.chip:hover {
  color: var(--primary);
  border-color: var(--primary-ring);
  transform: translateY(-1px);
}

.chip.active {
  color: #fff;
  background: linear-gradient(135deg, #4b8df8, #2f76ef);
  border-color: transparent;
  box-shadow: 0 10px 22px -12px rgba(47, 118, 239, .95);
}

.chip.active:hover {
  color: #fff;
}

.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  background: rgba(132, 146, 169, .13);
  border-radius: 999px;
}

.chip.active .chip-count {
  color: #fff;
  background: rgba(255, 255, 255, .22);
}

.chip-static {
  cursor: default;
}

.chip-static:hover {
  color: var(--text-2);
  border-color: var(--border);
  transform: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field > span,
.field-label {
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .02em;
}

.field input,
.field select,
.input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  color: var(--text);
  font-size: 13px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: 0;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field input::placeholder,
.input::placeholder {
  color: var(--muted);
}

.field input:focus,
.field select:focus,
.input:focus {
  background: var(--panel-strong);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ring);
}

.field input:disabled {
  opacity: .6;
}

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.select-wrap select {
  height: 38px;
  padding: 0 34px 0 14px;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  appearance: none;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: 0;
  transition: border-color .18s ease, box-shadow .18s ease, color .18s ease;
}

.select-wrap select:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.select-wrap select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

select option {
  color: #182235;
  background: #fff;
}

[data-theme="dark"] select option {
  color: #eaf0fc;
  background: #172033;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 9px;
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.badge-primary {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: transparent;
}

.badge-success {
  color: var(--success);
  background: rgba(22, 163, 74, .09);
  border-color: transparent;
}

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

.hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

code {
  padding: 1px 5px;
  color: var(--primary);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .92em;
  background: var(--primary-soft);
  border-radius: 5px;
}

.chip svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 内容头部 ---------- */

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.section {
  margin-top: 30px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.section-bar {
  display: inline-block;
  width: 3px;
  height: 18px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  border-radius: 3px;
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.section-head h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.015em;
}

.section-count {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

.section-head .section-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  margin-bottom: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.filter-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 4px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
}

.filter-label svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.filter-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

/* ---------- 首页大推荐 ---------- */

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  gap: 30px;
  padding: 24px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}

.hero-card::before {
  position: absolute;
  top: -120px;
  right: -80px;
  width: 420px;
  height: 320px;
  background: radial-gradient(closest-side, var(--primary-soft), transparent);
  content: "";
  pointer-events: none;
}

.hero-card::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9), transparent);
  content: "";
  pointer-events: none;
}

[data-theme="dark"] .hero-card::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .18), transparent);
}

.hero-poster {
  position: relative;
  z-index: 1;
  width: 212px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(145deg, var(--skeleton-b), var(--skeleton-a));
  border: 0;
  border-radius: 17px;
  box-shadow: 0 22px 38px -24px rgba(24, 45, 84, .55);
  aspect-ratio: 2 / 3;
}

.hero-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}

.hero-poster:hover img {
  transform: scale(1.035);
}

.hero-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 6px 8px 6px 0;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

.hero-eyebrow span {
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 5px var(--primary-soft);
}

.hero-title {
  overflow: hidden;
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 780;
  letter-spacing: -.035em;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: 12px;
  color: var(--text-2);
  font-size: 12.5px;
}

.meta-line .dot {
  width: 3px;
  height: 3px;
  background: var(--border-strong);
  border-radius: 50%;
}

.hero-desc {
  display: -webkit-box;
  max-width: 780px;
  margin-top: 15px;
  overflow: hidden;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.8;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-actions .btn {
  height: 44px;
  padding: 0 22px;
}

/* ---------- 海报网格 ---------- */

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

.poster-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px 8px 12px;
  cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.poster-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.poster-thumb {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(145deg, var(--skeleton-b), var(--skeleton-a));
  border-radius: 11px;
  aspect-ratio: 2 / 3;
}

.poster-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease, opacity .25s ease;
}

.poster-card:hover .poster-thumb img {
  transform: scale(1.035);
}

.poster-thumb::after {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(to top, rgba(9, 18, 34, .32), transparent);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.poster-card:hover .poster-thumb::after {
  opacity: 1;
}

.poster-note {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  max-width: calc(100% - 16px);
  padding: 4px 8px;
  overflow: hidden;
  color: #fff;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: .02em;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(17, 28, 48, .62);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 7px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.poster-merged {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  padding: 4px 7px;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  background: linear-gradient(135deg, #2f7cf6, #5a9bff);
  border-radius: 7px;
  box-shadow: 0 4px 12px rgba(47, 124, 246, .35);
}

.poster-info {
  min-width: 0;
  padding: 10px 4px 0;
}

.poster-info h3 {
  overflow: hidden;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poster-info p {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 30px 0 8px;
}

.load-more-wrap .btn {
  min-width: 132px;
}

.end-note {
  color: var(--muted);
  font-size: 11.5px;
}

.load-more-wrap .spinner {
  width: 15px;
  height: 15px;
  border-width: 2px;
}

/* ---------- 搜索 ---------- */

.search-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text-2);
  font-size: 13px;
}

.search-summary strong {
  color: var(--text);
  font-weight: 700;
}

.search-summary .muted {
  font-size: 11.5px;
}

.search-tabs {
  margin-bottom: 18px;
}

.search-group {
  margin-bottom: 30px;
}

.group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}

.group-head h3 {
  font-size: 15px;
  font-weight: 700;
}

.group-source-key {
  color: var(--muted);
  font-size: 10.5px;
}

.group-head .badge {
  margin-left: 2px;
}

.group-empty {
  padding: 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  background: var(--panel);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
}

.alert-panel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 17px;
  margin-bottom: 18px;
  background: var(--danger-soft);
  border: 1px solid rgba(229, 72, 77, .18);
  border-radius: 15px;
}

.alert-panel.is-warning {
  background: rgba(217, 119, 6, .07);
  border-color: rgba(217, 119, 6, .18);
}

.alert-icon {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  color: var(--danger);
  background: rgba(229, 72, 77, .1);
  border-radius: 9px;
  place-items: center;
}

.alert-panel.is-warning .alert-icon {
  color: var(--warning);
  background: rgba(217, 119, 6, .1);
}

.alert-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.alert-body {
  min-width: 0;
}

.alert-body strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}

.alert-body ul {
  padding: 0 0 0 16px;
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.75;
}

.alert-body p {
  color: var(--text-2);
  font-size: 11.5px;
  word-break: break-word;
}

.group-alert {
  margin-bottom: 14px;
}

/* ---------- 详情 ---------- */

.detail-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.detail-card {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  gap: 30px;
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.detail-poster {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(145deg, var(--skeleton-b), var(--skeleton-a));
  border-radius: 17px;
  box-shadow: 0 24px 44px -26px rgba(24, 45, 84, .55);
  aspect-ratio: 2 / 3;
}

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

.detail-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 4px 0;
}

.detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.detail-title {
  overflow: hidden;
  font-size: clamp(24px, 2.8vw, 36px);
  font-weight: 780;
  letter-spacing: -.035em;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: 12px;
  color: var(--text-2);
  font-size: 12.5px;
}

.detail-people {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 17px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.65;
}

.detail-people span {
  color: var(--muted);
}

.detail-desc {
  display: -webkit-box;
  max-width: 900px;
  margin-top: 17px;
  overflow: hidden;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.85;
  white-space: pre-line;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

.detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.detail-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 7px 12px;
  color: var(--text-2);
  font-size: 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.detail-stat strong {
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.play-section {
  margin-top: 26px;
}

.play-lines {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.play-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .03em;
}

.episode-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 11.5px;
}

.episode-head strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 9px;
}

.episode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 10px;
  overflow: hidden;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.episode-btn:hover {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-ring);
  transform: translateY(-1px);
}

.episode-btn.is-playing {
  color: #fff;
  background: linear-gradient(135deg, #4b8df8, #2f76ef);
  border-color: transparent;
}

/* ---------- 直播 ---------- */

.live-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 15px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.live-toolbar .select-wrap select {
  min-width: 180px;
}

.live-toolbar .muted {
  margin-left: auto;
  font-size: 11.5px;
}

.live-groups {
  margin-bottom: 14px;
}

.live-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.filter-search {
  display: flex;
  align-items: center;
  width: min(320px, 100%);
  height: 38px;
  padding: 0 13px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.filter-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.filter-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.filter-search input {
  flex: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 8px;
  color: var(--text);
  font-size: 12px;
  background: transparent;
  border: 0;
  outline: 0;
}

.live-count {
  color: var(--muted);
  font-size: 11px;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(194px, 1fr));
  gap: 12px;
}

.channel-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 11px 12px;
  cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.channel-card:hover {
  background: var(--panel-strong);
  border-color: var(--primary-ring);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.channel-logo {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  overflow: hidden;
  color: var(--muted);
  background: linear-gradient(145deg, var(--skeleton-b), var(--skeleton-a));
  border: 1px solid var(--border);
  border-radius: 11px;
  place-items: center;
}

.channel-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.channel-logo svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.channel-info {
  min-width: 0;
  flex: 1;
}

.channel-info strong {
  display: block;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-info span {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-play {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 50%;
  opacity: 0;
  place-items: center;
  transform: scale(.85);
  transition: opacity .18s ease, transform .18s ease;
}

.channel-card:hover .channel-play {
  opacity: 1;
  transform: scale(1);
}

.channel-play svg {
  width: 14px;
  height: 14px;
  margin-left: 1px;
  fill: currentColor;
  stroke: none;
}

/* ---------- 源管理 ---------- */

.page-intro {
  padding: 2px 2px 20px;
}

.page-intro h2 {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.025em;
}

.page-intro p {
  max-width: 820px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.form-card,
.settings-card {
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.form-card + .section,
.settings-card + .settings-card {
  margin-top: 18px;
}

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

.card-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.card-title h2,
.card-head h2 {
  font-size: 15.5px;
  font-weight: 700;
}

.card-title .section-bar {
  height: 16px;
}

.source-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.source-form .field {
  flex: 0 1 190px;
}

.source-form .field.grow {
  flex: 1 1 360px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 3px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

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

.toggle-track {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 21px;
  background: var(--border-strong);
  border-radius: 999px;
  transition: background .18s ease;
}

.toggle-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(20, 40, 80, .2);
  content: "";
  transition: transform .18s ease;
}

.toggle input:checked + .toggle-track {
  background: linear-gradient(135deg, #4b8df8, #2f76ef);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(15px);
}

.toggle input:focus-visible + .toggle-track {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.source-section {
  margin-top: 28px;
}

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

.source-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.source-row:hover {
  background: var(--panel-strong);
  box-shadow: var(--shadow-md);
}

.source-row.is-active {
  background: linear-gradient(135deg, var(--primary-soft), var(--panel));
  border-color: var(--primary-ring);
}

.source-icon {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 12px;
  place-items: center;
}

.source-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.source-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 650;
}

.source-url {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  margin-top: 18px;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.7;
  background: var(--primary-soft);
  border: 1px solid var(--primary-ring);
  border-radius: 14px;
}

.info-banner svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--primary);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* ---------- 设置 ---------- */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.settings-card h2 {
  font-size: 15.5px;
  font-weight: 700;
}

.settings-card > p {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.8;
}

.token-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.token-form .field {
  flex: 1 1 280px;
}

.input-with-action {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-action input {
  padding-right: 44px;
}

.input-eye {
  position: absolute;
  right: 5px;
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 9px;
  place-items: center;
}

.input-eye:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.input-eye svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.token-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.theme-choice {
  display: flex;
  flex: 1 1 160px;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.theme-choice:hover {
  border-color: var(--primary-ring);
  transform: translateY(-1px);
}

.theme-choice.active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-ring);
}

.theme-choice svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.about-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 12px;
}

.about-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

.about-row:last-child {
  border-bottom: 0;
}

.about-row span {
  color: var(--muted);
}

.about-row strong {
  font-weight: 600;
  text-align: right;
}

.disclaimer {
  padding: 14px 16px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.85;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 13px;
}

/* ---------- 空状态 / 错误 ---------- */

.state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 700px;
  padding: 46px 28px;
  margin: 32px auto;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.state-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 17px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-ring);
  border-radius: 18px;
  place-items: center;
}

.state-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.state-icon.is-error {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(229, 72, 77, .16);
}

.state-card h3 {
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -.02em;
}

.state-card p {
  max-width: 480px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 22px;
}

.state-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 24px;
}

.state-step {
  padding: 14px 12px;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.6;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.state-step strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 12px;
}

.boot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 48vh;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.boot-logo {
  display: grid;
  width: 64px;
  height: 64px;
  color: var(--primary);
  font-size: 19px;
  font-weight: 800;
  background: var(--primary-soft);
  border: 1px solid var(--primary-ring);
  border-radius: 20px;
  place-items: center;
  animation: pulse-soft 2s ease-in-out infinite;
}

@keyframes pulse-soft {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 var(--primary-ring); }
  50% { transform: scale(1.035); box-shadow: 0 0 0 12px transparent; }
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.spinner-lg {
  width: 34px;
  height: 34px;
  border-width: 3px;
  border-top-color: #7db2ff;
}

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

/* ---------- 骨架屏 ---------- */

.skeleton {
  background: linear-gradient(100deg, var(--skeleton-a) 20%, var(--skeleton-b) 42%, var(--skeleton-a) 64%);
  background-size: 220% 100%;
  border-radius: 10px;
  animation: shimmer 1.45s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

.skeleton-card {
  padding: 8px 8px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.skeleton-poster {
  width: 100%;
  border-radius: 11px;
  aspect-ratio: 2 / 3;
}

.skeleton-line {
  height: 11px;
  margin: 10px 4px 0;
}

.skeleton-line.w70 { width: 70%; }
.skeleton-line.w45 { width: 45%; height: 9px; margin-top: 7px; }

.skeleton-hero {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  gap: 30px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
}

.skeleton-hero-poster {
  border-radius: 17px;
  aspect-ratio: 2 / 3;
}

.skeleton-hero-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 13px;
}

.skeleton-hero-body .skeleton-line {
  margin-left: 0;
  height: 13px;
}

.skeleton-hero-body .skeleton-line.big {
  width: 46%;
  height: 32px;
  border-radius: 12px;
}

.skeleton-hero-body .skeleton-line.w80 { width: 80%; }
.skeleton-hero-body .skeleton-line.w60 { width: 60%; }
.skeleton-hero-body .skeleton-line.w30 { width: 30%; }

.skeleton-channels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(194px, 1fr));
  gap: 12px;
}

.skeleton-channel {
  height: 68px;
  border-radius: 15px;
}

/* ---------- 页脚 ---------- */

/* ---------- Toast ---------- */

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 12px 13px;
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: auto;
  transform: translateY(10px) scale(.98);
  transition: opacity .2s ease, transform .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-icon {
  display: grid;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 8px;
  place-items: center;
}

.toast-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast-text {
  flex: 1;
  padding-top: 2px;
  font-size: 12px;
  line-height: 1.6;
  word-break: break-word;
}

.toast-close {
  display: grid;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 7px;
  place-items: center;
}

.toast-close:hover {
  color: var(--text);
  background: var(--hover);
}

.toast-close svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.toast-error {
  border-color: rgba(229, 72, 77, .22);
}

.toast-error .toast-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.toast-success .toast-icon {
  color: var(--success);
  background: rgba(22, 163, 74, .1);
}

/* ---------- 模态框 ---------- */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  padding: 20px;
  background: rgba(14, 24, 42, .42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  place-items: center;
  transition: opacity .18s ease;
}

.modal-layer.is-open {
  opacity: 1;
}

.modal-card {
  width: min(430px, 100%);
  padding: 26px;
  background: var(--panel-strong);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(.985);
  transition: transform .2s ease;
}

.modal-layer.is-open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-ring);
  border-radius: 15px;
  place-items: center;
}

.modal-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-card h2 {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -.02em;
}

.modal-desc {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.modal-card form {
  margin-top: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.modal-hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

/* ---------- 播放器 ---------- */

.player-layer {
  position: fixed;
  inset: 0;
  z-index: 450;
  display: grid;
  padding: 22px;
  background: rgba(8, 14, 26, .58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  place-items: center;
  transition: opacity .2s ease;
}

.player-layer.is-open {
  opacity: 1;
}

.player-panel {
  display: flex;
  flex-direction: column;
  width: min(1080px, 100%);
  max-height: calc(100vh - 44px);
  overflow: hidden;
  background: #0b1220;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .7);
  transform: translateY(14px) scale(.99);
  transition: transform .22s ease;
}

.player-layer.is-open .player-panel {
  transform: translateY(0) scale(1);
}

.player-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.player-heading {
  min-width: 0;
}

.player-kicker {
  display: block;
  color: #6da5fb;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
}

.player-heading h2 {
  overflow: hidden;
  margin-top: 2px;
  color: #eef4ff;
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-heading p {
  overflow: hidden;
  margin-top: 2px;
  color: rgba(214, 227, 248, .55);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-head-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.player-icon-btn {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  color: rgba(220, 232, 250, .72);
  cursor: pointer;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  place-items: center;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.player-icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .18);
}

.player-icon-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.player-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 220px;
  background: #02060d;
}

.player-stage video {
  display: block;
  width: 100%;
  max-height: calc(100vh - 200px);
  aspect-ratio: 16 / 9;
  background: #000;
  outline: none;
}

.player-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(226, 238, 255, .78);
  font-size: 11.5px;
  background: rgba(2, 6, 13, .62);
  pointer-events: none;
}

.player-error {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: #f4f8ff;
  background: rgba(6, 11, 21, .84);
}

.player-error-icon {
  display: grid;
  width: 46px;
  height: 46px;
  color: #ff9a9d;
  background: rgba(229, 72, 77, .16);
  border: 1px solid rgba(229, 72, 77, .24);
  border-radius: 14px;
  place-items: center;
}

.player-error-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.player-error p {
  max-width: 560px;
  color: rgba(230, 239, 252, .84);
  font-size: 12.5px;
  line-height: 1.7;
  word-break: break-word;
}

.player-error-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.player-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 18px;
  color: rgba(202, 218, 240, .45);
  font-size: 10px;
  background: #0b1220;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.player-foot span:first-child {
  color: rgba(125, 178, 255, .8);
  font-weight: 600;
}

/* ---------- 动画 ---------- */

.fade-in {
  animation: fade-up .35s ease both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 响应式 ---------- */

@media (max-width: 1240px) {
  .page-head {
    max-width: 205px;
  }

  .site-pill select {
    width: 108px;
  }

  .view,
  .app-foot {
    padding-right: 24px;
    padding-left: 24px;
  }

  .topbar {
    padding-right: 24px;
    padding-left: 24px;
    gap: 12px;
  }
}

@media (max-width: 1080px) {
  :root {
    --sidebar-w: 208px;
  }

  .site-pill-label {
    display: none;
  }

  .site-pill select {
    width: 122px;
  }

  .page-head {
    min-width: 112px;
  }
}

@media (max-width: 920px) {
  :root {
    --sidebar-w: 100%;
  }

  .app {
    display: block;
  }

  .sidebar {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 11px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
  }

  .brand {
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

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

  .brand-text small {
    display: none;
  }

  .nav {
    flex: 1;
    flex-direction: row;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-group {
    display: flex;
    flex-direction: row;
    gap: 4px;
    margin: 0;
  }

  .nav-group + .nav-group {
    margin-top: 0;
    margin-left: 4px;
    padding-left: 8px;
    border-left: 1px solid var(--border);
  }

  .nav-label,
  .sidebar-foot {
    display: none;
  }

  .nav-item {
    height: 38px;
    padding: 0 11px;
    margin: 0;
    font-size: 12.5px;
    border-radius: 11px;
    white-space: nowrap;
  }

  .nav-item svg {
    width: 17px;
    height: 17px;
  }

  .main {
    margin-left: 0;
    min-height: calc(100vh - 61px);
  }

  .topbar {
    min-height: 70px;
  }

  .view {
    padding-top: 22px;
  }

  .hero-card {
    grid-template-columns: 184px minmax(0, 1fr);
    gap: 22px;
  }

  .hero-poster {
    width: 184px;
  }

  .detail-card {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 22px;
  }

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

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 13px 18px;
  }

  .page-head {
    flex: 1;
    max-width: none;
  }

  .page-head h1 {
    font-size: 19px;
  }

  .site-pill {
    order: 2;
  }

  .top-actions {
    order: 2;
  }

  .search-pill {
    order: 3;
    flex: 1 0 100%;
    max-width: none;
    margin-left: 0;
  }

  .view {
    padding: 20px 18px 44px;
  }

  .app-foot {
    padding: 0 18px 22px;
  }

  .hero-card {
    grid-template-columns: 156px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
  }

  .hero-poster {
    width: 156px;
  }

  .hero-title {
    font-size: 23px;
    white-space: normal;
  }

  .hero-desc {
    -webkit-line-clamp: 2;
    font-size: 12px;
  }

  .hero-actions {
    margin-top: 18px;
  }

  .hero-actions .btn {
    height: 40px;
    padding: 0 17px;
    font-size: 12.5px;
  }

  .detail-card {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
  }

  .detail-title {
    font-size: 23px;
  }

  .detail-desc {
    -webkit-line-clamp: 4;
  }

  .source-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .source-actions {
    width: 100%;
    padding-left: 56px;
  }

  .state-steps {
    grid-template-columns: 1fr;
  }

  .toast-stack {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 580px) {
  .sidebar {
    gap: 10px;
    padding: 10px 12px;
  }

  .brand-text {
    display: none;
  }

  .nav-group + .nav-group {
    margin-left: 0;
    padding-left: 4px;
  }

  .nav-item {
    padding: 0 9px;
  }

  .nav-item span {
    display: none;
  }

  .nav-item svg {
    width: 19px;
    height: 19px;
  }

  .page-head p {
    display: none;
  }

  .site-pill {
    height: 38px;
  }

  .site-pill select {
    width: 100px;
    font-size: 11.5px;
  }

  .search-pill {
    height: 42px;
  }

  .search-submit {
    height: 32px;
    padding: 0 16px;
  }

  .hero-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hero-poster {
    width: min(168px, 60%);
    margin: 0 auto;
  }

  .hero-body {
    padding: 0;
    text-align: center;
  }

  .hero-eyebrow,
  .hero-tags,
  .hero-actions,
  .meta-line {
    justify-content: center;
  }

  .hero-desc {
    text-align: left;
  }

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

  .poster-card {
    padding: 6px 6px 10px;
    border-radius: 14px;
  }

  .detail-card {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    width: min(180px, 62%);
    margin: 0 auto;
  }

  .detail-body {
    text-align: center;
  }

  .detail-title-row,
  .detail-meta,
  .detail-stats,
  .detail-actions {
    justify-content: center;
  }

  .detail-people,
  .detail-desc {
    text-align: left;
  }

  .play-lines {
    align-items: flex-start;
  }

  .episode-grid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 7px;
  }

  .episode-btn {
    height: 37px;
    font-size: 11px;
    border-radius: 10px;
  }

  .live-toolbar .muted {
    width: 100%;
    margin-left: 0;
  }

  .live-toolbar .select-wrap {
    flex: 1;
  }

  .live-toolbar .select-wrap select {
    width: 100%;
    min-width: 0;
  }

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

  .source-form .field,
  .source-form .field.grow {
    flex: 1 1 100%;
  }

  .source-form .btn {
    width: 100%;
  }

  .toggle {
    width: 100%;
  }

  .source-form .toggle {
    width: auto;
  }

  .source-actions {
    padding-left: 0;
  }

  .state-card {
    padding: 34px 18px;
  }

  .skeleton-hero {
    grid-template-columns: 1fr;
  }

  .skeleton-hero-poster {
    width: min(168px, 60%);
    margin: 0 auto;
  }

  .player-layer {
    padding: 0;
  }

  .player-panel {
    width: 100%;
    max-height: 100vh;
    border: 0;
    border-radius: 0;
    min-height: 100vh;
  }

  .player-stage {
    flex: 1;
  }

  .player-stage video {
    max-height: calc(100vh - 190px);
  }

  .player-head {
    padding: 13px 14px;
  }

  .player-foot {
    padding: 10px 14px;
  }

  .player-foot span:last-child {
    display: none;
  }
}

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

/* =========================================================
   Tauri 桌面外壳：自定义标题栏 / 窗口控制 / 边缘缩放
   ========================================================= */
.tauri-titlebar {
  display: none;
}

body.is-tauri {
  overflow: hidden;
}

body.is-tauri .tauri-titlebar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  padding: 0 0 0 12px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  user-select: none;
}

.tauri-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  flex: 1;
  min-width: 0;
}

.tauri-title-left img {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  object-fit: cover;
}

.tauri-title-left strong {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text);
}

.tauri-title-left span {
  font-size: 10px;
  color: var(--faint);
}

.tauri-window-buttons {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.tauri-window-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: default;
  transition: background 0.15s ease, color 0.15s ease;
}

.tauri-window-btn svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
}

.tauri-window-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.tauri-window-btn.is-close:hover {
  background: #e5484d;
  color: #fff;
}

body.is-tauri .sidebar {
  top: 38px;
  bottom: 0;
}

body.is-tauri .main {
  padding-top: 38px;
}

.tauri-resize {
  display: none;
}

body.is-tauri .tauri-resize {
  position: fixed;
  z-index: 300;
}

body.is-tauri .tauri-resize-n,
body.is-tauri .tauri-resize-s {
  left: 6px;
  right: 6px;
  height: 6px;
  cursor: ns-resize;
}

body.is-tauri .tauri-resize-n { top: 0; }
body.is-tauri .tauri-resize-s { bottom: 0; }

body.is-tauri .tauri-resize-e,
body.is-tauri .tauri-resize-w {
  top: 6px;
  bottom: 6px;
  width: 6px;
  cursor: ew-resize;
}

body.is-tauri .tauri-resize-e { right: 0; }
body.is-tauri .tauri-resize-w { left: 0; }

body.is-tauri .tauri-resize-ne,
body.is-tauri .tauri-resize-nw,
body.is-tauri .tauri-resize-se,
body.is-tauri .tauri-resize-sw {
  width: 10px;
  height: 10px;
}

body.is-tauri .tauri-resize-ne { top: 0; right: 0; cursor: nesw-resize; }
body.is-tauri .tauri-resize-nw { top: 0; left: 0; cursor: nwse-resize; }
body.is-tauri .tauri-resize-se { bottom: 0; right: 0; cursor: nwse-resize; }
body.is-tauri .tauri-resize-sw { bottom: 0; left: 0; cursor: nesw-resize; }

#tauri-close-layer .modal-card {
  width: min(390px, calc(100vw - 32px));
}
