/* ═══════════════════════════════════════════
   FTS-BLOG · Engineering Blueprint Aesthetic
   Classic Blueprint: Dark Navy + Cyan Grid
   ═══════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --bg: #0a1929;
  --bg-grid: rgba(100, 200, 255, 0.03);
  --bg-card: rgba(15, 35, 60, 0.8);
  --bg-hover: rgba(20, 45, 75, 0.9);
  --fg: #e0f0ff;
  --fg-dim: #8ab4d8;
  --muted: #5a7a9a;
  --border: rgba(100, 200, 255, 0.2);
  --border-strong: rgba(100, 200, 255, 0.4);
  --accent: #ff6b35;
  --accent-glow: rgba(255, 107, 53, 0.3);
  --grid-line: rgba(100, 200, 255, 0.06);
  --font-cn: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Consolas", "Monaco", monospace;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 5rem;
  --max-width: 1560px;
  --content-width: 720px;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-cn);
  background: linear-gradient(to bottom, #152e4a, var(--bg));
  color: var(--fg);
  line-height: 1.8;
  letter-spacing: 0.03em;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ── Blueprint Grid Background ── */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  z-index: 0;
}

/* ── Additional grid overlay (larger squares) ── */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(100, 200, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 200, 255, 0.08) 1px, transparent 1px);
  background-size: 100px 100px;
  pointer-events: none;
  z-index: 0;
}

/* All content above grid */
.container, .container-wide, .n-marker, .title-block,
.nav, .footer-block, .card, .stamp, .form-group,
.table, .description, .spec-block {
  position: relative;
  z-index: 1;
}

/* ── Compass "N" Marker ── */
.n-marker {
  position: fixed;
  top: var(--spacing-md);
  right: var(--spacing-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
  opacity: 0.6;
  z-index: 100;
}

/* ── Layout Container ── */
.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--spacing-lg) var(--spacing-md);
}

.container-wide {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing-lg) var(--spacing-md);
}

/* ── Title Block (Blueprint Header) ── */
.title-block {
  text-align: center;
  padding: var(--spacing-xl) 0 var(--spacing-lg);
  position: relative;
}

.title-block .main-title {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: var(--fg);
  text-shadow: 0 0 20px rgba(100, 200, 255, 0.3);
}

.title-block .sub-title {
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--fg-dim);
  margin-bottom: 0.5rem;
}

.title-block .sub-title-en {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border-strong);
  margin: var(--spacing-md) 0;
  position: relative;
}

.divider-thin {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--spacing-sm) 0;
}

/* ── Spec Lines ── */
.spec-block {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  line-height: 1.9;
  color: var(--muted);
  margin: var(--spacing-md) 0;
}

.spec-block .label {
  font-weight: 700;
  color: var(--fg);
}

.spec-block strong {
  color: var(--fg);
  font-weight: 600;
}

/* ── Description ── */
.description {
  text-align: center;
  font-size: 0.95rem;
  line-height: 2;
  letter-spacing: 0.04em;
  color: var(--fg-dim);
  max-width: var(--content-width);
  margin: var(--spacing-md) auto;
}

.post-hint {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: var(--spacing-sm);
}

/* ── Stamp Element ── */
.stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 0.5rem 1.2rem;
  border: 2px solid var(--accent);
  color: var(--accent);
  text-transform: uppercase;
  transform: rotate(-2deg);
  margin: var(--spacing-md) 0;
  opacity: 0.9;
  box-shadow: 0 0 15px var(--accent-glow);
}

.stamp-alt {
  border-color: var(--fg-dim);
  color: var(--fg-dim);
  box-shadow: 0 0 15px rgba(100, 200, 255, 0.2);
}

/* ── Footer Block ── */
.footer-block {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  line-height: 1.9;
  color: var(--muted);
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border);
}

.footer-block .field {
  font-weight: 600;
  color: var(--fg);
}

.beian-icon {
  height: 1em;
  width: auto;
  vertical-align: -0.1em;
  margin-right: 0.3em;
}

.footer-block a {
  color: var(--muted);
  text-decoration: none;
}

