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

:root {
  --ink: #26171a;
  --ink-2: #2e1d21;
  --ink-3: #3a262b;
  --rose: #eb879c;
  --blush: #ffb6c1;
  --paper: #fdf1f3;
  --muted: #e0c6cc;
  --line: rgba(255, 182, 193, 0.15);
  --radius: 28px;
  --sh: 0 2px 4px rgba(0, 0, 0, 0.32), 0 18px 40px rgba(0, 0, 0, 0.34);
  --sh-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 16px rgba(0, 0, 0, 0.24);
  --rail: 264px;
}

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

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

body {
  margin: 0;
  padding-left: var(--rail);
  background: var(--ink);
  color: var(--paper);
  font-family: 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.78;
  font-weight: 300;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

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

a {
  color: var(--blush);
  text-decoration: none;
  transition: color 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

a:hover {
  color: #fff;
}

:focus-visible {
  outline: 3px solid var(--blush);
  outline-offset: 3px;
  border-radius: 16px;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.02em;
}

/* ——— 左栏 ——— */
.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--rail);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 15px 24px;
  background: linear-gradient(180deg, #2d1c20 0%, #1e1215 78%);
  border-right: 1px solid var(--line);
  box-shadow: 6px 0 30px rgba(0, 0, 0, 0.28);
}

.rail-brand {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--ink-3);
  color: var(--blush);
  font-size: 20px;
  font-weight: 700;
  box-shadow: var(--sh-sm);
}

.rail-brand img {
  width: 46px;
  height: 46px;
  border-radius: 17px;
  object-fit: cover;
}

.rail-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: pill;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pill a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(255, 182, 193, 0.07);
  border: 1px solid rgba(255, 182, 193, 0.1);
  color: var(--paper);
  font-size: 16px;
  line-height: 1.4;
  box-shadow: var(--sh-sm);
}

.pill a::before {
  counter-increment: pill;
  content: counter(pill, decimal-leading-zero);
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--rose);
  letter-spacing: 0.06em;
}

.pill a:hover {
  background: rgba(255, 182, 193, 0.18);
  color: #fff;
  transform: translateX(3px);
}

.rail-cta {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-height: 50px;
  padding: 12px 14px;
  border-radius: 999px;
  background: var(--rose);
  color: #2a1216;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 12px 26px rgba(235, 135, 156, 0.28);
}

/* ——— 首屏 ——— */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: clamp(28px, 6vw, 78px);
  overflow: hidden;
  isolation: isolate;
  border-bottom-left-radius: 64px;
  border-bottom-right-radius: 64px;
  background: radial-gradient(120% 100% at 78% 8%, #6d3743 0%, #331f24 58%, #241519 100%);
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-art img,
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(200deg, rgba(38, 23, 26, 0.15) 0%, rgba(38, 23, 26, 0.78) 62%, rgba(38, 23, 26, 0.96) 100%);
}

.ghost {
  position: absolute;
  right: -0.08em;
  top: 8%;
  z-index: 0;
  font-size: clamp(88px, 16vw, 230px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.05em;
  color: rgba(255, 182, 193, 0.14);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  text-align: right;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(31px, 5vw, 58px);
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.hero-desc {
  margin: 0;
  max-width: 44ch;
  color: var(--muted);
  font-size: 17px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.hero-jump,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 26px;
  border-radius: 999px;
  background: var(--rose);
  color: #2a1216;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 12px 26px rgba(235, 135, 156, 0.26);
}

.hero-jump:hover,
.btn:hover,
.rail-cta:hover {
  background: var(--blush);
  color: #2a1216;
  transform: translateY(-2px);
}

/* ——— 正文区 ——— */
.stage {
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 66px) clamp(16px, 4vw, 44px) 0;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 38px);
  align-items: start;
}

.toc {
  position: sticky;
  top: 26px;
  padding: 22px 20px;
  border-radius: var(--radius);
  background: var(--ink-2);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
}

.toc small {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--rose);
}

.toc h2 {
  margin: 6px 0 12px;
  font-size: 22px;
}

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

.toc-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 2px;
  font-size: 16px;
  color: var(--muted);
  border-bottom: 1px dashed rgba(255, 182, 193, 0.18);
}

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

.toc-list a:hover {
  color: var(--blush);
  padding-left: 6px;
}

.prose {
  min-width: 0;
  overflow-wrap: break-word;
}

.prose section {
  position: relative;
  margin-bottom: 26px;
  padding: clamp(22px, 3.4vw, 42px);
  border-radius: var(--radius);
  background: var(--ink-2);
  border: 1px solid rgba(255, 182, 193, 0.1);
  box-shadow: var(--sh);
  scroll-margin-top: 24px;
}

.prose section::after {
  content: '';
  position: absolute;
  left: clamp(22px, 3.4vw, 42px);
  right: clamp(22px, 3.4vw, 42px);
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--rose), rgba(255, 182, 193, 0.1));
  opacity: 0.55;
}

