:root {
  --yc-sky: #0284C7;
  --yc-sky-dark: #0369A1;
  --yc-indigo: #1E3A5F;
  --yc-cyan: #22D3EE;
  --yc-bg: #F1F5F9;
  --yc-paper: #FFFFFF;
  --yc-ink: #0F172A;
  --yc-muted: #64748B;
  --yc-line: #E2E8F0;
  --yc-radius: 12px;
  --yc-wrap: 1140px;
  --yc-font: "DIN Alternate", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--yc-font);
  color: var(--yc-ink);
  background: var(--yc-bg);
  line-height: 1.65;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; transition: color .2s, background .2s, border-color .2s, box-shadow .2s; }
a:hover { color: var(--yc-sky); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.3; }

.yc-wrap {
  width: min(100% - 32px, var(--yc-wrap));
  margin-inline: auto;
}

/* Header */
.yc-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--yc-line);
}

.yc-laser-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--yc-cyan), var(--yc-sky), transparent);
  background-size: 200% 100%;
  animation: yc-laser 3.5s linear infinite;
}

@keyframes yc-laser {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.yc-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

.yc-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.yc-logo img { height: 40px; width: auto; }

.yc-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--yc-indigo), var(--yc-sky));
  position: relative;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.35);
}

.yc-logo-mark::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 50%;
  height: 2px;
  background: var(--yc-cyan);
  box-shadow: 0 0 8px var(--yc-cyan);
}

.yc-logo strong { display: block; font-size: 1.02rem; }
.yc-logo em {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  color: var(--yc-muted);
  margin-top: 2px;
}

.yc-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.yc-nav > ul {
  display: flex;
  align-items: center;
  gap: 2px;
}

.yc-nav > ul > li { position: relative; }

.yc-nav > ul > li > a {
  display: block;
  padding: 10px 13px;
  font-size: 0.92rem;
  color: #334155;
}

.yc-nav > ul > li > a:hover,
.yc-nav > ul > li.is-active > a {
  color: var(--yc-sky);
}

.yc-nav > ul > li.is-active > a {
  box-shadow: inset 0 -2px 0 var(--yc-cyan);
}

.yc-subnav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--yc-line);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.yc-nav > ul > li.has-child:hover > .yc-subnav { display: block; }

.yc-subnav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--yc-muted);
}

.yc-subnav a:hover,
.yc-subnav .is-active a {
  background: rgba(2, 132, 199, 0.08);
  color: var(--yc-sky);
}

.yc-search {
  display: flex;
  border: 1px solid var(--yc-line);
  border-radius: 8px;
  overflow: hidden;
  background: #F8FAFC;
}

.yc-search input {
  width: 128px;
  border: 0;
  padding: 8px 12px;
  font-size: 0.85rem;
  outline: none;
  background: transparent;
}

.yc-search button {
  border: 0;
  background: var(--yc-indigo);
  color: #fff;
  padding: 8px 12px;
  font-size: 0.82rem;
  cursor: pointer;
}

.yc-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--yc-line);
  border-radius: 8px;
  background: #fff;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.yc-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--yc-ink);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

body.nav-open .yc-nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .yc-nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .yc-nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.yc-nav-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 90;
}

body.nav-open .yc-nav-mask { display: block; }

/* Scan hero */
.yc-scan {
  position: relative;
  overflow: hidden;
  padding: 52px 0 56px;
  background:
    radial-gradient(ellipse 70% 80% at 85% 20%, rgba(34, 211, 238, 0.18), transparent 55%),
    linear-gradient(135deg, #0B1C2E 0%, #12324F 55%, #0C4A6E 100%);
  color: #fff;
}

.yc-scan-beam {
  position: absolute;
  left: -20%;
  right: -20%;
  top: 58%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--yc-cyan), transparent);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.7);
  animation: yc-beam 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes yc-beam {
  0%, 100% { transform: translateY(-28px); opacity: 0.35; }
  50% { transform: translateY(36px); opacity: 1; }
}

.yc-scan-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 36px;
  align-items: center;
}

.yc-eyebrow {
  margin: 0 0 12px;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  color: var(--yc-cyan);
  font-weight: 700;
}

.yc-scan-copy h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  max-width: 12em;
}

.yc-scan-desc {
  margin: 14px 0 0;
  max-width: 34em;
  color: rgba(226, 232, 240, 0.88);
  font-size: 1.02rem;
}

.yc-scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.yc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 600;
}

