:root {
  --bg: #000000;
  --card: #0a1016;
  --text: #f3f6f8;
  --muted: #8b9aaa;
  --line: rgba(0, 229, 255, 0.18);
  --cyan: #00e5ff;
  --cyan2: #2ee6d6;
  --ok: #3dff9a;
  --warn: #f0c674;
  --bad: #ff6b6b;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, Consolas, monospace;
  color-scheme: dark;
  font-family: var(--font);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
}
button, input, select { font: inherit; color: inherit; }

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(0, 90, 100, 0.35), transparent 60%),
    url("/assets/hero-space.png") right 8% top 0 / min(900px, 70vw) auto no-repeat,
    #000;
  opacity: 0.9;
  mask-image: linear-gradient(180deg, #000 0%, #000 42%, transparent 78%);
}

.page {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  height: 56px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.03em;
}
.brand span { color: var(--cyan); }
.nav {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
}
.nav a.on, .nav a:hover { color: var(--cyan); }
.status { display: flex; gap: 10px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}
.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warn);
}
.pill.ok::before { background: var(--ok); }
#crawl-connection.is-live::before { background: var(--ok); }
#crawl-connection.is-connecting::before { background: var(--warn); }
#crawl-connection.is-offline::before { background: var(--bad); }

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 0 48px;
}
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 72px 0 48px;
  position: relative;
}
.home-hero::before {
  content: "";
  position: absolute;
  top: 18%;
  left: 50%;
  width: min(520px, 80vw);
  height: 180px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0, 229, 255, 0.22), transparent 68%);
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}
.home-hero > * { position: relative; z-index: 1; }

.logo {
  margin: 0;
  font-size: clamp(52px, 8vw, 92px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #e8eef4;
  overflow: visible;
}
.home-hero .logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.04em;
  font-size: clamp(72px, 14vw, 148px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.25;
  padding: 0.2em 0.35em;
  overflow: visible;
  filter: drop-shadow(0 0 22px rgba(0, 229, 255, 0.28));
  animation: logo-in 900ms ease both;
}
.home-hero .logo-lyric,
.home-hero .logo-x {
  display: inline-block;
  line-height: 1.25;
  padding: 0.06em 0.02em;
  overflow: visible;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.home-hero .logo-lyric {
  background-image: linear-gradient(185deg, #ffffff 10%, #e8eef4 42%, #9aa8b8 100%);
}
.home-hero .logo-x {
  background-image: linear-gradient(180deg, #9af9ff 0%, #00e5ff 48%, #12b8c8 100%);
  filter: drop-shadow(0 0 14px rgba(0, 229, 255, 0.75));
}
.logo-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(360px, 70%);
  margin: 18px 0 8px;
  color: var(--cyan);
}
.logo-rule > span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}
.logo-rule svg {
  width: 46px;
  height: 16px;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.7));
}
.home-hero h1 {
  margin: 14px 0 0;
  font-size: clamp(24px, 3.2vw, 36px);
  font-weight: 750;
  letter-spacing: -0.02em;
  color: #fff;
}
@keyframes logo-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  min-width: 220px;
  padding: 14px 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #5ef0e0, var(--cyan2));
  color: #041014;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 0 32px rgba(0, 229, 255, 0.4);
}
.cta:hover { filter: brightness(1.06); }
.back {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
}
.back:hover { color: var(--cyan); }
.search-layout {
  width: min(1080px, 100%);
  margin-top: 28px;
  display: grid;
  grid-template-columns: minmax(280px, 480px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  text-align: left;
}
.search-page .hero { padding-bottom: 32px; }
.search-page .card { margin-top: 0; width: 100%; }
.search-page .result {
  margin: 0;
  min-height: 420px;
}
.bg-search {
  mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 90%);
}
.hero h1 {
  margin: 16px 0 0;
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 750;
  letter-spacing: 0.05em;
}
.sub {
  margin: 12px 0 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.card {
  width: min(480px, 100%);
  margin-top: 28px;
  padding: 24px;
  text-align: left;
  background: rgba(8, 14, 20, 0.94);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 14px;
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.08), 0 20px 50px rgba(0,0,0,.5);
}
.card label { display: block; margin-bottom: 12px; }
.card label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}
.card input[type="text"],
.card input[type="number"] {
  width: 100%;
  padding: 11px 12px;
  background: #05080c;
  border: 1px solid rgba(140, 160, 180, 0.2);
  border-radius: 8px;
  outline: 0;
}
.card input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.2), 0 0 16px rgba(0, 229, 255, 0.2);
  caret-color: var(--cyan);
}
.card input::placeholder { color: #5a6a78; }
.row {
  display: grid;
  grid-template-columns: 1.4fr .8fr;
  gap: 10px;
}
.check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px !important;
  cursor: pointer;
}
.check span { margin: 0 !important; }
.check input { accent-color: var(--cyan); width: 15px; height: 15px; }

