/* ============================================
   Stardust Theme - Anime/Kawaii Dark Style
   ============================================ */

:root {
  /* Dark theme (default) */
  --bg: #0f0e17;
  --bg-card: #1a1a2e;
  --bg-card-hover: #222244;
  --bg-nav: rgba(15, 14, 23, 0.85);
  --text: #e4e4e7;
  --text-muted: #9ca3af;
  --text-heading: #f5f5f7;
  --accent: #a78bfa;
  --accent2: #f472b6;
  --accent3: #67e8f9;
  --gradient: linear-gradient(135deg, #a78bfa 0%, #f472b6 50%, #67e8f9 100%);
  --gradient-card: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
  --border: rgba(167, 139, 250, 0.15);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(167, 139, 250, 0.15);
  --radius: 16px;
  --radius-sm: 8px;
}

[data-theme="light"] {
  --bg: #faf5ff;
  --bg-card: #ffffff;
  --bg-card-hover: #fdf2f8;
  --bg-nav: rgba(250, 245, 255, 0.85);
  --text: #374151;
  --text-muted: #6b7280;
  --text-heading: #1f2937;
  --accent: #7c3aed;
  --accent2: #ec4899;
  --accent3: #06b6d4;
  --border: rgba(124, 58, 237, 0.15);
  --shadow: 0 8px 32px rgba(124, 58, 237, 0.1);
  --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.08);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #fdf2f8 100%);
}

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

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

body {
  font-family: 'Noto Sans SC', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent2); }

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

/* ---- Particles Canvas ---- */
#particles-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-heading);
}

.logo-icon {
  font-size: 1.5rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.2) rotate(15deg); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
  background: rgba(167, 139, 250, 0.1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

.lang-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s;
  color: var(--text);
  font-family: inherit;
}

.lang-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s;
  color: var(--text);
}

.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

/* Google Translate bar cleanup */
.goog-te-banner-frame, .skiptranslate { display: none !important; }
body { top: 0 !important; }

/* ---- Main ---- */
.main {
  position: relative;
  z-index: 1;
  padding-top: 64px;
  min-height: 100vh;
}

/* ---- Hero ---- */
.hero {
  padding: 6rem 1.5rem 4rem;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-avatar {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
}

.avatar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  background: var(--gradient);
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin 4s linear infinite;
}

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

.avatar-text {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  margin-bottom: 1rem;
}

.title-line {
  display: block;
  font-size: 2.8rem;
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.title-sub {
  display: block;
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.3em;
  margin-top: 0.5rem;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.stat-item { text-align: center; }

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(167, 139, 250, 0.35);
  color: #fff;
}

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

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

/* ---- Sections ---- */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.title-icon {
  font-size: 1.4rem;
}

.section-more {
  text-align: center;
  margin-top: 2rem;
}

/* ---- Page Header ---- */
.page-header {
  text-align: center;
  padding: 4rem 1.5rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.page-title {
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.page-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ---- Post Cards ---- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.3s;
}

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

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

.post-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.post-category {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.75rem;
  border-radius: 50px;
  background: color-mix(in srgb, var(--cat-color, var(--accent)) 15%, transparent);
  color: var(--cat-color, var(--accent));
  border: 1px solid color-mix(in srgb, var(--cat-color, var(--accent)) 30%, transparent);
}

.post-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.post-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.post-card-title a {
  color: var(--text-heading);
}

.post-card-title a:hover {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.post-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.8rem;
  color: var(--accent);
  opacity: 0.8;
  transition: opacity 0.2s;
}

.tag:hover { opacity: 1; color: var(--accent2); }

.post-list {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-card-wide {
  max-width: 100%;
}

/* ---- Filter Bar ---- */
.filter-bar {
  max-width: 900px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-btn:hover, .filter-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(167, 139, 250, 0.1);
}

/* ---- Project Cards ---- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.project-grid-full {
  padding: 0 1.5rem;
}

.project-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.3s;
  position: relative;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.project-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-heading);
}

.project-version {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  background: rgba(103, 232, 249, 0.15);
  color: var(--accent3);
  border: 1px solid rgba(103, 232, 249, 0.3);
}

.project-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.project-desc-large {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.project-status {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.75rem;
  border-radius: 50px;
  margin-bottom: 1rem;
}

.status-active {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.status-beta {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-planned {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.status-completed {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

/* ---- Progress Bar ---- */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  overflow: visible;
  position: relative;
  margin-bottom: 1rem;
}

.progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 50px;
  transition: width 1s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: -4px;
  top: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 10px var(--accent);
}

.progress-text {
  position: absolute;
  right: 0;
  top: -22px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.progress-bar-large {
  height: 12px;
  margin: 1rem 0 2rem;
}

.project-latest-update {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-style: italic;
}

.project-link {
  font-weight: 600;
  font-size: 0.9rem;
}

.project-links {
  margin-bottom: 2rem;
}

/* ---- Progress Section in Project Detail ---- */
.project-progress-section {
  max-width: 600px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.project-progress-section h3 {
  color: var(--text-heading);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

/* ---- Timeline ---- */
.timeline-section {
  max-width: 700px;
  margin: 2rem auto;
}

.timeline-section h3 {
  color: var(--text-heading);
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  text-align: center;
}

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gradient);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 1.5rem;
}

.timeline-dot {
  position: absolute;
  left: -1.55rem;
  top: 0.5rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 10px var(--accent);
}

.timeline-item:first-child .timeline-dot {
  background: var(--accent2);
  box-shadow: 0 0 10px var(--accent2);
  width: 18px;
  height: 18px;
  left: -1.7rem;
}

.timeline-content {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.timeline-version {
  font-weight: 700;
  color: var(--accent3);
  font-size: 0.95rem;
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.timeline-content p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---- Category Grid ---- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s;
  text-align: center;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--cat-color, var(--accent));
  box-shadow: 0 8px 25px color-mix(in srgb, var(--cat-color, var(--accent)) 20%, transparent);
  color: var(--text-heading);
}

.category-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-heading);
}