.yc-btn-primary {
  background: var(--yc-cyan);
  color: #0B1C2E;
}

.yc-btn-primary:hover {
  background: #67E8F9;
  color: #0B1C2E;
}

.yc-btn-line {
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
}

.yc-btn-line:hover {
  border-color: var(--yc-cyan);
  color: var(--yc-cyan);
}

.yc-scan-meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.yc-meter-ring {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(34, 211, 238, 0.45);
  box-shadow:
    0 0 0 10px rgba(34, 211, 238, 0.08),
    inset 0 0 30px rgba(34, 211, 238, 0.12);
  background: rgba(15, 23, 42, 0.35);
}

.yc-meter-ring span {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--yc-cyan);
}

.yc-meter-ring strong {
  font-size: 1.15rem;
  margin-top: 4px;
}

.yc-meter-list {
  width: 100%;
  max-width: 220px;
}

.yc-meter-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.88rem;
  color: #CBD5E1;
}

.yc-meter-list i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yc-cyan);
  box-shadow: 0 0 8px var(--yc-cyan);
}

/* Matrix 2x2 */
.yc-matrix { margin: 36px 0 28px; }

.yc-section-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--yc-line);
}

.yc-section-hd h2 {
  font-size: 1.2rem;
  position: relative;
  padding-left: 14px;
}

.yc-section-hd h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 4px;
  height: 0.9em;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--yc-cyan), var(--yc-sky));
}

.yc-section-hd span,
.yc-section-hd a {
  font-size: 0.85rem;
  color: var(--yc-muted);
}

.yc-section-hd a:hover { color: var(--yc-sky); }

.yc-matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  counter-reset: ycmatrix;
}

.yc-matrix-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  padding: 14px;
  background: var(--yc-paper);
  border: 1px solid var(--yc-line);
  border-radius: var(--yc-radius);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.yc-matrix-card:hover {
  transform: translateY(-2px);
  border-color: rgba(2, 132, 199, 0.35);
  box-shadow: 0 12px 28px rgba(2, 132, 199, 0.1);
  color: inherit;
}

.yc-matrix-cover {
  border-radius: 10px;
  overflow: hidden;
  min-height: 110px;
  background: #E2E8F0;
}

.yc-matrix-cover img {
  width: 100%;
  height: 100%;
  min-height: 110px;
  object-fit: cover;
}

.yc-matrix-ph {
  counter-increment: ycmatrix;
  min-height: 110px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--yc-indigo), var(--yc-sky-dark));
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.yc-matrix-ph::after {
  content: "0" counter(ycmatrix);
}

.yc-matrix-body { min-width: 0; }

.yc-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  background: rgba(2, 132, 199, 0.1);
  color: var(--yc-sky);
  margin-bottom: 6px;
}

.yc-matrix-body h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.yc-matrix-body p {
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: var(--yc-muted);
}

.yc-matrix-body time {
  font-size: 0.78rem;
  color: var(--yc-muted);
}

/* Rail layout */
.yc-rail {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.yc-rail-nav {
  padding: 18px;
  background: var(--yc-paper);
  border: 1px solid var(--yc-line);
  border-radius: var(--yc-radius);
  align-self: start;
  position: sticky;
  top: 84px;
}

.yc-rail-nav > h2 {
  font-size: 1rem;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--yc-line);
}

.yc-rail-nav > ul { margin-bottom: 20px; }

.yc-rail-nav > ul a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #334155;
  border-left: 3px solid transparent;
}

.yc-rail-nav > ul li.is-active a,
.yc-rail-nav > ul a:hover {
  background: rgba(2, 132, 199, 0.08);
  color: var(--yc-sky);
  border-left-color: var(--yc-cyan);
}

.yc-rail-hot h3 {
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.yc-rail-main {
  padding: 20px;
  background: var(--yc-paper);
  border: 1px solid var(--yc-line);
  border-radius: var(--yc-radius);
}

.yc-news-rows li {
  border-bottom: 1px solid var(--yc-line);
}

.yc-news-rows li:last-child { border-bottom: 0; }

.yc-news-rows a {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  padding: 16px 0;
  color: inherit;
}

.yc-news-date {
  text-align: center;
  padding: 8px 4px;
  border-radius: 10px;
  background: #F1F5F9;
  border: 1px solid var(--yc-line);
}

.yc-news-date strong {
  display: block;
  font-size: 1.35rem;
  color: var(--yc-sky);
  line-height: 1.1;
}

.yc-news-date span {
  font-size: 0.72rem;
  color: var(--yc-muted);
}

.yc-news-body h3 {
  font-size: 1.05rem;
  margin: 4px 0 6px;
}

.yc-news-body p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--yc-muted);
}

