/* Blowfish-inspired Modern CSS */
* { box-sizing: border-box; }
:root {
  /* Light theme */
  --bg: #fdfdfd;
  --bg-secondary: #f3f4f6;
  --card: #ffffff;
  --card-hover: #ffffff;
  --text: #171717; /* neutral-900 */
  --text-muted: #525252; /* neutral-600 */
  --subtle: #737373; /* neutral-500 */
  --line: #e5e5e5; /* neutral-200 */
  --brand: #2563eb; /* blue-600 */
  --brand-hover: #1d4ed8; /* blue-700 */
  --brand-light: #dbeafe; /* blue-100 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 0.75rem; /* 12px */
  --radius-lg: 1rem; /* 16px */
  --container-pad-x: max(20px, env(safe-area-inset-left, 0px));
  --container-pad-r: max(20px, env(safe-area-inset-right, 0px));
  --container-max: 1200px;
}

html[data-theme="dark"] {
  --bg: #171717; /* neutral-900 */
  --bg-secondary: #262626; /* neutral-800 */
  --card: #262626; /* neutral-800 */
  --card-hover: #2e2e2e; /* slightly lighter than card */
  --text: #f5f5f5; /* neutral-50 */
  --text-muted: #a3a3a3; /* neutral-400 */
  --subtle: #737373; /* neutral-500 */
  --line: #404040; /* neutral-700 */
  --brand: #3b82f6; /* blue-500 */
  --brand-hover: #60a5fa; /* blue-400 */
  --brand-light: rgba(59, 130, 246, 0.2);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a { color: var(--brand); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--brand-hover); text-decoration: underline; text-underline-offset: 4px; }

.container {
  width: min(var(--container-max), 100%);
  max-width: 100%;
  padding-left: var(--container-pad-x);
  padding-right: var(--container-pad-r);
  margin: 0 auto;
}

.main-content {
  padding-top: 2rem;
  padding-bottom: max(3rem, env(safe-area-inset-bottom, 0px));
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(253, 253, 253, 0.85);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
html[data-theme="dark"] .site-header { background: rgba(23, 23, 23, 0.85); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  position: relative;
}

.brand {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none !important;
  letter-spacing: -0.025em;
  flex: 1;
}

.main-nav { margin-left: auto; }
.main-nav > ul {
  display: flex;
  list-style: none;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.main-nav a {
  display: block;
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.2s, color 0.2s;
}

.main-nav a:hover, .main-nav a.is-active {
  color: var(--text);
  background: var(--bg-secondary);
}

.main-nav__summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.main-nav__summary:hover {
  color: var(--text);
  background: var(--bg-secondary);
}

.main-nav__caret {
  width: 6px; height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.main-nav__group[open] > .main-nav__summary .main-nav__caret {
  transform: rotate(225deg);
}

.main-nav__sublist {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 200px;
  padding: 8px;
  margin-top: 8px;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 35;
}

.main-nav__sublist a {
  padding: 8px 12px;
  border-radius: 6px;
}

/* Mobile Nav (Checkbox driven) */
.nav-state { display: none; }
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 32px; height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 40;
}
.nav-burger__bar {
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s linear;
  margin: 0 auto;
}

@media (max-width: 880px) {
  .nav-burger { display: flex; }
  .brand { padding-right: 8px; }
  .main-nav {
    position: fixed;
    top: 65px;
    left: 0; right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    transform: translateY(-150%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 32;
  }
  .main-nav > ul { flex-direction: column; gap: 4px; }
  .main-nav a { padding: 12px 16px; }
  .main-nav__sublist {
    position: static;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 0 16px;
    margin-top: 0;
  }
  #nav-open:checked ~ .main-nav {
    transform: translateY(0);
    opacity: 1;
  }
  #nav-open:checked ~ .nav-burger .nav-burger__bar:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  #nav-open:checked ~ .nav-burger .nav-burger__bar:nth-child(2) { opacity: 0; }
  #nav-open:checked ~ .nav-burger .nav-burger__bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
}

/* Hero Section */
.hero {
  margin: 2rem 0;
  padding: 3rem 1rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
  color: var(--text);
}
.hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}
.hero--compact { margin: 1rem 0; padding: 1.5rem 1rem; text-align: left; }
.hero--compact h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 0.5rem; }
.hero--compact p { margin: 0; }

