/* ================================================================
   Aurora — content layer
   Post page, article typography, TOC, archive, taxonomy, about,
   search and overlays
   ================================================================ */

/* ---------------------------------------------------------------
   12. Post header & layout
   --------------------------------------------------------------- */
.post-hero {
  position: relative;
  padding: calc(var(--header-h) + 52px) 0 clamp(40px, 5vw, 58px);
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--line);
}

.post-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(65% 90% at 10% 0%, hsl(var(--hue, 240) 80% 92% / 0.75), transparent 58%),
    radial-gradient(55% 80% at 92% 10%, rgba(6, 182, 212, 0.09), transparent 62%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
}

[data-theme="dark"] .post-hero-bg {
  background:
    radial-gradient(65% 90% at 10% 0%, hsl(var(--hue, 240) 50% 22% / 0.6), transparent 58%),
    radial-gradient(55% 80% at 92% 10%, rgba(6, 182, 212, 0.08), transparent 62%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
}

.post-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 72%, var(--bg) 100%);
}

.post-hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.4;
}

.post-hero-orb--1 {
  width: 380px;
  height: 380px;
  top: -200px;
  left: -80px;
  background: hsl(var(--hue, 240) 80% 70%);
}

.post-hero-orb--2 {
  width: 300px;
  height: 300px;
  top: -140px;
  right: -60px;
  background: rgba(6, 182, 212, 0.4);
}

.post-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 90% at 40% 0%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 40% 0%, #000 10%, transparent 78%);
  opacity: 0.5;
}

.post-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 800px) minmax(232px, 280px);
  justify-content: center;
  align-items: start;
  gap: clamp(32px, 3.5vw, 48px);
  max-width: 1128px;
}

.post-hero-inner > * {
  grid-column: 1;
}

.post-hero-inner--single {
  grid-template-columns: minmax(0, 840px);
  max-width: 840px;
}

.post-kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.post-category {
  display: inline-flex;
  align-items: center;
  height: 25px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.post-locked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 25px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  font-size: 11px;
  font-weight: 600;
}

[data-theme="dark"] .post-locked {
  color: #fbbf24;
}

.post-locked .icon {
  width: 12px;
  height: 12px;
}

.post-title {
  margin-top: 16px;
  font-size: clamp(2.15rem, 4.4vw, 3.7rem);
  font-weight: 820;
  line-height: 1.08;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.post-lead {
  max-width: 780px;
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(14.5px, 1.2vw, 16px);
  line-height: 1.8;
}

.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 12px;
}

.post-author-mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.post-author-mini img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.post-author-mini:hover {
  color: var(--accent);
}

.meta-divider {
  width: 1px;
  height: 16px;
  background: var(--line-strong);
}

.post-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.post-meta-item .icon {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

.post-meta-item--muted {
  color: var(--muted-2);
}

.post-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 800px) minmax(232px, 280px);
  justify-content: center;
  align-items: start;
  gap: clamp(32px, 3.5vw, 48px);
  padding-top: clamp(40px, 5vw, 58px);
  padding-bottom: clamp(48px, 7vw, 90px);
}

.post-main {
  min-width: 0;
}

.post-cover {
  margin-bottom: 34px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.post-aside {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------------------------------------------------------------
   13. Article typography
   --------------------------------------------------------------- */
.prose {
  color: var(--text-soft);
  font-size: 1.015rem;
  line-height: 1.9;
  overflow-wrap: break-word;
}

.prose > *:first-child {
  margin-top: 0 !important;
}

.prose > h1:first-child,
.prose > hr:first-child {
  display: none;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  position: relative;
  scroll-margin-top: calc(var(--header-h) + 26px);
  color: var(--text);
  letter-spacing: -0.03em;
}

.prose h2 {
  margin: 2.5em 0 0.85em;
  padding-left: 14px;
  font-size: clamp(1.4rem, 2.4vw, 1.65rem);
  line-height: 1.32;
}

.prose h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.22em;
  bottom: 0.22em;
  width: 3px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--accent), var(--accent-3));
}

.prose h3 {
  margin: 2em 0 0.7em;
  font-size: 1.24rem;
  line-height: 1.4;
}

.prose h4 {
  margin: 1.7em 0 0.6em;
  font-size: 1.06rem;
}

.prose h5,
.prose h6 {
  margin: 1.5em 0 0.5em;
  font-size: 0.98rem;
}

.prose p {
  margin: 1.15em 0;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 32%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.prose a:hover {
  color: var(--accent-2);
  text-decoration-color: currentColor;
}

.prose strong {
  color: var(--text);
  font-weight: 650;
}

.prose em {
  color: var(--text);
}

.prose ul,
.prose ol {
  margin: 1.15em 0;
  padding-left: 1.5em;
}

.prose li {
  margin: 0.42em 0;
  padding-left: 0.2em;
}

.prose li::marker {
  color: var(--accent);
}

.prose li > ul,
.prose li > ol {
  margin: 0.4em 0;
}

.prose blockquote {
  position: relative;
  margin: 1.8em 0;
  padding: 18px 22px 18px 24px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-softer);
  color: var(--text-soft);
}