/* ── Cards System ── */
.card {
  border: 1px dashed var(--border);
  padding: var(--spacing-sm);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 5 / 3;
  cursor: pointer;
  max-width: 408px;
  justify-self: center;
  width: 100%;
  overflow: hidden;
  min-height: 0;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

/* Corner marks (technical drawing style) */
.card::before {
  content: '';
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    /* Top-left: horizontal */
    linear-gradient(to right, var(--border-strong)) no-repeat 0 0 / 12px 1.8px,
    /* Top-left: vertical */
    linear-gradient(to bottom, var(--border-strong)) no-repeat 0 0 / 1.8px 12px,
    /* Top-right: horizontal */
    linear-gradient(to left, var(--border-strong)) no-repeat 100% 0 / 12px 1.8px,
    /* Top-right: vertical */
    linear-gradient(to bottom, var(--border-strong)) no-repeat 100% 0 / 1.8px 12px,
    /* Bottom-left: horizontal */
    linear-gradient(to right, var(--border-strong)) no-repeat 0 100% / 12px 1.8px,
    /* Bottom-left: vertical */
    linear-gradient(to top, var(--border-strong)) no-repeat 0 100% / 1.8px 12px,
    /* Bottom-right: horizontal */
    linear-gradient(to left, var(--border-strong)) no-repeat 100% 100% / 12px 1.8px,
    /* Bottom-right: vertical */
    linear-gradient(to top, var(--border-strong)) no-repeat 100% 100% / 1.8px 12px;
  background-repeat: no-repeat;
}

.card:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
  box-shadow: 0 0 30px rgba(100, 200, 255, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-sm);
  flex-shrink: 0;
  min-height: 0;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: var(--fg);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  max-height: 3.2em;
}

.card-title-en {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  max-height: 1.28em;
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  flex-shrink: 0;
  margin-left: var(--spacing-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.card-stats {
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}

.card-excerpt {
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--fg-dim);
  margin: var(--spacing-sm) 0;
  flex-grow: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.card-footer {
  margin-top: auto;
  padding-top: var(--spacing-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  flex-shrink: 0;
  min-height: 0;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  overflow: hidden;
  max-height: 2.2em;
  flex: 1;
  min-width: 0;
  align-items: center;
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border-strong);
  color: var(--fg-dim);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  background: rgba(100, 200, 255, 0.05);
  white-space: nowrap;
  line-height: 1.4;
}

.tag:hover {
  border-color: var(--fg-dim);
  color: var(--fg);
  box-shadow: 0 0 10px rgba(100, 200, 255, 0.2);
}

.card-footer {
  margin-top: auto;
  padding-top: var(--spacing-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  flex-shrink: 0;
  min-height: 0;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--fg);
  text-decoration: none;
  transition: all 0.2s ease;
  margin-left: auto;
}

.card-link:hover {
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
}

.card-link::after {
  content: "→";
  transition: transform 0.2s ease;
}

.card-link:hover::after {
  transform: translateX(4px);
}

/* ── Post Grid ── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-sm);
  margin: var(--spacing-lg) auto;
  max-width: 1340px;
}

@Media (max-width: 1200px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 768px) {
  .post-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--fg);
  background: rgba(100, 200, 255, 0.1);
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(5px);
}

.btn:hover {
  background: rgba(100, 200, 255, 0.2);
  box-shadow: 0 0 20px rgba(100, 200, 255, 0.2);
}

.btn-outline {
  background: transparent;
  color: var(--fg);
}

.btn-outline:hover {
  background: rgba(100, 200, 255, 0.15);
}

.btn-danger {
  border-color: var(--accent);
  background: rgba(255, 107, 53, 0.1);
  color: var(--accent);
}

.btn-danger:hover {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
}

/* ── Forms ── */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--fg);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-cn);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  background: rgba(10, 25, 41, 0.6);
  color: var(--fg);
  transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 10px rgba(100, 200, 255, 0.2);
}

.form-input:focus-visible,
.form-textarea:focus-visible {
  outline: 2px solid rgba(100, 200, 255, 0.6);
  outline-offset: 2px;
}

.form-textarea {
  min-height: 300px;
  resize: vertical;
  line-height: 1.8;
}

/* ── Tables ── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--border-strong);
  color: var(--fg);
}

.table td {
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--border);
  color: var(--fg-dim);
}

.table tr:hover {
  background: rgba(100, 200, 255, 0.05);
}

/* ── Navigation ── */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--spacing-lg);
}

.nav-brand {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--fg);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: var(--spacing-md);
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--fg);
}

/* ── Utility Classes ── */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

/* ── Post Content ── */
.post-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--spacing-lg);
  margin: var(--spacing-lg) 0;
}

