:root {
  --blue-950: #06134a;
  --blue-900: #0a1e6b;
  --blue-850: #0c297f;
  --blue-800: #0e3b99;
  --blue-700: #0e56c7;
  --blue-600: #1182dd;
  --cyan-400: #45c7d7;
  --yellow-400: #e2d54c;
  --yellow-500: #d8c329;
  --wx-deep-0: #0e1f3e;
  --wx-deep-1: #060a86;
  --wx-blue-0: #0503b1;
  --wx-blue-1: #0812dd;
  --wx-sky-0: #0f56e8;
  --wx-cyan-0: #1697ed;
  --ink: #0f1022;
  --white: #f7fbff;
  --crt-dpr: 1;
  --crt-inv-dpr: 1;
  --crt-filter: none;
  --crt-scanline-opacity: 0.12;
  --crt-mask-opacity: 0.08;
  --crt-vignette-strength: 0.45;
  --crt-noise-opacity: 0.04;
  --wx-cloud-front: 0.4;
  --wx-cloud-back: 0.2;
  --wx-base-c1-x: 82%;
  --wx-base-c1-y: 32%;
  --wx-base-c2-x: 76%;
  --wx-base-c2-y: 72%;
  --wx-cloud-c1-x: 35%;
  --wx-cloud-c1-y: 40%;
  --wx-cloud-c2-x: 70%;
  --wx-cloud-c2-y: 55%;
  --wx-haze-c1-x: 82%;
  --wx-haze-c1-y: 32%;
  --wx-haze-c2-x: 70%;
  --wx-haze-c2-y: 65%;
  --wx-haze-c3-x: 30%;
  --wx-haze-c3-y: 40%;
  --wx-base-tx: -0.8%;
  --wx-base-ty: -0.4%;
  --wx-base-scale: 1.02;
  --wx-cloud-a-tx: -2%;
  --wx-cloud-a-ty: -1%;
  --wx-cloud-a-scale: 1.12;
  --wx-cloud-a-rot: -0.2deg;
  --wx-cloud-b-tx: 1.2%;
  --wx-cloud-b-ty: 0.6%;
  --wx-cloud-b-scale: 1.08;
  --wx-cloud-b-rot: 0.18deg;
  --wx-haze-tx: 0%;
  --wx-haze-ty: 0%;
  --wx-haze-scale: 1.04;
  --wx-mask-a:
    radial-gradient(circle at 18% 32%, rgba(255, 255, 255, 0.95) 0 45%, transparent 70%),
    radial-gradient(circle at 68% 58%, rgba(255, 255, 255, 0.9) 0 42%, transparent 68%),
    radial-gradient(circle at 58% 22%, rgba(255, 255, 255, 0.75) 0 38%, transparent 62%);
  --wx-mask-b:
    radial-gradient(circle at 28% 70%, rgba(255, 255, 255, 0.9) 0 44%, transparent 70%),
    radial-gradient(circle at 74% 28%, rgba(255, 255, 255, 0.85) 0 40%, transparent 66%),
    radial-gradient(circle at 52% 46%, rgba(255, 255, 255, 0.7) 0 34%, transparent 58%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  color: var(--white);
  text-transform: none;
  overflow: hidden;
  background: var(--wx-deep-0);
}

.crt-page {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
}

.crt-surface {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background: none;
  color: var(--white);
  text-transform: none;
  filter: var(--crt-filter);
}

.wx-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  isolation: isolate;
}

.wx-base {
  position: absolute;
  inset: -14%;
  background:
    radial-gradient(
      circle at var(--wx-base-c1-x) var(--wx-base-c1-y),
      rgba(22, 151, 237, 0.82),
      transparent 56%
    ),
    radial-gradient(
      circle at var(--wx-base-c2-x) var(--wx-base-c2-y),
      rgba(15, 86, 232, 0.6),
      transparent 62%
    ),
    linear-gradient(
      100deg,
      var(--wx-deep-0) 0%,
      var(--wx-deep-1) 24%,
      var(--wx-blue-0) 45%,
      var(--wx-blue-1) 60%,
      var(--wx-sky-0) 78%,
      var(--wx-cyan-0) 100%
    );
  transform: translate3d(var(--wx-base-tx), var(--wx-base-ty), 0) scale(var(--wx-base-scale));
  will-change: transform;
}

