/* 0v0.tv blog layout - PHP supplies only the theme tokens. */
/* === Theme Tokens === */
:root {
  color-scheme: light;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(0, 0, 0, 0.11);
  --text: #111111;
  --text-secondary: #444444;
  --muted: #888888;
  --bg: #f5f5f5;
  --bg-panel: #ebebeb;
  --chip-surface: rgba(255, 255, 255, 0.7);
  --chip-hover: rgba(255, 255, 255, 0.95);
  --accent: var(--blog-accent);
  --accent-deep: var(--blog-accent-deep);
  --accent-soft: #dbeafe;
  --accent-glow: var(--blog-accent-alpha-18);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.04), 0 0 1px rgba(0,0,0,0.06);
  --shadow: 0 6px 24px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-xl: 0 28px 64px rgba(0,0,0,0.1), 0 8px 20px rgba(0,0,0,0.04);
  --shadow-glow: 0 0 40px var(--blog-accent-alpha-14);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: rgba(32, 32, 36, 0.82);
  --surface-strong: rgba(40, 40, 44, 0.92);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f0f0f2;
  --text-secondary: #b8b8bc;
  --muted: #808085;
  --bg: #121214;
  --bg-panel: #1a1a1e;
  --chip-surface: rgba(255, 255, 255, 0.07);
  --chip-hover: rgba(255, 255, 255, 0.12);
  --accent-soft: rgba(74, 144, 226, 0.15);
  --accent-glow: var(--blog-accent-alpha-20);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.4);
  --shadow: 0 6px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.55);
  --shadow-xl: 0 28px 64px rgba(0,0,0,0.65);
  --shadow-glow: 0 0 50px var(--blog-accent-alpha-18);
}

/* === Base === */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  font-family: 'Inter', 'Pretendard Variable', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 250ms var(--ease), color 250ms var(--ease);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 5% -10%, rgba(160,160,160,0.08), transparent),
    radial-gradient(ellipse 50% 40% at 95% 15%, var(--blog-accent-alpha-08), transparent),
    radial-gradient(ellipse 60% 50% at 50% 110%, rgba(120,120,120,0.05), transparent);
  pointer-events: none;
  z-index: 0;
}
:root[data-theme="dark"] body::before {
  background:
    radial-gradient(ellipse 80% 50% at 5% -10%, var(--blog-accent-alpha-0a), transparent),
    radial-gradient(ellipse 50% 40% at 95% 15%, rgba(255,255,255,0.015), transparent),
    radial-gradient(ellipse 60% 50% at 50% 110%, rgba(255,255,255,0.01), transparent);
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
button { font-family: inherit; }
body.is-loading { cursor: progress; }

/* === Top Loading Bar === */
.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  z-index: 99999;
  pointer-events: none;
  transition: none;
}
.loading-bar.active {
  animation: loadingProgress 8s cubic-bezier(0.1, 0.5, 0.3, 1) forwards;
}
.loading-bar.done {
  width: 100%;
  animation: none;
  transition: opacity 300ms ease;
  opacity: 0;
}
@keyframes loadingProgress {
  0% { width: 0; }
  20% { width: 30%; }
  50% { width: 60%; }
  80% { width: 85%; }
  100% { width: 95%; }
}

/* === Animations === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === Layout === */
.wrapper {
  position: relative;
  z-index: 1;
  width: min(1260px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 80px;
}

/* === Header === */
.site-header {
  position: relative;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 8px 24px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: none;
  border-right: none;
  border-top: none;
  border-radius: 0;
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  animation: fadeIn 400ms var(--ease) both;
  width: 100vw;
  left: 50%;
  transform: translateX(-50%);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand-logo, .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.brand-logo { object-fit: cover; }
.brand-mark {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 4px 16px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
}
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.3), transparent 60%);
}
.header-side {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}
.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.header-link, .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--chip-surface);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}
.header-link:hover, .theme-toggle:hover {
  background: var(--chip-hover);
  transform: translateY(-1px);
}
.theme-toggle { color: var(--text); cursor: pointer; padding: 0; min-height: 38px; min-width: 38px; background: transparent; border: none; }
.theme-toggle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-size: 0.82rem;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.theme-toggle-label { display: none; }

