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

:root {
  --mint: #87ff71;
  --cyan: #01cdfe;
  --ink: #192617;
  --bg: #0b120b;
  --bg2: #111b11;
  --txt: #e9ffe6;
  --dim: #a3bda1;
  --line: rgba(135, 255, 113, 0.2);
  --glass: rgba(22, 36, 22, 0.58);
  --rad: 4px;
  --ease: cubic-bezier(0.22, 0.68, 0.28, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: "Noto Sans Thai", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--txt);
  background:
    radial-gradient(900px 520px at 88% -10%, rgba(1, 205, 254, 0.24), transparent 62%),
    radial-gradient(760px 460px at 2% 4%, rgba(255, 113, 206, 0.2), transparent 60%),
    linear-gradient(180deg, #0a110a 0%, #101a10 48%, #0a120a 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: screen;
}

a {
  color: var(--mint);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--cyan);
}

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

/* ---------- 顶栏 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px clamp(14px, 4vw, 40px);
  background: linear-gradient(180deg, rgba(10, 18, 10, 0.94), rgba(10, 18, 10, 0.66));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--rad);
  border: 1px solid rgba(135, 255, 113, 0.32);
  background: rgba(135, 255, 113, 0.06);
  filter: drop-shadow(0 0 10px rgba(1, 205, 254, 0.35));
}

.mark:hover {
  border-color: var(--cyan);
  filter: drop-shadow(0 0 14px rgba(135, 255, 113, 0.5));
}

.mark-img {
  border-radius: var(--rad);
  display: block;
}

.dd {
  position: relative;
}

.dd > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: var(--rad);
  border: 1px solid rgba(1, 205, 254, 0.4);
  background: rgba(1, 205, 254, 0.08);
  color: var(--txt);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
  user-select: none;
}

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

.dd-bar,
.dd-bar::before,
.dd-bar::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--mint);
  transition: transform 0.25s var(--ease);
}

.dd-bar {
  position: relative;
}

.dd-bar::before,
.dd-bar::after {
  content: "";
  position: absolute;
  left: 0;
}

.dd-bar::before {
  top: -5px;
}

.dd-bar::after {
  top: 5px;
}

.dd[open] > summary {
  border-color: var(--mint);
  box-shadow: 0 0 18px rgba(135, 255, 113, 0.28);
}

.dd[open] .dd-bar {
  background: transparent;
}

.dd[open] .dd-bar::before {
  transform: translateY(5px) rotate(45deg);
}

.dd[open] .dd-bar::after {
  transform: translateY(-5px) rotate(-45deg);
}

.dd menu {
  list-style: none;
  margin: 10px 0 0;
  padding: 8px;
  position: absolute;
  right: 0;
  top: 100%;
  width: min(288px, 78vw);
  border-radius: var(--rad);
  border: 1px solid rgba(1, 205, 254, 0.34);
  background: rgba(14, 24, 14, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(135, 255, 113, 0.08) inset;
  max-height: 72vh;
  overflow-y: auto;
}

.dd menu li a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--rad);
  color: var(--txt);
  font-size: 16px;
}

.dd menu li a:hover,
.dd menu li a:focus-visible {
  background: rgba(135, 255, 113, 0.12);
  color: var(--mint);
}

.dd[open] menu li {
  animation: slide-in 0.36s var(--ease) both;
}

.dd[open] menu li:nth-child(1) { animation-delay: 0.02s; }
.dd[open] menu li:nth-child(2) { animation-delay: 0.055s; }
.dd[open] menu li:nth-child(3) { animation-delay: 0.09s; }
.dd[open] menu li:nth-child(4) { animation-delay: 0.125s; }
.dd[open] menu li:nth-child(5) { animation-delay: 0.16s; }
.dd[open] menu li:nth-child(6) { animation-delay: 0.195s; }
.dd[open] menu li:nth-child(7) { animation-delay: 0.23s; }

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 头图 ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 42vh;
  padding: clamp(26px, 6vw, 60px) clamp(16px, 5vw, 56px) clamp(22px, 4vw, 44px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(1, 205, 254, 0.42) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  mask-image: linear-gradient(200deg, #000 8%, rgba(0, 0, 0, 0.25) 58%, transparent 88%);
  -webkit-mask-image: linear-gradient(200deg, #000 8%, rgba(0, 0, 0, 0.25) 58%, transparent 88%);
  animation: drift 22s linear infinite;
  opacity: 0.85;
}

@keyframes drift {
  to {
    background-position: 220px 220px;
  }
}

.hero::after {
  content: "";
  position: absolute;
  right: -8%;
  bottom: -46%;
  width: 76%;
  height: 96%;
  background: radial-gradient(closest-side, rgba(255, 113, 206, 0.36), transparent 72%);
  filter: blur(6px);
  pointer-events: none;
}

.hero-in {
  position: relative;
  z-index: 1;
  text-align: right;
  max-width: 100%;
}

.hero-eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(1, 205, 254, 0.6);
}

.hero-t {
  margin: 0;
  font-size: clamp(2.15rem, 8.4vw, 5.4rem);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.02em;
  word-break: break-word;
  background: linear-gradient(102deg, #87ff71 4%, #01cdfe 52%, #ff71ce 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(1, 205, 254, 0.34));
}

/* ---------- 布局 ---------- */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: clamp(20px, 4vw, 46px);
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 48px) clamp(16px, 5vw, 40px) 0;
}

