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

:root {
  --ink: #1f1726;
  --ink-2: #2a2031;
  --ink-3: #302442;
  --plum: #56228b;
  --plum-soft: #7b3fb8;
  --clay: #8b4513;
  --clay-soft: #c98a52;
  --cream: #f5eef8;
  --muted: #c3b2d1;
  --dim: #9c8caa;
  --rail: 236px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: 'Karla', 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--cream);
  background-color: var(--ink);
  background-image:
    radial-gradient(rgba(245, 238, 248, 0.07) 1px, transparent 1.4px),
    radial-gradient(760px 520px at 84% -10%, rgba(86, 34, 139, 0.45), transparent 70%),
    radial-gradient(680px 460px at 4% 98%, rgba(139, 69, 19, 0.34), transparent 72%);
  background-size: 20px 20px, auto, auto;
  background-attachment: fixed, fixed, fixed;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display SC', Georgia, 'Songti SC', serif;
  font-weight: 700;
  letter-spacing: 0.01em;
}

a {
  color: #dcb6f7;
}

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

.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 28px 18px 32px;
  overflow-y: auto;
  background: linear-gradient(175deg, rgba(86, 34, 139, 0.42), rgba(31, 23, 38, 0.94) 62%);
  border-right: 1px solid rgba(201, 138, 82, 0.22);
  backdrop-filter: blur(6px);
}

.brand {
  display: block;
  padding: 8px 6px;
  font-family: 'Playfair Display SC', Georgia, serif;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0.05em;
  color: var(--cream);
  text-decoration: none;
  border-radius: 18px 24px 16px 22px;
  transition: background 0.25s ease, color 0.25s ease;
}

.brand:hover,
.brand:focus-visible {
  color: #fff;
  background: rgba(139, 69, 19, 0.3);
}

.rail nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rail nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 11px 12px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--muted);
  text-decoration: none;
  border-radius: 16px 22px 16px 20px;
  transition: color 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.rail nav a .idx {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--clay-soft);
}

.rail nav a:hover,
.rail nav a:focus-visible {
  color: #fff;
  background: rgba(86, 34, 139, 0.5);
  transform: translateX(3px);
}

main {
  margin-left: var(--rail);
  position: relative;
  z-index: 1;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  min-height: 45vh;
  padding: 62px clamp(20px, 4vw, 52px) 54px;
  text-align: center;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 12% 0 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 138, 82, 0.45), transparent);
}

.hero-mark {
  flex: 0 0 auto;
  width: 86px;
  filter: drop-shadow(0 14px 26px rgba(86, 34, 139, 0.55));
  will-change: transform;
}

.hero-mark svg {
  display: block;
  width: 100%;
  height: auto;
}

.hero-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 5.2vw, 54px);
  line-height: 1.12;
  color: #fff;
  text-shadow: 0 10px 34px rgba(31, 23, 38, 0.8);
}

.hero-copy .lead {
  max-width: 42ch;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.7;
  color: var(--muted);
}

.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px) 76px;
}

.prose {
  min-width: 0;
  font-size: 17px;
}

.prose article {
  margin: 0 0 28px;
  padding: clamp(22px, 3.2vw, 36px);
  background: var(--ink-2);
  border-radius: 18px 26px 20px 24px;
  scroll-margin-top: 96px;
  box-shadow: 0 16px 34px -26px #000;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.prose article:nth-child(3n + 2) {
  background: var(--ink-3);
  border-radius: 26px 18px 24px 20px;
}

.prose article:nth-child(3n) {
  background: #2c2138;
  border-radius: 20px 24px 18px 26px;
}

.prose article:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 46px -28px rgba(86, 34, 139, 0.95);
}

.prose article:last-child {
  margin-bottom: 0;
}

.prose h2 {
  margin: 0 0 0.55em;
  font-size: clamp(22px, 3vw, 31px);
  line-height: 1.24;
  color: #f9f2fc;
}

.prose h3 {
  margin: 1.5em 0 0.5em;
  font-size: 19px;
  line-height: 1.4;
  color: #f2e6f8;
}

