@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{
  --ink:#1f1726;
  --purple:#56228b;
  --purple-l:#7b3fb8;
  --brown:#8b4513;
  --brown-l:#a9612c;
  --sand:#f6f0e7;
  --sand-2:#efe5d7;
  --panel:#fffdfa;
  --line:#dccdb9;
  --muted:#6b5d70;
  --head-h:130px;
  --r1:24px;
  --r2:16px;
  --r3:10px;
  --sh:0 18px 36px -22px rgba(31,23,38,.5), 0 3px 10px -7px rgba(31,23,38,.22);
  --sans:"Fira Sans", -apple-system, "Segoe UI", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono:"Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html{
  scroll-behavior:smooth;
  -webkit-text-size-adjust:100%;
  scroll-padding-top:calc(var(--head-h) + 12px);
}

body{
  margin:0;
  font-family:var(--sans);
  font-size:17px;
  line-height:1.75;
  color:var(--ink);
  background-color:var(--sand);
  background-image:
    radial-gradient(58% 38% at 102% -4%, rgba(86,34,139,.11), transparent 72%),
    radial-gradient(52% 42% at -6% 26%, rgba(139,69,19,.11), transparent 70%),
    radial-gradient(40% 30% at 50% 108%, rgba(86,34,139,.07), transparent 74%);
  background-attachment:fixed;
  overflow-x:hidden;
}

h1,h2,h3,h4{
  font-weight:600;
  line-height:1.25;
  letter-spacing:-.005em;
  margin:0;
}

p{margin:0 0 1.1em}
a{color:var(--purple);text-decoration-thickness:1px;text-underline-offset:3px}
a:hover{color:var(--brown)}
img{display:block;max-width:100%;height:auto}
figure{margin:0}

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

.wrap{
  width:min(1140px, 100% - 36px);
  margin-inline:auto;
}

/* ---------- 顶部：品牌行 + 药丸菜单行 ---------- */
.site-head{
  position:sticky;
  top:0;
  z-index:40;
  background:rgba(246,240,231,.94);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}

.brand-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:10px clamp(14px, 3.4vw, 32px) 8px;
}

.brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  color:var(--ink);
  text-decoration:none;
  font-family:var(--mono);
  font-weight:600;
  font-size:19px;
  letter-spacing:.04em;
}

.brand:hover{color:var(--purple)}

.brand-blob{
  width:20px;
  height:20px;
  flex:none;
  border-radius:64% 36% 58% 42% / 44% 58% 42% 56%;
  background:linear-gradient(140deg, var(--purple), var(--brown));
  box-shadow:0 4px 10px -5px rgba(86,34,139,.7);
}

.cta{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:0 18px;
  border-radius:999px;
  background:var(--purple);
  color:#fdf9f4;
  font-size:16px;
  font-weight:500;
  text-decoration:none;
  box-shadow:0 12px 22px -14px rgba(86,34,139,.95);
  transition:background .2s ease, transform .2s ease;
}

.cta:hover{background:var(--brown);color:#fdf9f4;transform:translateY(-1px)}

.menu{
  padding:0 clamp(10px, 3vw, 26px) 10px;
  overflow-x:auto;
  scrollbar-width:thin;
}

.menu ol{
  display:flex;
  align-items:center;
  gap:6px;
  margin:0;
  padding:0;
  list-style:none;
  width:max-content;
  min-width:100%;
}

.menu li{flex:none}

.menu a{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  padding:0 15px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--ink);
  font-size:16px;
  text-decoration:none;
  white-space:nowrap;
  box-shadow:0 6px 14px -12px rgba(31,23,38,.6);
  transition:border-color .2s ease, color .2s ease, background .2s ease;
}

.menu a:hover{border-color:var(--purple);color:var(--purple)}
.menu a[aria-current="true"]{background:var(--sand-2);border-color:var(--purple);color:var(--purple)}

/* ---------- 首屏 ---------- */
.hero{
  position:relative;
  overflow:hidden;
  padding:6px 0 34px;
}

