.sparkols-page-discovery {
  --discovery-ink: #172033;
  --discovery-muted: #68758a;
  --discovery-line: #e4e9f0;
  --discovery-soft: #f6f8fb;
  --discovery-green: #12a594;
  --discovery-green-dark: #0b7e72;
  padding: 0 2px 28px;
}

.discovery-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 158px;
  padding: 28px 30px;
  color: #fff;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(24, 8, 89, .94) 0%, rgba(30, 8, 102, .84) 45%, rgba(14, 7, 74, .2) 100%),
    url("/static/images/discovery/trend-intelligence-hero-v3.webp") center right / cover no-repeat;
  border: 1px solid rgba(128, 104, 255, .48);
  border-radius: 18px;
  box-shadow: 0 16px 38px rgba(55, 20, 142, .2);
}

.discovery-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(2, 5, 36, .12));
  content: "";
  pointer-events: none;
}

.discovery-hero > * { position: relative; z-index: 1; }
.discovery-hero-copy { max-width: 720px; text-shadow: 0 2px 16px rgba(5, 2, 38, .32); }

.discovery-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #82fff1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}

.discovery-eyebrow svg { width: 15px; height: 15px; }
.discovery-hero h2 { margin: 0; font-size: clamp(27px, 2.3vw, 38px); line-height: 1.18; letter-spacing: -.03em; }
.discovery-hero p { margin: 12px 0 0; color: #e1defa; font-size: 14px; line-height: 1.7; }

.discovery-hero-status {
  display: grid;
  justify-items: end;
  gap: 7px;
  min-width: 180px;
}

.discovery-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  color: #d9fff8;
  background: rgba(14, 7, 62, .42);
  border: 1px solid rgba(112, 255, 235, .54);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.discovery-live-pill i {
  width: 7px;
  height: 7px;
  background: #48d5bd;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(72, 213, 189, .12);
}

.discovery-hero-status strong { color: #fff; font-size: 13px; }
.discovery-hero-status small { color: #d0caf3; font-size: 11px; }

.discovery-ai-search {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 24px 24px 20px;
  text-align: center;
  background:
    radial-gradient(circle at 50% -20%, rgba(111, 77, 255, .13), transparent 48%),
    #fff;
  border: 1px solid var(--discovery-line);
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(36, 35, 79, .06);
}

.discovery-ai-search-copy { display: grid; justify-items: center; gap: 5px; }
.discovery-ai-search-copy > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7359d4;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .12em;
}
.discovery-ai-search-copy > span svg { width: 14px; height: 14px; }
.discovery-ai-search-copy h3 { margin: 0; color: var(--discovery-ink); font-size: 22px; letter-spacing: -.025em; }
.discovery-ai-search-copy p { margin: 0; color: #7b8799; font-size: 12px; }

.discovery-ai-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(860px, 100%);
  min-height: 56px;
  padding: 6px 7px 6px 18px;
  background: #fff;
  border: 1px solid #d9dfe8;
  border-radius: 999px;
  box-shadow: 0 5px 18px rgba(38, 36, 82, .11);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.discovery-ai-search-bar:focus-within {
  border-color: #8e79e7;
  box-shadow: 0 7px 24px rgba(89, 59, 188, .16), 0 0 0 4px rgba(117, 88, 215, .08);
}
.discovery-ai-search-bar > svg { width: 20px; height: 20px; flex: 0 0 auto; color: #7b8798; }
.discovery-ai-search-bar input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: #243247;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 14px;
}
.discovery-ai-search-bar input::placeholder { color: #a0a9b6; }
.discovery-ai-search-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 120px;
  min-height: 43px;
  padding: 0 17px;
  color: #fff;
  background: linear-gradient(135deg, #7357df, #9b41d2 60%, #eb3f93);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 5px 13px rgba(122, 69, 203, .24);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.discovery-ai-search-bar button svg { width: 14px; height: 14px; }
.discovery-ai-search-bar button:hover { filter: brightness(1.04); transform: translateY(-1px); }
.discovery-ai-search-bar button[disabled] { opacity: .7; cursor: wait; transform: none; }
.discovery-ai-search-bar button.is-loading svg { animation: discovery-spin .8s linear infinite; }

.discovery-search-suggestions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  color: #8b95a3;
  font-size: 10px;
}
.discovery-search-suggestions button {
  padding: 5px 9px;
  color: #59677a;
  background: #f5f6fa;
  border: 1px solid #e3e6ec;
  border-radius: 999px;
  font-size: 10px;
  cursor: pointer;
}
.discovery-search-suggestions button:hover { color: #6548c8; background: #f2efff; border-color: #d8cff7; }

.discovery-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-top: 16px;
  padding: 17px 18px;
  background: #fff;
  border: 1px solid var(--discovery-line);
  border-radius: 15px;
  box-shadow: 0 4px 16px rgba(25, 43, 63, .04);
}

.discovery-controls label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.discovery-controls label > span:first-child {
  color: #7a8799;
  font-size: 11px;
  font-weight: 700;
}

.discovery-select,
.discovery-search-input-wrap {
  width: 100%;
  min-height: 40px;
  color: #263449;
  background: #fbfcfe;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.discovery-select {
  padding: 0 34px 0 12px;
  appearance: auto;
  font-size: 13px;
  font-weight: 600;
}

.discovery-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
}

.discovery-search-input-wrap svg { width: 15px; height: 15px; color: #8b97a8; flex: 0 0 auto; }
.discovery-search-input-wrap input { width: 100%; min-width: 0; padding: 0; color: #263449; background: transparent; border: 0; outline: 0; font-size: 13px; }
.discovery-search-input-wrap input::placeholder { color: #a2adbc; }
.discovery-select:focus,
.discovery-search-input-wrap:focus-within { background: #fff; border-color: #68cfc0; box-shadow: 0 0 0 3px rgba(18, 165, 148, .1); }

.discovery-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  color: #465468;
  background: #fff;
  border: 1px solid #d9e1ea;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.discovery-control-btn svg { width: 15px; height: 15px; }
.discovery-control-btn:hover { border-color: #9db0c3; box-shadow: 0 4px 12px rgba(32, 52, 74, .08); transform: translateY(-1px); }
.discovery-control-btn.is-primary { color: #fff; background: var(--discovery-green); border-color: var(--discovery-green); }
.discovery-control-btn.is-primary:hover { background: var(--discovery-green-dark); border-color: var(--discovery-green-dark); }
.discovery-control-btn[disabled] { opacity: .62; cursor: wait; transform: none; }
.discovery-control-btn.is-loading svg { animation: discovery-spin .8s linear infinite; }

.discovery-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.discovery-summary article {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 78px;
  padding: 13px 14px;
  background: #fff;
  border: 1px solid var(--discovery-line);
  border-radius: 13px;
}

.discovery-summary article > span {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  border-radius: 10px;
}

.discovery-summary article > span svg { width: 17px; height: 17px; }
.discovery-summary .is-mint { color: #0d8a78; background: #e5f8f4; }
.discovery-summary .is-blue { color: #3572ce; background: #ebf2ff; }
.discovery-summary .is-violet { color: #7452c8; background: #f1edff; }
.discovery-summary .is-rose { color: #c45671; background: #ffedf2; }
.discovery-summary .is-amber { color: #a86a12; background: #fff4dc; }
.discovery-summary .is-cyan { color: #137f9b; background: #e7f7fb; }
.discovery-summary article div { display: grid; gap: 2px; min-width: 0; }
.discovery-summary strong { color: var(--discovery-ink); font-size: 22px; line-height: 1; }
.discovery-summary small { overflow: hidden; color: #7b8798; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }

.discovery-board {
  margin-top: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--discovery-line);
  border-radius: 16px;
  box-shadow: 0 5px 18px rgba(22, 39, 60, .035);
}

.discovery-tabs {
  display: flex;
  gap: 4px;
  padding: 10px;
  overflow-x: auto;
  background: #f5f7fa;
  border-bottom: 1px solid var(--discovery-line);
  scrollbar-width: thin;
}

.discovery-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 15px;
  color: #69778a;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.discovery-tabs button svg { width: 15px; height: 15px; }
.discovery-tabs button:hover { color: #33455a; background: #fff; }
.discovery-tabs button.is-active { color: #0a756b; background: #fff; border-color: #dbe5e5; box-shadow: 0 2px 8px rgba(30, 54, 71, .06); }

.discovery-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 8px;
}

.discovery-board-head h3 { margin: 0; color: var(--discovery-ink); font-size: 19px; letter-spacing: -.015em; }
.discovery-board-head p { margin: 5px 0 0; color: #8490a1; font-size: 12px; }
.discovery-board-head > span { padding: 6px 10px; color: #68768a; background: #f5f7fa; border: 1px solid #e4e9ef; border-radius: 999px; font-size: 11px; white-space: nowrap; }

.discovery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  padding: 14px 22px 24px;
}

.discovery-grid.is-creators { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.discovery-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  background: #fff;
  border: 1px solid #e2e7ee;
  border-radius: 13px;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.discovery-card:hover { border-color: #c3d5d3; box-shadow: 0 9px 22px rgba(24, 47, 67, .09); transform: translateY(-2px); }
.discovery-card-rank { position: absolute; z-index: 2; top: 10px; left: 10px; min-width: 25px; height: 25px; padding: 0 6px; color: #fff; background: rgba(18, 32, 49, .84); border-radius: 8px; font-size: 10px; font-weight: 800; line-height: 25px; text-align: center; backdrop-filter: blur(5px); }

.discovery-card-media {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  color: #8a99ab;
  background: #edf1f5;
}

.discovery-card-media img { width: 100%; height: 100%; transition: transform .25s ease; }
.discovery-card-media .discovery-media-backdrop {
  position: absolute;
  z-index: 1;
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  object-fit: cover;
  filter: blur(12px) saturate(.82);
  opacity: .34;
  transform: scale(1.08);
}
.discovery-card-media .discovery-media-image {
  position: relative;
  z-index: 2;
  object-fit: contain;
}
.discovery-card:hover .discovery-media-image { transform: scale(1.012); }
.discovery-media-fallback {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: grid;
  place-items: center;
  color: #8494aa;
  background:
    radial-gradient(circle at 72% 25%, rgba(28, 195, 174, .15), transparent 31%),
    linear-gradient(145deg, #f2f6f8, #e9eef4);
}
.discovery-media-fallback svg { width: 31px; height: 31px; }
.discovery-card.is-creator .discovery-card-media {
  aspect-ratio: auto;
  height: 88px;
  background:
    radial-gradient(circle at 72% 20%, rgba(39, 210, 185, .18), transparent 33%),
    linear-gradient(145deg, #f5f8fa, #e9f1f2);
}
.discovery-card.is-creator .discovery-card-media .discovery-media-image { width: 58px; height: 58px; object-fit: cover; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 4px 14px rgba(19, 44, 63, .14); }
.discovery-card.is-sound .discovery-card-media { aspect-ratio: auto; height: 112px; background: #f2effb; }
.discovery-card.is-sound .discovery-card-media .discovery-media-image { width: 68px; height: 68px; object-fit: cover; border-radius: 50%; box-shadow: 0 5px 15px rgba(56, 42, 92, .16); }

.discovery-card-play {
  position: absolute;
  z-index: 4;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: #fff;
  background: rgba(15, 28, 43, .82);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.discovery-card-play svg { width: 14px; height: 14px; }
.discovery-card-body { display: grid; gap: 10px; padding: 13px 14px 14px; }
.discovery-card-title-row { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.discovery-card h4 { display: -webkit-box; min-width: 0; margin: 0; overflow: hidden; color: #1e2a3b; font-size: 13px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.discovery-card-subtitle { display: block; margin-top: 3px; overflow: hidden; color: #8290a1; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }

.discovery-ai-analysis {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  background: linear-gradient(135deg, #f0fdf9, #f3f4ff);
  border: 1px solid #dceeea;
  border-radius: 9px;
}
.discovery-ai-analysis > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.discovery-ai-analysis > div span { display: inline-flex; align-items: center; gap: 4px; color: #0a8576; font-size: 9px; font-weight: 800; }
.discovery-ai-analysis > div span svg { width: 11px; height: 11px; }
.discovery-ai-analysis > div strong { overflow: hidden; color: #25364a; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.discovery-ai-analysis p { display: -webkit-box; margin: 0; overflow: hidden; color: #617087; font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.discovery-tags { display: flex; gap: 5px; overflow: hidden; }
.discovery-tags span {
  overflow: hidden;
  max-width: 112px;
  padding: 4px 7px;
  color: #526178;
  background: #f1f4f8;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.discovery-card.is-hashtag .discovery-tags span { color: #315f9d; background: #edf4ff; }

.discovery-search-reason {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  color: #6850c1;
  font-size: 9px;
  line-height: 1.4;
}
.discovery-search-reason svg { width: 11px; height: 11px; margin-top: 1px; flex: 0 0 auto; }

.discovery-related-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.discovery-related-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  padding: 5px 7px;
  overflow: hidden;
  color: #4d5d72;
  background: #f6f8fb;
  border: 1px solid #e8ecf1;
  border-radius: 7px;
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.discovery-related-meta svg { width: 11px; height: 11px; flex: 0 0 auto; color: #7054cc; }

.discovery-region-info {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.discovery-region-info span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}
.discovery-region-info svg { width: 10px; height: 10px; }
.discovery-region-info .is-actual { color: #087b6f; background: #e9f8f5; }
.discovery-region-info .is-market { color: #667287; background: #f1f3f6; }

.discovery-score {
  display: grid;
  justify-items: end;
  flex: 0 0 auto;
  color: #0d8a78;
}

.discovery-score strong { font-size: 18px; line-height: 1; }
.discovery-score small { margin-top: 2px; font-size: 9px; white-space: nowrap; }

.discovery-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.discovery-metric { min-width: 0; padding: 7px 8px; background: #f7f9fb; border-radius: 8px; }
.discovery-metric strong { display: block; overflow: hidden; color: #334256; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.discovery-metric span { display: block; margin-top: 2px; color: #96a1af; font-size: 9px; }

.discovery-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 1px; }
.discovery-growth { display: inline-flex; align-items: center; gap: 4px; color: #0b7e72; font-size: 10px; font-weight: 700; }
.discovery-growth svg { width: 13px; height: 13px; }
.discovery-card-link { display: inline-flex; align-items: center; gap: 4px; color: #596b80; font-size: 10px; font-weight: 700; text-decoration: none; }
.discovery-card-link:hover { color: #0b7e72; }
.discovery-card-link svg { width: 12px; height: 12px; }

.discovery-loading {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  padding: 14px 22px 24px;
}

.discovery-loading span {
  height: 250px;
  background: #f1f4f7;
  border: 1px solid #ebeff3;
  border-radius: 13px;
  animation: discovery-pulse 1.15s ease-in-out infinite alternate;
}

.discovery-error,
.discovery-empty {
  min-height: 260px;
  margin: 14px 22px 24px;
  padding: 28px;
  color: #718094;
  background: #f8fafc;
  border: 1px dashed #d9e1e9;
  border-radius: 13px;
}

.discovery-error { display: flex; align-items: center; justify-content: center; gap: 13px; }
.discovery-error > svg { width: 25px; height: 25px; color: #c27a31; }
.discovery-error div { display: grid; gap: 4px; }
.discovery-error strong, .discovery-empty strong { color: #344357; font-size: 14px; }
.discovery-error span, .discovery-empty span { font-size: 12px; }
.discovery-error button { margin-left: 8px; padding: 8px 12px; color: #fff; background: #0f8f82; border: 0; border-radius: 8px; font-size: 11px; font-weight: 700; cursor: pointer; }
.discovery-empty { display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; }
.discovery-empty svg { width: 33px; height: 33px; color: #9ba8b7; }
[hidden].discovery-loading,
[hidden].discovery-error,
[hidden].discovery-empty,
[hidden].discovery-grid { display: none !important; }
[hidden]#discovery-search-tab { display: none !important; }
.sparkols-page-discovery.is-syncing #discovery-result-count::after {
  margin-left: 7px;
  color: #0b8b7d;
  content: "· 后台同步中";
}

@keyframes discovery-spin { to { transform: rotate(360deg); } }
@keyframes discovery-pulse { from { opacity: .52; } to { opacity: 1; } }

@media (max-width: 1320px) {
  .discovery-controls { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
  .discovery-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .discovery-grid, .discovery-loading, .discovery-grid.is-creators { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .discovery-hero { align-items: flex-start; }
  .discovery-hero-status { min-width: 150px; }
  .discovery-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .discovery-controls .discovery-control-btn { width: 100%; }
  .discovery-grid, .discovery-loading, .discovery-grid.is-creators { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .sparkols-page-discovery { padding: 0 0 18px; }
  .discovery-hero { display: grid; gap: 22px; padding: 23px 20px; border-radius: 14px; }
  .discovery-hero-status { justify-items: start; min-width: 0; }
  .discovery-controls { grid-template-columns: 1fr 1fr; padding: 14px; }
  .discovery-industry-field { grid-column: span 2; }
  .discovery-ai-search { padding: 21px 14px 17px; }
  .discovery-ai-search-copy h3 { font-size: 19px; }
  .discovery-ai-search-copy p { max-width: 330px; line-height: 1.55; }
  .discovery-ai-search-bar { min-height: 51px; padding-left: 14px; }
  .discovery-ai-search-bar button { min-width: 46px; width: 46px; padding: 0; }
  .discovery-ai-search-bar button span { display: none; }
  .discovery-control-btn { width: 100%; }
  .discovery-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .discovery-tabs { justify-content: flex-start; }
  .discovery-board-head { align-items: flex-start; padding: 17px 15px 6px; }
  .discovery-grid, .discovery-loading, .discovery-grid.is-creators { grid-template-columns: 1fr; padding: 12px 15px 18px; }
  .discovery-loading span { height: 220px; }
  .discovery-card-media { aspect-ratio: 16 / 9; }
  .discovery-error, .discovery-empty { margin: 12px 15px 18px; }
}
