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

:root{
  --paper:#fafaf8;
  --ink:#1a1a1a;
  --gray:#4a4a4a;
  --card:#fffdf7;
  --mono:'Fira Code',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --sans:'Fira Sans','Helvetica Neue',Arial,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;
  --edge:clamp(16px,5vw,48px);
}

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

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

body{
  margin:0;
  overflow-x:clip;
  background-color:var(--paper);
  color:var(--ink);
  font-family:var(--sans);
  font-size:17px;
  line-height:1.75;
  font-weight:400;
  padding-bottom:calc(104px + env(safe-area-inset-bottom));
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  opacity:.42;
  mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23g)' opacity='0.5'/></svg>");
  background-size:160px 160px;
}

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

a{color:var(--ink)}

:focus-visible{outline:3px dashed var(--ink);outline-offset:3px}

/* ---------- 底部固定条 ---------- */
.dock{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:30;
  display:flex;
  align-items:center;
  gap:8px;
  padding:9px 12px calc(9px + env(safe-area-inset-bottom));
  background:var(--paper);
  border-top:2px solid var(--ink);
  border-bottom:0;
}
.dock::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:-6px;
  height:6px;
  background:repeating-linear-gradient(90deg,var(--ink) 0 12px,transparent 12px 22px);
  opacity:.55;
}

.dock-mark{
  flex:0 0 auto;
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  border:2px solid var(--ink);
  border-radius:12px;
  background:var(--card);
  text-decoration:none;
  overflow:hidden;
  transform:rotate(-2deg);
}
.dock-mark img{width:40px;height:40px;object-fit:cover;display:block}
.mark-txt{
  font-family:var(--mono);
  font-size:11px;
  line-height:1.05;
  font-weight:600;
  letter-spacing:-.02em;
  text-align:center;
  padding:2px;
}

.dock-group{position:relative;flex:0 0 auto}
.dock-group summary{
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:0 14px;
  border:2px solid var(--ink);
  border-radius:999px;
  background:var(--card);
  font-family:var(--mono);
  font-size:16px;
  cursor:pointer;
  user-select:none;
  transform:rotate(-1deg);
}
.dock-group:nth-of-type(2) summary{transform:rotate(1deg)}
.dock-group summary::-webkit-details-marker{display:none}
.dock-group[open] summary{background:var(--ink);color:var(--paper)}

.dock-group menu{
  position:absolute;
  left:0;
  bottom:calc(100% + 12px);
  width:min(74vw,286px);
  max-height:58vh;
  overflow:auto;
  margin:0;
  padding:8px;
  list-style:none;
  background:var(--card);
  border:2px solid var(--ink);
  border-radius:20px;
  transform:rotate(-.7deg);
  box-shadow:6px 6px 0 rgba(26,26,26,.12);
}
.dock-group + .dock-group menu{left:auto;right:0;transform:rotate(.7deg)}

.dock-group menu a{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  padding:6px 8px;
  border-radius:12px;
  text-decoration:none;
  font-size:16px;
  border-bottom:1px dashed rgba(26,26,26,.22);
}
.dock-group menu li:last-child a{border-bottom:0}
.dock-group menu a:hover,.dock-group menu a:focus-visible{background:rgba(26,26,26,.07)}

.idx{
  font-family:var(--mono);
  font-size:13px;
  color:var(--gray);
  flex:0 0 auto;
}
.nm{flex:1 1 auto}

.dock-cta{
  margin-left:auto;
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:0 18px;
  border:2px solid var(--ink);
  border-radius:999px;
  background:var(--ink);
  color:var(--paper);
  font-family:var(--mono);
  font-size:16px;
  text-decoration:none;
  transform:rotate(-1.6deg);
}

/* ---------- 头图 ---------- */
main{position:relative;z-index:1}

.hero{
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1.02fr) minmax(0,.98fr);
  gap:clamp(18px,4vw,44px);
  align-items:end;
  min-height:70vh;
  padding:clamp(34px,7vw,80px) var(--edge) clamp(58px,8vw,92px);
  clip-path:polygon(0 0,100% 0,100% 94%,0 100%);
  background:
    repeating-linear-gradient(0deg,rgba(26,26,26,.05) 0 1px,transparent 1px 26px),
    #f4f3ed;
  overflow:hidden;
}
.hero::after{
  content:"";
  position:absolute;
  left:-4%;
  right:-4%;
  bottom:0;
  height:15px;
  background:var(--ink);
  transform:rotate(-.9deg);
}

.hero-copy{
  position:relative;
  border-left:3px dashed var(--ink);
  padding-left:clamp(14px,3vw,24px);
}

