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

:root {
  --plum: #56228b;
  --plum-soft: #7c4ab0;
  --clay: #8b4513;
  --clay-soft: #b66a3c;
  --ink: #1f1726;
  --cream: #f7f1e9;
  --card: #fffaf4;
  --line: rgba(31, 23, 38, 0.13);
  --serif: "Noto Serif JP", "Songti SC", "SimSun", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", "PingFang SC", system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--cream);
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink);
  background: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 38% at 92% 4%, rgba(86, 34, 139, 0.16), transparent 70%),
    radial-gradient(46% 32% at 2% 30%, rgba(139, 69, 19, 0.13), transparent 72%),
    radial-gradient(60% 40% at 78% 92%, rgba(86, 34, 139, 0.1), transparent 74%),
    repeating-linear-gradient(114deg, rgba(31, 23, 38, 0.028) 0 2px, transparent 2px 7px);
}

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

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

p {
  margin: 0 0 1em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.page {
  position: relative;
  z-index: 1;
  overflow-x: clip;
}

/* 顶部栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 64px;
  padding: 0 clamp(12px, 3vw, 30px);
  background: rgba(247, 241, 233, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 62% 38% 46% 54% / 48% 56% 44% 52%;
  background: linear-gradient(142deg, var(--plum), var(--clay));
  box-shadow: 0 10px 20px -12px rgba(86, 34, 139, 0.95);
  transition: transform 0.5s ease, border-radius 0.5s ease;
}

.mark svg {
  width: 22px;
  height: 22px;
}

.mark:hover {
  transform: rotate(-8deg) scale(1.05);
  border-radius: 44% 56% 60% 40% / 56% 44% 56% 44%;
}

.find {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 6px 0 12px;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.find:focus-within {
  border-color: var(--plum-soft);
  box-shadow: 0 0 0 3px rgba(86, 34, 139, 0.14);
}

.find-ico svg {
  width: 16px;
  height: 16px;
  display: block;
}

.find-in {
  width: clamp(84px, 24vw, 170px);
  height: 40px;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}

.find-in::placeholder {
  color: rgba(31, 23, 38, 0.5);
}

/* 锚点条 */
.anchors-bar {
  position: sticky;
  top: 64px;
  z-index: 25;
  background: rgba(247, 241, 233, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.anchors {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px clamp(12px, 3vw, 30px) 10px;
  scrollbar-width: none;
}

.anchors::-webkit-scrollbar {
  display: none;
}

.anchor {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(86, 34, 139, 0.08);
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.28s ease, color 0.28s ease, transform 0.28s ease;
}

.anchor .ico {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 62% 38% 55% 45%;
  background: linear-gradient(140deg, var(--plum), var(--clay));
}

.anchor:hover,
.anchor.is-on {
  background: var(--plum);
  color: #fdf8f2;
  transform: translateY(-2px);
}

.anchor:hover .ico,
.anchor.is-on .ico {
  background: #f0dcc4;
}

.anchor.is-mute {
  display: none;
}

/* Hero */
.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 100svh;
  overflow: hidden;
  background: linear-gradient(155deg, #291334 0%, #56228b 58%, #8b4513 100%);
}

.hero-fig {
  position: absolute;
  inset: 0;
  margin: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  opacity: 0.92;
  will-change: transform;
}

.hero-fallback {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(52% 40% at 74% 24%, rgba(247, 241, 233, 0.24), transparent 68%),
    radial-gradient(60% 46% at 18% 76%, rgba(139, 69, 19, 0.55), transparent 70%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    182deg,
    rgba(31, 23, 38, 0.55) 0%,
    rgba(31, 23, 38, 0.12) 44%,
    rgba(31, 23, 38, 0.82) 100%
  );
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: clamp(26px, 7vw, 78px) clamp(18px, 5vw, 62px) clamp(46px, 11vw, 104px);
  max-width: 20em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 8px 16px;
  border: 1px solid rgba(253, 248, 242, 0.5);
  border-radius: 999px;
  background: rgba(253, 248, 242, 0.16);
  backdrop-filter: blur(6px);
  color: #fdf8f2;
  font-size: 15px;
  letter-spacing: 0.08em;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 58% 42% 52% 48%;
  background: #f0dcc4;
}

.hero-h1 {
  margin: 16px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(36px, 10vw, 86px);
  line-height: 1.14;
  letter-spacing: 0.015em;
  color: #fdf8f2;
  text-shadow: 0 18px 40px rgba(31, 23, 38, 0.42);
  word-break: break-word;
}

/* 正文与侧栏 */
.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(22px, 4vw, 44px);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(34px, 6vw, 76px) clamp(14px, 4vw, 40px);
}

.prose {
  min-width: 0;
}

.prose > section {
  position: relative;
  margin: 0 0 clamp(20px, 3vw, 34px);
  padding: clamp(20px, 4vw, 44px);
  background: var(--card);
  border-radius: 28px 60px 26px 56px;
  box-shadow: 0 22px 44px -32px rgba(31, 23, 38, 0.62);
  scroll-margin-top: 138px;
}

.prose > section:nth-of-type(even) {
  border-radius: 58px 26px 62px 28px;
}

.prose > section::before {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(20px, 4vw, 44px);
  width: 58px;
  height: 5px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, var(--plum), var(--clay));
  opacity: 0.7;
}

.prose h2,
.prose h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: 0.01em;
  scroll-margin-top: 138px;
}