.wx-cloud {
  position: absolute;
  inset: -22%;
  background:
    radial-gradient(
      ellipse at var(--wx-cloud-c1-x) var(--wx-cloud-c1-y),
      rgba(15, 86, 232, 0.6),
      rgba(5, 3, 177, 0.74) 45%,
      rgba(6, 10, 134, 0.82) 72%
    ),
    radial-gradient(
      ellipse at var(--wx-cloud-c2-x) var(--wx-cloud-c2-y),
      rgba(22, 151, 237, 0.55),
      rgba(8, 18, 221, 0.65) 48%,
      rgba(6, 10, 134, 0.78) 70%
    );
  mix-blend-mode: screen;
  opacity: var(--wx-cloud-back);
  will-change: transform, opacity;
  transition: opacity 10s ease;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 220% 220%;
  mask-size: 220% 220%;
  -webkit-mask-position: 50% 50%;
  mask-position: 50% 50%;
  backface-visibility: hidden;
}

.wx-cloud--a {
  -webkit-mask-image: var(--wx-mask-a);
  mask-image: var(--wx-mask-a);
  transform:
    translate3d(var(--wx-cloud-a-tx), var(--wx-cloud-a-ty), 0)
    scale(var(--wx-cloud-a-scale))
    rotate(var(--wx-cloud-a-rot));
}

.wx-cloud--b {
  -webkit-mask-image: var(--wx-mask-b);
  mask-image: var(--wx-mask-b);
  transform:
    translate3d(var(--wx-cloud-b-tx), var(--wx-cloud-b-ty), 0)
    scale(var(--wx-cloud-b-scale))
    rotate(var(--wx-cloud-b-rot));
}

.wx-bg.is-paused .wx-base,
.wx-bg.is-paused .wx-cloud,
.wx-bg.is-paused .wx-haze {
  animation-play-state: paused;
}

.wx-bg[data-front="a"] .wx-cloud--a {
  opacity: var(--wx-cloud-front);
}

.wx-bg[data-front="a"] .wx-cloud--b {
  opacity: var(--wx-cloud-back);
}

.wx-bg[data-front="b"] .wx-cloud--a {
  opacity: var(--wx-cloud-back);
}

.wx-bg[data-front="b"] .wx-cloud--b {
  opacity: var(--wx-cloud-front);
}

.wx-haze {
  position: absolute;
  inset: -18%;
  background:
    radial-gradient(
      ellipse at var(--wx-haze-c1-x) var(--wx-haze-c1-y),
      rgba(22, 151, 237, 0.8),
      transparent 60%
    ),
    radial-gradient(
      ellipse at var(--wx-haze-c2-x) var(--wx-haze-c2-y),
      rgba(15, 86, 232, 0.45),
      transparent 62%
    ),
    radial-gradient(
      ellipse at var(--wx-haze-c3-x) var(--wx-haze-c3-y),
      rgba(5, 3, 177, 0.25),
      transparent 65%
    );
  opacity: 0.55;
  mix-blend-mode: screen;
  filter: blur(26px);
  transform: translate3d(var(--wx-haze-tx), var(--wx-haze-ty), 0) scale(var(--wx-haze-scale));
  will-change: transform;
}

html.bg-animated .wx-base {
  animation: wxBaseDrift 240s ease-in-out infinite;
}

html.bg-animated .wx-cloud--a {
  animation: wxCloudDriftA 180s ease-in-out infinite;
}

html.bg-animated .wx-cloud--b {
  animation: wxCloudDriftB 220s ease-in-out infinite;
}