/* Dual */
.yc-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 48px;
}

.yc-dual-col {
  padding: 18px;
  background: var(--yc-paper);
  border: 1px solid var(--yc-line);
  border-radius: var(--yc-radius);
}

.yc-dual-accent {
  background: linear-gradient(160deg, rgba(2, 132, 199, 0.08), #fff 50%);
  border-color: rgba(2, 132, 199, 0.22);
}

.yc-plain-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--yc-line);
  font-size: 0.9rem;
}

.yc-plain-list li:last-child { border-bottom: 0; }

.yc-plain-list span {
  flex-shrink: 0;
  color: var(--yc-muted);
  font-size: 0.8rem;
}

/* Inner */
.yc-crumb {
  padding: 14px 0;
  font-size: 0.88rem;
  color: var(--yc-muted);
  border-bottom: 1px solid var(--yc-line);
  background: #fff;
}

.yc-crumb span { margin: 0 6px; color: #CBD5E1; }

.yc-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  padding: 28px 0 48px;
}

.yc-panel {
  background: var(--yc-paper);
  border: 1px solid var(--yc-line);
  border-radius: var(--yc-radius);
  padding: 18px;
  margin-bottom: 18px;
}

.yc-panel-hd {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--yc-line);
}

.yc-panel-hd h3 { font-size: 1rem; }

.yc-list-panel,
.yc-detail { margin-bottom: 0; }

.yc-page-title {
  font-size: 1.4rem;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--yc-line);
}

.yc-article-list li { border-bottom: 1px solid var(--yc-line); }
.yc-article-list li:last-child { border-bottom: 0; }

.yc-article-list a {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  align-items: flex-start;
  color: inherit;
}

.yc-article-list img {
  width: 140px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

.yc-article-list h2 {
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.yc-article-list p {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--yc-muted);
}

.yc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--yc-muted);
}

.yc-meta.center {
  justify-content: center;
  margin: 14px 0 22px;
}

.yc-detail > h1 {
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  text-align: center;
}

.yc-richtext {
  font-size: 1.02rem;
  line-height: 1.85;
  color: #334155;
}

.yc-richtext p { margin: 0 0 1em; }
.yc-richtext img { margin: 1em auto; border-radius: 10px; }
.yc-richtext h2, .yc-richtext h3 { margin: 1.2em 0 0.6em; }

.yc-pagerow {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--yc-line);
  font-size: 0.92rem;
}

.yc-pagerow a { color: var(--yc-sky); }
.yc-pagerow span { color: var(--yc-muted); }

.yc-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--yc-muted);
}

.yc-rank { counter-reset: ycrank; }

.yc-rank li {
  counter-increment: ycrank;
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--yc-line);
  font-size: 0.88rem;
}

.yc-rank li:last-child { border-bottom: 0; }

.yc-rank li::before {
  content: counter(ycrank);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #E2E8F0;
  color: var(--yc-indigo);
}

.yc-rank li:nth-child(-n+3)::before {
  background: var(--yc-sky);
  color: #fff;
}

.yc-side-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--yc-line);
  font-size: 0.9rem;
}

.yc-side-list li:last-child { border-bottom: 0; }

.yc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.yc-tags a {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--yc-muted);
  border: 1px solid var(--yc-line);
  background: #F8FAFC;
}

.yc-tags a:hover {
  color: var(--yc-sky);
  border-color: var(--yc-sky);
}

.yc-ad {
  font-size: 0.9rem;
  color: var(--yc-muted);
}

.yc-pagination { margin-top: 22px; }

.yc-page {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.yc-page a,
.yc-page .dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--yc-line);
  font-size: 0.88rem;
  color: var(--yc-muted);
  background: #fff;
}

.yc-page .active a,
.yc-page a:hover {
  background: var(--yc-sky);
  border-color: var(--yc-sky);
  color: #fff;
}

/* Footer */
.yc-footer {
  padding: 44px 0 26px;
  background: #0B1C2E;
  color: #CBD5E1;
}

.yc-footer a { color: #CBD5E1; }
.yc-footer a:hover { color: var(--yc-cyan); }

.yc-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 24px;
}

.yc-footer h3 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.yc-footer h4 {
  color: var(--yc-cyan);
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.yc-footer p {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: #94A3B8;
}

.yc-foot-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yc-foot-links a { font-size: 0.9rem; }

.yc-friendlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}