.prose blockquote p {
  margin: 0.5em 0;
}

.prose blockquote p:first-child {
  margin-top: 0;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose hr {
  height: 1px;
  margin: 3em 0;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.prose img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 1.5em auto;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  transition: opacity 0.2s;
}

.prose img:hover {
  opacity: 0.94;
}

.prose figure img {
  margin-bottom: 8px;
}

.prose figcaption {
  margin-top: 6px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.prose iframe {
  max-width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
}

.prose iframe[src*="youtube"],
.prose iframe[src*="youtu.be"],
.prose iframe[src*="vimeo"] {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 1.4em 0;
  box-shadow: var(--shadow-sm);
}

.prose video {
  width: 100%;
  border-radius: var(--radius-sm);
}

.table-wrap {
  margin: 1.7em 0;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  scrollbar-width: thin;
}

.table-wrap table {
  margin: 0;
}

.prose table {
  width: 100%;
  margin: 1.7em 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.65;
}

.prose thead {
  background: var(--surface-3);
}

.prose th {
  padding: 11px 14px;
  color: var(--text);
  font-weight: 650;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.prose tr:last-child td {
  border-bottom: 0;
}

.prose tbody tr {
  transition: background-color 0.2s;
}

.prose tbody tr:hover {
  background: var(--accent-softer);
}

/* Markdown tables used as image + caption blocks */
.prose table:has(img) {
  border: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

.prose table:has(img) thead {
  background: transparent;
}

.prose table:has(img) th {
  padding: 4px 8px 10px;
  border-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
}

.prose table:has(img) td {
  padding: 0 8px 20px;
  border-bottom: 0;
  text-align: center;
}

.prose table:has(img) tbody tr:hover {
  background: transparent;
}

.prose table:has(img) img {
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.prose .headerlink {
  display: inline-block;
  margin-left: 8px;
  color: var(--muted-2);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  font-size: 0.72em;
}

.prose .headerlink::after {
  content: "#";
}

.prose h1:hover .headerlink,
.prose h2:hover .headerlink,
.prose h3:hover .headerlink,
.prose h4:hover .headerlink,
.prose h5:hover .headerlink,
.prose h6:hover .headerlink {
  opacity: 1;
}

.prose .headerlink:hover {
  color: var(--accent);
}

/* Inline code */
.prose :not(pre) > code {
  padding: 0.18em 0.42em;
  border-radius: 6px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: color-mix(in srgb, var(--accent) 78%, var(--text));
  font-family: var(--font-mono);
  font-size: 0.86em;
  word-break: break-word;
}

/* Highlighted code blocks */
.prose figure.highlight {
  position: relative;
  margin: 1.8em 0;
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.prose figure.highlight table {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  border-collapse: collapse;
  table-layout: fixed;
  overflow: visible;
  background: transparent;
  font-size: 0.84rem;
}

.prose figure.highlight td {
  padding: 0;
  border: 0;
  vertical-align: top;
}

.prose figure.highlight .gutter {
  width: 46px;
  padding: 17px 0 17px 15px;
  text-align: right;
  color: #46536b;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.75;
  user-select: none;
  border-right: 1px solid rgba(148, 163, 184, 0.08);
}

.prose figure.highlight .gutter pre {
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 0;
  line-height: 1.75;
}

.prose figure.highlight .code {
  padding: 17px 20px;
  width: auto;
}

.prose figure.highlight pre {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.75;
  overflow-x: auto;
  scrollbar-width: thin;
}

.prose figure.highlight code {
  font-family: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
}

.prose figure.highlight .line {
  display: inline;
}

/* Generic pre blocks that are not highlighted by Hexo */
.prose pre:not(.highlight pre):not(.mermaid) {
  margin: 1.8em 0;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.75;
  overflow-x: auto;
  box-shadow: var(--shadow-md);
}

.prose pre.mermaid {
  margin: 1.8em 0;
  padding: 22px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
  overflow-x: auto;
}

.prose pre.mermaid svg {
  max-width: 100%;
  height: auto;
}

/* Code toolbar injected by JS */
.code-toolbar {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.55;
  transition: opacity 0.2s;
}

figure.highlight:hover .code-toolbar,
figure.highlight:focus-within .code-toolbar {
  opacity: 1;
}

.code-lang {
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.12);
  color: #8fa0bd;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  transition: background-color 0.2s, color 0.2s;
}

.code-copy:hover {
  background: rgba(148, 163, 184, 0.22);
  color: #fff;
}

.code-copy .icon {
  width: 14px;
  height: 14px;
}

.code-copy.is-copied {
  color: #4ade80;
}

/* Syntax colour palette (works with Hexo's hljs output) */
.hljs-comment,
.hljs-quote {
  color: #64748b;
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-type {
  color: #c084fc;
}

.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute {
  color: #86efac;
}

.hljs-number,
.hljs-symbol,
.hljs-bullet,
.hljs-link {
  color: #fbbf24;
}

.hljs-title,
.hljs-section,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
  color: #7dd3fc;
}

.hljs-variable,
.hljs-template-variable,
.hljs-params {
  color: #fca5a5;
}

.hljs-built_in,
.hljs-builtin-name,
.hljs-meta,
.hljs-tag {
  color: #67e8f9;
}

.hljs-deletion {
  color: #f87171;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: 700;
}

/* Task list */
.prose input[type="checkbox"] {
  margin-right: 6px;
  accent-color: var(--accent);
}

/* Footnotes */
.prose .footnotes {
  margin-top: 3em;
  padding-top: 1.4em;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
}

/* End of article */
.post-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 56px 0 34px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.post-end-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.post-end-mark .icon {
  width: 18px;
  height: 18px;
}

/* Share row */
.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.share-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 35px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s, transform 0.2s;
}

.share-btn .icon {
  width: 15px;
  height: 15px;
}

.share-btn:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  background: var(--accent-softer);
  transform: translateY(-1px);
}

.share-btn--icon {
  width: 35px;
  padding: 0;
  justify-content: center;
}

/* Author card */
.author-card {
  display: flex;
  gap: 20px;
  margin-top: 34px;
  padding: 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 100% at 100% 0%, var(--accent-soft), transparent 55%),
    var(--surface);
  box-shadow: var(--shadow-xs);
}

.author-card-avatar {
  flex: none;
  width: 64px;
  height: 64px;
  padding: 3px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
}

.author-card-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 17px;
  object-fit: cover;
  background: var(--surface);
}

.author-card-body {
  min-width: 0;
}

.author-card-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.author-card-body h2 {
  margin-top: 3px;
  font-size: 1.15rem;
}

.author-card-body p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.author-card-socials {
  display: flex;
  gap: 5px;
  margin-top: 12px;
}

.author-card-socials .icon-btn {
  width: 34px;
  height: 34px;
}

/* Previous / next */
.post-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 32px;
}

