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

/* ============================
   CSS 变量 & 重置
   ============================ */
:root {
  --c-green: #69ff69;
  --c-cyan: #00ffff;
  --c-dark: #172617;
  --c-dark2: #1f341f;
  --c-dark3: #243524;
  --c-text: #d4f5d4;
  --c-text-muted: #8abf8a;
  --c-border: rgba(105,255,105,0.18);
  --c-card-bg: rgba(23,38,23,0.85);
  --c-glass: rgba(105,255,105,0.06);
  --radius: 18px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --font-main: 'Nunito Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-brand: 'Varela Round', 'Nunito Sans', sans-serif;
  --nav-h: 64px;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.45), 0 0 12px rgba(105,255,105,0.08);
  --shadow-glow-g: 0 0 16px rgba(105,255,105,0.5);
  --shadow-glow-c: 0 0 16px rgba(0,255,255,0.5);
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-main);
  background-color: var(--c-dark);
  color: var(--c-text);
  line-height: 1.7;
  min-height: 100vh;
  padding-bottom: var(--nav-h);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-green); text-decoration: none; }
a:hover { color: var(--c-cyan); }
ul, ol { list-style: none; }

/* ============================
   排版
   ============================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-brand);
  line-height: 1.25;
  color: var(--c-green);
}

h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); text-shadow: var(--shadow-glow-g); }
h2 { font-size: clamp(1.2rem, 3vw, 1.8rem); }
h3 { font-size: 1.15rem; }

/* ============================
   固定底部导航
   ============================ */
.site-header {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(0deg, rgba(23,38,23,0.98) 80%, rgba(23,38,23,0.7));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--c-border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
}

.site-header nav {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.site-header nav::-webkit-scrollbar { display: none; }

.site-header nav > p {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  white-space: nowrap;
}

.site-header nav > p > a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--c-border);
  background: var(--c-glass);
  color: var(--c-text);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.site-header nav > p > a:hover,
.site-header nav > p > a:focus-visible {
  background: rgba(105,255,105,0.15);
  border-color: var(--c-green);
  color: var(--c-green);
  box-shadow: var(--shadow-glow-g);
}

/* ============================
   镀铬胶囊按钮
   ============================ */
.btn-chrome {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 28px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #a8ffb0 0%, #69ff69 40%, #00e5e5 100%);
  color: var(--c-dark);
  font-family: var(--font-brand);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 18px rgba(105,255,105,0.45), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: box-shadow var(--transition), transform var(--transition), filter var(--transition);
  text-shadow: none;
}
.btn-chrome:hover {
  box-shadow: 0 4px 28px rgba(105,255,105,0.7), inset 0 1px 0 rgba(255,255,255,0.6);
  transform: translateY(-2px);
  filter: brightness(1.08);
  color: var(--c-dark);
}
.btn-chrome.btn-sm {
  min-height: 40px;
  padding: 0 18px;
  font-size: 0.88rem;
  width: 100%;
  margin-top: 12px;
}

/* ============================
   虹彩徽章
   ============================ */
.iridescent, .eyebrow-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, #69ff69, #00ffff, #ff69b4, #69ff69);
  background-size: 200% auto;
  color: var(--c-dark);
  animation: iridescent-shift 3s linear infinite;
  margin-bottom: 12px;
}
@keyframes iridescent-shift {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.hero-badge {
  margin-bottom: 16px;
}

/* ============================
   容器与布局骨架
   ============================ */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* content-section：main > div.wrap > section > article，符合四层直接嵌套 */
.content-section {
  padding: 40px 0;
}

.content-article {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}

/* ============================
   Hero（首页 100vh）
   ============================ */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 80px 0 40px;
  background: radial-gradient(ellipse at 20% 50%, rgba(105,255,105,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 30%, rgba(0,255,255,0.07) 0%, transparent 55%);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(105,255,105,0.18) 1px, transparent 1px),
    radial-gradient(circle, rgba(0,255,255,0.1) 1px, transparent 1px);
  background-size: 40px 40px, 70px 70px;
  background-position: 0 0, 20px 20px;
  pointer-events: none;
}

.hero-article {
  display: flex;
  align-items: center;
  gap: 48px;
  width: 100%;
}

.hero-media {
  flex: 1 1 45%;
  min-width: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(105,255,105,0.2), var(--shadow-card);
}
.hero-media img, .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