.prose h2 {
  font-size: clamp(22px, 4.4vw, 30px);
  margin: 0 0 0.7em;
}

.prose h3 {
  font-size: clamp(19px, 3.4vw, 23px);
  margin: 1.6em 0 0.6em;
  color: #3a2450;
}

.prose h2 span,
.prose h3 span {
  display: inline;
}

.prose h2::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-top: 12px;
  border-radius: 999px;
  background: var(--clay-soft);
}

.prose p,
.prose li {
  font-size: 17px;
}

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

.prose li {
  margin-bottom: 0.45em;
}

.prose li::marker {
  color: var(--clay);
}

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

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

.prose blockquote {
  margin: 1.4em 0;
  padding: 16px 22px;
  border-left: 4px solid var(--plum-soft);
  border-radius: 4px 22px 22px 4px;
  background: rgba(86, 34, 139, 0.07);
  color: #3a2450;
}

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

.prose img,
.prose figure {
  border-radius: 20px;
}

.prose figure {
  margin: 1.4em 0;
  overflow: hidden;
}

.prose figure img {
  width: 100%;
}

.prose figcaption {
  padding: 10px 4px 0;
  font-size: 15px;
  color: rgba(31, 23, 38, 0.66);
}

.prose strong {
  color: #34194d;
}

.prose hr {
  border: 0;
  height: 1px;
  margin: 2em 0;
  background: var(--line);
}

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

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

/* 侧栏 */
.rail {
  display: grid;
  gap: 16px;
  align-content: start;
}

.rail-block {
  padding: 20px 22px;
  background: var(--card);
  border-radius: 24px 46px 24px 46px;
  box-shadow: 0 20px 40px -34px rgba(31, 23, 38, 0.7);
}

.rail-top {
  text-align: center;
  padding-bottom: 18px;
}

.rail-h {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--clay);
}

.rail-top .rail-h {
  margin-bottom: 6px;
}

.rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
  counter-reset: rail;
}

.rail-list li {
  counter-increment: rail;
}

.rail-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.5;
  text-decoration: none;
  transition: background 0.26s ease, color 0.26s ease;
}

.rail-list a::before {
  content: counter(rail, decimal-leading-zero);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--clay-soft);
}

.rail-list a:hover {
  background: rgba(86, 34, 139, 0.1);
  color: var(--plum);
}

.totop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 60% 40% 52% 48%;
  background: linear-gradient(145deg, var(--plum), var(--clay));
  color: #fdf8f2;
  font-size: 18px;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.totop:hover {
  transform: translateY(-4px);
}

/* 页脚 */
.foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(20px, 4vw, 42px);
  margin-top: clamp(40px, 8vw, 92px);
  padding: clamp(28px, 5vw, 58px) clamp(16px, 4vw, 44px) clamp(22px, 3vw, 34px);
  border-radius: 54px 54px 0 0;
  background: linear-gradient(158deg, #1f1726 0%, #2c1535 62%, #3d2110 100%);
  color: #f3eadf;
}

.foot-brand {
  flex: 1 1 210px;
  max-width: 320px;
}

.foot-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 60% 40% 46% 54%;
  background: linear-gradient(142deg, var(--plum-soft), var(--clay-soft));
}

.foot-mark svg {
  width: 21px;
  height: 21px;
}

.foot-name {
  margin: 12px 0 6px;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.06em;
  color: #fdf8f2;
}

.foot-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
  color: rgba(243, 234, 223, 0.76);
}

.foot-nav {
  flex: 1 1 230px;
}

.foot-nav dl {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 20px;
  margin: 0;
}

.foot-nav dt {
  width: 100%;
  margin-bottom: 4px;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: #d3bfe6;
}

.foot-nav dd {
  margin: 0;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #f3eadf;
  font-size: 15.5px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.26s ease, color 0.26s ease;
}

.foot-nav a:hover {
  color: #f0dcc4;
  border-bottom-color: #f0dcc4;
}

.sub {
  display: flex;
  flex: 1 1 220px;
  gap: 8px;
  align-items: center;
  max-width: 300px;
  padding: 4px;
  border: 1px solid rgba(243, 234, 223, 0.28);
  border-radius: 999px;
  background: rgba(243, 234, 223, 0.08);
}

.sub-in {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: #fdf8f2;
}

.sub-in::placeholder {
  color: rgba(243, 234, 223, 0.6);
}

.sub-btn {
  flex: none;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(140deg, var(--clay-soft), var(--clay));
  color: #fdf8f2;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: filter 0.26s ease, transform 0.26s ease;
}

.sub-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.foot-end {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 1 1 100%;
  padding-top: 16px;
  border-top: 1px solid rgba(243, 234, 223, 0.16);
}

.copy {
  margin: 0;
  font-size: 14.5px;
  letter-spacing: 0.04em;
  color: rgba(243, 234, 223, 0.68);
}

.foot-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 6px;
  color: #f3eadf;
  font-size: 15px;
  text-decoration: none;
}

.foot-top:hover {
  color: #f0dcc4;
}

/* 桌面布局 */
@media (min-width: 1000px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr) 298px;
    align-items: start;
  }

  .rail {
    position: sticky;
    top: 142px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16.5px;
  }

  .hero-copy {
    max-width: none;
  }

  .foot {
    border-radius: 36px 36px 0 0;
  }

  .foot-brand,
  .sub {
    max-width: none;
    flex: 1 1 100%;
  }
}

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

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

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