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

:root {
  --ink: #14110F;
  --gold: #F5B301;
  --paper: #F4EFE6;
  --muted: rgba(20, 17, 15, 0.66);
  --hair: rgba(20, 17, 15, 0.16);
  --rail: 236px;
  --edge: clamp(18px, 3vw, 48px);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Josefin Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.28;
}

.skip {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 40;
  padding: 12px 18px;
  min-height: 44px;
  background: var(--gold);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transform: translateY(-180%);
  transition: transform 0.18s ease;
}

.skip:focus {
  transform: translateY(0);
}

/* 左侧固定竖排导航 */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 26px 18px 22px;
  overflow-y: auto;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  color: var(--paper);
  font-family: 'Cinzel', 'PingFang SC', serif;
  font-size: 1.02rem;
  letter-spacing: 0.16em;
  border-bottom: 2px solid rgba(244, 239, 230, 0.2);
  padding-bottom: 16px;
}

.brand-mark {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  background: var(--gold);
  border-radius: 3px;
}

.brand-name {
  white-space: nowrap;
}

.rail-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail-nav li {
  opacity: 0;
  transform: translateX(-10px);
  animation: railIn 0.34s ease forwards;
  animation-delay: calc(var(--i) * 55ms + 80ms);
}

@keyframes railIn {
  to {
    opacity: 1;
    transform: none;
  }
}

.rail-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 8px;
  text-decoration: none;
  color: var(--paper);
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(244, 239, 230, 0.14);
  border-radius: 4px;
  transition: background 0.16s ease, color 0.16s ease;
}

.rail-nav .num {
  font-family: 'Cinzel', serif;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
  color: var(--gold);
  min-width: 1.9em;
}

.rail-nav a:hover,
.rail-nav a:focus-visible {
  background: rgba(245, 179, 1, 0.16);
}

.rail-nav a[aria-current='true'] {
  background: var(--gold);
  color: var(--ink);
}

.rail-nav a[aria-current='true'] .num {
  color: var(--ink);
}

.rail-foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 16px;
  background: var(--gold);
  color: var(--ink);
  border: 2px solid var(--gold);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.16s ease, color 0.16s ease;
}

.cta:hover,
.cta:focus-visible {
  background: var(--paper);
  border-color: var(--paper);
}

.rail-note {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: rgba(244, 239, 230, 0.6);
}

/* 主区：正文在左，目录在右 */
main {
  margin-left: var(--rail);
  padding: 0 var(--edge);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  column-gap: clamp(24px, 3vw, 48px);
  align-items: start;
}

div {
  min-width: 0;
  padding-bottom: 8px;
}

.hero {
  min-height: 70vh;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(18px, 3vw, 40px);
  align-items: center;
  padding: clamp(28px, 5vw, 60px) 0 clamp(26px, 4vw, 48px);
}

