@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ============================================================
   CSS 自定义属性 — Y2K 霓虹铬感主题
   ============================================================ */
:root {
  --c-bg: #172617;
  --c-bg-2: #1e301e;
  --c-bg-3: #243824;
  --c-primary: #69ff69;
  --c-cyan: #00ffff;
  --c-text: #d4f5d4;
  --c-text-dim: #8fba8f;
  --c-border: #2e4a2e;
  --c-border-bright: #3a6a3a;
  --c-card-bg: #1a2e1a;
  --c-card-border: #2e5a2e;
  --c-glow-green: rgba(105,255,105,0.35);
  --c-glow-cyan: rgba(0,255,255,0.3);
  --c-chrome-1: #c8ffc8;
  --c-chrome-2: #69ff69;
  --c-chrome-3: #00ffff;
  --c-overlay-bg: #0d1a0d;
  --radius-card: 18px;
  --radius-btn: 8px;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --transition-base: 0.22s ease;
  --header-h: 60px;
  --announce-h: 36px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--c-bg);
  color: var(--c-text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-cyan); }
ul { list-style: none; }
hr {
  border: none;
  border-top: 1px solid var(--c-border-bright);
  margin: 1rem 0 1.5rem;
  opacity: 0.7;
}

/* ============================================================
   公告栏
   ============================================================ */
.announce-bar {
  background: linear-gradient(90deg, var(--c-bg-3), var(--c-bg-2), var(--c-bg-3));
  border-bottom: 1px solid var(--c-border-bright);
  height: var(--announce-h);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c-primary);
  letter-spacing: 0.08em;
  text-align: center;
  padding: 0 1rem;
}

/* ============================================================
   页头
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: rgba(23,38,23,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border-bright);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
}

.site-header__brand { flex: 0 0 auto; }

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-icon { width: 36px; height: 36px; border-radius: 8px; }

.brand-icon-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-cyan));
  color: var(--c-bg);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: 10px;
  box-shadow: 0 0 12px var(--c-glow-green);
}

.breadcrumb-nav {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb-nav a {
  color: var(--c-text-dim);
  transition: color var(--transition-base);
}

.breadcrumb-nav a:hover { color: var(--c-primary); }

/* ============================================================
   汉堡按钮
   ============================================================ */
.hamburger {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--c-primary);
  border-radius: 2px;
  transition: all var(--transition-base);
  box-shadow: 0 0 6px var(--c-glow-green);
}

.hamburger:hover span { background: var(--c-cyan); box-shadow: 0 0 8px var(--c-glow-cyan); }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

/* ============================================================
   全屏遮罩菜单
   ============================================================ */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(13,26,13,0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.menu-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.menu-overlay__inner {
  text-align: center;
  width: min(480px, 90vw);
}

.menu-close {
  display: block;
  margin: 0 auto 2rem;
  background: none;
  border: 1px solid var(--c-border-bright);
  color: var(--c-text-dim);
  font-size: 1.4rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  transition: all var(--transition-base);
}

.menu-close:hover { color: var(--c-primary); border-color: var(--c-primary); box-shadow: 0 0 10px var(--c-glow-green); }

.menu-overlay nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.menu-overlay nav ul li a {
  display: block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--c-text);
  border-radius: 10px;
  transition: all var(--transition-base);
  border: 1px solid transparent;
  line-height: 1.4;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-overlay nav ul li a:hover,
.menu-overlay nav ul li a[aria-current="page"] {
  color: var(--c-primary);
  background: rgba(105,255,105,0.07);
  border-color: var(--c-border-bright);
  text-shadow: 0 0 10px var(--c-glow-green);
}

/* ============================================================
   侧边 aside (隐藏式导航)
   ============================================================ */
.site-aside {
  display: none;
}

/* ============================================================
   主内容布局
   ============================================================ */
.page-entry main,
.page-category main,
.page-about main,
.page-privacy main,
.page-tag main {
  display: grid;
  grid-template-columns: 1fr;
}

/* ============================================================
   包裹容器
   ============================================================ */
.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ============================================================
   Hero — 首页满屏
   ============================================================ */
.hero-section {
  min-height: calc(100vh - var(--header-h) - var(--announce-h));
  display: flex;
  align-items: flex-start;
  padding: 5vh 0 4vh;
}

.hero-article {
  max-width: 720px;
}

.hero-h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--c-chrome-1);
  text-shadow: 0 0 30px var(--c-glow-green), 0 0 60px rgba(105,255,105,0.15);
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--c-primary), var(--c-cyan), var(--c-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--c-text-dim);
  margin-bottom: 2rem;
  max-width: 600px;
  line-height: 1.75;
}

