*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

[class^="ri-"]::before, [class*=" ri-"]::before { font-family: remixicon !important; }

:root {
  --chrome: #0b0b0c;
  --toolbar: #171718;
  --panel: #0d0d0e;
  --bg: #080808;
  --line: rgba(255,255,255,0.08);
  --text: #f2f2f2;
  --muted: rgba(242,242,242,0.5);
  --accent: #ffffff;
  --accent-ink: #0a0a0a;
  --accent-soft: rgba(255,255,255,0.14);
}
html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow: hidden;
}
a { color: inherit; }

.rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: 56px;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  padding: 12px 9px 12px;
  background: var(--chrome);
  border-right: 1px solid var(--line);
  z-index: 20;
  overflow: hidden;
  transition: width .18s ease, box-shadow .18s ease;
}
.pk-rail-open .rail { width: 200px; }
.rail a, .rail-toggle {
  position: relative; flex-shrink: 0;
  height: 38px; border-radius: 12px; border: none; background: none; font: inherit;
  display: flex; align-items: center; gap: 12px; padding: 0 10px;
  color: var(--muted); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background .15s, color .15s;
}
.rail a:hover, .rail-toggle:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.rail a.active { background: var(--accent); color: var(--accent-ink); }
.rail i { font-size: 18px; width: 18px; flex-shrink: 0; text-align: center; }
.rail-label { font-size: 13px; font-weight: 500; opacity: 0; transition: opacity .12s ease; }
.pk-rail-open .rail-label { opacity: 1; }
.rail-badge { position: absolute; top: 1px; left: 22px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: #f23f42; color: #fff; font: 700 10px/16px system-ui, sans-serif; text-align: center; box-shadow: 0 0 0 2px var(--chrome); display: none; pointer-events: none; }
.rail-badge.show { display: block; }
.rail-sep { flex-shrink: 0; height: 1px; margin: 4px 6px; background: var(--line); }

.rail-brand { position: relative; flex-shrink: 0; height: 44px; cursor: pointer; border-radius: 12px; outline: none; }
.rail-brand:focus-visible { box-shadow: 0 0 0 2px rgba(255,255,255,0.35); }
.rail-brand img {
  position: absolute; top: 50%; left: 50%; max-width: none;
  user-select: none; -webkit-user-drag: none; pointer-events: none;
  transition: opacity .26s ease, transform .3s cubic-bezier(.2,.7,.3,1);
}
.brand-mark { width: 36px; height: auto; opacity: 1; transform: translate(-50%, -50%) scale(1); }
.brand-word { height: 30px; width: auto; opacity: 0; transform: translate(-50%, -50%) scale(.9); }
.pk-rail-open .brand-mark { opacity: 0; transform: translate(-50%, -50%) scale(.75); }
.pk-rail-open .brand-word { opacity: 1; transform: translate(-50%, -50%) scale(1); transition-delay: .07s; }
.rail .spacer { flex: 1; }

.chrome {
  position: fixed; left: 56px; right: 0; top: 0; height: 100px;
  display: flex; flex-direction: column;
  background: var(--chrome);
  z-index: 10;
}
.tabs {
  height: 50px;
  display: flex; align-items: center; gap: 6px;
  padding: 0 8px 0 6px;
  min-width: 0;
}
.tab-strip {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 2px;
  overflow-x: auto; scrollbar-width: none;
}
.tab-strip::-webkit-scrollbar { display: none; }
#pk-tabs { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.tab {
  position: relative;
  flex: 0 0 var(--tab-w, 240px); width: var(--tab-w, 240px);
  height: 36px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 6px 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted); font-size: 13px; font-weight: 500;
  cursor: pointer; user-select: none; touch-action: none;
  transition: transform .2s cubic-bezier(.2,.7,.3,1), background .15s, color .15s, box-shadow .15s;
}
.tab i { font-size: 14px; flex-shrink: 0; }
.tab .tab-icon { width: 14px; height: 14px; flex-shrink: 0; object-fit: contain; border-radius: 3px; }
.tab:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.tab.active {
  background: var(--toolbar); border-color: var(--line); color: var(--text);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
.tab.active i { color: var(--accent); }
.tab.dragging {
  transition: none; z-index: 3; cursor: grabbing;
  background: var(--toolbar);  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 12px 28px rgba(0,0,0,0.5);
}
.tab .tab-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab .tab-x {
  width: 20px; height: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; background: none; color: inherit;
  font-size: 13px; opacity: .55; cursor: pointer;
}
.tab .tab-x:hover { background: rgba(255,255,255,0.1); opacity: 1; }
.tab-new {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border: none; background: none; color: var(--muted); font-size: 18px; cursor: pointer;
}
.tab-new:hover { color: var(--text); }

.addr {
  flex: 1; min-width: 0;
  margin: 0 8px 8px;
  display: flex; align-items: center; gap: 4px;
  padding: 0 8px;
  background: var(--toolbar);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.addr .nav-btn, .addr .ic {
  width: 30px; height: 30px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); border-radius: 999px; font-size: 16px;
  background: none; border: none; cursor: pointer;
}
.addr .nav-btn:hover:not(:disabled), .addr .ic:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.addr .ic.on { color: var(--accent); }
.url-form {
  flex: 1; max-width: 620px; height: 30px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px; padding: 0 14px;
  border-radius: 999px;
  background: rgba(0,0,0,0.3);
  border: 1px solid transparent;
  font-size: 13px;
}
.url-form:focus-within { border-color: rgba(255,255,255,0.45); }
.url-form i { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.url-form input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: var(--text); font: inherit; font-size: 13px; text-align: center;
}
.url-form input::placeholder { color: var(--muted); }
.addr .right { display: flex; gap: 2px; margin-left: 4px; }
.addr [hidden] { display: none !important; }

.mini-player {
  flex-shrink: 0; height: 36px; margin-left: 4px; padding: 0 8px 0 4px;
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.3); border: 1px solid var(--line); border-radius: 12px;
}
.mini-cover {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 4px;
  object-fit: contain; background: none;
}
.mini-text { width: 110px; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.mini-title, .mini-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-title { font-size: 12px; font-weight: 600; color: var(--text); }
.mini-artist { font-size: 11px; color: var(--muted); }
.mini-btn {
  width: 26px; height: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); border-radius: 999px; font-size: 16px;
  background: none; border: none; cursor: pointer;
}
.mini-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.mini-play { color: var(--text); }
.mini-wave {
  width: 44px; height: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
}
.mini-wave i {
  width: 2px; height: 35%; border-radius: 2px;
  background: var(--muted); opacity: 0.6;
}
.mini-wave i:nth-child(3n) { height: 75%; }
.mini-wave i:nth-child(4n+1) { height: 55%; }
.mini-player.playing .mini-wave i {
  background: var(--accent); opacity: 1;
  animation: mini-bar 0.9s ease-in-out infinite alternate;
}
.mini-player.playing .mini-wave i:nth-child(2n) { animation-delay: -0.4s; }
.mini-player.playing .mini-wave i:nth-child(3n) { animation-delay: -0.7s; }
@keyframes mini-bar { from { height: 25%; } to { height: 100%; } }

