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

:root{
  --ink:#1f1f1f;
  --bg:#f5f5f5;
  --paper:#ffffff;
  --muted:#4a4a4a;
  --line:rgba(31,31,31,.14);
  --r:18px;
}

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

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

body{
  margin:0;
  overflow-x:hidden;
  background:var(--bg);
  color:var(--ink);
  font-family:"Comic Neue","Baloo 2",system-ui,-apple-system,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  font-size:17px;
  line-height:1.78;
}

img{display:block;max-width:100%;height:auto}
a{color:inherit;text-decoration-thickness:1.5px;text-underline-offset:3px}
:focus-visible{outline:3px solid var(--ink);outline-offset:2px}

/* 左侧竖排导航 */
.rail{
  position:fixed;
  top:0;bottom:0;left:0;
  z-index:30;
  display:flex;
  flex-direction:column;
  gap:16px;
  width:250px;
  padding:20px 16px;
  overflow-y:auto;
  background:var(--paper);
  border-right:2px solid var(--ink);
}

.brand{
  display:block;
  padding:8px 12px;
  border:2px solid var(--ink);
  border-radius:14px;
  background:var(--bg);
  font-family:"Baloo 2","Comic Neue",system-ui,sans-serif;
  font-size:22px;
  font-weight:700;
  line-height:1.35;
  text-align:center;
  text-decoration:none;
  transition:background .22s ease,color .22s ease;
}
.brand:hover,.brand:focus-visible{background:var(--ink);color:var(--paper)}

.rail-nav{display:flex;flex-direction:column;gap:6px}

.rail-nav a{
  position:relative;
  display:flex;
  align-items:center;
  min-height:44px;
  padding:8px 10px 8px 28px;
  border:2px solid transparent;
  border-radius:12px;
  font-size:16px;
  line-height:1.4;
  text-decoration:none;
  transition:background .22s ease,border-color .22s ease,transform .22s ease;
}
.rail-nav a::before{
  content:"";
  position:absolute;
  left:11px;
  width:10px;
  height:10px;
  border-radius:3px;
  background:var(--ink);
  opacity:.32;
  transition:opacity .22s ease,transform .22s ease;
}
.rail-nav a:hover,.rail-nav a:focus-visible{
  background:var(--bg);
  border-color:var(--ink);
  transform:translateX(2px);
}
.rail-nav a:hover::before,.rail-nav a:focus-visible::before{opacity:1;transform:rotate(45deg)}

.rail-top{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  margin-top:auto;
  border:2px solid var(--ink);
  border-radius:999px;
  font-size:15px;
  text-decoration:none;
  transition:background .22s ease,color .22s ease;
}
.rail-top:hover,.rail-top:focus-visible{background:var(--ink);color:var(--paper)}

/* 画布 */
.canvas{
  display:flex;
  flex-direction:column;
  min-height:100vh;
  margin-left:250px;
}

.announce{
  margin:0;
  padding:10px 40px;
  background:var(--paper);
  border-bottom:2px solid var(--ink);
  color:var(--muted);
  font-size:15px;
  line-height:1.55;
}

main{flex:1 1 auto}

/* 首屏 */
.hero{
  position:relative;
  display:grid;
  grid-template-columns:1.05fr .95fr;
  gap:34px;
  align-items:end;
  min-height:70vh;
  padding:48px 40px 56px;
  overflow:hidden;
}
.hero::before{
  content:"";
  position:absolute;
  left:-8%;
  right:-8%;
  bottom:7%;
  height:96px;
  z-index:0;
  background:rgba(255,255,255,.92);
  border-top:2px solid rgba(31,31,31,.5);
  border-bottom:2px solid rgba(31,31,31,.5);
  transform:skewY(-5deg);
}

