/* =========================================================================
   韩漫天堂 · TOPTOON — 视觉系统
   暗色影院风：深夜底 + 火光橙 / 洋红 / 青电三色渐变
   ========================================================================= */

:root {
  --a1: #ff6a3d;
  --a2: #ff2e88;
  --a3: #64e3ff;
  --grad: linear-gradient(120deg, var(--a1), var(--a2) 62%, #a855f7);
  --grad-soft: linear-gradient(120deg, rgba(255,106,61,.18), rgba(255,46,136,.14) 60%, rgba(168,85,247,.16));
  --ok: #38d39f;
  --warn: #ffcc66;

  --bg: #07080e;
  --bg-2: #0b0d18;
  --surface: #11132250;
  --surface-solid: #12142400;
  --panel: #14172a;
  --panel-2: #1b1f36;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #eef0f8;
  --text-dim: #a7adc4;
  --text-mute: #737a94;
  --shadow: 0 18px 50px -22px rgba(0, 0, 0, .85);
  --shadow-soft: 0 10px 30px -18px rgba(0, 0, 0, .8);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --topbar-h: 64px;
  --maxw: 1280px;
  --ease: cubic-bezier(.22, .7, .24, 1);
}

html[data-theme="light"] {
  --bg: #f4f5fb;
  --bg-2: #eceef8;
  --surface: #ffffffb8;
  --panel: #ffffff;
  --panel-2: #f2f4fd;
  --line: rgba(15, 17, 34, .1);
  --line-strong: rgba(15, 17, 34, .18);
  --text: #171a2b;
  --text-dim: #4d5468;
  --text-mute: #828aa3;
  --shadow: 0 18px 50px -26px rgba(24, 28, 60, .5);
  --shadow-soft: 0 10px 26px -18px rgba(24, 28, 60, .45);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }
svg { width: 20px; height: 20px; fill: currentColor; }
::selection { background: rgba(255, 106, 61, .32); }

.view:focus { outline: none; }

/* ---------- 环境光 ---------- */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient__orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.ambient__orb--a { width: 44vw; height: 44vw; top: -18vw; left: -8vw; background: radial-gradient(circle, rgba(255,106,61,.5), transparent 68%); }
.ambient__orb--b { width: 40vw; height: 40vw; top: 8vw; right: -12vw; background: radial-gradient(circle, rgba(255,46,136,.42), transparent 68%); }
.ambient__orb--c { width: 46vw; height: 46vw; bottom: -22vw; left: 24vw; background: radial-gradient(circle, rgba(100,227,255,.26), transparent 70%); }
.ambient__grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 25%, transparent 78%);
}
html[data-theme="light"] .ambient { opacity: .5; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: blur(18px) saturate(150%);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.topbar.is-stuck { border-bottom-color: var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); }
.topbar__inner {
  max-width: var(--maxw); margin: 0 auto; height: var(--topbar-h);
  display: flex; align-items: center; gap: 18px; padding: 0 20px;
}
.topbar__progress { height: 2px; width: 0; background: var(--grad); transition: width .12s linear; }

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand__mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 19px;
  box-shadow: 0 8px 22px -10px var(--a2);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__text strong { font-size: 16px; letter-spacing: .3px; }
.brand__text small { font-size: 10px; letter-spacing: 2.4px; color: var(--text-mute); }

.nav { display: flex; gap: 4px; margin-left: 6px; }
.nav a {
  position: relative; padding: 8px 14px; border-radius: 999px; color: var(--text-dim);
  font-size: 14.5px; font-weight: 500; transition: color .2s, background .2s;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.is-active { color: var(--text); }
.nav a.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%);
  width: 18px; height: 2px; border-radius: 2px; background: var(--grad);
}

.topbar__tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--text-mute);
  background: var(--surface); transition: border-color .2s, color .2s, transform .2s;
  min-width: 250px;
}
.search-trigger:hover { border-color: var(--line-strong); color: var(--text-dim); transform: translateY(-1px); }
.search-trigger svg { width: 17px; height: 17px; }
.search-trigger__label { font-size: 13.5px; }
.search-trigger kbd { margin-left: auto; }

