:root {
  --bg-deep: #050816;
  --ink: #e8f0ff;
  --muted: rgba(210, 224, 255, 0.62);
  --glass: rgba(12, 18, 40, 0.48);
  --glass-strong: rgba(10, 16, 36, 0.72);
  --glass-edge: rgba(160, 220, 255, 0.28);
  --cyan: #5cf0ff;
  --cyan-soft: rgba(92, 240, 255, 0.35);
  --purple: #c084fc;
  --purple-soft: rgba(192, 132, 252, 0.35);
  --pink: #f472b6;
  --ok: #34d399;
  --danger: #fb7185;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --font: "Outfit", "Sora", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --body: "Noto Sans SC", "Outfit", "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius: 22px;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.65);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg-deep);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { appearance: none; border: 0; background: none; cursor: pointer; }
.hidden { display: none !important; }

/* —— wallpaper —— */
.bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 10%, #1a1240 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, #062a3a 0%, transparent 45%),
    linear-gradient(160deg, #0a1630 0%, #12082a 45%, #050816 100%);
}
.bg-layer {
  position: absolute; inset: -3%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1.6s var(--ease), transform 10s linear;
  will-change: opacity, transform;
  filter: saturate(1.15) brightness(0.72);
}
.bg-layer.on {
  opacity: 1;
  transform: scale(1);
}
.bg-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(40% 30% at 15% 12%, rgba(92, 240, 255, 0.22), transparent 70%),
    radial-gradient(35% 28% at 88% 18%, rgba(192, 132, 252, 0.2), transparent 70%),
    radial-gradient(50% 40% at 50% 100%, rgba(244, 114, 182, 0.12), transparent 70%);
  animation: glowPulse 10s ease-in-out infinite alternate;
}
.bg-grain {
  position: absolute; inset: 0; opacity: 0.18; pointer-events: none; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}
.bg-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 8, 22, 0.35) 0%, rgba(5, 8, 22, 0.55) 45%, rgba(5, 8, 22, 0.82) 100%);
}

@keyframes glowPulse {
  from { opacity: 0.75; }
  to { opacity: 1; }
}

/* —— shell —— */
.shell {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 1.25rem));
  margin: 0 auto;
  padding: 1rem 0 calc(5.5rem + env(safe-area-inset-bottom));
}