.hero-media{
  position:relative;
  z-index:1;
  align-self:center;
  overflow:hidden;
  aspect-ratio:5/4;
  border:2px solid var(--ink);
  border-radius:24px;
  background-color:var(--bg);
  background-image:repeating-linear-gradient(-45deg,#ffffff 0 12px,#f0f0f0 12px 24px);
}
.hero-img{width:100%;height:100%;object-fit:cover}

.hero-text{
  position:relative;
  z-index:1;
  text-align:right;
}

h1{
  margin:0 0 16px;
  font-size:clamp(30px,4vw,52px);
  line-height:1.22;
  letter-spacing:-.01em;
}

.hero-desc{
  max-width:34ch;
  margin:0 0 0 auto;
  color:#3d3d3d;
  font-size:17px;
}

/* 正文 */
.wrap{
  width:100%;
  max-width:960px;
  margin:0 auto;
  padding:8px 40px 72px;
}

.post{display:grid;gap:18px}

.post > section{
  padding:26px 28px;
  border:2px solid var(--ink);
  border-radius:var(--r);
  background:var(--paper);
  scroll-margin-top:24px;
}
.post > section:nth-child(even){
  width:calc(100% - 30px);
  justify-self:end;
}

.post h2,.post h3{
  margin:0 0 12px;
  line-height:1.36;
}
.post h2{font-size:clamp(20px,2.4vw,26px)}
.post h3{font-size:19px}

.post h2 > span,.post h3 > span,.foot-h > span{
  position:relative;
  display:inline-block;
  padding-bottom:6px;
}
.post h2 > span::after,.post h3 > span::after,.foot-h > span::after{
  content:"";
  position:absolute;
  left:0;bottom:0;
  width:100%;
  height:4px;
  border-radius:2px;
  background:var(--ink);
  opacity:.85;
}

.post p{margin:0 0 14px}
.post ul,.post ol{margin:0 0 14px;padding-left:1.4em}
.post li{margin-bottom:6px}
.post blockquote{
  margin:0 0 14px;
  padding:10px 16px;
  border-left:4px solid var(--ink);
  background:var(--bg);
  border-radius:0 12px 12px 0;
}
.post > section > :last-child{margin-bottom:0}

/* 页脚 */
.site-foot{
  margin-top:auto;
  padding:32px 40px 20px;
  background:var(--paper);
  border-top:2px solid var(--ink);
}

.foot-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:26px;
  max-width:760px;
}

.foot-h{
  margin:0 0 10px;
  font-size:15px;
  font-weight:600;
  letter-spacing:.14em;
}
.foot-h > span{padding-bottom:8px}
.foot-h > span::after{height:3px;opacity:1}

.foot-grid dl{margin:0}
.foot-grid dt{margin:0}
.foot-grid dd{margin:0;color:var(--muted);font-size:15px}
.foot-grid a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:2px 0;
  font-size:15px;
  text-decoration:none;
}
.foot-grid a:hover,.foot-grid a:focus-visible{text-decoration:underline}

.foot-bar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-top:22px;
  padding-top:14px;
  border-top:2px solid var(--ink);
  font-size:15px;
}
.foot-bar p{margin:0}
.foot-bar a{display:inline-flex;align-items:center;min-height:40px;text-decoration:none}
.foot-bar a:hover{text-decoration:underline}

@media (prefers-reduced-motion: no-preference){
  .post > section{transition:transform .28s ease,border-color .28s ease}
  .post > section:hover{transform:scale(1.012);border-color:var(--ink)}
  .reveal{opacity:0;transform:translateY(16px)}
  .reveal.in{
    opacity:1;
    transform:none;
    transition:opacity .55s ease,transform .55s ease;
  }
}

@media (max-width:860px){
  .rail{
    position:static;
    width:auto;
    gap:10px;
    padding:12px 16px;
    overflow:visible;
    border-right:0;
    border-bottom:2px solid var(--ink);
  }
  .brand{align-self:flex-start;padding:6px 14px;font-size:19px}
  .rail-nav{flex-direction:row;flex-wrap:wrap;gap:6px}
  .rail-nav a{
    min-height:40px;
    padding:6px 12px 6px 24px;
    font-size:15px;
    border-color:var(--line);
  }
  .rail-nav a::before{left:9px;width:8px;height:8px}
  .rail-top{align-self:flex-start;margin-top:2px;padding:0 18px}

  .canvas{margin-left:0}
  .announce{padding:8px 16px;font-size:14px}

  .hero{
    grid-template-columns:1fr;
    min-height:0;
    gap:16px;
    padding:26px 16px 34px;
  }
  .hero::before{height:70px;bottom:4%}
  .hero-text{order:-1;text-align:left}
  .hero-desc{margin-left:0;max-width:none}
  .hero-media{order:2;aspect-ratio:16/10;border-radius:20px}

  .wrap{padding:6px 16px 48px}
  .post > section{padding:18px 16px;width:100%;justify-self:stretch}

  .site-foot{padding:24px 16px 16px}
  .foot-grid{grid-template-columns:1fr;gap:10px}
}

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