.post-pagination-item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}

.post-pagination-item:hover {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.post-pagination-item.is-empty {
  visibility: hidden;
}

.post-pagination-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-pagination-label .icon {
  width: 13px;
  height: 13px;
}

.post-pagination-item strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.post-pagination-item:hover strong {
  color: var(--accent);
}

.post-pagination-item--next {
  text-align: right;
}

.post-pagination-item--next .post-pagination-label {
  justify-content: flex-end;
}

/* Related */
.related-posts {
  margin-top: 52px;
}

.related-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.related-head h2 {
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.related-head span {
  color: var(--muted);
  font-size: 11.5px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.comments {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.comments-title {
  margin-bottom: 18px;
  font-size: 1.2rem;
}

/* ---------------------------------------------------------------
   14. Table of contents
   --------------------------------------------------------------- */
.toc-card {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
}

.toc-head > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toc-head .icon {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.toc-percent {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
}

.toc-progress {
  height: 3px;
  margin-bottom: 12px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.toc-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transition: width 0.2s linear;
}

.toc-nav {
  max-height: calc(100vh - 330px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.toc-nav::-webkit-scrollbar {
  width: 4px;
}

.toc-nav::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
}

.toc-link {
  position: relative;
  display: block;
  padding: 6px 0 6px 13px;
  border-left: 1.5px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  transition: color 0.2s, border-color 0.2s;
}

.toc-link:hover {
  color: var(--text);
}

.toc-link.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.toc-link--h3 {
  padding-left: 25px;
  font-size: 11.5px;
}

.toc-link--h4 {
  padding-left: 36px;
  font-size: 11px;
}

.toc-empty {
  color: var(--muted-2);
  font-size: 11.5px;
}

.toc-card .toc-empty {
  display: none;
}

.toc-card.is-empty {
  display: none;
}

.aside-card {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.aside-title {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.aside-share-actions {
  display: flex;
  gap: 5px;
}

.aside-back-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 0.2s, color 0.2s;
}

.aside-back-card .aside-title {
  margin: 0;
}

.aside-back-arrow {
  color: var(--muted);
  transition: transform 0.2s, color 0.2s;
}

.aside-back-card:hover {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  color: var(--accent);
}

.aside-back-card:hover .aside-back-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* Floating TOC */
.toc-fab {
  position: fixed;
  right: 22px;
  bottom: 74px;
  z-index: 91;
  display: none;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

.toc-fab .icon {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.toc-drawer {
  position: fixed;
  inset: 0;
  z-index: 160;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.toc-drawer.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 18, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 88vw);
  padding: 22px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
  overflow-y: auto;
}

.toc-drawer.is-open .drawer-panel {
  transform: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc-nav--mobile {
  max-height: none;
}

.toc-nav--mobile .toc-link {
  font-size: 13px;
  padding-top: 9px;
  padding-bottom: 9px;
}

/* Reading progress */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 130;
  height: 2.5px;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: width 0.1s linear;
}

/* ---------------------------------------------------------------
   15. Archive timeline
   --------------------------------------------------------------- */
.archive-section {
  padding-top: clamp(36px, 5vw, 56px);
}

.year-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: clamp(32px, 5vw, 48px);
}

.year-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s, transform 0.2s;
}

.year-chip span {
  color: var(--muted-2);
  font-size: 10.5px;
}

.year-chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.year-chip.is-active {
  color: var(--on-accent);
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}

.year-chip.is-active span {
  color: rgba(255, 255, 255, 0.72);
}

.timeline-year {
  margin-bottom: 44px;
}

.timeline-year-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.timeline-year-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.timeline-year-head span {
  color: var(--muted);
  font-size: 11.5px;
}

.timeline-list {
  position: relative;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 58px 18px minmax(0, 1fr) 32px;
  align-items: start;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-date {
  padding-top: 2px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.timeline-dot {
  position: relative;
  width: 8px;
  height: 8px;
  margin: 7px auto 0;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-softer);
  z-index: 1;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(58px + 12px + 9px - 0.5px);
  width: 1px;
  background: var(--line);
}

.timeline-item:first-child::before {
  top: 22px;
}

.timeline-item:last-child::before {
  bottom: calc(100% - 22px);
}

.timeline-body {
  min-width: 0;
}

.timeline-body h3 {
  font-size: clamp(0.98rem, 1.5vw, 1.1rem);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.015em;
}

.timeline-body h3 a {
  transition: color 0.2s;
}

.timeline-item:hover .timeline-body h3 a {
  color: var(--accent);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
}

.timeline-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.timeline-meta .icon {
  width: 12px;
  height: 12px;
}

.timeline-cat {
  color: var(--accent);
  font-weight: 600;
}

.timeline-arrow {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted-2);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s, color 0.2s, background-color 0.2s;
}

.timeline-arrow .icon {
  width: 14px;
  height: 14px;
}

.timeline-item:hover .timeline-arrow {
  opacity: 1;
  transform: none;
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---------------------------------------------------------------
   16. Categories page
   --------------------------------------------------------------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
}

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 120% at 100% 0%, hsl(var(--hue, 240) 70% 94% / 0.7), transparent 55%),
    var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s, border-color 0.25s;
}

[data-theme="dark"] .category-card {
  background:
    radial-gradient(120% 120% at 100% 0%, hsl(var(--hue, 240) 45% 24% / 0.55), transparent 55%),
    var(--surface);
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
  box-shadow: var(--shadow-md);
}

.category-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: hsl(var(--hue, 240) 70% 92%);
  color: hsl(var(--hue, 240) 55% 36%);
  border: 1px solid hsl(var(--hue, 240) 60% 86%);
}

[data-theme="dark"] .category-card-icon {
  background: hsl(var(--hue, 240) 45% 20%);
  color: hsl(var(--hue, 240) 65% 80%);
  border-color: hsl(var(--hue, 240) 40% 28%);
}

.category-card-icon .icon {
  width: 20px;
  height: 20px;
}

.category-card-count {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.category-card h2 {
  margin-top: 4px;
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  text-transform: capitalize;
}

.category-card-bar {
  height: 3px;
  margin: 4px 0 6px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.category-card-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: hsl(var(--hue, 240) 65% 62%);
  opacity: 0.75;
}

.category-card-posts {
  display: flex;
  flex-direction: column;
  gap: 7px;
  list-style: none;
}

.category-card-posts li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.category-card-posts li > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-card-posts time {
  flex: none;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
}

.category-card-arrow {
  position: absolute;
  right: 22px;
  bottom: 22px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 0.25s, transform 0.25s, background-color 0.25s, color 0.25s;
}

.category-card-arrow .icon {
  width: 14px;
  height: 14px;
}

.category-card:hover .category-card-arrow {
  opacity: 1;
  transform: none;
  background: var(--accent);
  color: var(--on-accent);
}

/* ---------------------------------------------------------------
   17. Tags page
   --------------------------------------------------------------- */
.tag-page {
  max-width: 980px;
}

.tag-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.tag-filter {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: min(320px, 100%);
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tag-filter:focus-within {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: 0 0 0 4px var(--accent-softer);
}

.tag-filter .icon {
  width: 16px;
  height: 16px;
}

.tag-filter input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.tag-filter input::placeholder {
  color: var(--muted-2);
}

.tag-toolbar-count {
  flex: none;
  color: var(--muted);
  font-size: 11.5px;
}

.tag-cloud-large {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: calc(0.42em * var(--tag-scale, 1)) calc(0.85em * var(--tag-scale, 1));
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  font-size: calc(0.9rem * var(--tag-scale, 1));
  font-weight: 550;
  line-height: 1.25;
  box-shadow: var(--shadow-xs);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s, transform 0.2s;
}

.tag-pill-hash {
  color: var(--accent);
  opacity: 0.7;
  font-weight: 600;
}

.tag-pill-count {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 0.62em;
  font-variant-numeric: tabular-nums;
}

.tag-pill:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background: var(--accent-softer);
  transform: translateY(-2px);
}

.tag-pill.is-hidden {
  display: none;
}

.tag-empty {
  padding: 48px 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

/* ---------------------------------------------------------------
   18. About page
   --------------------------------------------------------------- */
.about-hero {
  position: relative;
  padding: calc(var(--header-h) + 72px) 0 clamp(48px, 6vw, 72px);
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--line);
}

.about-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 90% at 12% 0%, var(--accent-soft), transparent 58%),
    radial-gradient(50% 80% at 92% 20%, rgba(6, 182, 212, 0.08), transparent 60%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
}

.about-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 70%, var(--bg) 100%);
}

.about-hero-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: center;
  gap: clamp(36px, 6vw, 76px);
}