.toc-sidebar {
  position: sticky;
  top: var(--spacing-md);
  height: fit-content;
  max-height: calc(100vh - var(--spacing-lg));
  overflow-y: auto;
  border-left: 1px solid var(--border);
  padding-left: var(--spacing-md);
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: var(--spacing-sm);
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.toc-title::after {
  content: '比例 1:1';
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

/* Vertical progress track (accent fills to the active section) */
.toc-progress {
  position: absolute;
  left: -0.55rem;
  top: 0.35rem;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  border-radius: 1px;
  transition: height 0.25s ease;
  z-index: 1;
  height: 0;
}

.toc-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.6;
  padding: 0.3rem 0.5rem;
  border-left: 2px solid transparent;
  margin-left: -0.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  position: relative;
}

.toc-link:hover {
  color: var(--fg);
  border-left-color: var(--border-strong);
  background: rgba(100, 200, 255, 0.04);
}

.toc-link.active {
  color: var(--fg);
  border-left-color: var(--accent);
  background: rgba(255, 107, 53, 0.06);
  font-weight: 600;
}

.toc-number {
  font-size: 0.62rem;
  color: var(--muted);
  min-width: 1.4em;
  text-align: right;
  flex-shrink: 0;
  opacity: 0.7;
  letter-spacing: 0.04em;
}

.toc-link.active .toc-number {
  color: var(--accent);
  opacity: 1;
}

.toc-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.toc-link-h3 {
  padding-left: 1.25rem;
  font-size: 0.73rem;
}

.toc-link-h3 .toc-number {
  font-size: 0.58rem;
  min-width: 1.2em;
}

.toc-empty {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.7;
  padding: var(--spacing-sm) 0;
  letter-spacing: 0.06em;
}

.toc-flash {
  background: rgba(255, 107, 53, 0.12) !important;
}

.post-content-full {
  min-width: 0;
}

.post-content-full .description {
  max-width: 900px;
}

.post-body {
  text-align: left !important;
}

.post-body h2,
.post-body h3,
.post-body p,
.post-body ul,
.post-body ol {
  text-align: left;
}

.post-body pre {
  text-align: left;
}

.post-body code {
  text-align: left;
}

.description h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: var(--spacing-lg) 0 var(--spacing-sm);
  color: var(--fg);
  scroll-margin-top: var(--spacing-md);
}

.description h3 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: var(--spacing-md) 0 var(--spacing-sm);
  color: var(--fg);
  scroll-margin-top: var(--spacing-md);
}

.description p {
  margin: var(--spacing-sm) 0;
  color: var(--fg-dim);
}

.description ul, .description ol {
  margin: var(--spacing-sm) 0;
  padding-left: var(--spacing-md);
  color: var(--fg-dim);
}

.description li {
  margin: 0.3rem 0;
}

.description code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: rgba(100, 200, 255, 0.1);
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--border);
  color: var(--fg);
}

.description pre {
  background: rgba(10, 25, 41, 0.8);
  border: 1px solid var(--border);
  padding: var(--spacing-md);
  overflow-x: auto;
  margin: var(--spacing-md) 0;
}

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

.description strong {
  color: var(--fg);
  font-weight: 600;
}

.description a {
  color: var(--accent);
  text-decoration: none;
}

/* Markdown Tables */
.description table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-md) 0;
  font-size: 0.9rem;
}

.description table th,
.description table td {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
}

.description table th {
  background: rgba(100, 200, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--fg);
  text-transform: uppercase;
}

.description table td {
  color: var(--fg-dim);
}

.description table tr:hover td {
  background: rgba(100, 200, 255, 0.05);
}

.description a:hover {
  text-shadow: 0 0 10px var(--accent-glow);
}

/* ── Upload Zone ── */
.upload-zone {
  border: 2px dashed var(--border);
  padding: var(--spacing-lg);
  text-align: center;
  margin: var(--spacing-md) 0;
  transition: all 0.2s ease;
  cursor: pointer;
}

.upload-zone:hover {
  border-color: var(--border-strong);
  background: rgba(100, 200, 255, 0.05);
}

.upload-zone.dragover {
  border-color: var(--fg);
  background: rgba(100, 200, 255, 0.1);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: var(--spacing-lg);
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--fg);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  :root {
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
  }

  .container {
    padding: var(--spacing-md) var(--spacing-sm);
  }

  .title-block .main-title {
    font-size: 1.6rem;
  }

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

  .nav {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .n-marker {
    top: var(--spacing-sm);
    right: var(--spacing-sm);
  }

  .post-layout {
    grid-template-columns: 1fr;
  }

  .toc-sidebar {
    display: none;
  }
}

