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

:root{
  --green:#1F6F43;
  --green-d:#154A2D;
  --brown:#C97B3D;
  --cream:#F5EFE4;
  --ink:#1E221D;
  --muted:#5B5F53;
  --line:#D9CFBE;
  --mono:"Roboto Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
}

*,*::before,*::after{box-sizing:border-box}

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

body{
  margin:0;
  background:var(--cream);
  color:var(--ink);
  font-family:"Exo","PingFang SC","Microsoft YaHei",system-ui,-apple-system,sans-serif;
  font-size:17px;
  line-height:1.75;
  -webkit-font-smoothing:antialiased;
}

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

a{color:var(--green-d)}

:focus-visible{outline:3px solid var(--brown);outline-offset:2px}

h1,h2,h3,h4{font-weight:700;line-height:1.2}

hr{
  border:0;
  border-top:2px solid var(--brown);
  margin:14px 0;
  height:0;
}

/* 顶部两行：品牌独占一行，菜单另起一行 */
.topbar{
  position:sticky;
  top:0;
  z-index:40;
  background:var(--cream);
  border-bottom:2px solid var(--ink);
}

.brandrow{
  display:flex;
  align-items:center;
  padding:12px 18px;
  border-bottom:2px solid var(--line);
}

.brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-height:40px;
  text-decoration:none;
  color:var(--ink);
}

.mark{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  background:var(--green);
  color:var(--cream);
  font-family:var(--mono);
  font-weight:700;
  font-size:17px;
  line-height:1;
}

.brandname{
  font-size:19px;
  font-weight:700;
  letter-spacing:.1em;
}

.menurow{
  background:var(--green);
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}

.menulist{
  display:flex;
  margin:0;
  padding:0;
  list-style:none;
  white-space:nowrap;
}

.menulist a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:12px 15px;
  color:var(--cream);
  font-size:16px;
  font-weight:500;
  letter-spacing:.04em;
  text-decoration:none;
  border-right:1px solid rgba(245,239,228,.28);
  transition:background-color .18s ease,color .18s ease;
}

.menulist a:hover,
.menulist a:focus-visible{
  background:var(--cream);
  color:var(--green);
}

/* 首屏：左图右文，文案右对齐，点阵底纹 */
.hero{
  position:relative;
  display:grid;
  grid-template-columns:1.05fr .95fr;
  align-items:center;
  gap:clamp(18px,4vw,48px);
  min-height:70vh;
  padding:clamp(24px,5vw,56px) clamp(18px,4vw,48px);
  background-color:var(--cream);
  background-image:radial-gradient(var(--line) 1.4px,transparent 1.4px);
  background-size:22px 22px;
  border-bottom:3px solid var(--green);
  overflow:hidden;
}

.hero-art{
  position:relative;
  margin:0;
  aspect-ratio:4/3;
  border:3px solid var(--ink);
  background:var(--cream);
  overflow:hidden;
  will-change:transform;
}

.shape{position:absolute;display:block;z-index:1}

.s1{
  left:0;top:0;
  width:46%;height:46%;
  background:var(--green);
}

.s2{
  right:0;bottom:0;
  width:38%;height:38%;
  background:var(--brown);
}

.hero-img{
  position:relative;
  z-index:2;
  width:100%;
  height:100%;
  object-fit:cover;
}

.hero-copy{text-align:right}

.kicker{
  margin:0 0 12px;
  font-family:var(--mono);
  font-size:13px;
  letter-spacing:.3em;
  color:var(--brown);
}

.hero-copy h1{
  margin:0;
  font-size:clamp(2rem,5.2vw,3.5rem);
  letter-spacing:-.01em;
}

.lead{
  margin:18px 0 0 auto;
  max-width:32ch;
  color:var(--muted);
  font-size:17px;
}

/* 正文区：左侧索引栏 + 主内容 */
.body-grid{
  display:grid;
  grid-template-columns:260px minmax(0,1fr);
}

.side{
  position:sticky;
  top:108px;
  align-self:start;
  max-height:calc(100vh - 130px);
  overflow:auto;
  padding:26px 18px;
  border-right:2px solid var(--line);
  background:rgba(31,111,67,.05);
}

.side-title{
  margin:0 0 8px;
  font-family:var(--mono);
  font-size:14px;
  font-weight:500;
  letter-spacing:.16em;
  color:var(--green);
}

