@import url('https://fonts.googleapis.com/css2?family=Calistoga:ital@0;1&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root{
  --lime:#87ff71;
  --sun:#ffce5c;
  --ink:#192617;
  --bg:#0f1a0e;
  --bg2:#16230f;
  --paper:#1c2b18;
  --tx:#eaf6e4;
  --dim:#b7ccae;
  --line:rgba(135,255,113,.32);
  --sans:'Inter',system-ui,-apple-system,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif;
  --disp:'Calistoga',Georgia,'Songti SC',serif;
  --mono:'JetBrains Mono',ui-monospace,monospace;
}

*{box-sizing:border-box}

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

body{
  margin:0;
  background:var(--bg);
  color:var(--tx);
  font-family:var(--sans);
  font-size:17px;
  line-height:1.7;
  overflow-x:hidden;
  padding-bottom:180px;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  background-image:radial-gradient(circle,rgba(135,255,113,.16) 1.2px,transparent 1.3px);
  background-size:20px 20px;
  opacity:.55;
}

a{color:var(--lime)}

/* ---------- 底部固定条导航 ---------- */
.topbar{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:60;
  display:flex;
  flex-wrap:wrap;
  gap:.2rem .5rem;
  padding:.5rem .6rem calc(.5rem + env(safe-area-inset-bottom));
  background:rgba(15,26,14,.95);
  border-top:2px dashed var(--lime);
  box-shadow:0 -10px 34px rgba(0,0,0,.5);
}

.brand{
  order:-1;
  flex:1 0 100%;
  text-align:center;
  font-family:var(--disp);
  font-size:1.2rem;
  letter-spacing:.08em;
  color:var(--sun);
  text-decoration:none;
  padding:.15rem 0 .3rem;
  border-bottom:2px dotted rgba(255,206,92,.35);
}

.brand:hover{color:var(--lime)}

.nav{flex:1 1 0;min-width:0}

.nav p{
  margin:0;
  display:flex;
  flex-wrap:wrap;
  gap:.15rem;
  justify-content:center;
}

.nav a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:0 .55rem;
  font-size:1rem;
  font-weight:500;
  color:var(--tx);
  text-decoration:none;
  border-radius:10px;
  border-bottom:3px solid transparent;
  white-space:nowrap;
  transition:transform .18s ease,background .18s ease,color .18s ease,border-color .18s ease;
}

.nav a:hover,
.nav a:focus-visible{
  background:var(--lime);
  color:var(--ink);
  border-bottom-color:var(--sun);
  transform:translateY(-2px) rotate(-1.4deg);
}

/* ---------- 主体 ---------- */
main{position:relative;z-index:1}

.hero{
  position:relative;
  overflow:hidden;
  display:grid;
  gap:1.1rem;
  padding:1.5rem 1.05rem 2.8rem;
  background:linear-gradient(165deg,#1d2e17 0%,#101a0f 62%,#0f1a0e 100%);
  clip-path:polygon(0 0,100% 0,100% calc(100% - 1.8rem),0 100%);
}

.hero::before{
  content:"";
  position:absolute;
  inset:0;
  background-image:
    repeating-linear-gradient(45deg,rgba(255,206,92,.09) 0 2px,transparent 2px 15px),
    radial-gradient(circle,rgba(135,255,113,.22) 1.4px,transparent 1.5px);
  background-size:auto,22px 22px;
  pointer-events:none;
}

.hero-txt{position:relative;order:1}

h1{
  position:relative;
  font-family:var(--disp);
  font-weight:400;
  font-size:clamp(2rem,7.4vw,3.7rem);
  line-height:1.06;
  letter-spacing:.005em;
  margin:0 0 .7rem;
  color:#fff;
  text-shadow:3px 3px 0 rgba(25,38,23,.9);
  display:inline-block;
}

h1::after{
  content:"";
  position:absolute;
  left:0;
  right:-6px;
  bottom:-.28rem;
  height:8px;
  background:repeating-linear-gradient(90deg,var(--sun) 0 11px,transparent 11px 20px);
}

.lede{
  margin:.9rem 0 0;
  max-width:46ch;
  color:var(--dim);
  font-size:1.02rem;
  line-height:1.65;
}

.hero-art{
  position:relative;
  order:2;
  margin:0;
  height:190px;
  border-radius:10px;
  overflow:hidden;
  border:2px solid rgba(135,255,113,.55);
  background:
    repeating-linear-gradient(135deg,rgba(135,255,113,.1) 0 6px,transparent 6px 16px),
    var(--bg2);
}

.hero-img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius:8px;
  filter:saturate(1.12) contrast(1.03);
}

