/* ============================================
   DESIGN SYSTEM — Modern Dark Blog
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Colors - Dark Theme (Sleeker, minimalist) */
  --bg-primary: #0f1115;
  --bg-secondary: #16181d;
  --bg-tertiary: #1e2128;
  --bg-card: rgba(22, 24, 29, 0.7);
  --bg-card-hover: rgba(28, 31, 38, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.02);
  --bg-glass-border: rgba(255, 255, 255, 0.05);

  --text-primary: #f0f2f5;
  --text-secondary: #a1a5b0;
  --text-tertiary: #757a85;
  --text-muted: #4e535e;

  /* Sophisticated Green Accent */
  --accent-primary: #10b981;
  --accent-secondary: #3b82f6;
  --accent-gradient: linear-gradient(135deg, #10b981, #14b8a6, #3b82f6);
  --accent-gradient-text: linear-gradient(135deg, #34d399, #60a5fa);
  --accent-glow: rgba(16, 185, 129, 0.15);

  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-hover: rgba(255, 255, 255, 0.12);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(16, 185, 129, 0.08);

  /* Typography */
  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --container-max: 1100px;
  --container-narrow: 760px;
  --navbar-height: 64px;
}

/* --- Light Theme --- */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-glass: rgba(255, 255, 255, 0.6);
  --bg-glass-border: rgba(0, 0, 0, 0.05);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-muted: #94a3b8;

  --accent-primary: #059669;
  --accent-secondary: #0ea5e9;
  --accent-gradient: linear-gradient(135deg, #059669, #0891b2, #0ea5e9);
  --accent-gradient-text: linear-gradient(135deg, #059669, #0ea5e9);
  --accent-glow: rgba(5, 150, 105, 0.08);

  --border-color: rgba(0, 0, 0, 0.06);
  --border-color-hover: rgba(0, 0, 0, 0.12);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 40px rgba(5, 150, 105, 0.06);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  background-image:
    radial-gradient(var(--bg-glass-border) 1px, transparent 1px),
    radial-gradient(var(--bg-glass-border) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: var(--accent-primary);
  color: white;
}



/* --- Layout --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container-narrow {
  max-width: var(--container-narrow);
}

/* --- Reading Progress Bar --- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent-gradient);
  z-index: 1001;
  width: 0%;
  transition: width 100ms linear;
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  z-index: 1000;
  transition: all var(--transition-base);
  background: transparent;
}

.navbar.scrolled {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--bg-glass-border);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-weight: 700;
  font-size: 1.15rem;
  transition: all var(--transition-fast);
  color: var(--text-primary);
  text-decoration: none;
}

.logo-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--accent-primary);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
  transition: all var(--transition-fast) cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-logo:hover .logo-avatar {
  transform: rotate(8deg) scale(1.1);
  border-color: var(--accent-secondary);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.logo-icon {
  display: none; /* Deprecated in favor of logo-avatar */
}

/* Footer Brand */
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.footer-brand .logo-avatar {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.nav-link.active {
  color: var(--accent-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  border: 1px solid var(--border-color);
}

.theme-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--border-color-hover);
  transform: scale(1.05);
}

[data-theme="dark"] .icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: block;
}

[data-theme="light"] .icon-sun {
  display: block;
}

[data-theme="light"] .icon-moon {
  display: none;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 38px;
  height: 38px;
  border: none;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--border-color);
}

.mobile-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* --- Author Profile --- */
.author-profile {
  position: relative;
  padding: calc(var(--navbar-height) + var(--space-3xl)) 0 var(--space-2xl);
  z-index: 1;
}

.profile-content {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  max-width: 800px;
  animation: fadeInUp 0.6s ease;
}

.profile-avatar {
  flex-shrink: 0;
}

.profile-avatar img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-card);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

.profile-avatar img:hover {
  transform: scale(1.05) rotate(-3deg);
  box-shadow: var(--shadow-glow);
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
}

/* --- Status Dot --- */
.status-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 16px;
  cursor: help;
}

.status-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  background-color: #10b981;
  border-radius: 50%;
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #10b981;
  border-radius: 50%;
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  z-index: -1;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  100% {
    transform: scale(3.5);
    opacity: 0;
  }
}

.status-tooltip {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-md);
  letter-spacing: normal;
}

.status-wrapper:hover .status-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.status-tooltip::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: var(--text-primary);
}

.profile-bio {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.profile-links {
  display: flex;
  gap: var(--space-md);
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--transition-base);
}

.social-link:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.social-link svg {
  color: var(--text-secondary);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.social-link:hover svg {
  color: var(--accent-primary);
  transform: scale(1.1) rotate(5deg);
}

/* --- Posts Section --- */
.main-content {
  position: relative;
  z-index: 1;
  padding-bottom: var(--space-4xl);
}

.posts-section {
  animation: fadeInUp 0.6s ease 0.4s both;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2xl);
}

