:root {
  --bg: #0b0b0e;
  --surface: #141418;
  --surface-2: #1b1b21;
  --surface-3: #24242b;
  --line: #2a2a32;
  --text: #ececf1;
  --text-2: #c4c4cd;
  --muted: #8e8e9a;
  --accent: #ffb454;
  --accent-ink: #1c1206;
  --accent-soft: rgba(255, 180, 84, 0.12);
  --danger: #f08a7e;
  --ok: #7fd1a0;
  --radius: 12px;
  --radius-sm: 8px;
  --bar-h: 60px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
svg { flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(255, 180, 84, 0.35); }

.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 16px; height: 16px; }
.i.fill { fill: currentColor; }

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--bar-h);
  display: flex; align-items: center; gap: 28px; padding: 0 24px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand img { width: 30px; height: 30px; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav a { position: relative; text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: var(--radius-sm); white-space: nowrap; transition: color .15s, background-color .15s; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--text); }
.nav a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -11px; height: 2px; background: var(--accent); border-radius: 2px; }
.topbar .end { margin-left: auto; display: flex; align-items: center; gap: 4px; }

main { max-width: 1280px; margin: 0 auto; padding: 32px 24px 72px; outline: none; }
main.flush { display: none; }

h1 { font-size: 30px; line-height: 1.15; margin: 0 0 6px; letter-spacing: -0.025em; }
h2 { font-size: 17px; margin: 40px 0 14px; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 10px; }
h2 a { font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; margin-left: auto; }
h2 a:hover { color: var(--text); }
.sub { color: var(--muted); margin: 0 0 24px; }
.muted { color: var(--muted); }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { margin: 0; }
kbd { font: 12px var(--mono); padding: 1px 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 0; background: var(--accent); color: var(--accent-ink);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: filter .15s, background-color .15s;
}
.btn:hover { filter: brightness(1.07); }
.btn.ghost { background: var(--surface-2); color: var(--text); font-weight: 500; }
.btn.ghost:hover { filter: none; background: var(--surface-3); }
.btn.quiet { background: transparent; color: var(--text-2); font-weight: 500; }
.btn.quiet:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px rgba(240, 138, 126, 0.35); }
.btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--radius-sm); border: 0;
  background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; transition: color .15s, background-color .15s;
}
.icon-btn:hover, .icon-btn.active { background: var(--surface-2); color: var(--text); }
.input, .select {
  height: 40px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); outline: none; min-width: 0; transition: border-color .15s;
}
.input:focus, .select:focus { border-color: var(--accent); }
.select { padding-right: 32px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238e8e9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; color: var(--muted); }
.search { position: relative; flex: 1 1 260px; }
.search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { width: 100%; padding-left: 40px; padding-right: 44px; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.search .input:focus ~ kbd, .search .input:not(:placeholder-shown) ~ kbd { display: none; }

.hero { padding: 56px 0 8px; max-width: 760px; }
.hero-mark { width: 72px; height: 72px; margin-bottom: 20px; }
.hero h1 { font-size: 46px; letter-spacing: -0.035em; }
.hero .sub { font-size: 17px; margin-bottom: 0; }
.omnibox {
  display: flex; align-items: center; gap: 6px; margin-top: 28px; padding: 6px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); transition: border-color .15s;
}
.omnibox:focus-within { border-color: var(--accent); }
.omnibox input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 0; background: transparent; outline: none; font-size: 16px; }
.omnibox .btn { height: 44px; padding: 0 20px; border-radius: 10px; }
.engine-pill {
  height: 44px; padding: 0 30px 0 12px; border-radius: 10px; border: 0; background-color: var(--surface-2);
  color: var(--text-2); font-size: 14px; font-weight: 500;
}
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  height: 32px; padding: 0 13px; border-radius: 999px; border: 0; background: var(--surface);
  color: var(--text-2); cursor: pointer; font-size: 13px; transition: background-color .15s, color .15s;
}
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.on { background: var(--accent-soft); color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 40px; }
.tile {
  display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface);
  text-decoration: none; transition: background-color .15s;
}
.tile:hover { background: var(--surface-2); }
.tile .i { color: var(--accent); margin-bottom: 8px; }
.tile strong { font-size: 16px; }
.tile span { color: var(--muted); font-size: 14px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.count { color: var(--muted); font-size: 13px; margin-left: auto; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 18px 14px; }
.grid.posters { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); }
.card { position: relative; display: block; text-align: left; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--radius); min-width: 0; color: inherit; }
.card .thumb { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.posters .card .thumb { aspect-ratio: 2 / 3; }
.card.wide .thumb { aspect-ratio: 16 / 9; }
.card img { position: relative; width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.card:hover img { transform: scale(1.04); }
.card:hover .thumb { box-shadow: 0 0 0 2px var(--accent); }
.card .name { display: block; margin-top: 9px; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card:focus-visible { outline-offset: 4px; }
.letter { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 600; background: var(--surface); color: #43434d; }
.poster, .episode .thumb { position: relative; }
.poster img, .episode .thumb img { position: relative; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0, 0, 0, .55); }
.progress i { display: block; height: 100%; background: var(--accent); }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 168px); gap: 14px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.row.wide { grid-auto-columns: minmax(240px, 280px); }
.more { display: flex; justify-content: center; margin-top: 28px; }
.empty { grid-column: 1 / -1; padding: 48px 20px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); }
.skeleton .thumb { animation: pulse 1.4s ease-in-out infinite; }
.skeleton .name, .skeleton .meta { height: 11px; margin-top: 10px; border-radius: 4px; background: var(--surface); width: 70%; }
.skeleton .meta { width: 45%; margin-top: 7px; }
@keyframes pulse { 50% { opacity: .55; } }
.notice { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); font-size: 14px; margin-bottom: 16px; }
.notice.err { color: #f6b8b0; background: rgba(240, 138, 126, 0.08); }
code { font-family: var(--mono); font-size: 13px; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }

.browser { position: fixed; inset: var(--bar-h) 0 0 0; display: flex; flex-direction: column; background: var(--bg); z-index: 10; }
.browser-bar { position: relative; display: flex; align-items: center; gap: 4px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.address { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; margin: 0 6px; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid transparent; transition: border-color .15s; }
.address:focus-within { border-color: var(--accent); }
.address input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 0; background: transparent; outline: none; font-size: 14px; }
.address .engine-pill { height: 32px; border-radius: 999px; font-size: 13px; padding: 0 28px 0 12px; background-position: right 8px center; }
.loadbar { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--accent); opacity: 0; transition: width 2.5s cubic-bezier(.1,.7,.2,1), opacity .3s; }
.loadbar.on { width: 85%; opacity: 1; }
.loadbar.done { width: 100%; opacity: 0; transition: width .2s, opacity .4s .2s; }
.browser-frame { position: relative; flex: 1; background: #fff; }
.browser-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.blank { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg); color: var(--muted); text-align: center; padding: 24px; }
.blank > div { max-width: 460px; }
.blank img { width: 56px; height: 56px; margin: 0 auto 18px; }
.blank h3 { color: var(--text); font-size: 20px; margin: 0 0 6px; letter-spacing: -0.01em; }
.blank p { margin: 0 0 18px; }
.blank .quick { justify-content: center; }

