:root{
  --violet:#56228b;
  --violet-soft:#7c4cb2;
  --ochre:#8b4513;
  --ochre-soft:#b4713c;
  --ink:#1f1726;
  --cream:#f5eee1;
  --panel:#fffdf7;
  --line:#e0d2bb;
  --muted:#5b5069;
  --pix:"Press Start 2P",ui-monospace,SFMono-Regular,Menlo,monospace;
  --sans:"PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,-apple-system,sans-serif;
  --shadow:0 16px 32px -24px rgba(31,23,38,.8);
}

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

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

body{
  margin:0;
  font-family:var(--sans);
  font-size:17px;
  line-height:1.78;
  color:var(--ink);
  background-color:var(--cream);
  background-image:radial-gradient(rgba(139,69,19,.15) 1px,transparent 1px);
  background-size:18px 18px;
  overflow-x:hidden;
}

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

a{color:var(--violet);text-underline-offset:3px;}

:focus-visible{outline:3px solid var(--ochre);outline-offset:2px;border-radius:5px;}

p{margin:0 0 1rem;}

/* 顶部细条 */
.topline{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.55rem;
  padding:.6rem .9rem;
  background:var(--violet);
  color:#f7ecdd;
  font-family:var(--pix);
  font-size:11px;
  letter-spacing:.1em;
  text-align:center;
}
.topline .pulse{
  flex:none;
  width:8px;
  height:8px;
  border-radius:50%;
  background:#e7c9a3;
  animation:pulse 2.6s ease-out infinite;
}
@keyframes pulse{
  0%{box-shadow:0 0 0 0 rgba(231,201,163,.65)}
  70%{box-shadow:0 0 0 11px rgba(231,201,163,0)}
  100%{box-shadow:0 0 0 0 rgba(231,201,163,0)}
}

/* 顶栏 */
.topbar{
  position:sticky;
  top:0;
  z-index:60;
  display:flex;
  align-items:center;
  gap:.65rem;
  padding:.5rem .75rem;
  background:rgba(245,238,225,.95);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line);
}
.mark{
  flex:none;
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  border-radius:17px 13px 19px 14px;
  background:linear-gradient(150deg,var(--violet),var(--ochre));
  color:#fff;
  text-decoration:none;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.mark img{width:100%;height:100%;object-fit:cover;}
.mark-txt{font-family:var(--pix);font-size:15px;line-height:1;}

.pills{
  flex:1;
  display:flex;
  gap:.4rem;
  overflow-x:auto;
  scrollbar-width:none;
  padding:.1rem 0;
  -webkit-overflow-scrolling:touch;
}
.pills::-webkit-scrollbar{display:none;}
.pill{
  flex:none;
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:.5rem .95rem;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--ink);
  font-size:16px;
  white-space:nowrap;
  text-decoration:none;
  transition:background .2s ease,color .2s ease,border-color .2s ease;
}
.pill:hover,.pill:focus-visible{
  background:var(--violet);
  border-color:var(--violet);
  color:#fff;
}

/* 主区 */
main{display:block;}
main div{scroll-margin-top:112px;}