.about-portrait {
  position: relative;
  justify-self: center;
  width: 220px;
  height: 220px;
}

.about-portrait-ring {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--accent) 38%, transparent);
  animation: spin 36s linear infinite;
}

.about-portrait img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--surface);
  box-shadow: 0 30px 60px -24px color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--surface);
}

.about-portrait::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 120deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  z-index: -1;
  filter: blur(1px);
  opacity: 0.9;
}

.about-portrait-badge {
  position: absolute;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}

.about-intro h1 {
  margin-top: 12px;
  font-size: clamp(2.4rem, 4.5vw, 3.5rem);
  font-weight: 820;
  letter-spacing: -0.045em;
}

.about-role {
  margin-top: 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.about-bio {
  max-width: 640px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.85;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.about-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 11.5px;
}

.about-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.about-meta .icon {
  width: 14px;
  height: 14px;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) 320px;
  gap: clamp(36px, 5vw, 64px);
  align-items: start;
}

.about-content {
  padding-top: 4px;
}

.about-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.stack-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stack-chip {
  padding: 5px 10px;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 550;
}

.about-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.about-facts > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-3);
  text-align: center;
}

.about-facts strong {
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.about-facts span {
  color: var(--muted);
  font-size: 10px;
}

/* Generic page */
.page-content-wrap {
  max-width: 900px;
}

.page-prose {
  padding-top: 4px;
}

/* ---------------------------------------------------------------
   19. 404
   --------------------------------------------------------------- */
.notfound {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: calc(var(--header-h) + 40px) 0 80px;
  overflow: hidden;
  isolation: isolate;
}

.notfound-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.notfound-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, var(--bg) 100%);
}

