:root {
  --bg: #0b0e14;
  --bg2: #11151f;
  --card: rgba(23,28,40,.72);
  --border: #262d3d;
  --text: #e8ebf2;
  --muted: #8b93a7;
  --accent: #4f8cff;
  --accent2: #b06cff;
  --danger: #ff4d5e;
  --ok: #30c67c;
  --female: #ff6fa5;
  --male: #4f8cff;
  --radius: 12px;
  --grad: linear-gradient(135deg, #4f8cff, #b06cff);
  --global-blur: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 20% -10%, rgba(79,140,255,.08), transparent),
    radial-gradient(1000px 500px at 90% 0%, rgba(176,108,255,.08), transparent),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* 全局背景（PC 推荐 fanart 轮播，模糊 + 暗色遮罩） */
.global-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-layer {
  position: absolute; inset: -40px;
  background-size: cover; background-position: center top;
  filter: blur(var(--global-blur)) brightness(.52) saturate(1.12);
  opacity: 0; transition: opacity .9s ease;
  will-change: opacity;
}
.bg-layer.active { opacity: 1; }
.bg-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,14,20,.42), rgba(11,14,20,.55) 50%, rgba(11,14,20,.9) 100%);
}

/* 导航栏背景切换 + 模糊控件（仅 PC） */
.bg-ctrl {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: rgba(15,18,28,.4);
}
.bg-arrow {
  width: 24px; height: 24px; border-radius: 50%; border: none;
  background: rgba(79,140,255,.12); color: var(--text); font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s, transform .15s;
}
.bg-arrow:hover { background: rgba(79,140,255,.3); transform: scale(1.1); }
.bg-arrow:active { transform: scale(.9); }
.bg-idx { font-size: 12px; color: var(--muted); min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.bg-blur-label { font-size: 12px; color: var(--muted); margin-left: 2px; }
.bg-blur-range { width: 74px; accent-color: var(--accent); cursor: pointer; }

/* 全局卡片磨砂玻璃：与导航栏透明度一致（半透明 + 背景模糊） */
.card, .review, .list-item, .magnet, .partition-bar, .period-bar,
.cat-group, .collapse-panel, .collapse-section, .cast-card, .cast-item {
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

/* 顶部导航 */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; background: rgba(15,18,28,.72);
  backdrop-filter: blur(var(--global-blur)) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
  position: sticky; top: 0; z-index: 50;
}
.brand {
  font-weight: 800; font-size: 19px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -.02em;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; font-size: 17px; font-weight: 900;
  box-shadow: 0 4px 12px rgba(79,140,255,.45);
  flex-shrink: 0;
}
.brand-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 12px rgba(79,140,255,.4));
}
.searchbox { flex: 1; display: flex; gap: 8px; max-width: 560px; }
.searchbox input {
  flex: 1; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.searchbox input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,140,255,.15); }
.searchbox button {
  padding: 9px 18px; border-radius: 999px; border: none;
  background: var(--grad); color: #fff; font-weight: 600; transition: opacity .2s, transform .15s, box-shadow .2s;
}
.searchbox button:hover { opacity: .92; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(79,140,255,.4); }
.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav a {
  color: var(--muted); font-size: 14px; padding: 7px 13px; border-radius: 999px;
  transition: color .2s, background .2s;
}
.nav a:hover { color: var(--text); background: rgba(79,140,255,.12); }
.user-box { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.user-box a { color: var(--accent); }

main { padding: 24px 20px 90px; max-width: 1280px; margin: 0 auto; position: relative; z-index: 1; }

/* 底部导航栏 */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: space-around;
  background: rgba(15,18,28,.72); backdrop-filter: blur(var(--global-blur)) saturate(160%);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 24px rgba(0,0,0,.35);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.bn-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); font-size: 11px; text-decoration: none;
  padding: 6px 14px; border-radius: 10px; transition: color .2s, background .2s, transform .15s;
}
.bn-item .bn-icon { font-size: 20px; transition: transform .2s; }
.bn-item:hover { color: var(--text); }
.bn-item.active { color: var(--accent); }
.bn-item.active .bn-icon { transform: translateY(-2px) scale(1.1); }