/* Cards & Layout */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
  box-shadow: var(--shadow-sm);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  background: var(--card-hover);
}

.card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-secondary);
  overflow: hidden;
}
.card-cover {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.card:hover .card-cover { transform: scale(1.05); }

.card__body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}
.card h3 a { color: var(--text); text-decoration: none !important; }
.card h3 a:hover { color: var(--brand); }

.meta {
  font-size: 0.875rem;
  color: var(--subtle);
  margin-bottom: 1rem;
}
.desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag-list {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto;
}
.tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--brand-light);
  color: var(--brand);
  text-decoration: none !important;
  transition: opacity 0.2s;
}
.tag:hover { opacity: 0.8; }

/* Panels / Sidebar */
.sidebar { display: grid; gap: 1.5rem; align-content: start; }
.sidebar--home { position: sticky; top: 88px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.panel h3 {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
}
.panel ul { list-style: none; margin: 0; padding: 0; }
.panel li { padding: 0.5rem 0; border-bottom: 1px dashed var(--line); font-size: 0.95rem; }
.panel li:last-child { border-bottom: none; }
.panel a { color: var(--text-muted); text-decoration: none !important; }
.panel a:hover { color: var(--brand); }

.contact-qr { margin-top: 1rem; text-align: center; }
.contact-qr img { width: 200px; max-width: 200px; border-radius: var(--radius); border: 1px solid var(--line); }
.contact-tip { font-size: 0.85rem; color: var(--subtle); margin-top: 0.5rem; text-align: center; }

/* Article Page */
.article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

/* Article Header Layout */
.article-header {
  display: grid;
  gap: clamp(1.25rem, 2vw, 2rem);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.article-hero {
  position: relative;
}

.article-hero-cover {
  position: relative;
  margin: 0;
  border-radius: calc(var(--radius-lg) + 0.3rem);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--line));
  background:
    linear-gradient(180deg, transparent 55%, rgba(15, 23, 42, 0.18)),
    color-mix(in srgb, var(--brand-light) 42%, var(--card));
  box-shadow: var(--shadow);
}

.article-hero-cover::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.16));
  pointer-events: none;
}

.article-header-content {
  max-width: 760px;
}

.article-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.85rem;
  color: var(--subtle);
  font-size: 0.92rem;
}

.article-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.article-breadcrumb a:hover {
  color: var(--brand);
  text-decoration: none;
}

.article-breadcrumb__sep {
  opacity: 0.6;
}

.article-breadcrumb__current {
  color: var(--text);
  font-weight: 700;
}

.article-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.article-description {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.article-page-meta {
  font-size: 0.95rem;
  color: var(--subtle);
  margin-bottom: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.article-page-meta .meta-left,
.article-page-meta .meta-right {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
}

.article-page-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.article-page-meta .meta-item--link {
  color: inherit;
  text-decoration: none;
}

.article-page-meta .meta-item--link:hover {
  color: var(--brand);
  text-decoration: none;
}

.article-page-meta .meta-item svg {
  color: var(--subtle);
  opacity: 0.8;
}

.article h1, .article h2, .article h3 {
  color: var(--text);
  font-weight: 800;
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}
.article h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-top: 0; }
.article h2 { font-size: 1.75rem; border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; }
.article h3 { font-size: 1.5rem; }
.article-content p { margin-bottom: 1.25rem; font-size: 1.05rem; line-height: 1.75; color: var(--text-muted); }
.article-content img {
  max-width: 100%; height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin: 1.5rem auto;
  display: block;
}
.article-content img[alt*="二维码"] {
  width: min(100%, 300px);
  max-width: 300px;
}
.article-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--brand);
  background: var(--bg-secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-style: italic;
}
.article-content ul, .article-content ol { margin-bottom: 1.5rem; padding-left: 1.5rem; color: var(--text-muted); font-size: 1.05rem; }
.article-content li { margin-bottom: 0.5rem; }
.article-content code {
  background: var(--bg-secondary);
  color: var(--brand);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.article-content pre {
  background: var(--bg-secondary);
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  border: 1px solid var(--line);
}
.article-content pre code { background: none; color: inherit; padding: 0; }

.post-cover-wrap { margin-bottom: 2rem; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); }
.post-cover {
  display: block;
  width: 100%;
  min-height: clamp(280px, 42vw, 520px);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-content > :first-child {
  margin-top: 0;
}

@media (min-width: 768px) {
  .article-header.has-cover {
    gap: clamp(1.5rem, 2.4vw, 2.4rem);
  }

  .article-hero-cover {
    border-radius: calc(var(--radius-lg) + 0.45rem);
  }

  .article-header.has-cover .post-cover {
    min-height: clamp(340px, 34vw, 520px);
  }
}

.article .pan-share-card,
.article .attachment-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand-light) 28%, transparent), transparent 58%),
    var(--card);
  box-shadow: var(--shadow-sm);
}