.prose h4 {
  margin: 1.2em 0 0.4em;
  font-size: 17px;
  color: #eddcf5;
}

.prose p {
  max-width: 68ch;
  margin: 0 0 1em;
}

.prose ul,
.prose ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.prose li {
  margin: 0.35em 0;
}

.prose strong {
  color: #fff;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose blockquote {
  margin: 1.2em 0;
  padding: 14px 20px;
  color: #eadff1;
  background: rgba(139, 69, 19, 0.22);
  border-radius: 16px 22px 18px 24px;
}

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

.prose figure {
  margin: 1.2em 0;
}

.prose img {
  display: block;
  margin: 0 auto;
  border-radius: 16px;
}

.prose table {
  width: 100%;
  margin: 1.2em 0;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 9px 11px;
  text-align: left;
  border-bottom: 1px solid rgba(201, 138, 82, 0.28);
}

.prose th {
  color: var(--clay-soft);
  font-weight: 600;
}

.prose hr {
  height: 1px;
  margin: 1.7em 0;
  border: 0;
  background: rgba(201, 138, 82, 0.3);
}

.side {
  position: sticky;
  top: 28px;
  padding: 22px 20px 24px;
  background: linear-gradient(200deg, rgba(86, 34, 139, 0.34), rgba(42, 32, 49, 0.9));
  border-radius: 22px 18px 26px 20px;
  box-shadow: 0 18px 40px -30px #000;
}

.side h2 {
  margin: 0 0 6px;
  font-size: 20px;
  color: #f9f2fc;
}

.side .subtitle {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--clay-soft);
}

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

.side-list a {
  display: block;
  padding: 11px 10px;
  min-height: 42px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
  border-radius: 14px 18px 14px 20px;
  transition: color 0.22s ease, background 0.22s ease;
}

.side-list a:hover,
.side-list a:focus-visible {
  color: #fff;
  background: rgba(139, 69, 19, 0.32);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 22px;
  margin-left: var(--rail);
  padding: 28px 22px 40px;
  border-top: 1px solid rgba(201, 138, 82, 0.2);
  background: rgba(31, 23, 38, 0.6);
}

.foot address {
  font-style: normal;
  letter-spacing: 0.06em;
  color: var(--clay-soft);
}

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

.foot ul a {
  display: inline-block;
  padding: 12px 10px;
  min-height: 40px;
  font-size: 16px;
  line-height: 1.3;
  color: var(--muted);
  text-decoration: none;
  border-radius: 14px;
  transition: color 0.22s ease, background 0.22s ease;
}

.foot ul a:hover,
.foot ul a:focus-visible {
  color: #fff;
  background: rgba(86, 34, 139, 0.45);
}

.foot .copy {
  width: 100%;
  margin: 2px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--dim);
}

@media (max-width: 860px) {
  .rail {
    position: sticky;
    top: 0;
    right: 0;
    bottom: auto;
    width: auto;
    gap: 8px;
    padding: 12px 14px 10px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid rgba(201, 138, 82, 0.24);
    background: rgba(31, 23, 38, 0.95);
  }

  .brand {
    padding: 6px 4px;
    font-size: 19px;
  }

  .rail nav ol {
    flex-direction: row;
    gap: 8px;
    padding-bottom: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .rail nav a {
    white-space: nowrap;
    padding: 11px 13px;
  }

  .rail nav a:hover,
  .rail nav a:focus-visible {
    transform: none;
  }

  main {
    margin-left: 0;
  }

  .hero {
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    padding: 32px 18px 30px;
  }

  .hero-mark {
    width: 62px;
  }

  .cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding: 0 16px 48px;
  }

  .prose article {
    padding: 20px 18px;
    scroll-margin-top: 124px;
  }

  .prose article:hover {
    transform: none;
  }

  .side {
    position: static;
  }

  .foot {
    margin-left: 0;
    padding: 24px 16px 34px;
  }
}

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

  * {
    animation: none !important;
    transition: none !important;
  }

  .hero-mark {
    transform: none !important;
  }
}

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