.hero-text {
  flex: 1 1 50%;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hero-text h1 {
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  margin-bottom: 16px;
}

.hero-desc {
  color: var(--c-text-muted);
  font-size: 1.05rem;
  margin-bottom: 28px;
  max-width: 400px;
}

/* ============================
   栏目页 hero
   ============================ */
.page-hero-section, .about-header-section,
.privacy-header-section, .article-header-section,
.default-section {
  padding: 60px 0 32px;
  background: linear-gradient(180deg, rgba(105,255,105,0.04) 0%, transparent 100%);
}

.page-hero-article, .about-header-article,
.privacy-header-article, .article-header-article,
.default-article {
  max-width: 800px;
}

.page-date {
  display: inline-block;
  color: var(--c-text-muted);
  font-size: 0.85rem;
  margin-top: 8px;
}

.breadcrumb {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--c-text-muted);
  margin-bottom: 10px;
}
.breadcrumb a { color: var(--c-cyan); }

/* ============================
   正文 prose
   ============================ */
.main-content {
  min-width: 0;
}

.prose { font-size: 1rem; line-height: 1.8; }
.prose h2 { margin: 32px 0 12px; font-size: 1.35rem; }
.prose h3 { margin: 24px 0 10px; color: var(--c-cyan); }
.prose p { margin-bottom: 16px; }
.prose a { color: var(--c-cyan); border-bottom: 1px solid rgba(0,255,255,0.3); }
.prose a:hover { color: var(--c-green); border-color: var(--c-green); }
.prose ul, .prose ol { margin: 0 0 16px 20px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 6px; }
.prose blockquote {
  border-left: 3px solid var(--c-green);
  padding: 12px 20px;
  margin: 20px 0;
  background: var(--c-glass);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--c-text-muted);
}
.prose strong { color: var(--c-green); font-weight: 700; }
.prose code {
  background: rgba(105,255,105,0.12);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.9em;
  color: var(--c-cyan);
}
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.prose th, .prose td {
  border: 1px solid var(--c-border);
  padding: 10px 14px;
  text-align: left;
}
.prose th { background: rgba(105,255,105,0.08); color: var(--c-green); }
.prose img { border-radius: var(--radius-sm); margin: 16px 0; }

/* ============================
   侧边栏
   ============================ */
.sidebar {
  position: sticky;
  top: 20px;
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar small {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--c-text-muted);
  text-transform: uppercase;
  display: block;
  margin-top: 16px;
}
.sidebar small:first-child { margin-top: 0; }

.sidebar h2 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--c-green);
}
.sidebar h3 { font-size: 0.95rem; }

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

/* ============================
   药丸卡片链接
   ============================ */
.article-pill {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--c-border);
  background: var(--c-glass);
  font-size: 0.85rem;
  color: var(--c-text);
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  min-height: 40px;
}
.article-pill strong {
  font-weight: 600;
  color: inherit;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.article-pill:hover {
  background: rgba(105,255,105,0.12);
  border-color: var(--c-green);
  color: var(--c-green);
  box-shadow: var(--shadow-glow-g);
  transform: translateX(3px);
}

/* ============================
   频道卡片网格
   ============================ */
.channels-section {
  padding: 40px 0 60px;
}
.channels-article { }

.channels-article small {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--c-text-muted);
  margin-bottom: 6px;
}
.channels-article h2 {
  margin-bottom: 24px;
}

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

.channel-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: var(--c-card-bg);
  box-shadow: var(--shadow-card);
  color: var(--c-text);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  min-height: 120px;
  position: relative;
  overflow: hidden;
}
.channel-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--c-green), var(--c-cyan));
  opacity: 0;
  transition: opacity var(--transition);
}
.channel-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px rgba(105,255,105,0.15);
  border-color: rgba(105,255,105,0.35);
}
.channel-card:hover::before { opacity: 1; }
.channel-card strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-green);
  font-family: var(--font-brand);
}
.channel-card .card-desc {
  font-size: 0.88rem;
  color: var(--c-text-muted);
  line-height: 1.5;
}
.channel-card .card-date {
  font-size: 0.75rem;
  color: var(--c-cyan);
  margin-top: auto;
}

/* ============================
   子页列表（channel 页）
   ============================ */
.child-list { margin-top: 40px; }
.child-list small {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--c-text-muted);
  margin-bottom: 6px;
}
.child-list h2 { margin-bottom: 20px; }

.child-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.child-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: var(--c-card-bg);
  box-shadow: var(--shadow-card);
  color: var(--c-text);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.child-card strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-green);
  font-family: var(--font-brand);
}
.child-card .child-desc {
  font-size: 0.88rem;
  color: var(--c-text-muted);
  line-height: 1.5;
}
.child-card .child-date {
  font-size: 0.75rem;
  color: var(--c-cyan);
}
.child-card:hover {
  transform: translateX(5px);
  border-color: rgba(0,255,255,0.4);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 14px rgba(0,255,255,0.12);
}