/* ============================================================
   页面 Hero — 内页
   ============================================================ */
.page-hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 2.5rem;
}

.page-hero__inner { max-width: 800px; }

.page-hero h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: var(--c-primary);
  text-shadow: 0 0 20px var(--c-glow-green);
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.page-desc {
  font-size: 1rem;
  color: var(--c-text-dim);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.page-date, .entry-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c-text-dim);
  letter-spacing: 0.04em;
  display: inline-block;
  margin-right: 1rem;
}

.entry-meta { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ============================================================
   Eyebrow
   ============================================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--c-cyan);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  text-shadow: 0 0 8px var(--c-glow-cyan);
}

/* ============================================================
   버튼
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.6rem 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--c-bg);
  background: linear-gradient(135deg, var(--c-primary), var(--c-cyan));
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
  box-shadow: 0 0 18px var(--c-glow-green), 0 4px 16px rgba(0,0,0,0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--c-cyan), var(--c-primary));
  box-shadow: 0 0 28px var(--c-glow-cyan), 0 6px 20px rgba(0,0,0,0.5);
  color: var(--c-bg);
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--c-primary);
  background: transparent;
  border: 1px solid var(--c-primary);
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
}

.btn-secondary:hover {
  background: rgba(105,255,105,0.1);
  box-shadow: 0 0 14px var(--c-glow-green);
  color: var(--c-cyan);
  border-color: var(--c-cyan);
}

/* ============================================================
   卡片网格
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  list-style: none;
  padding: 0;
}

.card-grid--children { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card-grid--entries { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card-grid--tag { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.card {
  background: var(--c-card-bg);
  border: 1px solid var(--c-card-border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-base);
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, rgba(105,255,105,0.04), rgba(0,255,255,0.03));
  pointer-events: none;
}

.card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-cyan));
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}

.card:hover {
  border-color: var(--c-primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(105,255,105,0.15), 0 0 0 1px rgba(105,255,105,0.2);
}

.card h3 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.6rem;
}

.card h3 a { color: var(--c-text); }
.card h3 a:hover { color: var(--c-primary); }

.card p {
  font-size: 0.85rem;
  color: var(--c-text-dim);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 0.75rem;
}

.card time {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--c-text-dim);
  letter-spacing: 0.04em;
}

.card .card-cta {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--c-cyan);
  letter-spacing: 0.04em;
  transition: color var(--transition-base);
}

.card .card-cta:hover { color: var(--c-primary); }

.card-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.card-body { display: flex; flex-direction: column; flex: 1; }

/* ============================================================
   正文散文
   ============================================================ */
.prose {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-text);
  max-width: 760px;
}

.prose h2 {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-primary);
  margin: 2rem 0 0.25rem;
  text-shadow: 0 0 10px var(--c-glow-green);
}

.prose h3 {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--c-cyan);
  margin: 1.5rem 0 0.25rem;
}

.prose p { margin-bottom: 1.1rem; }

.prose a {
  color: var(--c-primary);
  text-decoration: underline;
  text-decoration-color: rgba(105,255,105,0.3);
}

.prose a:hover { color: var(--c-cyan); text-decoration-color: var(--c-cyan); }

.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  list-style: disc;
}

.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.4rem; }

.prose blockquote {
  border-left: 3px solid var(--c-primary);
  padding-left: 1rem;
  margin: 1.25rem 0;
  color: var(--c-text-dim);
  font-style: italic;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--c-bg-3);
  color: var(--c-cyan);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.prose pre {
  background: var(--c-bg-3);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}

.prose pre code { background: none; padding: 0; }

/* ============================================================
   内容区分节
   ============================================================ */
.content-section {
  padding: 2rem 0;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 2.5rem;
}

.cats-section, .entries-section, .children-section,
.tag-list-section { padding: 1rem 0 2rem; margin-bottom: 1rem; }

.cats-section h2, .entries-section h2,
.children-section h2, .tag-list-section h2 {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-primary);
  text-shadow: 0 0 8px var(--c-glow-green);
  margin-bottom: 0.25rem;
}

/* ============================================================
   右侧 sidebar aside (内容页)
   ============================================================ */
.sidebar-aside {
  display: none;
}

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--c-border-bright);
  margin-top: 4rem;
}

.footer-cta {
  background: linear-gradient(135deg, var(--c-bg-2), var(--c-bg-3));
  padding: 3rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--c-border);
}

