:root {
  --bg: #0d1117;
  --card: #161b22;
  --line: #30363d;
  --txt: #e6edf3;
  --muted: #8b949e;
  --acc: #f0b429;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--txt); font-family: var(--font-uy, "ALKATIP Yazma", serif); }
a { color: var(--acc); text-decoration: none; }
.top {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: #010409;
  position: sticky; top: 0; z-index: 20;
}
.logo { font-weight: 700; font-size: 22px; color: #fff; }
.src-btn, .btn, .copy-row button, .rng, .nav a, .cats a, .oauth button {
  background: var(--card); color: var(--txt); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; cursor: pointer; font: inherit;
}
.q { display: flex; gap: 6px; flex: 1; min-width: 180px; }
.q input { flex: 1; background: var(--card); color: var(--txt); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.main { padding: 16px; max-width: 1100px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.card { position: relative; background: var(--card); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; background: #0d1117; }
.card b, .card small { display: block; padding: 0 8px; }
.card small { color: var(--muted); padding-bottom: 8px; }
.card .tag { position: absolute; margin: -2.2em 8px 0; background: #0009; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.card .src-tag {
  position: absolute; top: 8px; left: 8px; right: auto;
  background: #000a; color: #f0b429; padding: 2px 6px; border-radius: 4px; font-size: 11px; max-width: 70%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-scope { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.search-scope a {
  background: var(--card); color: var(--txt); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 12px;
}
.search-scope a.on { background: var(--acc); color: #111; }
.cats { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.cats a.on, .src-cell.on, .ep.on .ep-play, .rng.on { background: var(--acc); color: #111; }
.rank { padding: 0; list-style: none; }
.rank a { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--txt); }
.player-box { background: #000; border-radius: 10px; overflow: hidden; }
.player-box .player,
.player { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 0; overflow: hidden; position: relative; }
.play-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #8b949e; }
.player video,
.player-box video {
  width: 100%;
  height: 100%;
  background: #000;
  outline: none;
  object-fit: contain;
}
.eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 12px; }
.ep { min-width: 0; }
.ep-play {
  width: 100%; background: var(--card); color: var(--acc); font-weight: 700;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 4px; cursor: pointer;
  font: inherit; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ep.on .ep-play { background: var(--acc); color: #111; }
.play-err { margin-top: 8px; background: #5c4a12; color: #ffe08a; padding: 10px; border-radius: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.play-err[hidden], [hidden] { display: none !important; }
.play-err .play-hint { opacity: 0.9; font-size: 0.92em; width: 100%; }
.play-err .alt-box { width: 100%; margin-top: 6px; font-size: 0.9em; }
.play-err .alt-box a { color: #ffe08a; text-decoration: underline; margin-top: 4px; }
.meta { display: grid; grid-template-columns: 140px 1fr; gap: 16px; margin-top: 16px; }
.poster { width: 140px; border-radius: 8px; }
.copy-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.copy-row button:disabled { opacity: 0.6; cursor: wait; }
.copy-hint { margin: 8px 0 0; color: var(--muted, #8b949e); font-size: 0.85em; line-height: 1.4; }
.pick-copy { flex-shrink: 0; }
.ep.hide { display: none; }
.form { max-width: 420px; margin: 24px auto; display: grid; gap: 12px; }
.form input, .form textarea, #siteDomain { width: 100%; padding: 8px; background: var(--card); color: var(--txt); border: 1px solid var(--line); border-radius: 8px; }
.err { color: #ff7b72; } .ok { color: #3fb950; } .hint { color: var(--muted); }
.src-sheet {
  position: fixed; inset: 0; background: #0008; z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
  overscroll-behavior: contain;
}
.src-sheet[hidden] { display: none !important; }
.src-panel {
  background: var(--card); width: 100%; max-width: 640px;
  max-height: min(85vh, 720px);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border-radius: 16px 16px 0 0;
  display: flex; flex-direction: column; gap: 10px;
  box-sizing: border-box;
}
.src-hd { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.src-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1 1 auto; min-height: 0;
  max-height: none;
  padding-bottom: 4px;
  touch-action: pan-y;
}
.src-panel > .btn { flex-shrink: 0; }
.src-cell { text-align: center; padding: 12px 8px; background: #0d1117; border-radius: 8px; color: var(--txt); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(10px); background: #222; padding: 10px 16px; border-radius: 8px; opacity: 0; transition: .2s; z-index: 80; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.wm { pointer-events: none; position: fixed; inset: 0; z-index: 30; opacity: .22; font-size: 13px; overflow: hidden; }
.wm span { position: absolute; white-space: nowrap; transform: rotate(-18deg); }
.ad-modal { position: fixed; inset: 0; background: #000a; z-index: 50; display: flex; align-items: center; justify-content: center; }
.ad-box, .pick-box { background: var(--card); padding: 16px; border-radius: 12px; max-width: 480px; width: 92%; }
.pick-mask { position: fixed; inset: 0; background: #000a; z-index: 60; display: flex; align-items: center; justify-content: center; }
.pick-bd { max-height: 60vh; overflow: auto; }
.pick-row { display: flex; gap: 8px; margin: 6px 0; }
.pick-in { flex: 1; direction: ltr; }
.oauth { display: flex; gap: 8px; }
.who { color: var(--acc); font-weight: 600; }

/* account (aligned with biz.noqi.pro /account, dark theme) */
.acct-wrap { max-width: 560px; margin: 18px auto; }
.acct-hero {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff; border-radius: 14px; padding: 18px; margin-bottom: 14px;
}
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; flex: 0 0 auto;
}
.hero-info { min-width: 0; }
.hero-name { font-size: 1.15rem; font-weight: 700; }
.hero-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.hero-tags .tag { background: rgba(255,255,255,.2); color: #fff; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.hero-tags .tag.vip { background: #fbbf24; color: #78350f; }
.hero-sub { font-size: .8rem; opacity: .85; }
.acct-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px; margin-bottom: 14px;
}
.acct-card label { display: block; margin: 10px 0; font-size: .88rem; color: var(--muted); }
.acct-card input {
  display: block; width: 100%; margin-top: 4px;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; background: #0d1117; color: var(--txt);
}
.acct-label { color: var(--muted); font-size: .86rem; margin-bottom: 8px; }
.acct-label small { color: #6e7681; }
.keyrow { display: flex; align-items: center; gap: 8px; }
.keyrow code {
  flex: 1; background: #0d1117; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: .72rem; word-break: break-all; direction: ltr;
}
.api-doc { margin-top: 10px; }
.api-doc summary { cursor: pointer; color: var(--acc); font-size: .85rem; }
.api-doc pre {
  background: #010409; color: #a5f3fc; border-radius: 10px; padding: 12px 14px;
  font-size: .72rem; line-height: 1.7; overflow-x: auto; margin-top: 8px; direction: ltr; text-align: left;
}
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 6px; }
.plan-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px;
  text-align: center; background: #0d1117;
}
.plan-title { font-weight: 700; font-size: .92rem; }
.plan-days { color: var(--muted); font-size: .8rem; margin: 4px 0; }
.plan-price { color: #f0b429; font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; }
.plan-card .btn { width: 100%; font-size: .82rem; padding: 7px 0; }
.bind-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.bind-row:last-child { border-bottom: 0; }
.ob {
  width: 30px; height: 30px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
  background: #30363d;
}
.ob-qq { background: #12b7f5; }
.ob-alipay { background: #1677ff; }
.ob-douyin { background: #111; }
.bind-name { font-weight: 600; font-size: .9rem; }
.bind-nick { flex: 1; min-width: 0; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-form { display: inline; }
.hist-list { display: flex; flex-direction: column; gap: 8px; }
.hist-row {
  display: flex; gap: 10px; align-items: center;
  padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: #0d1117;
}
.hist-row img { width: 40px; height: 56px; object-fit: cover; border-radius: 6px; background: #161b22; }
.hist-row b { display: block; font-size: .9rem; }
.hist-row small { color: var(--muted); font-size: .75rem; }

@media (max-width: 700px) { .meta { grid-template-columns: 1fr; } .poster { width: 100px; } }