.notfound-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.notfound-code {
  font-size: clamp(6rem, 18vw, 12rem);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.07em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.92;
}

.notfound-code span {
  display: inline-block;
  animation: float 5s ease-in-out infinite;
}

.notfound-inner h1 {
  margin-top: 16px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.04em;
}

.notfound-inner > p {
  max-width: 480px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.notfound-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.notfound-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.notfound-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.notfound-links a .icon {
  width: 13px;
  height: 13px;
}

.notfound-links a:hover {
  color: var(--accent);
}

/* ---------------------------------------------------------------
   20. Search overlay
   --------------------------------------------------------------- */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 9vh 20px 32px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.search-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 18, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.search-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  min-height: 300px;
  max-height: 78vh;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(-14px) scale(0.985);
  transition: transform 0.32s var(--ease);
}

.search-modal.is-open .search-panel {
  transform: none;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.search-bar-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}

.search-bar-icon .icon {
  width: 19px;
  height: 19px;
}

.search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 500;
}

.search-input::placeholder {
  color: var(--muted-2);
  font-weight: 400;
}

.search-input::-webkit-search-cancel-button {
  display: none;
}

.search-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--muted);
  flex: none;
  transition: background-color 0.2s, color 0.2s;
}

.search-close:hover {
  background: var(--surface-3);
  color: var(--text);
}

.search-hint-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
}

.search-keys {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.search-keys span {
  margin-right: 8px;
}

.search-keys kbd {
  height: 18px;
  min-width: 18px;
  font-size: 9.5px;
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.search-result {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  transition: background-color 0.15s;
}

.search-result + .search-result {
  margin-top: 2px;
}

.search-result:hover,
.search-result.is-active {
  background: var(--accent-softer);
}

.search-result-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--muted);
  flex: none;
}