.article .pan-share-card {
  position: relative;
  gap: 0.75rem;
  padding: 1.05rem 1.1rem 1.1rem;
  border-color: color-mix(in srgb, var(--brand) 18%, var(--line));
  background:
    radial-gradient(circle at right top, color-mix(in srgb, var(--brand-light) 82%, transparent), transparent 42%),
    linear-gradient(135deg, color-mix(in srgb, var(--brand-soft) 72%, transparent), transparent 56%),
    var(--card);
  overflow: hidden;
}

.article .pan-share-card::after {
  content: "";
  position: absolute;
  inset: auto -52px -52px auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand-light) 90%, transparent), transparent 68%);
  opacity: 0.75;
  pointer-events: none;
}

.article .attachment-cards {
  display: grid;
  gap: 0.7rem;
  margin: 1rem 0;
}

.pan-share-card__head {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.42rem;
  align-items: start;
}

.attachment-card__head {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.35rem 0.55rem;
  min-width: 0;
  overflow: hidden;
}

.pan-share-card__eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.article .pan-share-card h3,
.article .attachment-card strong,
.article .attachment-card h3,
.article .attachment-card p,
.article .pan-share-card p {
  margin-top: 0;
}

.pan-share-card__badge,
.attachment-card__type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: fit-content;
  margin-bottom: 0;
  padding: 0.18rem 0.52rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pan-share-card__title {
  margin: 0;
  max-width: 46rem;
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  font-weight: 800;
  line-height: 1.4;
  color: var(--text);
}

.pan-share-card__meta {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.55;
  max-width: 52rem;
}

.pan-share-card__meta::before {
  content: "分享说明";
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.06rem;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-secondary) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 92%, transparent);
  color: var(--subtle);
  font-size: 0.69rem;
  font-weight: 700;
}

.pan-share-card__actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  margin-top: 0;
  overflow: visible;
}

.attachment-card__actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  margin-top: 0.45rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.pan-share-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0.46rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none !important;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.attachment-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none !important;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.pan-share-card__btn:hover,
.attachment-card__btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.pan-share-card__btn--primary,
.attachment-card__btn--primary {
  background: var(--brand);
  color: #fff;
}

.pan-share-card__btn--primary {
  box-shadow: 0 12px 28px -18px color-mix(in srgb, var(--brand) 72%, transparent);
}

.pan-share-card__btn--primary:hover,
.attachment-card__btn--primary:hover {
  background: var(--brand-hover);
  color: #fff;
}

.pan-share-card__btn--ghost,
.attachment-card__btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.pan-share-card__btn--ghost:hover,
.attachment-card__btn--ghost:hover {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 24%, var(--line));
}