.side hr{width:52px;border-top-width:3px;margin:0 0 14px}

.jump{
  margin:0;
  padding:0;
  list-style:none;
}

.jump a{
  display:flex;
  align-items:baseline;
  gap:10px;
  min-height:40px;
  padding:9px 6px;
  font-size:16px;
  color:var(--ink);
  text-decoration:none;
  border-bottom:1px dashed var(--line);
  transition:background-color .15s ease,color .15s ease;
}

.jump .num{
  font-family:var(--mono);
  font-size:12px;
  color:var(--brown);
}

.jump a:hover,
.jump a:focus-visible{
  background:var(--green);
  color:var(--cream);
}

.jump a:hover .num,
.jump a:focus-visible .num{color:var(--cream)}

.content{
  max-width:840px;
  padding:clamp(22px,4vw,48px);
  min-width:0;
}

.content div{
  scroll-margin-top:124px;
  padding:0 0 34px;
}

.content div + div{
  padding-top:32px;
  border-top:2px solid var(--line);
}

.content h2{
  margin:0 0 6px;
  font-size:clamp(1.35rem,2.6vw,1.9rem);
  color:var(--green);
}

.content h2 + hr{
  width:72px;
  border-top-width:3px;
  margin:0 0 18px;
}

.content h3{
  margin:24px 0 8px;
  font-size:1.16rem;
}

.content h3 + hr{width:44px;margin:0 0 12px;border-top-width:2px}

.content p{margin:0 0 16px;max-width:68ch}

.content ul,
.content ol{margin:0 0 16px;padding-left:1.25em}

.content li{margin:0 0 8px}

.content a{text-underline-offset:3px}

.content figure{
  margin:22px 0;
  border:3px solid var(--ink);
  background:var(--cream);
}

.content figcaption{
  padding:8px 10px;
  border-top:2px solid var(--line);
  font-family:var(--mono);
  font-size:14px;
  color:var(--muted);
}

.content aside{
  margin:22px 0;
  padding:14px 16px;
  border-left:6px solid var(--brown);
  background:rgba(201,123,61,.12);
}

.content aside p:last-child{margin-bottom:0}

.content blockquote{
  margin:22px 0;
  padding:12px 16px;
  border-left:6px solid var(--green);
  background:rgba(31,111,67,.07);
}

.content blockquote p:last-child{margin-bottom:0}

.content table{
  width:100%;
  border-collapse:collapse;
  margin:0 0 18px;
  font-size:16px;
}

.content th,
.content td{
  border:2px solid var(--line);
  padding:8px 10px;
  text-align:left;
}

.content th{background:rgba(31,111,67,.1)}

/* 页脚：单行极简，分区两段 */
.foot{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px 18px;
  background:var(--green);
  color:var(--cream);
  border-top:3px solid var(--ink);
}

.foot div{margin:0}

.copy{
  margin:0;
  font-family:var(--mono);
  font-size:14px;
  letter-spacing:.04em;
}

.totop{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:6px 14px;
  border:2px solid rgba(245,239,228,.7);
  color:var(--cream);
  font-size:16px;
  text-decoration:none;
  transition:background-color .16s ease,color .16s ease;
}

.totop:hover,
.totop:focus-visible{
  background:var(--cream);
  color:var(--green);
}

/* 入场动画 */
.stag{
  opacity:0;
  transform:translateY(14px);
  transition:opacity .32s ease,transform .32s ease;
}

.stag.in{
  opacity:1;
  transform:none;
}

@media (max-width:860px){
  .hero{
    grid-template-columns:1fr;
    min-height:0;
    padding:20px 18px 26px;
    background-size:16px 16px;
  }

  .hero-copy{order:1}
  .hero-art{order:2;aspect-ratio:16/10}

  .lead{margin-left:auto;max-width:48ch}

  .body-grid{grid-template-columns:1fr}

  .side{
    position:static;
    max-height:none;
    border-right:0;
    border-bottom:2px solid var(--line);
    padding:16px 18px;
  }

  .jump{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
  }

  .jump li{flex:0 0 auto}

  .jump a{
    border-bottom:0;
    border:2px solid var(--line);
    padding:8px 11px;
  }

  .content{padding:20px 18px}

  .content div{scroll-margin-top:116px}

  .foot{justify-content:space-between}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .stag{opacity:1;transform:none;transition:none}
  .hero-art{transform:none !important}
}

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