.search-result.is-active .search-result-icon,
.search-result:hover .search-result-icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.search-result-icon .icon {
  width: 17px;
  height: 17px;
}

.search-result-body {
  min-width: 0;
  flex: 1;
}

.search-result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
}

.search-result-title time {
  margin-left: auto;
  flex: none;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
}

.search-result-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 10px;
}

.search-result-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.search-result-meta .icon {
  width: 11px;
  height: 11px;
}

.search-result mark {
  padding: 0 1px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
}

.search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 44px 24px;
  text-align: center;
}

.search-panel.is-empty .search-results {
  display: none;
}

.search-panel.is-empty .search-empty {
  flex: 1;
}

.search-empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 6px;
  border-radius: 16px;
  background: var(--surface-3);
  color: var(--muted);
}

.search-empty-icon .icon {
  width: 22px;
  height: 22px;
}

.search-empty-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.search-empty-text {
  color: var(--muted);
  font-size: 12px;
}

.search-suggest {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.search-suggest-label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-suggest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.search-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 10.5px;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.search-tag span {
  color: var(--muted-2);
  font-size: 9px;
}

.search-tag:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  background: var(--accent-softer);
}

.search-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10px;
}

.search-brand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-weight: 600;
}

.search-brand .icon {
  width: 12px;
  height: 12px;
  color: var(--accent);
}

/* ---------------------------------------------------------------
   21. Toast & lightbox
   --------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 300;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  font-weight: 550;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.3s var(--ease);
  white-space: nowrap;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(5, 8, 15, 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-figure {
  max-width: min(1200px, 92vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.97);
  transition: transform 0.3s var(--ease);
}

.lightbox.is-open .lightbox-figure img {
  transform: scale(1);
}

.lightbox-figure figcaption {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: background-color 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ---------------------------------------------------------------
   22. Animations
   --------------------------------------------------------------- */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.86);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(36px, 26px, 0) scale(1.08);
  }
  100% {
    transform: translate3d(-24px, 44px, 0) scale(0.96);
  }
}

@keyframes nudge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

@keyframes scrollWheel {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  70% {
    opacity: 0;
    transform: translateY(7px);
  }
  100% {
    opacity: 0;
  }
}


/* Third-party player (APlayer / Meting) in dark mode */
[data-theme="dark"] .aplayer {
  background: var(--surface);
  color: var(--text-soft);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .aplayer .aplayer-info {
  border-color: var(--line) !important;
}

[data-theme="dark"] .aplayer .aplayer-info .aplayer-music .aplayer-title,
[data-theme="dark"] .aplayer .aplayer-info .aplayer-music .aplayer-author,
[data-theme="dark"] .aplayer .aplayer-time,
[data-theme="dark"] .aplayer .aplayer-time .aplayer-icon,
[data-theme="dark"] .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon path {
  color: var(--text-soft);
  fill: var(--text-soft);
}

[data-theme="dark"] .aplayer .aplayer-list ol li {
  border-color: var(--line);
  color: var(--text-soft);
}

[data-theme="dark"] .aplayer .aplayer-list ol li:hover {
  background: var(--surface-3);
}

[data-theme="dark"] .aplayer .aplayer-list ol li.aplayer-list-light {
  background: var(--accent-soft);
}


/* Encrypted post form */
#hexo-blog-encrypt .hbe-content {
  padding: 30px 0 20px;
}

#hexo-blog-encrypt .hbe-input {
  display: block;
  width: min(440px, 100%);
  margin: 0 auto;
}

#hexo-blog-encrypt .hbe-input-field-default {
  float: none;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 14px;
  text-align: center;
  opacity: 1;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

#hexo-blog-encrypt .hbe-input-field-default:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-softer);
  outline: none;
}

#hexo-blog-encrypt .hbe-input-field-default::placeholder {
  color: var(--muted);
}

#hexo-blog-encrypt .hbe-input-label {
  display: none;
}

/* Encrypted hint */
.encrypt-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 11.5px;
}

.encrypt-hint .icon {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

/* APlayer shell */
.prose .aplayer {
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.prose .aplayer .aplayer-list {
  border-top: 1px solid var(--line);
}

/* Player fallback */
.aplayer.is-unavailable {
  width: 100% !important;
  max-width: 560px;
  margin: 0 auto;
  background: transparent !important;
  box-shadow: none !important;
}

.player-fallback {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  text-align: left;
}

.player-fallback-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}

.player-fallback-icon .icon {
  width: 20px;
  height: 20px;
}

.player-fallback-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.player-fallback-copy strong {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
}

.player-fallback-copy span span {
  color: var(--muted);
  font-size: 11px;
}

.player-fallback > a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  flex: none;
}

.player-fallback > a .icon {
  width: 12px;
  height: 12px;
}

.player-fallback > a:hover {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
}