.pan-share-card__code {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0.42rem 0.78rem;
  border-radius: calc(var(--radius) + 0.2rem);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.pan-share-card__code-label {
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 700;
}

.pan-share-card__code-value {
  color: var(--text);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.attachment-card__type {
  margin-bottom: 0;
  flex: 0 0 auto;
}

.attachment-card__name {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.88rem;
  line-height: 1.3;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article img.is-lightboxable {
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.article img.is-lightboxable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
}

body.lightbox-open {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(2, 6, 23, 0.78);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.image-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.image-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.image-lightbox__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(92vw, 1200px);
  max-height: calc(100vh - 8rem);
}

.image-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 10rem);
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.image-lightbox__caption {
  width: min(92vw, 900px);
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Article Sidebar */
.article-toc nav ul { list-style: none; padding: 0; margin: 0; }
.article-toc nav ul ul { padding-left: 1rem; margin-top: 0.5rem; }
.article-toc li { margin-bottom: 0.5rem; font-size: 0.9rem; }
.article-toc a { color: var(--text-muted); text-decoration: none !important; transition: color 0.2s; }
.article-toc a:hover, .article-toc a.is-active { color: var(--brand); font-weight: 600; }
.article-toc-extra {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  border-top: 1px dashed var(--line);
  padding-top: 0.75rem;
}

.article-page-facts { list-style: none; padding: 0; margin: 0; }
.article-page-facts li { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px dashed var(--line); font-size: 0.9rem; }
.article-page-facts li:last-child { border-bottom: none; }
.article-page-facts span { color: var(--subtle); }
.article-page-facts strong { color: var(--text); font-weight: 600; }

:where(.about-article, .archive-main, .article-page-main) [id] {
  scroll-margin-top: 110px;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 0.9rem;
}

/* Floating Contact */
.site-floaters {
  pointer-events: none;
}

.site-floaters > * {
  pointer-events: auto;
}

.floating-theme-toggle {
  position: fixed;
  left: max(2rem, calc(env(safe-area-inset-left, 0px) + 1rem));
  bottom: max(2rem, calc(env(safe-area-inset-bottom, 0px) + 1rem));
  z-index: 40;
}

.floating-theme-toggle,
.floating-contact__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-radius: 9999px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.floating-theme-toggle {
  display: inline-grid;
  place-items: center;
}

.floating-theme-toggle:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  background: color-mix(in srgb, var(--brand-soft) 72%, var(--card));
}

.floating-theme-toggle__icon {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  color: var(--text);
  opacity: 0;
  transform: scale(0.72) rotate(-18deg);
  transition: opacity 0.22s ease, transform 0.22s ease, color 0.22s ease;
}

.floating-theme-toggle__icon svg {
  width: 100%;
  height: 100%;
}

.floating-theme-toggle[data-theme-current="light"] .floating-theme-toggle__icon--moon,
.floating-theme-toggle[data-theme-current="dark"] .floating-theme-toggle__icon--sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

html[data-theme="dark"] .floating-theme-toggle {
  color: #f8fafc;
}

.floating-contact {
  position: fixed;
  right: max(2rem, calc(env(safe-area-inset-right, 0px) + 1rem));
  bottom: max(2rem, calc(env(safe-area-inset-bottom, 0px) + 1rem));
  z-index: 40;
}
.floating-contact__trigger {
  margin: 0;
  font-size: 0;
  line-height: 0;
  list-style: none;
  appearance: none;
  -webkit-appearance: none;
}
.floating-contact__trigger::-webkit-details-marker { display: none; }
.floating-contact__trigger::marker { content: ""; }
.floating-contact__trigger:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  background: color-mix(in srgb, var(--brand-soft) 72%, var(--card));
}
.floating-contact__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 1.35rem;
}
.floating-contact__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
.floating-contact[open] .floating-contact__trigger {
  color: #fff;
  border-color: color-mix(in srgb, var(--brand) 58%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 92%, white), var(--brand-hover));
}
.floating-contact__panel {
  position: absolute;
  right: 0; bottom: calc(100% + 1rem);
  width: 280px;
  background: color-mix(in srgb, var(--card) 96%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.floating-contact__panel h3 { margin: 0 0 0.5rem; font-size: 1.1rem; color: var(--text); }
.floating-contact__panel p { font-size: 0.85rem; color: var(--subtle); margin-bottom: 1rem; }
.contact-action {
  display: block; text-align: center; padding: 0.5rem; margin-bottom: 0.5rem;
  border-radius: var(--radius); background: var(--bg-secondary); color: var(--text);
  font-weight: 600; font-size: 0.9rem;
}
.contact-action:hover { text-decoration: none; background: var(--line); }

/* Taxonomies Grid */
.terms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.term-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
  text-decoration: none !important;
}
.term-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.term-tile__name { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.term-tile__meta { font-size: 0.85rem; color: var(--subtle); }

/* Archives Timeline */
.archive-timeline {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
}
.archive-year-block {
  margin-bottom: 3rem;
  position: relative;
}
.archive-year {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--line);
  position: relative;
}
.archive-list {
  list-style: none;
  padding-left: 1.5rem;
  margin: 0;
  border-left: 2px solid var(--line);
}
.archive-item {
  position: relative;
  padding-bottom: 1.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.archive-item::before {
  content: "";
  position: absolute;
  left: -1.5rem;
  top: 0.6rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
  transform: translateX(-5px);
  box-shadow: 0 0 0 4px var(--bg);
  transition: transform 0.2s, background 0.2s;
}
.archive-item:hover::before {
  transform: translateX(-5px) scale(1.2);
  background: var(--brand);
}
.archive-item:last-child {
  padding-bottom: 0;
}
.archive-date {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-family: monospace;
  min-width: 60px;
}
.archive-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  flex: 1;
  transition: color 0.2s;
}
.archive-title:hover {
  color: var(--brand);
}
.archive-cat {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--subtle);
  white-space: nowrap;
}
.archive-empty {
  text-align: center;
  color: var(--subtle);
  padding: 3rem 0;
  font-size: 1.1rem;
}