html.bg-animated .wx-haze {
  animation: wxHazeDrift 200s ease-in-out infinite;
}

.frame {
  width: min(860px, 96vw);
  padding: 26px 26px 28px;
  position: relative;
  transform: scale(1.28);
  transform-origin: center;
  filter: saturate(1.12) contrast(1.12) brightness(1.04);
  isolation: isolate;
  z-index: 1;
}

body.crt-on .crt-page::before,
body.crt-on .crt-page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

body.crt-on .crt-page::before {
  z-index: 2;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, var(--crt-scanline-opacity)) 0 calc(1px * var(--crt-inv-dpr)),
      rgba(0, 0, 0, 0) calc(1px * var(--crt-inv-dpr)) calc(3px * var(--crt-inv-dpr))
    ),
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, var(--crt-mask-opacity)) 0 calc(1px * var(--crt-inv-dpr)),
      rgba(0, 0, 0, 0) calc(1px * var(--crt-inv-dpr)) calc(3px * var(--crt-inv-dpr))
    );
  mix-blend-mode: multiply;
}

body.crt-on .crt-page::after {
  z-index: 3;
  background-image:
    radial-gradient(
      ellipse at center,
      rgba(0, 0, 0, 0) 52%,
      rgba(0, 0, 0, var(--crt-vignette-strength)) 100%
    ),
    var(--crt-noise-url);
  background-size: 100% 100%, 120px 120px;
  background-blend-mode: multiply, screen;
  opacity: 1;
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 56px;
  height: 50px;
  padding: 6px 4px 4px;
  border-radius: 4px;
  border: 2px solid rgba(230, 240, 255, 0.9);
  background: linear-gradient(160deg, #1e49a8, #0a2b7a 70%);
  color: var(--white);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1.1;
  font-size: 11px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 3px 3px 0 rgba(5, 14, 50, 0.6);
}

.title {
  padding: 6px 12px 5px;
  background: linear-gradient(90deg, #f1f2f4 0%, #e1e4e8 100%);
  color: #1a1a1d;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: lowercase;
  font-size: 18px;
  border-radius: 3px;
  box-shadow: 3px 3px 0 rgba(7, 15, 55, 0.6);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.45);
}

.meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.date {
  padding: 5px 10px 4px;
  background: #f6f6f8;
  color: #1a1a2a;
  font-weight: 700;
  border-radius: 3px;
  font-size: 14px;
  text-transform: lowercase;
  box-shadow: 3px 3px 0 rgba(7, 15, 55, 0.6);
}

.music {
  display: flex;
  gap: 6px;
  align-items: center;
}

#musicToggle {
  background: transparent;
  color: #1a1a2a;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  padding: 4px 8px 4px 4px;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#musicToggle[aria-pressed="true"] {
  background: transparent;
}

.bgm-icon {
  width: 38px;
  height: 38px;
  display: block;
  border-radius: 50%;
  overflow: hidden;
  background-image: url('assets/music-toggle-sprite.png');
  background-size: 200% 100%;
  background-position: left center;
  background-repeat: no-repeat;
  box-shadow: none;
}

#musicToggle[aria-pressed="true"] .bgm-icon {
  background-position: right center;
  box-shadow: none;
}

.bgm-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
}

#musicToggle[aria-pressed="true"] .bgm-label--off {
  display: none;
}

#musicToggle[aria-pressed="false"] .bgm-label--on {
  display: none;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(720px, 94%);
  margin-left: 66px;
  transition: opacity 0.6s ease, filter 0.6s ease;
}

.list.fading {
  opacity: 0;
  filter: blur(1.5px);
}

.list-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(720px, 94%);
  margin-left: 66px;
  margin-top: 10px;
}

.list-nav {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}

.list-nav:focus-visible {
  outline: 2px solid rgba(255, 236, 92, 0.7);
  outline-offset: 3px;
}