.yc-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  color: #94A3B8;
}

/* Responsive */
@media (max-width: 960px) {
  .yc-scan-inner,
  .yc-rail,
  .yc-dual,
  .yc-layout { grid-template-columns: 1fr; }
  .yc-rail-nav { position: static; }
  .yc-matrix-grid { grid-template-columns: 1fr; }
  .yc-footer-grid { grid-template-columns: 1fr; }
  .yc-side { order: 2; }
}

@media (max-width: 768px) {
  .yc-nav-toggle { display: flex; }

  .yc-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(86vw, 320px);
    height: 100vh;
    z-index: 110;
    flex-direction: column;
    align-items: stretch;
    padding: 80px 20px 24px;
    background: #fff;
    border-left: 1px solid var(--yc-line);
    transform: translateX(105%);
    transition: transform .28s ease;
    overflow-y: auto;
  }

  .yc-nav.is-open { transform: translateX(0); }

  .yc-nav > ul {
    flex-direction: column;
    align-items: stretch;
  }

  .yc-nav > ul > li > a {
    border-radius: 8px;
    padding: 12px 14px;
  }

  .yc-nav > ul > li.is-active > a {
    box-shadow: none;
    background: rgba(2, 132, 199, 0.08);
  }

  .yc-subnav {
    position: static;
    display: none;
    margin: 0 0 4px 10px;
    box-shadow: none;
    border: 0;
    padding: 0;
  }

  .yc-nav > ul > li.has-child.is-open > .yc-subnav,
  .yc-nav > ul > li.has-child:hover > .yc-subnav { display: block; }

  .yc-search { width: 100%; margin-top: 14px; }
  .yc-search input { width: 100%; flex: 1; }

  .yc-scan { padding: 36px 0 44px; }
  .yc-matrix-card { grid-template-columns: 1fr; }
  .yc-matrix-cover,
  .yc-matrix-cover img,
  .yc-matrix-ph { min-height: 140px; }

  .yc-news-rows a { grid-template-columns: 56px 1fr; gap: 12px; }

  .yc-article-list a { flex-direction: column; }
  .yc-article-list img {
    width: 100%;
    height: 160px;
  }

  .yc-detail > h1 { text-align: left; }
  .yc-meta.center { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .yc-laser-line,
  .yc-scan-beam { animation: none; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================================
   Dark theme overrides (appended; base rules untouched)
   Activated via [data-theme="dark"] on <html> or <body>.
   Anti-flash inline script lives in header.php (before stylesheet).
   Note: existing @media (prefers-reduced-motion: reduce) rule above
   already disables all transitions globally, so theme transitions
   are auto-respected.
   ============================================================ */

/* Smooth theme transition on key surfaces (both directions).
   Targeted to avoid overriding <a>'s own transition rule. */
body,
.yc-header,
.yc-subnav,
.yc-search,
.yc-nav-toggle,
.yc-matrix-card,
.yc-rail-nav,
.yc-rail-main,
.yc-dual-col,
.yc-panel,
.yc-crumb,
.yc-news-date,
.yc-footer {
  transition: background-color .3s, color .3s, border-color .3s;
}

html[data-theme="dark"],
body[data-theme="dark"] {
  --yc-sky: #38BDF8;            /* brightened for dark-bg visibility */
  --yc-sky-dark: #0EA5E9;       /* brightened counterpart */
  --yc-bg: #0F1620;
  --yc-paper: rgba(26, 33, 44, 0.8);
  --yc-ink: #E8EDF5;
  --yc-muted: #94A3B8;
  --yc-line: rgba(148, 163, 184, 0.15);
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(34, 211, 238, 0.06), transparent 55%),
    linear-gradient(180deg, #0F1620 0%, #0B0F14 100%);
  color: var(--yc-ink);
}

/* Header bar */
html[data-theme="dark"] .yc-header {
  background: rgba(15, 22, 32, 0.85);
  border-bottom-color: var(--yc-line);
}

/* Secondary text color overrides for elements with hardcoded #334155 */
html[data-theme="dark"] .yc-nav > ul > li > a,
html[data-theme="dark"] .yc-rail-nav > ul a,
html[data-theme="dark"] .yc-richtext {
  color: #CBD5E1;
}

html[data-theme="dark"] .yc-nav > ul > li > a:hover,
html[data-theme="dark"] .yc-nav > ul > li.is-active > a,
html[data-theme="dark"] .yc-rail-nav > ul li.is-active a,
html[data-theme="dark"] .yc-rail-nav > ul a:hover {
  color: var(--yc-sky);
}

html[data-theme="dark"] .yc-subnav a:hover,
html[data-theme="dark"] .yc-subnav .is-active a {
  background: rgba(56, 189, 248, 0.12);
  color: var(--yc-sky);
}

/* Subnav dropdown */
html[data-theme="dark"] .yc-subnav {
  background: #1A212C;
  border-color: var(--yc-line);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

/* Search box */
html[data-theme="dark"] .yc-search {
  background: rgba(15, 23, 42, 0.6);
  border-color: var(--yc-line);
}

html[data-theme="dark"] .yc-search input { color: #E8EDF5; }
html[data-theme="dark"] .yc-search input::placeholder { color: #64748B; }

/* Nav toggle (mobile) */
html[data-theme="dark"] .yc-nav-toggle {
  background: #1A212C;
  border-color: var(--yc-line);
}

/* Card / panel paper surfaces */
html[data-theme="dark"] .yc-matrix-card,
html[data-theme="dark"] .yc-rail-nav,
html[data-theme="dark"] .yc-rail-main,
html[data-theme="dark"] .yc-dual-col,
html[data-theme="dark"] .yc-panel,
html[data-theme="dark"] .yc-crumb {
  background: var(--yc-paper);
  border-color: var(--yc-line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

html[data-theme="dark"] .yc-matrix-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.12);
}

html[data-theme="dark"] .yc-dual-accent {
  background: linear-gradient(160deg, rgba(56, 189, 248, 0.1), rgba(26, 33, 44, 0.6) 50%);
  border-color: rgba(56, 189, 248, 0.25);
}

html[data-theme="dark"] .yc-matrix-cover { background: #1A212C; }

html[data-theme="dark"] .yc-news-date {
  background: rgba(15, 23, 42, 0.6);
  border-color: var(--yc-line);
}

/* Rank badges */
html[data-theme="dark"] .yc-rank li::before {
  background: #1A212C;
  color: var(--yc-cyan);
}

html[data-theme="dark"] .yc-rank li:nth-child(-n+3)::before {
  background: var(--yc-sky);
  color: #0B0F14;
}

/* Tags */
html[data-theme="dark"] .yc-tags a {
  background: rgba(15, 23, 42, 0.6);
  border-color: var(--yc-line);
  color: #CBD5E1;
}

/* Pagination */
html[data-theme="dark"] .yc-page a,
html[data-theme="dark"] .yc-page .dots {
  background: #1A212C;
  border-color: var(--yc-line);
  color: #CBD5E1;
}

html[data-theme="dark"] .yc-page .active a,
html[data-theme="dark"] .yc-page a:hover {
  background: var(--yc-sky);
  border-color: var(--yc-sky);
  color: #0B0F14;
}

/* Footer (already dark; harmonize with theme) */
html[data-theme="dark"] .yc-footer {
  background: #0B0F14;
  border-top: 1px solid var(--yc-line);
}

/* Mobile nav drawer in dark mode */
@media (max-width: 768px) {
  html[data-theme="dark"] .yc-nav {
    background: #0F1620;
    border-left-color: var(--yc-line);
  }
  html[data-theme="dark"] .yc-nav-mask {
    background: rgba(0, 0, 0, 0.6);
  }
}

/* ============================================================
   Theme toggle button
   ============================================================ */
.yc-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid var(--yc-line);
  border-radius: 8px;
  background: transparent;
  color: var(--yc-ink);
  cursor: pointer;
  flex-shrink: 0;
  transition: color .2s, border-color .2s, background-color .2s;
}

.yc-theme-toggle:hover {
  color: var(--yc-sky);
  border-color: var(--yc-sky);
}

.yc-theme-toggle:focus-visible {
  outline: 2px solid var(--yc-sky);
  outline-offset: 2px;
}

.yc-theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* Light mode shows moon (click → dark); dark mode shows sun (click → light) */
.yc-theme-toggle .yc-icon-sun { display: none; }
.yc-theme-toggle .yc-icon-moon { display: block; }

html[data-theme="dark"] .yc-theme-toggle .yc-icon-sun { display: block; }
html[data-theme="dark"] .yc-theme-toggle .yc-icon-moon { display: none; }

/* Hide toggle on very small screens to keep nav drawer uncluttered */
@media (max-width: 480px) {
  .yc-theme-toggle { display: none; }
}
