/* =========================================================
   CoinDesk mirror — custom additions
   ========================================================= */

#cdTheme .cd-sun { display: none; }
html[data-theme="dark"] #cdTheme .cd-moon { display: none; }
html[data-theme="dark"] #cdTheme .cd-sun { display: block; }

/* 顶部行情条吸顶（与 header 一起） */
@media (min-width: 1280px) {
  [data-homepage-module="markets-ticker"] {
    position: sticky;
    top: 72px;
    z-index: 90;
  }
}

/* ---------- Today's Videos player ---------- */
.cd-player { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; border-radius: 6px; }
.cd-player > img { width: 100%; height: 100%; object-fit: cover; }
.cd-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.18) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,.08) 58%, rgba(0,0,0,.62) 100%);
}
.cd-pill {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  background: #fff; color: #000;
  font-family: var(--font-sans); font-size: 11px; font-weight: 600;
  padding: 5px 7px; border-radius: 3px; line-height: 1;
}
.cd-bigplay {
  position: absolute; inset: 0; margin: auto; z-index: 3;
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease, opacity .2s ease;
}
.cd-bigplay:hover { background: rgba(0,0,0,.75); }
.cd-ui { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 0 10px 8px; color: #fff; }
.cd-progress { position: relative; height: 11px; display: flex; align-items: center; cursor: pointer; }
.cd-progress::before {
  content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 3px;
  background: rgba(255,255,255,.45); border-radius: 2px;
}
.cd-progress > span { position: relative; z-index: 1; height: 3px; background: #fff; border-radius: 2px; }
.cd-controls { display: flex; align-items: center; gap: 1px; margin-top: 1px; }
.cd-controls button {
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; border-radius: 3px;
}
.cd-controls button:hover { background: rgba(255,255,255,.16); }
.cd-time { font-family: var(--font-sans); font-size: 11px; margin-left: 6px; letter-spacing: -.01em; }
.cd-spacer { flex: 1; }

/* ---------- Search overlay ---------- */
#cdSearchOverlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 96px 16px 32px; overflow-y: auto;
}
#cdSearchOverlay[hidden] { display: none !important; }
.cd-search-panel {
  max-width: 800px; margin: 0 auto;
  background: var(--bg-surface-default); color: var(--text-default);
  border: 1px solid var(--border-default);
  border-radius: 10px; padding: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.cd-search-field { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border-default); padding-bottom: 14px; }
.cd-search-field svg { color: var(--text-subtle); flex: none; }
.cd-search-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-family: var(--font-serif); font-size: 21px; color: var(--text-strong);
}
.cd-search-field input::placeholder { color: var(--text-placeholder); }
#cdSearchClose {
  width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1;
  color: var(--text-default); display: flex; align-items: center; justify-content: center;
}
#cdSearchClose:hover { background: var(--bg-surface-subtle); }
.cd-search-hint { font-family: var(--font-sans); font-size: 12.5px; color: var(--text-subtle); margin: 12px 2px 2px; }
.cd-search-hint kbd {
  font-family: var(--font-sans); font-size: 11px; border: 1px solid var(--border-default);
  border-radius: 3px; padding: 1px 5px;
}
#cdSearchResults { margin-top: 6px; }
.cd-search-result { display: block; padding: 13px 4px; border-top: 1px solid var(--border-default); }
.cd-search-result:hover h4 { text-decoration: underline; text-underline-offset: 3px; }
.cd-search-result h4 { font-family: var(--font-serif); font-size: 18px; font-weight: 500; line-height: 1.3; }
.cd-search-result p { font-family: var(--font-sans); font-size: 12px; color: var(--text-subtle); margin-top: 4px; }
.cd-search-empty { padding: 28px 4px; font-family: var(--font-sans); font-size: 14px; color: var(--text-subtle); }

/* =========================================================
   Explore more — horizontal card carousel
   ========================================================= */
