:root {
  --bg: #0d0d12;
  --bg-2: #14141c;
  --bg-3: #1c1c26;
  --card: #191922;
  --text: #f2f3f7;
  --text-dim: #9a9aad;
  --text-mute: #6c6c80;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #ff5c39;
  --accent-2: #ffb057;
  --accent-grad: linear-gradient(120deg, #ff5c39, #ff9a3d);
  --blue: #4f8cff;
  --green: #22c55e;
  --pink: #ec4899;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; cursor: pointer; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
.hidden { display: none !important; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 26px;
  padding: 0 34px; height: 64px;
  background: rgba(13, 13, 18, 0.82);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.brand-mark {
  display: block; width: 36px; height: 36px; flex: none; border-radius: 10px;
  box-shadow: 0 6px 18px rgba(255, 92, 57, .34);
  transition: transform .22s cubic-bezier(.2,.8,.3,1.2), box-shadow .22s;
}
.brand:hover .brand-mark { transform: translateY(-1px) scale(1.05); box-shadow: 0 9px 24px rgba(255, 92, 57, .5); }
/* 羽线轻微「振翅」动效 */
.brand-mark .bm-feather { animation: feather 3.6s ease-in-out infinite; }
.brand-mark .f2 { animation-delay: .18s; }
.brand-mark .f3 { animation-delay: .36s; }
@keyframes feather {
  0%, 70%, 100% { transform: translate(0, 0); }
  82% { transform: translate(1.1px, -1.1px); }
}
@media (prefers-reduced-motion: reduce) { .brand-mark .bm-feather { animation: none; } }
.brand-text { display: flex; align-items: baseline; gap: 8px; }
.logo {
  font-size: 22px; font-weight: 800; letter-spacing: 1px;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { font-size: 11px; color: var(--text-mute); letter-spacing: 3px; }
/* 顶栏导航 */
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav-link {
  display: inline-flex; align-items: center; gap: 5px; padding: 8px 15px; border-radius: 999px;
  color: var(--text-dim); font-size: 14.5px; background: none; border: none; cursor: pointer;
  transition: all .18s; white-space: nowrap; font-family: inherit;
}
.topnav-link:hover { color: var(--text); background: rgba(255,255,255,.06); }
.topnav-link.active { color: #fff; background: rgba(255,92,57,.16); font-weight: 600; }
.topnav-link .caret { font-size: 10px; opacity: .8; }
.login-entry { background: var(--accent-grad); color: #fff; font-weight: 600; }
.login-entry:hover { background: var(--accent-grad); filter: brightness(1.08); color: #fff; }

/* 下拉菜单（客户端下载） */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: 46px; right: 0; min-width: 290px; padding: 8px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); display: none; flex-direction: column; gap: 2px; z-index: 130;
}
.dropdown.open .dropdown-menu { display: flex; animation: fade .18s ease; }
.dropdown-menu a { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 8px; }
.dropdown-menu a b { font-size: 14px; color: var(--text); font-weight: 600; }
.dropdown-menu a span { font-size: 12px; color: var(--text-mute); margin-top: 3px; }
.dropdown-menu a:hover { background: rgba(255,255,255,.06); }
.dropdown-menu .dm-head { font-size: 12px; color: var(--text-mute); padding: 6px 12px 8px; letter-spacing: 1px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.search-box { display: flex; align-items: center; background: var(--bg-3); border-radius: 999px; padding: 4px 4px 4px 16px; border: 1px solid var(--line); }
.search-box input { background: none; border: none; outline: none; color: var(--text); width: 190px; font-size: 14px; }
.search-box input::placeholder { color: var(--text-mute); }
.search-box button { background: var(--accent-grad); border: none; color: #fff; border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 600; }

.user-menu { position: relative; display: flex; align-items: center; gap: 8px; }
.uname-inline { font-size: 14px; font-weight: 600; color: var(--text-dim); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text-dim);
  border-radius: 999px; padding: 6px 12px 6px 10px; font-size: 13px; cursor: pointer;
  transition: .18s;
}
.logout-btn svg { width: 15px; height: 15px; }
.logout-btn:hover { color: #fff; border-color: var(--accent); background: rgba(255,92,57,.18); }
.avatar {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-grad); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer;
}
.user-dropdown {
  position: absolute; right: 0; top: 48px; min-width: 180px; padding: 8px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); display: none; flex-direction: column; gap: 2px;
}
.um-trigger:hover ~ .user-dropdown, .user-dropdown:hover { display: flex; }
.user-dropdown .uname { padding: 8px 12px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-dropdown button { text-align: left; background: none; border: none; color: var(--text-dim); padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.user-dropdown button:hover { background: rgba(255,255,255,.06); color: var(--text); }

/* ---------- 布局：左侧导航 + 主内容 ---------- */
.layout { display: flex; align-items: flex-start; }
.sidebar {
  flex: 0 0 208px; width: 208px; position: sticky; top: 64px;
  height: calc(100vh - 64px); overflow-y: auto; padding: 14px 12px 40px;
  border-right: 1px solid var(--line); background: var(--bg-2);
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: 10px; color: var(--text-dim); font-size: 15px; transition: all .18s;
}
.side-nav a svg { width: 20px; height: 20px; flex: 0 0 auto; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: var(--text); }
.side-nav a.active { background: var(--accent-grad); color: #fff; font-weight: 600; box-shadow: 0 6px 18px rgba(255,92,57,.28); }
.side-divider { height: 1px; background: var(--line); margin: 14px 8px; }
.side-title { font-size: 12px; color: var(--text-mute); padding: 4px 14px 8px; letter-spacing: 1.5px; }
.side-cats { display: flex; flex-direction: column; gap: 1px; }
.side-cat {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border-radius: 9px; color: var(--text-dim); font-size: 14px; cursor: pointer; transition: all .16s;
}
.side-cat svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .75; }
.side-cat span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-cat:hover { background: rgba(255,255,255,.06); color: var(--text); }
.side-cat.active { background: rgba(255,92,57,.16); color: #fff; font-weight: 600; }
.side-cat.active svg { opacity: 1; color: var(--accent-2); }
.side-cat-empty { padding: 8px 14px; color: var(--text-mute); font-size: 13px; }

/* ---------- 视图 ---------- */
#view { flex: 1; min-width: 0; padding-bottom: 80px; }
.view-section { display: none; }
.view-section.active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Hero 轮播 ---------- */
.hero { position: relative; height: 480px; overflow: hidden; margin-bottom: 8px; }
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease;
  background-size: cover; background-position: center 30%;
}
.hero-slide.active { opacity: 1; }
.hero-slide::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(13,13,18,.95) 0%, rgba(13,13,18,.7) 35%, rgba(13,13,18,.15) 70%, rgba(13,13,18,.6) 100%),
              linear-gradient(0deg, var(--bg) 2%, transparent 45%);
}
.hero-content {
  position: absolute; left: 60px; bottom: 70px; max-width: 560px; z-index: 3;
}
.hero-badge { display: inline-block; font-size: 12px; font-weight: 700; color: #fff; background: var(--accent-grad); padding: 4px 12px; border-radius: 6px; margin-bottom: 14px; letter-spacing: .5px; }
.hero-title { font-size: 44px; font-weight: 800; line-height: 1.1; margin-bottom: 12px; text-shadow: 0 4px 24px rgba(0,0,0,.6); }
.hero-meta { display: flex; align-items: center; gap: 14px; color: var(--text-dim); font-size: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.hero-meta .score { color: var(--accent-2); font-weight: 800; font-size: 18px; }
.hero-overview { color: #cfcfdc; font-size: 15px; line-height: 1.6; margin-bottom: 22px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-btns { display: flex; gap: 12px; }
.hero-dots { position: absolute; bottom: 26px; left: 60px; display: flex; gap: 8px; z-index: 3; }
.hero-dots span { width: 24px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.3); cursor: pointer; transition: all .3s; }
.hero-dots span.active { background: var(--accent); width: 40px; }

/* ---------- 按钮 ---------- */
.btn { border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text); padding: 10px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; transition: all .2s; }
.btn:hover { background: rgba(255,255,255,.12); }
.btn.primary { background: var(--accent-grad); border: none; color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.block { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .4; filter: grayscale(.35); pointer-events: none; }
.btn.ghost { background: rgba(255,255,255,.1); backdrop-filter: blur(6px); }

/* ---------- 内容行 ---------- */
.rows { padding: 0 40px; }
.row { margin: 34px 0; }
.row-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.row-head h3 { font-size: 21px; font-weight: 700; }
.row-head .more { font-size: 13px; color: var(--text-mute); margin-left: auto; }
.row-strip-wrap { position: relative; }
.row-strip {
  display: flex; gap: 16px; overflow-x: auto; scroll-behavior: smooth; padding-bottom: 8px;
  scrollbar-width: none;
}
.row-strip::-webkit-scrollbar { display: none; }
.strip-arrow {
  position: absolute; top: 50%; transform: translateY(-60%); z-index: 5;
  width: 42px; height: 42px; border-radius: 50%; border: none;
  background: rgba(20,20,28,.9); color: #fff; font-size: 20px; display: grid; place-items: center;
  box-shadow: var(--shadow); opacity: 0; transition: opacity .2s;
}
.row-strip-wrap:hover .strip-arrow { opacity: 1; }
.strip-arrow.left { left: -18px; }
.strip-arrow.right { right: -18px; }

/* ---------- 影片卡片 ---------- */
.card {
  flex: 0 0 auto; width: 168px; cursor: pointer; transition: transform .22s;
}
.card:hover { transform: translateY(-6px); }
.card .poster {
  position: relative; width: 100%; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, #2a2a3a, #3a2a3a); box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.card .poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .poster .ph { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 14px; font-weight: 700; color: rgba(255,255,255,.85); font-size: 15px; line-height: 1.4; }
.card .poster .rating { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.72); color: var(--accent-2); font-size: 12px; font-weight: 800; padding: 3px 7px; border-radius: 6px; }
.card .poster .tag { position: absolute; top: 8px; left: 8px; background: rgba(79,140,255,.9); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; }
.card .c-title { font-size: 14px; margin-top: 9px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .c-sub { font-size: 12px; color: var(--text-mute); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 首页筛选栏（爱奇艺风格） ---------- */
.filterbar { margin: 6px 40px 2px; padding: 16px 22px 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; }
.fb-tabs { display: flex; gap: 26px; padding-bottom: 13px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.fb-tabs button { background: none; border: none; color: var(--text-dim); font-size: 16px; font-weight: 600; padding: 2px; position: relative; cursor: pointer; font-family: inherit; }
.fb-tabs button:hover { color: var(--text); }
.fb-tabs button.active { color: #fff; }
.fb-tabs button.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -14px; height: 2px; background: var(--accent); border-radius: 2px; }
.fb-row { display: flex; align-items: flex-start; gap: 12px; padding: 6px 0; }
.fb-label { flex: 0 0 42px; color: var(--text-mute); font-size: 13.5px; padding-top: 6px; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 2px; }
.fb-chips button { background: none; border: none; color: var(--text-dim); font-size: 13.5px; padding: 5px 12px; border-radius: 8px; cursor: pointer; font-family: inherit; }
.fb-chips button:hover { color: var(--text); background: rgba(255,255,255,.05); }
.fb-chips button.active { color: var(--accent-2); font-weight: 700; background: rgba(255,92,57,.1); }

/* ---------- 剧集 季/集 面板 ---------- */
.series-panel { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.sp-head { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.sp-seasons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.sp-season { background: var(--bg-3); border: 1px solid var(--line); color: var(--text-dim); padding: 7px 16px; border-radius: 999px; font-size: 13.5px; cursor: pointer; font-family: inherit; }
.sp-season:hover { color: var(--text); }
.sp-season.active { background: var(--accent-grad); border: none; color: #fff; font-weight: 600; }
.sp-episodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; max-height: 230px; overflow-y: auto; }
.ep-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.ep-item:hover { border-color: rgba(255,92,57,.5); }
.ep-no { color: var(--accent-2); font-weight: 700; font-size: 12px; flex: 0 0 auto; }
.ep-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }

/* ---------- 区块头 ---------- */
.section-head { display: flex; align-items: center; gap: 16px; padding: 30px 40px 18px; }
.section-head h2 { font-size: 24px; font-weight: 800; }
.section-actions { margin-left: auto; display: flex; gap: 10px; }
.filters { display: flex; gap: 8px; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--text-dim); padding: 7px 16px; border-radius: 999px; font-size: 14px; }
.chip.active { background: var(--accent-grad); color: #fff; border: none; font-weight: 600; }

/* ---------- 看板 ---------- */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 0 40px; }
.column { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 260px; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.column-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.column-head .cname { font-weight: 700; font-size: 15px; }
.column-head .count { margin-left: auto; font-size: 12px; color: var(--text-mute); background: var(--bg-3); padding: 2px 9px; border-radius: 999px; }
.column-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 80px; }
.column-body.drag-over { background: rgba(255,92,57,.08); border-radius: 10px; }
.kcard { display: flex; gap: 11px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: 8px; cursor: grab; transition: all .18s; }
.kcard:hover { border-color: rgba(255,92,57,.5); transform: translateX(2px); }
.kcard.dragging { opacity: .4; }
.kcard .kposter { width: 46px; height: 66px; border-radius: 7px; overflow: hidden; flex: 0 0 auto; background: linear-gradient(135deg,#2a2a3a,#3a2a3a); }
.kcard .kposter img { width: 100%; height: 100%; object-fit: cover; }
.kcard .kinfo { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.kcard .ktitle { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcard .ksub { font-size: 11.5px; color: var(--text-mute); margin-top: 3px; }
.column-empty { color: var(--text-mute); font-size: 13px; text-align: center; padding: 24px 8px; }
.head-note { font-size: 13px; font-weight: 400; color: var(--text-mute); margin-left: 12px; }
/* 看板未登录 Emby 时的引导卡 */
.board-lock {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center;
  gap: 12px; text-align: center; padding: 56px 24px;
  background: var(--bg-2); border: 1px dashed var(--line); border-radius: var(--radius);
}
.board-lock .bl-mark { width: 56px; height: 56px; background: url('/favicon.svg') center / contain no-repeat; }
.board-lock h3 { font-size: 17px; font-weight: 700; }
.board-lock p { color: var(--text-dim); font-size: 13.5px; line-height: 1.7; max-width: 460px; }
.board-lock .btn { margin-top: 6px; }
/* 卡片右上角的删除按钮（hover 出现） */
.kcard { position: relative; }
.kdel {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  background: rgba(0, 0, 0, .62); border: 1px solid var(--line); border-radius: 50%;
  color: #fff; opacity: 0; transition: opacity .16s, background .16s, border-color .16s;
}
.kdel svg { width: 12px; height: 12px; }
.kcard:hover .kdel, .kdel:focus-visible { opacity: 1; }
.kdel:hover { background: var(--accent); border-color: var(--accent); }

/* ---------- 网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; padding: 0 40px; }
.grid .card { width: 100%; }

/* ---------- 查找 ---------- */
.search-bar-lg { display: flex; gap: 12px; padding: 0 40px 10px; }
.search-bar-lg input { flex: 1; background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; color: var(--text); font-size: 15px; outline: none; }
.search-bar-lg input:focus { border-color: var(--accent); }
#searchResults { padding: 10px 40px; }
.result-group { margin: 26px 0; }
.result-group h3 { font-size: 17px; margin-bottom: 14px; color: var(--text-dim); }

/* ---------- 订阅 ---------- */
.sub-add { display: flex; gap: 10px; padding: 0 40px 20px; }
.sub-add select, .sub-add input { background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; color: var(--text); font-size: 14px; outline: none; }
.sub-add input { flex: 1; }
.sub-list { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 40px; }
.sub-item { display: flex; align-items: center; gap: 10px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 999px; padding: 8px 8px 8px 16px; font-size: 14px; }
.sub-item .stype { color: var(--accent-2); font-size: 12px; font-weight: 700; }
.sub-item button { background: none; border: none; color: var(--text-mute); font-size: 16px; padding: 0 6px; }
.sub-item button:hover { color: var(--accent); }
.feed-title { padding: 30px 40px 4px; font-size: 18px; }

/* ---------- 设置 ---------- */
.settings-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 40px 18px; padding: 24px 26px; }
.settings-card h3 { font-size: 17px; margin-bottom: 10px; }
.settings-card .hint { color: var(--text-dim); font-size: 13.5px; line-height: 1.6; margin-bottom: 16px; }
.settings-card .hint a { color: var(--accent-2); }
.settings-card label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }
.settings-card input { display: block; width: 100%; max-width: 520px; margin-top: 6px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; color: var(--text); font-size: 14px; outline: none; }
.settings-card input:focus { border-color: var(--accent); }
.status { font-size: 13px; margin-left: 12px; color: var(--green); }
.status.error { color: #ff6b6b; }

/* ---------- 弹层 ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
.modal-box { position: relative; width: min(880px, 92vw); max-height: 88vh; overflow-y: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.detail { display: flex; gap: 26px; padding: 28px; }
.detail .d-poster { flex: 0 0 240px; aspect-ratio: 2/3; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg,#2a2a3a,#3a2a3a); }
.detail .d-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail .d-body { flex: 1; min-width: 0; }
.detail h2 { font-size: 28px; margin-bottom: 6px; }
.detail .d-orig { color: var(--text-mute); font-size: 14px; margin-bottom: 14px; }
.detail .d-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; color: var(--text-dim); font-size: 14px; margin-bottom: 16px; }
.detail .d-meta .score { color: var(--accent-2); font-weight: 800; font-size: 20px; }
.detail .d-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.detail .d-tags span { font-size: 12.5px; background: var(--bg-3); border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; color: var(--text-dim); }
.detail .d-overview { color: #cfcfdc; font-size: 14.5px; line-height: 1.75; margin-bottom: 22px; }
.detail .d-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.d-status-row { display: flex; gap: 8px; margin-bottom: 18px; }
.d-status-row button { flex: 1; }

.login-box { position: relative; width: min(400px, 92vw); background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 34px; box-shadow: var(--shadow); animation: pop .25s ease; }
.login-logo {
  width: 64px; height: 64px; margin-bottom: 16px;
  background: url('/favicon.svg') center / contain no-repeat;
  filter: drop-shadow(0 10px 26px rgba(255, 92, 57, .4));
}
.login-box h2 { font-size: 26px; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 6px; }
.login-box .hint { color: var(--text-dim); font-size: 13.5px; margin-bottom: 22px; }
.login-box label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }
.login-box input { display: block; width: 100%; margin-top: 6px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--text); font-size: 14px; outline: none; }
.login-box input:focus { border-color: var(--accent); }

.player-box { position: relative; width: min(1100px, 94vw); background: #000; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); animation: pop .25s ease; }
.player-head { display: flex; align-items: center; padding: 12px 18px; background: #111; color: #fff; font-size: 15px; font-weight: 600; }
.player-head button { margin-left: auto; background: none; border: 1px solid var(--line); color: #fff; padding: 6px 14px; border-radius: 8px; font-size: 13px; }
.player-box video { width: 100%; max-height: 76vh; background: #000; display: block; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%); background: var(--bg-3); border: 1px solid var(--line); color: var(--text); padding: 12px 22px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); z-index: 300; }
.toast.error { border-color: #ff6b6b; color: #ff8f8f; }

/* ---------- 空状态 ---------- */
.empty { color: var(--text-mute); text-align: center; padding: 60px 20px; font-size: 15px; }

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .brand-sub { display: none; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .search-box { flex: 1; order: 4; width: 100%; }
  .search-box input { width: 100%; }
  .topnav { order: 3; overflow-x: auto; }
  .topbar-right { order: 2; }
  .layout { flex-direction: column; }
  .sidebar {
    position: static; width: 100%; flex: none; height: auto; display: flex; flex-direction: row;
    gap: 6px; overflow-x: auto; padding: 10px 12px; border-right: none;
    border-bottom: 1px solid var(--line); scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .side-nav { flex-direction: row; }
  .side-nav a { padding: 8px 12px; white-space: nowrap; }
  .side-divider, .side-title { display: none; }
  .side-cats { flex-direction: row; }
  .side-cat { white-space: nowrap; }
  .hero { height: 360px; }
  .hero-content { left: 24px; bottom: 40px; }
  .hero-title { font-size: 30px; }
  .rows, .section-head, .board, .grid, .search-bar-lg, #searchResults, .sub-add, .sub-list, .settings-card,
  .res-list, .res-head, .sub-hint, .res-loading, .res-more { padding-left: 18px; padding-right: 18px; }
  .res-item { flex-wrap: wrap; }
  .res-meta { flex-direction: row; align-items: center; gap: 10px; width: 100%; justify-content: flex-start; }
  .res-btn { width: 100%; }
  .board { grid-template-columns: 1fr; }
  .detail { flex-direction: column; }
  .detail .d-poster { flex: none; width: 160px; }
}

/* ============ 栏目排序下拉 ============ */
.head-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sort-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text-dim);
  padding: 8px 14px; border-radius: 999px; font-size: 14px; cursor: pointer;
}
.sort-btn svg { width: 16px; height: 16px; flex: none; }
.sort-btn:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.2); }
.sort-btn .caret { font-size: 11px; color: var(--text-mute); }
.sort-menu { top: 42px; right: 0; left: auto; min-width: 285px; max-height: 64vh; overflow-y: auto; padding: 6px; }
.sm-head {
  font-size: 12px; color: var(--text-mute); letter-spacing: 1px;
  padding: 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.sort-menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: none; border: none; color: var(--text-dim); text-align: left;
  padding: 10px 12px; border-radius: 8px; font-size: 14px; width: 100%; cursor: pointer;
  user-select: none;
}
.sort-menu button:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.sort-menu button.active { background: rgba(255, 92, 57, 0.12); color: var(--text); font-weight: 600; }
.sort-menu .sm-name { white-space: nowrap; }
.sort-menu .sm-dir { font-size: 12px; color: var(--text-mute); white-space: nowrap; }
.sort-menu button:hover .sm-dir { color: var(--text-dim); }
.sort-menu button.active .sm-dir { color: var(--accent-2); }

/* ============ MoviePilot 订阅 ============ */
.sub-item .sname { font-weight: 600; }
.sub-hint { padding: 0 40px 18px; color: var(--text-mute); font-size: 13px; line-height: 1.7; max-width: 900px; }
.sub-hint b { color: var(--text-dim); }
.feed-note { font-size: 13px; font-weight: 400; color: var(--text-mute); margin-left: 10px; }

/* 资源搜索结果（MoviePilot 资源搜索） */
.res-loading { display: flex; align-items: center; gap: 16px; padding: 24px 40px; color: var(--text-dim); font-size: 14px; }
.res-loading .hint { color: var(--text-mute); font-size: 12.5px; margin-top: 6px; }
.spin {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.res-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 40px 14px; color: var(--text-dim); font-size: 13.5px;
}
.res-head b { color: var(--accent-2); }
.res-list { display: flex; flex-direction: column; gap: 10px; padding: 0 40px; }
.res-item {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 18px; transition: .18s;
}
.res-item:hover { border-color: rgba(255,92,57,.55); background: var(--bg-3); }
.res-main { flex: 1; min-width: 0; }
.res-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-sub { font-size: 12px; color: var(--text-mute); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.res-tags span {
  font-size: 11.5px; color: var(--text-dim); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 7px; background: var(--bg-3);
}
.res-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12.5px; flex: none; }
.res-meta .res-site { color: var(--accent-2); }
.res-meta .res-size { color: var(--text-dim); }
.res-meta .res-seed { color: var(--green); }
.res-btn { flex: none; padding: 8px 18px; font-size: 13px; }
.res-more { display: flex; justify-content: center; padding: 18px 40px 8px; }
.sub-item .sstate { font-size: 12px; color: var(--text-dim); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.sub-item .slack { font-size: 12px; color: #f59e0b; }
.sub-item button { margin-left: auto; }
#subSearchResults { margin-top: 6px; }
.card .sub-btn { margin-top: 8px; width: 100%; padding: 7px 10px; font-size: 13px; }
#mpStat { color: var(--text-dim); font-size: 13px; }
