/* ============ 换源选择弹框（手机端 + PC 端共用） ============ */
.src-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.src-modal.show { opacity: 1; visibility: visible; }

.src-mask {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 20, .62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.src-card {
  position: relative;
  width: min(92vw, 480px);
  max-height: 82vh;
  box-sizing: border-box;
  padding: 24px 22px 16px;
  border-radius: 22px;
  color: #eef0ff;
  background: linear-gradient(160deg, #1c1e33 0%, #12131f 58%, #0b0c14 100%);
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .65), inset 0 0 0 1px rgba(99, 102, 241, .12);
  transform: translateY(18px) scale(.96);
  opacity: 0;
  transition: transform .32s cubic-bezier(.2, .9, .25, 1.05), opacity .32s ease;
  overflow: hidden;
}
.src-modal.show .src-card { transform: translateY(0) scale(1); opacity: 1; }

.src-card::before {
  content: "";
  position: absolute;
  top: -45%;
  left: -20%;
  width: 140%;
  height: 85%;
  background: radial-gradient(closest-side, rgba(99, 102, 241, .32), transparent 72%);
  pointer-events: none;
}

.src-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #c9cbe6;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: .2s;
  z-index: 2;
}
.src-close:hover { background: rgba(239, 68, 68, .28); color: #fff; transform: rotate(90deg); }

.src-head { position: relative; padding-right: 40px; margin-bottom: 16px; }
.src-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .5px;
  background: linear-gradient(90deg, #a5b4fc, #c4b5fd, #f0abfc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.src-sub { margin-top: 6px; font-size: 12px; color: #8b90ad; }

.src-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  max-height: 54vh;
  overflow-y: auto;
  padding: 4px 2px 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, .55) transparent;
}
.src-grid::-webkit-scrollbar { width: 6px; }
.src-grid::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, .55); border-radius: 8px; }

.src-item {
  position: relative;
  padding: 13px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .055);
  color: #dfe2f5;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
  text-align: center;
  font-family: inherit;
}
.src-item:hover {
  background: rgba(99, 102, 241, .22);
  border-color: rgba(129, 140, 248, .78);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, .32);
}
.src-item:active { transform: scale(.97); }
.src-item.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(99, 102, 241, .58);
}
.src-item.active::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 9px;
  font-size: 11px;
  opacity: .95;
}

.src-foot {
  position: relative;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 12px;
  color: #8b90ad;
  text-align: center;
}
.src-foot b { color: #c4b5fd; font-weight: 600; }

@media (max-width: 420px) {
  .src-card { padding: 20px 16px 14px; }
  .src-grid { grid-template-columns: repeat(auto-fill, minmax(83px, 1fr)); gap: 8px; }
  .src-item { padding: 11px 6px; font-size: 13px; }
}