.card button[type="submit"] {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #5ef0e0, var(--cyan2));
  color: #041014;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 28px rgba(0, 229, 255, 0.35);
}
.card button[type="submit"] span { pointer-events: none; }
.card button[type="submit"] i { font-style: normal; margin-left: auto; }
.card button[type="submit"]:disabled { opacity: .55; cursor: wait; box-shadow: none; }
.hint {
  margin: 10px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.hint.is-error { color: var(--bad); }

.stats { margin-bottom: 20px; }
.stats h2 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 700;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(6, 12, 16, 0.85);
}
.stats-grid article {
  padding: 18px 16px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 110px;
}
.stats-grid article:nth-child(3n) { border-right: 0; }
.stats-grid article:nth-child(n+4) { border-top: 1px solid var(--line); }
.stats-grid article:last-child { border-right: 0; }
.stats-grid span { color: var(--muted); font-size: 12px; }
.stats-grid strong {
  color: var(--cyan);
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.3);
  line-height: 1;
}
.stats-grid em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}
#collected-today-delta { color: var(--ok); }

.boards {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}
.board {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 12, 16, 0.88);
  overflow: hidden;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.boards .board {
  height: 560px;
}
.board > header,
.entries-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.board h3 { margin: 0; font-size: 14px; }
.board small { color: var(--muted); font-size: 11px; }
.scroll { overflow: visible; }
.scroll-fixed {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.scroll-fixed table {
  width: 100%;
  height: 100%;
  table-layout: fixed;
}
.scroll-fixed thead th {
  height: 36px;
}
.scroll-fixed tbody tr {
  height: calc((100% - 36px) / 10);
}
.scroll-fixed tbody tr.pad-row td {
  border-bottom-color: transparent;
  color: transparent;
  user-select: none;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th, td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.08);
  text-align: left;
  white-space: nowrap;
}
th {
  position: static;
  background: #070d12;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .06em;
}
.source-name strong, .source-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-name small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.num-cell { font-variant-numeric: tabular-nums; }
.status-ok, .status-bad {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status-ok { color: var(--ok); }
.status-bad { color: var(--bad); }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 8px currentColor;
}
.log-time { font-family: var(--mono); font-size: 11px; }
.log-source { color: var(--muted); }
.log-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 650;
}
.tag-new { color: var(--cyan); background: rgba(0,229,255,.12); }
.tag-update { color: var(--warn); background: rgba(240,198,116,.12); }
.tag-error { color: var(--bad); background: rgba(255,107,107,.12); }
.log-content {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.empty-table { text-align: center; color: var(--muted); padding: 28px; }
.entry-state { color: var(--cyan); }
#recent-entries td:first-child {
  white-space: normal;
  vertical-align: top;
}
#recent-entries td:first-child strong,
#recent-entries td:first-child small {
  display: block;
}
#recent-entries td:first-child strong {
  margin-bottom: 8px;
  line-height: 1.35;
}
#recent-entries td:first-child small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.filters { display: flex; gap: 10px; }
.filters label {
  display: flex; align-items: center; gap: 6px;
  margin: 0; font-size: 11px; color: var(--muted);
}
select {
  background: #05080c;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
}