.hero{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:70vh;
  padding:4.5rem 1.2rem 3.5rem;
  overflow:hidden;
  border-radius:0 0 28px 28px;
  background-color:var(--ink);
  background-image:
    radial-gradient(circle at 18% 18%,rgba(86,34,139,.95),transparent 62%),
    radial-gradient(circle at 82% 76%,rgba(139,69,19,.9),transparent 58%);
}
.hero-fig{
  position:absolute;
  inset:0;
  margin:0;
  z-index:0;
}
.hero-fig img{
  width:100%;
  height:100%;
  object-fit:cover;
  transform:scale(1.06);
  will-change:transform;
}
.hero-veil{
  position:absolute;
  inset:0;
  z-index:1;
  background:linear-gradient(180deg,rgba(31,23,38,.45),rgba(31,23,38,.82));
}
.hero::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:2;
  background-image:radial-gradient(rgba(255,255,255,.28) 1px,transparent 1px);
  background-size:16px 16px;
  opacity:.35;
  pointer-events:none;
}
.blob{
  position:absolute;
  z-index:2;
  top:-40px;
  right:-50px;
  width:230px;
  height:230px;
  fill:rgba(124,76,178,.5);
  filter:blur(2px);
  animation:float 13s ease-in-out infinite;
  pointer-events:none;
}
@keyframes float{
  0%,100%{transform:translate3d(0,0,0) rotate(0deg)}
  50%{transform:translate3d(-14px,18px,0) rotate(8deg)}
}
.hero-copy{
  position:relative;
  z-index:3;
  max-width:46rem;
  text-align:center;
}
.hero h1{
  margin:0;
  font-size:clamp(1.85rem,5vw,3.2rem);
  line-height:1.42;
  letter-spacing:.015em;
  color:#fffaf3;
  text-shadow:0 6px 26px rgba(0,0,0,.5);
}

/* 右侧定位轨 */
.rail{
  position:fixed;
  z-index:40;
  right:12px;
  top:50%;
  transform:translateY(-50%);
  display:none;
  flex-direction:column;
  gap:2px;
  padding:8px 6px;
  border-radius:22px;
  background:rgba(255,253,247,.92);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}
.rail .dot{
  position:relative;
  display:grid;
  place-items:center;
  width:34px;
  height:40px;
  text-decoration:none;
}
.rail .dot::before{
  content:"";
  width:9px;
  height:9px;
  border-radius:50%;
  background:var(--line);
  transition:background .2s ease,transform .2s ease;
}
.rail .dot:hover::before,.rail .dot:focus-visible::before{
  background:var(--violet);
  transform:scale(1.5);
}
.rail .dot span{
  position:absolute;
  right:44px;
  white-space:nowrap;
  font-size:14px;
  padding:.3rem .6rem;
  border-radius:999px;
  background:var(--ink);
  color:#fff;
  opacity:0;
  transform:translateX(6px);
  transition:opacity .2s ease,transform .2s ease;
  pointer-events:none;
}
.rail .dot:hover span,.rail .dot:focus-visible span{opacity:1;transform:none;}