section:has(> [data-homepage-module="multi-vertical"]) {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.cd-explore {
  width: 100%;
  background: var(--bg-surface-subtle);
  border-top: 1px solid var(--border-default);
  padding: 30px 0 42px;
}
.cd-wrap { max-width: 1512px; margin: 0 auto; padding: 0 24px; }
.cd-explore-head { display: flex; align-items: center; gap: 64px; margin-bottom: 26px; }
.cd-explore-head h2 {
  font-family: var(--font-sans); font-size: 16px; line-height: 22px; font-weight: 500;
  color: var(--text-strong);
}
.cd-explore-arrows { display: flex; gap: 8px; }
.cd-arrow {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border-default);
  background: transparent; color: var(--text-default);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .15s ease, opacity .15s ease;
}
.cd-arrow:hover { background: var(--bg-surface-default); }
.cd-arrow:disabled { opacity: .35; cursor: default; }

.cd-explore-track {
  display: flex; align-items: stretch; gap: 24px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
  padding-bottom: 4px;
}
.cd-explore-track::-webkit-scrollbar { display: none; }
.cd-card {
  flex: 0 0 392px;
  scroll-snap-align: start;
  background: var(--bg-surface-default);
  color: var(--text-default);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  padding: 24px;
  display: flex; flex-direction: column;
  min-width: 0;
}
.cd-card-head { display: flex; align-items: center; gap: 8px; }
.cd-card-head h3 {
  font-family: var(--font-sans); font-size: 18px; line-height: 24px; font-weight: 500;
  color: var(--text-strong);
}
.cd-card-ic { display: inline-flex; color: var(--text-strong); }
.cd-chev { color: var(--text-subtle); flex: none; }
.cd-card-sub {
  margin-top: 8px;
  font-family: var(--font-sans); font-size: 14px; line-height: 20px; color: var(--text-subtle);
}