.result-wrap { margin-bottom: 24px; }
.result {
  min-height: 320px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 12, 16, 0.88);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.lyrics-stage {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 8px 8px;
}
#stage-clock {
  color: var(--cyan);
  font-family: var(--mono);
  letter-spacing: .14em;
  font-size: 12px;
  margin-bottom: 18px;
}
.stage-placeholder {
  color: var(--muted);
}
.stage-placeholder p {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 20px;
}
.stage-placeholder[hidden],
.stage-lines[hidden] {
  display: none !important;
}
.stage-lines {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.stage-line {
  margin: 0;
  max-width: 100%;
  line-height: 1.45;
  will-change: transform, opacity;
}
.stage-line.is-past-2 {
  font-size: 14px;
  color: rgba(232, 244, 248, 0.28);
}
.stage-line.is-past-1 {
  font-size: 16px;
  color: rgba(232, 244, 248, 0.48);
}
.stage-line.is-current {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  text-shadow: 0 0 24px rgba(0, 229, 255, 0.18);
}
.stage-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 22px;
}
.stage-actions[hidden] { display: none !important; }
.stage-actions button {
  min-width: 96px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.stage-actions button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.stage-actions button.is-active {
  background: rgba(0, 229, 255, 0.12);
  border-color: var(--cyan);
  color: var(--cyan);
}
.empty {
  min-height: 260px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}
.empty span { color: var(--cyan); font-family: var(--mono); letter-spacing: .14em; font-size: 12px; }
.empty p { margin: 12px 0 4px; color: var(--text); font-size: 20px; }
#result-content > header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  align-items: flex-start;
}
#result-cover {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 auto;
  background: rgba(255,255,255,.04);
  display: block;
}
.result-cover-wrap {
  flex: 0 0 auto;
  width: 120px;
}
.cover-source {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  letter-spacing: .02em;
  word-break: break-all;
}
#result-artist {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
#result-title {
  margin: 4px 0;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -.03em;
}
#result-album { margin: 0; color: var(--muted); }
#result-provider {
  height: fit-content;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cyan);
  font-size: 10px;
  text-transform: uppercase;
}
#result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 0;
}
#result-meta span {
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(0,229,255,.1);
  color: var(--muted);
  font-size: 11px;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.toolbar button {
  padding: 7px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
}
.toolbar button.is-active {
  background: var(--cyan);
  color: #041014;
  border-color: var(--cyan);
}
.toolbar button:disabled { opacity: .4; cursor: not-allowed; }
.lyrics-clock {
  display: inline-block;
  min-width: 3.2em;
  margin: 0 8px 0 4px;
  color: var(--cyan);
  font-family: var(--mono);
  letter-spacing: .08em;
  font-size: 12px;
}
.suggest-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-height: 240px;
  overflow: auto;
  border-top: 1px solid var(--line);
}
.suggest-list li { margin: 0; }
.suggest-list button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  padding: 10px 4px;
  cursor: pointer;
  font: inherit;
}
.suggest-list button:hover { color: var(--cyan); }
.suggest-list small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.lyrics-panel {
  margin: 0;
  max-height: 480px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 2.1;
}
.lrc-line {
  padding: 2px 8px;
  color: var(--muted);
  border-radius: 6px;
  transition: color .15s ease, background .15s ease;
}
.lrc-line.is-active {
  color: var(--text);
  background: rgba(0, 229, 255, 0.08);
}
#lyrics-output {
  margin: 0;
  max-height: 480px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 2;
}

footer {
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .12em;
}
footer a { color: var(--cyan); text-decoration: none; }

@media (max-width: 860px) {
  .topbar { grid-template-columns: 1fr auto; }
  .nav { display: none; }
  .search-layout { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid article:nth-child(2n) { border-right: 0; }
  .stats-grid article:nth-child(odd) { border-right: 1px solid var(--line); }
  .stats-grid article:nth-child(n+3) { border-top: 1px solid var(--line); }
  .boards { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .stats-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .entries-head { flex-direction: column; align-items: flex-start; }
  .filters { width: 100%; }
}
