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

:root{
  --paper:#fafaf8;
  --ink:#1a1a1a;
  --mid:#4a4a4a;
  --rule:#cfcec7;
  --wash:#f2f1ec;
  --card:#ffffff;
}

*{box-sizing:border-box}

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

body{
  margin:0;
  background-color:var(--paper);
  color:var(--ink);
  font-family:'Fira Code','Share Tech Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:17px;
  line-height:1.72;
  background-image:
    repeating-linear-gradient(0deg,rgba(26,26,26,.032) 0 1px,transparent 1px 4px),
    repeating-linear-gradient(90deg,rgba(26,26,26,.018) 0 1px,transparent 1px 6px);
}

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

a{
  color:var(--ink);
  text-decoration:none;
  background-image:linear-gradient(var(--ink),var(--ink));
  background-repeat:no-repeat;
  background-size:100% 1px;
  background-position:0 100%;
}

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

[id]{scroll-margin-top:16px}

.sheet{
  max-width:1080px;
  margin:0 auto;
  padding:0 clamp(14px,4vw,40px);
}

/* 页头：品牌独占一行，菜单平铺下一行 */
.masthead{
  padding-top:clamp(10px,2vw,20px);
}

.brandrow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-height:48px;
  padding:6px 0;
  background-size:0 1px;
}

.brand:hover{background-size:100% 2px}

.brandtext{
  font-size:clamp(18px,3.4vw,24px);
  font-weight:700;
  letter-spacing:.12em;
}

.mark{
  width:34px;
  height:34px;
  object-fit:contain;
  filter:grayscale(1) contrast(1.25);
  transform:rotate(-2deg);
}

.tabs{
  display:flex;
  flex-wrap:wrap;
  gap:0 4px;
  padding:4px 0 6px;
  border-top:2px dashed var(--rule);
  border-bottom:2px solid var(--ink);
}

.tabs a{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:0 8px;
  font-size:16px;
  color:var(--mid);
  background-size:0 1px;
  transition:background-size .14s steps(2), color .14s steps(2);
}

.tabs a:hover,
.tabs a:focus-visible{
  color:var(--ink);
  background-size:100% 2px;
}

/* 首屏 */
.hero{
  min-height:45vh;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  align-items:flex-end;
  text-align:right;
  padding:clamp(28px,7vw,64px) 0 clamp(18px,4vw,30px);
  background-image:radial-gradient(var(--rule) 1px,transparent 1px);
  background-size:14px 14px;
  background-position:center bottom;
}

.hero h1{
  margin:0;
  font-size:clamp(2.3rem,9vw,4.6rem);
  line-height:1.04;
  font-weight:700;
  letter-spacing:-.015em;
}

.lead{
  max-width:50ch;
  margin:14px 0 0;
  font-size:16px;
  line-height:1.6;
  color:var(--mid);
}

.herofig{
  width:120px;
  height:9px;
  margin:18px 0 0;
  background:var(--ink);
  opacity:.16;
  transform:rotate(-1.6deg);
}

/* 正文 + 侧栏 */
.spread{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:clamp(18px,3vw,30px);
  padding:8px 0 56px;
}

.col-main{
  min-width:0;
}

.col-main > div{
  padding:clamp(22px,4vw,34px) 0;
  border-top:2px dashed var(--rule);
}

.col-main > div:first-child{
  border-top:0;
  padding-top:0;
}

.col-main h2{
  margin:0 0 8px;
  font-size:clamp(1.35rem,4vw,1.9rem);
  line-height:1.24;
  letter-spacing:.005em;
}

.col-main h2 + hr,
.side h2 + hr{
  border:0;
  border-top:3px solid var(--ink);
  width:64px;
  margin:0 0 18px;
}

.col-main h3{
  margin:26px 0 8px;
  font-size:1.1rem;
  line-height:1.35;
}

.col-main h3::before{
  content:"";
  display:inline-block;
  width:9px;
  height:9px;
  margin-right:8px;
  background:var(--mid);
  transform:rotate(12deg);
  vertical-align:middle;
}

.col-main p{
  margin:0 0 14px;
  max-width:68ch;
}

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

.col-main li{margin:0 0 6px}

.col-main figure{
  margin:20px 0;
  padding:10px;
  background:var(--card);
  border-radius:18px;
  box-shadow:0 8px 20px rgba(26,26,26,.09);
  transform:rotate(-.4deg);
}

