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

/* ===== 基础重置与CSS变量 ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --c-mint: #99ffcc;
  --c-green: #00ff41;
  --c-deep: #001e3c;
  --c-deep-2: #002a56;
  --c-deep-3: #003470;
  --c-mint-dim: rgba(153,255,204,0.12);
  --c-green-dim: rgba(0,255,65,0.08);
  --c-text: #c8f5e0;
  --c-text-dim: #7fbfa0;
  --c-text-muted: #4a8a6a;
  --c-border: rgba(153,255,204,0.15);
  --font-display: 'Playfair Display SC', Georgia, serif;
  --font-body: 'Karla', system-ui, -apple-system, sans-serif;
  --nav-h: 64px;
  --radius: 10px;
  --radius-lg: 18px;
  --max-w: 1200px;
  --content-w: 780px;
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

html {
  scroll-behavior: smooth;
}

body.theme-dark {
  background-color: var(--c-deep);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--c-mint);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover,
a:focus-visible {
  color: var(--c-green);
}

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

ul, ol {
  list-style: none;
}

/* ===== 有机浮动球 ===== */
.orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.18;
  animation: orb-breathe 8s ease-in-out infinite;
}

.orb--1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--c-mint) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.orb--2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--c-green) 0%, transparent 70%);
  bottom: 100px;
  left: -80px;
  animation-delay: 4s;
}

@keyframes orb-breathe {
  0%, 100% { transform: scale(1) translateY(0); opacity: 0.18; }
  50% { transform: scale(1.15) translateY(-20px); opacity: 0.28; }
}

/* ===== 页面包裹 ===== */
.page-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--nav-h);
}

/* ===== 底部固定导航 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(0,20,50,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--c-border);
  height: var(--nav-h);
}

.bottom-nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  gap: 0.5rem;
  position: relative;
}

.bottom-nav__brand {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-mint);
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.bottom-nav__brand:hover {
  color: var(--c-green);
}

.bottom-nav__left,
.bottom-nav__right {
  display: flex;
  align-items: center;
}

.bottom-nav__left ul,
.bottom-nav__right ul {
  display: flex;
  gap: 0;
}

.bottom-nav__left a,
.bottom-nav__right a {
  font-size: 0.78rem;
  color: var(--c-text-dim);
  padding: 0.6rem 0.6rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  transition: color var(--transition);
  border-radius: 6px;
}

.bottom-nav__left a:hover,
.bottom-nav__right a:hover {
  color: var(--c-mint);
  background: var(--c-mint-dim);
}

/* details/summary 导航 */
.bottom-nav__more {
  position: relative;
}

.bottom-nav__more > summary {
  font-size: 0.78rem;
  color: var(--c-text-dim);
  padding: 0.6rem 0.75rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.bottom-nav__more > summary::-webkit-details-marker { display: none; }

.bottom-nav__more[open] > summary,
.bottom-nav__more > summary:hover {
  color: var(--c-mint);
  background: var(--c-mint-dim);
}

.bottom-nav__dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,20,50,0.98);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  min-width: 200px;
  padding: 0.5rem 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 200;
}

.bottom-nav__dropdown li a {
  display: block;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  color: var(--c-text-dim);
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: background var(--transition), color var(--transition);
}

.bottom-nav__dropdown li a:hover {
  background: var(--c-mint-dim);
  color: var(--c-mint);
}

/* ===== Hero（首页） ===== */
.hero {
  position: relative;
  min-height: 45vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c-deep) 0%, var(--c-deep-3) 60%, #002818 100%);
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(0,30,60,0.85) 40%, rgba(0,100,50,0.25) 100%);
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  padding: 3rem 2rem 4rem;
  text-align: right;
}

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

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(0,255,65,0.2);
}

.hero__sub {
  font-size: 1rem;
  color: var(--c-text-dim);
  max-width: 480px;
  margin-left: auto;
  line-height: 1.7;
}

/* 色带/弧形底边 */
.hero__arc {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--c-deep);
  clip-path: ellipse(55% 100% at 50% 100%);
  z-index: 3;
}

/* ===== 页面 Banner（内页） ===== */
.page-banner {
  position: relative;
  padding: 3rem 2rem 3.5rem;
  background: linear-gradient(135deg, var(--c-deep-3) 0%, var(--c-deep) 100%);
  border-bottom: 1px solid var(--c-border);
  overflow: hidden;
}

