:root {
  --ink: #1f1726;
  --ink2: #2a1e34;
  --ink3: #35263f;
  --violet: #56228b;
  --violet-l: #7c40bd;
  --clay: #8b4513;
  --clay-l: #b9743d;
  --paper: #efe7f3;
  --mute: #b6a5c3;
  --line: rgba(239, 231, 243, 0.13);
  --serif: 'Cormorant', 'Songti SC', 'Source Han Serif SC', 'SimSun', Georgia, serif;
  --sans: 'Montserrat', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
  --sy: 0px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 58px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 36px 0 40px 200px;
  background-color: var(--ink);
  background-image:
    radial-gradient(920px 520px at 88% -8%, rgba(86, 34, 139, 0.55), transparent 62%),
    radial-gradient(760px 480px at -8% 34%, rgba(139, 69, 19, 0.26), transparent 62%),
    var(--noise);
  background-repeat: no-repeat, no-repeat, repeat;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.78;
  font-weight: 400;
  letter-spacing: 0.005em;
  min-height: 100vh;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--clay-l);
  outline-offset: 3px;
}

/* ---------- 顶部细条 ---------- */
.announce {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink2);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--mute);
  white-space: nowrap;
  overflow: hidden;
}

/* ---------- 左侧固定竖排导航 ---------- */
.rail {
  position: fixed;
  top: 36px;
  left: 0;
  bottom: 0;
  width: 200px;
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 16px 26px;
  background: linear-gradient(180deg, rgba(31, 23, 38, 0.97), rgba(31, 23, 38, 0.92));
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mark {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  text-decoration: none;
  border-radius: 18px 13px 20px 12px;
  background: linear-gradient(145deg, var(--violet), var(--clay));
  box-shadow: 0 10px 26px rgba(86, 34, 139, 0.4);
  transition: transform 0.3s ease;
}

.mark:hover {
  transform: rotate(-5deg) scale(1.05);
}

.mark-img {
  display: block;
  width: 24px;
  height: 24px;
}

.mark-txt {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  color: #fdf7ff;
}

.pill {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(239, 231, 243, 0.09);
  background: rgba(239, 231, 243, 0.055);
  color: var(--paper);
  font-size: 16px;
  line-height: 1.35;
  text-decoration: none;
  transition: background 0.24s ease, color 0.24s ease, transform 0.24s ease;
}

.pill:hover,
.pill:focus-visible {
  background: var(--violet);
  color: #fff;
  transform: translateX(3px);
}

.pill:nth-child(odd):hover {
  background: var(--clay);
}

/* ---------- 版面骨架 ---------- */
main {
  display: block;
}

.wrap {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 34px;
}

/* ---------- Hero ---------- */
.hero {
  grid-column: 1 / -1;
  display: grid;
  align-items: center;
  min-height: 45vh;
  padding: 26px 0 34px;
}

.hero-in {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
  gap: 36px;
  align-items: center;
  width: 100%;
}

.hero-art {
  position: relative;
  aspect-ratio: 5 / 4;
  border-radius: 58% 42% 46% 54% / 46% 54% 46% 54%;
  overflow: hidden;
  background: linear-gradient(150deg, rgba(86, 34, 139, 0.9), rgba(139, 69, 19, 0.72));
  box-shadow: 0 26px 60px rgba(15, 10, 20, 0.55);
  transform: translate3d(0, calc(var(--sy) * -0.05), 0);
  will-change: transform;
}

.hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rub {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--clay);
  box-shadow: 0 12px 32px rgba(139, 69, 19, 0.55);
}

.rub::after {
  content: "";
  position: absolute;
  inset: 17px;
  border-radius: 50%;
  background: rgba(31, 23, 38, 0.5);
}

.hero-copy {
  text-align: center;
  padding: 0 4px;
}

.hero-h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 4.7vw, 3.6rem);
  line-height: 1.16;
  letter-spacing: 0.012em;
  background: linear-gradient(100deg, #f7f0fb 20%, #d7c2ea 65%, var(--clay-l) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 侧边目录 ---------- */
.side {
  padding-top: 4px;
  min-width: 0;
}

.side-h {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.45rem;
  letter-spacing: 0.06em;
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.side-list a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  min-height: 40px;
  color: var(--mute);
  text-decoration: none;
  font-size: 16px;
  border-bottom: 1px dashed rgba(239, 231, 243, 0.08);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.side-list a:hover {
  color: var(--paper);
  padding-left: 5px;
}

.idx {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--clay-l);
  font-variant-numeric: tabular-nums;
}

/* ---------- 正文 ---------- */
.main-col {
  min-width: 0;
  padding-bottom: 72px;
}

.main-col > section {
  padding: 34px 0 14px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 60px;
}

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

.main-col h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 2.7vw, 2.15rem);
  line-height: 1.28;
  letter-spacing: 0.01em;
}

.main-col h3 {
  margin: 26px 0 4px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.28rem;
  line-height: 1.4;
}

.main-col p {
  margin: 14px 0;
}

.main-col ul,
.main-col ol {
  margin: 14px 0;
  padding-left: 22px;
}

.main-col li {
  margin: 8px 0;
}

.main-col a {
  color: var(--clay-l);
  text-underline-offset: 3px;
}

.main-col strong,
.main-col b {
  color: #fff;
}

