@import url('https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&family=Cabin:wght@400;500;600;700&display=swap');

/* ===== CSS 变量 ===== */
:root {
  --green: #87ff71;
  --blue: #01cdfe;
  --dark: #192617;
  --dark2: #0d1a0d;
  --dark3: #1e3318;
  --purple: #b967ff;
  --pink: #ff71ce;
  --white: #f0ffe8;
  --text: #d4f5c8;
  --text-dim: #8ab880;
  --card-bg: #0f1f0e;
  --border: #87ff7133;
  --border-glow: #87ff7166;
  --font-title: 'Amatic SC', cursive;
  --font-body: 'Cabin', sans-serif;
  --nav-h: 64px;
  --max-w: 1200px;
  --content-w: 780px;
  --aside-w: 220px;
  --gap: 2rem;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--dark2);
  background-image:
    linear-gradient(180deg, #0a0f0a 0%, #192617 40%, #0d1a1f 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== 扫描线叠加效果 ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ===== 链接 ===== */
a { color: var(--green); text-decoration: none; transition: color 0.2s, text-shadow 0.2s; }
a:hover { color: var(--blue); text-shadow: 0 0 8px var(--blue); }

/* ===== 导航 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12,20,10,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  gap: 1rem;
}

.main-nav p {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  flex: 1;
}

.nav-left { justify-content: flex-end; }
.nav-right { justify-content: flex-start; }

.main-nav p a {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  padding: 0.6rem 0.5rem;
  white-space: nowrap;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.03em;
}

.main-nav p a:hover,
.main-nav p a[aria-current="page"] {
  color: var(--green);
  text-shadow: 0 0 6px var(--green);
}

.nav-brand {
  flex-shrink: 0;
  text-align: center;
  padding: 0 1rem;
}

.nav-brand-text {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--green);
  text-shadow: 0 0 12px var(--green), 0 0 24px rgba(135,255,113,0.4);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.nav-logo {
  height: 40px;
  width: auto;
}

.nav-cta {
  background: linear-gradient(90deg, var(--green), var(--blue));
  color: var(--dark2) !important;
  font-weight: 700 !important;
  padding: 0.5rem 1.1rem !important;
  border: none;
  text-shadow: none !important;
  min-height: 40px;
  letter-spacing: 0.05em;
}

.nav-cta:hover {
  background: linear-gradient(90deg, var(--blue), var(--green));
  color: var(--dark2) !important;
  box-shadow: 0 0 16px var(--green);
  text-shadow: none !important;
}

/* ===== Glitch 动画 ===== */
@keyframes glitch1 {
  0%, 100% { clip-path: inset(0 0 95% 0); transform: translate(-2px, 0); }
  20% { clip-path: inset(30% 0 50% 0); transform: translate(2px, 0); }
  40% { clip-path: inset(60% 0 20% 0); transform: translate(-1px, 0); }
  60% { clip-path: inset(80% 0 5% 0); transform: translate(3px, 0); }
  80% { clip-path: inset(10% 0 75% 0); transform: translate(-2px, 0); }
}

@keyframes glitch2 {
  0%, 100% { clip-path: inset(50% 0 30% 0); transform: translate(2px, 0); color: var(--blue); }
  25% { clip-path: inset(10% 0 80% 0); transform: translate(-2px, 0); color: var(--pink); }
  50% { clip-path: inset(70% 0 10% 0); transform: translate(1px, 0); color: var(--purple); }
  75% { clip-path: inset(40% 0 45% 0); transform: translate(-3px, 0); color: var(--green); }
}

.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  animation: glitch1 4s infinite linear;
  color: var(--pink);
  opacity: 0.7;
}

.glitch::after {
  animation: glitch2 4s infinite linear 0.5s;
  opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
  .glitch::before, .glitch::after { animation: none; }
}