.page-banner::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(0,255,65,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.page-banner__content {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.page-banner__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--c-mint);
  margin-top: 0.75rem;
  line-height: 1.3;
}

.page-banner__arc {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--c-deep);
  clip-path: ellipse(60% 100% at 50% 100%);
}

/* ===== 面包屑 ===== */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--c-text-muted);
}

.breadcrumb:hover { color: var(--c-mint); }

.breadcrumb__sep {
  margin: 0 0.4rem;
  color: var(--c-text-muted);
  font-size: 0.75rem;
}

.breadcrumbs {
  font-size: 0.82rem;
  color: var(--c-text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.breadcrumbs a {
  color: var(--c-text-muted);
}

.breadcrumbs a:hover { color: var(--c-mint); }

.breadcrumbs span:last-child {
  color: var(--c-text-dim);
}

/* ===== 主内容区 ===== */
.main-content {
  flex: 1;
  padding: 2.5rem 0 3rem;
  position: relative;
  z-index: 1;
}

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* 带侧边栏布局 */
.layout-with-aside {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  align-items: start;
}

.layout-with-aside__main {
  min-width: 0;
}

/* ===== 正文容器 main > article.wrap > section > div ===== */
.content-section {
  margin-bottom: 2rem;
}

.prose {
  color: var(--c-text);
  font-size: 1rem;
  line-height: 1.8;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--c-mint);
  margin: 2rem 0 0.75rem;
}

.prose h3 {
  font-size: 1.1rem;
  color: var(--c-text);
  margin: 1.5rem 0 0.5rem;
  font-weight: 600;
}

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

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

.prose ol { list-style: decimal; }

.prose li { margin-bottom: 0.4rem; }

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

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

.prose strong { color: var(--c-mint); font-weight: 600; }

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

/* ===== section-block ===== */
.section-block {
  margin: 2.5rem 0;
  padding: 0 1.5rem;
}

/* ===== eyebrow / small 眉题 ===== */
.eyebrow,
small.eyebrow {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--c-green);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-family: var(--font-body);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  color: var(--c-mint);
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

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

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

.card {
  display: block;
  background: var(--c-mint-dim);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--c-mint), var(--c-green));
  opacity: 0;
  transition: opacity var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(153,255,204,0.35);
  background: rgba(153,255,204,0.16);
}

.card:hover::before { opacity: 1; }

.card__body {
  padding: 1.25rem 1rem;
}

.card__title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--c-mint);
  margin-bottom: 0.5rem;
  line-height: 1.35;
  font-weight: 400;
}

.card__desc {
  font-size: 0.82rem;
  color: var(--c-text-dim);
  line-height: 1.6;
}

/* ===== Story 列表 ===== */
.story-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.story-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
  color: var(--c-text);
}

.story-item:hover {
  background: var(--c-mint-dim);
  border-color: var(--c-border);
  color: var(--c-mint);
}

.story-item__num {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--c-text-muted);
  min-width: 2rem;
  flex-shrink: 0;
}

.story-item__title {
  flex: 1;
  font-size: 0.92rem;
}

.story-item__date {
  font-size: 0.75rem;
  color: var(--c-text-muted);
  white-space: nowrap;
}

/* ===== dl 子页列表 ===== */
.children-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.children-list__dt {
  padding: 0.9rem 0 0.3rem;
  border-top: 1px solid var(--c-border);
}

.children-list__dt:first-of-type {
  border-top: none;
}

.children-list__dt a {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--c-mint);
  font-weight: 400;
  transition: color var(--transition);
}

.children-list__dt a:hover { color: var(--c-green); }

.children-list__dd {
  padding: 0 0 0.9rem;
}

.children-list__dd p {
  font-size: 0.88rem;
  color: var(--c-text-dim);
  margin-bottom: 0.25rem;
  line-height: 1.6;
}

.children-list__dd time {
  font-size: 0.75rem;
  color: var(--c-text-muted);
}