.doc {
  min-width: 0;
}

.doc > section {
  padding: 28px 0 30px;
  border-top: 1px dashed var(--line);
  scroll-margin-top: 84px;
}

.doc > section:first-child {
  border-top: 0;
  padding-top: 6px;
}

.doc h2 {
  margin: 0 0 14px;
  font-size: clamp(1.3rem, 3.4vw, 1.85rem);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f2fff0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.doc h2 > span {
  background: linear-gradient(transparent 64%, rgba(1, 205, 254, 0.32) 64%);
}

.doc h3 {
  margin: 22px 0 10px;
  font-size: 1.12rem;
  color: var(--mint);
}

.doc p {
  margin: 0 0 14px;
  color: #dff2dc;
}

.doc ul,
.doc ol {
  margin: 0 0 16px;
  padding-left: 1.25em;
}

.doc li {
  margin: 0 0 8px;
}

.doc li::marker {
  color: var(--cyan);
}

.doc img {
  border-radius: var(--rad);
  border: 1px solid var(--line);
}

.doc blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--cyan);
  background: rgba(1, 205, 254, 0.07);
  border-radius: 0 var(--rad) var(--rad) 0;
  color: #cfe8cd;
}

.doc code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: rgba(135, 255, 113, 0.12);
  padding: 0.1em 0.36em;
  border-radius: var(--rad);
}

/* ---------- 侧栏 ---------- */
.rail {
  position: sticky;
  top: 78px;
  padding: 16px 16px 20px;
  border-radius: var(--rad);
  border: 1px solid rgba(135, 255, 113, 0.26);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.rail-h {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: var(--cyan);
}

.rail-h > span {
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(1, 205, 254, 0.4);
}

.rail-h2 {
  margin-top: 20px;
}

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

.rail-list li {
  counter-increment: sec;
  margin: 0;
  border-bottom: 1px solid rgba(135, 255, 113, 0.1);
}

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

.rail-list a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  min-height: 40px;
  padding: 9px 2px;
  color: #d8efd5;
  font-size: 15px;
  line-height: 1.4;
}

.rail-list a::before {
  content: counter(sec, decimal-leading-zero);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(135, 255, 113, 0.6);
  flex: none;
}

.rail-list a:hover,
.rail-list a.on {
  color: var(--mint);
}

.rail-list a.on {
  text-shadow: 0 0 12px rgba(135, 255, 113, 0.5);
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--rad);
  border: 1px solid rgba(1, 205, 254, 0.42);
  background: rgba(1, 205, 254, 0.1);
  font-size: 14px;
  color: var(--cyan);
}

.to-top:hover {
  background: rgba(135, 255, 113, 0.16);
  border-color: var(--mint);
}

/* ---------- 页脚 ---------- */
.foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 26px;
  align-items: end;
  max-width: 1120px;
  margin: clamp(30px, 6vw, 64px) auto 0;
  padding: 34px clamp(16px, 5vw, 40px) 30px;
  border-top: 1px solid var(--line);
}

.foot-brand {
  margin: 0;
  font-size: clamp(1.55rem, 6.4vw, 3.1rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, #87ff71, #01cdfe 60%, #ff71ce);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 14px;
  margin: 0;
  font-size: 15px;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 0;
  color: #cfe6cc;
}

.foot small {
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid rgba(135, 255, 113, 0.12);
  font-size: 13px;
  color: var(--dim);
}

/* ---------- 滚动显形 ---------- */
.rv {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
    order: 2;
    margin-top: 4px;
  }

  .foot {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .foot-links {
    justify-content: flex-start;
  }
}

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

  .hero {
    min-height: 46vh;
    padding-top: 24px;
  }

  .hero-t {
    font-size: clamp(1.95rem, 9.6vw, 3rem);
  }

  .doc > section {
    scroll-margin-top: 76px;
  }
}

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

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

  .dd[open] menu li,
  .hero-dots {
    animation: none;
  }
}

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