.player { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: #000; }
.player-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.player-bar .title { display: flex; flex-direction: column; min-width: 0; margin-left: 6px; }
.player-bar strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.25; }
.player-bar small { color: var(--muted); font-size: 12px; }
.player-bar .fav.on { color: var(--accent); }
.spacer { flex: 1; }
.player-stage { position: relative; flex: 1; }
.player-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player-stage .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }

.panel { max-width: 400px; margin: 48px auto; padding: 28px; background: var(--surface); border-radius: 16px; }
.panel h1 { font-size: 22px; }
.panel .btn { width: 100%; }
.panel .mark { width: 40px; height: 40px; margin-bottom: 16px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 20px; color: var(--muted); font-size: 14px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.detail { display: grid; grid-template-columns: 230px 1fr; gap: 32px; align-items: start; }
.detail .poster { border-radius: var(--radius); overflow: hidden; background: var(--surface); aspect-ratio: 2/3; }
.detail .poster img { width: 100%; height: 100%; object-fit: cover; }
.detail h1 { font-size: 34px; }
.detail p.overview { color: var(--text-2); max-width: 70ch; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 14px; margin: 6px 0 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.episodes { display: grid; gap: 8px; }
.episode { display: grid; grid-template-columns: 184px 1fr; gap: 16px; padding: 10px; border-radius: var(--radius); background: transparent; border: 0; cursor: pointer; text-align: left; transition: background-color .15s; }
.episode:hover { background: var(--surface); }
.episode .thumb { aspect-ratio: 16/9; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.episode .thumb img { width: 100%; height: 100%; object-fit: cover; }
.episode strong { display: block; margin-top: 2px; }
.episode p { margin: 4px 0 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-wrap { position: fixed; inset: 0; z-index: 45; background: #000; display: flex; flex-direction: column; }
.video-wrap video { flex: 1; width: 100%; min-height: 0; background: #000; }

.settings { max-width: 760px; }
.section { padding: 24px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; padding-top: 8px; }
.section h2 { margin: 0 0 4px; }
.section > .sub { margin-bottom: 16px; font-size: 14px; }
.options { display: grid; gap: 4px; }
.option { display: grid; grid-template-columns: 20px 1fr auto; gap: 14px; align-items: start; padding: 14px 16px; border-radius: var(--radius); cursor: pointer; transition: background-color .15s; }
.option:hover { background: var(--surface); }
.option.on { background: var(--surface); box-shadow: inset 0 0 0 1px rgba(255, 180, 84, 0.45); }
.option.off { cursor: default; opacity: .55; }
.option.off:hover { background: transparent; }
.option input { margin: 3px 0 0; accent-color: var(--accent); width: 16px; height: 16px; }
.option strong { display: block; font-weight: 600; }
.option span { display: block; color: var(--muted); font-size: 14px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.bad { background: rgba(240, 138, 126, 0.1); color: var(--danger); }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.cx { position: fixed; inset: var(--bar-h) 0 0 0; z-index: 10; display: flex; flex-direction: column; background: #0b0b0e; }
.cx-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 18px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.cx-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.cx-bar .dot.off { background: var(--muted); }
.cx-term { flex: 1; min-height: 0; padding: 10px 6px 6px 14px; }
.cx-term .xterm { height: 100%; }
.cx-ended { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: var(--radius); background: var(--surface-2); color: var(--text-2); font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 10px; background: var(--surface-3); color: var(--text); font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

@media (max-width: 720px) {
  :root { --bar-h: 56px; }
  .topbar { gap: 12px; padding: 0 12px; }
  .brand span { display: none; }
  .nav a { padding: 8px 10px; }
  .nav a.active::after { bottom: -9px; left: 10px; right: 10px; }
  main { padding: 20px 16px 56px; }
  .hero { padding-top: 16px; }
  .hero h1 { font-size: 34px; }
  .hero-mark { width: 56px; height: 56px; }
  .omnibox { flex-wrap: wrap; }
  .omnibox input { flex-basis: 100%; order: -1; }
  .omnibox .engine-pill { flex: 1; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 14px 10px; }
  .detail { grid-template-columns: 1fr; }
  .detail .poster { max-width: 200px; }
  .episode { grid-template-columns: 120px 1fr; }
  .browser-bar { padding: 8px; }
  .browser-bar [data-act="forward"], .browser-bar [data-act="fullscreen"] { display: none; }
  .address .engine-pill { max-width: 112px; }
  .player-bar .label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

#corner { position: fixed; top: 0; right: 0; width: 44px; height: 44px; z-index: 35; }
.nav-gear svg { width: 18px; height: 18px; }