/* 分区/周期切换 chips */
.partition-bar, .period-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
  padding: 6px; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; position: sticky; top: 60px; z-index: 5;
  backdrop-filter: blur(10px);
}
.pt-chip {
  padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--muted);
  text-decoration: none; transition: all .2s;
}
.pt-chip:hover { color: var(--text); background: rgba(79,140,255,.1); }
.pt-chip.active { color: #fff; background: var(--grad); font-weight: 600; }

/* 演员筛选按钮（推荐按钮右侧，圆角矩形，不与 chips 重叠）*/
.af-toggle {
  border: 1px solid var(--border) !important;
  background: var(--card) !important;
  border-radius: 10px !important;
  padding: 5px 14px !important;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  align-self: center;
  flex-shrink: 0;
  margin-left: 0 !important;
  line-height: 1.4;
  transition: all .2s;
}
.af-toggle:hover { color: var(--text); background: rgba(79,140,255,.1) !important; }
.af-toggle.active { color: #fff; background: var(--grad) !important; border-color: transparent !important; font-weight: 600; }
.partition-bar, .period-bar { align-items: center; }
.actor-filter-panel {
  max-height: 0; overflow: hidden; margin-bottom: 14px;
  transition: max-height .4s cubic-bezier(.22,.61,.36,1), opacity .3s;
  opacity: 0;
}
.actor-filter-panel.open { max-height: 460px; opacity: 1; }
.actor-filter-panel > div {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px;
}
.af-sliders { display: flex; gap: 10px; flex-wrap: wrap; }
.af-item {
  flex: 1 1 150px; min-width: 140px; padding: 8px 10px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 10px;
}
.af-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.af-item input[type="range"] {
  width: 100%; height: 4px; margin: 7px 0; accent-color: var(--accent); display: block;
}
.af-val { font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.af-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
@media (max-width: 720px) {
  /* 移动端筛选滑块横向滑动 */
  .af-sliders { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  .af-item { flex: 0 0 150px; }
  .actor-filter-panel.open { max-height: 400px; }
}

/* 网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.grid-landscape { grid-template-columns: repeat(4, 1fr); }
.poster-card {
  cursor: pointer; transition: transform .25s cubic-bezier(.4,0,.2,1);
  animation: fadeUp .4s ease both;
}
.poster-card:hover { transform: translateY(-6px); }
.poster-card img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px;
  background: var(--card); box-shadow: 0 4px 16px rgba(0,0,0,.3);
  transition: box-shadow .25s, transform .25s, opacity .45s ease;
  opacity: 0;
}
.poster-card img.loaded { opacity: 1; }
/* 无海报时用站点 logo 占位：铺满整个海报框（SVG 自带深色底，cover 裁剪边缘但中心内容完整） */
.poster-card img.noimg-logo {
  object-fit: cover; padding: 0;
  background: linear-gradient(160deg, #131726, #1b2033);
}
.poster-card:hover img { box-shadow: 0 10px 28px rgba(0,0,0,.5), 0 0 0 1px var(--accent); }
.poster-card .pt { font-size: 13px; margin-top: 7px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.poster-card .pn { color: var(--muted); font-size: 12px; margin-top: 3px; font-weight: 600; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.badge.res { background: rgba(48,198,124,.16); color: var(--ok); }
.badge.nores { background: rgba(255,77,94,.13); color: var(--danger); }
.badge.play { background: rgba(79,140,255,.42); color: #dbe7ff; }
.badge.cnsub { background: rgba(255,150,40,.45); color: #ffe4c4; }
.badge.mag { background: rgba(38,26,92,.85); color: #ffd76e; border: 1px solid rgba(255,215,110,.28); }
/* 详情页番号前缀链接 */
.code-link { color: var(--accent); text-decoration: none; border-bottom: 1px dashed var(--accent); cursor: pointer; }
.code-link:hover { color: #7fabff; text-shadow: 0 0 10px rgba(79,140,255,.5); }

/* 索引构建进度条 */
.progress-track { width: 100%; height: 8px; border-radius: 6px; background: var(--border); overflow: hidden; margin-top: 4px; }
.progress-fill { height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--accent), #7fabff); transition: width .4s ease; }

/* 实时日志面板 */
.log-panel {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  width: min(920px, 94vw); max-height: 60vh; z-index: 300;
  background: rgba(10, 13, 18, .97); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0,0,0,.6); display: flex; flex-direction: column; overflow: hidden;
}
.log-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; }
.log-head span { flex: 1; }
.log-panel pre {
  margin: 0; padding: 10px 14px; overflow-y: auto; flex: 1;
  font-family: Consolas, "Courier New", monospace; font-size: 12px; line-height: 1.5;
  color: #c9d4e3; white-space: pre-wrap; word-break: break-all;
}
@media (max-width: 720px) {
  .log-panel { bottom: 8px; width: 96vw; max-height: 70vh; }
}

/* 区块 */
.section { margin-top: 30px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section h2 { font-size: 19px; font-weight: 700; }
.section-head h2 { position: relative; padding-left: 14px; }
.section-head h2::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 18px; border-radius: 2px; background: var(--grad);
}
.more-link { color: var(--muted); font-size: 13px; transition: color .2s; }
.more-link:hover { color: var(--accent); }

/* 详情页（Emby 布局） */
.detail-page { position: relative; }
.detail-bg {
  position: fixed; inset: 0; z-index: 0;
  background-size: cover; background-position: center top;
  filter: blur(var(--global-blur)) brightness(.45) saturate(1.15);
  pointer-events: none;
}
/* 详情页：隐藏导航栏里的背景切换按钮（详情页只有一张 fanart，无轮播可切），模糊滑块保留 */
body.on-detail .bg-arrow, body.on-detail .bg-idx { display: none; }
.detail-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,14,20,.35), rgba(11,14,20,.55) 45%, rgba(11,14,20,.94) 100%);
}
.detail-hero {
  position: relative; z-index: 1; display: flex; gap: 26px; padding: 30px 26px 26px;
  flex-wrap: wrap; align-items: flex-start;
}
.detail-hero .poster {
  width: 210px; flex-shrink: 0;
  border-radius: 12px; box-shadow: 0 12px 34px rgba(0,0,0,.55);
  aspect-ratio: 3/4; object-fit: cover;
  transition: opacity .45s ease; opacity: 0;
  background: var(--card);
}
.detail-hero .poster.loaded { opacity: 1; }
.detail-hero .poster.noimg-logo {
  object-fit: cover; padding: 0;
  background: linear-gradient(160deg, #131726, #1b2033);
}
/* 无 fanart 时：背景居中展示 logo（不拉伸铺满） */
.detail-page.no-fanart .detail-bg,
.detail-page.no-fanart .fanart-hero {
  background-size: 42%; background-repeat: no-repeat; background-position: center;
}
.detail-page.no-fanart .fanart-scrim { background: rgba(11,14,20,.35); }
.hero-info { flex: 1; min-width: 300px; }
.hero-info h1 { font-size: 26px; font-weight: 800; line-height: 1.25; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.hero-title { font-weight: 400; font-size: 17px; color: #cfd6e4; }
.hero-info .sub { color: var(--muted); margin: 10px 0; font-size: 13px; }
.actions { display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

.detail-body { position: relative; z-index: 1; padding: 4px 26px 30px; }

/* 详情页标签切换 */
.tabs-detail { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.tabs-detail .tab {
  padding: 9px 16px; background: none; border: none; color: var(--muted);
  font-size: 14px; font-weight: 600; border-bottom: 2px solid transparent;
  cursor: pointer; transition: color .2s;
}
.tabs-detail .tab:hover { color: var(--text); }
.tabs-detail .tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* 评论 */
.review { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; animation: fadeUp .3s ease both; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.review-user { font-weight: 700; font-size: 13px; }
.review-score { color: #ffb340; font-weight: 700; font-size: 13px; }
.review-meta { color: var(--muted); font-size: 12px; }
.review-content { font-size: 14px; line-height: 1.7; color: #cfd6e4; word-break: break-word; }

/* 清单 */
.list-item { display: flex; justify-content: space-between; padding: 11px 15px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; font-size: 14px; transition: border-color .2s, transform .15s; }
.list-item:hover { border-color: var(--accent); transform: translateX(3px); }
.list-item .mm { color: var(--muted); font-size: 12px; }

/* 演员页 */
.actor-page { padding: 22px; }
.actor-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.actor-avatar { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.actor-head h1 { font-size: 22px; margin-bottom: 6px; }

/* 迷你收藏按钮 */
.fav-mini {
  border: none; background: none; color: var(--muted); font-size: 16px;
  cursor: pointer; padding: 2px 6px; border-radius: 6px; transition: all .2s;
}
.fav-mini:hover { color: var(--accent2); background: rgba(176,108,255,.1); transform: scale(1.15); }

/* 自定义版本下拉 */
.vp-dd { position: relative; }
.vp-dd-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 13px; cursor: pointer;
  transition: border-color .2s;
}
.vp-dd-btn:hover { border-color: var(--accent); }
.vp-dd-arrow { transition: transform .25s; color: var(--muted); }
.vp-dd.open .vp-dd-arrow { transform: rotate(180deg); }
.vp-dd-menu {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  max-height: 260px; overflow-y: auto; box-shadow: 0 12px 32px rgba(0,0,0,.5);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.vp-dd.open .vp-dd-menu { opacity: 1; visibility: visible; transform: none; }
.vp-dd-item { padding: 10px 14px; font-size: 13px; cursor: pointer; transition: background .15s; white-space: nowrap; }
.vp-dd-item:hover { background: rgba(79,140,255,.12); }
.vp-dd-item.active { background: rgba(79,140,255,.18); color: var(--accent); font-weight: 600; }
/* 工具栏里的下拉保持紧凑 */
.period-bar .vp-dd, .rand-tools .vp-dd, .partition-bar .vp-dd { width: auto; min-width: 96px; }
.period-bar .vp-dd-btn, .rand-tools .vp-dd-btn, .partition-bar .vp-dd-btn { width: auto; padding: 6px 10px; gap: 8px; font-size: 13px; }
.period-bar .vp-dd-menu, .rand-tools .vp-dd-menu, .partition-bar .vp-dd-menu { right: auto; min-width: 120px; }

/* 演员 */
.cast-list { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.cast-item {
  display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer; transition: border-color .2s, transform .15s, box-shadow .2s;
}
.cast-item:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.cast-item { animation: fadeUp .4s ease both; }
.cast-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.cast-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--card); border: 2px solid var(--border); transition: opacity .4s ease; opacity: 0; }
.cast-avatar.loaded, .cast-avatar.noimg { opacity: 1; }
.cast-avatar.noimg { display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--muted); }
.cast-name { font-size: 14px; font-weight: 500; }
.gender { margin-right: 4px; font-size: 13px; }
.gender.female { color: var(--female); }
.gender.male { color: var(--male); }

/* 标签 */
.chip {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  font-size: 13px; cursor: pointer; transition: all .2s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: rgba(79,140,255,.08); }
.chip.crew:hover { border-color: var(--accent2); color: var(--accent2); background: rgba(176,108,255,.08); }

/* 播放器 */
.player-wrap { margin-top: 14px; background: #000; border-radius: 12px; overflow: hidden; }
.player-wrap video { width: 100%; max-height: 62vh; }

/* 剧照 */
.stills { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.stills img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 8px; cursor: pointer; transition: transform .2s, opacity .4s ease; opacity: 0; background: var(--card); }
.stills img.loaded { opacity: 1; }
.stills img:hover { transform: scale(1.03); }

/* 磁力 */
.magnet { padding: 11px 15px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: border-color .2s, transform .15s; }
.magnet:hover { border-color: var(--accent); transform: translateX(3px); }
.magnet .mt { font-size: 14px; margin-bottom: 4px; word-break: break-all; }
.magnet .mm { font-size: 12px; color: var(--muted); }

/* 卡片/表单 */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.card h3 { margin-bottom: 14px; }
.card.summary { line-height: 1.75; color: #c6cddc; font-size: 14px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-group input, .form-group select, .vp-select {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card); color: var(--text); outline: none;
}
.form-group input:focus, .vp-select:focus { border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 10px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.table th { color: var(--muted); font-weight: 500; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; border: none;
  font-size: 14px; font-weight: 600; transition: transform .15s, opacity .2s, box-shadow .2s;
}
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(79,140,255,.35); }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 6px 13px; font-size: 12px; border-radius: 8px; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* 模态 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; z-index: 100; animation: fadeIn .2s ease; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; width: 420px; max-width: 92vw; max-height: 86vh; overflow-y: auto; padding: 22px; animation: fadeUp .25s ease; }
.modal-head { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.close { background: none; border: none; color: var(--muted); font-size: 24px; }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.loading {
  text-align: center; color: var(--muted); padding: 40px;
}
.loading::after {
  content: ''; display: inline-block; width: 22px; height: 22px; margin-left: 10px;
  border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite; vertical-align: middle;
}

#toast { position: fixed; top: 70px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast-item {
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  padding: 10px 16px; border-radius: 8px; font-size: 13px; max-width: 320px;
  animation: fadeUp .25s ease;
}
.toast-item.err { border-left-color: var(--danger); }
.toast-item.ok { border-left-color: var(--ok); }

.auth-wrap { max-width: 400px; margin: 60px auto; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs button { flex: 1; padding: 10px; background: var(--card); border: 1px solid var(--border); color: var(--muted); border-radius: 10px; transition: all .2s; }
.tabs button.active { color: var(--text); border-color: var(--accent); background: rgba(79,140,255,.1); }

/* 动画 */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes lbIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

/* 视图切换动效 */
.view-anim { animation: viewIn .28s cubic-bezier(.4,0,.2,1); }

/* 剧照灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.88);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s;
}
.lightbox.show { opacity: 1; visibility: visible; }
.lightbox.show img { animation: lbIn .28s ease; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lb-close {
  position: absolute; top: 18px; right: 22px; font-size: 34px; color: #fff;
  background: none; border: none; cursor: pointer; opacity: .8; transition: opacity .2s, transform .2s;
}
.lb-close:hover { opacity: 1; transform: scale(1.15); }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; font-size: 30px;
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.2);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .2s;
}
.lb-nav:hover { background: rgba(255,255,255,.22); transform: translateY(-50%) scale(1.08); }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }

/* 点击按压动效 */
.btn:active { transform: scale(.95); }
.chip:active { transform: scale(.92); }
.cast-item:active { transform: scale(.96); }
.poster-card:active { transform: scale(.97); }
.magnet:active { transform: scale(.99); }
.searchbox button:active { transform: scale(.95); }
.tabs-detail .tab:active { transform: translateY(1px); }
.fav-mini:active { transform: scale(1.3); }

@media (max-width: 720px) {
  /* 顶部导航：固定（像底部导航一样，横竖滑动都不动），换行紧凑防溢出 */
  .topbar { position: fixed; left: 0; right: 0; top: 0; z-index: 60; flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  main { padding-top: 120px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 26px; height: 26px; border-radius: 7px; font-size: 15px; }
  .searchbox { order: 3; flex-basis: 100%; max-width: 100%; }
  /* 导航按钮右对齐 */
  .nav { margin-left: auto; justify-content: flex-end; gap: 2px; }
  .nav a { font-size: 12px; padding: 5px 8px; }
  .cover-toggle { display: none; }
  .bg-ctrl { display: none; }
  .global-bg { display: none; }
  .user-box { font-size: 12px; gap: 6px; white-space: nowrap; }

  /* 详情页：海报左侧 + 番号/标题右侧（不再上下堆叠） */
  .detail-hero { flex-direction: row; flex-wrap: nowrap; gap: 12px; padding: 16px 14px; align-items: flex-start; }
  .detail-hero .poster { width: 108px; flex-shrink: 0; border-radius: 10px; }
  .hero-info { min-width: 0; flex: 1; }
  .hero-info h1 { font-size: 18px; line-height: 1.3; }
  .hero-title { font-size: 12px; display: block; margin-top: 4px; }
  .hero-info .sub { font-size: 12px; margin: 6px 0; }
  .actions { gap: 8px; margin: 10px 0; }
  .actions .btn { padding: 8px 13px; font-size: 13px; }

  /* 背景 fanart 移动端右对齐（主角居右更适合竖屏） */
  .detail-bg { background-position: right top; }

  /* 演员列表更紧凑（头像略小、间距收紧，一行更多） */
  .cast-list { gap: 8px; margin: 10px 0; }
  .cast-item { padding: 3px 10px 3px 3px; gap: 8px; }
  .cast-avatar { width: 48px; height: 48px; }
  .cast-name { font-size: 13px; }

  /* 剧照一行 3 张 */
  .stills { grid-template-columns: repeat(3, 1fr); gap: 6px; }

  /* 海报网格更紧凑 */
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
  .poster-card .pt { font-size: 12px; }

  /* 详情正文左右留白收窄 */
  .detail-body { padding: 4px 14px 26px; }
  main { padding: 120px 12px 90px; }
}

/* 海报排名角标（Top250） */
.poster-card { position: relative; }
.rank-badge {
  position: absolute; top: 6px; left: 6px; z-index: 3;
  min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ffb340, #ff7a3c); color: #1a1200;
  font-weight: 800; font-size: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

/* 磁力三按钮 */
.magnet-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* 评论工具栏 */
.review-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.review-toolbar .tabs { margin-bottom: 0; }
.review-like { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 13px; transition: color .2s, transform .15s; }
.review-like:hover { color: var(--accent); transform: scale(1.06); }
.review-like:active { transform: scale(1.2); }

/* 实体页 */
.entity-page { padding: 22px; }
.entity-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.entity-head h1 { font-size: 22px; margin: 2px 0 6px; }

/* Top250 入口 */
.top250-entry { display: flex; align-items: center; gap: 18px; cursor: pointer; transition: border-color .2s, transform .15s; }
.top250-entry:hover { border-color: var(--accent); transform: translateY(-2px); }
.top250-entry .trophy { font-size: 40px; }
.top250-entry .entry-title { font-size: 17px; font-weight: 700; }
.top250-entry .mm { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* 榜单页 Top250 入口 */
.rank-top-entry {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 18px; margin-bottom: 14px; transition: border-color .2s, transform .15s;
}
.rank-top-entry:hover { border-color: var(--accent); transform: translateY(-2px); }
.rank-top-entry .trophy { font-size: 30px; }
.rank-top-entry .entry-title { font-size: 16px; font-weight: 700; }
.rank-top-entry .mm { color: var(--muted); font-size: 13px; }
.rank-top-entry .more-link { margin-left: auto; }

/* 离线对话框行内重命名 */
.off-rename-row { display: flex; align-items: center; gap: 6px; width: 100%; }
.off-rename-row input {
  flex: 1; min-width: 0; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--accent); background: var(--bg2); color: var(--text); outline: none;
}

/* 离线下载对话框 */
.offline-dlg { display: flex; flex-direction: column; gap: 14px; }
.offline-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.offline-head .off-title { font-size: 13px; color: var(--muted); word-break: break-all; flex: 1; }
.offline-folder { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--card); }
.off-folder-tools { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.off-folder-item { user-select: none; }
.offline-files { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--card); max-height: 220px; overflow-y: auto; }
.off-res { margin-bottom: 10px; }
.off-res-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; word-break: break-all; }
.off-file { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.off-file .mm { margin-left: auto; font-size: 12px; color: var(--muted); }
.offline-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.offline-foot .mm { margin-right: auto; font-size: 12px; color: var(--muted); }

/* ==================== 导航美化 ==================== */
.nav-link { font-weight: 500; }
.cover-toggle { background: none; border: 1px solid var(--border); color: var(--muted); font-size: 13px; padding: 6px 13px; border-radius: 999px; cursor: pointer; transition: color .2s, background .2s, border-color .2s; }
.cover-toggle:hover { color: var(--text); background: rgba(79,140,255,.12); border-color: var(--accent); }
.user-box { gap: 8px; }
.user-chip { display: inline-flex; align-items: center; gap: 7px; background: rgba(79,140,255,.1); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px 3px 3px; }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-name.vip-name { color: #c77dff; text-shadow: 0 0 10px rgba(199,125,255,.5); }
.vip-tag { color: #c77dff; font-weight: 700; }
.user-role { font-size: 11px; color: var(--muted); background: rgba(255,255,255,.06); padding: 1px 7px; border-radius: 999px; }
.logout-link, .login-link {
  color: var(--muted); font-size: 13px; padding: 6px 11px; border-radius: 999px; transition: all .2s;
}
.logout-link:hover { color: var(--danger); background: rgba(255,77,94,.12); }
.login-link:hover { color: var(--text); background: rgba(79,140,255,.12); }

/* 用户下拉菜单（退出） */
.user-menu { position: relative; }
.user-caret { font-size: 10px; color: var(--muted); transition: transform .25s; }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 132px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  padding: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.5); z-index: 80;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.user-dropdown.show { opacity: 1; visibility: visible; transform: none; }
.user-dropdown a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--danger); font-size: 13px; transition: background .2s; }
.user-dropdown a:hover { background: rgba(255,77,94,.12); }

/* ==================== 登录页 ==================== */
body.on-login .searchbox, body.on-login .nav, body.on-login .bottom-nav, body.on-login .bg-ctrl { display: none; }
body.on-login .topbar { justify-content: center; }
body.on-login main { padding-top: 40px; }
.auth-wrap { max-width: 400px; margin: 40px auto; }
.auth-wrap .brand-row { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-wrap .brand-row .brand-mark { width: 52px; height: 52px; border-radius: 14px; font-size: 28px; }
.auth-wrap .brand-row .auth-brand-text { font-size: 26px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-wrap .brand-row .auth-tagline { color: var(--muted); font-size: 13px; }

/* ==================== 演员标签折叠 ==================== */
.tag-wrap { display: flex; flex-direction: column; gap: 8px; }
.tag-row { margin: 0; }
.tag-extra { animation: fadeUp .3s ease; }
.tag-toggle { align-self: flex-start; }

/* ==================== 详情页演员小头像（区别于演员页大图） ==================== */
.cast-small .cast-avatar { width: 34px; height: 34px; font-size: 16px; }
.cast-small .cast-item { padding: 3px 10px 3px 3px; gap: 7px; }
.cast-small .cast-name { font-size: 12px; }

/* ==================== 弹窗播放器 ==================== */
.modal.player-modal { width: min(92vw, 720px); }
.modal.player-modal .player-wrap video { max-height: 70vh; }

/* PC 大屏：播放器弹窗更大 */
@media (min-width: 1024px) {
  .modal.player-modal { width: min(92vw, 1280px); }
  .modal.player-modal .player-wrap video { max-height: 82vh; }
}

/* ==================== Top250 年份下拉 ==================== */
.top250-year { appearance: auto; cursor: pointer; border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: 10px; padding: 8px 12px; transition: border-color .2s, box-shadow .2s; }
.top250-year:hover, .top250-year:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,140,255,.15); outline: none; }

/* ==================== 输入框防移动端自动缩放 ==================== */
input, select, textarea { font-size: 16px; }

/* ==================== 杂项 ==================== */
.off-hint { margin-left: auto; color: var(--muted); font-size: 11px; }

/* 模态淡出动效 */
.modal-overlay.modal-closing { animation: fadeOut .18s ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }

/* 标签页卡片网格（演员/系列/片商） */
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.cast-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 8px; background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer; transition: border-color .2s, transform .15s, box-shadow .2s; animation: fadeUp .4s ease both;
}
.cast-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.cast-card .cast-avatar { width: 64px; height: 64px; border-radius: 50%; }
.cast-card .cast-avatar.noimg { font-size: 26px; }
.cast-card .cast-name { font-size: 13px; text-align: center; line-height: 1.3; word-break: break-all; }
.cast-card .mm { color: var(--muted); font-size: 12px; }

/* ==================== 详情页 Emby 风格（移动端） ==================== */
.fanart-hero { display: none; }
.mobile-extras { display: none; }
.mobile-hero-extras { display: none; }
.detail-meta-line { display: none; }

/* 折叠区块（磁力/评论/清单） */
.collapse-section { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; background: var(--card); overflow: hidden; }
.collapse-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; background: none; border: none; color: var(--text);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s;
}
.collapse-head:hover { background: rgba(79,140,255,.06); }
.collapse-arrow { transition: transform .25s; color: var(--muted); font-size: 12px; }
.collapse-head.open .collapse-arrow { transform: rotate(180deg); }
.collapse-body { padding: 0 16px 14px; }
@keyframes collapseIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes collapseOut { to { opacity: 0; transform: translateY(-6px); } }

/* 版本下拉项显示大小 */
.vp-dd-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vp-dd-item .mm { color: var(--muted); font-size: 11px; }

@media (max-width: 720px) {
  /* 移动端：隐藏 PC 模糊背景与标题，展示全尺寸 fanart 头部 */
  .detail-bg { display: none; }
  .desktop-title, .desktop-sub, .desktop-extras { display: none; }
  .detail-meta-line { display: block; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
  .fanart-hero {
    display: block; position: relative; width: 100%; aspect-ratio: 16/9;
    background-size: cover; background-position: center top; margin-bottom: 14px;
  }
  .fanart-scrim {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(11,14,20,0) 28%, rgba(11,14,20,.5) 62%, var(--bg) 100%);
  }
  .fanart-heading { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px 10px; }
  .fh-code { font-size: 13px; font-weight: 800; color: var(--accent); letter-spacing: .5px; text-shadow: 0 1px 4px rgba(0,0,0,.85); }
  .fh-title { font-size: 19px; font-weight: 800; margin: 3px 0; line-height: 1.3; text-shadow: 0 2px 8px rgba(0,0,0,.9); }
  .fh-title.clamped { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
  .fh-meta { font-size: 12px; color: #c6cddc; text-shadow: 0 1px 4px rgba(0,0,0,.85); }
  .mobile-extras { display: block; }
  .mobile-hero-extras { display: block; }
  .mobile-hero-extras .chip { font-size: 12px; }

  /* 演职人员一行最多 3 个 */
  .mobile-extras .cast-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
  .mobile-extras .cast-item { flex-direction: column; align-items: center; justify-content: flex-start; text-align: center; padding: 10px 4px; border-radius: 12px; gap: 6px; position: relative; }
  .mobile-extras .cast-avatar { width: 46px; height: 46px; }
  .mobile-extras .cast-name { font-size: 12px; word-break: break-all; }
  .mobile-extras .fav-mini { position: absolute; top: 4px; right: 4px; }
}

/* ==================== 折叠面板（磁力/评论/清单同一面板切换） ==================== */
.collapse-panel { border: 1px solid var(--border); border-radius: 12px; background: var(--card); overflow: hidden; }
.collapse-panel-head { display: flex; align-items: center; gap: 6px; padding: 12px 16px; }
.cp-tab { color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px 2px; transition: color .2s; }
.cp-tab:hover { color: var(--text); }
.cp-tab.active { color: var(--accent); }
.cp-sep { color: var(--muted); font-size: 13px; }
.cp-collapse { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 12px; transition: transform .25s; user-select: none; padding: 4px 6px; }
.cp-collapse.open { transform: rotate(180deg); }
.collapse-panel-body { padding: 0 16px 14px; }
.cp-content { animation: collapseIn .28s ease; }

/* ==================== 卡片收藏按钮 / 随机工具 ==================== */
.cast-card { position: relative; }
.cast-card .fav-mini { position: absolute; top: 4px; right: 4px; }
.rand-tools { display: flex; align-items: center; gap: 8px; }
.rand-tools .vp-select { width: auto; min-width: 90px; padding: 6px 10px; font-size: 13px; }

/* ==================== 类别页 ==================== */
.cat-selected { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.cat-groups { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.cat-group { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.cat-group-name { font-size: 14px; font-weight: 700; margin-bottom: 10px; color: var(--accent); }
.cat-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; }
.sort-select { width: auto; min-width: 110px; padding: 6px 10px; font-size: 13px; }

/* ==================== 海报评分角标 / 播放角标 ==================== */
.poster-img-wrap { position: relative; }
.score-badge {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  padding: 1px 7px; border-radius: 7px; font-size: 11px; font-weight: 800;
  background: rgba(255,160,50,.58); color: #1a1200;
  box-shadow: 0 2px 8px rgba(0,0,0,.5); backdrop-filter: blur(4px);
}
.poster-overlay-badges {
  position: absolute; left: 6px; bottom: 6px; z-index: 3;
  display: flex; gap: 4px; flex-wrap: wrap;
}
.poster-overlay-badges .badge { font-size: 11px; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
/* 磁力数量标识：海报内右下角 */
.poster-mag {
  position: absolute; right: 6px; bottom: 6px; z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,.5); backdrop-filter: blur(4px);
}
/* 横版（fanart）封面 */
.poster-card.landscape img { aspect-ratio: 16/9; }
.poster-card.landscape .poster-overlay-badges .badge { font-size: 10px; }
.poster-card.landscape .score-badge { font-size: 10px; padding: 1px 6px; }

/* ==================== 详情页返回按钮 ==================== */
.back-btn {
  position: fixed; left: 14px; top: 90px; z-index: 55;
  width: 44px; height: 40px; border-radius: 10px;
  background: rgba(15,18,28,.75); border: 1px solid var(--border); color: var(--text);
  font-size: 20px; cursor: pointer; backdrop-filter: blur(12px);
  transition: transform .15s, background .2s; display: flex; align-items: center; justify-content: center;
}
.back-btn:hover { background: rgba(79,140,255,.18); transform: scale(1.08); }

/* 移动端：返回按钮下移到搜索栏下方，避免重叠 */
@media (max-width: 720px) {
  .back-btn { top: 108px; left: 12px; width: 38px; height: 36px; }
}

/* ==================== 类别页筛选头 ==================== */
.cat-filter-head {
  display: flex; align-items: center; justify-content: space-between; cursor: pointer;
  padding: 10px 2px; font-size: 14px; font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--border); margin-bottom: 10px;
}

/* ==================== 收藏页多选 ==================== */
.fav-tools { display: flex; gap: 8px; align-items: center; }
.fav-card { position: relative; }
.fav-card .poster-img-wrap { position: relative; }
.fav-check { position: absolute; top: 6px; left: 6px; z-index: 4; width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.fav-x {
  position: absolute; top: 6px; right: 6px; z-index: 4; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(15,18,28,.72); color: var(--danger); border: 1px solid var(--border);
  font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .15s;
}
.fav-x:hover { background: rgba(255,77,94,.22); transform: scale(1.1); }

/* ==================== 站点公告弹窗（登录后右上角，5 秒自动关闭） ==================== */
.site-notice {
  position: fixed; top: 76px; right: 16px; z-index: 200;
  width: min(380px, calc(100vw - 32px));
  background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
  opacity: 0; transform: translateX(28px);
  transition: opacity .3s ease, transform .3s cubic-bezier(.22,.61,.36,1);
  overflow: hidden;
}
.site-notice.show { opacity: 1; transform: none; }
.site-notice-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; font-weight: 700; font-size: 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(79,140,255,.08);
}
.site-notice-x {
  border: none; background: transparent; color: var(--muted);
  font-size: 14px; cursor: pointer; padding: 2px 6px; border-radius: 6px;
  transition: color .2s, background .2s;
}
.site-notice-x:hover { color: #fff; background: rgba(255,77,94,.35); }
.site-notice-body { padding: 12px 14px; font-size: 13px; line-height: 1.65; max-height: 280px; overflow-y: auto; }
.site-notice-body p { margin: 0 0 8px; }
.site-notice-body p:last-child { margin-bottom: 0; }
.site-notice-body a { color: var(--accent); }
.site-notice-body code { background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.site-notice-body pre { background: rgba(0,0,0,.3); padding: 8px 10px; border-radius: 8px; overflow-x: auto; }
.site-notice-body pre code { background: none; padding: 0; }
.site-notice-body ul, .site-notice-body ol { margin: 0 0 8px; padding-left: 20px; }
.site-notice-body h1, .site-notice-body h2, .site-notice-body h3 { margin: 4px 0 8px; font-size: 15px; }
@media (max-width: 720px) {
  .site-notice { top: 8px; right: 8px; }
}

/* ==================== 移动端补充样式（必须放在文件末尾，保证覆盖基础样式） ==================== */
@media (max-width: 720px) {
  /* 纯圆形首字母头像：去掉外围胶囊/椭圆框，无用户名无下拉箭头 */
  .user-chip {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    gap: 0 !important;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .user-avatar { width: 28px; height: 28px; font-size: 13px; flex-shrink: 0; }
  .user-name { display: none !important; }
  .user-role { display: none !important; }
  .user-caret { display: none !important; }

  /* 推荐页随机栏：紧凑单行（随机标题 + 类别 + 资源 + 刷新不换行） */
  .section-head { gap: 6px; }
  .section-head h2 { flex-shrink: 0; font-size: 16px; }
  .rand-tools { flex-wrap: nowrap; gap: 4px; min-width: 0; }
  .rand-tools .mm { font-size: 11px; flex-shrink: 0; }
  .rand-tools .vp-dd { min-width: 0; flex-shrink: 1; }
  .rand-tools .vp-dd-btn {
    padding: 5px 6px; gap: 4px; font-size: 12px;
    white-space: nowrap; flex-wrap: nowrap;
  }
  .rand-tools .vp-dd-btn > span { white-space: nowrap; }
  .rand-tools .btn { padding: 5px 7px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }

  /* 搜索框：整体胶囊式，按钮内嵌右侧，聚焦时整框发光 */
  .searchbox {
    gap: 0; padding: 3px 3px 3px 12px;
    background: var(--card); border: 1px solid var(--border); border-radius: 999px;
    box-shadow: 0 2px 14px rgba(0,0,0,.16);
    transition: border-color .2s, box-shadow .2s;
  }
  .searchbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,140,255,.14); }
  .searchbox input {
    padding: 7px 0; font-size: 14px;
    border: none; background: transparent; box-shadow: none; border-radius: 0;
  }
  .searchbox input:focus { box-shadow: none; }
  .searchbox button {
    padding: 7px 14px; font-size: 13px; border-radius: 999px;
    box-shadow: 0 1px 6px rgba(79,140,255,.35);
  }
}