.shape{position:absolute;pointer-events:none}

.shape-a{
  width:66px;
  height:66px;
  border-radius:50%;
  background:var(--sun);
  top:-14px;
  right:12%;
  mix-blend-mode:screen;
  opacity:.9;
}

.shape-b{
  width:0;
  height:0;
  border-left:24px solid transparent;
  border-right:24px solid transparent;
  border-bottom:42px solid var(--lime);
  bottom:.4rem;
  left:5%;
  transform:rotate(13deg);
  opacity:.92;
}

.shape-c{
  width:64px;
  height:64px;
  border-radius:10px;
  background:repeating-linear-gradient(45deg,var(--sun) 0 3px,transparent 3px 9px);
  top:24%;
  left:3%;
  transform:rotate(-9deg);
  opacity:.85;
}

/* ---------- 正文 + 右侧栏 ---------- */
.shell{
  display:grid;
  gap:1.7rem;
  max-width:1120px;
  margin:0 auto;
  padding:1.7rem 1.05rem 0;
}

.prose{
  min-width:0;
  font-size:1.05rem;
  line-height:1.75;
}

.prose article{
  padding-top:1.9rem;
  margin-top:1.9rem;
  border-top:2px dashed rgba(135,255,113,.24);
  scroll-margin-top:1rem;
}

.prose article:first-child{
  padding-top:0;
  margin-top:0;
  border-top:0;
}

.prose h2{
  font-family:var(--disp);
  font-weight:400;
  font-size:clamp(1.45rem,4.2vw,2.05rem);
  line-height:1.22;
  margin:0 0 .45rem;
  color:var(--lime);
  letter-spacing:.01em;
}

.prose h3{
  font-family:var(--disp);
  font-weight:400;
  font-size:1.22rem;
  line-height:1.32;
  margin:1.5rem 0 .55rem;
  color:var(--sun);
}

.prose p{margin:0 0 1.05rem}
.prose p:last-child{margin-bottom:0}

.prose hr{
  border:0;
  height:6px;
  margin:.25rem 0 1.15rem;
  background:repeating-linear-gradient(90deg,var(--sun) 0 12px,transparent 12px 22px);
  opacity:.8;
}

.prose a{
  color:var(--lime);
  text-decoration:underline;
  text-decoration-style:dashed;
  text-underline-offset:3px;
}

.prose a:hover{
  background:var(--lime);
  color:var(--ink);
  text-decoration:none;
}

.prose ul,
.prose ol{
  margin:0 0 1.15rem;
  padding-left:1.25rem;
}

.prose li{margin:.4rem 0}
.prose li::marker{color:var(--sun)}

.prose strong{color:var(--sun)}

.prose figure{
  margin:1.25rem 0;
  padding:0;
  border-radius:10px;
  overflow:hidden;
  border-bottom:5px solid var(--sun);
}

.prose img{
  display:block;
  max-width:100%;
  height:auto;
  border-radius:10px;
}

.prose blockquote{
  margin:1.25rem 0;
  padding:.95rem 1.05rem .95rem 1.15rem;
  background:var(--paper);
  border-left:7px solid var(--sun);
  border-bottom:4px solid var(--lime);
  border-radius:10px;
  color:var(--tx);
}

.prose table{
  width:100%;
  display:block;
  overflow-x:auto;
  border-collapse:collapse;
  margin:1.2rem 0;
  font-size:.99rem;
}

.prose th,
.prose td{
  border:1px dashed rgba(135,255,113,.38);
  padding:.55rem .65rem;
  text-align:left;
}

.prose th{background:rgba(135,255,113,.1)}

.prose time{
  font-family:var(--mono);
  font-size:.86rem;
  color:var(--dim);
}

.prose code{
  font-family:var(--mono);
  font-size:.9em;
  background:#0a1308;
  border-radius:6px;
  padding:.08rem .35rem;
}

.side{
  position:relative;
  align-self:start;
  background:var(--paper);
  border:2px dashed var(--lime);
  border-bottom:6px solid var(--sun);
  border-radius:10px;
  padding:1rem 1rem 1.15rem;
}

.side-h{
  font-family:var(--disp);
  font-weight:400;
  font-size:1.12rem;
  letter-spacing:.03em;
  color:var(--sun);
  margin:0 0 .5rem;
}