/* 正文区块 */
main > div:not(.hero){
  width:calc(100% - 1.6rem);
  max-width:68rem;
  margin:1.1rem auto;
  padding:1.6rem 1.15rem 1.9rem;
  background:var(--panel);
  border-radius:10px;
  border-bottom:3px solid var(--ochre);
  box-shadow:var(--shadow);
}
main > div:not(.hero):nth-of-type(even){
  border-bottom-color:var(--violet);
  background:linear-gradient(180deg,#fffdf7,#fbf6ec);
}
main > div:not(.hero) h2{
  margin:1.4rem 0 .7rem;
  padding-left:.7rem;
  font-size:1.3rem;
  line-height:1.5;
  border-left:5px solid var(--violet);
}
main > div:not(.hero) h3{
  margin:1.2rem 0 .5rem;
  font-size:1.1rem;
  line-height:1.55;
  color:var(--ochre);
}
main > div:not(.hero) h2:first-child,
main > div:not(.hero) h3:first-child{margin-top:0;}
main > div:not(.hero) a{
  color:var(--violet);
  text-decoration:underline;
  padding:2px 1px;
}
main > div:not(.hero) ul,
main > div:not(.hero) ol{
  margin:0 0 1.1rem;
  padding-left:1.3rem;
}
main > div:not(.hero) li{margin:.35rem 0;}
main > div:not(.hero) figure,
main > div:not(.hero) aside{
  margin:1.2rem 0;
  padding:1rem;
  border-radius:16px;
  background:#f3ebdd;
  border:1px solid var(--line);
}
main > div:not(.hero) figcaption{
  font-size:.9rem;
  color:var(--muted);
  margin-top:.5rem;
}
main > div:not(.hero) blockquote{
  margin:1.1rem 0;
  padding:.7rem 1rem;
  border-left:4px solid var(--ochre-soft);
  background:#f7f0e4;
  border-radius:0 14px 14px 0;
  color:#3a2f42;
}
main > div:not(.hero) img{border-radius:12px;}

/* 交错动画初态由脚本加类 */
main > div.fx{
  opacity:0;
  transform:translateY(16px);
  transition:opacity .6s ease,transform .6s ease;
}
main > div.fx.in{opacity:1;transform:none;}

/* 页脚 */
.foot{
  position:relative;
  margin-top:2.6rem;
  padding:2.3rem 1.1rem .9rem;
  background:var(--ink);
  color:#f0e7de;
  border-radius:26px 26px 0 0;
  overflow:hidden;
}
.foot::after{
  content:"";
  position:absolute;
  z-index:0;
  left:-80px;
  bottom:-110px;
  width:260px;
  height:260px;
  border-radius:52% 48% 60% 40%/45% 55% 45% 55%;
  background:radial-gradient(circle at 40% 40%,rgba(86,34,139,.75),rgba(86,34,139,0) 70%);
  pointer-events:none;
}
.foot-cols{
  position:relative;
  z-index:1;
  max-width:68rem;
  margin:0 auto;
  display:grid;
  gap:1.6rem;
  grid-template-columns:1fr;
}
.foot dl{margin:0;}
.foot dt,.foot dd{margin:0;}
.col-title h2{
  margin:0 0 .55rem;
  font-size:.95rem;
  line-height:1.5;
  letter-spacing:.16em;
  color:#e9cba4;
}
.col-title h2 span{
  display:inline-block;
  padding-bottom:.25rem;
  border-bottom:3px dotted rgba(233,203,164,.55);
}
.foot-nav a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:.35rem 0;
  color:#f4ece3;
  text-decoration:none;
  border-bottom:1px dashed rgba(255,255,255,.16);
  transition:color .2s ease;
}
.foot-nav a:hover,.foot-nav a:focus-visible{color:#f0c9f7;}
.foot-about dd{color:#cdbfd7;}

.sub{display:flex;flex-wrap:wrap;gap:.5rem;}
.sub input{
  flex:1 1 9rem;
  min-height:44px;
  padding:.5rem .8rem;
  font-family:inherit;
  font-size:16px;
  color:var(--ink);
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:999px;
}
.sub button{
  min-height:44px;
  padding:.5rem 1.1rem;
  font-family:inherit;
  font-size:16px;
  color:#fff;
  background:var(--violet);
  border:1px solid var(--violet-soft);
  border-radius:999px;
  cursor:pointer;
  transition:background .2s ease;
}
.sub button:hover{background:var(--ochre);border-color:var(--ochre);}

.foot-base{
  position:relative;
  z-index:1;
  max-width:68rem;
  margin:1.4rem auto 0;
  padding-top:.9rem;
  border-top:1px solid rgba(255,255,255,.15);
  font-size:.85rem;
  color:#b8aac3;
}
.foot-base p{margin:0;}

/* 断点 */
@media (min-width:640px){
  main > div:not(.hero){padding:2.1rem 2rem 2.3rem;margin:1.5rem auto;}
  .hero{padding:5.5rem 1.5rem 4rem;}
}
@media (min-width:760px){
  .foot-cols{grid-template-columns:1.1fr 1fr 1fr;}
  .foot{padding:2.8rem 1.6rem 1.1rem;}
}
@media (min-width:900px){
  main > div:not(.hero){padding:2.6rem 2.6rem 2.8rem;}
  .hero h1{letter-spacing:.02em;}
}
@media (min-width:1180px){
  .rail{display:flex;}
  main > div:not(.hero){margin:1.7rem auto;}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto;}
  *,*::before,*::after{animation-duration:.001ms !important;animation-iteration-count:1 !important;transition-duration:.001ms !important;}
  main > div.fx{opacity:1;transform:none;}
}

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