/* ---------------------------------------------------------------
   Extended Markdown: task lists, footnotes, definition lists,
   abbreviations, math and containers
   --------------------------------------------------------------- */
.prose .contains-task-list {
  padding-left: 0.4em;
  list-style: none;
}

.prose li.task-list-item {
  position: relative;
  padding-left: 1.55em;
  list-style: none;
}

.prose li.task-list-item > input[type="checkbox"] {
  position: absolute;
  left: 0;
  top: 0.48em;
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--accent);
}

.prose .task-list-item-checkbox {
  margin: 0;
  accent-color: var(--accent);
}

.prose .footnotes {
  margin-top: 3.4em;
  padding-top: 1.5em;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.8;
}

.prose .footnotes::before {
  content: "Footnotes";
  display: block;
  margin-bottom: 0.6em;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.prose .footnotes ol {
  padding-left: 1.4em;
}

.prose .footnotes li {
  margin: 0.5em 0;
}

.prose .footnote-ref a {
  padding: 0 2px;
  font-weight: 650;
  text-decoration: none;
}

.prose .footnote-backref {
  margin-left: 4px;
  text-decoration: none;
  opacity: 0.55;
}

.prose dl {
  margin: 1.5em 0;
}

.prose dt {
  margin-top: 1em;
  color: var(--text);
  font-weight: 650;
}

.prose dd {
  margin-left: 1.2em;
  color: var(--muted);
}

.prose abbr[title] {
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.prose ins {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
}

.prose mark {
  padding: 0.08em 0.28em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent-3) 20%, transparent);
  color: var(--text);
}

.prose .katex-display {
  margin: 1.5em 0;
  padding: 0.4em 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.prose .katex {
  font-size: 1.05em;
}

/* markdown-it-container blocks (::: note, ::: tip ...) */
.prose .note,
.prose .tip,
.prose .warning,
.prose .danger {
  margin: 1.6em 0;
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border-left: 3px solid var(--accent);
  background: var(--accent-softer);
}

.prose .tip {
  border-left-color: #10b981;
  background: color-mix(in srgb, #10b981 7%, transparent);
}

.prose .warning {
  border-left-color: #f59e0b;
  background: color-mix(in srgb, #f59e0b 8%, transparent);
}

.prose .danger {
  border-left-color: #ef4444;
  background: color-mix(in srgb, #ef4444 7%, transparent);
}

.prose .note > :first-child,
.prose .tip > :first-child,
.prose .warning > :first-child,
.prose .danger > :first-child {
  margin-top: 0;
}

.prose .note > :last-child,
.prose .tip > :last-child,
.prose .warning > :last-child,
.prose .danger > :last-child {
  margin-bottom: 0;
}

/* GFM alerts (> [!NOTE]) transformed by theme.js */
.prose .admonition {
  position: relative;
  margin: 1.6em 0;
  padding: 18px 20px 18px 22px;
  border: 1px solid color-mix(in srgb, var(--admonition-color) 22%, transparent);
  border-left: 3px solid var(--admonition-color);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: color-mix(in srgb, var(--admonition-color) 7%, transparent);
}

.prose .admonition p {
  margin: 0.55em 0;
}

.prose .admonition p:first-of-type {
  margin-top: 0;
}

.prose .admonition p:last-child {
  margin-bottom: 0;
}

.admonition-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--admonition-color);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admonition-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--admonition-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--admonition-color) 16%, transparent);
}

.prose .admonition--note {
  --admonition-color: #3b82f6;
}

.prose .admonition--tip {
  --admonition-color: #10b981;
}

.prose .admonition--important {
  --admonition-color: #8b5cf6;
}

.prose .admonition--warning {
  --admonition-color: #f59e0b;
}

.prose .admonition--caution {
  --admonition-color: #ef4444;
}


/* Hexo highlight.js token classes (markdown-it output) */
.prose figure.highlight .comment,
.prose figure.highlight .quote {
  color: #64748b;
  font-style: italic;
}

.prose figure.highlight .keyword,
.prose figure.highlight .selector-tag,
.prose figure.highlight .literal,
.prose figure.highlight .type {
  color: #c084fc;
}

.prose figure.highlight .string,
.prose figure.highlight .regexp,
.prose figure.highlight .addition,
.prose figure.highlight .attribute,
.prose figure.highlight .attr {
  color: #86efac;
}

.prose figure.highlight .number,
.prose figure.highlight .symbol,
.prose figure.highlight .bullet,
.prose figure.highlight .link {
  color: #fbbf24;
}

.prose figure.highlight .title,
.prose figure.highlight .section,
.prose figure.highlight .name,
.prose figure.highlight .selector-id,
.prose figure.highlight .selector-class {
  color: #7dd3fc;
}

.prose figure.highlight .variable,
.prose figure.highlight .template-variable,
.prose figure.highlight .params {
  color: #fca5a5;
}

