/* 独立音乐平台登录页样式（依赖 styles.css 的设计变量与基础组件） */

.platform-body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

.platform-app {
  width: 100%;
  max-width: 1180px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 18px calc(36px + env(safe-area-inset-bottom, 0px));
}

/* ---------- 顶部 ---------- */
.platform-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 -18px;
  padding: 14px 18px 12px;
  background: linear-gradient(180deg, rgba(8, 6, 15, 0.94) 0%, rgba(8, 6, 15, 0.72) 76%, rgba(8, 6, 15, 0) 100%);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
}

.platform-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 650;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.platform-back:hover {
  color: var(--text);
  border-color: var(--stroke-strong);
  background: var(--surface-2);
}

.platform-brand {
  min-width: 0;
  flex: 1;
}

.platform-brand__title {
  font-size: 19px;
  font-weight: 780;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.platform-brand__desc {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.45;
}

.platform-guest {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  max-width: 42vw;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--surface);
}

.platform-guest__name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 未登录提示 ---------- */
.platform-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 179, 92, 0.28);
  border-radius: 16px;
  background: rgba(255, 179, 92, 0.08);
  color: #ffd9a8;
}

.platform-banner__text {
  font-size: 13px;
  line-height: 1.55;
  min-width: 0;
}

/* ---------- 双栏布局 ---------- */
.platform-grid {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.platform-side,
.platform-main {
  min-width: 0;
}

.platform-side {
  position: sticky;
  top: 84px;
}

.platform-main {
  min-height: 420px;
}

/* ---------- 平台页签 ---------- */
.platform-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.platform-tab {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 0 6px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.platform-tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.platform-tab.is-active {
  color: #fff;
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(124, 92, 255, 0.28);
}

/* ---------- 登录区 ---------- */
.platform-login__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.platform-login__title {
  font-size: 16px;
  font-weight: 750;
}

.platform-login__badge {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: #8ff0c4;
  background: rgba(61, 220, 151, 0.13);
  border: 1px solid rgba(61, 220, 151, 0.32);
  white-space: nowrap;
}

.platform-hint {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-faint);
}

.platform-side #platformLoggedOut .btn {
  margin-top: 12px;
}

.platform-cookie-toggle {
  display: block;
  margin: 10px auto 0;
  text-align: center;
}

.platform-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  margin-top: 6px;
}

.platform-qr__img {
  width: 210px;
  height: 210px;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
  object-fit: contain;
}

.platform-qr__link {
  font-size: 11.5px;
  text-align: center;
  word-break: break-all;
}

.platform-qr__status {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  color: var(--text-dim);
}

.platform-qr__refresh {
  min-height: 32px;
}

/* ---------- Cookie 备用登录 ---------- */
.platform-cookie {
  margin-top: 6px;
  padding: 12px;
  border: 1px solid rgba(255, 179, 92, 0.22);
  border-radius: 14px;
  background: rgba(255, 179, 92, 0.05);
}

.platform-cookie__title {
  font-size: 13px;
  font-weight: 700;
  color: #ffd9a8;
}

.platform-cookie__desc {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-faint);
  word-break: break-word;
}

.platform-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.platform-field__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
}

.platform-field__input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  outline: none;
  background: rgba(0, 0, 0, 0.32);
  color: var(--text);
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.platform-field__input:focus {
  border-color: rgba(124, 92, 255, 0.66);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.14);
}

.platform-error {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #ff9b9b;
  word-break: break-word;
}

.platform-cookie__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.platform-cookie__actions .btn {
  flex: 1;
}

/* ---------- 已登录账号 ---------- */
.platform-account {
  margin-top: 4px;
}

.platform-account__who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.platform-account__avatar {
  display: flex;
  flex: none;
}

.platform-account__meta {
  min-width: 0;
}

.platform-account__name {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}

.platform-account__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.platform-unsupported {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 179, 92, 0.26);
  border-radius: 12px;
  background: rgba(255, 179, 92, 0.07);
}

.platform-unsupported__text {
  font-size: 12px;
  line-height: 1.6;
  color: #ffd9a8;
  word-break: break-word;
}

.platform-status {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-faint);
  word-break: break-word;
}

.platform-status--warn {
  color: #ffd9a1;
}

.platform-status--ok {
  color: #a9f5cf;
}

/* ---------- 音乐库 ---------- */
.platform-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.platform-card-head__title {
  font-size: 15px;
  font-weight: 730;
}