.hero-inner{
  display:grid;
  grid-template-columns:1.02fr .98fr;
  gap:clamp(20px, 4vw, 52px);
  align-items:center;
  min-height:calc(100svh - var(--head-h));
}

.hero-inner.solo{grid-template-columns:1fr}

.hero-media{
  position:relative;
  border-radius:46% 54% 44% 56% / 52% 44% 56% 48%;
  overflow:hidden;
  box-shadow:var(--sh);
  background:var(--sand-2);
}

.hero-media::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  border:1px solid rgba(86,34,139,.16);
  pointer-events:none;
}

.hero-img{
  width:100%;
  aspect-ratio:5 / 6;
  object-fit:cover;
}

.hero-copy{
  position:relative;
  text-align:right;
  padding:4px 2px;
}

.hero-ghost{
  position:absolute;
  top:-.36em;
  right:-.06em;
  z-index:0;
  font-family:var(--mono);
  font-weight:700;
  font-size:clamp(3.2rem, 11.5vw, 9rem);
  line-height:1;
  letter-spacing:-.04em;
  white-space:nowrap;
  color:transparent;
  -webkit-text-stroke:1.4px rgba(86,34,139,.17);
  pointer-events:none;
  user-select:none;
}

.hero h1{
  position:relative;
  z-index:1;
  font-size:clamp(2rem, 5.2vw, 3.9rem);
  line-height:1.14;
  letter-spacing:-.02em;
}

.hero h1::after{
  content:"";
  display:block;
  width:clamp(64px, 22%, 168px);
  height:10px;
  margin:18px 0 0 auto;
  border-radius:64% 36% 58% 42% / 52% 58% 42% 48%;
  background:linear-gradient(90deg, var(--brown), var(--purple));
  opacity:.85;
}

/* ---------- 正文与侧栏 ---------- */
.stage{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 296px;
  gap:clamp(22px, 4vw, 48px);
  align-items:start;
  padding:8px 0 72px;
}

.body{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--r1) var(--r2) var(--r1) var(--r2);
  padding:clamp(20px, 3.4vw, 46px);
  box-shadow:var(--sh);
  min-width:0;
}

.body > :first-child{margin-top:0}
.body > :last-child{margin-bottom:0}

.body div[id]{
  scroll-margin-top:calc(var(--head-h) + 16px);
}

.body div + div{
  margin-top:2.4em;
  padding-top:2em;
  border-top:1px dashed var(--line);
}

.body h2{
  position:relative;
  margin:0 0 .6em;
  padding-left:1.05em;
  font-size:clamp(1.35rem, 2.5vw, 1.78rem);
}

.body h2::before{
  content:"";
  position:absolute;
  left:0;
  top:.52em;
  width:.55em;
  height:.55em;
  border-radius:64% 36% 58% 42% / 52% 58% 42% 48%;
  background:var(--brown);
  background-image:linear-gradient(150deg, var(--brown), var(--purple));
}

.body h3{
  margin:1.8em 0 .5em;
  font-size:1.12rem;
  color:var(--purple);
}

.body p{margin:0 0 1.05em}

.body ul,.body ol{
  margin:0 0 1.2em;
  padding-left:1.3em;
}

.body li{margin-bottom:.45em}

.body li::marker{color:var(--purple)}

.body blockquote{
  margin:0 0 1.3em;
  padding:16px 20px;
  border-left:4px solid var(--purple);
  border-radius:0 var(--r2) var(--r2) 0;
  background:var(--sand-2);
  color:var(--ink);
}

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

.body figure{margin:0 0 1.4em}

.body img{
  border-radius:var(--r2);
  box-shadow:var(--sh);
}

.body figcaption{
  margin-top:.6em;
  font-size:15px;
  color:var(--muted);
}

.body strong{color:var(--brown)}

.body hr{
  border:0;
  border-top:1px dashed var(--line);
  margin:2em 0;
}

.rail{
  position:sticky;
  top:calc(var(--head-h) + 18px);
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--r2) var(--r1) var(--r2) var(--r1);
  padding:22px 20px;
  box-shadow:var(--sh);
}

