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

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

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

body {
  margin: 0;
  background: #ffffff;
  color: #000000;
  font-family: "Nunito Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.78;
  font-weight: 400;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; }
img { display: block; }
a { color: inherit; }
p { margin: 0 0 1.1rem; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4 {
  font-family: "Varela Round", "Nunito Sans", "PingFang SC", sans-serif;
  font-weight: 400;
  margin: 0 0 1rem;
  line-height: 1.18;
}

h3 { font-size: 1.15rem; }

::selection { background: #000; color: #fff; }

/* ---------- 页头：品牌独占一行，下方平铺文字导航 ---------- */
.site-head {
  background: #000;
  color: #fff;
  padding: 16px 24px 8px;
  border-bottom: 2px solid #000;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: .35em;
  text-decoration: none;
  color: #fff;
  font-family: "Varela Round", "Nunito Sans", "PingFang SC", sans-serif;
  font-size: clamp(1.55rem, 5.2vw, 2.05rem);
  line-height: 1.1;
  letter-spacing: .04em;
  padding: 6px 0;
  min-height: 44px;
}

.brand-mark { font-size: .8em; opacity: .8; }

.top-nav {
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, .38);
  padding-top: 4px;
}

.top-nav p {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  margin: 0;
}

.top-nav a {
  display: inline-block;
  padding: 11px 0;
  min-height: 44px;
  text-decoration: none;
  font-size: .95rem;
  letter-spacing: .03em;
  border-bottom: 1px solid transparent;
  transition: border-color .18s ease, opacity .18s ease;
}

.top-nav a:hover,
.top-nav a:focus-visible { border-bottom-color: #fff; }

/* ---------- 主体：非对称栅格，正文居左，侧栏在右 ---------- */
.mag {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 244px;
  column-gap: 3rem;
  counter-reset: sec;
}

.masthead {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  text-align: right;
  padding: 3.2rem 0 2.2rem;
  border-bottom: 2px solid #000;
}

.masthead-mark {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
  overflow: hidden;
}

.masthead-mark span {
  font-family: "Varela Round", "PingFang SC", sans-serif;
  font-size: clamp(86px, 20vw, 240px);
  line-height: .78;
  white-space: nowrap;
  opacity: .07;
  transform: translateX(-8%);
}

.masthead h1 {
  position: relative;
  margin: 0;
  max-width: 20ch;
  font-size: clamp(1.95rem, 5.6vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: .01em;
}

.masthead h2 {
  position: relative;
  margin: 1.1rem 0 0;
  font-size: clamp(.95rem, 2.4vw, 1.12rem);
  letter-spacing: .26em;
  color: #000;
}

.masthead .subtitle {
  position: relative;
  margin: .95rem 0 0;
  max-width: 46ch;
  color: #333;
  font-size: .96rem;
  line-height: 1.7;
  border-top: 1px solid #000;
  padding-top: .8rem;
}

/* ---------- 正文区块 ---------- */
.mag > article {
  grid-column: 1;
  padding: 2.7rem 0;
  border-bottom: 1px solid #000;
  scroll-margin-top: 22px;
}

.mag > article:not(.masthead) { counter-increment: sec; }

.mag > article:not(.masthead) h2 {
  font-size: clamp(1.32rem, 3.1vw, 1.85rem);
  line-height: 1.22;
  margin-bottom: 1.1rem;
  text-wrap: balance;
}

.mag > article:not(.masthead) h2::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  margin-bottom: .55rem;
  font-family: "Nunito Sans", sans-serif;
  font-size: .74rem;
  letter-spacing: .34em;
  color: #555;
}

.mag > article:not(.masthead) > p:first-of-type::first-letter {
  float: left;
  font-family: "Varela Round", "PingFang SC", sans-serif;
  font-size: 3.1em;
  line-height: .84;
  padding: .08em .12em 0 0;
}

.mag > article p { max-width: 66ch; }
.mag > article ul, .mag > article ol { padding-left: 1.3rem; margin: 0 0 1.1rem; }
.mag > article li { margin-bottom: .5rem; }

.mag blockquote {
  margin: 1.9rem 0;
  padding: .3rem 0 .3rem 1.2rem;
  border-left: 4px solid #000;
  font-family: "Varela Round", "PingFang SC", sans-serif;
  font-size: 1.12rem;
  line-height: 1.6;
}

.mag figure { margin: 1.7rem 0; }
.mag figcaption {
  margin-top: .55rem;
  padding-top: .45rem;
  border-top: 1px solid #000;
  font-size: .86rem;
  color: #444;
  line-height: 1.6;
}

.mag a { text-underline-offset: 3px; }
.mag > article a:hover { opacity: .68; }

/* ---------- 右侧栏 ---------- */
.rail {
  grid-column: 2;
  grid-row: 2 / span 60;
  align-self: start;
  position: sticky;
  top: 16px;
  margin-top: 2.7rem;
  padding-left: 1rem;
  border-left: 2px solid #000;
  font-size: .94rem;
}

.rail-title {
  margin: 0 0 .5rem;
  font-size: .74rem;
  letter-spacing: .3em;
  color: #555;
}

.rail ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rail;
}

.rail li { counter-increment: rail; }

.rail a {
  display: block;
  padding: 11px 0;
  min-height: 42px;
  text-decoration: none;
  border-bottom: 1px dotted #b4b4b4;
  line-height: 1.35;
}

.rail a::before {
  content: counter(rail, decimal-leading-zero);
  margin-right: .55em;
  font-size: .72rem;
  letter-spacing: .12em;
  color: #666;
}

.rail a:hover,
.rail a:focus-visible { border-bottom-color: #000; }

/* ---------- 页脚 ---------- */
.site-foot {
  margin-top: 3.2rem;
  padding: 22px 24px;
  background: #000;
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 26px;
}

.foot-brand a {
  font-family: "Varela Round", "PingFang SC", sans-serif;
  font-size: clamp(1.45rem, 6.4vw, 2.45rem);
  line-height: 1.1;
  letter-spacing: .03em;
  text-decoration: none;
  color: #fff;
  display: inline-block;
  padding: 4px 0;
}

.foot-nav p {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
  margin: 0;
}

.foot-nav a {
  display: inline-block;
  padding: 11px 0;
  min-height: 42px;
  font-size: .88rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.foot-nav a:hover,
.foot-nav a:focus-visible { border-bottom-color: #fff; }

.foot-legal { font-size: .88rem; letter-spacing: .06em; opacity: .8; }

/* ---------- 滚动显现 ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .65s ease, transform .65s ease;
}

.js .reveal.in { opacity: 1; transform: none; }

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid #fff;
  border-radius: 4px;
  background: #000;
  color: #fff;
  font-family: "Varela Round", "PingFang SC", sans-serif;
  font-size: .9rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

.to-top.on { opacity: 1; visibility: visible; }
.to-top:hover { background: #fff; color: #000; }

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  .mag { grid-template-columns: minmax(0, 1fr); column-gap: 0; }
  .masthead { min-height: 0; padding: 2.4rem 0 1.9rem; }
  .masthead h1 { max-width: none; }
  .rail {
    grid-column: 1;
    grid-row: auto;
    position: static;
    margin: 1.9rem 0 0;
    padding: 1.2rem 0 0;
    border-left: 0;
    border-top: 2px solid #000;
  }
  .mag > article p { max-width: none; }
}

@media (max-width: 600px) {
  body { font-size: 16.5px; }
  .site-head { padding: 14px 18px 6px; }
  .mag { padding: 0 18px; }
  .site-foot { padding: 18px; }
  .masthead-mark span { opacity: .06; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .to-top { transition: none; }
  .top-nav a, .foot-nav a { transition: none; }
}

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