.addr .stats {
  flex-shrink: 0; display: flex; align-items: center; gap: 10px;
  margin: 0 6px 0 10px;
  font-size: 12px; font-weight: 500; color: var(--muted);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.stat { display: inline-flex; align-items: center; gap: 6px; }
.stat-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.6); }
.stat-sep { width: 1px; height: 12px; background: var(--line); }

.pk-stage {
  position: fixed; left: 56px; right: 8px; top: 100px; bottom: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.pk-frame {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; display: none; background: var(--panel);
}
.pk-frame.pk-in { animation: pk-fade .16s ease-out; }
@keyframes pk-fade { from { opacity: 0; } to { opacity: 1; } }

.chrome, .pk-stage { transition: left .18s ease; }
.pk-rail-open .chrome { left: 200px; }
.pk-rail-open .pk-stage { left: 208px; }

.pk-rail-hidden .rail { display: none; }
.pk-rail-hidden .chrome { left: 0; }
.pk-rail-hidden .pk-stage { left: 8px; }

.stage {
  position: fixed; inset: 0; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 35%, #1f1f22 0%, #0d0d0e 60%, #080808 100%);
}
.dither-container { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.dither-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 0%, rgba(8,8,8,0.55) 70%, rgba(8,8,8,0.85) 100%);
}
.hero, .search { position: relative; z-index: 2; }
.hero { width: min(640px, 90vw); text-align: center; }
.logo {
  display: block; margin: 0 auto;
  width: min(324px, 46vw); height: auto;
  user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 4px 30px rgba(0,0,0,0.5));
}
.tagline { margin-top: 14px; font-size: 15px; color: rgba(244,238,233,0.85); text-shadow: 0 2px 16px rgba(0,0,0,0.6); }