/* Layout polish overrides */
:root {
  --bg: #f8fafc;
  --bg-secondary: #eef2ff;
  --card: rgba(255, 255, 255, 0.92);
  --card-hover: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --subtle: #64748b;
  --line: rgba(148, 163, 184, 0.28);
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-light: rgba(37, 99, 235, 0.12);
  --brand-soft: rgba(37, 99, 235, 0.08);
  --shadow-sm: 0 10px 24px -18px rgba(15, 23, 42, 0.24);
  --shadow: 0 20px 48px -28px rgba(15, 23, 42, 0.28);
  --shadow-lg: 0 32px 72px -36px rgba(15, 23, 42, 0.36);
  --radius: 0.875rem;
  --radius-lg: 1.25rem;
  --container-max: 1240px;
}

html[data-theme="dark"] {
  --bg: #020617;
  --bg-secondary: rgba(30, 41, 59, 0.72);
  --card: rgba(15, 23, 42, 0.84);
  --card-hover: rgba(15, 23, 42, 0.96);
  --text: #e2e8f0;
  --text-muted: #cbd5e1;
  --subtle: #94a3b8;
  --line: rgba(148, 163, 184, 0.2);
  --brand: #60a5fa;
  --brand-hover: #93c5fd;
  --brand-light: rgba(96, 165, 250, 0.18);
  --brand-soft: rgba(96, 165, 250, 0.12);
  --shadow-sm: 0 14px 28px -22px rgba(2, 6, 23, 0.9);
  --shadow: 0 28px 56px -34px rgba(2, 6, 23, 0.95);
  --shadow-lg: 0 36px 96px -40px rgba(2, 6, 23, 0.98);
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at top, rgba(37, 99, 235, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 250, 252, 0.96)),
    var(--bg);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top, rgba(96, 165, 250, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 1)),
    var(--bg);
}

a {
  text-decoration-thickness: 0.08em;
}

.site-main {
  min-height: calc(100vh - 160px);
}

.main-content {
  padding-top: clamp(0.95rem, 1.6vw, 1.4rem);
  padding-bottom: max(3.2rem, env(safe-area-inset-bottom, 0px));
}

.site-header {
  background: color-mix(in srgb, var(--card) 86%, transparent);
  border-bottom-color: var(--line);
}