.glass-card,
.glass-bar {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.neon-cyan {
  border-color: rgba(92, 240, 255, 0.42);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(92, 240, 255, 0.12),
    0 0 36px -10px rgba(92, 240, 255, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.neon-purple {
  border-color: rgba(192, 132, 252, 0.42);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(192, 132, 252, 0.1),
    0 0 32px -12px rgba(192, 132, 252, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* views / transitions */
.view { width: 100%; }
.view.fade-out {
  animation: fadeOut 0.28s var(--ease) both;
}
.view.slide-in {
  animation: slideIn 0.42s var(--ease) both;
}
.view-home.slide-in {
  animation: slideInBack 0.42s var(--ease) both;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(28px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes slideInBack {
  from { opacity: 0; transform: translateX(-22px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateX(-12px) scale(0.99); }
}
@keyframes enterUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes cardPop {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes eq {
  0%, 100% { transform: scaleY(0.35); }
  50% { transform: scaleY(1); }
}
@keyframes ringSpin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* music fab */
.music-fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 60;
  width: 54px; height: 54px;
  border-radius: 18px;
  background: rgba(10, 16, 36, 0.78);
  border: 1px solid rgba(92, 240, 255, 0.4);
  color: var(--cyan);
  box-shadow: 0 12px 40px -16px rgba(92, 240, 255, 0.55);
  display: grid; place-items: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.4s var(--spring), background 0.25s, box-shadow 0.25s;
}
.music-fab:hover { transform: translateY(-3px) scale(1.05); }
.music-fab:active { transform: scale(0.96); }
.music-fab.on {
  background: linear-gradient(145deg, rgba(92, 240, 255, 0.28), rgba(192, 132, 252, 0.28));
  box-shadow: 0 0 28px rgba(92, 240, 255, 0.45);
}
.music-eq { display: flex; align-items: flex-end; gap: 3px; height: 16px; }
.music-eq i {
  display: block; width: 3px; height: 14px; border-radius: 2px;
  background: currentColor; transform-origin: bottom; transform: scaleY(0.4);
}
.music-fab.on .music-eq i { animation: eq 0.75s ease-in-out infinite; }
.music-fab.on .music-eq i:nth-child(2) { animation-delay: 0.12s; }
.music-fab.on .music-eq i:nth-child(3) { animation-delay: 0.24s; }
.music-fab.on .music-eq i:nth-child(4) { animation-delay: 0.08s; }

/* topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: 18px;
  margin-bottom: 0.9rem;
  animation: enterUp 0.7s var(--ease) both;
}
.topbar-brand {
  display: flex; align-items: center; gap: 0.45rem;
  font-family: var(--font);
  min-width: 0;
}
.topbar-brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  flex-shrink: 0;
  animation: glowPulse 2.4s ease-in-out infinite alternate;
}
.topbar-brand strong { font-weight: 800; letter-spacing: 0.04em; }
.topbar-brand em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(160, 220, 255, 0.22);
  transition: background 0.2s, border-color 0.2s, transform 0.25s var(--spring);
}
.chip:hover {
  background: rgba(92, 240, 255, 0.12);
  border-color: rgba(92, 240, 255, 0.45);
  transform: translateY(-1px);
}
.chip.ghost { background: transparent; }

/* hero */
.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 4px);
  padding: 1.35rem 1.15rem 1.2rem;
  text-align: center;
  margin-bottom: 0.85rem;
  animation: enterUp 0.8s var(--ease) 0.05s both;
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(92, 240, 255, 0.14), transparent 65%);
  pointer-events: none;
}
.hero-ring {
  position: absolute;
  left: 50%; top: 1.1rem;
  width: 118px; height: 118px;
  margin-left: -59px;
  border-radius: 50%;
  border: 1px dashed rgba(92, 240, 255, 0.35);
  animation: ringSpin 18s linear infinite;
  pointer-events: none;
}
.avatar {
  position: relative;
  width: 92px; height: 92px;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--cyan), var(--purple), var(--pink));
  background-size: 200% 200%;
  animation: shimmer 6s linear infinite alternate;
  box-shadow: 0 0 28px rgba(92, 240, 255, 0.35);
  z-index: 1;
}
.avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #111827;
  border: 3px solid rgba(5, 8, 22, 0.85);
}
.hero-copy { position: relative; z-index: 1; }
.hero-copy .brand {
  margin: 0;
  font-family: var(--font);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.28em;
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(92, 240, 255, 0.45);
}
.hero-copy h1 {
  margin: 0.25rem 0 0.35rem;
  font-family: var(--font);
  font-size: clamp(1.55rem, 5vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.02em;
}
.hero-copy .lead {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.cta, .neon-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: min(280px, 100%);
  padding: 0.85rem 1.2rem;
  border-radius: 16px;
  color: #041018;
  font-weight: 700;
  background: linear-gradient(120deg, #5cf0ff 0%, #a78bfa 55%, #f472b6 100%);
  background-size: 160% 160%;
  box-shadow: 0 12px 32px -12px rgba(92, 240, 255, 0.65);
  transition: transform 0.35s var(--spring), filter 0.2s, background-position 0.5s;
}
.cta small { font-weight: 500; opacity: 0.75; font-size: 0.72rem; }
.cta:hover {
  transform: translateY(-2px) scale(1.02);
  background-position: 100% 50%;
  filter: brightness(1.05);
}
.cta:active { transform: scale(0.98); }

/* notice */
.notice {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.8rem;
  border-radius: 14px;
  margin-bottom: 1.1rem;
  overflow: hidden;
  animation: enterUp 0.85s var(--ease) 0.08s both;
}
.notice-label {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.5rem;
  border-radius: 8px;
  color: #1a0b2e;
  background: linear-gradient(120deg, #c084fc, #5cf0ff);
}
.notice-track {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.notice-text {
  margin: 0;
  display: inline-block;
  white-space: nowrap;
  font-size: 0.82rem;
  color: rgba(232, 240, 255, 0.88);
  animation: marquee 22s linear infinite;
  padding-right: 0;
  min-width: 100%;
}
.notice-text.dup {
  display: inline-block;
}
.notice-text.dup::after {
  content: "　" attr(data-copy);
  padding-left: 3rem;
}

/* home grid */
.home-grid-wrap { margin-bottom: 1rem; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.7rem;
  padding: 0 0.15rem;
}
.section-head h2 {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
}
.section-head span {
  color: var(--muted);
  font-size: 0.78rem;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
@media (min-width: 560px) {
  .home-grid { grid-template-columns: repeat(3, 1fr); }
}
.brand-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 1.1rem 0.85rem 1rem;
  text-align: center;
  background: var(--glass-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(92, 240, 255, 0.28);
  box-shadow:
    0 16px 40px -24px rgba(0, 0, 0, 0.7),
    0 0 24px -12px rgba(92, 240, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.35s var(--spring), border-color 0.2s, box-shadow 0.25s;
  animation: cardPop 0.55s var(--ease) both;
}
.brand-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(80% 60% at 50% 0%, rgba(92, 240, 255, 0.16), transparent 70%);
  pointer-events: none;
}
.brand-card:nth-child(3n) {
  border-color: rgba(192, 132, 252, 0.35);
  box-shadow:
    0 16px 40px -24px rgba(0, 0, 0, 0.7),
    0 0 24px -12px rgba(192, 132, 252, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.brand-card:nth-child(3n+2) {
  border-color: rgba(244, 114, 182, 0.32);
}
.brand-card:hover,
.brand-card:focus-visible {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(92, 240, 255, 0.65);
  outline: none;
}
.brand-card:active { transform: scale(0.98); }
.brand-card .ico {
  font-size: 1.85rem;
  line-height: 1;
  margin-bottom: 0.55rem;
  filter: drop-shadow(0 0 10px rgba(92, 240, 255, 0.35));
}
.brand-card .name {
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.brand-card .hint {
  margin-top: 0.3rem;
  font-size: 0.7rem;
  color: var(--muted);
}
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--muted);
  border-radius: 16px;
  border: 1px dashed rgba(160, 220, 255, 0.25);
  background: rgba(8, 12, 28, 0.35);
}

/* rules */
.rules {
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  margin-bottom: 1.2rem;
  animation: enterUp 0.9s var(--ease) 0.12s both;
}
.rules h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font);
  font-size: 0.95rem;
}
.rules ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.7;
}
.foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.6;
  opacity: 0.85;
}

/* browse */
.browse-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 16px;
  margin-bottom: 0.85rem;
}
.back-btn {
  width: 36px; height: 36px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: var(--cyan);
  background: rgba(92, 240, 255, 0.1);
  border: 1px solid rgba(92, 240, 255, 0.28);
  flex-shrink: 0;
  transition: transform 0.25s var(--spring), background 0.2s;
}
.back-btn:hover { transform: scale(1.06); background: rgba(92, 240, 255, 0.18); }
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  align-items: center;
  min-width: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.crumbs button,
.crumbs span {
  color: inherit;
  max-width: 9em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crumbs button {
  color: rgba(232, 240, 255, 0.9);
  font-weight: 600;
}
.crumbs button:hover { color: var(--cyan); }
.crumbs .sep { opacity: 0.45; }

.browse-panel {
  border-radius: calc(var(--radius) + 2px);
  padding: 0.9rem 0.7rem 0.75rem;
  background: rgba(6, 10, 24, 0.68);
}
.browse-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.15rem 0.35rem 0.75rem;
}
.browse-head h2 {
  margin: 0;
  font-family: var(--font);
  font-size: 1.15rem;
}
.browse-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.table-wrap { overflow: hidden; border-radius: 14px; }
.file-table {
  border: 1px solid rgba(92, 240, 255, 0.18);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(4, 8, 20, 0.62);
}
.file-head,
.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.2rem 7.2rem;
  gap: 0.4rem;
  align-items: center;
  padding: 0.7rem 0.75rem;
}
.file-head {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(210, 224, 255, 0.55);
  background: rgba(92, 240, 255, 0.06);
  border-bottom: 1px solid rgba(160, 220, 255, 0.12);
}
.file-row {
  width: 100%;
  text-align: left;
  color: var(--ink);
  border-bottom: 1px solid rgba(160, 220, 255, 0.08);
  transition: background 0.2s, transform 0.25s var(--spring);
  animation: enterUp 0.4s var(--ease) both;
}
.file-row:last-child { border-bottom: 0; }
.file-row:hover {
  background: rgba(92, 240, 255, 0.08);
}
.file-row.is-folder:active { transform: scale(0.99); }
.file-name {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.file-ico {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 1.05rem;
  background: rgba(92, 240, 255, 0.1);
  border: 1px solid rgba(92, 240, 255, 0.2);
}
.file-row.is-link .file-ico {
  background: rgba(192, 132, 252, 0.12);
  border-color: rgba(192, 132, 252, 0.28);
}
.file-title {
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-size,
.file-time {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.file-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 420px) {
  .file-head,
  .file-row {
    grid-template-columns: minmax(0, 1fr) 3.4rem;
  }
  .file-head span:last-child,
  .file-time { display: none; }
  .topbar-brand em { display: none; }
  .shell { width: min(100%, calc(100% - 0.9rem)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .notice-text { animation: none; }
}
