:root {
  --bg: #0a1220;
  --surface: #182f59;
  --search-bg: #12294f;
  --search-border: #7897cf;
  --card-border: rgba(255, 255, 255, 0.2);
  --primary: #b6fc32;
  --on-primary: #010b1d;
  --text: #ffffff;
  --text-muted: #cfe0f8;
  --thumb-bg: #ffffff;
  --radius-card: 12px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Chakra Petch", system-ui, sans-serif;
}

.app {
  width: min(720px, 100vw);
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.toolbar {
  display: block;
}

.search-box {
  min-height: 50px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--search-border);
  background: var(--search-bg);
  border-radius: var(--radius-pill);
  padding: 0 12px;
}

.search-icon {
  display: block;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.search-box input {
  width: 100%;
  min-height: 42px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.meta {
  margin: 14px 0 8px;
  min-height: 20px;
}

.meta p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}

.grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}

.card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 8px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  position: relative;
  min-height: 0;
  height: auto;
}

.card-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease;
}

.card-link:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.35);
}

.card-link:hover .play-btn {
  filter: brightness(1.05);
}

.card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.thumb-wrap {
  position: relative;
  margin: 0;
  width: 48px;
  height: 48px;
  aspect-ratio: 1;
  flex-shrink: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--thumb-bg);
}

.thumb-wrap::before,
.thumb-frame {
  display: none;
}

.thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--thumb-bg);
  clip-path: none;
  z-index: 1;
  border-radius: var(--radius-card);
}

.card-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.title {
  margin: 0;
  padding: 0;
  min-height: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 28px;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  white-space: normal;
  word-break: break-word;
}

.sub {
  display: block;
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-btn {
  margin: 0;
  width: 76px;
  min-height: 0;
  border: 0;
  cursor: pointer;
  background: var(--primary);
  color: var(--on-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-transform: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  box-shadow: none;
  pointer-events: none;
  position: static;
  top: auto;
  flex-shrink: 0;
}

.play-btn img {
  display: none;
}

.download {
  margin-top: auto;
  min-height: 32px;
  border: 0;
  cursor: pointer;
  background: var(--primary);
  color: var(--on-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  box-shadow: none;
}

.download:active,
.play-btn:active {
  transform: scale(0.98);
}

.hot {
  display: none;
}

.pagination {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-btn,
.ellipsis {
  min-width: 30px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--search-border);
  background: var(--search-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
}

.page-btn {
  cursor: pointer;
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.ellipsis {
  border: 0;
  min-width: auto;
  background: transparent;
  color: var(--text-muted);
}

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 24px 8px;
  border: 1px dashed var(--search-border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

@media (max-width: 420px) {
  .app {
    padding-inline: 12px;
  }

  .grid {
    gap: 12px;
  }

  .title {
    font-size: 15px;
    line-height: 24px;
  }

  .play-btn {
    width: auto;
    min-width: 76px;
  }
}