@media (max-width: 480px) {
  .title-block .main-title {
    font-size: 1.3rem;
  }

  .spec-block {
    font-size: 0.75rem;
  }

  .post-layout {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════
   Homepage enhancements · Navigation / Status / Hot / Gadgets
   ═══════════════════════════════════════════ */

/* ── Nav active state ── */
.nav-links a.active {
  color: var(--fg);
  text-shadow: 0 0 8px rgba(100, 200, 255, 0.5);
}

.nav-brand-sub {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ── Scroll progress bar ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), #ffb347);
  box-shadow: 0 0 12px var(--accent-glow);
  z-index: 999;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 80ms linear;
  will-change: transform;
}

/* ── Back to top ── */
.back-to-top {
  position: fixed;
  right: var(--spacing-md);
  bottom: var(--spacing-md);
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--border-strong);
  background: rgba(10, 25, 41, 0.85);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s ease;
  z-index: 900;
  backdrop-filter: blur(6px);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: var(--fg);
  box-shadow: 0 0 18px rgba(100, 200, 255, 0.25);
}

/* ── Hero actions: search + random ── */
.hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin: 0 0 var(--spacing-md);
}

.hero-search {
  display: flex;
  gap: var(--spacing-xs);
  min-width: min(480px, 100%);
}

.hero-search .form-input {
  flex: 1;
  min-width: 0;
}

.btn-random {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 107, 53, 0.06);
}

.btn-random:hover {
  background: rgba(255, 107, 53, 0.18);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ── Status panel ── */
.status-panel {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  border: 1px dashed var(--border-strong);
  background: var(--border);
  margin: var(--spacing-md) auto var(--spacing-lg);
  max-width: 1100px;
}

.status-item {
  background: rgba(10, 25, 41, 0.9);
  padding: var(--spacing-sm);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}

.status-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.status-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.06em;
  text-shadow: 0 0 12px rgba(100, 200, 255, 0.25);
}

/* ── Hot drawings strip ── */
.hot-section {
  margin: 0 auto var(--spacing-lg);
  max-width: 1100px;
}

.section-heading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: var(--spacing-sm);
  text-transform: uppercase;
}

.section-heading .label {
  color: var(--fg);
  font-weight: 700;
}

.hot-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-sm);
}

.hot-item {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  border: 1px dashed var(--border);
  background: var(--bg-card);
  padding: var(--spacing-sm);
  text-decoration: none;
  transition: all 0.2s ease;
  min-width: 0;
}

.hot-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
  box-shadow: 0 0 18px rgba(100, 200, 255, 0.1);
}

.hot-rank {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
}

.hot-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.hot-title {
  color: var(--fg);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hot-views {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ── Typewriter caret ── */
.typewriter {
  min-height: 1.4em;
}

.typewriter::after {
  content: '▍';
  margin-left: 2px;
  color: var(--accent);
  animation: caret-blink 1s steps(1) infinite;
}

@keyframes caret-blink {
  50% { opacity: 0; }
}

/* ── Scanner sweep across the homepage title block ── */
.homepage-content .title-block {
  overflow: hidden;
}

.homepage-content .title-block::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -10%;
  height: 8%;
  background: linear-gradient(180deg, transparent, rgba(100, 200, 255, 0.12), transparent);
  animation: scan-sweep 7s ease-in-out infinite;
  pointer-events: none;
  will-change: transform;
}

@keyframes scan-sweep {
  0% { transform: translateY(0); }
  55%, 100% { transform: translateY(calc(100vh + 20%)); }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hot-strip {
    grid-template-columns: 1fr;
  }

  .status-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .status-item:last-child {
    grid-column: span 2;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-search {
    min-width: 0;
  }

  .btn-random {
    justify-content: center;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .homepage-content .title-block::after,
  .typewriter::after {
    animation: none;
  }

  .back-to-top,
  .scroll-progress {
    transition: none;
  }

  .page-splash-bar {
    transition: none !important;
  }

  .title-block,
  .nav,
  .spec-block,
  .hero-actions,
  .status-panel,
  .hot-section,
  .description,
  .post-grid {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ═══════════════════════════════════════════
   Full-screen page splash · Blueprint immersive
   ═══════════════════════════════════════════ */

.page-splash {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: linear-gradient(to bottom, #0a1929, #152e4a);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.page-splash.done {
  opacity: 0;
  pointer-events: none;
}

.page-splash-inner {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
}

.page-splash.done .page-splash-inner {
  transform: translateY(-28px) scale(0.55);
  opacity: 0;
}

/* Blueprint grid behind splash */
.page-splash-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(100, 200, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 200, 255, 0.04) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.page-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  position: relative;
  z-index: 1;
}

.page-splash-brand {
  font-family: var(--font-mono);
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--fg);
  text-shadow: 0 0 30px rgba(100, 200, 255, 0.55), 0 0 60px rgba(100, 200, 255, 0.2);
}

.page-splash-sub {
  font-size: 1.05rem;
  color: var(--fg-dim);
  letter-spacing: 0.14em;
  margin-top: 0.2rem;
}

.page-splash-tagline {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 0.15rem;
}

.page-splash-bar-wrap {
  width: min(420px, 78vw);
  height: 4px;
  background: rgba(100, 200, 255, 0.12);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  margin-top: 1.4rem;
}

.page-splash-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), #ffb347);
  box-shadow: 0 0 14px var(--accent-glow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.08s linear;
  will-change: transform;
}

/* Ruler ticks */
.page-splash-bar-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent, transparent 9px, rgba(100, 200, 255, 0.45) 9px, rgba(100, 200, 255, 0.45) 10px);
  pointer-events: none;
  z-index: 2;
}

.page-splash-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

#splashPercent {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--fg);
  min-width: 3.5rem;
  text-align: right;
}

