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

:root {
  --ink: #1f1f1f;
  --paper: #ffffff;
  --wash: #f5f5f5;
  --line: rgba(31, 31, 31, 0.12);
  --line-2: rgba(31, 31, 31, 0.24);
  --glass: rgba(255, 255, 255, 0.66);
  --shadow: 0 8px 26px rgba(31, 31, 31, 0.07);
  --max: 1180px;
}

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

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

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: "Cabin", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16.5px;
  line-height: 1.68;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: inherit;
}

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

h1,
h2,
h3,
h4 {
  font-family: "Amatic SC", "Cabin", cursive;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: 0.02em;
  margin: 0;
}

h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
}

h3 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin-top: 1.4rem;
}

p {
  margin: 0 0 1rem;
}

hr {
  border: 0;
  height: 2px;
  width: 54px;
  background: var(--ink);
  margin: 0.6rem 0 1.4rem;
}

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

/* 顶部条与品牌栏 */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.strip {
  margin: 0;
  background: var(--ink);
  color: #ffffff;
  text-align: center;
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  padding: 0.4rem 16px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem clamp(14px, 4vw, 34px);
}

.brand {
  font-family: "Amatic SC", cursive;
  font-weight: 700;
  font-size: clamp(1.65rem, 4.4vw, 2.15rem);
  line-height: 1;
  letter-spacing: 0.05em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.3rem 0;
}

/* 汉堡遮罩菜单：details > summary + menu > li > a */
.drawer {
  position: relative;
}

.drawer > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line-2);
  background: var(--paper);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.drawer > summary:hover {
  background: var(--ink);
  color: var(--paper);
}

.drawer > summary::-webkit-details-marker {
  display: none;
}

.burger {
  position: relative;
  width: 20px;
  height: 2px;
  background: currentColor;
}

.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: currentColor;
}

.burger::before {
  top: -6px;
}

.burger::after {
  top: 6px;
}

.drawer[open] {
  z-index: 70;
}

.drawer[open] > summary {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 90;
  box-shadow: var(--shadow);
  background: var(--paper);
  color: var(--ink);
}

.drawer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.drawer[open] .drawer-menu {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: 14vh clamp(20px, 8vw, 90px);
  background: rgba(245, 245, 245, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow-y: auto;
}

.drawer[open] .drawer-menu li {
  border-bottom: 1px solid var(--line);
}

.drawer[open] .drawer-menu a {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 0.2rem 0;
  text-decoration: none;
  font-family: "Amatic SC", cursive;
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  letter-spacing: 0.04em;
  transition: padding-left 0.25s ease;
}

.drawer[open] .drawer-menu a:hover {
  padding-left: 0.7rem;
}

/* 首屏 */
.hero {
  position: relative;
  min-height: calc(100svh - 100px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.4rem;
  padding: clamp(24px, 6vw, 64px) clamp(16px, 6vw, 64px) clamp(64px, 13vw, 130px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(24vh, 200px);
  background: var(--wash);
  clip-path: polygon(0 64%, 100% 0, 100% 100%, 0 100%);
  z-index: 1;
}

.hero-h1 {
  position: relative;
  z-index: 2;
  font-size: clamp(2.6rem, 12vw, 9rem);
  max-width: 22ch;
  letter-spacing: 0.01em;
}

.hero-fig {
  position: relative;
  z-index: 2;
  margin: 0;
  max-width: 52ch;
}

.hero-fig figcaption {
  border-left: 2px solid var(--ink);
  padding-left: 0.9rem;
  font-size: 0.95rem;
  line-height: 1.62;
  color: #3a3a3a;
}

/* 正文区：左正文 + 右索引 */
.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 252px;
  gap: clamp(16px, 2vw, 26px);
  align-items: start;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(26px, 5vw, 58px) clamp(14px, 4vw, 32px) clamp(50px, 8vw, 96px);
}

.prose {
  min-width: 0;
}

.prose > section {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  padding: clamp(20px, 3.2vw, 38px);
  margin: 0 0 clamp(16px, 2.4vw, 26px);
  scroll-margin-top: 118px;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.prose > section:nth-child(even) {
  margin-left: clamp(0px, 3vw, 44px);
}

.prose > section:hover {
  transform: scale(1.006);
  box-shadow: 0 12px 34px rgba(31, 31, 31, 0.1);
}

.prose > section > h2:first-child {
  margin-top: 0;
}

.prose ul,
.prose ol {
  padding-left: 1.15rem;
  margin: 0 0 1rem;
}

.prose li {
  margin: 0.32rem 0;
}

.prose a {
  color: #000000;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose blockquote {
  margin: 1.2rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 2px solid var(--line-2);
  color: #333333;
}

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

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.6rem;
  text-align: left;
}

.prose figure {
  margin: 1.2rem 0;
}

.prose figcaption {
  font-size: 0.88rem;
  color: #4a4a4a;
  padding-top: 0.4rem;
}

/* 右栏索引 */
.rail {
  position: sticky;
  top: 92px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 20px 18px;
}

.rail-h2 {
  font-size: 1.75rem;
  margin: 0;
}

.rail hr {
  width: 40px;
  margin: 0.4rem 0 0.8rem;
}

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

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 0;
  font-size: 0.94rem;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.2s ease;
}

.rail-list li:last-child a {
  border-bottom: 0;
}

.rail-list a:hover {
  padding-left: 0.35rem;
}

/* 页脚 */
.foot {
  background: var(--ink);
  color: var(--wash);
  padding: clamp(28px, 5vw, 56px) clamp(16px, 5vw, 48px) 18px;
}

.foot-big {
  font-family: "Amatic SC", cursive;
  font-weight: 700;
  font-size: clamp(2.6rem, 11vw, 7rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  margin: 0 0 1.3rem;
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  padding-top: 1.2rem;
}

.foot-cols dl {
  margin: 0;
  min-width: 0;
}

.foot-cols dt {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 0.5rem;
}

.foot-cols dd {
  margin: 0;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.foot-cols ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.foot-cols a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: none;
}

.foot-cols a:hover {
  text-decoration: underline;
}

.foot-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  padding-top: 0.8rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.78);
}

.foot-end a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--wash);
  text-decoration: none;
}

.foot-end a:hover {
  text-decoration: underline;
}

/* 滚动显现 */
.rv {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.rv.in {
  opacity: 1;
  transform: none;
}

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

  .rv {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .prose > section,
  .drawer[open] .drawer-menu a {
    transition: none;
  }

  .prose > section:hover {
    transform: none;
  }
}

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

  .prose > section:nth-child(even) {
    margin-left: 0;
  }

  .rail {
    position: static;
    order: 2;
  }
}

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

  .strip {
    font-size: 0.7rem;
    letter-spacing: 0.16em;
  }

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

  .hero {
    min-height: calc(100svh - 104px);
  }
}

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