kbd {
  font-family: inherit; font-size: 11px; padding: 1px 6px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--text-mute); background: var(--panel-2);
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-dim);
  transition: color .2s, border-color .2s, transform .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn--ghost { width: auto; padding: 0 12px; font-size: 12px; }
.icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: block; }

/* ---------- 布局 ---------- */
.view { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 26px 20px 120px; }

.section { margin: 44px 0 0; }
.section__head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.section__head h2 { margin: 0; font-size: 21px; letter-spacing: .2px; display: flex; align-items: center; gap: 10px; }
.section__head h2::before {
  content: ""; width: 4px; height: 20px; border-radius: 4px; background: var(--grad);
}
.section__head p { margin: 0; color: var(--text-mute); font-size: 13px; }
.section__more { margin-left: auto; font-size: 13.5px; color: var(--text-dim); display: flex; align-items: center; gap: 4px; }
.section__more:hover { color: var(--a1); }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-dim); font-size: 13px;
  transition: all .18s var(--ease); white-space: nowrap;
}
.pill:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.pill.is-active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 22px -12px var(--a2); }
.pill--ghost { background: transparent; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 14px; font-weight: 600; font-size: 14.5px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  transition: transform .18s var(--ease), box-shadow .2s, border-color .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 14px 30px -16px var(--a2); }
.btn--primary:hover { box-shadow: 0 18px 38px -14px var(--a2); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 8px 14px; border-radius: 11px; font-size: 13px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- 英雄区 ---------- */
.hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.hero__stage { position: relative; min-height: 420px; }
.hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s var(--ease); pointer-events: none; }
.hero__slide.is-active { opacity: 1; pointer-events: auto; }
.hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center 22%; filter: blur(34px) saturate(140%); transform: scale(1.18); opacity: .55; }
.hero__veil {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(7,8,14,.96) 8%, rgba(7,8,14,.72) 46%, rgba(7,8,14,.25) 100%),
              linear-gradient(0deg, var(--bg) 2%, transparent 60%);
}
html[data-theme="light"] .hero__veil {
  background: linear-gradient(90deg, rgba(244,245,251,.97) 8%, rgba(244,245,251,.78) 46%, rgba(244,245,251,.3) 100%),
              linear-gradient(0deg, var(--bg) 2%, transparent 60%);
}
.hero__content { position: relative; display: flex; gap: 28px; padding: 40px 40px 34px; align-items: center; }
.hero__poster { width: 190px; flex-shrink: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line-strong); }
.hero__poster img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.hero__body { max-width: 620px; }
.hero__badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--grad-soft); border: 1px solid var(--line-strong); font-size: 12.5px; color: var(--text-dim); margin-bottom: 14px; }
.hero__badge b { color: var(--a1); }
.hero__title { margin: 0 0 10px; font-size: clamp(26px, 3.6vw, 44px); line-height: 1.12; letter-spacing: -.5px; }
.hero__desc { margin: 0 0 18px; color: var(--text-dim); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__dots { position: absolute; right: 26px; bottom: 22px; display: flex; gap: 8px; }
.hero__dots button { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); transition: all .25s; }
.hero__dots button.is-active { width: 26px; border-radius: 999px; background: var(--grad); }