.footer-cta__text {
  font-size: 1rem;
  color: var(--c-text-dim);
  margin-bottom: 1.25rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.footer-copy {
  padding: 1rem 1.5rem;
  text-align: center;
}

.footer-copy p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c-text-dim);
  letter-spacing: 0.04em;
}

.footer-copy a { color: var(--c-text-dim); }
.footer-copy a:hover { color: var(--c-primary); }

/* ============================================================
   英雄图片
   ============================================================ */
.entry-hero-img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: var(--radius-card);
  margin-top: 1.5rem;
  box-shadow: 0 4px 32px rgba(0,0,0,0.5);
}

/* ============================================================
   no-items
   ============================================================ */
.no-items div {
  background: var(--c-card-bg);
  border: 1px dashed var(--c-border);
  border-radius: var(--radius-card);
  padding: 2rem;
  text-align: center;
}

.no-items h3 { font-family: var(--font-mono); color: var(--c-text-dim); margin-bottom: 0.5rem; }
.no-items p { color: var(--c-text-dim); font-size: 0.9rem; }

/* ============================================================
   Scroll Reveal 动效
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   桌面断点 ≥768px
   ============================================================ */
@media (min-width: 768px) {
  .wrap { padding: 0 2rem; }

  .hero-h1 { font-size: clamp(2rem, 4vw, 3rem); }

  .card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

  /* 桌面：内容 + 右侧 sidebar 布局 */
  .page-entry body,
  .page-category body,
  .page-about body,
  .page-privacy body,
  .page-tag body { display: block; }

  .page-entry main,
  .page-category main,
  .page-about main,
  .page-privacy main,
  .page-tag main {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 0 2rem;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 2rem;
    align-items: start;
  }

  .page-entry .wrap,
  .page-category .wrap,
  .page-about .wrap,
  .page-privacy .wrap,
  .page-tag .wrap {
    max-width: 100%;
    padding: 0;
  }

  .sidebar-aside {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + var(--announce-h) + 1rem);
    max-height: calc(100vh - var(--header-h) - var(--announce-h) - 2rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--c-border) transparent;
  }

  .sidebar-inner {
    background: var(--c-card-bg);
    border: 1px solid var(--c-card-border);
    border-radius: var(--radius-card);
    padding: 1.25rem;
  }

  .sidebar-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--c-cyan);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
  }

  .sidebar-links { display: flex; flex-direction: column; gap: 0.25rem; }

  .sidebar-links li a {
    display: block;
    padding: 0.45rem 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--c-text-dim);
    border-radius: 6px;
    transition: all var(--transition-base);
    min-height: 40px;
    display: flex;
    align-items: center;
    line-height: 1.3;
  }

  .sidebar-links li a:hover {
    color: var(--c-primary);
    background: rgba(105,255,105,0.07);
  }

  .menu-overlay nav ul li a { font-size: 1.1rem; }
}

/* ============================================================
   大屏 ≥1100px
   ============================================================ */
@media (min-width: 1100px) {
  .page-entry main,
  .page-category main,
  .page-about main,
  .page-privacy main,
  .page-tag main {
    grid-template-columns: 1fr 280px;
    gap: 0 2.5rem;
    max-width: 1200px;
  }

  .hero-h1 { font-size: 3rem; }
}

/* ============================================================
   首页：全宽，无 sidebar
   ============================================================ */
.page-home .wrap { max-width: 1040px; }

/* ============================================================
   移动端安全
   ============================================================ */
@media (max-width: 767px) {
  .sidebar-aside { display: none; }

  .site-header { padding: 0 1rem; }

  .hero-section { padding: 3vh 0 3vh; }

  .card-grid { grid-template-columns: 1fr; }
  .card-grid--children { grid-template-columns: 1fr; }
  .card-grid--entries { grid-template-columns: 1fr; }

  .footer-cta { padding: 2rem 1rem; }
}

/* ============================================================
   Glow 脉冲动画
   ============================================================ */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 12px var(--c-glow-green); }
  50% { box-shadow: 0 0 24px var(--c-glow-green), 0 0 48px rgba(105,255,105,0.15); }
}

@media (prefers-reduced-motion: no-preference) {
  .btn-primary { animation: glow-pulse 3s ease-in-out infinite; }
}

/* ============================================================
   滚动条美化
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb { background: var(--c-border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-primary); }

/* ============================================================
   选中颜色
   ============================================================ */
::selection { background: rgba(105,255,105,0.25); color: var(--c-primary); }