.category-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---- Tag Cloud ---- */
.tag-cloud {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.tag-cloud-item {
  padding: 0.5rem 1rem;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  transition: all 0.3s;
  white-space: nowrap;
}

.tag-cloud-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.tag-cloud-item sup {
  font-size: 0.7em;
  color: var(--accent2);
  margin-left: 2px;
}

/* ---- Article ---- */
.article {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.article-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.article-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.article-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.article-tags {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.article-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* ---- Markdown Body ---- */
.markdown-body {
  font-size: 1.05rem;
  line-height: 1.8;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  color: var(--text-heading);
  font-weight: 700;
  margin: 2rem 0 1rem;
  line-height: 1.3;
}

.markdown-body h1 { font-size: 1.8rem; }
.markdown-body h2 { font-size: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.markdown-body h3 { font-size: 1.25rem; }

.markdown-body p { margin-bottom: 1.2rem; }

.markdown-body img {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

.markdown-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(167, 139, 250, 0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
}

.markdown-body code {
  font-family: 'Fira Code', monospace;
  font-size: 0.9em;
  background: rgba(167, 139, 250, 0.1);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent);
}

.markdown-body pre {
  margin: 1.5rem 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.markdown-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.markdown-body ul, .markdown-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.2rem;
}

.markdown-body li { margin-bottom: 0.4rem; }

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

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

.markdown-body th {
  background: rgba(167, 139, 250, 0.1);
  font-weight: 600;
}

.markdown-body hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

/* ---- About ---- */
.about-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.about-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
}

.about-card h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-heading);
  margin: 1.5rem 0 0.5rem;
}

.about-tagline {
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.about-bio {
  text-align: left;
  max-width: 500px;
  margin: 0 auto 2rem;
}

.about-bio p {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.about-skills {
  text-align: left;
  max-width: 500px;
  margin: 0 auto;
}

.about-skills h3 {
  color: var(--text-heading);
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.skill-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  min-width: 160px;
}

.skill-item .progress-bar {
  margin: 0;
  height: 6px;
}

.skill-item .progress-fill::after {
  width: 12px;
  height: 12px;
  right: -3px;
  top: -3px;
}

/* ---- 404 Error Page ---- */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: 2rem;
}

.error-content {
  text-align: center;
  max-width: 500px;
}

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

.error-star {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.error-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
}

.error-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.error-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Changelog ---- */
.changelog-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.changelog-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.changelog-list li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.changelog-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
  top: 0.35rem;
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ---- TOC Sidebar ---- */
.article-layout {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.article-layout.has-toc {
  max-width: 1100px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  align-items: start;
}

.article-layout .article {
  max-width: 100%;
  padding: 2rem 1.5rem 4rem;
}

.toc-sidebar {
  position: sticky;
  top: 84px;
  padding: 1rem 0;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.toc-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--border);
}

.toc-link {
  display: block;
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: all 0.2s;
}

.toc-link:hover, .toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.toc-level-3 { padding-left: 1.5rem; font-size: 0.78rem; }
.toc-level-4 { padding-left: 2.25rem; font-size: 0.75rem; }

/* ---- Reading Time ---- */
.reading-time {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---- Search ---- */
.search-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.3s;
  color: var(--text);
}

.search-toggle:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  padding: 10vh 1rem 1rem;
  align-items: flex-start;
  justify-content: center;
}

.search-modal.open {
  display: flex;
}

.search-modal-inner {
  width: 100%;
  max-width: 600px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.search-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.search-input {
  flex: 1;
  padding: 1rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.1rem;
  font-family: inherit;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  padding: 1rem;
  cursor: pointer;
  transition: color 0.2s;
}

.search-close:hover {
  color: var(--accent);
}

.search-results {
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-result-item {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  text-decoration: none;
}

.search-result-item:hover {
  background: rgba(167, 139, 250, 0.1);
}

.search-result-title {
  font-weight: 600;
  color: var(--text-heading);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.search-result-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.search-result-meta .post-category {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
}

.search-result-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.search-hint {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---- Back to Top ---- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  z-index: 50;
  box-shadow: 0 4px 15px rgba(167, 139, 250, 0.3);
  pointer-events: none;
}

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

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.5);
}

/* ---- Mobile overrides ---- */
@media (max-width: 1024px) {
  .article-layout.has-toc {
    grid-template-columns: 1fr;
  }
  .toc-sidebar {
    display: none;
  }
}

/* ---- Footer ---- */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

.footer-decor {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.5em;
}

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

.footer-sub {
  margin-top: 0.5rem;
  font-size: 0.8rem !important;
  opacity: 0.6;
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: none;
  }

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

  .hero { padding: 3rem 1rem 2rem; }
  .title-line { font-size: 2rem; }
  .hero-stats { gap: 1.5rem; }
  .stat-num { font-size: 1.5rem; }

  .post-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }

  .article-title { font-size: 1.6rem; }
  .article { padding: 1rem 1rem 3rem; }

  .skill-item { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .skill-name { min-width: auto; }
  .skill-item .progress-bar { width: 100%; }

  .timeline { padding-left: 1.5rem; }
}

@media (max-width: 480px) {
  .title-line { font-size: 1.6rem; }
  .hero-stats { flex-direction: column; gap: 1rem; }
  .category-grid { grid-template-columns: 1fr; }
}