/* === Glass Shell === */
.shell, .notice, .post-card, .list-item {
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.shell {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
}

/* === Controls === */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* === View Toggle === */
.view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: var(--chip-surface);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.view-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--muted);
  transition: all 150ms var(--ease);
}
.view-link:hover:not(.active) { color: var(--text); background: var(--chip-hover); }
.view-link.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* === Category Tabs === */
.category-section { position: relative; flex: 1; min-width: 0; }
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  animation: fadeIn 500ms ease 180ms both;
}
.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
  background: var(--chip-surface);
  border: 1px solid var(--line);
  transition: all 150ms var(--ease);
}
.category-tab:hover:not(.active) {
  background: var(--chip-hover);
  color: var(--text);
  transform: translateY(-1px);
}
.category-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.category-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 0.78rem;
  font-weight: 700;
}
:root[data-theme="dark"] .category-count { background: rgba(255, 255, 255, 0.08); }
.category-tab.active .category-count { background: rgba(255,255,255,0.2); color: #fff; }

/* Category toggle button */
.cat-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--chip-surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 150ms var(--ease);
  flex-shrink: 0;
}
.cat-toggle-btn:hover { background: var(--chip-hover); color: var(--text); transform: translateY(-1px); }
.cat-toggle-btn.active { background: var(--accent); color: #fff; border-color: transparent; }

/* Category list (dropdown) view */
.category-list-wrap {
  display: none;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  animation: fadeIn 200ms ease both;
}
.category-list-wrap.visible { display: flex; }
.category-section.list-mode .category-tabs { display: none; }
.category-section.list-mode .category-list-wrap { display: flex; }
.cat-search-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.cat-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.cat-list-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.cat-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
  transition: all 120ms var(--ease);
}
.cat-list-item:hover { background: var(--chip-hover); color: var(--text); }
.cat-list-item.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.cat-list-item .category-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
}
.cat-list-item.active .category-count { background: rgba(255,255,255,0.2); color: #fff; }
.cat-list-empty {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* === Archive Meta === */
.archive-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

/* === Card Grid === */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.post-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 350ms var(--ease-spring), box-shadow 350ms var(--ease-spring);
  opacity: 0;
  transform: translateY(20px);
}
.post-card.stagger-in {
  animation: fadeInUp 500ms var(--ease-spring) both;
}
.post-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}
.card-thumb {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-panel);
  overflow: hidden;
}
.card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms var(--ease-spring);
}
.post-card:hover .card-thumb img { transform: scale(1.06); }
.card-body { padding: 20px 22px 24px; }
.card-meta, .article-categories { display: flex; flex-wrap: wrap; gap: 6px; }
.card-meta { margin-bottom: 12px; }
.card-category {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 150ms var(--ease);
}
.card-category:hover { transform: translateY(-1px); }
.card-body h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-body h2 a { transition: color 150ms var(--ease); }
.card-body h2 a:hover { color: var(--accent); }
.card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* === Stretched Link (whole card/list clickable) === */
.post-card { position: relative; cursor: pointer; }
.post-card .card-body h2 a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.post-card .card-thumb { position: relative; z-index: 2; }
.post-card .card-category { position: relative; z-index: 2; }
.list-item { position: relative; cursor: pointer; }
.list-item h2 a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.list-item .list-thumb { position: relative; z-index: 2; }
.list-item .card-category { position: relative; z-index: 2; }