.page-splash-stamp {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #fff;
  background: var(--accent);
  padding: 0.25rem 0.8rem;
  transform: rotate(-2deg);
  box-shadow: 0 0 12px var(--accent-glow);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.page-splash.stamp-visible .page-splash-stamp {
  opacity: 1;
}

.page-splash-n {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
  opacity: 0.5;
}

/* Hide scroll while splash is active */
body.page-splash-active {
  overflow: hidden;
}

/* ═══════════════════════════════════════════
   Drawing loader · Article transition
   ═══════════════════════════════════════════ */

/* Hide article content until loader finishes (prevents flash) */
html.drawer-ready .title-block,
html.drawer-ready .spec-block,
html.drawer-ready .post-layout,
html.drawer-ready .post-content-full {
  opacity: 0;
}

.drawing-loader {
  position: fixed;
  inset: 0;
  z-index: 1900;
  background: linear-gradient(to bottom, #0a1929, #152e4a);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}

.drawing-loader.active {
  opacity: 1;
  pointer-events: auto;
}

.drawing-loader-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(100, 200, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 200, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.drawing-loader-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 520px;
  width: 90%;
}

.drawing-loader-title {
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  font-weight: 700;
  color: var(--fg);
  text-align: center;
  letter-spacing: 0.1em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawing-loader-sub {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--fg-dim);
  letter-spacing: 0.18em;
}

.drawing-loader-bar-wrap {
  width: 100%;
  height: 3px;
  background: rgba(100, 200, 255, 0.12);
  position: relative;
  overflow: hidden;
}

.drawing-loader-bar {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
}

.drawing-loader-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.14em;
}

.drawing-loader-stamp {
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  transform: rotate(-2deg);
  box-shadow: 0 0 10px var(--accent-glow);
}

.drawing-loader::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-strong), transparent);
}

.drawing-loader::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-strong), transparent);
}

.drawing-loader-n {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
  opacity: 0.45;
}

@media (max-width: 768px) {
  .drawing-loader-inner {
    width: 92%;
    gap: 0.8rem;
  }

  .drawing-loader-title {
    font-size: 1.2rem;
  }

  .drawing-loader-sub {
    font-size: 0.8rem;
  }

  .drawing-loader-meta {
    font-size: 0.7rem;
    gap: 0.6rem;
  }
}
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: var(--spacing-lg) auto;
  max-width: 960px;
}

.post-list-item {
  display: flex;
  align-items: stretch;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-sm);
  border-bottom: 1px dashed var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  border-left: 2px solid transparent;
  border-right: 2px solid transparent;
}

.post-list-item:hover {
  background: rgba(100, 200, 255, 0.04);
  border-bottom-color: var(--border-strong);
}

.post-list-index {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
  min-width: 2.6rem;
  text-align: right;
  opacity: 0.9;
}

.post-list-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.post-list-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.post-list-title-en {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.post-list-excerpt {
  font-size: 0.88rem;
  color: var(--fg-dim);
  line-height: 1.7;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.post-list-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.post-list-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.2rem;
  flex-shrink: 0;
  min-width: 6.5rem;
  text-align: right;
}

.post-list--archive .post-list-item {
  padding: var(--spacing-sm) var(--spacing-sm);
}

.post-list--archive .post-list-index {
  font-size: 1.25rem;
  min-width: 3rem;
}

.post-list--archive .post-list-item:hover {
  border-left-color: var(--accent);
  border-right-color: var(--accent);
  background: rgba(255, 107, 53, 0.04);
}

/* ── Drum list (archive page) ── */
.drum-viewport {
  height: 520px;
  overflow: hidden;
  position: relative;
  margin: var(--spacing-lg) auto;
  max-width: 1100px;
  border: 1px dashed var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  touch-action: none;
}

.drum-viewport::before {
  content: '';
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    linear-gradient(to right, var(--border-strong)) no-repeat 0 0 / 12px 1.8px,
    linear-gradient(to bottom, var(--border-strong)) no-repeat 0 0 / 1.8px 12px,
    linear-gradient(to left, var(--border-strong)) no-repeat 100% 0 / 12px 1.8px,
    linear-gradient(to bottom, var(--border-strong)) no-repeat 100% 0 / 1.8px 12px,
    linear-gradient(to right, var(--border-strong)) no-repeat 0 100% / 12px 1.8px,
    linear-gradient(to top, var(--border-strong)) no-repeat 0 100% / 1.8px 12px,
    linear-gradient(to left, var(--border-strong)) no-repeat 100% 100% / 12px 1.8px,
    linear-gradient(to top, var(--border-strong)) no-repeat 100% 100% / 1.8px 12px;
  background-repeat: no-repeat;
}

.drum-viewport:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
  box-shadow: 0 0 30px rgba(100, 200, 255, 0.08);
}

