/* 红脸 · 技术志 — 大气排版 + 明快暗色（天青 / 琥珀 / 淡紫点缀） */

:root {
  --bg-deep: #111827;
  --bg-surface: #1a2234;
  --bg-elevated: #243047;
  --border: rgba(148, 163, 184, 0.14);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-muted: #a5f3fc;
  --accent-violet: #c4b5fd;
  --accent-secondary: #fbbf24;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --accent-violet-soft: rgba(196, 181, 253, 0.12);
  --accent-warm-soft: rgba(251, 191, 36, 0.12);
  --accent-glow: rgba(56, 189, 248, 0.42);
  --accent-ring: rgba(56, 189, 248, 0.38);
  --tag-fg: #cffafe;
  --font-sans: "DM Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
  --radius: 12px;
  --shadow: 0 20px 56px rgba(15, 23, 42, 0.55);
  --content-width: 72rem;
  --prose-width: 42rem;
  --article-wide-max: 56rem;
  --page-pad-y: 2.5rem;
  --page-pad-y-bottom: 4rem;
  /* 全站水平留白：窄屏用 vw 拉出可见边距，大屏封顶避免过空 */
  --pad-inline: clamp(1.35rem, 5vw, 2.25rem);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 95% 65% at 50% -22%, rgba(56, 189, 248, 0.2), transparent 54%),
    radial-gradient(ellipse 52% 48% at 108% 0%, var(--accent-violet-soft), transparent 50%),
    radial-gradient(ellipse 42% 38% at -8% 92%, var(--accent-warm-soft), transparent 48%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  touch-action: manipulation;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

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

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* —— 布局 —— */
.wrap {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-left: max(var(--pad-inline), env(safe-area-inset-left, 0px));
  padding-right: max(var(--pad-inline), env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.78);
  backdrop-filter: blur(16px);
  padding-top: env(safe-area-inset-top, 0px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.75rem 0;
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-left: max(var(--pad-inline), env(safe-area-inset-left, 0px));
  padding-right: max(var(--pad-inline), env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

.logo-mark {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  display: block;
}

.logo-mark--footer {
  width: 1.75rem;
  height: 1.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--text);
  min-width: 0;
  flex-shrink: 1;
  -webkit-tap-highlight-color: transparent;
}

.brand__text {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
}

.brand__name {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand__tag {
  font-weight: 600;
  font-size: 0.65rem;
  color: var(--accent-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-main a {
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav-main a:hover {
  color: var(--accent-hover);
}

.nav-main a[aria-current="page"] {
  color: var(--text);
  text-shadow: 0 0 24px var(--accent-soft);
}

/* 移动端菜单 */
.menu-toggle {
  display: none;
  padding: 0.5rem 0.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font-size: 0.875rem;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-main {
    position: fixed;
    z-index: 200;
    left: max(var(--pad-inline), env(safe-area-inset-left, 0px));
    right: max(var(--pad-inline), env(safe-area-inset-right, 0px));
    top: calc(3.5rem + env(safe-area-inset-top, 0px));
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    max-height: min(70vh, calc(100dvh - 5.5rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-main a {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
  }

  .nav-main a:active {
    background: var(--accent-soft);
  }

  .nav-main.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .brand {
    font-size: 1.05rem;
  }

  .hero {
    padding: clamp(2rem, 8vw, 4rem) 1rem clamp(2rem, 7vw, 3.5rem);
  }

  .hero h1 {
    font-size: clamp(1.65rem, 7vw, 2.75rem);
    line-height: 1.2;
  }

  .hero-lead {
    font-size: 1rem;
  }

  .post-grid {
    gap: 1rem;
  }

  .site-footer {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  }

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

/* —— Hero —— */
.hero {
  padding: clamp(3rem, 10vw, 6rem) 1rem clamp(3rem, 8vw, 5rem);
  text-align: center;
}

.hero h1 {
  margin: 0 auto 1rem;
  max-width: var(--prose-width);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(
    125deg,
    #f8fafc 0%,
    #7dd3fc 35%,
    #fde68a 68%,
    #ddd6fe 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  margin: 0 auto;
  max-width: var(--prose-width);
  color: var(--text-muted);
  font-size: 1.125rem;
}

/* 首页 main 内相邻内容栏：垂直分缝（Hero 自带大段下留白，单独取消顶距） */
main#main > .wrap + .wrap {
  margin-top: 1.5rem;
}

main#main > .hero + .wrap {
  margin-top: 0;
}

/* —— 广告位（预留 AdSense）—— */
.ad-slot {
  margin: 2rem auto;
  min-height: 90px;
  max-width: min(100%, 728px);
  border: 1px dashed rgba(56, 189, 248, 0.28);
  border-radius: var(--radius);
  background: linear-gradient(165deg, var(--bg-surface), rgba(56, 189, 248, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.ad-slot--inline {
  min-height: 250px;
  max-width: 300px;
}

.ad-slot__label {
  padding: 1rem;
  text-align: center;
}

/* —— 文章列表 —— */
.section-title {
  margin: 0 0 1.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-violet);
}

.post-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  border-color: var(--accent-ring);
  box-shadow: 0 0 0 1px var(--accent-glow), 0 12px 40px rgba(15, 23, 42, 0.35);
}

.post-card__meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.post-card__category {
  font-weight: 600;
  color: var(--accent-muted);
}

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

.post-card__meta-sep {
  opacity: 0.45;
  user-select: none;
}

/* —— 首页分类入口 —— */
.category-strip {
  padding-bottom: 0.25rem;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
}

.category-chip:hover {
  border-color: var(--accent-ring);
  color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-violet-soft));
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.12);
}

/* —— 分类总览 / 分类列表页 —— */
.category-page {
  padding: var(--page-pad-y) 1rem var(--page-pad-y-bottom);
}

.category-page__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #f8fafc 0%, #7dd3fc 50%, #fde68a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.category-page__lead {
  margin: 0 0 2rem;
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.category-hub {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .category-hub {
    grid-template-columns: repeat(2, 1fr);
  }
}

.category-tile {
  display: block;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.category-tile h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.category-tile p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.category-tile:hover {
  border-color: var(--accent-ring);
  box-shadow: 0 0 0 1px var(--accent-glow), 0 12px 36px rgba(15, 23, 42, 0.3);
}

/* 文章页：返回链接与正文同宽、同列对齐 */
.article-page > .back-link {
  display: flex;
  align-items: center;
  max-width: var(--prose-width);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

.article-page--wide > .back-link {
  max-width: min(100%, var(--article-wide-max));
}

.article-page .ad-slot--inline {
  display: flex;
  margin-left: auto;
  margin-right: auto;
  max-width: min(100%, var(--prose-width));
  box-sizing: border-box;
}

.article-page--wide .ad-slot--inline {
  max-width: min(100%, var(--article-wide-max));
}

/* 分类列表页：标题、导语、列表同一内容栏 */
.category-page > .back-link {
  display: flex;
  align-items: center;
  max-width: var(--prose-width);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

.category-page > .category-page__title {
  max-width: var(--prose-width);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

.category-page > .category-page__lead {
  max-width: var(--prose-width);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

.category-page > section {
  max-width: var(--prose-width);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

/* 分类总览页：与 .wrap 左右对齐一致，避免窄标题 + 宽磁贴错位 */
.category-page--hub > .back-link,
.category-page--hub > .category-page__title,
.category-page--hub > .category-page__lead {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
}

.post-grid--compact {
  grid-template-columns: 1fr;
  width: 100%;
  max-width: var(--prose-width);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.category-page section .post-grid--compact {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.category-empty {
  margin: 0;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.post-card__title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.post-card__title a {
  color: var(--text);
}

.post-card__title a:hover {
  color: var(--accent);
}

.post-card__excerpt {
  margin: 0;
  flex: 1;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.post-card__tags {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-violet-soft));
  border: 1px solid rgba(56, 189, 248, 0.22);
  color: var(--tag-fg);
  font-weight: 500;
}

/* —— 页脚 —— */
.site-footer {
  position: relative;
  margin-top: 5rem;
  padding: 0 0 2.25rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.04) 0%, transparent 42%);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(36rem, 88%);
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(56, 189, 248, 0.45),
    rgba(196, 181, 253, 0.4),
    transparent
  );
  pointer-events: none;
}

.footer-wrap {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-top: 3rem;
  padding-left: max(var(--pad-inline), env(safe-area-inset-left, 0px));
  padding-right: max(var(--pad-inline), env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

.footer-grid {
  display: grid;
  gap: 2rem 2.5rem;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.footer-brand {
  max-width: 22rem;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.65rem;
}

.footer-logo:hover {
  color: var(--accent-hover);
}

.footer-logo:hover .brand__tag {
  color: var(--accent-violet);
}

.footer-logo:hover .brand__name {
  color: var(--accent-hover);
}

.footer-tagline {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.footer-col {
  min-width: 0;
}

.footer-heading {
  margin: 0 0 0.85rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-violet);
}

.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
  font-weight: 500;
}

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

.footer-note {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-muted);
  opacity: 0.92;
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.footer-copy {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-copy-mark {
  color: var(--accent-secondary);
  margin-right: 0.15em;
}

.footer-fine {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  opacity: 0.85;
}

/* —— 文章页 —— */
.article-page {
  padding: var(--page-pad-y) 1rem var(--page-pad-y-bottom);
}

.article-page--wide .article-header {
  max-width: min(100%, var(--article-wide-max));
}

.article-header {
  max-width: var(--prose-width);
  margin: 0 auto 2.5rem;
}

.article-header h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  background: linear-gradient(120deg, #f8fafc 0%, #a5f3fc 45%, #e9d5ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.article-meta time {
  color: var(--text);
}

.article-meta__category {
  font-weight: 600;
  color: var(--accent);
}

.article-meta__category:hover {
  color: var(--accent-hover);
}

.article-lead {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.prose {
  max-width: var(--prose-width);
  margin-inline: auto;
}

.prose h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #e2e8f0;
}

.prose h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.prose p {
  margin: 0 0 1.25rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1.25rem;
  padding-left: 1.35rem;
}

.prose li {
  margin-bottom: 0.35rem;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent-secondary);
  background: linear-gradient(90deg, var(--accent-soft), var(--accent-warm-soft));
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.prose pre {
  margin: 1.5rem 0;
  padding: 1.25rem;
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.55;
}

.prose pre code {
  padding: 0;
  border: none;
  background: none;
}

/* 宽表格类长文（如数据库草案） */
.prose--wide {
  max-width: min(100%, var(--article-wide-max));
}

.prose .table-scroll {
  overflow-x: auto;
  margin: 1.25rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  -webkit-overflow-scrolling: touch;
}

.prose .table-scroll table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.prose .table-scroll th,
.prose .table-scroll td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.prose .table-scroll th {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.12), var(--bg-elevated));
  font-weight: 600;
  white-space: nowrap;
  color: #e2e8f0;
}

.prose .table-scroll tbody tr:hover td {
  background: rgba(56, 189, 248, 0.06);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 2rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
}

.back-link:hover {
  color: var(--accent);
}

/* —— 关于页等简单页 —— */
.page-simple {
  padding: var(--page-pad-y) 0 var(--page-pad-y-bottom);
  max-width: var(--prose-width);
  margin-inline: auto;
  width: 100%;
  box-sizing: border-box;
}

.page-simple h1 {
  margin-top: 0;
  background: linear-gradient(120deg, #f8fafc 0%, #a5f3fc 45%, #e9d5ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* —— 移动端全站细化（与上文 ≤768px 规则叠加）—— */
@media (max-width: 768px) {
  body {
    font-size: 1rem;
    line-height: 1.62;
  }

  #main {
    min-width: 0;
  }

  .post-card {
    padding: 1.15rem;
    -webkit-tap-highlight-color: transparent;
  }

  .post-card:active {
    border-color: var(--accent-ring);
  }

  .post-card__title {
    font-size: 1.1rem;
    line-height: 1.38;
  }

  .post-card__excerpt {
    font-size: 0.9rem;
  }

  .section-title {
    margin-bottom: 1.1rem;
  }

  .category-strip {
    padding-bottom: 0.5rem;
  }

  .category-chip {
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
  }

  .category-chip:active {
    opacity: 0.92;
  }

  .ad-slot {
    margin: 1.35rem auto;
    min-height: 72px;
  }

  .ad-slot--inline {
    max-width: 100%;
    width: 100%;
    min-height: 200px;
  }

  :root {
    --page-pad-y: 1.75rem;
    --page-pad-y-bottom: 3rem;
    --pad-inline: clamp(1.25rem, 5.5vw, 2rem);
  }

  .category-page__title {
    font-size: clamp(1.5rem, 6.5vw, 2rem);
    line-height: 1.22;
  }

  .category-page__lead {
    font-size: 0.98rem;
    margin-bottom: 1.5rem;
  }

  .category-tile {
    padding: 1.2rem;
    -webkit-tap-highlight-color: transparent;
  }

  .category-tile:active {
    border-color: var(--accent-ring);
  }

  .category-tile h3 {
    font-size: 1.05rem;
  }

  .category-empty {
    padding: 1rem 1.15rem;
    font-size: 0.9rem;
    max-width: 100%;
  }

  .article-page--wide .article-header {
    max-width: 100%;
  }

  .article-header {
    margin-bottom: 1.65rem;
    padding-inline: 0;
  }

  .article-header h1 {
    font-size: clamp(1.45rem, 6vw, 2.1rem);
    line-height: 1.22;
    word-break: break-word;
  }

  .article-meta {
    gap: 0.5rem 0.85rem;
    font-size: 0.8125rem;
    line-height: 1.45;
  }

  .article-meta__category {
    min-height: 2.25rem;
    display: inline-flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
  }

  .article-lead {
    font-size: 0.9375rem;
    line-height: 1.58;
  }

  .back-link {
    min-height: 2.75rem;
    padding: 0.35rem 0;
    margin-bottom: 1.35rem;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
  }

  .prose,
  .prose--wide {
    max-width: 100%;
    padding-inline: 0;
  }

  .prose h2 {
    font-size: 1.22rem;
    margin: 1.85rem 0 0.65rem;
    line-height: 1.3;
    word-break: break-word;
  }

  .prose h3 {
    font-size: 1.05rem;
    margin: 1.5rem 0 0.45rem;
    word-break: break-word;
  }

  .prose p {
    margin-bottom: 1.1rem;
  }

  .prose ul,
  .prose ol {
    padding-left: 1.15rem;
    margin-bottom: 1.1rem;
  }

  .prose li {
    margin-bottom: 0.45rem;
  }

  .prose blockquote {
    padding: 0.85rem 1rem;
    margin: 1.25rem 0;
    font-size: 0.95rem;
  }

  .prose pre {
    margin: 1.15rem 0;
    padding: 1rem;
    font-size: 0.78rem;
    line-height: 1.52;
    border-radius: 10px;
  }

  .prose code {
    font-size: 0.82em;
    word-break: break-word;
  }

  .prose .table-scroll {
    margin: 1.1rem 0;
    border-radius: 10px;
    max-width: none;
  }

  .prose .table-scroll table {
    font-size: 0.75rem;
  }

  .prose .table-scroll th,
  .prose .table-scroll td {
    padding: 0.4rem 0.5rem;
  }

  .prose .table-scroll th {
    white-space: normal;
    min-width: 4.5rem;
  }

  .page-simple {
    padding: var(--page-pad-y) 0 var(--page-pad-y-bottom);
    max-width: 100%;
  }

  .page-simple h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
    line-height: 1.2;
  }

  .page-simple p {
    font-size: 0.98rem;
  }

  .footer-wrap {
    padding-top: 2.25rem;
  }

  .footer-grid {
    gap: 1.65rem;
  }

  .footer-brand {
    max-width: none;
  }

  .footer-logo {
    min-height: 2.75rem;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
  }

  .footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.2rem 0;
    -webkit-tap-highlight-color: transparent;
  }

  .post-card__category {
    min-height: 2.25rem;
    display: inline-flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
  }

  .post-card__title a {
    -webkit-tap-highlight-color: transparent;
  }

  a {
    -webkit-tap-highlight-color: rgba(56, 189, 248, 0.15);
  }

  @supports selector(body:has(*)) {
    body:has(.nav-main.is-open) {
      overflow: hidden;
    }
  }
}