.prose small {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--rose);
}

.prose h2 {
  margin: 0 0 0.6em;
  font-size: clamp(23px, 2.6vw, 31px);
  color: #fff;
}

.prose h3 {
  margin: 1.4em 0 0.5em;
  font-size: clamp(19px, 2vw, 23px);
  color: var(--blush);
}

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

.prose ul,
.prose ol {
  margin: 0.8em 0;
  padding-left: 1.3em;
  max-width: 66ch;
}

.prose li {
  margin: 0.4em 0;
}

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

.prose a {
  border-bottom: 1px solid rgba(255, 182, 193, 0.5);
}

.prose strong,
.prose b {
  color: #fff;
  font-weight: 700;
}

.prose blockquote {
  margin: 1.1em 0;
  padding: 0.25em 0 0.25em 1.1em;
  border-left: 3px solid var(--rose);
  color: var(--muted);
  font-style: normal;
}

.prose figure {
  margin: 1.2em 0;
}

.prose img {
  border-radius: 18px;
  box-shadow: var(--sh-sm);
}

.prose figcaption {
  margin-top: 0.5em;
  font-size: 15px;
  color: var(--muted);
}

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

/* ——— 页脚 ——— */
.foot {
  margin-top: clamp(44px, 7vw, 96px);
  padding: clamp(30px, 6vw, 68px) clamp(16px, 4vw, 44px) 26px;
  background: linear-gradient(180deg, #2c1a1e 0%, #1a1013 100%);
  border-top-left-radius: 64px;
  border-top-right-radius: 64px;
}

.foot-cta {
  max-width: 1220px;
  margin: 0 auto;
  padding-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.foot-big {
  margin: 0;
  font-size: clamp(34px, 6vw, 62px);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: #fff;
}

.foot-cols {
  max-width: 1220px;
  margin: 0 auto;
  padding: 30px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 40px);
}

.foot-cols dl {
  margin: 0;
}

.foot-nav dl {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.foot-cols dt {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.foot-cols dt a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 0;
  font-size: 16px;
  letter-spacing: 0;
  color: var(--paper);
}

.foot-cols dt a:hover {
  color: var(--blush);
}

.foot-cols dd {
  margin: 2px 0 0;
  font-size: 16px;
  color: var(--blush);
}

.foot-cols dd:empty {
  display: none;
}

.foot-base {
  max-width: 1220px;
  margin: 0 auto;
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--muted);
}

.foot-base p {
  margin: 0;
}

.foot-base a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 0;
  color: var(--blush);
}

/* ——— 动效 ——— */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy {
    animation: rise 0.5s ease both;
  }

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

html.js .prose section {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

html.js .prose section.in {
  opacity: 1;
  transform: none;
}

html.js .prose section:nth-child(2) { transition-delay: 0.04s; }
html.js .prose section:nth-child(3) { transition-delay: 0.08s; }
html.js .prose section:nth-child(4) { transition-delay: 0.12s; }
html.js .prose section:nth-child(5) { transition-delay: 0.16s; }
html.js .prose section:nth-child(6) { transition-delay: 0.2s; }
html.js .prose section:nth-child(7) { transition-delay: 0.24s; }

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

  html.js .prose section {
    opacity: 1;
    transform: none;
    transition: none;
  }

  a,
  .pill a {
    transition: none;
  }
}

/* ——— 断点 ——— */
@media (max-width: 1000px) {
  .stage {
    grid-template-columns: 210px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  body {
    padding-left: 0;
    padding-top: 68px;
  }

  .rail {
    top: 0;
    bottom: auto;
    width: 100%;
    height: 68px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  }

  .rail-brand,
  .rail-brand img {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .rail-nav {
    flex: 1 1 auto;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .rail-nav::-webkit-scrollbar {
    height: 0;
  }

  .rail-list {
    flex-direction: row;
    gap: 8px;
    padding: 2px 0;
  }

  .pill a {
    white-space: nowrap;
    padding: 9px 14px;
    transform: none;
  }

  .pill a:hover {
    transform: none;
  }

  .rail-cta {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 18px;
  }

  .hero {
    min-height: calc(100svh - 68px);
    border-bottom-left-radius: 42px;
    border-bottom-right-radius: 42px;
    padding: clamp(24px, 7vw, 48px);
  }

  .ghost {
    font-size: clamp(72px, 22vw, 150px);
    top: 6%;
  }

  .stage {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 26px;
  }

  .toc {
    position: static;
  }

  .toc-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
  }

  .toc-list a {
    border-bottom: 0;
    padding: 8px 0;
  }

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

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

  .foot {
    border-top-left-radius: 42px;
    border-top-right-radius: 42px;
  }
}

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

  .foot-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-copy {
    gap: 13px;
  }
}

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