.hero-title{
  font-family:var(--mono);
  font-weight:700;
  font-size:clamp(30px,6.6vw,54px);
  line-height:1.16;
  letter-spacing:-.03em;
  margin:0 0 .5em;
  word-break:break-word;
}
.hero-title::after{
  content:"";
  display:block;
  width:min(74%,260px);
  height:8px;
  margin-top:.4em;
  background:repeating-linear-gradient(115deg,var(--ink) 0 10px,transparent 10px 17px);
  opacity:.7;
}

.hero-lede{
  margin:0;
  max-width:46ch;
  color:var(--gray);
  font-size:17px;
  line-height:1.7;
}

.hero-fig{
  position:relative;
  margin:0;
  aspect-ratio:4/5;
  border:2.5px solid var(--ink);
  border-radius:28px;
  background:var(--card);
  overflow:hidden;
  transform:rotate(-1.5deg);
}
.hero-fig img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  filter:grayscale(1) contrast(1.1);
}
.hero-fig::before{
  content:"";
  position:absolute;
  top:-9px;
  left:26px;
  width:78px;
  height:20px;
  background:rgba(74,74,74,.26);
  border-left:1px dashed rgba(26,26,26,.45);
  border-right:1px dashed rgba(26,26,26,.45);
  transform:rotate(-6deg);
  z-index:2;
}

/* ---------- 正文区 ---------- */
.spread{
  position:relative;
  display:grid;
  grid-template-columns:186px minmax(0,1fr);
  gap:clamp(20px,4vw,52px);
  max-width:1100px;
  margin:0 auto;
  padding:clamp(38px,6vw,76px) var(--edge) clamp(30px,4vw,48px);
}

.notes{
  position:sticky;
  top:22px;
  align-self:start;
  border-left:2px solid var(--ink);
  padding-left:14px;
  transform:rotate(-.6deg);
}
.notes-title{
  font-family:var(--mono);
  font-size:16px;
  font-weight:600;
  margin:0 0 12px;
  letter-spacing:.02em;
}
.notes-title span{
  background-image:linear-gradient(transparent 70%,rgba(26,26,26,.22) 70%);
  padding:0 .14em;
}
.notes-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:2px;
}
.notes-list a{
  display:flex;
  gap:8px;
  align-items:baseline;
  min-height:40px;
  padding:6px 4px;
  text-decoration:none;
  font-size:16px;
  line-height:1.35;
  border-bottom:1px dashed rgba(26,26,26,.2);
}
.notes-list a:hover{background:rgba(26,26,26,.06)}

.prose{max-width:70ch;min-width:0}

.prose > section{
  --rot:-.22deg;
  position:relative;
  border:1.8px solid var(--ink);
  border-radius:28px;
  background:var(--card);
  padding:clamp(20px,3.6vw,42px);
  margin:0 0 clamp(24px,4vw,44px);
  scroll-margin-top:40px;
  transform:rotate(var(--rot));
}
.prose > section:nth-child(even){--rot:.3deg}
.prose > section::before{
  content:"";
  position:absolute;
  top:-9px;
  left:clamp(20px,8%,52px);
  width:62px;
  height:18px;
  background:rgba(74,74,74,.2);
  border-left:1px dashed rgba(26,26,26,.4);
  border-right:1px dashed rgba(26,26,26,.4);
  transform:rotate(-4deg);
  border-radius:2px;
}
.prose > div:nth-child(even)::before{transform:rotate(3deg)}

.prose h2,.prose h3{
  font-family:var(--mono);
  line-height:1.32;
  letter-spacing:-.015em;
  margin:0 0 .65em;
  font-weight:600;
}
.prose h2{font-size:clamp(21px,3.4vw,27px)}
.prose h3{font-size:18px;margin-top:1.2em}
.prose h2 > span,.prose h3 > span{
  background-image:linear-gradient(transparent 72%,rgba(26,26,26,.18) 72%);
  padding:0 .1em;
}

.prose p{margin:0 0 1.05em}
.prose p:last-child{margin-bottom:0}
.prose ul,.prose ol{margin:0 0 1.05em;padding-left:1.3em}
.prose li{margin:.35em 0}
.prose li::marker{color:var(--gray)}
.prose a{
  text-decoration:underline;
  text-decoration-style:dotted;
  text-underline-offset:3px;
  text-decoration-thickness:2px;
}
.prose strong{background:rgba(26,26,26,.09);padding:0 .16em}
.prose img{
  display:block;
  margin:1em 0;
  border:1.6px solid var(--ink);
  border-radius:18px;
  filter:grayscale(1) contrast(1.05);
}
.prose blockquote{
  margin:1.1em 0;
  padding:.2em 0 .2em 1em;
  border-left:3px dashed var(--gray);
  color:var(--gray);
}
.prose table{
  display:block;
  width:100%;
  overflow-x:auto;
  border-collapse:collapse;
  font-family:var(--mono);
  font-size:16px;
  margin:0 0 1.1em;
}
.prose th,.prose td{
  border:1.4px solid var(--ink);
  padding:8px 10px;
  text-align:left;
}
.prose hr{border:0;border-top:2px dashed var(--gray);margin:1.4em 0}