.notfound-code {
  font-size: clamp(72px, 12vw, 120px);
  font-weight: 600; letter-spacing: -3px; line-height: 1;
  color: var(--text);
  text-shadow: 0 4px 40px rgba(0,0,0,0.45);
}
.notfound-address { font-family: ui-monospace, Consolas, monospace; color: var(--text); word-break: break-all; }
.notfound-home {
  position: relative; z-index: 2;
  margin-top: 34px;
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.notfound-home:hover { filter: brightness(1.06); }

.search {
  margin-top: 34px;
  width: min(640px, 84%);
  height: 54px;
  display: flex; align-items: center;
  padding: 0 8px 0 22px;
  background: rgba(10,10,10,0.6);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
}
.search i.lead { color: var(--muted); font-size: 17px; margin-right: 12px; }
.search input {
  flex: 1; height: 100%; background: none; border: none; outline: none;
  color: var(--text); font: inherit; font-size: 15px;
}
.search input::placeholder { color: var(--muted); }
.search button {
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.search button:hover { filter: brightness(1.08); }

.quick-links {
  position: relative; z-index: 2;
  margin-top: 18px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
  max-width: 92vw;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03)), rgba(10,10,10,0.55);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -1px 0 rgba(255,255,255,0.04), 0 14px 40px rgba(0,0,0,0.35);
}
.quick-link {
  position: relative;
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06); color: var(--text); font-size: 19px;
  transition: background 0.2s, box-shadow 0.2s;
  animation: quick-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  animation-delay: calc(var(--i, 0) * 30ms);
}
.quick-link:hover {
  background: rgba(255,255,255,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 8px 22px rgba(0,0,0,0.3);
}
.quick-link:active { transform: scale(0.95); }
.quick-link img.sc-fav { width: 22px; height: 22px; border-radius: 5px; }
.quick-link::after {
  content: attr(data-name);
  position: absolute; top: calc(100% + 10px); left: 50%;
  transform: translate(-50%, -4px);
  padding: 4px 10px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.04)), rgba(16,16,18,0.55);
  -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.16); color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
  font: 600 12px/1.2 Inter, system-ui, sans-serif; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.quick-link:hover::after { opacity: 1; transform: translate(-50%, 0); }
.quick-links.editing .quick-link::after { display: none; }
.quick-links.editing .quick-link:not(.quick-action) { animation: quick-wiggle 0.45s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * -70ms); }
.quick-sep { width: 1px; height: 28px; margin: 0 6px; background: rgba(255,255,255,0.15); }
.quick-link .sc-x {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.2); background: #2a2a2e; color: #fff;
  font-size: 14px; line-height: 18px; text-align: center;
}
.quick-link .sc-x:hover { background: #3d3d44; }

@keyframes quick-pop {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes quick-wiggle {
  from { rotate: -2.5deg; }
  to { rotate: 2.5deg; }
}

.sc-dialog {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.sc-dialog[hidden] { display: none; }
.sc-card {
  width: min(360px, 90vw); box-sizing: border-box; padding: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03)), rgba(10,10,10,0.6);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.16); border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 24px 60px rgba(0,0,0,0.5);
  display: flex; flex-direction: column; gap: 6px;
}
.sc-card h2 { margin: 0 0 8px; font: 600 18px/1.2 Inter, system-ui, sans-serif; color: var(--text); }
.sc-card label { font: 500 12px/1 Inter, system-ui, sans-serif; color: var(--muted); margin-top: 8px; }
.sc-card input {
  box-sizing: border-box; width: 100%; height: 40px; padding: 0 12px; border-radius: 12px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); outline: none;
  color: var(--text); font: inherit; font-size: 14px;
}
.sc-card input:focus { border-color: rgba(255,255,255,0.4); box-shadow: 0 0 0 4px rgba(255,255,255,0.06); }
.sc-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.sc-btn {
  height: 36px; padding: 0 16px; border-radius: 999px; border: none; cursor: pointer;
  background: rgba(255,255,255,0.08); color: var(--text); font: 600 13px Inter, system-ui, sans-serif;
}
.sc-btn.sc-primary { background: rgba(255,255,255,0.18); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,0.25); }
.sc-btn:hover { filter: brightness(1.08); }

.entry-notice-scrim {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(0,0,0,0.22);
  -webkit-backdrop-filter: blur(12px) saturate(1.1); backdrop-filter: blur(12px) saturate(1.1);
}
.entry-notice {
  position: relative; width: 340px; max-width: 100%; overflow: hidden;
  padding: 22px; border-radius: 22px; color: var(--text);
  background: color-mix(in srgb, var(--toolbar) 78%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(120%); backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0,0,0,0.28);
  font: 13px/1.5 Inter, system-ui, sans-serif;
}
.entry-notice-title { margin: 0 0 6px; font-weight: 600; font-size: 14px; }
.entry-notice-text { margin: 0 0 14px; color: var(--muted); }
.entry-notice-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.entry-notice-btn {
  height: 32px; padding: 0 14px; border-radius: 999px; border: none; cursor: pointer;
  background: rgba(255,255,255,0.18); color: var(--text); font: 600 13px Inter, system-ui, sans-serif;
}
.entry-notice-btn:hover { filter: brightness(1.08); }
.entry-notice-btn-quiet { background: rgba(255,255,255,0.08); }

.pk-embed #nav-widget { display: none !important; }

@media (max-width: 980px) {
  .addr .stats { display: none; }
}
@media (max-width: 720px) {
  .url-form { display: none; }
}
