:root {
  --bg: #0b0d12;
  --card: #141821;
  --card2: #1b2030;
  --line: #262c3b;
  --text: #e8ebf2;
  --muted: #8b93a7;
  --accent: #23ade5;
  --accent2: #1b8fc0;
  --red: #ff5d5d;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Helvetica, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.pre { white-space: pre-line; }
.break { word-break: break-all; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px;
  border-bottom: 1px solid var(--line); background: rgba(11,13,18,.85); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20; }
.brand { color: var(--text); font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 13px; }
.bot-link { font-size: 14px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--text); }
body.tg .topbar, body.tg .foot { display: none; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 18px 14px 40px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; }

/* card */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 16px; }
.fname { font-size: 19px; margin: 0 0 4px; word-break: break-word; line-height: 1.35; }
.sub { color: var(--muted); margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.chip { background: var(--card2); border: 1px solid var(--line); padding: 4px 11px; border-radius: 99px; font-size: 13px; color: #cfd5e3; }
.chip.red { color: var(--red); border-color: rgba(255,93,93,.4); }

/* buttons */
.actions, .players { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--card2); color: var(--text);
  padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: .15s; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent2); }
.btn.small { padding: 7px 13px; font-size: 13px; }
.ext-players { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.ext-players .label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }

/* player (ArtPlayer) */
.player-shell { background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.player { width: 100%; aspect-ratio: 16 / 9; max-height: 78vh; }
@media (max-width: 640px) {
  .wrap { padding: 0 0 30px; }
  .player-shell { border-radius: 0; border-left: 0; border-right: 0; }
  .card { border-radius: 0; border-left: 0; border-right: 0; margin-top: 10px; }
  .tip { margin: 10px 10px 0 !important; }
}
body.tg .wrap { padding-top: 0; }

/* tip */
.tip { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #13202b; border: 1px solid #1f3a4d; color: #bfe6f7; font-size: 14px; }
.tip.warn { background: #2a1d10; border-color: #5a3a14; color: #ffd8a8; }

/* audio */
.audio-card { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.cover { width: 180px; height: 180px; border-radius: 16px; background: linear-gradient(135deg, #23ade5, #6a5cff);
  background-size: cover; background-position: center; display: grid; place-items: center; font-size: 64px;
  position: relative; flex-shrink: 0; box-shadow: 0 10px 30px rgba(35,173,229,.25); }
.eq { position: absolute; bottom: 10px; right: 10px; display: flex; gap: 3px; align-items: flex-end; height: 18px; opacity: 0; }
.eq.on { opacity: 1; }
.eq i { width: 4px; background: #fff; border-radius: 2px; animation: eq 0.9s infinite ease-in-out; }
.eq i:nth-child(2) { animation-delay: .2s } .eq i:nth-child(3) { animation-delay: .4s } .eq i:nth-child(4) { animation-delay: .1s }
@keyframes eq { 0%,100% { height: 4px } 50% { height: 18px } }
.a-main { flex: 1; min-width: 240px; }
.a-title { font-size: 20px; font-weight: 700; word-break: break-word; }
.a-sub { color: var(--muted); margin-bottom: 12px; }
.seek { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seek input { flex: 1; }
input[type=range] { accent-color: var(--accent); }
.a-ctrls { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 14px 0 8px; }
.a-row { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.a-row select { background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.vol { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.vol input { width: 90px; }
.ic { appearance: none; border: 1px solid var(--line); background: var(--card2); color: var(--text); width: 44px; height: 44px;
  border-radius: 50%; font-size: 16px; cursor: pointer; display: inline-grid; place-items: center; }
.ic.big { width: 62px; height: 62px; background: var(--accent); border-color: var(--accent); color: #fff; font-size: 22px; }
.ic.sm { width: 36px; height: 36px; border-radius: 9px; font-size: 16px; }
.ic.active { border-color: var(--accent); color: var(--accent); }

/* pdf */
.pdf-shell { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pdf-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 8px 10px; background: var(--card2); border-bottom: 1px solid var(--line); }
.pdf-bar .grp { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.pdf-bar input { width: 56px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px; text-align: center; }
.pdf-pages { position: relative; height: 80vh; overflow: auto; padding: 12px; background: #525659; }
.pdf-pages .pg { margin: 0 auto 12px; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.4); max-width: none; }
.pdf-pages canvas { display: block; }
.pdf-dark .pdf-pages { background: #1a1a1a; }
.pdf-dark .pdf-pages canvas { filter: invert(.92) hue-rotate(180deg); }
.loading { color: #fff; text-align: center; padding: 60px 10px; }
.pdf-shell:fullscreen .pdf-pages { height: calc(100vh - 54px); }

/* image */
.img-shell { position: relative; background: #000 repeating-conic-gradient(#111 0 25%, #0b0b0b 0 50%) 50% / 24px 24px;
  border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; height: 75vh;
  display: grid; place-items: center; touch-action: none; }
.img-shell img { max-width: 100%; max-height: 100%; transition: transform .15s; cursor: grab; user-select: none; }
.img-tools { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px;
  background: rgba(0,0,0,.6); padding: 6px; border-radius: 12px; }

/* file / center */
.file-hero { text-align: center; }
.file-icon { width: 96px; height: 120px; margin: 10px auto; border-radius: 10px; background: var(--card2);
  border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; color: var(--accent); position: relative; }
.center-card { max-width: 460px; margin: 60px auto 0; text-align: center; }
.center-card h1 { margin: 6px 0; font-size: 22px; }
.big-icon { font-size: 54px; }
.hero { max-width: 560px; }
.pw-form { display: flex; gap: 8px; margin-top: 16px; }
.pw-form input { flex: 1; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.err { color: var(--red); }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(30px); opacity: 0;
  background: #222837; color: #fff; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  transition: .25s; pointer-events: none; z-index: 99; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