/* ===== 侧边栏 ===== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 1.5rem;
}

.sidebar__widget {
  background: rgba(0,42,86,0.5);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.sidebar__widget::after {
  content: '';
  position: absolute;
  bottom: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(153,255,204,0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.sidebar__title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--c-text);
  margin-bottom: 0.9rem;
  font-weight: 400;
}

.sidebar__links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar__links li a {
  display: block;
  font-size: 0.84rem;
  color: var(--c-text-dim);
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(153,255,204,0.06);
  transition: color var(--transition), padding-left var(--transition);
}

.sidebar__links li:last-child a { border-bottom: none; }

.sidebar__links li a:hover {
  color: var(--c-mint);
  padding-left: 6px;
}

/* ===== 标签云 ===== */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  background: var(--c-green-dim);
  border: 1px solid rgba(0,255,65,0.2);
  border-radius: 100px;
  font-size: 0.78rem;
  color: var(--c-green);
  min-height: 32px;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.tag-pill:hover {
  background: rgba(0,255,65,0.18);
  border-color: var(--c-green);
  color: #fff;
}

/* ===== Story 页专用 ===== */
.story-main {
  padding-top: 2rem;
}

.story-header {
  padding: 0 1.5rem 1.5rem;
}

.story-date {
  display: block;
  font-size: 0.78rem;
  color: var(--c-text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.story-h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  color: var(--c-mint);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.story-lead {
  font-size: 1rem;
  color: var(--c-text-dim);
  line-height: 1.7;
  max-width: 600px;
  border-left: 2px solid var(--c-green);
  padding-left: 1rem;
}

.story-hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 0 1.5rem 1.5rem;
}

.story-hero__img {
  width: 100%;
  height: 320px;
  object-fit: cover;
}

.story-prose {
  padding: 0;
}

.story-modified {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--c-border);
  font-size: 0.8rem;
  color: var(--c-text-muted);
}

/* ===== About / Legal ===== */
.about-prose,
.legal-prose {
  max-width: var(--content-w);
}

.legal-date {
  font-size: 0.82rem;
  color: var(--c-text-muted);
  margin-bottom: 1.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--c-green-dim);
  border-left: 2px solid var(--c-green);
  border-radius: 0 4px 4px 0;
  display: inline-block;
}

/* ===== 页脚 ===== */
.site-footer {
  background: rgba(0,10,25,0.9);
  border-top: 1px solid var(--c-border);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: auto;
}

.site-footer__cols {
  max-width: var(--max-w);
  margin: 0 auto 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-col dt.footer-col__head {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--c-mint);
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--c-border);
  font-weight: 400;
}

.footer-col dd {
  margin: 0;
}

.footer-col dd a {
  display: block;
  font-size: 0.83rem;
  color: var(--c-text-dim);
  padding: 0.25rem 0;
  transition: color var(--transition);
}

.footer-col dd a:hover { color: var(--c-mint); }

.footer-desc {
  font-size: 0.78rem;
  color: var(--c-text-muted);
  line-height: 1.6;
  margin-top: 0.5rem;
}

.site-footer__bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-border);
}

.site-footer__bottom p {
  font-size: 0.78rem;
  color: var(--c-text-muted);
}

/* ===== Stagger 动画 ===== */
@media (prefers-reduced-motion: no-preference) {
  .stagger-item {
    opacity: 0;
    transform: translateY(16px);
    animation: stagger-in 0.5s ease forwards;
    animation-delay: calc(var(--i, 0) * 0.07s);
  }
}

@keyframes stagger-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stagger-item {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .orb {
    animation: none;
  }
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .layout-with-aside {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .site-footer__cols {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  :root {
    --nav-h: 56px;
  }

  body.theme-dark {
    font-size: 16px;
  }

  .bottom-nav__inner {
    padding: 0 0.5rem;
  }

  .bottom-nav__left,
  .bottom-nav__right {
    display: none;
  }

  .bottom-nav__brand {
    font-size: 0.72rem;
    padding: 0.5rem;
    flex: 1;
    justify-content: center;
  }

  .bottom-nav__more > summary {
    font-size: 0.75rem;
    padding: 0.5rem 0.6rem;
  }

  .hero__content {
    padding: 2rem 1rem 3rem;
    text-align: right;
  }

  .hero__sub {
    font-size: 0.9rem;
  }

  .page-banner {
    padding: 2rem 1rem 2.5rem;
  }

  .section-block {
    padding: 0 1rem;
  }

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

  .story-hero {
    margin: 0 1rem 1rem;
  }

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

  .site-footer__cols {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .wrap {
    padding: 0 1rem;
  }
}

@media (max-width: 380px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}