/* === List View === */
.list-stack { display: flex; flex-direction: column; gap: 12px; }
.list-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  padding: 18px 22px;
  align-items: center;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 250ms var(--ease), box-shadow 250ms var(--ease), background 250ms var(--ease);
  opacity: 0;
  transform: translateY(20px);
}
.list-item.stagger-in {
  animation: fadeInUp 400ms var(--ease-spring) both;
}
.list-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
  background: var(--surface-strong);
}
.list-thumb {
  display: block;
  align-self: center;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-panel), rgba(128,128,128,0.15));
  aspect-ratio: 16 / 9;
  width: 100%;
}
.list-thumb img, .list-thumb-fallback { width: 100%; height: 100%; }
.list-thumb img { object-fit: cover; transition: transform 400ms ease; }
.list-item:hover .list-thumb img { transform: scale(1.05); }
.list-thumb-fallback {
  display: block;
  background: linear-gradient(135deg, rgba(128,128,128,0.1), rgba(80,80,80,0.08));
}
.list-item-main { min-width: 0; align-self: center; }
.list-item h2 { margin: 0 0 6px; font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.list-item h2 a { transition: color 150ms var(--ease); }
.list-item h2 a:hover { color: var(--accent); }
.list-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* === Pagination === */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--chip-surface);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 0.88rem;
  transition: all 150ms var(--ease);
}
.pagination-link:hover:not(.active) { background: var(--chip-hover); transform: translateY(-2px); }
.pagination-link.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* === Article === */
.article {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  padding-left: 0;
  padding-right: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.article-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--chip-surface);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 150ms var(--ease);
}
.article-back::before { content: '←'; margin-right: 2px; }
.article-back:hover { background: var(--chip-hover); transform: translateX(-4px); }
.article h2 {
  margin: 24px 0 14px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.04em;
}
.article-cover {
  margin: 24px 0;
  max-width: 480px;
}
.article-cover img { transition: transform 600ms ease; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--line); }
.post-inline-image { display: block; max-width: 100%; height: auto; margin: 1.25rem auto; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.article-cover:hover img { transform: scale(1.02); }
.carousel { position: relative; max-width: 480px; margin: 24px 0; overflow: hidden; border-radius: var(--radius-lg); }
.carousel-track { display: flex; transition: transform 0.35s ease; user-select: none; }
.carousel .carousel-track { cursor: grab; }
.carousel-track img { flex: 0 0 100%; width: 100%; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--line); display: block; -webkit-user-drag: none; user-select: none; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.45); color: #fff; border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; z-index: 2; opacity: 0; transition: opacity 0.2s; }
.carousel:hover .carousel-btn { opacity: 1; }
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }
.carousel-dots { text-align: center; padding: 8px 0 0; }
.carousel-dots .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-secondary); margin: 0 3px; opacity: 0.35; cursor: pointer; border: none; padding: 0; transition: opacity 0.2s; }
.carousel-dots .dot.active { opacity: 1; }
/* Mini carousel in card / list views */
.card-thumb .carousel-track, .list-thumb .carousel-track { height: 100%; cursor: pointer; }
.card-thumb .carousel-track img, .list-thumb .carousel-track img { flex: 0 0 100%; height: 100%; }
.post-card:hover .card-thumb[data-carousel] .carousel-track img { transform: none; }
.list-item:hover .list-thumb[data-carousel] img { transform: none; }
.card-thumb .carousel-btn, .list-thumb .carousel-btn { width: 26px; height: 26px; font-size: 0.8rem; }
.card-thumb:hover .carousel-btn, .list-thumb:hover .carousel-btn { opacity: 1; }
.card-thumb .carousel-dots, .list-thumb .carousel-dots { position: absolute; bottom: 6px; left: 0; right: 0; padding: 0; }
.card-thumb .carousel-dots .dot, .list-thumb .carousel-dots .dot { width: 6px; height: 6px; }
.article-content {
  /*max-width: 740px;*/
  line-height: 1.75;
  font-size: 1.04rem;
  color: var(--text-secondary);
}
.article-content strong, .article-content b { color: var(--text); }
.article-content em { font-style: italic; }
.article-content del { text-decoration: line-through; opacity: 0.7; }
.article-content u { text-decoration: underline; }
.article-content p { margin: 0.6em 0; }
.article-content h2, .article-content h3, .article-content h4 {
  color: var(--text);
  margin: 1.4em 0 0.5em;
  line-height: 1.4;
}
.article-content h2 { font-size: 1.5em; }
.article-content h3 { font-size: 1.25em; }
.article-content h4 { font-size: 1.1em; }
.article-content blockquote {
  border-left: 4px solid var(--accent, #888);
  margin: 1em 0;
  padding: 0.5em 1em;
  color: var(--text-secondary);
  background: rgba(128,128,128,0.06);
  border-radius: 4px;
}
.article-content pre {
  background: rgba(0,0,0,0.06);
  border-radius: 6px;
  padding: 1em;
  overflow-x: auto;
  margin: 1em 0;
}
.article-content pre code { background: none; padding: 0; font-size: 0.92em; }
.article-content code {
  background: rgba(0,0,0,0.06);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.92em;
  font-family: 'Consolas', 'Monaco', monospace;
}
.article-content ul, .article-content ol {
  margin: 0.8em 0;
  padding-left: 1.8em;
}
.article-content ol + ol, .article-content ul + ul { margin-top: 0; }
.article-content li { margin: 0.3em 0; }
.article-content ul.task-list {
  list-style: none;
  padding-left: 0.2em;
}
.article-content ul.task-list input[type="checkbox"] {
  margin-right: 0.5em;
  vertical-align: middle;
}
.article-content a {
  color: var(--accent, #4a90d9);
  text-decoration: underline;
  word-break: break-all;
}
.article-content .cdn-download-link {
  text-decoration: none;
  color: inherit;
}
.article-content hr {
  border: none;
  height: 1px;
  background: var(--line, #ddd);
  margin: 1em 0;
}
:root[data-theme="dark"] .article-content pre,
:root[data-theme="dark"] .article-content code { background: rgba(255,255,255,0.08); }
:root[data-theme="dark"] .article-content blockquote { background: rgba(255,255,255,0.04); }
.yt-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin: 1em 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.yt-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* === CDN Download Card === */
.cdn-download {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 1em 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text);
  transition: all 200ms var(--ease);
  overflow: hidden;
}
.cdn-download:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.cdn-download-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: transform 200ms var(--ease);
}
.cdn-download-link:hover { transform: translateY(-1px); }
.cdn-download-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  flex-shrink: 0;
}
.cdn-download-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
}
.cdn-download-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cdn-filename {
  font-weight: 700;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cdn-download-hint {
  font-size: 0.78rem;
  color: var(--muted);
}
.cdn-download-arrow {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 200ms var(--ease);
}
.cdn-download-link:hover .cdn-download-arrow { transform: translateY(2px); }
.cdn-download-arrow svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
}
/* === Page Share Button === */
.article-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.page-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--chip-surface);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 150ms var(--ease);
  position: relative;
  flex-shrink: 0;
  color: var(--fg);
}
.page-share-btn:hover {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}
.page-share-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}
.page-share-toast {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 200ms var(--ease);
}
.page-share-btn.copied .page-share-toast {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* === CDN Custom Audio Player === */
.cdna {
  display: flex;
  align-items: stretch;
  margin: 1em 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-panel);
  overflow: hidden;
  gap: 0;
}
.cdna audio { display: none; }
/* vinyl disc */
.cdna-disc {
  width: 96px;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
[data-theme="light"] .cdna-disc {
  background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
}
.cdna-disc-inner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #2d2d3f, #444, #2d2d3f, #555, #2d2d3f);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 0 3px rgba(255,255,255,.06), inset 0 0 12px rgba(0,0,0,.5);
  transition: transform .4s cubic-bezier(.4,0,.2,1);
}
[data-theme="light"] .cdna-disc-inner {
  background: conic-gradient(from 0deg, #bbb, #ddd, #bbb, #eee, #bbb);
  box-shadow: 0 0 0 3px rgba(0,0,0,.06), inset 0 0 12px rgba(0,0,0,.15);
}
.cdna.cdna-playing .cdna-disc-inner {
  animation: cdna-spin 3s linear infinite;
}
@keyframes cdna-spin {
  to { transform: rotate(360deg); }
}
.cdna-disc-label {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent, #6c5ce7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .5px;
  box-shadow: 0 0 8px var(--accent-glow, rgba(108,92,231,.4));
}
/* body */
.cdna-body {
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.cdna-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* wave progress */
.cdna-wave {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  cursor: pointer;
}
.cdna-wave-buffered {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  border-radius: 3px;
  background: var(--accent-soft, rgba(108,92,231,.15));
  pointer-events: none;
}
.cdna-wave-filled {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent, #6c5ce7), #a29bfe);
  pointer-events: none;
  transition: width 80ms linear;
}
.cdna-wave::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent, #6c5ce7);
  box-shadow: 0 0 6px var(--accent-glow, rgba(108,92,231,.5));
  pointer-events: none;
  transition: transform 150ms var(--ease);
}
.cdna-wave:hover::after {
  transform: translate(-50%, -50%) scale(1);
}
.cdna-wave-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.cdna-wave:hover { height: 8px; margin-top: -1px; margin-bottom: -1px; }
/* bottom row */
.cdna-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cdna-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--text);
  flex-shrink: 0;
}
.cdna-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent, #6c5ce7);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease);
}
.cdna-play:hover {
  transform: scale(1.08);
  box-shadow: 0 0 14px var(--accent-glow, rgba(108,92,231,.5));
}
.cdna-play svg {
  width: 16px;
  height: 16px;
  fill: #fff;
  stroke: none;
}
.cdna-play .cdna-ic-pause { display: none; }
.cdna.cdna-playing .cdna-play .cdna-ic-play { display: none; }
.cdna.cdna-playing .cdna-play .cdna-ic-pause { display: block; }
.cdna-time {
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: 1;
}
.cdna-vol-btn {
  width: 24px;
  height: 24px;
}
.cdna-vol-btn svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.cdna-vol-btn:hover svg { color: var(--accent); }
.cdna-vol {
  width: 60px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--line);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.cdna-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent, #6c5ce7);
  border: none;
  cursor: pointer;
}
.cdna-vol::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent, #6c5ce7);
  border: none;
  cursor: pointer;
}
@media (max-width: 600px) {
  .cdna-disc { width: 72px; min-height: 72px; }
  .cdna-disc-inner { width: 48px; height: 48px; }
  .cdna-disc-label { width: 18px; height: 18px; font-size: 0.42rem; }
  .cdna-body { padding: 10px 14px; gap: 8px; }
  .cdna-title { font-size: 0.8rem; }
  .cdna-vol { width: 40px; }
}