.col-main figcaption{
  margin-top:8px;
  font-size:16px;
  line-height:1.55;
  color:var(--mid);
}

.col-main img{
  border-radius:12px;
  filter:grayscale(.28) contrast(1.05);
}

.col-main blockquote{
  margin:20px 0;
  padding:12px 16px;
  border-left:4px solid var(--mid);
  background:rgba(74,74,74,.055);
  color:var(--mid);
}

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

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

.col-main th,
.col-main td{
  border-bottom:1px dashed var(--rule);
  padding:9px 6px;
  text-align:left;
}

.side{
  background:var(--card);
  border:2px solid var(--ink);
  border-radius:18px;
  padding:16px 16px 10px;
  box-shadow:0 10px 22px rgba(26,26,26,.11);
  transform:rotate(.6deg);
}

.side h2{
  margin:0 0 8px;
  font-size:1.02rem;
  line-height:1.3;
  letter-spacing:.16em;
}

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

.sidelist a{
  display:flex;
  align-items:center;
  min-height:42px;
  padding:2px 2px;
  font-size:16px;
  line-height:1.3;
  color:var(--mid);
  border-bottom:1px dotted var(--rule);
  background-size:0 1px;
}

.sidelist li:last-child a{border-bottom:0}

.sidelist a:hover,
.sidelist a:focus-visible{
  color:var(--ink);
  background-size:100% 2px;
}

/* 页脚 */
.base{
  border-top:3px solid var(--ink);
  background:var(--wash);
  background-image:repeating-linear-gradient(180deg,rgba(26,26,26,.03) 0 1px,transparent 1px 5px);
  padding:0 clamp(14px,4vw,40px) 8px;
  margin:0 calc(-1 * clamp(14px,4vw,40px));
}

.cta{
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  justify-content:space-between;
  gap:14px;
  padding:clamp(26px,5vw,46px) 0 clamp(18px,4vw,28px);
  border-bottom:2px dashed var(--rule);
}

.ctabig{
  margin:0;
  font-size:clamp(1.8rem,7.5vw,3rem);
  line-height:1.05;
  font-weight:700;
  letter-spacing:-.01em;
}

.ctago{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:0 18px;
  font-size:16px;
  border:2px solid var(--ink);
  border-radius:999px;
  background:var(--card);
  box-shadow:3px 3px 0 var(--ink);
  background-size:0 1px;
}

.ctago:hover,
.ctago:focus-visible{
  transform:translate(2px,2px);
  box-shadow:1px 1px 0 var(--ink);
  background-size:0 1px;
}

.cols{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:18px;
  padding:clamp(20px,4vw,32px) 0;
}

.cols dl{margin:0}

.cols dt{
  margin:0 0 4px;
  font-size:16px;
  font-weight:600;
  letter-spacing:.06em;
}

.cols dd{
  margin:0;
  font-size:16px;
  color:var(--mid);
}

.fnav dl{
  display:grid;
  gap:0;
}

.fnav dt{margin:0}

.fnav a{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  padding:0 2px;
  font-size:16px;
  font-weight:400;
  color:var(--mid);
  background-size:0 1px;
}

.fnav a:hover,
.fnav a:focus-visible{
  color:var(--ink);
  background-size:100% 2px;
}

.fcol a{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  color:var(--mid);
  background-size:0 1px;
}

.fcol a:hover,
.fcol a:focus-visible{
  color:var(--ink);
  background-size:100% 2px;
}

.bar{
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:10px;
  padding:12px 0 24px;
  border-top:2px dashed var(--rule);
  font-size:16px;
  color:var(--mid);
}

.bar p{margin:0}

.bar a{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  color:var(--mid);
}

/* 滚动显现 */
.js .rv{
  opacity:0;
  transform:translateY(12px);
}

.js .rv.in{
  opacity:1;
  transform:none;
  transition:opacity .18s steps(2), transform .18s steps(2);
}

@media (min-width:700px){
  .cols{grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}
}

@media (min-width:820px){
  .spread{
    grid-template-columns:minmax(0,1fr) 244px;
    align-items:start;
    gap:34px;
  }
  .side{
    position:sticky;
    top:20px;
  }
  .tabs a{font-size:16px;padding:0 10px}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .js .rv{opacity:1;transform:none;transition:none}
  .ctago:hover,
  .ctago:focus-visible{transform:none;box-shadow:3px 3px 0 var(--ink)}
}

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