.header-inner {
  min-height: 64px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.brand__title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.brand__subtitle {
  font-size: 0.76rem;
  color: var(--subtle);
  font-weight: 500;
}

.nav-scrim {
  display: none;
}

.main-nav > ul {
  gap: 8px;
}

.main-nav__item,
.main-nav__item--has-children {
  position: relative;
}

.main-nav a,
.main-nav__summary {
  padding: 8px 12px;
  border-radius: 999px;
}

.main-nav a:hover,
.main-nav a.is-active,
.main-nav__summary:hover,
.main-nav__group.is-active > .main-nav__summary {
  background: var(--brand-soft);
  color: var(--brand);
}

.main-nav__sublist {
  right: auto;
  left: 0;
  margin-top: 8px;
  min-width: 208px;
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.site-footer {
  margin-top: 0;
  padding: 2rem 0 2.35rem;
  border-top-color: var(--line);
}

.site-footer__inner {
  display: grid;
  gap: 0.4rem;
  text-align: center;
}

.site-footer__inner p {
  margin: 0;
}

.site-footer__contact a,
.site-footer__contact span {
  font-weight: 600;
}

.hero {
  position: relative;
  overflow: hidden;
  margin: 0.75rem 0 1rem;
  padding: clamp(1.15rem, 2.4vw, 1.9rem);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-lg) + 0.25rem);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--card) 92%, transparent), color-mix(in srgb, var(--bg-secondary) 72%, transparent)),
    var(--card);
  box-shadow: var(--shadow-sm);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -42% auto;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--brand-light), transparent 68%);
  pointer-events: none;
}

.hero--compact {
  text-align: left;
  margin-top: 0;
  padding: clamp(1.05rem, 2.1vw, 1.65rem);
}

.hero h1,
.hero--compact h1 {
  position: relative;
  z-index: 1;
  margin-bottom: 0.55rem;
}

.hero p,
.hero--compact p {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero__eyebrow,
.section-intro__eyebrow,
.article-eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand);
}

.hero__actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.hero__stats {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.hero-stat,
.article-list-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 78%, transparent);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.58rem 0.95rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none !important;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.button--primary {
  background: var(--brand);
  color: #fff;
}

.button--primary:hover {
  background: var(--brand-hover);
  color: #fff;
}

.button--secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.button--secondary:hover {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 32%, var(--line));
}

.layout {
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 320px);
  gap: clamp(0.95rem, 1.4vw, 1.35rem);
}

.layout > * {
  min-width: 0;
}

.article-page-layout {
  grid-template-columns: minmax(0, 1.8fr) minmax(248px, 300px);
}

.cards {
  gap: 1rem;
}

.cards--dense-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.card {
  border-radius: calc(var(--radius-lg) + 0.1rem);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}

.card > h3,
.card > .meta,
.card > .desc,
.card > .tag-list,
.card > p {
  padding-left: 1rem;
  padding-right: 1rem;
}

.card > h3 {
  margin-top: 0.85rem;
}

.card > .meta {
  margin-bottom: 0.65rem;
}

.card > .desc {
  margin-top: 0;
  margin-bottom: 0.8rem;
  line-height: 1.55;
}

.card > .tag-list,
.card > p:last-child {
  padding-bottom: 1rem;
}

.card__media {
  border-bottom: 1px solid var(--line);
}

.card__media--placeholder {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand-light) 64%, transparent), transparent),
    color-mix(in srgb, var(--bg-secondary) 70%, transparent);
}

.card__media-label {
  display: inline-flex;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.card--article-featured {
  margin-bottom: 1rem;
}

.card--empty {
  min-height: 180px;
  justify-content: center;
}

.section-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.section-intro h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
}

.section-intro p {
  max-width: 560px;
  margin: 0;
  color: var(--text-muted);
}

.article-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 1rem;
}

.sidebar {
  gap: 0.85rem;
}

.panel {
  padding: 1.15rem 1.2rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.panel h3 {
  margin: 0 0 0.85rem 0;
  padding-bottom: 0.6rem;
  font-size: 1rem;
}

.panel__text {
  margin: 0;
  color: var(--text-muted);
}

.panel__eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand);
}

.panel + .panel {
  margin-top: 0;
}

.panel-categories {
  display: grid;
  gap: 0.45rem;
}

.panel li {
  padding: 0;
  border-bottom: none;
}

.category-item,
.article-list-links a,
.about-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-secondary) 56%, transparent);
  border: 1px solid transparent;
  color: var(--text-muted);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.category-item:hover,
