@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

/* ─── 基础重置 ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #000000;
  --bg2: #121212;
  --bg3: #1a1a1a;
  --border: #2a2a2a;
  --border-accent: #00e5ff;
  --text: #e0e0e0;
  --text-dim: #888;
  --text-muted: #555;
  --accent: #00e5ff;
  --accent2: #7c4dff;
  --accent3: #00ff88;
  --danger: #ff4081;
  --font-mono: 'Fira Code', 'Share Tech Mono', 'Courier New', monospace;
  --radius: 10px;
  --max-w: 1100px;
  --nav-h: 56px;
  color-scheme: dark;
}

html { font-size: 16px; line-height: 1.6; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #fff; text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

/* ─── 公告条 ─── */
.site-announce {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-size: 0.75rem;
  color: var(--accent3);
  letter-spacing: 0.08em;
  padding: 6px 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── 导航 details/summary ─── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0,0,0,0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.nav-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding: 0 24px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.nav-summary::-webkit-details-marker { display: none; }

.nav-brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent);
  letter-spacing: 0.05em;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-toggle-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 4px;
  margin-left: auto;
}

.site-nav[open] .nav-toggle-label { color: var(--accent); border-color: var(--accent); }

.nav-menu {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  padding: 0;
  list-style: none;
}

.nav-menu--split {
  display: flex;
  align-items: stretch;
}

.nav-menu__left,
.nav-menu__right {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  padding: 8px;
  flex: 1;
}

.nav-menu__left { border-right: 1px solid var(--border); justify-content: flex-end; }
.nav-menu__right { justify-content: flex-start; }

.nav-menu li a {
  display: block;
  padding: 8px 12px;
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  border-radius: 4px;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}
.nav-menu li a:hover {
  color: var(--accent);
  background: rgba(0,229,255,0.06);
  text-decoration: none;
  text-shadow: 0 0 10px var(--accent);
}

/* ─── 主内容布局 ─── */
main {
  display: grid;
  grid-template-columns: 1fr 260px;
  grid-template-rows: auto;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
  gap: 0 24px;
  align-items: start;
}

.wrap {
  min-width: 0;
  padding: 32px 0;
}

/* ─── 侧边栏 aside ─── */
.content-aside,
.home-aside {
  grid-column: 2;
  grid-row: 1;
  padding: 32px 0;
  position: sticky;
  top: calc(var(--nav-h) + 8px);
}

.aside-block {
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg2);
}

.aside-block h3 {
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.aside-nav {
  list-style: none;
}

.aside-nav li { margin-bottom: 6px; }

.aside-nav li a {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: block;
  padding: 4px 0;
  transition: color 0.15s;
}
.aside-nav li a:hover { color: var(--accent); text-decoration: none; }

/* ─── 面包屑 ─── */
.breadcrumb {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--accent); }

/* ─── Hero（首页）─── */
.hero-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 40px;
  position: relative;
}

.hero-article {
  position: relative;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #2a2a2a 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 48px 40px;
}

.hero-text { flex: 1; }

.hero-eyebrow {
  font-size: 0.72rem;
  color: var(--accent3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-h1 {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 16px;
  text-shadow: 0 0 10px rgba(0,229,255,0.3);
}

.hero-sub {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 28px;
  max-width: 520px;
  line-height: 1.7;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-media { flex-shrink: 0; }
.hero-img { max-width: 180px; border-radius: 8px; opacity: 0.85; }

/* ─── 按钮 ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 6px;
  letter-spacing: 0.05em;
  transition: background 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.btn-primary:hover {
  background: #fff;
  color: #000;
  box-shadow: 0 0 14px rgba(0,229,255,0.4);
  text-decoration: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  border: 1px solid var(--border-accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.btn-ghost:hover {
  background: rgba(0,229,255,0.08);
  color: #fff;
  text-decoration: none;
}

/* ─── 标签芯片 ─── */
.tag-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  font-size: 0.72rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  background: rgba(0,229,255,0.05);
  letter-spacing: 0.06em;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.tag-chip:hover {
  background: var(--accent);
  color: #000;
  text-decoration: none;
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

/* ─── 分类卡片网格 ─── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.cat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--bg2);
  transition: border-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cat-card:hover { border-color: var(--accent); }

.cat-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cat-card__title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
}
.cat-card__title:hover { color: var(--accent); }

.cat-card__desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.6;
  flex: 1;
}

.cat-card__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-card__links li a {
  font-size: 0.76rem;
  color: var(--text-muted);
  transition: color 0.15s;
}
.cat-card__links li a:hover { color: var(--accent); text-decoration: none; }

.cat-card__more {
  font-size: 0.76rem;
  color: var(--accent);
  align-self: flex-end;
}

/* ─── 表格 ─── */
.entry-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.82rem;
}

.entry-table th {
  background: var(--bg2);
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-accent);
  text-transform: uppercase;
}

.entry-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.entry-table tr:hover td { background: rgba(0,229,255,0.03); }
.entry-row--alt td { background: rgba(255,255,255,0.01); }

.entry-table a { color: var(--text); }
.entry-table a:hover { color: var(--accent); }

.td-index { color: var(--text-muted); font-size: 0.72rem; width: 48px; }
.td-date { color: var(--text-muted); font-size: 0.72rem; white-space: nowrap; }
.td-desc { color: var(--text-dim); font-size: 0.78rem; }
.td-empty { text-align: center; color: var(--text-muted); padding: 32px; }

.entry-table--full { table-layout: fixed; }
.entry-table--full .th-index { width: 52px; }
.entry-table--full .th-date { width: 120px; }
.entry-table--full .th-desc { width: 35%; }

/* ─── h2 + hr 装饰 ─── */
h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 40px;
  margin-bottom: 0;
}

h2:first-child { margin-top: 0; }

h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

hr {
  border: none;
  border-top: 1px solid var(--border-accent);
  margin: 10px 0 24px;
  opacity: 0.4;
}

/* ─── prose 正文 ─── */
.prose {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text);
  max-width: 72ch;
}