.hero-art {
  position: relative;
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 28px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.ghost {
  position: absolute;
  right: -0.06em;
  bottom: -0.16em;
  font-family: 'Cinzel', 'PingFang SC', serif;
  font-size: clamp(76px, 11vw, 148px);
  line-height: 0.82;
  letter-spacing: -0.04em;
  color: rgba(20, 17, 15, 0.18);
  pointer-events: none;
}

.tips {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 38px;
  width: 100%;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  font-size: 0.82rem;
  overflow: hidden;
}

.tips li {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  white-space: nowrap;
  opacity: 0;
  animation: tick 12s linear infinite;
}

@keyframes tick {
  0% { opacity: 1; }
  30% { opacity: 1; }
  34% { opacity: 0; }
  100% { opacity: 0; }
}

.hero-copy {
  text-align: right;
}

.eyebrow {
  margin: 0 0 12px;
  font-family: 'Cinzel', 'PingFang SC', serif;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.hero-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  letter-spacing: 0.005em;
}

.hero-lead {
  margin: 0 0 22px;
  font-size: 1.06rem;
  line-height: 1.85;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 22px;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.96rem;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.btn-sm {
  min-height: 44px;
  padding: 10px 18px;
  font-size: 0.9rem;
  width: 100%;
}

.index-block,
.outro {
  padding: clamp(26px, 4vw, 44px) 0;
  border-bottom: 2px solid var(--ink);
}

.outro {
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 28px;
  padding: clamp(24px, 3.6vw, 38px);
  margin: clamp(26px, 4vw, 44px) 0;
}

.index-block h2,
.outro h2 {
  margin: 0 0 10px;
  font-size: clamp(1.4rem, 2.5vw, 1.95rem);
}

.chips {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chips a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.92rem;
  transition: background 0.16s ease, color 0.16s ease;
}

.chips a:hover,
.chips a:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

/* 正文片段（程序注入的 section 直接挂在 div 下） */
div > section:not(.hero):not(.index-block):not(.outro) {
  padding: clamp(26px, 4vw, 44px) 0;
  border-bottom: 2px solid var(--ink);
}

div section h2 {
  margin: 0 0 12px;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
}

p.subtitle {
  margin: 0 0 20px;
  padding-left: 14px;
  border-left: 4px solid var(--gold);
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.8;
}

div section h3 {
  margin: 26px 0 10px;
  font-size: 1.16rem;
}

div section p,
div section li {
  font-size: 1.0625rem;
  line-height: 1.88;
}

div section p {
  margin: 0 0 16px;
}

div section ul,
div section ol {
  margin: 0 0 18px;
  padding-left: 1.35em;
}

div section li {
  margin-bottom: 8px;
}

div section a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

div section a:hover {
  background: var(--gold);
  text-decoration-color: var(--ink);
}

div section blockquote {
  margin: 22px 0;
  padding: 18px 20px;
  border: 2px solid var(--ink);
  border-radius: 28px;
  background: var(--paper);
}

div section blockquote p:last-child {
  margin-bottom: 0;
}

div section img {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 28px;
  margin: 18px 0;
}

div section table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 0.98rem;
}

div section th,
div section td {
  border: 2px solid var(--ink);
  padding: 10px 12px;
  text-align: left;
}

div section th {
  background: var(--gold);
}

/* 右侧目录 */
.side {
  position: sticky;
  top: 24px;
  padding-top: clamp(28px, 5vw, 60px);
  display: grid;
  gap: 16px;
}

.side-card {
  border: 2px solid var(--ink);
  border-radius: 28px;
  padding: 18px;
  background: var(--paper);
}

.side-title {
  margin: 0 0 12px;
  font-family: 'Cinzel', 'PingFang SC', serif;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 0;
  text-decoration: none;
  font-size: 0.94rem;
  border-bottom: 1px dashed rgba(20, 17, 15, 0.24);
  transition: color 0.16s ease;
}

.side-nav li:last-child a {
  border-bottom: 0;
}

.side-nav .num {
  font-family: 'Cinzel', serif;
  font-size: 0.86rem;
  color: var(--muted);
  min-width: 1.9em;
}

.side-nav a:hover,
.side-nav a[aria-current='true'] {
  color: #8a6500;
}

.side-nav a[aria-current='true'] .num {
  color: var(--ink);
}

.side-note {
  background: var(--gold);
}

.side-text {
  margin: 0 0 14px;
  font-size: 0.94rem;
  line-height: 1.8;
}

/* 页脚单行三栏 */
.foot {
  margin-left: var(--rail);
  margin-top: clamp(28px, 5vw, 56px);
  background: var(--ink);
  color: var(--paper);
  padding: 34px var(--edge);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.foot-name {
  display: block;
  font-family: 'Cinzel', 'PingFang SC', serif;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.foot-brand p {
  margin: 10px 0 0;
  font-size: 0.88rem;
  line-height: 1.7;
  color: rgba(244, 239, 230, 0.68);
  max-width: 40ch;
}

.foot-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: rgba(244, 239, 230, 0.82);
  text-decoration: none;
  font-size: 0.92rem;
  border-bottom: 2px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.foot-nav a:hover,
.foot-nav a:focus-visible {
  color: var(--gold);
  border-color: var(--gold);
}

.foot-copy p {
  margin: 0;
  font-size: 0.84rem;
  color: rgba(244, 239, 230, 0.62);
  white-space: nowrap;
}

section[id],
main[id] {
  scroll-margin-top: 18px;
}

:focus-visible {
  outline: 3px solid #8a6500;
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  main {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    position: static;
    padding-top: 0;
    padding-bottom: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .side-note {
    grid-column: auto;
  }

  .foot {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .foot-copy {
    grid-column: 1 / -1;
  }

  .foot-copy p {
    white-space: normal;
  }
}

@media (max-width: 860px) {
  .rail {
    position: static;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 14px;
    padding: 14px 16px 16px;
    overflow: visible;
  }

  .brand {
    border-bottom: 0;
    padding-bottom: 0;
    margin-right: auto;
  }

  .rail-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .rail-nav ul {
    display: flex;
    gap: 6px;
  }

  .rail-nav li {
    flex: 0 0 auto;
  }

  .rail-nav a {
    border-bottom: 2px solid rgba(244, 239, 230, 0.18);
    border-radius: 999px;
    padding: 8px 12px;
    white-space: nowrap;
  }

  .rail-nav .num {
    min-width: auto;
  }

  .rail-foot {
    margin-top: 0;
  }

  .rail-note {
    display: none;
  }

  .cta {
    min-height: 44px;
    padding: 10px 18px;
  }

  main {
    margin-left: 0;
    padding: 0 16px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-top: 24px;
  }

  .hero-art {
    aspect-ratio: 16 / 11;
    border-radius: 20px;
  }

  .foot {
    margin-left: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .side {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-card,
  .outro {
    border-radius: 20px;
  }
}

@media (max-width: 420px) {
  .hero-copy h1 {
    font-size: 1.85rem;
  }

  .actions .btn {
    flex: 1 1 auto;
  }

  .chips a {
    font-size: 0.88rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .rail-nav li {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .tips {
    height: auto;
  }

  .tips li {
    position: static;
    opacity: 1;
    animation: none;
    white-space: normal;
    padding: 4px 12px;
  }

  .skip,
  .btn,
  .cta,
  .chips a,
  .rail-nav a {
    transition: none;
  }
}

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