.nav-icon {
  width: 60px;
  height: 36px;
  display: block;
  background-image: url('assets/nav-arrows-sprite.png');
  background-size: 200% 100%;
  background-position: left center;
  background-repeat: no-repeat;
  filter: drop-shadow(0 2px 0 rgba(3, 12, 38, 0.55)) drop-shadow(0 0 8px rgba(20, 40, 120, 0.25));
}

.nav-icon.nav-right {
  background-position: right center;
}

.list-rss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.rss-icon {
  width: 60px;
  height: 36px;
  display: block;
  background-image: url('assets/rss-bryce.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  filter: drop-shadow(0 2px 0 rgba(3, 12, 38, 0.55))
    drop-shadow(0 0 8px rgba(20, 40, 120, 0.25));
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 52px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 18px 16px;
  position: relative;
  background: linear-gradient(90deg, #212f8f 0%, #2556af 60%, #2f6ec0 100%);
  border-radius: 4px;
  border: 1px solid rgba(5, 12, 48, 0.35);
  box-shadow: 0 3px 0 rgba(6, 14, 52, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.row-desc {
  position: absolute;
  left: 16px;
  bottom: 9px;
  color: #ff6a6a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: lowercase;
  text-shadow: 1px 1px 0 rgba(8, 16, 48, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 180px);
}

.row:hover .row-title,
.row:focus-visible .row-title,
.row:active .row-title,
.row.is-pressed .row-title {
  color: #f7ff8a;
  text-shadow: 2px 2px 0 rgba(10, 20, 60, 0.8), 0 0 12px rgba(255, 252, 150, 0.7),
    0 0 26px rgba(255, 244, 120, 0.55);
}

.row:hover .row-desc,
.row:focus-visible .row-desc,
.row:active .row-desc,
.row.is-pressed .row-desc {
  color: #ff8b8b;
  text-shadow: 1px 1px 0 rgba(8, 16, 48, 0.8), 0 0 10px rgba(255, 120, 120, 0.7),
    0 0 22px rgba(255, 70, 70, 0.55);
}

.row:focus-visible {
  outline: 2px solid rgba(255, 236, 92, 0.7);
  outline-offset: 3px;
}

.row.row-disabled {
  cursor: default;
}

.row.row-disabled:focus-visible {
  outline: none;
}

.row::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  height: 2px;
  background: rgba(214, 63, 63, 0.7);
  border-radius: 999px;
}

.row-title {
  color: #d8e45a;
  font-weight: 700;
  font-size: 19px;
  text-shadow: 2px 2px 0 rgba(10, 20, 60, 0.8), 0 0 14px rgba(217, 238, 120, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.trend-icon {
  width: 52px;
  height: 52px;
  display: block;
  background-image: url('assets/trend-state-sprite.png');
  background-size: 300% 100%;
  background-position: left center;
  background-repeat: no-repeat;
  filter: drop-shadow(0 2px 0 rgba(3, 12, 38, 0.55)) drop-shadow(0 0 8px rgba(20, 40, 120, 0.25));
}

.trend-icon.state-hot {
  background-position: left center;
}

.trend-icon.state-trend {
  background-position: center center;
}

.trend-icon.state-freeze {
  background-position: right center;
}

.source-badge {
  width: 52px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(160deg, #f3f7ff, #b7cce6);
  border: 2px solid rgba(12, 22, 64, 0.45);
  color: #1b2a3f;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.6px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  box-shadow: 0 3px 0 rgba(5, 16, 52, 0.6);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
}

.source-hn {
  background: linear-gradient(160deg, #f6f2e8, #d7b18a);
  color: #3c2a1b;
}

.source-gh {
  background: linear-gradient(160deg, #f0f6ff, #a9c4e6);
}

.source-lw {
  background: linear-gradient(160deg, #eef6f2, #9cc9b6);
  color: #1e3a31;
}

.source-lb {
  background: linear-gradient(160deg, #f7f5ea, #d2c47f);
  color: #3b3317;
}

.source-hr {
  background: linear-gradient(160deg, #f3effa, #b5a9e2);
  color: #2a2140;
}

.source-mj {
  background: linear-gradient(160deg, #f2f5f8, #9ec6d9);
}

.source-ai {
  background: linear-gradient(160deg, #f3f7ff, #b7cce6);
}

.diamond {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(45deg);
  border-radius: 4px;
  border: 2px solid rgba(10, 20, 40, 0.55);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 3px 0 rgba(3, 12, 38, 0.6);
  filter: drop-shadow(0 0 6px rgba(255, 235, 150, 0.25));
}

.diamond span {
  transform: rotate(-45deg);
  font-weight: 800;
  font-size: 12px;
  color: #162233;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.diamond.hot {
  background: linear-gradient(160deg, var(--yellow-400), var(--yellow-500));
  filter: drop-shadow(0 0 7px rgba(255, 232, 120, 0.45));
}

.diamond.hot[data-state="trend"] {
  background: linear-gradient(160deg, #f8c35c, #ff9f3b);
  filter: drop-shadow(0 0 7px rgba(255, 180, 90, 0.5));
}

.diamond.hot[data-state="freeze"] {
  background: linear-gradient(160deg, #a6eef8, #6ed2e8);
  filter: drop-shadow(0 0 7px rgba(110, 210, 232, 0.55));
}

.diamond.hot span {
  letter-spacing: 0.5px;
  font-size: 10px;
}


@media (max-width: 860px) {
  .frame {
    padding: 20px 18px 22px;
    transform: scale(1);
  }

  .title {
    font-size: 17px;
  }

  .row-title {
    font-size: 17px;
  }

  .list {
    margin-left: 34px;
  }

  .list-controls {
    margin-left: 34px;
  }

  .row-desc {
    max-width: calc(100% - 150px);
  }
}

@media (max-width: 700px) {
  .crt-surface {
    padding: 16px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .meta {
    align-items: flex-start;
  }

  .list {
    width: 100%;
    margin-left: 0;
  }

  .list-controls {
    width: 100%;
    margin-left: 0;
    justify-content: center;
  }

  .row {
    grid-template-columns: minmax(0, 1fr) 62px 42px;
  }

  .row-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.15;
  }

  .row-desc {
    max-width: calc(100% - 120px);
  }

  .source-badge {
    width: 48px;
    height: 36px;
    font-size: 13px;
  }

  .diamond {
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wx-base,
  .wx-cloud,
  .wx-haze {
    animation: none !important;
  }

  .wx-bg {
    --wx-cloud-back: 0;
  }
}

@keyframes wxBaseDrift {
  0% {
    transform: translate3d(-0.8%, -0.4%, 0) scale(1.02);
  }
  50% {
    transform: translate3d(0.6%, 0.5%, 0) scale(1.04);
  }
  100% {
    transform: translate3d(-0.8%, -0.4%, 0) scale(1.02);
  }
}

@keyframes wxCloudDriftA {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(1.12) rotate(-0.2deg);
  }
  50% {
    transform: translate3d(2%, 1.2%, 0) scale(1.18) rotate(0.15deg);
  }
  100% {
    transform: translate3d(-2%, -1%, 0) scale(1.12) rotate(-0.2deg);
  }
}

@keyframes wxCloudDriftB {
  0% {
    transform: translate3d(1.2%, 0.6%, 0) scale(1.08) rotate(0.18deg);
  }
  50% {
    transform: translate3d(-1.6%, 1.4%, 0) scale(1.15) rotate(-0.12deg);
  }
  100% {
    transform: translate3d(1.2%, 0.6%, 0) scale(1.08) rotate(0.18deg);
  }
}

@keyframes wxHazeDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(1.04);
  }
  50% {
    transform: translate3d(1.2%, -0.6%, 0) scale(1.08);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1.04);
  }
}