.prose p { margin-bottom: 1em; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.5em; color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 1em; }
.prose li { margin-bottom: 0.4em; }
.prose a { color: var(--accent); }
.prose strong { color: #fff; }
.prose code {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.85em;
}
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  color: var(--text-dim);
  margin: 1em 0;
}
.prose time { color: var(--accent3); }

/* ─── 分类页 Hero ─── */
.cat-hero {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  margin-bottom: 32px;
}
.cat-hero__article {
  padding: 32px 32px 28px;
}

.cat-h1 {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(0,229,255,0.2);
}

.cat-desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 60ch;
  margin-bottom: 12px;
}

.cat-meta {
  display: flex;
  gap: 20px;
  font-size: 0.76rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.cat-meta strong { color: var(--accent); }
.cat-meta time { color: var(--accent3); }

/* ─── 条目页 ─── */
.entry-section {
  margin-bottom: 40px;
}
.entry-article {}

.entry-header {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  padding: 28px 28px 24px;
  margin-bottom: 28px;
}

.entry-hero-wrap {
  margin-bottom: 20px;
}
.entry-hero-img {
  border-radius: 6px;
  max-height: 200px;
  object-fit: cover;
}

.entry-h1 {
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.4;
}

.entry-lead {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 16px;
  line-height: 1.7;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.76rem;
}

.meta-item { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.meta-label { color: var(--text-muted); }
.meta-item time { color: var(--accent3); }
.meta-item a { color: var(--accent); }

.entry-prose { margin-bottom: 24px; }

.entry-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ─── 标签页 ─── */
.tag-section { margin-bottom: 40px; }

.tag-h1 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  color: #fff;
}
.tag-badge {
  background: var(--accent);
  color: #000;
  padding: 2px 12px;
  border-radius: 4px;
  font-size: 1em;
  font-weight: 700;
}
.tag-h1__sub { font-size: 0.75em; color: var(--text-muted); font-weight: 400; }

.tag-desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 20px;
  max-width: 60ch;
  line-height: 1.7;
}

.tag-entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.tag-entry-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}
.tag-entry-card:hover { border-color: var(--accent); }

.tag-entry-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
}

.entry-parent {
  color: var(--accent2);
  font-size: 0.7rem;
  border: 1px solid var(--accent2);
  border-radius: 3px;
  padding: 1px 6px;
}

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

.tag-entry-card__title {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
}
.tag-entry-card__title:hover { color: var(--accent); text-decoration: none; }

.tag-entry-card__desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ─── about 页 ─── */
.about-h1 {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}
.about-meta { font-size: 0.76rem; color: var(--text-muted); margin-bottom: 20px; }
.about-meta time { color: var(--accent3); }
.about-prose { margin-bottom: 32px; }

.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.feature-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--bg2);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.feature-num {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.4;
  line-height: 1;
  flex-shrink: 0;
}