.side-rule{
  border:0;
  height:5px;
  width:58px;
  margin:0 0 .9rem;
  background:var(--lime);
}

.side-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:.2rem;
}

.side-list a{
  display:flex;
  align-items:center;
  min-height:42px;
  padding:.2rem .5rem;
  color:var(--tx);
  font-size:1rem;
  text-decoration:none;
  border-radius:10px;
  border-bottom:2px solid rgba(135,255,113,.22);
  transition:transform .16s ease,background .16s ease,color .16s ease,border-color .16s ease;
}

.side-list a:hover,
.side-list a:focus-visible{
  background:var(--lime);
  color:var(--ink);
  border-bottom-color:var(--sun);
  transform:translateX(4px);
}

/* ---------- 页脚 ---------- */
.foot{
  position:relative;
  z-index:1;
  margin-top:2.8rem;
  padding:2.2rem 1.05rem 1.8rem;
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  justify-content:space-between;
  gap:.7rem 1rem;
  border-top:3px solid var(--ink);
  background:linear-gradient(0deg,#0a1308,rgba(10,19,8,0));
}

.foot-brand{
  flex:1 0 100%;
  margin:0;
  font-family:var(--disp);
  font-size:clamp(2.6rem,13vw,5.2rem);
  line-height:.9;
  letter-spacing:.05em;
  color:rgba(135,255,113,.14);
  -webkit-text-stroke:2px var(--lime);
  word-break:break-word;
}

.foot-copy{
  margin:0;
  color:var(--dim);
}

.foot-copy small{
  font-family:var(--mono);
  font-size:.86rem;
}

.foot-links{
  margin:0;
  display:flex;
  gap:.9rem;
}

.foot-links a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  color:var(--sun);
  text-decoration:none;
  border-bottom:2px dashed var(--sun);
}

.foot-links a:hover{color:var(--lime);border-color:var(--lime)}

/* ---------- 动效 ---------- */
@keyframes pop{
  from{opacity:0;transform:translateY(9px)}
  to{opacity:1;transform:none}
}

.nav a,
.side-list li{
  animation:pop .45s ease both;
}

.nav a:nth-child(2),.side-list li:nth-child(2){animation-delay:.05s}
.nav a:nth-child(3),.side-list li:nth-child(3){animation-delay:.1s}
.nav a:nth-child(4),.side-list li:nth-child(4){animation-delay:.15s}
.nav a:nth-child(5),.side-list li:nth-child(5){animation-delay:.2s}
.nav a:nth-child(6),.side-list li:nth-child(6){animation-delay:.25s}
.nav a:nth-child(7),.side-list li:nth-child(7){animation-delay:.3s}

/* ---------- 大屏 ---------- */
@media (min-width:860px){
  body{padding-bottom:104px}

  .topbar{
    display:grid;
    grid-template-columns:1fr auto 1fr;
    align-items:center;
    gap:1rem;
    padding:.55rem 1.5rem calc(.55rem + env(safe-area-inset-bottom));
  }

  .brand{
    order:0;
    flex:none;
    font-size:1.55rem;
    padding:0 1.4rem;
    border-bottom:0;
    border-left:2px dotted rgba(255,206,92,.4);
    border-right:2px dotted rgba(255,206,92,.4);
    line-height:1.9;
  }

  .nav p{flex-wrap:nowrap}
  .nav-a p{justify-content:flex-end}
  .nav-b p{justify-content:flex-start}

  .hero{
    grid-template-columns:1.02fr .98fr;
    align-items:center;
    gap:2.2rem;
    min-height:45vh;
    padding:2.4rem 2rem 3.4rem;
  }

  .hero-txt{padding-left:1rem}
  .hero-art{height:clamp(230px,34vh,330px)}

  .shell{
    grid-template-columns:minmax(0,1fr) 17.5rem;
    gap:2.6rem;
    padding:2.2rem 1.6rem 0;
  }

  .side{position:sticky;top:1.6rem}

  .foot{padding:2.6rem 1.6rem 2rem}
  .foot-brand{font-size:clamp(3.4rem,9vw,5.6rem)}
}

@media (min-width:1180px){
  .hero{padding-left:2.6rem;padding-right:2.6rem}
  .shell{padding-left:2rem;padding-right:2rem}
  .foot{padding-left:2rem;padding-right:2rem}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,
  *::before,
  *::after{
    animation:none !important;
    transition:none !important;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
