/* ============================================================
   网易云搜索页 —— 独立页面样式
   只依赖 style.css 的 :root 设计变量，不重复定义颜色体系
   ============================================================ */

.ns-page {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.ns-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px clamp(14px, 4vw, 32px);
  background: color-mix(in oklch, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}

.ns-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color var(--t-fast) var(--e-out), color var(--t-fast) var(--e-out);
}
.ns-back:hover { border-color: var(--brand); color: var(--brand-strong); }

.ns-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.ns-brand-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(140deg, var(--brand), var(--brand-strong));
  color: var(--on-brand);
  font-size: 12px;
  font-weight: 700;
}

/* ---------- 搜索框 ---------- */
.ns-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 620px;
  padding: 9px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: border-color var(--t-fast) var(--e-out), box-shadow var(--t-fast) var(--e-out);
}
.ns-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.ns-search svg { flex: none; color: var(--text-3); }
.ns-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.ns-search input::placeholder { color: var(--text-3); }
.ns-search input::-webkit-search-cancel-button { display: none; }

.ns-search-clear {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--text-3);
  cursor: pointer;
}
.ns-search-clear:hover { background: var(--brand-soft); color: var(--brand-strong); }

.ns-go {
  flex: none;
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast) var(--e-out), transform var(--t-fast) var(--e-out);
}
.ns-go:hover { background: var(--brand-strong); }
.ns-go:active { transform: scale(0.97); }

/* ---------- 主体 ---------- */
.ns-main {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 22px clamp(14px, 4vw, 32px) 80px;
}

.ns-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.ns-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.ns-title em { font-style: normal; color: var(--brand-strong); }
.ns-count { font-size: 12.5px; color: var(--text-3); }

/* ---------- 结果网格 ---------- */
.ns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 12px;
}

.ns-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--e-out),
              transform var(--t-fast) var(--e-out),
              box-shadow var(--t-fast) var(--e-out);
}
.ns-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.ns-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.ns-cover {
  flex: none;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text-3);
  overflow: hidden;
}
.ns-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ns-meta { min-width: 0; flex: 1; }
.ns-name {
  display: block;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ns-sub {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 播放按钮：悬停才显形，避免视觉噪音 */
.ns-play {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity var(--t-fast) var(--e-out), transform var(--t-fast) var(--e-out);
  pointer-events: none;
}
.ns-card:hover .ns-play,
.ns-card:focus-within .ns-play { opacity: 1; transform: scale(1); pointer-events: auto; }

/* 版权受限标记 */
.ns-card.bad { opacity: 0.62; }
.ns-card.bad .ns-play { background: var(--bg-soft); color: var(--text-3); }
.ns-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.6;
}

/* ---------- 骨架屏 ---------- */
.ns-skel {
  height: 72px;
  border-radius: var(--radius-m);
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--bg-soft) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  animation: ns-shimmer 1.3s linear infinite;
}
@keyframes ns-shimmer {
  from { background-position: 180% 0; }
  to   { background-position: -80% 0; }
}

/* ---------- 状态区 ---------- */
.ns-state {
  grid-column: 1 / -1;
  padding: 54px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
  line-height: 1.9;
}
.ns-state strong { display: block; margin-bottom: 6px; color: var(--text-2); font-size: 15px; font-weight: 600; }

/* ---------- 热词 ---------- */
.ns-hot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}
.ns-hot button {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: all var(--t-fast) var(--e-out);
}
.ns-hot button:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

/* ---------- 提示条 ---------- */
.ns-note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 26px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-s);
  background: var(--surface-2);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-2);
}
.ns-note svg { flex: none; margin-top: 2px; color: var(--brand); }

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  .ns-top { flex-wrap: wrap; gap: 9px; padding: 11px 14px; }
  .ns-brand { order: 1; }
  .ns-back { order: 2; margin-left: auto; }
  .ns-search { order: 3; flex-basis: 100%; max-width: none; }
  .ns-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
  .ns-cover { width: 42px; height: 42px; }
  .ns-main { padding-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ns-skel { animation: none; }
  .ns-card { transition: none; }
}