/* ===== Hero 区域（首页） ===== */
.hero-section {
  position: relative;
  min-height: 70vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.hero-collage {
  position: relative;
  grid-column: 2;
  grid-row: 1;
}

.hero-slot {
  position: absolute;
  overflow: hidden;
  border: 2px solid var(--border-glow);
}

.hero-slot-1 {
  top: 5%;
  right: 5%;
  width: 55%;
  height: 60%;
  z-index: 2;
  box-shadow: 0 0 30px rgba(135,255,113,0.2);
}

.hero-slot-2 {
  bottom: 5%;
  right: 0%;
  width: 60%;
  height: 55%;
  z-index: 1;
  filter: hue-rotate(20deg);
  box-shadow: 0 0 20px rgba(1,205,254,0.2);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-placeholder {
  background: linear-gradient(135deg, var(--dark3) 0%, #0d2020 100%);
}

.hero-placeholder-2 {
  background: linear-gradient(135deg, #1a0d26 0%, var(--dark3) 100%);
  filter: hue-rotate(40deg);
}

.hero-text {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 2rem 4rem 3rem;
  z-index: 3;
  text-align: left;
}

.hero-h1 {
  font-family: var(--font-title);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  color: var(--green);
  text-shadow: 0 0 20px var(--green), 0 0 40px rgba(135,255,113,0.4);
  line-height: 1.1;
  margin-bottom: 1.2rem;
  letter-spacing: 0.02em;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
  max-width: 420px;
  line-height: 1.6;
}

.hero-btn {
  display: inline-block;
  background: transparent;
  border: 2px solid var(--green);
  color: var(--green);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s;
  align-self: flex-start;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}

.hero-btn:hover {
  background: var(--green);
  color: var(--dark2);
  box-shadow: 0 0 24px var(--green), 0 0 48px rgba(135,255,113,0.3);
  text-shadow: none;
}

/* ===== 页面主体布局 ===== */
.page-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.content-with-aside {
  display: grid;
  grid-template-columns: var(--aside-w) 1fr;
  gap: var(--gap);
  align-items: start;
}

/* ===== 侧边栏 ===== */
.site-aside {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  padding: 1.5rem;
  background: var(--card-bg);
  border-left: 3px solid var(--green);
  border-bottom: 3px solid var(--green);
}

.aside-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green);
  text-shadow: 0 0 8px rgba(135,255,113,0.5);
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}

.aside-title span,
.aside-sub-title span {
  display: block;
}

.aside-sub-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue);
  text-shadow: 0 0 8px rgba(1,205,254,0.4);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.aside-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.aside-links li a {
  font-size: 0.88rem;
  color: var(--text-dim);
  padding: 0.35rem 0.5rem;
  display: block;
  border-left: 2px solid transparent;
  transition: all 0.2s;
}

.aside-links li a:hover {
  color: var(--green);
  border-left-color: var(--green);
  padding-left: 0.9rem;
  text-shadow: 0 0 6px var(--green);
}

/* ===== 主内容区 ===== */
.main-content {
  min-width: 0;
}

.page-content-body {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text);
}

.page-content-body h2 {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--green);
  text-shadow: 0 0 10px rgba(135,255,113,0.4);
  margin: 2rem 0 0.75rem;
  letter-spacing: 0.04em;
}

.page-content-body h3 {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--blue);
  text-shadow: 0 0 8px rgba(1,205,254,0.3);
  margin: 1.5rem 0 0.6rem;
}

.page-content-body p { margin-bottom: 1rem; }

.page-content-body ul,
.page-content-body ol {
  margin: 0.75rem 0 1rem 1.5rem;
}

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

.page-content-body a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-content-body a:hover { color: var(--green); }

.page-content-body strong { color: var(--green); font-weight: 700; }

.page-content-body blockquote {
  border-left: 3px solid var(--purple);
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  background: rgba(185,103,255,0.06);
  color: var(--text-dim);
  font-style: italic;
}

.page-content-body code {
  background: rgba(135,255,113,0.1);
  color: var(--green);
  padding: 0.1em 0.4em;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.page-content-body pre {
  background: var(--dark3);
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--border);
}

/* ===== 节标题 ===== */
.section-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--green);
  text-shadow: 0 0 16px rgba(135,255,113,0.5);
  margin-bottom: 1.5rem;
  letter-spacing: 0.04em;
  position: relative;
}

.section-title span { display: block; }

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--blue));
  margin-top: 0.5rem;
  box-shadow: 0 0 8px var(--green);
}

/* ===== 首页专区卡片 ===== */
.home-content-section,
.topic-body-section,
.tag-body-section,
.about-body-section,
.privacy-body-section,
.article-main-section {
  padding: 3rem 0 2rem;
}

.topic-section {
  padding: 3rem 0 2rem;
}

.latest-section {
  padding: 2rem 0 3rem;
}

.topic-list,
.article-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.topic-card,
.article-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-bottom: 3px solid var(--green);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.topic-card:hover,
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(135,255,113,0.15);
  border-color: var(--green);
}

.topic-card a,
.article-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.topic-card a:hover,
.article-card a:hover {
  text-shadow: none;
  color: inherit;
}

.card-inner {
  padding: 1.25rem 1.25rem 1rem;
}

.card-inner h3 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--green);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.card-inner h3 span { display: block; }

.card-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.card-arrow {
  font-size: 0.85rem;
  color: var(--blue);
  letter-spacing: 0.05em;
}

.card-date {
  display: block;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

/* ===== 子页列表（ol > li > a + small 结构） ===== */
.sub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sub-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 0.85rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sub-item:hover {
  border-left-color: var(--green);
  box-shadow: 0 2px 12px rgba(135,255,113,0.1);
}

.sub-item a {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  flex-shrink: 0;
}

.sub-item a:hover { color: var(--green); }

.sub-item small,
.sub-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  flex: 1;
  min-width: 120px;
}

.sub-item time {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== 内页 Hero ===== */
.page-hero {
  padding: 4rem 0 3rem;
  position: relative;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(135,255,113,0.03) 0%, rgba(1,205,254,0.05) 100%);
  pointer-events: none;
}

.page-hero-inner {
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--blue);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.page-h1 {
  font-family: var(--font-title);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--green);
  text-shadow: 0 0 20px rgba(135,255,113,0.5);
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: 0.03em;
}

.page-sub {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 600px;
  line-height: 1.6;
}