/* === CDN Custom Video Player === */
.cdnv {
  position: relative;
  margin: 1em 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: #000;
  overflow: hidden;
  cursor: pointer;
  --cdnv-accent: var(--accent, #6c5ce7);
}
.cdnv video {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #000;
}
.cdnv.cdnv-playing { cursor: default; }
.cdnv-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}
.cdnv-big-play svg {
  width: 64px;
  height: 64px;
  fill: rgba(255,255,255,.85);
  filter: drop-shadow(0 2px 12px rgba(0,0,0,.5));
  transition: transform 200ms ease, opacity 200ms ease;
}
.cdnv:hover .cdnv-big-play svg { transform: scale(1.1); }
.cdnv.cdnv-playing .cdnv-big-play { opacity: 0; transition: opacity .3s; }
.cdnv-title {
  position: absolute;
  top: 10px; left: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  background: rgba(0,0,0,.45);
  padding: 3px 10px;
  border-radius: 6px;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 3;
  pointer-events: none;
  opacity: 1;
  transition: opacity .3s;
}
.cdnv.cdnv-playing .cdnv-title { opacity: 0; }
.cdnv.cdnv-playing:hover .cdnv-title { opacity: 1; }
.cdnv-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
  z-index: 5;
  opacity: 1;
  transition: opacity .3s;
}
.cdnv.cdnv-playing .cdnv-controls { opacity: 0; }
.cdnv.cdnv-playing:hover .cdnv-controls { opacity: 1; }
.cdnv-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: background 150ms;
}
.cdnv-btn:hover { background: rgba(255,255,255,.15); }
.cdnv-btn svg { width: 20px; height: 20px; fill: #fff; stroke: none; }
.cdnv-play { width: 32px; height: 32px; }
.cdnv-play .cdnv-ic-pause { display: none; }
.cdnv.cdnv-playing .cdnv-play .cdnv-ic-play { display: none; }
.cdnv.cdnv-playing .cdnv-play .cdnv-ic-pause { display: block; }
.cdnv-progress {
  flex: 1;
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,.2);
  cursor: pointer;
}
.cdnv-progress-buffered {
  position: absolute; left: 0; top: 0;
  height: 100%;
  background: rgba(255,255,255,.25);
  border-radius: 3px;
  pointer-events: none;
}
.cdnv-progress-filled {
  position: absolute; left: 0; top: 0;
  height: 100%;
  background: var(--cdnv-accent);
  border-radius: 3px;
  pointer-events: none;
}
.cdnv-progress-input {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  margin: 0; opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.cdnv-progress:hover { height: 8px; margin-top: -1px; margin-bottom: -1px; }
.cdnv-time {
  font-size: 0.72rem;
  color: rgba(255,255,255,.8);
  white-space: nowrap;
  min-width: 80px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.cdnv-speed-wrap { position: relative; }
.cdnv-speed {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  min-width: 36px;
}
.cdnv-speed-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,20,20,.95);
  border-radius: 8px;
  padding: 4px;
  flex-direction: column;
  min-width: 60px;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.cdnv-speed-wrap.open .cdnv-speed-menu { display: flex; }
.cdnv-speed-menu button {
  background: none; border: none;
  color: rgba(255,255,255,.7);
  font-size: 0.74rem;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: background 100ms;
}
.cdnv-speed-menu button:hover { background: rgba(255,255,255,.12); }
.cdnv-speed-menu button.active { color: var(--cdnv-accent); font-weight: 700; }
.cdnv-pip svg, .cdnv-fs svg {
  width: 18px; height: 18px;
  fill: none; stroke: #fff; stroke-width: 2;
}
@media (max-width: 600px) {
  .cdnv-time { font-size: 0.65rem; min-width: 64px; }
  .cdnv-speed { font-size: 0.65rem; }
  .cdnv-big-play svg { width: 48px; height: 48px; }
  .cdnv-controls { gap: 4px; padding: 6px 8px; }
}

/* === Article Ad === */
.article-ad {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  margin: 0 auto;
}
.article-ad-mobile {
  display: none;
  justify-content: center;
  align-items: center;
  margin: 24px auto 0;
}

/* === Article Nav === */
.article-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 24px;
  padding-bottom: 24px;
  border-top: 1px solid var(--line);
}
.article-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--chip-surface);
  border: 1px solid var(--line);
  transition: all 150ms var(--ease);
  flex: 1;
  min-width: 0;
  max-width: 200px;
}
.article-nav-link:hover {
  background: var(--chip-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.article-nav-link.next { align-items: flex-end; text-align: right; }
.article-nav-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.article-nav-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === Feed Footer === */
.feed-footer { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 28px; }
.load-more {
  min-height: 48px;
  padding: 0 28px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease);
}
.load-more:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 8px 32px var(--accent-glow); }
.load-more:active { transform: translateY(0) scale(0.98); }
.feed-status { color: var(--muted); font-size: 0.88rem; }
.notice {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer {
  margin-top: 40px;
  padding: 20px 0;
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.sentinel { width: 100%; height: 1px; }



/* === Search === */
.search-container {
  position: relative;
}
.search-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--chip-surface);
  border: 1px solid var(--line);
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease), background 200ms var(--ease);
}
.search-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--chip-hover);
}
.search-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.search-input {
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  width: 160px;
}
.search-input:focus { width: 160px; }
.search-input::placeholder { color: var(--muted); }
.search-dropdown {
  position: fixed;
  top: auto;
  right: auto;
  width: 560px;
  max-height: min(440px, 60vh);
  overflow-y: auto;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: var(--shadow-xl);
  z-index: 9999;
  display: none;
  animation: fadeInUp 250ms var(--ease-spring) both;
}
.search-dropdown.active { display: block; }
.search-dropdown-header {
  padding: 14px 18px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
}
.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  transition: background 120ms var(--ease);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.search-result-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--chip-surface);
}
.search-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.search-result-body {
  flex: 1;
  min-width: 0;
}
.search-result-item:last-child { border-bottom: 0; }
.search-result-item:hover, .search-result-item.focused {
  background: var(--accent-glow);
}
.search-result-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result-excerpt {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.search-result-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
}
.search-highlight {
  background: var(--accent);
  color: #fff;
  border-radius: 3px;
  padding: 0 2px;
}
.search-empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}
.search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  background: var(--line);
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1;
  transition: background 150ms var(--ease), opacity 150ms var(--ease);
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
}
.search-clear:hover { background: var(--muted); color: #fff; }
.search-clear.visible { opacity: 1; pointer-events: auto; }

/* === Scrollbar === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }
::selection { background: var(--accent); color: #fff; }

/* === TOC Sidebar === */
.toc-sidebar {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 90;
  width: 36px;
  pointer-events: none;
  transition: width 300ms var(--ease);
}
.toc-sidebar:hover, .toc-sidebar.toc-active {
  width: 220px;
  pointer-events: auto;
}
.toc-dot-wrap {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: auto;
  cursor: pointer;
  height: 20px;
  transition: transform 150ms var(--ease);
}
.toc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.35;
  flex-shrink: 0;
  transition: opacity 200ms ease, transform 200ms ease, background 200ms ease;
}
.toc-dot-wrap:hover .toc-dot,
.toc-dot-wrap.active .toc-dot {
  opacity: 1;
  transform: scale(1.5);
}
.toc-dot-wrap.active .toc-dot {
  background: var(--accent);
}
.toc-label {
  position: absolute;
  right: 22px;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-panel);
  padding: 3px 10px;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 200ms ease, transform 200ms ease, color 200ms ease;
  pointer-events: none;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toc-sidebar:hover .toc-label,