.article-list-links a:hover,
.about-nav__link:hover {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 24%, var(--line));
  text-decoration: none;
  transform: translateY(-1px);
}

.category-name {
  font-weight: 600;
}

.category-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  color: var(--subtle);
  font-size: 0.78rem;
}

.article-list-links {
  display: grid;
  gap: 0.45rem;
}

.article-list-links li {
  padding: 0;
}

.contact-qr img {
  width: 200px;
  max-width: 200px;
  border-radius: calc(var(--radius) + 0.1rem);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.floating-contact__qr {
  margin: 0.9rem 0 0;
  text-align: center;
}

.floating-contact__qr img {
  display: block;
  width: 200px;
  max-width: 200px;
  margin: 0 auto;
  border-radius: calc(var(--radius) + 0.1rem);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.floating-contact__panel {
  width: min(280px, calc(100vw - 2rem));
  padding: 1.15rem;
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.floating-contact__trigger {
  padding: 0.65rem 1.2rem;
}

.contact-action {
  border: 1px solid transparent;
}

.contact-action:hover {
  border-color: color-mix(in srgb, var(--brand) 24%, var(--line));
  background: var(--brand-soft);
}

.contact-action--subtle {
  font-weight: 600;
  color: var(--text-muted);
}

.taxonomy-hero__inner {
  position: relative;
  z-index: 1;
}

.taxonomy-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
  color: var(--subtle);
  font-size: 0.92rem;
}

.taxonomy-breadcrumb__sep {
  opacity: 0.75;
}

.taxonomy-breadcrumb__current {
  color: var(--text);
  font-weight: 700;
}

.taxonomy-hero__title {
  margin: 0;
}

.taxonomy-hero__desc {
  margin-top: 0.55rem;
}

.terms-page {
  display: grid;
  gap: 0.85rem;
}

.terms-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.85rem;
}

.term-tile {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--card);
}

.term-tile__arrow {
  margin-top: 0.35rem;
  color: var(--brand);
  font-weight: 700;
}

.terms-empty {
  grid-column: 1 / -1;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--subtle);
}

.article-page-main {
  padding: clamp(1.15rem, 2.4vw, 2rem);
}

.article-header {
  gap: clamp(1rem, 1.6vw, 1.4rem);
  margin-bottom: 1.5rem;
}

.article-eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  background: color-mix(in srgb, var(--brand-soft) 78%, transparent);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 0.4rem;
}

.article-description {
  margin-bottom: 0.9rem;
}

.article-page-meta {
  padding-top: 0.8rem;
  margin-bottom: 0.8rem;
  gap: 0.75rem;
}

.article-tag-list {
  margin-top: 0.2rem;
}

.article-page-sidebar {
  gap: 0.75rem;
}

.article-page-panel {
  border-radius: calc(var(--radius-lg) - 0.05rem);
  box-shadow: var(--shadow-sm);
}

.article-page-sidebar .panel {
  overflow: hidden;
}

.article-page-facts li {
  align-items: baseline;
  gap: 0.85rem;
  padding: 0.4rem 0;
}

.article-comments-panel {
  margin-top: 1.5rem;
  scroll-margin-top: 110px;
}

.article-breadcrumb {
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  font-size: 0.88rem;
}

.article-page-meta .meta-left,
.article-page-meta .meta-right {
  gap: 1rem;
}

.article-content p {
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.7;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.2rem;
  padding-left: 1.35rem;
  font-size: 1rem;
}

.article-content li {
  margin-bottom: 0.4rem;
}

.article h1,
.article h2,
.article h3 {
  margin-top: 1.6rem;
  margin-bottom: 0.8rem;
}

.article h2 {
  padding-bottom: 0.4rem;
}

.article-content img {
  margin: 1.2rem auto;
}

.article-content blockquote {
  margin: 1.2rem 0;
  padding: 0.85rem 1.15rem;
}

.article-content pre {
  padding: 1rem;
}