/* ---------- 尾段 ---------- */
.outro{
  position:relative;
  max-width:1100px;
  margin:0 auto;
  padding:0 var(--edge) clamp(36px,6vw,64px);
  display:grid;
  gap:20px;
  justify-items:start;
}
.outro-fig{
  margin:0;
  width:100%;
  border:2px solid var(--ink);
  border-radius:28px;
  background:var(--card);
  overflow:hidden;
  transform:rotate(.5deg);
}
.outro-fig img{
  display:block;
  width:100%;
  height:auto;
  filter:grayscale(1) contrast(1.06);
}
.backtop{
  margin:0;
  font-family:var(--mono);
  font-size:16px;
}
.backtop a{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:0 16px;
  border:2px dashed var(--ink);
  border-radius:999px;
  text-decoration:none;
}

/* ---------- 页脚 ---------- */
.foot{
  position:relative;
  z-index:1;
  border-top:2.5px solid var(--ink);
  background:#f1f0e9;
  padding:clamp(30px,5vw,56px) var(--edge) 0;
}
.foot-grid{
  display:grid;
  grid-template-columns:1.15fr .9fr 1fr;
  gap:clamp(20px,4vw,40px);
  max-width:1100px;
  margin:0 auto;
  align-items:start;
}
.foot-brand{
  font-style:normal;
  font-family:var(--mono);
  font-size:18px;
  font-weight:600;
  letter-spacing:-.01em;
  line-height:1.4;
  border-left:3px solid var(--ink);
  padding-left:12px;
  transform:rotate(-.8deg);
  word-break:break-word;
}
.foot-col h3{
  font-family:var(--mono);
  font-size:16px;
  font-weight:600;
  margin:0 0 10px;
}
.foot-col h3 span{
  background-image:linear-gradient(transparent 70%,rgba(26,26,26,.2) 70%);
  padding:0 .14em;
}
.foot-links{
  list-style:none;
  margin:0;
  padding:0;
}
.foot-links a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  font-size:16px;
  text-decoration:none;
  border-bottom:1px dashed rgba(26,26,26,.28);
}

.sub{display:flex;flex-wrap:wrap;gap:8px}
.sub input{
  flex:1 1 130px;
  min-height:44px;
  min-width:0;
  padding:0 12px;
  font-family:var(--sans);
  font-size:16px;
  color:var(--ink);
  background:var(--paper);
  border:2px solid var(--ink);
  border-radius:12px;
}
.sub button{
  flex:0 0 auto;
  min-height:44px;
  padding:0 18px;
  font-family:var(--mono);
  font-size:16px;
  color:var(--paper);
  background:var(--ink);
  border:2px solid var(--ink);
  border-radius:999px;
  cursor:pointer;
  transform:rotate(-1.2deg);
}

.foot-base{
  margin:clamp(24px,4vw,40px) 0 0;
  padding:14px 0 calc(14px + 4px);
  text-align:center;
  font-family:var(--mono);
  font-size:14px;
  color:var(--gray);
  border-top:2px dashed rgba(26,26,26,.4);
}

/* ---------- 显现 ---------- */
.js .hero-copy,
.js .hero-fig,
.js .notes,
.js .prose > *,
.js .outro-fig,
.js .backtop,
.js .foot-grid > *{
  opacity:0;
  transform:translateY(16px) rotate(var(--rot,0deg));
  transition:opacity .16s steps(2),transform .2s ease-out;
  transition-delay:calc(var(--i,0) * 55ms);
}
.js .in{
  opacity:1;
  transform:rotate(var(--rot,0deg));
}

/* ---------- 断点 ---------- */
@media (max-width:900px){
  .hero{
    grid-template-columns:1fr;
    min-height:0;
    align-items:start;
    padding-bottom:clamp(50px,9vw,70px);
  }
  .hero-fig{aspect-ratio:16/11;margin-top:6px}
  .spread{grid-template-columns:1fr;gap:24px;padding-top:32px}
  .notes{position:static;border-left:0;border-top:2px dashed var(--ink);padding:12px 0 0;transform:none}
  .notes-list{grid-template-columns:1fr 1fr;column-gap:12px}
  .foot-grid{grid-template-columns:1fr}
  .foot-brand{border-left-width:0;border-top:3px solid var(--ink);padding:10px 0 0;transform:none}
  .dock{gap:6px;padding-left:10px;padding-right:10px}
  .dock-group summary{padding:0 12px}
  .dock-cta{padding:0 14px}
}

@media (max-width:420px){
  .dock-group summary{font-size:15px;padding:0 10px}
  .dock-cta{font-size:15px;padding:0 12px}
  .notes-list{grid-template-columns:1fr}
}

@media (min-width:901px){
  .foot{padding-bottom:0}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  body::before{opacity:.3}
}

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