:root {
  --green: #25b768;
  --green-dark: #118a4c;
  --green-soft: #eefaf3;
  --text: #17191d;
  --muted: #8a9099;
  --subtle: #f5f6f7;
  --line: #eceef0;
  --danger: #bf5656;
  --radius: 18px;
  --safe-bottom: max(16px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: #fff;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: #fff;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input { font: inherit; }

button {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

button:disabled { cursor: default; }

.app-shell {
  width: min(100%, 680px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 12px) 18px calc(104px + var(--safe-bottom));
}

.page-header {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  min-height: 88px;
}

.brand { text-align: center; }

.brand h1 {
  margin: 3px 0 0;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 760;
  letter-spacing: -.4px;
}

.brand p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.back-button span {
  width: 12px;
  height: 12px;
  border-left: 2px solid #22262b;
  border-bottom: 2px solid #22262b;
  transform: rotate(45deg);
}

.more-button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.more-button i {
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background: #25292e;
}

.search-area { position: relative; }

.search-box {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 8px 0 18px;
  border: 1px solid #e5e7e9;
  border-radius: 17px;
  background: #fafafa;
  transition: border-color .18s ease, background .18s ease;
}

.search-box:focus-within {
  border-color: #cfeede;
  background: #fff;
}

.search-icon {
  width: 17px;
  height: 17px;
  position: relative;
  border: 2px solid #969ca4;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  right: -5px;
  bottom: -1px;
  border-radius: 2px;
  background: #969ca4;
  transform: rotate(45deg);
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 17px;
}

.search-box input::placeholder { color: #a2a7ae; }

.search-clear {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: #d8dce0;
  font-size: 20px;
  line-height: 26px;
}

.search-submit {
  height: 42px;
  padding: 0 17px;
  border-radius: 13px;
  background: var(--green);
  color: #fff;
  font-size: 15px;
  font-weight: 680;
}

.search-submit:disabled { opacity: .55; }

.advanced-panel {
  position: absolute;
  z-index: 20;
  top: 66px;
  right: 0;
  width: min(280px, calc(100vw - 36px));
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 14px 38px rgba(18, 27, 35, .12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.mode-item {
  width: 100%;
  min-height: 55px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 12px;
  text-align: left;
}

.mode-item strong {
  font-size: 15px;
  font-weight: 650;
}

.mode-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.mode-item.is-active { background: var(--green-soft); }
.mode-item.is-active strong { color: var(--green-dark); }

.search-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.spinner,
.load-more-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid #dfe7e2;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.content-section { margin-top: 27px; }

.section-title-row {
  min-height: 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title-row h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 730;
}

.section-title-row > button {
  padding: 6px 0 6px 16px;
  color: #a0a5ac;
  font-size: 13px;
}

.result-title-row {
  align-items: flex-end;
  margin-bottom: 14px;
}

.result-title-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.result-count {
  padding-bottom: 2px;
  color: var(--muted);
  font-size: 13px;
}

.recent-list { margin-top: 7px; }

.recent-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr 14px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.recent-row:last-child { border-bottom: 0; }

.recent-text {
  overflow: hidden;
  color: #31353a;
  font-size: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.recent-text span { color: var(--muted); }

.row-chevron {
  width: 8px;
  height: 8px;
  justify-self: end;
  border-top: 1.5px solid #adb1b7;
  border-right: 1.5px solid #adb1b7;
  transform: rotate(45deg);
}

.empty-note {
  padding: 34px 0;
  color: #a1a6ad;
  font-size: 14px;
  text-align: center;
}

.results-list {
  display: flex;
  flex-direction: column;
}

.song-card {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 13px;
  min-height: 99px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.song-card:last-child { border-bottom: 0; }

.song-card.is-active::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 17px;
  bottom: 17px;
  width: 3px;
  border-radius: 99px;
  background: var(--green);
}

.song-cover {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--subtle);
}

.song-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.song-title {
  margin: 0;
  overflow: hidden;
  color: #22262a;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 680;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.song-artist {
  margin-top: 5px;
  overflow: hidden;
  color: #858b93;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.song-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.song-action {
  min-width: 67px;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid #dfe3e5;
  border-radius: 10px;
  color: #596068;
  background: #fff;
  font-size: 13px;
  font-weight: 620;
  text-decoration: none;
}

.song-action.primary {
  border-color: #ccebd9;
  color: var(--green-dark);
  background: var(--green-soft);
}

.song-action.is-playing {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.song-action:disabled {
  opacity: .45;
  pointer-events: none;
}

.song-error {
  margin-top: 8px;
  color: var(--danger);
  font-size: 12px;
}

.empty-state {
  padding: 64px 0 50px;
  text-align: center;
}

.empty-state strong {
  display: block;
  color: #50555b;
  font-size: 15px;
}

.empty-state span {
  display: block;
  margin-top: 7px;
  color: #a0a5ac;
  font-size: 13px;
}

.load-more {
  width: 100%;
  height: 46px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 14px;
  font-weight: 650;
}

.load-more:disabled { opacity: .72; }
.load-more-spinner { display: none; }
.load-more.is-loading .load-more-spinner { display: inline-block; }

.mini-player {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: var(--safe-bottom);
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 656px);
  min-height: 66px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 1px solid #ebedef;
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 14px 34px rgba(21, 29, 36, .13);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.mini-player img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--subtle);
}

.mini-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mini-copy strong,
.mini-copy span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mini-copy strong {
  color: #282c31;
  font-size: 14px;
  font-weight: 650;
}

.mini-copy span {
  color: var(--muted);
  font-size: 12px;
}

.mini-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
}

.play-state-icon {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid #fff;
}

.mini-toggle.is-playing .play-state-icon {
  width: 12px;
  height: 14px;
  margin: 0;
  border: 0;
  position: relative;
}

.mini-toggle.is-playing .play-state-icon::before,
.mini-toggle.is-playing .play-state-icon::after {
  content: "";
  position: absolute;
  top: 0;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: #fff;
}

.mini-toggle.is-playing .play-state-icon::before { left: 0; }
.mini-toggle.is-playing .play-state-icon::after { right: 0; }

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(92px + var(--safe-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 40px);
  padding: 10px 14px;
  border-radius: 12px;
  color: #fff;
  background: rgba(28,31,34,.9);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

@media (min-width: 700px) {
  .app-shell { padding-left: 28px; padding-right: 28px; }
}

@media (max-width: 360px) {
  .app-shell { padding-left: 14px; padding-right: 14px; }
  .search-box { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .search-clear { display: none !important; }
  .search-submit { padding: 0 14px; }
  .song-card { grid-template-columns: 64px minmax(0, 1fr); }
  .song-cover { width: 64px; height: 64px; }
}

.download-gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px 18px;
}

.download-gate-mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 28, .42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.download-gate-card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 24px 20px 20px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(18, 27, 35, .22);
}

.download-gate-card h3 {
  margin: 0;
  padding-right: 32px;
  font-size: 20px;
  line-height: 1.3;
}

.download-gate-card > p {
  margin: 9px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.download-gate-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #8a9099;
  background: #f3f4f5;
  font-size: 22px;
  line-height: 34px;
}

#download-gate-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#download-gate-mobile {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #dfe3e5;
  border-radius: 14px;
  outline: 0;
  color: var(--text);
  background: #fafafa;
  font-size: 16px;
}

#download-gate-mobile:focus {
  border-color: #bfe8d0;
  background: #fff;
}

#download-gate-submit {
  height: 48px;
  border-radius: 14px;
  color: #fff;
  background: var(--green);
  font-size: 15px;
  font-weight: 680;
}

#download-gate-submit:disabled {
  opacity: .55;
}

.download-gate-error {
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.download-gate-note {
  margin-top: 12px;
  color: #a0a5ac;
  font-size: 12px;
  text-align: center;
}