.drum-viewport:focus-visible {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 2px rgba(100, 200, 255, 0.25);
}

.drum-track {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.drum-item {
  height: 110px;
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  padding: 0 var(--spacing-lg);
  border-bottom: 1px dashed var(--border);
  cursor: pointer;
  opacity: 0.22;
  transition: opacity 0.4s ease, background 0.4s ease, border-color 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  position: relative;
}

.drum-item::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, transparent 0%, rgba(100, 200, 255, 0.03) 50%, transparent 100%) no-repeat 0 0 / 200% 100%;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.drum-item:hover {
  opacity: 0.75;
  background: rgba(100, 200, 255, 0.03);
}

.drum-item.active {
  opacity: 1;
  background: rgba(100, 200, 255, 0.08);
  border-left-color: var(--accent);
  transform: translateX(4px) scale(1.01);
  box-shadow: inset 0 0 0 1px rgba(100, 200, 255, 0.05), 0 8px 24px rgba(0, 0, 0, 0.25);
}

.drum-item.active::before {
  opacity: 1;
  background-position: -100% 0;
}

.drum-number {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 3.4rem;
  text-align: right;
  flex-shrink: 0;
  opacity: 0.9;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.drum-item.active .drum-number {
  opacity: 1;
  transform: scale(1.05);
  text-shadow: 0 0 18px rgba(100, 200, 255, 0.35);
}

.drum-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.drum-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.drum-title-en {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.drum-meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  text-align: right;
  flex-shrink: 0;
  min-width: 9rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.drum-meta::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--border);
  margin-bottom: 0.15rem;
  transition: background 0.4s ease;
}

.drum-item.active .drum-meta::before {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

@media (max-width: 768px) {
  .drum-viewport {
    height: 420px;
  }

  .drum-item {
    height: 100px;
    padding: 0 var(--spacing-sm);
    gap: var(--spacing-sm);
  }

  .drum-number {
    font-size: 1.5rem;
    min-width: 2.6rem;
  }

  .drum-title {
    font-size: 1.1rem;
  }

  .drum-title-en {
    font-size: 0.85rem;
  }

  .drum-meta {
    font-size: 0.72rem;
    min-width: 7.5rem;
  }
}

/* ── Splash-to-content reveal ── */
body.page-splash-active .title-block {
  opacity: 0;
  transform: translateY(40px) scale(0.55);
}

body.loaded .title-block {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.05s,
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.05s;
}

body.loaded .nav,
body.loaded .spec-block {
  opacity: 0;
  animation: splashReveal 0.55s ease forwards;
}

body.loaded .nav { animation-delay: 0.08s; }
body.loaded .spec-block { animation-delay: 0.14s; }

body.loaded .hero-actions,
body.loaded .status-panel {
  opacity: 0;
  animation: splashReveal 0.55s ease forwards;
}

body.loaded .hero-actions { animation-delay: 0.2s; }
body.loaded .status-panel { animation-delay: 0.22s; }

body.loaded .hot-section,
body.loaded .description {
  opacity: 0;
  animation: splashReveal 0.55s ease forwards;
}

body.loaded .hot-section { animation-delay: 0.26s; }
body.loaded .description { animation-delay: 0.3s; }

body.loaded .post-grid {
  opacity: 0;
  animation: splashReveal 0.55s ease forwards;
}

body.loaded .post-grid { animation-delay: 0.34s; }

@keyframes splashReveal {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════
   Archive page · Drawing database decorations
   ═══════════════════════════════════════════ */

/* Blueprint frame around archive content */
.posts-page .homepage-content {
  position: relative;
  padding: var(--spacing-lg);
  border: 1px dashed var(--border);
  background:
    linear-gradient(rgba(100, 200, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 200, 255, 0.02) 1px, transparent 1px),
    var(--bg);
  background-size: 24px 24px, 24px 24px, 100% 100%;
}

/* Corner brackets (technical drawing style) */
.posts-page .homepage-content {
  position: relative;
}

.posts-page .homepage-content::before,
.posts-page .homepage-content::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--accent);
  border-style: solid;
  pointer-events: none;
  opacity: 0.6;
}