.section-title {
  font-size: 1.4rem;
  font-weight: 600;
}

.section-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

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

/* --- Post Cards --- */
.posts-grid {
  display: grid;
  gap: var(--space-lg);
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-2xl);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-slow);
  z-index: 0;
}

.post-card::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: var(--bg-card);
  border-radius: calc(var(--radius-lg) - 1px);
  z-index: 1;
  transition: background var(--transition-base);
}

.post-card>* {
  position: relative;
  z-index: 2;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.post-card:hover::before {
  opacity: 1;
}

.post-card:hover::after {
  background: var(--bg-card-hover);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}

.separator {
  opacity: 0.4;
}

.post-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: var(--space-sm);
  transition: color var(--transition-fast);
}

.post-card:hover .post-card-title {
  color: var(--accent-primary);
}

.post-card-summary {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* --- Tags --- */
.tag {
  display: inline-block;
  padding: 2px var(--space-sm);
  background: var(--accent-glow);
  border: 1px solid var(--accent-glow);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--accent-primary);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.tag:hover {
  background: var(--accent-primary);
  color: var(--bg-primary);
  transform: translateY(-1px);
}

/* --- Article Page --- */
.article-page {
  position: relative;
  z-index: 1;
  padding-top: calc(var(--navbar-height) + var(--space-3xl));
  padding-bottom: var(--space-4xl);
  min-height: 100vh;
}

.article-header {
  margin-bottom: var(--space-3xl);
  animation: fadeInUp 0.6s ease;
}

.back-link {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  transition: color var(--transition-fast);
}

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

.article-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.02em;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* --- Article Content (Prose) --- */
.prose {
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--text-primary);
  animation: fadeInUp 0.6s ease 0.1s both;
  letter-spacing: 0.01em;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  margin-top: 2em;
  margin-bottom: 0.75em;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.prose h1 {
  font-size: 2.25rem;
}

.prose h2 {
  font-size: 1.75rem;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.prose h3 {
  font-size: 1.5rem;
}

.prose h4 {
  font-size: 1.25rem;
}

.prose p {
  margin-bottom: 1.5em;
  color: var(--text-secondary);
}

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

.prose a {
  color: var(--accent-primary);
  text-decoration: none;
  position: relative;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.prose a::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--accent-primary);
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

.prose a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

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

.prose ul,
.prose ol {
  margin-bottom: 1.5em;
  padding-left: 1.5em;
  color: var(--text-secondary);
}

.prose li {
  margin-bottom: 0.5em;
  padding-left: 0.25em;
}

.prose li::marker {
  color: var(--accent-primary);
  font-weight: bold;
}

.prose blockquote {
  margin: 2em 0;
  padding: var(--space-lg) var(--space-xl);
  background: var(--bg-card);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-style: italic;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.prose blockquote::before {
  content: '"';
  position: absolute;
  top: 5px;
  left: 15px;
  font-size: 4rem;
  color: var(--accent-glow);
  font-family: serif;
  line-height: 1;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--accent-glow);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--accent-primary);
  word-break: break-word;
}

.prose pre {
  margin: 2em 0;
  padding: calc(var(--space-xl) + 1.5rem) var(--space-xl) var(--space-xl);
  background: #0d1117 !important;
  border-radius: var(--radius-md);
  overflow-x: auto;
  border: 1px solid var(--border-color);
  position: relative;
  box-shadow: var(--shadow-md);
}

.prose pre::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 15px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 20px 0 0 #f59e0b, 40px 0 0 #10b981;
}

.prose pre code {
  background: none;
  padding: 0;
  border: none;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #e6edf3;
}