.tag {
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-dim);
}
.tag--accent { background: var(--grad-soft); border-color: transparent; color: var(--text); }
.tag--status { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.tag--status.is-ongoing { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }

/* ---------- 漫画卡片 ---------- */
.grid {
  display: grid; gap: 18px 16px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.grid--wide { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }

.card { position: relative; display: block; border-radius: var(--radius); }
.card__cover {
  position: relative; border-radius: var(--radius); overflow: hidden; background: var(--panel-2);
  aspect-ratio: 3/4; border: 1px solid var(--line);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.card:hover .card__cover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease), opacity .35s; }
.card:hover .card__cover img { transform: scale(1.06); }
.card__shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(4,5,10,.86) 0%, rgba(4,5,10,.2) 34%, transparent 62%); opacity: .9; }
.card__stat {
  position: absolute; left: 9px; top: 9px; padding: 3px 8px; border-radius: 999px;
  font-size: 11.5px; background: rgba(8,9,16,.72); backdrop-filter: blur(6px); color: #eef0f8;
  border: 1px solid rgba(255,255,255,.14);
}
.card__stat--hot { background: var(--grad); border-color: transparent; color: #fff; }
.card__foot { position: absolute; left: 10px; right: 10px; bottom: 9px; }
.card__status {
  position: absolute; right: 9px; top: 9px; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; background: rgba(8,9,16,.66); color: #cfe9ff; backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.12);
}
.card__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.14); }
.card__progress i { display: block; height: 100%; background: var(--grad); }
.card__title {
  margin: 9px 2px 3px; font-size: 14px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__sub { font-size: 12px; color: var(--text-mute); display: flex; gap: 6px; align-items: center; padding: 0 2px; }
.card__sub span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__fav {
  position: absolute; right: 6px; bottom: 44px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(8,9,16,.6); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.18); color: #fff; opacity: 0; transform: translateY(6px);
  transition: all .22s var(--ease);
}
.card:hover .card__fav { opacity: 1; transform: none; }
.card__fav svg { width: 17px; height: 17px; }
.card__fav.is-on { opacity: 1; transform: none; color: var(--a2); }

/* ---------- 榜单列表 ---------- */
.rank-list { display: grid; gap: 10px; }
.rank-item {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  transition: transform .2s var(--ease), border-color .2s, background .2s;
}
.rank-item:hover { transform: translateX(4px); border-color: var(--line-strong); background: var(--panel); }
.rank-item__no {
  width: 30px; flex-shrink: 0; text-align: center; font-weight: 800; font-size: 17px;
  font-variant-numeric: tabular-nums; color: var(--text-mute);
}
.rank-item:nth-child(1) .rank-item__no { color: #ffd166; }
.rank-item:nth-child(2) .rank-item__no { color: #cbd5e1; }
.rank-item:nth-child(3) .rank-item__no { color: #f0a06a; }
.rank-item__cover { width: 46px; height: 62px; border-radius: 9px; object-fit: cover; flex-shrink: 0; background: var(--panel-2); }
.rank-item__body { min-width: 0; flex: 1; }
.rank-item__body strong { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-item__body small { color: var(--text-mute); font-size: 12.5px; }
.rank-item__tags { display: flex; gap: 6px; flex-shrink: 0; }
.rank-item__heat { font-size: 12.5px; color: var(--a1); font-weight: 700; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ---------- 分类页 ---------- */
.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  margin-bottom: 22px; position: sticky; top: calc(var(--topbar-h) + 10px); z-index: 20;
  backdrop-filter: blur(14px);
}
.filterbar__group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filterbar__label { font-size: 12.5px; color: var(--text-mute); }
.filterbar__count { margin-left: auto; font-size: 13px; color: var(--text-dim); }

/* ---------- 详情页 ---------- */
.detail { position: relative; }
.detail__backdrop { position: absolute; inset: -30px -20px auto; height: 380px; border-radius: 0 0 40% 40%; background-size: cover; background-position: center 20%; filter: blur(60px) saturate(150%); opacity: .4; pointer-events: none; z-index: -1; }
.detail__top { display: flex; gap: 30px; align-items: flex-start; }
.detail__poster { width: 230px; flex-shrink: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-strong); box-shadow: var(--shadow); position: relative; }
.detail__poster img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.detail__body { flex: 1; min-width: 0; }
.detail__crumb { font-size: 13px; color: var(--text-mute); margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.detail__crumb a:hover { color: var(--a1); }
.detail__title { margin: 0 0 12px; font-size: clamp(24px, 3vw, 36px); line-height: 1.15; letter-spacing: -.4px; }
.detail__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.detail__stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.stat {
  padding: 12px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); min-width: 96px;
}
.stat b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--text-mute); }
.detail__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.detail__summary {
  padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--text-dim); font-size: 14.5px; line-height: 1.85;
}
.detail__summary h3 { margin: 0 0 8px; font-size: 14px; color: var(--text); }