.main-col blockquote {
  margin: 20px 0;
  padding: 16px 22px;
  border-radius: 10px;
  background: var(--ink2);
  color: var(--mute);
}

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

.main-col th,
.main-col td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.main-col .card {
  padding: 20px 22px;
  border-radius: 10px;
  background: var(--ink2);
  margin: 18px 0;
}

hr {
  border: 0;
  height: 1px;
  margin: 18px 0;
  background: linear-gradient(90deg, var(--violet), var(--clay) 52%, transparent);
  opacity: 0.9;
}

/* ---------- 页脚 ---------- */
footer {
  padding: 52px 34px 36px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(42, 30, 52, 0), rgba(42, 30, 52, 0.92) 55%);
}

.f-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 330px);
  gap: 36px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto 40px;
}

.f-mark {
  display: block;
  margin-bottom: 10px;
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: 0.07em;
  color: var(--paper);
}

.f-desc {
  margin: 0;
  max-width: 46ch;
  color: var(--mute);
  font-size: 16px;
  line-height: 1.72;
}

.f-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 20px;
  border-radius: 999px;
  background: var(--ink2);
}

.f-form input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  border: 0;
  background: none;
  color: var(--paper);
  font-family: inherit;
  font-size: 16px;
}

.f-form input::placeholder {
  color: var(--mute);
}

.f-form input:focus {
  outline: none;
}

.f-form button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.24s ease;
}

.f-form button:hover {
  background: var(--clay);
}

.f-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  max-width: 1180px;
  margin: 0 auto 28px;
}

.f-dl {
  margin: 0;
}

.f-dl dt {
  margin-bottom: 10px;
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--clay-l);
}

.f-dl dd {
  margin: 0;
}

.f-dl a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--mute);
  text-decoration: none;
  font-size: 16px;
  transition: color 0.2s ease;
}

.f-dl a:hover {
  color: var(--paper);
}

.f-copy {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--mute);
}

/* ---------- 回到顶部 ---------- */
.totop {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 56;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink2);
  color: var(--paper);
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.24s ease, color 0.24s ease;
}

.totop:hover {
  background: var(--violet);
  color: #fff;
}

/* ---------- 入场 ---------- */
.reveal {
  animation: rise 0.85s cubic-bezier(0.2, 0.72, 0.3, 1) both;
}

.hero-h1.reveal {
  animation-delay: 0.1s;
}

.side-list li:nth-child(n) a {
  animation: rise 0.6s ease both;
}

.side-list li:nth-child(1) a { animation-delay: 0.04s; }
.side-list li:nth-child(2) a { animation-delay: 0.08s; }
.side-list li:nth-child(3) a { animation-delay: 0.12s; }
.side-list li:nth-child(4) a { animation-delay: 0.16s; }
.side-list li:nth-child(5) a { animation-delay: 0.2s; }
.side-list li:nth-child(6) a { animation-delay: 0.24s; }
.side-list li:nth-child(7) a { animation-delay: 0.28s; }

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

/* ---------- 平板 ---------- */
@media (max-width: 1024px) {
  body {
    padding-left: 178px;
  }
  .rail {
    width: 178px;
    padding: 16px 12px 22px;
  }
  .pill {
    font-size: 16px;
    padding: 6px 14px;
  }
  .wrap {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 0 24px;
  }
  .hero {
    grid-column: auto;
  }
  .side,
  .main-col {
    grid-column: 1;
  }
  .side {
    padding-bottom: 6px;
  }
  .side-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 18px;
  }
  .side-list a {
    border-bottom: 0;
    min-height: 40px;
  }
}

/* ---------- 手机 ---------- */
@media (max-width: 900px) {
  body {
    padding: 36px 0 84px;
    font-size: 17px;
  }
  .announce {
    letter-spacing: 0.24em;
    text-indent: 0.24em;
    font-size: 13px;
  }
  .rail {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    height: 66px;
    flex-direction: row;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-top: 1px solid var(--line);
    background: rgba(31, 23, 38, 0.985);
  }
  .mark {
    margin: 0 4px 0 0;
    width: 40px;
    height: 40px;
    border-radius: 15px 12px 16px 12px;
  }
  .pill {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 6px 15px;
  }
  .wrap {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 18px;
  }
  .hero {
    min-height: 0;
    padding: 14px 0 6px;
  }
  .hero-in {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .hero-art {
    aspect-ratio: 16 / 9;
    order: 2;
  }
  .hero-copy {
    order: 1;
  }
  .hero-h1 {
    font-size: clamp(1.9rem, 8vw, 2.6rem);
    color: var(--paper);
    background: none;
    -webkit-text-fill-color: currentColor;
  }
  .side {
    order: 3;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }
  .main-col {
    order: 2;
    padding-bottom: 44px;
  }
  .main-col > section {
    padding: 26px 0 10px;
  }
  footer {
    padding: 40px 18px 28px;
  }
  .f-top {
    grid-template-columns: 1fr;
    gap: 22px;
    margin-bottom: 30px;
  }
  .f-nav {
    gap: 16px;
    margin-bottom: 22px;
  }
  .f-dl a {
    font-size: 15px;
  }
  .totop {
    right: 14px;
    bottom: 80px;
    padding: 0 16px;
  }
}

/* ---------- 无障碍 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal,
  .side-list li a {
    animation: none;
  }
  .hero-art {
    transform: none;
  }
  .pill:hover,
  .mark:hover {
    transform: none;
  }
}

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