.prose table {
  width: 100%;
  margin: 2em 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.prose th,
.prose td {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

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

.prose th {
  background: var(--bg-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.prose tr:hover td {
  background: var(--bg-glass);
}

.prose img {
  border-radius: var(--radius-md);
  margin: 2em 0;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
  display: block;
  max-width: 100%;
}

.prose img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

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

/* Task Lists in Prose */
.prose ul li:has(input[type="checkbox"]) {
  list-style: none;
  margin-left: -1.75em;
  display: flex;
  align-items: flex-start;
}

.prose ul li input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 1.25em;
  height: 1.25em;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-color);
  border-radius: 4px;
  margin-right: 0.5em;
  margin-top: 0.25em;
  position: relative;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.prose ul li input[type="checkbox"]:hover {
  border-color: var(--accent-primary);
}

.prose ul li input[type="checkbox"]:checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.prose ul li input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 40%;
  left: 50%;
  width: 0.35em;
  height: 0.65em;
  border: solid var(--bg-primary);
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
  animation: checkmark-in 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes checkmark-in {
  0% {
    transform: translate(-50%, -50%) rotate(45deg) scale(0);
    opacity: 0;
  }

  100% {
    transform: translate(-50%, -50%) rotate(45deg) scale(1);
    opacity: 1;
  }
}

.prose ul li input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.prose ul li input[type="checkbox"]:disabled:hover {
  border-color: var(--border-color);
}

.prose ul li input[type="checkbox"]:checked:disabled:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* ============================================
   EMBED CARDS — Multi-Platform Card System
   ============================================ */

/* --- Base Card (Glassmorphism & Neumorphism) --- */
.embed-card {
  display: block;
  margin: 2em 0;
  padding: calc(var(--space-lg) + 0.2rem) var(--space-xl);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow-sm);
}

/* Ambient hover glow base */
.embed-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 0;
  pointer-events: none;
}

/* ============================================
   EMBED CARDS — Multi-Platform Card System (Elite Edition)
   ============================================ */

/* --- Base Card (Glass & Elite Neumorphism) --- */
.embed-card {
  display: block;
  margin: 2.5em 0;
  padding: var(--space-xl);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Ambient Brand Glow */
.embed-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, var(--brand-glow, transparent), transparent 70%);
}

/* Left Brand Stripe (Enhanced) */
.embed-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 4px;
  border-radius: 0 100px 100px 0;
  background: var(--brand-color, var(--accent-primary));
  opacity: 0.6;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 15px var(--brand-color, transparent);
}

.embed-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 
    0 30px 60px -12px rgba(0, 0, 0, 0.3),
    0 18px 36px -18px rgba(0, 0, 0, 0.35),
    0 0 25px -5px var(--brand-glow, transparent);
  border-color: var(--brand-color, var(--accent-primary));
  background: var(--bg-card-hover);
}

.embed-card:hover::before {
  opacity: 0.4;
}

.embed-card:hover::after {
  top: 0;
  height: 100%;
  opacity: 1;
  width: 6px;
}

/* Elite Watermark Animation */
.embed-card-watermark {
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 150px;
  height: 150px;
  opacity: 0.02;
  pointer-events: none;
  transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 0;
  filter: grayscale(1) blur(1px);
  transform: rotate(20deg) scale(0.9);
}

.embed-card:hover .embed-card-watermark {
  opacity: 0.15;
  transform: scale(1.2) rotate(-5deg) translate(-15px, -15px);
  filter: grayscale(0) blur(0);
}

/* Content Layout */
.embed-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  position: relative;
  z-index: 1;
}

.embed-card-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: white;
  padding: 4px;
}

[data-theme="dark"] .embed-card-icon {
  background: rgba(255, 255, 255, 0.9);
}

.embed-card:hover .embed-card-icon {
  transform: rotate(15deg) scale(1.2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.embed-card-badge {
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  margin-left: auto;
  background: rgba(var(--brand-rgb, 0, 0, 0), 0.1);
  color: var(--brand-color, var(--text-secondary));
  border: 1px solid rgba(var(--brand-rgb, 0, 0, 0), 0.2);
  backdrop-filter: blur(10px);
}

.embed-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.embed-card-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
  position: relative;
  z-index: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0.85;
}

.embed-card-footer {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  font-size: 0.85rem;
  color: var(--text-tertiary);
  position: relative;
  z-index: 1;
  font-weight: 600;
}

.embed-card-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s ease;
}

.embed-card:hover .embed-card-stat {
  color: var(--text-secondary);
}

.embed-card-lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
}