/* Prices / Stocks */
.cd-price-list { margin-top: 20px; }
.cd-price-list li {
  display: grid;
  grid-template-columns: 20px 24px minmax(0, 1fr) auto auto;
  align-items: center; gap: 12px;
  height: 55px;
  border-top: 1px solid var(--border-default);
}
.cd-num { font-family: var(--font-sans); font-size: 13px; color: var(--text-default); }
.cd-coin { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.cd-sym { font-family: var(--font-sans); font-size: 16px; font-weight: 600; color: var(--text-strong); }
.cd-price {
  font-family: var(--font-sans); font-size: 15px; color: var(--text-strong);
  text-align: right; font-variant-numeric: tabular-nums;
}
.cd-chg {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 7px; border-radius: 4px;
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.cd-chg.up { background: var(--bg-pos-alt); color: var(--text-pos); }
.cd-chg.down { background: var(--bg-neg-alt); color: var(--text-neg); }
.cd-chg.flat { background: var(--bg-surface-subtle); color: var(--text-subtle); }

.cd-stock-list { margin-top: 20px; }
.cd-stock-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
  align-items: center; gap: 12px;
  height: 55px;
  border-top: 1px solid var(--border-default);
}

/* Exchange Benchmark */
.cd-card-benchmark {
  background: #000; border-color: #000; color: #fff;
  position: relative; overflow: hidden;
}
.cd-card-benchmark::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.12) 1.3px, transparent 1.7px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, transparent 32%, #000 72%);
  mask-image: linear-gradient(180deg, transparent 32%, #000 72%);
  opacity: .75;
}
.cd-card-benchmark::after {
  content: ""; position: absolute; right: -70px; bottom: -90px;
  width: 280px; height: 280px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,210,0,.38), transparent 64%);
}
.cd-benchmark-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  width: 100%;
}
.cd-brand-lockup { display: flex; align-items: center; gap: 9px; margin-top: 12px; }
.cd-brand-mark svg { width: 30px; height: 30px; display: block; }
.cd-brand-word {
  font-family: var(--font-sans); font-size: 24px; font-weight: 700;
  letter-spacing: -.03em; color: #fff; line-height: 1;
}
.cd-card-benchmark h3 {
  font-family: var(--font-serif); font-size: 34px; line-height: 40px; font-weight: 500;
  color: #fff; text-align: center; margin-top: 16px;
}
.cd-rank-date {
  font-family: var(--font-sans); font-size: 18px; font-weight: 500;
  color: #ffd200; margin-top: 6px;
}
.cd-bench-list {
  width: 100%; margin-top: 26px;
  border: 1px solid #262626; border-radius: 8px; overflow: hidden;
  background: #080808;
}
.cd-bench-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  align-items: center; gap: 12px;
  height: 58px; padding: 0 14px;
  border-bottom: 1px solid #262626;
  font-family: var(--font-sans); font-size: 15px; color: #fff;
}
.cd-bench-list li:last-child { border-bottom: 0; }
.cd-rank {
  width: 26px; height: 26px; border-radius: 50%;
  background: #ffd200; color: #000;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.cd-bname { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-bscore { color: #d4d4d4; font-variant-numeric: tabular-nums; }
.cd-aa {
  background: #18e589; color: #000;
  font-size: 11px; font-weight: 700; padding: 3px 6px; border-radius: 4px;
}

/* Videos */
.cd-video-main { display: block; margin-top: 16px; }
.cd-video-main img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px;
  background: var(--bg-surface-subtle);
}
.cd-video-main h4 {
  font-family: var(--font-serif); font-size: 19px; line-height: 26px; font-weight: 500;
  color: var(--text-strong); margin-top: 10px;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.cd-vmeta {
  font-family: var(--font-sans); font-size: 11px; font-weight: 500;
  letter-spacing: .06em; color: var(--text-subtle); margin-top: 6px; text-transform: uppercase;
}
.cd-video-list { margin-top: 14px; border-top: 1px solid var(--border-default); }
.cd-video-list li { border-bottom: 1px solid var(--border-default); }
.cd-video-list a {
  display: grid; grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px; padding: 12px 0; align-items: center;
}
.cd-video-list img { width: 150px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; }
.cd-video-list h4 {
  font-family: var(--font-serif); font-size: 16px; line-height: 21px; font-weight: 500;
  color: var(--text-strong);
}
.cd-video-list a:hover h4 { text-decoration: underline; text-underline-offset: 3px; }

/* Indices card */
.cd-card-head-indices { gap: 6px; }
.cd-cdmark svg { width: 18px; height: 18px; display: block; }
.cd-slash { color: var(--text-subtle); font-family: var(--font-sans); font-size: 16px; }
.cd-indices-title {
  font-family: var(--font-serif); font-size: 32px; line-height: 38px; font-weight: 500;
  color: var(--text-strong); margin-top: 24px;
}
.cd-index-rows { margin-top: 16px; }
.cd-index-rows li {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto;
  align-items: center; gap: 12px; height: 58px;
  border-top: 1px solid var(--border-default);
}
.cd-index-rows img { width: 26px; height: 26px; border-radius: 50%; }
.cd-isym { font-family: var(--font-sans); font-size: 16px; font-weight: 600; color: var(--text-strong); }
.cd-iprice {
  font-family: var(--font-sans); font-size: 15px; color: var(--text-strong);
  text-align: right; font-variant-numeric: tabular-nums;
}

/* Podcast card */
.cd-pod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.cd-pod img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 4px; background: var(--bg-surface-subtle); }
.cd-pod h4 {
  font-family: var(--font-serif); font-size: 16px; line-height: 21px; font-weight: 500;
  color: var(--text-strong); margin-top: 8px;
}
.cd-pod:hover h4 { text-decoration: underline; text-underline-offset: 3px; }
.cd-pod p { font-family: var(--font-sans); font-size: 12px; color: var(--text-subtle); margin-top: 2px; }
.cd-pod-social {
  display: flex; gap: 10px; margin-top: auto; padding-top: 18px;
  border-top: 1px solid var(--border-default);
}
.cd-pod-social a {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.cd-pod-social a:nth-child(1) { background: #8e44ad; }
.cd-pod-social a:nth-child(2) { background: #1db954; }
.cd-pod-social a:nth-child(3) { background: #ff0000; }

/* responsive card widths */
@media (max-width: 1439px) {
  .cd-card { flex-basis: calc((100% - 24px) / 2); }
}
@media (max-width: 860px) {
  .cd-explore-head { gap: 24px; }
  .cd-card { flex-basis: 86vw; }
  .cd-wrap { padding: 0 16px; }
}
@media (max-width: 600px) {
  .cd-search-panel { padding: 16px; }
  .cd-search-field input { font-size: 18px; }
  .cd-video-list a { grid-template-columns: 104px minmax(0, 1fr); }
  .cd-video-list img { width: 104px; }
  .cd-indices-title { font-size: 27px; line-height: 33px; }
  .cd-bench-list li { font-size: 14px; }
  .cd-bench-list { margin-top: 20px; }
}