/* Top-left corner */
.posts-page .homepage-content::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

/* Top-right corner */
.posts-page .homepage-content > .title-block::after {
  content: '';
  position: absolute;
  top: -1px;
  right: -1px;
  width: 24px;
  height: 24px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 2px 2px 0 0;
  pointer-events: none;
  opacity: 0.6;
}

/* Bottom-left corner */
.posts-page .homepage-content > .text-center::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: -1px;
  width: 24px;
  height: 24px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0 0 2px 2px;
  pointer-events: none;
  opacity: 0.6;
}

/* Bottom-right corner (already exists via .homepage-content::after, keep it) */
.posts-page .homepage-content::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

/* Additional corner marks via inset box-shadow */
.posts-page .title-block {
  position: relative;
}

.posts-page .title-block::before {
  content: '◆';
  position: absolute;
  top: -0.5rem;
  right: 0;
  font-size: 0.65rem;
  color: var(--accent);
  opacity: 0.5;
  letter-spacing: 0.1em;
}

/* Scale indicator for drum viewport */
.drum-viewport {
  position: relative;
}

.drum-viewport::after {
  content: 'SCALE 1:1';
  position: absolute;
  bottom: 0.5rem;
  right: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  opacity: 0.5;
  pointer-events: none;
}

/* Query stamp style for search form */
.hero-search {
  position: relative;
}

.hero-search::before {
  content: 'QUERY';
  position: absolute;
  top: -0.6rem;
  left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  opacity: 0.6;
  background: var(--bg);
  padding: 0 0.4rem;
}

.hero-search::after {
  content: '►';
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent);
  opacity: 0.4;
  pointer-events: none;
}

/* Archive list item technical style */
.drum-item {
  position: relative;
}

.drum-item::after {
  content: attr(data-index);
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.3s ease;
  letter-spacing: 0.1em;
}

.drum-item:hover::after {
  opacity: 0.4;
}

/* Bottom technical plate to balance top stamp */
.posts-page .drum-viewport + .divider {
  position: relative;
}

.posts-page .drum-viewport + .divider::before,
.posts-page .drum-viewport + .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40px;
  height: 1px;
  background: var(--border-strong);
  opacity: 0.4;
}

.posts-page .drum-viewport + .divider::before {
  left: 0;
}

.posts-page .drum-viewport + .divider::after {
  right: 0;
}

/* Technical reference markers */
.posts-page .spec-block {
  position: relative;
  padding-left: 1.2rem;
  padding-right: 1.2rem;
}

.posts-page .spec-block::before {
  content: '▣';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6rem;
  color: var(--accent);
  opacity: 0.5;
}

.posts-page .spec-block::after {
  content: '◈';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6rem;
  color: var(--accent);
  opacity: 0.5;
}

/* Symmetrical title decorations */
.posts-page .title-block {
  position: relative;
}

.posts-page .title-block::before {
  content: '◆';
  position: absolute;
  top: -0.5rem;
  right: 0;
  font-size: 0.65rem;
  color: var(--accent);
  opacity: 0.5;
  letter-spacing: 0.1em;
}

.posts-page .title-block::after {
  content: '◆';
  position: absolute;
  top: -0.5rem;
  left: 0;
  font-size: 0.65rem;
  color: var(--accent);
  opacity: 0.5;
  letter-spacing: 0.1em;
}

/* Drum viewport corner accents */
.drum-viewport {
  position: relative;
}

.drum-viewport::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border-top: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
  opacity: 0.3;
  pointer-events: none;
}

.drum-viewport::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-bottom: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  opacity: 0.3;
  pointer-events: none;
}

/* Additional drum viewport corners for symmetry */
.drum-viewport .drum-corner-tr,
.drum-viewport .drum-corner-bl {
  position: absolute;
  width: 20px;
  height: 20px;
  pointer-events: none;
  opacity: 0.3;
}

.drum-viewport .drum-corner-tr {
  top: 0;
  right: 0;
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
}

.drum-viewport .drum-corner-bl {
  bottom: 0;
  left: 0;
  border-bottom: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
}

/* Scale indicator inside drum viewport */
.scale-indicator {
  position: absolute;
  bottom: 0.5rem;
  right: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
}