/* --- Brand Engine --- */
.embed-card--github { --brand-color: #6e5494; --brand-rgb: 110, 84, 148; --brand-glow: rgba(110, 84, 148, 0.3); }
.embed-card--gitee  { --brand-color: #c71d23; --brand-rgb: 199, 29, 35; --brand-glow: rgba(199, 29, 35, 0.3); }
.embed-card--docker { --brand-color: #2496ed; --brand-rgb: 36, 150, 237; --brand-glow: rgba(36, 150, 237, 0.3); }
.embed-card--youtube { --brand-color: #ff0000; --brand-rgb: 255, 0, 0; --brand-glow: rgba(255, 0, 0, 0.3); }
.embed-card--bilibili { --brand-color: #fb7299; --brand-rgb: 251, 114, 153; --brand-glow: rgba(251, 114, 153, 0.3); }
.embed-card--douyin { --brand-color: #fe2c55; --brand-rgb: 254, 44, 85; --brand-glow: rgba(254, 44, 85, 0.3); }

/* Elite Video Thumb */
.embed-card-thumb {
  width: 100%;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  aspect-ratio: 16/9;
  object-fit: cover;
  position: relative;
  z-index: 1;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.embed-card:hover .embed-card-thumb {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

/* --- Article Footer --- */
.article-footer {
  margin-top: var(--space-3xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--border-color);
}

.share-section {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.share-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.share-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: var(--accent-glow);
}

/* --- Comments --- */
.comments-section {
  margin-top: var(--space-3xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--border-color);
}

.comments-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: var(--space-xl);
}

.giscus-container {
  min-height: 100px;
}

.comments-placeholder {
  padding: var(--space-2xl);
  background: var(--bg-glass);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.9rem;
  line-height: 2;
}

.comments-placeholder a {
  color: var(--accent-primary);
  text-decoration: underline;
}

/* --- Archive Page --- */
.archive-page {
  position: relative;
  z-index: 1;
  padding-top: calc(var(--navbar-height) + var(--space-3xl));
  padding-bottom: var(--space-4xl);
  min-height: 100vh;
}

.archive-header {
  margin-bottom: var(--space-3xl);
  animation: fadeInUp 0.6s ease;
}

.page-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.page-subtitle {
  color: var(--text-tertiary);
  font-size: 0.95rem;
}

.archive-year-group {
  margin-bottom: var(--space-3xl);
  animation: fadeInUp 0.6s ease 0.1s both;
}

.archive-year {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.archive-year::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.archive-item {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.archive-item:hover {
  background: var(--bg-card);
}

.archive-item time {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  min-width: 100px;
}

.archive-title {
  flex: 1;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.archive-item:hover .archive-title {
  color: var(--accent-primary);
}

.archive-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--transition-fast);
}

.archive-item:hover .archive-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* --- Footer --- */
.footer {
  position: relative;
  z-index: 1;
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: var(--space-md);
}

.footer-text {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  margin-bottom: var(--space-sm);
}

.footer-copyright {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* --- 404 Page --- */
.page-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: var(--space-xl);
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  background: var(--accent-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--space-md);
}

.error-message {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.error-description {
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
}

.btn-home {
  display: inline-flex;
  padding: var(--space-sm) var(--space-xl);
  background: var(--accent-gradient);
  color: white;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.3);
}

.btn-home:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(124, 92, 255, 0.4);
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

/* --- Global Loader --- */
.global-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.global-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.global-loader .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- Toast Notification --- */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: var(--space-sm) var(--space-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  transition: all var(--transition-base);
  backdrop-filter: blur(20px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
  :root {
    --space-xl: 1.25rem;
    --space-2xl: 1.75rem;
    --space-3xl: 2rem;
    --space-4xl: 2.5rem;
  }

  .container {
    padding: 0 var(--space-md);
    width: 100%;
  }

  .nav-container {
    padding: 0 var(--space-md);
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: var(--space-md);
    gap: 0;
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    padding: var(--space-md);
    width: 100%;
    text-align: center;
    border-radius: var(--radius-md);
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .author-profile {
    padding: calc(var(--navbar-height) + var(--space-xl)) 0 var(--space-lg);
  }

  .profile-content {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }

  .profile-avatar img {
    width: 90px;
    height: 90px;
  }

  .profile-name {
    font-size: 1.6rem;
    justify-content: center;
    flex-wrap: wrap;
  }

  .status-wrapper {
    margin-left: 8px;
  }

  .profile-bio {
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
  }

  .profile-links {
    justify-content: center;
  }

  .social-link {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.85rem;
  }

  .section-header {
    margin-bottom: var(--space-md);
  }

  .section-title {
    font-size: 1.2rem;
  }

  .post-card {
    padding: var(--space-md);
  }

  .post-card-title {
    font-size: 1.05rem;
  }

  .post-card-summary {
    font-size: 0.9rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .article-title {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
  }

  .prose {
    font-size: 1rem;
  }

  .prose pre {
    padding: var(--space-md);
    margin-left: calc(-1 * var(--space-md));
    margin-right: calc(-1 * var(--space-md));
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .prose blockquote {
    margin-left: 0;
    margin-right: 0;
  }

  .prose table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .archive-item {
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-md);
  }

  .archive-item time {
    min-width: auto;
    font-size: 0.8rem;
  }

  .share-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-content {
    padding: var(--space-lg) 0;
  }

  .github-card {
    padding: var(--space-md);
  }
}

@media (max-width: 480px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .profile-name {
    font-size: 1.4rem;
  }

  .post-card-meta {
    font-size: 0.75rem;
  }

  .tag {
    font-size: 0.7rem;
    padding: 2px 8px;
  }
}

/* --- Print Styles --- */
@media print {

  .navbar,
  .ambient-bg,
  .reading-progress,
  .footer,
  .share-section,
  .comments-section,
  .theme-toggle,
  .back-link,
  .mobile-menu-toggle {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .article-page {
    padding-top: 0;
  }

  .prose pre {
    border: 1px solid #ddd;
  }
}