/* ============================================
   统一内容详情页布局系统
   Inspired by: GitHub article layout, Linear changelog, Tailwind prose
   Container: max-w-6xl (1152px) — wide but readable
   ============================================ */

/* --- Page-level container --- */
.detail-hero {
  position: relative;
  overflow: hidden;
  padding: 4rem 0;
  background: var(--cyber-bg-primary);
}

.detail-hero .detail-container {
  position: relative;
  z-index: 1;
}

.detail-container {
  max-width: 72rem; /* 1152px = max-w-6xl */
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .detail-container { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
  .detail-container { padding-left: 2rem; padding-right: 2rem; }
}

/* --- Hero grid background (reusable) --- */
.detail-hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image:
    linear-gradient(var(--neon-cyan, #1ee7ff) 1px, transparent 1px),
    linear-gradient(90deg, var(--neon-cyan, #1ee7ff) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* --- Breadcrumb --- */
.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  margin-bottom: 2rem;
  color: var(--text-muted);
}

.detail-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.detail-breadcrumb a:hover {
  color: var(--neon-green);
}

.detail-breadcrumb .current {
  color: var(--neon-cyan);
}

/* --- Hero title area --- */
.detail-title {
  font-family: var(--font-mono);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--neon-cyan);
  margin-bottom: 1rem;
  text-shadow: 0 0 20px rgba(30, 231, 255, 0.25);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.detail-meta-sep {
  width: 1px;
  height: 1rem;
  background: var(--glass-border);
}

.detail-intro {
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--text-secondary, #b0b8c8);
  margin-bottom: 1.5rem;
  max-width: 52rem;
  border-left: 3px solid rgba(30, 231, 255, 0.25);
  padding-left: 1rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.detail-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: rgba(30, 231, 255, 0.1);
  color: var(--neon-cyan);
  border: 1px solid rgba(30, 231, 255, 0.3);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* --- Content section --- */
.detail-body {
  padding: 3rem 0;
  background: var(--cyber-bg-primary);
}

/* --- Content card (the article itself) — premium feel --- */
.detail-card {
  background: var(--glass-bg, rgba(10, 15, 30, 0.6));
  border: 1px solid rgba(30, 231, 255, 0.08);
  border-radius: 0.75rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow:
    0 0 0 1px rgba(30, 231, 255, 0.04),
    0 2px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.detail-card:hover {
  border-color: rgba(30, 231, 255, 0.15);
  box-shadow:
    0 0 0 1px rgba(30, 231, 255, 0.06),
    0 4px 24px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

@media (min-width: 640px) {
  .detail-card { padding: 2.5rem 3rem; }
}

@media (min-width: 1024px) {
  .detail-card { padding: 3rem 3.5rem; }
}

/* --- Section heading inside card --- */
.detail-section-heading {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--neon-cyan);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--neon-cyan);
  text-shadow: 0 0 15px rgba(30, 231, 255, 0.3);
}

/* --- Metadata bar (horizontal, replaces sidebar) --- */
.detail-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  background: var(--glass-bg);
  border: var(--border-neon);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  font-family: var(--font-mono);
  margin-bottom: 2rem;
}

.detail-meta-bar .meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.detail-meta-bar .meta-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.detail-meta-bar .meta-value {
  font-size: 0.8rem;
  color: var(--neon-cyan);
  font-weight: 600;
}

.detail-meta-bar .meta-value a {
  color: var(--neon-cyan);
  text-decoration: none;
}

.detail-meta-bar .meta-value a:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.detail-meta-bar .meta-divider {
  width: 1px;
  height: 1.2rem;
  background: var(--glass-border);
  margin: 0 1rem;
}

@media (max-width: 640px) {
  .detail-meta-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .detail-meta-bar .meta-divider { display: none; }
}

/* ==========================================================
   Unified rich-text / prose content styling
   Modeled after Tailwind Typography prose-lg + Medium.com
   Body: 17px / 1.8 line-height / 48rem reading width
   Wide elements (pre, table, img) can stretch to card width
   ========================================================== */
.detail-content {
  color: var(--text-secondary, #b0b8c8);
  font-size: 1.0625rem; /* 17px — Medium standard */
  line-height: 1.8;
  letter-spacing: 0.01em;
  word-break: break-word;
}

/* --- Headings — generous top margin for visual rhythm --- */
.detail-content h1,
.detail-content h2,
.detail-content h3,
.detail-content h4,
.detail-content h5 {
  font-family: var(--font-mono, monospace);
  color: var(--neon-cyan, #1ee7ff);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.detail-content h1 {
  font-size: 2em;        /* ~34px */
  margin-top: 0;
  margin-bottom: 0.9em;
}

.detail-content h2 {
  font-size: 1.5em;      /* ~25.5px */
  margin-top: 2em;       /* big gap before h2 — creates sections */
  margin-bottom: 0.8em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid rgba(30, 231, 255, 0.15);
}

.detail-content h3 {
  font-size: 1.25em;     /* ~21px */
  margin-top: 1.6em;
  margin-bottom: 0.6em;
}

.detail-content h4 {
  font-size: 1.1em;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

/* First element after section heading has no extra gap */
.detail-content h1 + *,
.detail-content h2 + *,
.detail-content h3 + *,
.detail-content h4 + * {
  margin-top: 0;
}

/* --- Paragraphs --- */
.detail-content p {
  margin-top: 0;
  margin-bottom: 1.5em;  /* generous paragraph gap */
}

/* Lead paragraph (first p after heading) */
.detail-content > p:first-child {
  font-size: 1.15em;
  color: var(--text-primary, #e8eaf0);
}

/* --- Links --- */
.detail-content a {
  color: var(--neon-green, #30ffb2);
  text-decoration: underline;
  text-decoration-color: rgba(48, 255, 178, 0.35);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color 0.2s, color 0.2s;
}

.detail-content a:hover {
  color: var(--neon-cyan, #1ee7ff);
  text-decoration-color: currentColor;
}

/* --- Bold / Strong --- */
.detail-content strong,
.detail-content b {
  color: var(--text-primary, #e8eaf0);
  font-weight: 600;
}

/* --- Inline Code --- */
.detail-content code {
  font-family: var(--font-mono, monospace);
  background: rgba(30, 231, 255, 0.06);
  color: var(--neon-green, #30ffb2);
  padding: 0.2em 0.45em;
  border-radius: 0.3em;
  font-size: 0.85em;
  border: 1px solid rgba(30, 231, 255, 0.12);
  white-space: nowrap;
}

/* --- Code Blocks — wider, with accent top bar --- */
.detail-content pre {
  position: relative;
  background: rgba(5, 6, 10, 0.7);
  border: 1px solid rgba(30, 231, 255, 0.12);
  border-radius: 0.5rem;
  padding: 1.5em 1.25em;
  overflow-x: auto;
  margin: 2em -0.5rem; /* slight negative margin to feel wider */
  font-family: var(--font-mono, monospace);
  font-size: 0.8125rem; /* 13px */
  line-height: 1.7;
  tab-size: 2;
}

/* Accent bar at top of code block */
.detail-content pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--neon-cyan, #1ee7ff), var(--neon-green, #30ffb2));
  border-radius: 0.5rem 0.5rem 0 0;
  opacity: 0.6;
}

.detail-content pre code {
  background: none;
  padding: 0;
  border: none;
  color: var(--text-secondary, #b0b8c8);
  font-size: inherit;
  white-space: pre;
}

/* --- Lists --- */
.detail-content ul,
.detail-content ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 1.75em;
}

.detail-content li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  padding-left: 0.25em;
}

.detail-content li::marker {
  color: var(--neon-cyan, #1ee7ff);
}

/* Nested lists tighter */
.detail-content li > ul,
.detail-content li > ol {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

/* --- Blockquotes — prominent callout style --- */
.detail-content blockquote {
  position: relative;
  border-left: 4px solid var(--neon-cyan, #1ee7ff);
  padding: 1em 1.5em;
  margin: 2em 0;
  background: rgba(30, 231, 255, 0.04);
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
  color: var(--text-secondary, #b0b8c8);
}

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

/* --- Images — full width with subtle frame --- */
.detail-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2em auto;
  border-radius: 0.5rem;
  border: 1px solid rgba(30, 231, 255, 0.1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

/* --- Tables — full width, striped, polished --- */
.detail-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 0.875em;
  line-height: 1.6;
  overflow-x: auto;
  display: block;
}

.detail-content thead {
  border-bottom: 2px solid rgba(30, 231, 255, 0.2);
}

.detail-content th {
  background: rgba(30, 231, 255, 0.06);
  color: var(--neon-cyan, #1ee7ff);
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75em 1em;
  text-align: left;
  white-space: nowrap;
}

.detail-content td {
  padding: 0.7em 1em;
  border-bottom: 1px solid rgba(30, 231, 255, 0.06);
}

.detail-content tbody tr:hover {
  background: rgba(30, 231, 255, 0.03);
}

/* --- Horizontal Rule — decorative --- */
.detail-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(30, 231, 255, 0.3), transparent);
  margin: 3em 0;
}

/* --- Definition lists & details --- */
.detail-content dl {
  margin: 1.5em 0;
}

.detail-content dt {
  font-weight: 600;
  color: var(--neon-cyan, #1ee7ff);
  font-family: var(--font-mono, monospace);
  margin-top: 1em;
}

.detail-content dd {
  margin-left: 1.5em;
  margin-bottom: 0.5em;
}

/* --- Navigation (prev/next) --- */
.detail-nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
}

@media (min-width: 768px) {
  .detail-nav { grid-template-columns: 1fr 1fr; }
}

.detail-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.25s ease;
}

.detail-nav-link:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 4px 20px rgba(30, 231, 255, 0.1);
  transform: translateY(-2px);
}

.detail-nav-link .nav-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.detail-nav-link.nav-next {
  justify-content: flex-end;
  text-align: right;
}

/* --- Back button --- */
.detail-back {
  margin-top: 2rem;
  text-align: center;
}

/* --- Light theme overrides --- */
html[data-theme="light"] .detail-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .detail-meta-bar {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .detail-nav-link {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .detail-content pre {
  background: #f6f8fa;
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .detail-content pre::before {
  opacity: 0.4;
}

html[data-theme="light"] .detail-content code {
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.12);
}

html[data-theme="light"] .detail-content blockquote {
  background: rgba(59, 130, 246, 0.04);
}

html[data-theme="light"] .detail-content th {
  background: rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .detail-content tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

/* --- Tablet landscape --- */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  .detail-container { max-width: 90vw; }
  .detail-card { padding: 2rem; }
}

/* --- Tablet portrait --- */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .detail-container { max-width: 92vw; }
}

/* --- Mobile --- */
@media (max-width: 640px) {
  .detail-hero { padding: 2.5rem 0; }
  .detail-title { font-size: 1.5rem; }
  .detail-card { padding: 1.25rem; }
  .detail-body { padding: 1.5rem 0; }
}

/* ==========================================================
   Project Card Tier System — V2 (aggressive visual)
   Strategy: FULL card border + permanent glow + icon tint +
   strong placeholder gradient. No thin accent bar (clipped by overflow:hidden).
   ========================================================== */

/* --- LIVE DEMO tier (green) — most prominent --- */
.tier-live {
  border-color: rgba(48, 255, 178, 0.4) !important;
  box-shadow: 0 0 15px rgba(48, 255, 178, 0.1), inset 0 0 30px rgba(48, 255, 178, 0.03) !important;
}
.tier-live:hover {
  border-color: #30ffb2 !important;
  box-shadow: 0 0 30px rgba(48, 255, 178, 0.25), inset 0 0 40px rgba(48, 255, 178, 0.05) !important;
}
.tier-live .cyber-card-no-image {
  background: linear-gradient(135deg, #060d0a 0%, rgba(48, 255, 178, 0.12) 100%) !important;
}
.tier-live .cyber-card-no-image-icon { color: #30ffb2 !important; opacity: 0.7 !important; }
.tier-live .cyber-card-no-image-text { color: #30ffb2 !important; }
.tier-live .cyber-card-title a { color: #30ffb2 !important; }

/* --- PUBLISHED tier (gold/amber) --- */
.tier-published {
  border-color: rgba(251, 191, 36, 0.35) !important;
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.08), inset 0 0 30px rgba(251, 191, 36, 0.02) !important;
}
.tier-published:hover {
  border-color: #fbbf24 !important;
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.2), inset 0 0 40px rgba(251, 191, 36, 0.04) !important;
}
.tier-published .cyber-card-no-image {
  background: linear-gradient(135deg, #0d0a04 0%, rgba(251, 191, 36, 0.1) 100%) !important;
}
.tier-published .cyber-card-no-image-icon { color: #fbbf24 !important; opacity: 0.7 !important; }
.tier-published .cyber-card-no-image-text { color: #fbbf24 !important; }
.tier-published .cyber-card-title a { color: #fbbf24 !important; }

/* --- OPEN SOURCE tier (cyan, default) --- */
.tier-opensource {
  border-color: rgba(30, 231, 255, 0.15) !important;
}
.tier-opensource:hover {
  border-color: rgba(30, 231, 255, 0.5) !important;
  box-shadow: 0 0 25px rgba(30, 231, 255, 0.15) !important;
}
/* no special placeholder — keeps default cyber.css styling */

/* --- PRIVATE tier (purple, muted) --- */
.tier-private {
  border-color: rgba(168, 85, 247, 0.2) !important;
  opacity: 0.88;
}
.tier-private:hover {
  border-color: rgba(168, 85, 247, 0.45) !important;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.12) !important;
  opacity: 1;
}
.tier-private .cyber-card-no-image {
  background: linear-gradient(135deg, #080610 0%, rgba(168, 85, 247, 0.08) 100%) !important;
}
.tier-private .cyber-card-no-image-icon { color: #c084fc !important; opacity: 0.5 !important; }
.tier-private .cyber-card-no-image-text { color: #c084fc !important; }
.tier-private .cyber-card-title a { color: #c084fc !important; }

/* --- Hide the old accent bar divs (they get clipped anyway) --- */
.tier-accent { display: none; }

/* --- Glow overlay (keep for hover effect) --- */
.tier-glow-live      { background: radial-gradient(circle at 50% 30%, rgba(48, 255, 178, 0.15), transparent 70%); }
.tier-glow-published { background: radial-gradient(circle at 50% 30%, rgba(251, 191, 36, 0.12), transparent 70%); }
.tier-glow-opensource { background: radial-gradient(circle at 50% 50%, rgba(30, 231, 255, 0.1), transparent 70%); }
.tier-glow-private   { background: radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.08), transparent 70%); }

/* --- Card badges container --- */
.card-badges {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 0.4rem;
  z-index: 3;
}

/* --- Tier badges --- */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 0.25rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.tier-badge-live {
  background: rgba(48, 255, 178, 0.2);
  color: #30ffb2;
  border: 1px solid rgba(48, 255, 178, 0.5);
  text-shadow: 0 0 8px rgba(48, 255, 178, 0.4);
}

.tier-badge-published {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.5);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.tier-badge-private {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

/* --- Live dot pulse --- */
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #30ffb2;
  box-shadow: 0 0 6px rgba(48, 255, 178, 0.6);
  animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(48, 255, 178, 0.6); }
  50% { opacity: 0.5; box-shadow: 0 0 12px rgba(48, 255, 178, 0.3); }
}

/* --- Title icon color per tier --- */
.tier-title-icon-live      { color: #30ffb2 !important; }
.tier-title-icon-published { color: #fbbf24 !important; }
.tier-title-icon-opensource { color: var(--neon-cyan, #1ee7ff) !important; }
.tier-title-icon-private   { color: #c084fc !important; }

/* --- Link icon colors --- */
.tier-icon-live { color: #30ffb2 !important; }
.tier-icon-live:hover { color: #10b981 !important; }
.tier-icon-published { color: #fbbf24 !important; }
.tier-icon-published:hover { color: #f59e0b !important; }

/* --- Light theme overrides --- */
html[data-theme="light"] .tier-live {
  border-color: rgba(16, 185, 129, 0.3) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.08) !important;
}
html[data-theme="light"] .tier-live:hover {
  border-color: #059669 !important;
  box-shadow: 0 2px 20px rgba(16, 185, 129, 0.15) !important;
}
html[data-theme="light"] .tier-live .cyber-card-no-image {
  background: linear-gradient(135deg, #f0fdf9 0%, rgba(16, 185, 129, 0.08) 100%) !important;
}
html[data-theme="light"] .tier-live .cyber-card-title a { color: #059669 !important; }

html[data-theme="light"] .tier-published {
  border-color: rgba(217, 119, 6, 0.25) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.06) !important;
}
html[data-theme="light"] .tier-published:hover {
  border-color: #d97706 !important;
  box-shadow: 0 2px 20px rgba(245, 158, 11, 0.12) !important;
}
html[data-theme="light"] .tier-published .cyber-card-no-image {
  background: linear-gradient(135deg, #fffbeb 0%, rgba(245, 158, 11, 0.08) 100%) !important;
}
html[data-theme="light"] .tier-published .cyber-card-title a { color: #d97706 !important; }

html[data-theme="light"] .tier-private {
  border-color: rgba(124, 58, 237, 0.15) !important;
  opacity: 0.85;
}
html[data-theme="light"] .tier-private .cyber-card-no-image {
  background: linear-gradient(135deg, #faf5ff 0%, rgba(124, 58, 237, 0.05) 100%) !important;
}
html[data-theme="light"] .tier-private .cyber-card-title a { color: #7c3aed !important; }

html[data-theme="light"] .tier-badge-live {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.35);
}
html[data-theme="light"] .tier-badge-published {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.35);
}
html[data-theme="light"] .tier-badge-private {
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
  border-color: rgba(124, 58, 237, 0.2);
}
html[data-theme="light"] .live-dot { background: #059669; box-shadow: 0 0 6px rgba(5, 150, 105, 0.5); }

/* ==========================================================
   Pagination Component — GitHub/StackOverflow style
   1 ... (n-1) [n] (n+1) ... last  |  GO_TO() input
   ========================================================== */

.pagination-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border, rgba(30, 231, 255, 0.08));
}

.pagination-inner {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* --- Prev/Next buttons --- */
.pg-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 0.5rem;
  border: 1px solid var(--glass-border, rgba(30, 231, 255, 0.12));
  background: var(--glass-bg, rgba(10, 15, 30, 0.4));
  color: var(--text-secondary, #b0b8c8);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.pg-btn:hover:not(.pg-disabled) {
  border-color: var(--neon-cyan, #1ee7ff);
  color: var(--neon-cyan, #1ee7ff);
  background: rgba(30, 231, 255, 0.06);
}

.pg-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- Page numbers --- */
.pg-numbers {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pg-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  color: var(--text-secondary, #b0b8c8);
  text-decoration: none;
  transition: all 0.2s ease;
}

.pg-num:hover:not(.pg-active) {
  border-color: var(--glass-border, rgba(30, 231, 255, 0.15));
  background: rgba(30, 231, 255, 0.04);
  color: var(--neon-cyan, #1ee7ff);
}

.pg-active {
  background: var(--neon-cyan, #1ee7ff) !important;
  color: #000 !important;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(30, 231, 255, 0.3);
}

.pg-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2.25rem;
  font-size: 1rem;
  color: var(--text-muted, #6b7280);
  letter-spacing: 0.15em;
  user-select: none;
}

/* --- Jump to page --- */
.pg-jump {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
}

.pg-jump-input {
  width: 3rem;
  padding: 0.3rem 0.4rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  border-radius: 0.375rem;
  border: 1px solid var(--glass-border, rgba(30, 231, 255, 0.15));
  background: var(--glass-bg, rgba(10, 15, 30, 0.4));
  color: var(--neon-cyan, #1ee7ff);
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}

.pg-jump-input::-webkit-inner-spin-button,
.pg-jump-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pg-jump-input:focus {
  border-color: var(--neon-cyan, #1ee7ff);
  box-shadow: 0 0 8px rgba(30, 231, 255, 0.15);
}

.pg-jump-total {
  color: var(--text-muted, #6b7280);
  margin-left: 0.2rem;
}

/* --- Page info (x-y of z) --- */
.pg-info {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  color: var(--text-muted, #6b7280);
  letter-spacing: 0.03em;
}

/* --- Light theme --- */
html[data-theme="light"] .pg-btn {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
  color: #4b5563;
}

html[data-theme="light"] .pg-btn:hover:not(.pg-disabled) {
  border-color: #2aa198;
  color: #2aa198;
  background: rgba(42, 161, 152, 0.06);
}

html[data-theme="light"] .pg-active {
  background: #2aa198 !important;
  color: #fff !important;
  box-shadow: 0 0 8px rgba(42, 161, 152, 0.3);
}

html[data-theme="light"] .pg-num:hover:not(.pg-active) {
  border-color: rgba(0, 0, 0, 0.1);
  color: #2aa198;
}

html[data-theme="light"] .pg-jump-input {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.15);
  color: #2aa198;
}

html[data-theme="light"] .pg-jump-input:focus {
  border-color: #2aa198;
}

/* --- Mobile responsive --- */
@media (max-width: 640px) {
  .pagination-inner { gap: 0.2rem; }
  .pg-btn { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
  .pg-btn-text { display: none; }
  .pg-num { min-width: 2rem; height: 2rem; font-size: 0.75rem; }
  .pg-ellipsis { width: 1.5rem; }
}

/* ============================================
   打印样式
   ============================================ */
@media print {
  .navbar,
  .footer,
  .btn {
    display: none !important;
  }

  .blog-post {
    max-width: none !important;
    margin: 0 !important;
  }
}