.feature-item strong { display: block; color: #fff; font-size: 0.9rem; margin-bottom: 6px; }
.feature-item p { font-size: 0.78rem; color: var(--text-dim); line-height: 1.6; margin: 0; }

/* ─── privacy 页 ─── */
.privacy-h1 {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}
.privacy-meta { font-size: 0.76rem; color: var(--text-muted); margin-bottom: 20px; }
.privacy-meta time { color: var(--accent3); }
.privacy-prose { margin-bottom: 32px; }

.privacy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 16px;
}
.privacy-table th {
  background: var(--bg2);
  color: var(--accent);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-accent);
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.privacy-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.privacy-table tr:hover td { background: rgba(0,229,255,0.03); }

/* ─── home 专属区块 ─── */
.home-cats { margin-bottom: 40px; }
.home-content { margin-bottom: 40px; }
.home-recent { margin-bottom: 40px; }
.home-tags { margin-bottom: 20px; }

/* ─── 页脚 ─── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  margin-top: 60px;
}

.footer-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

.footer-cta__text {
  font-size: 0.88rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.footer-body {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  gap: 32px;
}

.footer-dl { flex: 1; min-width: 140px; }

.footer-dl dt {
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.footer-dl dd {
  margin-bottom: 6px;
}

.footer-dl dd a {
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: color 0.15s;
}
.footer-dl dd a:hover { color: var(--accent); text-decoration: none; }

.footer-bar {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-copy { font-size: 0.72rem; color: var(--text-muted); }
.footer-links { font-size: 0.72rem; color: var(--text-muted); }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

/* ─── 动效（stagger + 减弱动效尊重） ─── */
@media (prefers-reduced-motion: no-preference) {
  .cat-card, .tag-entry-card, .feature-item {
    opacity: 0;
    transform: translateY(16px);
    animation: fadeSlideIn 0.4s ease forwards;
  }

  .cat-card:nth-child(1) { animation-delay: 0.05s; }
  .cat-card:nth-child(2) { animation-delay: 0.10s; }
  .cat-card:nth-child(3) { animation-delay: 0.15s; }
  .cat-card:nth-child(4) { animation-delay: 0.20s; }
  .cat-card:nth-child(n+5) { animation-delay: 0.25s; }

  .tag-entry-card:nth-child(1) { animation-delay: 0.05s; }
  .tag-entry-card:nth-child(2) { animation-delay: 0.10s; }
  .tag-entry-card:nth-child(3) { animation-delay: 0.15s; }
  .tag-entry-card:nth-child(4) { animation-delay: 0.20s; }
  .tag-entry-card:nth-child(n+5) { animation-delay: 0.25s; }

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

  .hero-h1 {
    animation: glowPulse 4s ease-in-out infinite;
  }
  @keyframes glowPulse {
    0%, 100% { text-shadow: 0 0 10px rgba(0,229,255,0.3); }
    50% { text-shadow: 0 0 20px rgba(0,229,255,0.6), 0 0 40px rgba(0,229,255,0.2); }
  }
}

/* ─── 响应式断点 ─── */
@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }

  .content-aside, .home-aside {
    grid-column: 1;
    grid-row: auto;
    position: static;
    padding-top: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }

  .aside-block { margin-bottom: 0; }

  .footer-body { flex-wrap: wrap; gap: 24px; }
}

@media (max-width: 600px) {
  .nav-brand {
    font-size: 0.85rem;
  }

  .nav-menu--split {
    flex-direction: column;
  }
  .nav-menu__left { border-right: none; border-bottom: 1px solid var(--border); justify-content: flex-start; }

  .hero-inner { flex-direction: column; padding: 32px 20px; gap: 20px; }
  .hero-h1 { font-size: 1.3rem; }
  .hero-media { display: none; }

  .cat-grid { grid-template-columns: 1fr; }
  .about-features { grid-template-columns: 1fr; }
  .tag-entry-grid { grid-template-columns: 1fr; }

  .entry-table--full .th-desc { display: none; }
  .entry-table--full .td-desc { display: none; }

  .footer-cta { flex-direction: column; align-items: flex-start; padding: 20px; }
  .footer-body { padding: 20px; }
  .footer-bar { flex-direction: column; align-items: flex-start; }

  .content-aside, .home-aside { grid-template-columns: 1fr; }

  .wrap { padding: 20px 0; }

  h2 { font-size: 0.9rem; }

  .privacy-table { font-size: 0.75rem; }
  .privacy-table td, .privacy-table th { padding: 8px 10px; }
}

@media (max-width: 375px) {
  .site-announce { font-size: 0.68rem; }
  .nav-summary { padding: 0 12px; }
  main { padding: 0 10px; }
  .hero-inner { padding: 24px 14px; }
  .entry-header { padding: 20px 16px; }
  .cat-hero__article { padding: 20px 16px; }
}