/* Hide default scale text since we now use corner accents */
.scale-text {
  display: none;
}

/* Blueprint stamp decoration for archive page */
.blueprint-stamp {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--border-strong);
  background: rgba(100, 200, 255, 0.03);
  margin-bottom: var(--spacing-md);
  position: relative;
}

.blueprint-stamp::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  border: 1px dashed var(--border);
  pointer-events: none;
}

.stamp-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.15em;
  text-shadow: 0 0 12px rgba(100, 200, 255, 0.3);
}

.stamp-sub {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  opacity: 0.7;
}

/* Bottom plate to balance top stamp */
.blueprint-plate {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  background: rgba(100, 200, 255, 0.02);
  margin-top: var(--spacing-md);
  position: relative;
}

.blueprint-plate::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  border: 1px dashed var(--border);
  pointer-events: none;
  opacity: 0.5;
}

.plate-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.15em;
  opacity: 0.8;
}

.plate-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  opacity: 0.6;
}

/* Compass markers N/S for archive page */
.compass-marker {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0.35;
  letter-spacing: 0.1em;
  pointer-events: none;
}

.compass-marker {
  top: 0.5rem;
  right: 0.75rem;
}

.compass-s {
  top: auto;
  bottom: 0.5rem;
  right: 0.75rem;
}

/* Symmetrical divider accents */
.posts-page .divider {
  position: relative;
}

.posts-page .divider::before,
.posts-page .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30px;
  height: 1px;
  background: var(--border-strong);
  opacity: 0.3;
}

.posts-page .divider::before {
  left: 0;
}

.posts-page .divider::after {
  right: 0;
}

/* Search form technical frame */
.hero-search {
  position: relative;
  border: 1px dashed var(--border);
  padding: 0.75rem 1rem;
  background: rgba(100, 200, 255, 0.01);
}

.hero-search::before {
  content: 'QUERY';
  position: absolute;
  top: -0.55rem;
  left: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  opacity: 0.7;
  background: var(--bg);
  padding: 0 0.4rem;
}

.hero-search::after {
  content: '►';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent);
  opacity: 0.35;
  pointer-events: none;
}

/* Drum item symmetric hover accent */
.drum-item {
  position: relative;
}

.drum-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drum-item:hover::before {
  opacity: 0.4;
}

.drum-item.active::before {
  opacity: 0.7;
}

/* Search loader for archive page query form */
.search-form {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  align-items: center;
}

.search-input-wrap {
  display: flex;
  gap: var(--spacing-sm);
  flex: 1;
  min-width: 0;
}

.search-loader {
  display: none;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--accent);
  background: rgba(100, 200, 255, 0.08);
  box-shadow: 0 0 12px rgba(100, 200, 255, 0.15);
}

.search-form.loading .search-loader {
  display: inline-flex;
}

.search-loader-ring {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: searchSpin 0.8s linear infinite;
  box-shadow: 0 0 8px var(--accent-glow);
}

.search-loader-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.2em;
  text-shadow: 0 0 10px rgba(100, 200, 255, 0.4);
}

@keyframes searchSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════════════════════════
   404 error loader
   ═══════════════════════════════════════════ */
.error-loader {
  position: fixed;
  inset: 0;
  z-index: 1900;
  background: linear-gradient(to bottom, #0a1929, #152e4a);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}

.error-loader.active {
  opacity: 1;
  pointer-events: auto;
}

.error-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.error-loader-code {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-shadow: 0 0 24px rgba(100, 200, 255, 0.5);
}

.error-loader-text {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.15em;
}

.error-loader-sub {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  opacity: 0.7;
}

/* ═══════════════════════════════════════════
   Tags page loader
   ═══════════════════════════════════════════ */
.tags-loader {
  position: fixed;
  inset: 0;
  z-index: 1900;
  background: linear-gradient(to bottom, #0a1929, #152e4a);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}

.tags-loader.active {
  opacity: 1;
  pointer-events: auto;
}

.tags-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.tags-loader-title {
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.15em;
}

.tags-loader-sub {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  opacity: 0.7;
}

/* ═══════════════════════════════════════════
   Admin / API shared loader style
   ═══════════════════════════════════════════ */
.admin-loader,
.api-loader {
  position: fixed;
  inset: 0;
  z-index: 1900;
  background: linear-gradient(to bottom, #0a1929, #152e4a);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}

.admin-loader.active,
.api-loader.active {
  opacity: 1;
  pointer-events: auto;
}

.admin-loader-inner,
.api-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.admin-loader-title,
.api-loader-title {
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.15em;
}

.admin-loader-sub,
.api-loader-sub {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  opacity: 0.7;
}
