:root {
  --bg-start: #eef8ff;
  --bg-end: #f9fcff;
  --ink: #122335;
  --muted: #37536f;
  --line-a: rgba(118, 190, 255, 0.26);
  --line-b: rgba(86, 165, 238, 0.2);
  --glass: rgba(255, 255, 255, 0.42);
  --glass-border: rgba(255, 255, 255, 0.66);
  --shadow: 0 24px 60px rgba(80, 137, 193, 0.12);
  --brand-a: #58aeea;
  --brand-b: #86c9f5;
  --link: #2d7fbe;
}

:root[data-theme="dark"] {
  --bg-start: #0c1623;
  --bg-end: #111f30;
  --ink: #e8f3ff;
  --muted: #b6cee7;
  --line-a: rgba(125, 196, 255, 0.18);
  --line-b: rgba(108, 179, 247, 0.14);
  --glass: rgba(24, 38, 55, 0.45);
  --glass-border: rgba(188, 220, 251, 0.25);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --brand-a: #70bbea;
  --brand-b: #9fd6f6;
  --link: #9ccff7;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--ink);
}

body {
  background: radial-gradient(circle at 10% 15%, #fbfeff 0%, transparent 45%),
    radial-gradient(circle at 82% 8%, #e7f4ff 0%, transparent 40%),
    linear-gradient(140deg, var(--bg-start), var(--bg-end));
  overflow-x: hidden;
}

.backdrop,
.backdrop::before,
.backdrop::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
}

.backdrop {
  z-index: -2;
}

.backdrop::before {
  background: linear-gradient(115deg, transparent 15%, var(--line-a) 35%, transparent 55%),
    linear-gradient(225deg, transparent 8%, var(--line-b) 38%, transparent 62%);
  filter: blur(2px);
  opacity: 0.9;
  animation: sweep 10s ease-in-out infinite alternate;
}

.backdrop::after {
  background-image: repeating-linear-gradient(
    130deg,
    rgba(255, 255, 255, 0.58) 0,
    rgba(255, 255, 255, 0.58) 1px,
    transparent 1px,
    transparent 24px
  );
  opacity: 0.24;
  animation: drift 16s linear infinite;
}

@keyframes sweep {
  from {
    transform: translateX(-2.5%);
  }
  to {
    transform: translateX(2.5%);
  }
}

@keyframes drift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-22px);
  }
}

.topbar {
  width: min(1120px, calc(100% - 2rem));
  margin: 1.2rem auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
}

.logo {
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 0.03em;
}

nav {
  display: flex;
  gap: 1rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.theme-toggle {
  border: 1px solid rgba(116, 171, 217, 0.35);
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.48rem 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.glass {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  box-shadow: var(--shadow);
  border-radius: 24px;
}

main {
  width: min(1120px, calc(100% - 2rem));
  margin: 2rem auto 3rem;
  display: grid;
  gap: 1.2rem;
}

.hero,
.player-wrap {
  padding: clamp(1.2rem, 2vw, 2rem);
}

.hero {
  display: grid;
  gap: 0.9rem;
}

.eyebrow {
  margin: 0;
  font-weight: 700;
  color: var(--link);
}

h1 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.1;
}

h1 span {
  background: linear-gradient(120deg, var(--brand-a), var(--brand-b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
  align-items: center;
}

input[type="url"],
input[type="text"] {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(117, 173, 218, 0.35);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.72rem 0.95rem;
  font: inherit;
}

:root[data-theme="dark"] input[type="url"],
:root[data-theme="dark"] input[type="text"] {
  background: rgba(20, 31, 45, 0.85);
}

.btn {
  border: 0;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.62rem 1.05rem;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(120deg, var(--brand-a), var(--brand-b));
  color: #fff;
}

.btn.ghost {
  border: 1px solid rgba(99, 162, 210, 0.35);
  color: var(--link);
  background: rgba(255, 255, 255, 0.5);
}

.status {
  min-height: 1.5rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.result-row {
  display: grid;
  gap: 0.5rem;
}

.result-row label {
  font-size: 0.92rem;
  color: var(--muted);
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
}

.player-wrap {
  min-height: 60vh;
}

#player-frame {
  width: 100%;
  min-height: 60vh;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0 1rem 2.1rem;
}

@media (max-width: 820px) {
  .topbar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .input-row,
  .result-actions {
    grid-template-columns: 1fr;
  }

  .btn,
  .theme-toggle {
    width: 100%;
  }
}