.platform-lib-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.platform-lib-tab {
  flex: 1;
  min-width: 0;
  min-height: 30px;
  padding: 0 6px;
  border: 1px solid var(--stroke);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}

.platform-lib-tab.is-active {
  color: #fff;
  background: var(--grad);
  border-color: transparent;
}

.platform-library__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(58vh, 520px);
  padding-right: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.platform-lib-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.platform-lib-item:nth-child(odd) {
  background: rgba(255, 255, 255, 0.03);
}

.platform-lib-item:hover,
.platform-lib-item:focus-visible {
  background: rgba(255, 255, 255, 0.065);
}

.platform-lib-item__cover {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 9px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.06);
}

.platform-lib-item__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.platform-lib-item__meta {
  min-width: 0;
}

.platform-lib-item__name {
  font-size: 13px;
  font-weight: 620;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-lib-item__sub {
  margin-top: 1px;
  font-size: 11px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-lib-item__arrow {
  flex: none;
  font-size: 15px;
  color: var(--text-faint);
}

/* ---------- 歌曲列表 ---------- */
.platform-tracks__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.platform-track-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(56vh, 500px);
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.platform-track-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 9px;
}

.platform-track-item:nth-child(odd) {
  background: rgba(255, 255, 255, 0.025);
}

.platform-track-item__check {
  display: grid;
  place-items: center;
}

.platform-track-item__check input {
  width: 16px;
  height: 16px;
  accent-color: #7c5cff;
  cursor: pointer;
}

.platform-track-item__meta {
  min-width: 0;
}

.platform-track-item__name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-track-item__sub {
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-track-item__dur {
  font-size: 10.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.platform-more {
  display: block;
  width: 100%;
  margin-top: 10px;
}

.platform-track-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.platform-check-all {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
}

.platform-check-all input {
  width: 16px;
  height: 16px;
  accent-color: #7c5cff;
  cursor: pointer;
}

.platform-track-footer .btn {
  min-width: 150px;
}

/* ---------- 空状态 / 页脚 ---------- */
.platform-empty {
  display: grid;
  justify-items: center;
  padding: 70px 18px;
  text-align: center;
}

.platform-empty__icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin-bottom: 12px;
  border-radius: 50%;
  color: rgba(200, 190, 255, 0.55);
  background: radial-gradient(circle at 50% 35%, rgba(124, 92, 255, 0.18), rgba(255, 255, 255, 0.02) 72%);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.platform-empty__title {
  font-size: 14px;
  font-weight: 650;
  color: var(--text-dim);
}

.platform-empty__desc {
  max-width: 420px;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-faint);
}

.platform-foot {
  margin-top: 26px;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

/* ---------- 响应式：手机单栏 ---------- */
@media (max-width: 899px) {
  .platform-app {
    padding: 0 14px calc(30px + env(safe-area-inset-bottom, 0px));
  }

  .platform-topbar {
    margin: 0 -14px;
    padding: 10px 14px 9px;
    gap: 9px;
  }

  .platform-brand__title {
    font-size: 16px;
  }

  .platform-brand__desc {
    display: none;
  }

  .platform-back {
    min-height: 30px;
    padding: 0 9px;
    font-size: 11.5px;
  }

  .platform-guest {
    max-width: 34vw;
    padding-right: 8px;
  }

  .platform-guest__name {
    max-width: 72px;
    font-size: 11.5px;
  }

  .platform-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
    margin-top: 13px;
  }

  .platform-side {
    position: static;
  }

  .platform-main {
    min-height: 320px;
  }

  .platform-qr__img {
    width: 180px;
    height: 180px;
  }

  .platform-library__list {
    max-height: none;
  }

  .platform-track-list {
    max-height: 52vh;
  }

  .platform-track-footer {
    flex-wrap: wrap;
  }

  .platform-track-footer .btn {
    flex: 1;
    min-width: 130px;
  }

  .platform-empty {
    padding: 46px 12px;
  }

  .platform-lib-item {
    grid-template-columns: 38px minmax(0, 1fr) auto auto;
    gap: 8px;
  }

  .platform-lib-item__cover {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 379px) {
  .platform-brand__title {
    font-size: 15px;
  }

  .platform-guest {
    display: none;
  }

  .platform-tab {
    font-size: 12px;
  }

  .platform-ticket {
    font-size: 12px;
  }
}
