/* ============================================
   幻简实验室 · 高级版 Design System
   ============================================ */
:root {
  --bg-deep: #07070d;
  --bg-primary: #0b0b14;
  --bg-secondary: #11111e;
  --bg-card: #141420;
  --bg-card-hover: #1a1a2a;
  --bg-elevated: #1c1c2e;

  --gold-300: #d4b87a;
  --gold-400: #c8a45c;
  --gold-500: #b8923e;
  --gold-600: #a07d30;

  --purple-300: #9b8feb;
  --purple-400: #7f77dd;
  --purple-500: #655bc9;
  --purple-600: #534ab7;

  --text-primary: #e8e6e0;
  --text-secondary: #a8a69e;
  --text-tertiary: #6b6a66;
  --text-muted: #4a4946;
  --text-gold: var(--gold-400);

  --border-subtle: rgba(255,255,255,0.05);
  --border-default: rgba(255,255,255,0.08);
  --border-accent: rgba(196,164,92,0.2);

  --font-sans: "Inter", -apple-system, "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "STSong", Georgia, "Songti SC", serif;
  --font-mono: "JetBrains Mono", "Consolas", "Fira Code", monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
}
::selection { background: rgba(83,74,183,0.4); color: #fff; }

a { color: var(--gold-400); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-300); }
img { max-width: 100%; display: block; }

.container { max-width: 900px; margin: 0 auto; padding: 0 28px; }
@media (max-width:640px) { .container { padding: 0 20px; } }

/* ---- Noise Texture ---- */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ============================================
   Header
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(7,7,13,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}
.logo .accent { color: var(--gold-400); }
.logo .dot { color: var(--text-muted); margin: 0 2px; }
.logo .light { font-weight: 300; color: var(--text-tertiary); }

.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a {
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--text-secondary); }
.nav-cta {
  background: linear-gradient(135deg, var(--gold-600), var(--gold-400));
  color: #0b0b14 !important;
  padding: 6px 18px;
  border-radius: 20px;
  font-weight: 600 !important;
  font-size: 12px !important;
  letter-spacing: 0.5px;
  transition: opacity var(--transition) !important;
}
.nav-cta:hover { opacity: 0.9; color: #0b0b14 !important; }

/* ============================================
   Hero
   ============================================ */
.hero {
  padding: 64px 0 48px;
  text-align: center;
  position: relative;
}
.hero::after {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(83,74,183,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--gold-400);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 24px;
  border: 1px solid var(--border-accent);
  padding: 5px 16px;
  border-radius: 20px;
  background: rgba(196,164,92,0.04);
}
.hero h1 {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 18px;
  letter-spacing: -0.5px;
  position: relative;
}
.hero h1 .gold { color: var(--gold-400); }
.hero h1 .purple { color: var(--purple-400); }
.hero p {
  font-size: 16px;
  color: var(--text-tertiary);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.7;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--purple-600), var(--purple-500));
  color: #fff;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity var(--transition);
}
.hero-cta:hover { opacity: 0.9; color: #fff; }
.hero-cta svg { width: 16px; height: 16px; }

/* ============================================
   Section Headers
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.section-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.section-count {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ============================================
   Post Cards
   ============================================ */
.post-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 40px;
}
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
}
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 22px 22px;
  transition: border-color var(--transition), transform var(--transition), background var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.post-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,164,92,0.3), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.post-card:hover {
  border-color: rgba(196,164,92,0.2);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
}
.post-card:hover::before { opacity: 1; }
.post-card-tag {
  font-size: 10px;
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.post-card-tag::before {
  content: '';
  width: 14px;
  height: 1px;
  background: var(--gold-400);
  opacity: 0.5;
}
.post-card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}
.post-card-excerpt {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 12px;
}
.post-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.post-card-meta .sep { width: 2px; height: 2px; background: var(--text-muted); border-radius: 50%; }

/* ============================================
   Single Post
   ============================================ */
.post-header {
  padding: 56px 0 36px;
  max-width: 720px;
  margin: 0 auto;
}
.post-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  transition: color var(--transition);
}
.post-header .back-link:hover { color: var(--text-secondary); }
.post-header h1 {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}
.post-meta-line {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.post-meta-line .dot { width: 2px; height: 2px; background: var(--text-muted); border-radius: 50%; }

.post-body {
  max-width: 700px;
  margin: 0 auto;
  padding-bottom: 48px;
}
.post-content {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 2;
  color: var(--text-primary);
}
.post-content p { margin-bottom: 22px; }
.post-content h2 {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 600;
  margin: 44px 0 18px;
  letter-spacing: -0.2px;
}
.post-content h3 {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  margin: 32px 0 14px;
}
.post-content ul, .post-content ol { padding-left: 24px; margin-bottom: 22px; }
.post-content li { margin-bottom: 8px; }
.post-content blockquote {
  border-left: 2px solid var(--gold-400);
  padding: 14px 22px;
  margin: 24px 0;
  background: var(--bg-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
  font-family: var(--font-sans);
  font-size: 15px;
}
.post-content strong { color: #fff; }
.post-content code {
  background: var(--bg-elevated);
  color: var(--gold-300);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 14px;
  font-family: var(--font-mono);
}
.post-content a { text-decoration: underline; text-underline-offset: 2px; }
.post-content img { border-radius: var(--radius-md); margin: 24px 0; }

.post-footer {
  max-width: 700px;
  margin: 0 auto 56px;
  border-top: 1px solid var(--border-subtle);
  padding: 32px 0;
}
.post-footer-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.post-footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  padding: 14px 24px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition);
}
.post-footer-cta:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.post-footer-cta .arrow {
  color: var(--gold-400);
  font-size: 16px;
}

/* ============================================
   Archive
   ============================================ */
.archive-page { padding: 56px 0 40px; }
.archive-page h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}
.archive-page .archive-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 36px;
}
.archive-item {
  display: flex;
  gap: 20px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: padding var(--transition);
}
.archive-item:hover { padding-left: 8px; }
.archive-date {
  min-width: 80px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.archive-title {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
  transition: color var(--transition);
}
.archive-title:hover { color: var(--gold-400); }

/* ============================================
   About
   ============================================ */
.about-page { padding: 60px 0; }
.about-card {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}
.about-card .symbol {
  font-size: 40px;
  color: var(--gold-400);
  margin-bottom: 20px;
  display: block;
}
.about-card h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 14px;
}
.about-card p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
}
.about-card .highlight {
  color: var(--gold-400);
  font-weight: 500;
}
.about-card .divider {
  width: 40px;
  height: 1px;
  background: var(--border-accent);
  margin: 28px auto;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 36px 0;
  text-align: center;
}
.footer-inner {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 12px;
  color: var(--text-muted);
}
.footer-inner a { color: var(--text-tertiary); }
.footer-inner a:hover { color: var(--text-secondary); }

/* ============================================
   Animations
   ============================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-up { animation: fadeUp 0.6s ease both; }
.fade-up-d1 { animation-delay: 0.1s; }
.fade-up-d2 { animation-delay: 0.2s; }
.fade-up-d3 { animation-delay: 0.3s; }
.fade-in { animation: fadeIn 0.6s ease both; }

/* ============================================
   Tag Badge
   ============================================ */
.tag-badge {
  display: inline-block;
  font-size: 10px;
  padding: 3px 12px;
  border-radius: 12px;
  background: rgba(196,164,92,0.1);
  color: var(--gold-400);
  letter-spacing: 0.5px;
}

/* ============================================
   Reading Progress Bar (on post pages)
   ============================================ */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--purple-600), var(--gold-400));
  z-index: 999;
  transition: width 0.1s;
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