@media (max-width: 767px) {
  .article-page-main {
    padding: 1.15rem;
  }

  .article-header {
    margin-bottom: 2rem;
  }

  .article-hero-cover {
    border-radius: calc(var(--radius-lg) - 0.05rem);
  }

  .post-cover {
    min-height: clamp(220px, 58vw, 320px);
  }

  .article-page-meta {
    gap: 0.85rem;
  }

  .article-breadcrumb {
    margin-bottom: 0.7rem;
    font-size: 0.86rem;
  }
}

.article-comments-panel #artalk-comments {
  min-height: 120px;
}

.archive-layout,
.about-layout,
.taxonomy-term-layout {
  align-items: start;
}

.archive-main,
.section-list-main,
.home-main {
  min-width: 0;
}

.archive-timeline {
  max-width: none;
  margin: 0;
  padding: 0;
}

.archive-intro,
.about-article {
  padding: clamp(1.05rem, 2vw, 1.45rem);
}

.archive-intro {
  margin-bottom: 0.9rem;
}

.archive-year-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.archive-year {
  margin: 0;
  padding: 0;
  border-bottom: none;
}

.archive-year-count {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
}

.archive-list {
  padding-left: 1rem;
}

.archive-item {
  background: transparent;
  gap: 0.75rem;
  padding-bottom: 1rem;
}

.archive-item::before {
  left: -1rem;
  top: 0.45rem;
  width: 8px;
  height: 8px;
  transform: translateX(-4px);
  box-shadow: 0 0 0 3px var(--bg);
}

.archive-cat {
  padding: 0.16rem 0.5rem;
  font-size: 0.72rem;
  background: color-mix(in srgb, var(--card) 84%, transparent);
}

.about-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.about-nav__link {
  justify-content: center;
  min-width: 108px;
}

.about-article h2:first-child {
  margin-top: 0;
}

@media (min-width: 1040px) {
  .sidebar--home,
  .article-page-sidebar,
  .archive-sidebar,
  .about-sidebar,
  .article-list-sidebar,
  .taxonomy-term-sidebar {
    position: sticky;
    top: 84px;
  }

  .article-page-sidebar {
    padding-top: clamp(0.7rem, 1.2vw, 1rem);
  }
}

@media (max-width: 1039px) {
  .layout,
  .article-page-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 880px) {
  .brand__subtitle {
    display: none;
  }

  .nav-scrim {
    position: fixed;
    inset: 64px 0 0;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .main-nav {
    top: 64px;
    left: 10px;
    right: 10px;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius-lg) + 0.1rem);
    background: var(--card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .main-nav > ul {
    gap: 0.4rem;
  }

  .main-nav a,
  .main-nav__summary {
    border-radius: var(--radius);
  }

  #nav-open:checked ~ .nav-scrim {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 860px) {
  .hero__actions,
  .hero__stats,
  .section-intro,
  .article-page-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-page-meta .meta-left,
  .article-page-meta .meta-right {
    gap: 0.65rem;
  }
}

@media (max-width: 640px) {
  .main-content {
    padding-top: 0.85rem;
  }

  .hero,
  .hero--compact,
  .article,
  .panel,
  .floating-contact__panel {
    padding: 0.9rem;
  }

  .floating-contact {
    right: max(1rem, calc(env(safe-area-inset-right, 0px) + 0.75rem));
    bottom: max(1rem, calc(env(safe-area-inset-bottom, 0px) + 0.75rem));
  }

  .floating-theme-toggle {
    left: max(1rem, calc(env(safe-area-inset-left, 0px) + 0.75rem));
    bottom: max(1rem, calc(env(safe-area-inset-bottom, 0px) + 0.75rem));
    width: 3rem;
    height: 3rem;
  }

  .floating-contact__trigger {
    width: 3rem;
    height: 3rem;
  }

  .card > h3,
  .card > .meta,
  .card > .desc,
  .card > .tag-list,
  .card > p {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .article-page-meta {
    gap: 0.65rem;
  }

  .article-breadcrumb {
    margin-bottom: 0.55rem;
  }

  .pan-share-card__actions,
  .attachment-card__actions {
    gap: 0.45rem;
  }

  .image-lightbox {
    padding: 1rem;
  }

  .image-lightbox__stage,
  .image-lightbox__caption {
    width: 100%;
  }
}