/* ===== 文章页 ===== */
.article-header-section {
  padding: 2rem 0;
}

.article-hero-wrap {
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-glow);
  overflow: hidden;
  box-shadow: 0 0 24px rgba(135,255,113,0.1);
}

.article-hero-img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 420px;
  object-fit: cover;
}

.article-h1 {
  font-family: var(--font-title);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--green);
  text-shadow: 0 0 16px rgba(135,255,113,0.4);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--green); }

.article-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 0.5rem;
}

.date-pub, .date-mod {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-family: var(--font-body);
}

/* ===== 相关推荐 ===== */
.related-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.related-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
  padding: 0.7rem 1rem;
  background: var(--card-bg);
  border-left: 3px solid var(--purple);
  transition: border-color 0.2s;
}

.related-item:hover { border-left-color: var(--green); }

.related-item a { font-weight: 600; color: var(--text); }
.related-item a:hover { color: var(--green); }
.related-item small { font-size: 0.85rem; color: var(--text-dim); }

/* ===== About / Privacy 页面 ===== */
.about-header-section,
.privacy-header-section {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.about-header-inner,
.privacy-header-inner {
  max-width: var(--content-w);
}

.about-links-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.privacy-date {
  display: block;
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-top: 0.75rem;
}

/* ===== 标签聚合页 ===== */
.tag-hero { border-bottom: 1px solid var(--border); }

.tag-articles-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* ===== 页脚 ===== */
.site-footer {
  background: rgba(8,14,8,0.95);
  border-top: 1px solid var(--border);
  padding: 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-logo-img {
  height: 28px;
  width: auto;
}

.footer-brand {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green);
  text-shadow: 0 0 8px rgba(135,255,113,0.4);
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-nav a {
  font-size: 0.88rem;
  color: var(--text-dim);
  padding: 0.5rem 0;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.footer-nav a:hover { color: var(--green); }

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ===== 副标题 (h2 > span) ===== */
h2 > span, h3 > span {
  display: inline;
}

/* ===== 页面标题区颜色条纹背景 ===== */
.topic-hero,
.tag-hero {
  background: linear-gradient(135deg,
    rgba(135,255,113,0.04) 0%,
    rgba(1,205,254,0.06) 50%,
    rgba(185,103,255,0.04) 100%);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

/* ===== 格栅背景装饰 ===== */
.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(
    transparent,
    rgba(25, 38, 23, 0.8)
  );
  pointer-events: none;
  z-index: 2;
}

/* ===== 首页文章区域宽度 ===== */
.topic-section,
.latest-section {
  max-width: 100%;
}

/* ===== 响应式：平板 ===== */
@media (max-width: 900px) {
  :root {
    --aside-w: 180px;
  }

  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-collage {
    grid-column: 1;
    grid-row: 2;
    height: 280px;
    position: relative;
    width: 100%;
  }

  .hero-text {
    grid-column: 1;
    grid-row: 1;
    padding: 3rem 1.5rem 2rem;
  }

  .hero-slot-1 {
    top: 5%;
    right: 30%;
    width: 40%;
    height: 80%;
  }

  .hero-slot-2 {
    bottom: 5%;
    right: 5%;
    width: 45%;
    height: 75%;
  }

  .main-nav {
    gap: 0.5rem;
  }

  .main-nav p a {
    font-size: 0.78rem;
    padding: 0.5rem 0.3rem;
  }

  .nav-cta {
    padding: 0.5rem 0.7rem !important;
    font-size: 0.78rem !important;
  }
}

/* ===== 响应式：手机 ===== */
@media (max-width: 640px) {
  :root {
    --nav-h: auto;
  }

  .site-header {
    position: relative;
    height: auto;
  }

  .main-nav {
    flex-direction: column;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    align-items: stretch;
  }

  .nav-brand {
    order: -1;
    padding: 0.5rem 0;
    text-align: center;
  }

  .nav-left, .nav-right {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.2rem 0.5rem;
  }

  .main-nav p a {
    font-size: 0.82rem;
    padding: 0.5rem 0.4rem;
  }

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

  .site-aside {
    position: static;
    order: 2;
    margin-top: 2rem;
  }

  .hero-text {
    padding: 2rem 1rem 1.5rem;
  }

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

  .hero-btn {
    width: 100%;
    justify-content: center;
  }

  .topic-list,
  .article-list {
    grid-template-columns: 1fr;
  }

  .page-main {
    padding: 0 1rem 3rem;
  }

  .hero-collage {
    height: 220px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
  }

  .footer-nav {
    gap: 1rem;
  }

  .footer-nav a {
    min-height: 44px;
  }

  .sub-item {
    flex-direction: column;
    gap: 0.3rem;
  }

  .article-dates {
    flex-direction: column;
    gap: 0.25rem;
  }

  .main-nav p {
    gap: 0.1rem 0.4rem;
  }

  .nav-cta {
    min-height: 44px;
    padding: 0.6rem 1rem !important;
  }

  .page-h1 { font-size: 2rem; }

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

  .about-header-section,
  .privacy-header-section {
    padding: 2rem 0 1.5rem;
  }
}

/* ===== 工具类 ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