.chapter-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.chapter-tools input {
  flex: 1; min-width: 160px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); outline: none;
}
.chapter-tools input:focus { border-color: var(--a1); }
.chapter-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); max-height: 460px; overflow-y: auto; padding-right: 4px; }
.chapter-grid::-webkit-scrollbar { width: 8px; }
.chapter-grid::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
.chapter-link {
  padding: 9px 10px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; text-align: center; color: var(--text-dim); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; transition: all .16s var(--ease);
}
.chapter-link:hover { color: var(--text); border-color: var(--a1); background: var(--panel); transform: translateY(-2px); }
.chapter-link.is-read { color: var(--text-mute); opacity: .7; }

/* ---------- 阅读器 ---------- */
body.reader-mode { background: #05060a; }
body.reader-mode .topbar, body.reader-mode .footer, body.reader-mode .tabbar, body.reader-mode .ambient { display: none; }
.reader { max-width: 900px; margin: 0 auto; padding: 0 0 130px; }
.reader__bar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; background: color-mix(in srgb, #05060a 86%, transparent);
  backdrop-filter: blur(16px); border-bottom: 1px solid rgba(255,255,255,.08); color: #eef0f8;
  transition: transform .3s var(--ease);
}
.reader__bar.is-hidden { transform: translateY(-102%); }
.reader__bar .icon-btn { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: #eef0f8; }
.reader__title { min-width: 0; flex: 1; }
.reader__title strong { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader__title small { color: #98a0b8; font-size: 12px; }
.reader__bar-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--grad); width: 0; }

.reader__pages { background: #05060a; }
.reader__page { position: relative; background: #0b0c14; min-height: 220px; }
.reader__page img { width: 100%; display: block; opacity: 0; transition: opacity .45s var(--ease); }
.reader__page img.is-loaded { opacity: 1; }
.reader__page::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, #0b0c14 20%, #14172a 42%, #0b0c14 64%);
  background-size: 220% 100%; animation: shimmer 1.4s infinite linear; z-index: -1;
}
.reader__page.is-loaded::after { display: none; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.reader__nav { display: flex; gap: 12px; padding: 26px 18px; }
.reader__nav .btn { flex: 1; }
.reader__end { text-align: center; padding: 20px 18px 0; color: #98a0b8; font-size: 13.5px; }

.chapter-sheet { position: fixed; inset: 0; z-index: 90; display: grid; align-items: end; }
.chapter-sheet__scrim { position: absolute; inset: 0; background: rgba(3,4,8,.7); backdrop-filter: blur(4px); }
.chapter-sheet__panel {
  position: relative; max-height: 74vh; overflow: hidden auto; background: var(--panel);
  border-radius: 22px 22px 0 0; border-top: 1px solid var(--line); padding: 18px 18px 30px;
  animation: sheetUp .32s var(--ease);
}
@keyframes sheetUp { from { transform: translateY(30px); opacity: .4; } }
.sheet__head { display: flex; align-items: center; margin-bottom: 14px; }
.sheet__head strong { font-size: 16px; }
.sheet__head button { margin-left: auto; }
.sheet__grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.sheet__grid a { padding: 9px; text-align: center; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; color: var(--text-dim); }
.sheet__grid a.is-current { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------- 搜索面板 ---------- */
.search-overlay { position: fixed; inset: 0; z-index: 100; }
.search-overlay[hidden] { display: none; }
.search-overlay__scrim { position: absolute; inset: 0; background: rgba(3,4,8,.6); backdrop-filter: blur(6px); animation: fade .2s; }
.search-panel {
  position: relative; max-width: 640px; margin: 8vh auto 0; border-radius: 20px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  animation: pop .26s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(-12px) scale(.98); opacity: 0; } }
.search-panel__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.search-panel__head svg { color: var(--text-mute); width: 22px; height: 22px; }
.search-panel__head input { flex: 1; border: 0; background: none; outline: none; font-size: 17px; color: var(--text); }
.search-panel__body { max-height: 56vh; overflow-y: auto; padding: 8px; }
.search-panel__foot { display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--text-mute); font-size: 12px; }
.search-panel__foot span { display: flex; align-items: center; gap: 4px; }
.search-hit { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; }
.search-hit:hover, .search-hit.is-active { background: var(--surface); }
.search-hit img { width: 42px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--panel-2); }
.search-hit__body { min-width: 0; flex: 1; }
.search-hit__body strong { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-hit__body small { color: var(--text-mute); font-size: 12.5px; }
.search-group { padding: 10px 12px 4px; font-size: 12px; color: var(--text-mute); }
.search-empty { padding: 40px 20px; text-align: center; color: var(--text-mute); }

/* ---------- 书架 ---------- */
.shelf-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.empty {
  padding: 70px 24px; text-align: center; border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg); color: var(--text-mute);
}
.empty h3 { color: var(--text); margin: 14px 0 6px; }
.empty svg { width: 44px; height: 44px; opacity: .5; }

/* ---------- 骨架 / 提示 ---------- */
.skeleton-card .card__cover, .skeleton { background: var(--panel-2); animation: pulse 1.5s infinite ease-in-out; }
.skeleton-line { height: 12px; border-radius: 6px; background: var(--panel-2); animation: pulse 1.5s infinite ease-in-out; }
@keyframes pulse { 50% { opacity: .55; } }

.toast-stack { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 200; display: grid; gap: 10px; }
.toast {
  padding: 11px 18px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line-strong);
  color: var(--text); font-size: 14px; box-shadow: var(--shadow); animation: pop .25s var(--ease);
}
.toast.is-ok { border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.toast.is-err { border-color: color-mix(in srgb, var(--a2) 55%, transparent); }

.to-top {
  position: fixed; right: 22px; bottom: 96px; z-index: 50; width: 44px; height: 44px;
  border-radius: 50%; display: grid; place-items: center; background: var(--panel-2);
  border: 1px solid var(--line-strong); color: var(--text-dim); box-shadow: var(--shadow);
  transition: transform .2s var(--ease), color .2s;
}
.to-top:hover { transform: translateY(-3px); color: var(--text); }
.to-top[hidden] { display: none; }

/* ---------- 页脚 / 底部导航 ---------- */
.footer { position: relative; z-index: 1; border-top: 1px solid var(--line); margin-top: 70px; padding: 40px 20px 110px; background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
.footer__inner { max-width: var(--maxw); margin: 0 auto; }
.footer__brand { display: flex; gap: 14px; align-items: flex-start; }
.footer__brand strong { font-size: 15px; }
.footer__brand p { margin: 4px 0 0; color: var(--text-mute); font-size: 13px; max-width: 520px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 18px; margin: 22px 0 14px; color: var(--text-dim); font-size: 13.5px; }
.footer__links a:hover { color: var(--a1); }
.footer__cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.footer__cats a { font-size: 12.5px; color: var(--text-mute); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }
.footer__cats a:hover { color: var(--text); }
.footer__note { color: var(--text-mute); font-size: 12px; margin: 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: none;
  grid-template-columns: repeat(5, 1fr); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0;
  color: var(--text-mute); font-size: 11px;
}
.tabbar svg { width: 21px; height: 21px; }
.tabbar .is-active { color: var(--a1); }

.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.4px; }
.page-head p { margin: 0; color: var(--text-mute); font-size: 14px; }
.breadcrumb { display: flex; gap: 8px; align-items: center; color: var(--text-mute); font-size: 13px; margin-bottom: 10px; }
.breadcrumb a:hover { color: var(--a1); }

.load-more { display: flex; justify-content: center; margin-top: 28px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--a1); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.error-box { padding: 48px 24px; text-align: center; color: var(--text-dim); }

@media (max-width: 1024px) {
  .search-trigger { min-width: 0; }
  .search-trigger__label, .search-trigger kbd { display: none; }
  .search-trigger { padding: 9px 11px; }
}

@media (max-width: 860px) {
  :root { --topbar-h: 58px; }
  .nav { display: none; }
  .view { padding: 18px 14px 130px; }
  .tabbar { display: grid; }
  .to-top { bottom: 84px; right: 14px; }
  .hero__content { flex-direction: column; align-items: flex-start; padding: 26px 20px; gap: 18px; }
  .hero__poster { width: 132px; }
  .hero__stage { min-height: 0; }
  .hero__slide { position: relative; display: none; }
  .hero__slide.is-active { display: block; }
  .hero__dots { position: static; justify-content: center; padding: 0 0 18px; }
  .detail__top { flex-direction: column; }
  .detail__poster { width: 150px; }
  .filterbar { position: static; }
  .rank-item__tags { display: none; }
  .footer { padding-bottom: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