/* ============================
   文章页 meta & hero
   ============================ */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 12px 0 20px;
}
.article-meta time {
  font-size: 0.82rem;
  color: var(--c-text-muted);
}
.article-hero-wrap {
  margin-top: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.article-hero-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* ============================
   small 眉题（h2 前同级）
   ============================ */
small {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--c-text-muted);
}

/* ============================
   页脚
   ============================ */
footer {
  background: linear-gradient(180deg, var(--c-dark3) 0%, var(--c-dark) 100%);
  border-top: 1px solid var(--c-border);
  padding-bottom: calc(var(--nav-h) + 20px);
}

footer > section { padding: 40px 16px 0; max-width: 1200px; margin: 0 auto; }

.footer-brand {
  text-align: center;
  padding-top: 56px !important;
}
.footer-logo-text {
  font-family: var(--font-brand);
  font-size: clamp(2.4rem, 7vw, 5rem);
  font-weight: 700;
  background: linear-gradient(90deg, var(--c-green), var(--c-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 12px;
  text-shadow: none;
  filter: drop-shadow(0 0 20px rgba(105,255,105,0.4));
}
.footer-slogan {
  color: var(--c-text-muted);
  font-size: 0.9rem;
  max-width: 500px;
  margin: 0 auto;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding-top: 32px !important;
}
.footer-nav-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-nav-col a {
  color: var(--c-text-muted);
  font-size: 0.88rem;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.footer-nav-col a:hover {
  color: var(--c-green);
  background: rgba(105,255,105,0.06);
}

.footer-copy {
  text-align: center;
  padding-top: 24px !important;
  padding-bottom: 20px;
}
.footer-copy p {
  color: var(--c-text-muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}
.footer-copy a {
  color: var(--c-text-muted);
}
.footer-copy a:hover { color: var(--c-cyan); }

/* ============================
   Stagger 动效
   ============================ */
@media (prefers-reduced-motion: no-preference) {
  .channel-card,
  .child-card,
  .article-pill {
    animation: fadeSlideUp 0.45s ease both;
  }
  .channel-card:nth-child(1) { animation-delay: 0.05s; }
  .channel-card:nth-child(2) { animation-delay: 0.12s; }
  .channel-card:nth-child(3) { animation-delay: 0.19s; }
  .channel-card:nth-child(4) { animation-delay: 0.26s; }
  .channel-card:nth-child(5) { animation-delay: 0.33s; }

  .child-card:nth-child(1) { animation-delay: 0.05s; }
  .child-card:nth-child(2) { animation-delay: 0.1s; }
  .child-card:nth-child(3) { animation-delay: 0.15s; }
  .child-card:nth-child(4) { animation-delay: 0.2s; }
  .child-card:nth-child(5) { animation-delay: 0.25s; }

  @keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .footer-logo-text {
    animation: glowPulse 3s ease-in-out infinite alternate;
  }
  @keyframes glowPulse {
    from { filter: drop-shadow(0 0 16px rgba(105,255,105,0.3)); }
    to { filter: drop-shadow(0 0 32px rgba(0,255,255,0.5)); }
  }

  .hero-text h1 {
    animation: neonFlicker 4s ease-in-out infinite;
  }
  @keyframes neonFlicker {
    0%, 95%, 100% { text-shadow: 0 0 16px rgba(105,255,105,0.5); }
    97% { text-shadow: 0 0 4px rgba(105,255,105,0.2); }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================
   响应式
   ============================ */
@media (max-width: 900px) {
  .content-article {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .hero-article {
    flex-direction: column;
    gap: 32px;
  }
  .hero-media { width: 100%; }
  .hero-text {
    text-align: center;
    align-items: center;
  }
  .footer-nav {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .wrap { padding: 0 12px; }

  .hero-section {
    min-height: 100vh;
    padding: 24px 0 32px;
  }
  .hero-text h1 { font-size: 1.6rem; }

  .channel-grid {
    grid-template-columns: 1fr;
  }

  .site-header nav > p {
    padding: 0 8px;
    gap: 6px;
  }
  .site-header nav > p > a {
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .footer-logo-text {
    font-size: 2.2rem;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }

  .page-hero-section,
  .about-header-section,
  .privacy-header-section,
  .article-header-section,
  .default-section {
    padding: 40px 0 20px;
  }

  .article-meta { gap: 10px; }
}

/* 确保首屏可见 h1（避免被底部 nav 遮挡） */
.hero-section .hero-text h1,
.page-hero-article h1,
.about-header-article h1,
.privacy-header-article h1,
.article-header-article h1,
.default-article h1 {
  position: relative;
  z-index: 1;
}

/* 无障碍焦点 */
:focus-visible {
  outline: 2px solid var(--c-green);
  outline-offset: 3px;
  border-radius: 4px;
}