.rail h2{
  font-size:1.05rem;
  letter-spacing:.02em;
  color:var(--purple);
  margin-bottom:.4em;
}

.rail .subtitle{
  font-size:15.5px;
  line-height:1.65;
  color:var(--muted);
  margin:0 0 1em;
  padding-bottom:1em;
  border-bottom:1px dashed var(--line);
}

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

.rail-list li + li{border-top:1px solid rgba(220,205,185,.7)}

.rail-list a{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:42px;
  padding:4px 2px;
  font-size:15.5px;
  color:var(--ink);
  text-decoration:none;
}

.rail-list a::before{
  counter-increment:rail;
  content:counter(rail, decimal-leading-zero);
  font-family:var(--mono);
  font-size:12px;
  color:var(--brown-l);
  letter-spacing:.06em;
}

.rail-list a:hover{color:var(--purple)}

/* ---------- 页脚 ---------- */
.site-foot{
  display:grid;
  grid-template-columns:1.15fr 1fr;
  gap:18px 40px;
  align-items:start;
  margin-top:20px;
  padding:44px clamp(18px, 5vw, 58px) 30px;
  background:var(--ink);
  color:var(--sand);
  border-radius:36px 36px 0 0;
}

.foot-about{grid-column:1;margin:0}

.foot-mark{
  font-family:var(--mono);
  font-size:18px;
  letter-spacing:.05em;
  color:var(--sand);
}

.foot-links{
  grid-column:2;
  margin:0;
  text-align:right;
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:0 14px;
}

.foot-links a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:2px 0;
  font-size:15.5px;
  color:#e5d8f0;
  text-decoration:none;
}

.foot-links a:hover{color:#c9a6ec;text-decoration:underline}

.foot-copy{grid-column:1;font-size:13.5px;color:#a598b4}
.foot-top{grid-column:2;text-align:right;font-size:13.5px}
.foot-top a{color:#a598b4;text-decoration:none}
.foot-top a:hover{color:var(--sand)}

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference){
  .menu li{animation:rise .5s cubic-bezier(.22,.72,.3,1) backwards}
  .menu li:nth-child(1){animation-delay:.02s}
  .menu li:nth-child(2){animation-delay:.06s}
  .menu li:nth-child(3){animation-delay:.1s}
  .menu li:nth-child(4){animation-delay:.14s}
  .menu li:nth-child(5){animation-delay:.18s}
  .menu li:nth-child(6){animation-delay:.22s}
  .menu li:nth-child(7){animation-delay:.26s}
}

@keyframes rise{
  from{opacity:0;transform:translateY(-8px)}
  to{opacity:1;transform:none}
}

.js .rv{opacity:0;transform:translateY(22px)}

.js .rv.in{
  opacity:1;
  transform:none;
  transition:opacity .62s ease, transform .62s cubic-bezier(.22,.72,.3,1);
}

@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
  .js .rv{opacity:1;transform:none;transition:none}
}

/* ---------- 断点 ---------- */
@media (max-width: 980px){
  .hero-inner{
    grid-template-columns:1fr;
    min-height:0;
    padding-top:14px;
    gap:22px;
  }
  .hero-copy{text-align:left;order:-1}
  .hero h1::after{margin-left:0}
  .hero-img{aspect-ratio:16 / 10}
  .hero-ghost{right:auto;left:-.04em}
  .stage{grid-template-columns:1fr}
  .rail{position:static;order:3}
  .site-foot{grid-template-columns:1fr;border-radius:26px 26px 0 0}
  .foot-links,.foot-top{grid-column:1;text-align:left;justify-content:flex-start}
  .foot-copy,.foot-top{grid-column:1}
}

@media (max-width: 620px){
  :root{--head-h:126px}
  body{font-size:16.5px}
  .brand{font-size:17px}
  .cta{min-height:42px;padding:0 14px;font-size:15px}
  .body{padding:20px 18px}
  .rail{padding:18px 16px}
  .hero-ghost{font-size:clamp(2.6rem, 15vw, 5rem);top:-.2em}
  .site-foot{padding:34px 18px 24px}
}

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