.toc-sidebar.toc-active .toc-label {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.toc-dot-wrap:hover .toc-label {
  color: var(--text);
}
.toc-dot-wrap.active .toc-label {
  color: var(--accent);
  font-weight: 700;
}
.toc-label.toc-h3 { font-size: 0.68rem; font-weight: 500; }
.toc-label.toc-h4 { font-size: 0.64rem; font-weight: 400; }
@media (max-width: 1400px) { .toc-sidebar { display: none; } }

/* === Responsive === */
@media (max-width: 960px) {
  .controls, .archive-meta { flex-direction: column; align-items: flex-start; }
  .site-header { gap: 12px; margin-bottom: 0; border-radius: 0; margin-bottom: 20px;}
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list-item { grid-template-columns: 140px minmax(0, 1fr); }
  .shell { padding: 22px; }
  .article { padding: 0; padding-top: 20px; }
}
@media (max-width: 640px) {
  .wrapper { width: 100%; }
  .cards-grid { grid-template-columns: 1fr; gap: 16px; }
  .controls-copy h1 { font-size: 1.8rem; }
  .list-item {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    border-radius: var(--radius);
    overflow: hidden;
  }
  .list-thumb {
    aspect-ratio: 16 / 9;
    border-radius: 0;
  }
  .list-item-main {
    padding: 14px 16px;
  }
  .list-item .card-meta { margin-bottom: 6px; }
  .list-item h2 { font-size: 1rem; }
  .list-item p { -webkit-line-clamp: 2; line-clamp: 2; }
  .shell { padding: 16px; border-radius: 0; background: transparent; border: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .site-header { padding: 12px 16px; border-radius: 0; grid-template-columns: auto 1fr auto; margin-bottom: 0; box-shadow: none; width: 100vw; left: 50%; transform: translateX(-50%); }
  .brand span { display: none; }
  .search-input { width: 120px; }
  .search-input:focus { width: 120px; }
  .article { padding: 0; padding-top: 16px; padding-bottom: 24px; margin-bottom: 40px; border-radius: 0; }
  .article-ad { display: none; }
  .article-ad-mobile { display: flex; }
  .category-tabs { gap: 6px; }
  .category-tab { padding: 7px 12px; font-size: 0.82rem; }
  .category-section { flex: unset; width: 100%; }
  .category-section .category-tabs { display: none; }
  .category-section .category-list-wrap { display: flex; }
  .cat-toggle-btn { display: none; }
  .search-dropdown { width: 100vw; left: 0 !important; }
}
