:root {
  --violet: #56228b;
  --violet-soft: rgba(86, 34, 139, 0.1);
  --brown: #8b4513;
  --ink: #1f1726;
  --ink-soft: #4a3f52;
  --paper: #f4efe6;
  --paper-deep: #e9e0d2;
  --card: #fffdf9;
  --line: rgba(31, 23, 38, 0.16);
  --radius-card: 4px;
  --radius-organic: 24px 8px 24px 8px;
  --max: 1180px;
  --font: "Figtree", "Noto Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 10% 4%, rgba(139, 69, 19, 0.12), transparent 44%),
    radial-gradient(circle at 92% 18%, rgba(86, 34, 139, 0.11), transparent 48%),
    radial-gradient(circle at 40% 96%, rgba(139, 69, 19, 0.08), transparent 52%);
  background-repeat: no-repeat;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

a {
  color: var(--violet);
}

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

.top {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(244, 239, 230, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.topnav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}

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

.menu--l {
  justify-content: flex-end;
}

.menu--r {
  justify-content: flex-start;
}

.menu > li {
  position: relative;
}

.menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.menu a:hover,
.menu a:focus-visible {
  color: var(--violet);
  background: var(--violet-soft);
  transform: translateY(-1px);
}

.menu .sub {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 70;
  min-width: 208px;
  margin: 0;
  padding: 8px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--card);
  border: 4px solid var(--violet);
  border-radius: var(--radius-card);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.menu--r .sub {
  left: auto;
  right: 0;
}

.menu .has-sub:hover > .sub,
.menu .has-sub:focus-within > .sub {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 18px;
  text-decoration: none;
  color: var(--ink);
  border-left: 3px solid var(--brown);
  border-right: 3px solid var(--violet);
  border-radius: 999px;
}

.brandname {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.brand-logo {
  height: 32px;
  width: auto;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
  padding: 56px 24px 132px;
  overflow: hidden;
  background: linear-gradient(168deg, rgba(255, 253, 249, 0.72) 0%, rgba(233, 224, 210, 0.55) 62%, rgba(226, 214, 198, 0.6) 100%);
}

.hero-vein {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(108deg, rgba(86, 34, 139, 0.06) 0 2px, transparent 2px 16px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}

.hero-slash {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 116px;
  background: linear-gradient(92deg, var(--violet) 0%, #63266f 46%, var(--brown) 100%);
  clip-path: polygon(0 62%, 100% 4%, 100% 100%, 0 100%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.hero-blob {
  position: absolute;
  z-index: -1;
  left: -48px;
  top: -46px;
  width: 320px;
  height: 300px;
  background: radial-gradient(circle at 38% 36%, rgba(86, 34, 139, 0.2), rgba(86, 34, 139, 0.03) 72%);
  border-radius: 58% 42% 40% 60% / 54% 46% 54% 46%;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(1.8rem, 6.2vw, 3.9rem);
  line-height: 1.14;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: break-word;
}

.lede {
  margin: 0;
  max-width: 58ch;
  font-size: 1.06rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.hero-fig {
  position: relative;
  z-index: 2;
  margin: 0 auto;
  width: 100%;
  max-width: 720px;
  border: 4px solid var(--violet);
  border-radius: var(--radius-organic);
  overflow: hidden;
  background: var(--paper-deep);
}

.hero-media {
  display: block;
  width: 100%;
  height: auto;
  max-height: 44vh;
  object-fit: cover;
}

main {
  position: relative;
  z-index: 3;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 24px 80px;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

.rail {
  position: sticky;
  top: 96px;
  padding: 18px 14px;
  background: var(--card);
  border: 4px solid var(--ink);
  border-radius: var(--radius-card);
}

.rail-h {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--brown);
}

.rail-h > span {
  display: inline-block;
  padding-bottom: 5px;
  border-bottom: 3px solid var(--violet);
}

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

.rail-list li {
  animation: rise 0.5s ease both;
}

.rail-list li:nth-child(2) { animation-delay: 0.05s; }
.rail-list li:nth-child(3) { animation-delay: 0.1s; }
.rail-list li:nth-child(4) { animation-delay: 0.15s; }
.rail-list li:nth-child(5) { animation-delay: 0.2s; }
.rail-list li:nth-child(6) { animation-delay: 0.25s; }
.rail-list li:nth-child(7) { animation-delay: 0.3s; }

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

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: var(--radius-card);
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
  line-height: 1.4;
  transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.rail-list a:hover,
.rail-list a:focus-visible {
  color: var(--violet);
  background: var(--violet-soft);
  padding-left: 16px;
}

.content {
  min-width: 0;
}

.prose {
  max-width: 70ch;
  font-size: 1.06rem;
  line-height: 1.8;
  color: var(--ink);
}

.prose > section {
  padding: 36px 0;
  border-top: 1px dashed var(--line);
  scroll-margin-top: 96px;
}

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

.prose h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3.2vw, 1.85rem);
  line-height: 1.32;
  letter-spacing: -0.01em;
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: break-word;
}

.prose h2 > span {
  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 4px solid var(--brown);
}

.prose h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.4;
  font-weight: 600;
  color: var(--violet);
}

.prose h3 > span {
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 3px solid rgba(139, 69, 19, 0.5);
}

.prose h4 {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 600;
}

.prose p {
  margin: 0;
}

.prose > section > * + * {
  margin-top: 1em;
}

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

.prose li + li {
  margin-top: 0.45em;
}

.prose blockquote {
  margin: 0;
  padding: 16px 20px;
  background: var(--card);
  border: 4px solid var(--paper-deep);
  border-left: 6px solid var(--brown);
  border-radius: var(--radius-card);
  color: var(--ink-soft);
}

.prose figure {
  margin: 0;
}

.prose img {
  height: auto;
  border: 4px solid var(--card);
  border-radius: var(--radius-card);
}

.prose hr {
  height: 0;
  border: 0;
  border-top: 1px dashed var(--line);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border: 2px solid var(--line);
  text-align: left;
}

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

.prose a:hover {
  color: var(--brown);
}

.foot {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px 32px;
  padding: 68px clamp(22px, 6vw, 96px) 26px;
  background: var(--ink);
  color: #efe6da;
}

.foot section {
  min-width: 0;
}

.bigbrand {
  margin: 0;
  font-size: clamp(1.9rem, 5.4vw, 3.6rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(233, 214, 246, 0.92);
  overflow-wrap: break-word;
}

.foot h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: #c4b2da;
}

.foot h3 > span {
  display: inline-block;
  padding-bottom: 5px;
  border-bottom: 3px solid var(--brown);
}

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

.footlist a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 0;
  color: #ded2ea;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.footlist a:hover,
.footlist a:focus-visible {
  color: #fff;
  transform: translateX(4px);
}

.footkw {
  margin: 0;
  color: #ded2ea;
  letter-spacing: 0.08em;
}

.copyd {
  grid-column: 1 / -1;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(239, 230, 218, 0.22);
  color: rgba(239, 230, 218, 0.7);
}

.totop {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  box-shadow: 0 6px 18px rgba(31, 23, 38, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.totop.is-on {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .topnav {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 14px;
  }

  .brand {
    order: -1;
    justify-self: center;
    border-left: 0;
    border-right: 0;
    border-bottom: 2px solid var(--brown);
    border-radius: 0;
    padding: 4px 12px 8px;
  }

  .menu,
  .menu--l,
  .menu--r {
    justify-content: center;
    gap: 0;
  }

  .menu a {
    padding: 10px 11px;
    font-size: 1rem;
  }

  .menu .sub {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 36px 18px 104px;
    gap: 26px;
  }

  .hero-blob {
    width: 220px;
    height: 200px;
    left: -34px;
    top: -28px;
  }

  .hero-media {
    max-height: 34vh;
  }

  .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 36px 18px 60px;
  }

  .rail {
    order: 2;
    position: static;
    border-width: 3px;
  }

  .prose > section {
    scroll-margin-top: 120px;
  }

  .foot {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
    padding: 48px 20px 22px;
  }

  .foot h3 {
    margin-bottom: 6px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

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