.prose figure.highlight .built_in,
.prose figure.highlight .builtin-name,
.prose figure.highlight .meta,
.prose figure.highlight .tag {
  color: #67e8f9;
}

.prose figure.highlight .deletion {
  color: #f87171;
}

.prose figure.highlight .emphasis {
  font-style: italic;
}

.prose figure.highlight .strong {
  font-weight: 700;
}

.prose figure.highlight .doctag,
.prose figure.highlight .code {
  color: inherit;
}

/* Code block fullscreen viewer */
.code-expand,
.code-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  transition: background-color 0.2s, color 0.2s;
}

.code-expand:hover,
.code-copy:hover {
  background: rgba(148, 163, 184, 0.24);
  color: #fff;
}

.code-expand .icon,
.code-copy .icon {
  width: 14px;
  height: 14px;
}

.prose figure.highlight .code pre {
  white-space: pre;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.code-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 260;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.code-fullscreen.is-open {
  opacity: 1;
  visibility: visible;
}

.code-fullscreen-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 15, 0.82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.code-fullscreen-panel {
  position: absolute;
  inset: 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
  transform: translateY(12px) scale(0.99);
  transition: transform 0.3s var(--ease);
}

.code-fullscreen.is-open .code-fullscreen-panel {
  transform: none;
}

.code-fullscreen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: none;
  height: 54px;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.code-fullscreen-lang {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.code-fullscreen-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.code-fullscreen-actions .icon-btn {
  color: var(--text-soft);
}

.code-fullscreen-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--code-bg);
}

.code-fullscreen-body .prose {
  min-height: 100%;
  max-width: none;
}

.code-fullscreen-body .prose figure.highlight {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--code-bg);
}

.code-fullscreen-body .prose figure.highlight table {
  margin: 0;
  table-layout: fixed;
  width: 100%;
}

.code-fullscreen-body .prose figure.highlight .code {
  padding: 22px 24px;
}

.code-fullscreen-body .prose figure.highlight pre {
  max-width: 100%;
  max-height: none;
  overflow: auto;
  font-size: 0.9rem;
  line-height: 1.75;
}

@media (max-width: 640px) {
  .code-fullscreen-panel {
    inset: 0;
    border: 0;
    border-radius: 0;
  }

  .code-fullscreen-head {
    height: 52px;
    padding-top: env(safe-area-inset-top);
    height: calc(52px + env(safe-area-inset-top));
  }

  .code-fullscreen-body .prose figure.highlight .code {
    padding: 16px;
  }
}

.post-layout--single {
  grid-template-columns: minmax(0, 840px);
}


/* ------------------------------------------------------------------
   Music and video library pages
   ------------------------------------------------------------------ */
.media-intro {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin: 0 0 26px;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 58%),
    linear-gradient(135deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.media-intro::after {
  content: "";
  position: absolute;
  right: -55px;
  bottom: -100px;
  width: 230px;
  height: 230px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 50%;
  pointer-events: none;
}

.media-intro-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 54px;
  height: 54px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
}

.media-intro-mark .icon {
  width: 25px;
  height: 25px;
}

.media-intro-copy {
  min-width: 0;
  max-width: 62ch;
}

.media-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.media-intro-copy h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.media-intro-copy > p:not(.media-kicker) {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.media-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.media-meta span {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.035em;
}

.media-badge {
  position: absolute;
  white-space: nowrap;
  top: 18px;
  right: 18px;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.music-player .aplayer {
  margin: 0;
  border-radius: var(--radius-md);
}

.music-player .aplayer .aplayer-list {
  border-top-color: var(--line);
}

.music-player .aplayer .aplayer-list ol {
  max-height: 360px;
  scrollbar-width: thin;
}

.music-player .aplayer .aplayer-list ol li {
  min-height: 42px;
  padding-block: 10px;
}

.music-player .aplayer .aplayer-list ol li .aplayer-list-index {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.music-player .aplayer .aplayer-list ol li .aplayer-list-title {
  font-weight: 600;
}

.music-player .aplayer .aplayer-list ol li .aplayer-list-author {
  color: var(--muted);
  font-size: 11px;
}

.media-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.media-note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.video-section {
  margin-top: 28px;
}

.video-section + .video-section {
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.video-section-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.video-section-index {
  padding-top: 3px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.video-section-head h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.025em;
}

.video-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.video-count {
  padding-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  white-space: nowrap;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.video-card {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.video-card:hover {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  box-shadow: var(--shadow-sm);
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-3);
}

.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.video-card figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.video-tag {
  flex: none;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .media-intro {
    gap: 13px;
    padding: 18px;
  }

  .media-intro-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .media-intro-mark .icon {
    width: 21px;
    height: 21px;
  }

  .media-badge {
    position: static;
    align-self: flex-start;
    margin-left: auto;
    font-size: 9px;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .video-section-head {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .video-count {
    grid-column: 2;
  }
}
