:root {
  --ink: #192617;
  --ink-2: #101c0f;
  --green: #87ff71;
  --yellow: #ffce5c;
  --fg: #e8f2e0;
  --dim: #a9bda1;
  --rail: 252px;
}

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

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

body {
  margin: 0;
  font-family: "Noto Sans Thai", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  background: var(--ink);
  color: var(--fg);
}

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

h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; }

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

[id] { scroll-margin-top: 84px; }

/* ---------- 左侧固定栏 ---------- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail);
  padding: 18px 16px 30px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: var(--ink-2);
  border-right: 2px dashed rgba(135, 255, 113, .45);
  overflow-y: auto;
  z-index: 50;
}

.rail::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(135, 255, 113, .22) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
}

.rail > * { position: relative; z-index: 1; }

.rail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--green);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.brand-name { letter-spacing: -.01em; }

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 13px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 90% 100%, 0 100%);
  transition: transform .18s ease, background .18s ease;
}

.cta:hover { background: var(--green); transform: rotate(-3deg) scale(1.04); }

.railnav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 16px;
}

.grp-label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--yellow);
}

.grp-label::after {
  content: "";
  display: block;
  height: 3px;
  margin-top: 7px;
  background: repeating-linear-gradient(90deg, var(--yellow) 0 6px, transparent 6px 12px);
}

.grp-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.grp-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px;
  color: var(--fg);
  text-decoration: none;
  border-left: 4px solid transparent;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.grp-list a:hover,
.grp-list a:focus-visible {
  background: rgba(135, 255, 113, .16);
  border-left-color: var(--green);
  color: var(--green);
}

.grp-list a.is-active {
  background: var(--green);
  border-left-color: var(--yellow);
  color: var(--ink);
  font-weight: 700;
}

.topbar { display: none; }

/* ---------- 主体 ---------- */
.main {
  margin-left: var(--rail);
  max-width: 1560px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  align-items: start;
  gap: clamp(20px, 3vw, 44px);
  padding: clamp(20px, 3vw, 44px) clamp(16px, 3vw, 44px) 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(16px, 2.5vw, 32px);
  min-height: 45vh;
  padding-bottom: clamp(18px, 3vw, 34px);
  border-bottom: 2px dashed rgba(135, 255, 113, .32);
}

.hero-art {
  position: relative;
  height: 100%;
  min-height: 190px;
  background: var(--green);
  clip-path: polygon(0 6%, 94% 0, 100% 92%, 6% 100%);
  overflow: hidden;
}

.hero-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(var(--ink) 1.5px, transparent 1.5px);
  background-size: 14px 14px;
  opacity: .45;
}

.hero-art img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
}

.sh { position: absolute; z-index: 1; }
.s1 {
  width: 74px; height: 74px;
  top: 16%; left: 12%;
  background: var(--yellow);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: rotate(-8deg);
}
.s2 {
  width: 62px; height: 62px;
  right: 14%; bottom: 12%;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 68%, 0 100%);
  transform: rotate(12deg);
}
.s3 {
  width: 96px; height: 12px;
  top: 62%; left: 32%;
  background: var(--ink);
  clip-path: polygon(0 40%, 100% 0, 100% 60%, 0 100%);
}

.hero-copy { text-align: right; }

.kicker,
.prose small,
.side small {
  display: inline-block;
  background: var(--yellow);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 2px 10px;
  transform: rotate(-1.5deg);
}

h1 {
  margin-top: 14px;
  font-size: clamp(30px, 4.6vw, 52px);
  color: var(--green);
  letter-spacing: -.015em;
}

/* ---------- 正文 ---------- */
.prose { max-width: 72ch; }

.prose > div {
  padding: clamp(26px, 4vw, 44px) 0;
  border-top: 2px dashed rgba(135, 255, 113, .22);
}

.prose > div:first-child {
  border-top: 0;
  padding-top: clamp(24px, 3vw, 34px);
}

.prose small { margin-bottom: 9px; }

.prose h2 {
  font-size: clamp(22px, 3vw, 30px);
  color: var(--green);
  margin: 0 0 14px;
}

.prose h3 {
  font-size: 19px;
  color: var(--yellow);
  margin: 22px 0 8px;
}

.prose p { margin: 0 0 14px; }

.prose ul, .prose ol { margin: 0 0 16px; padding-left: 1.25em; }
.prose li { margin-bottom: 6px; }

.prose a {
  color: var(--yellow);
  text-decoration: none;
  border-bottom: 2px solid rgba(255, 206, 92, .45);
}

.prose a:hover {
  color: var(--ink);
  background: var(--yellow);
  border-bottom-color: var(--yellow);
}

.prose strong { color: var(--green); }

.prose img { margin: 16px 0; border: 3px solid var(--green); }

.prose blockquote {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: rgba(255, 206, 92, .13);
  border-left: 6px solid var(--yellow);
}

/* ---------- 右侧边栏 ---------- */
.side {
  position: sticky;
  top: 24px;
  background: var(--yellow);
  color: var(--ink);
  padding: 22px 18px 26px;
  clip-path: polygon(0 0, 100% 0, 100% 94%, 91% 100%, 0 100%);
}

.side small { border-bottom: 2px solid var(--ink); padding-bottom: 3px; }

.side h2 {
  font-size: 22px;
  color: var(--ink);
  margin: 10px 0 12px;
}

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

.side-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px dotted rgba(25, 38, 23, .38);
  transition: padding-left .16s ease, background .16s ease, color .16s ease;
}

.side-list a:hover {
  background: var(--ink);
  color: var(--yellow);
  padding-left: 9px;
}

/* ---------- 页脚 ---------- */
.foot {
  margin-left: var(--rail);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(20px, 4vw, 50px);
  padding: clamp(30px, 5vw, 60px) clamp(16px, 3vw, 44px) 26px;
  background: var(--ink-2);
  border-top: 3px solid var(--green);
}

.foot-name {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--green);
  text-shadow: 4px 4px 0 var(--yellow);
}

.foot-dots {
  display: block;
  width: 96px;
  height: 14px;
  margin-top: 18px;
  background: repeating-linear-gradient(90deg, var(--green) 0 10px, transparent 10px 18px);
  clip-path: polygon(0 0, 100% 30%, 100% 100%, 0 70%);
}

.foot dl { margin: 0; }

.foot dt {
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--yellow);
}

.foot dt:first-child { margin-top: 0; }

.foot dd { margin: 0; }

.foot dd a {
  display: flex;
  align-items: center;
  min-height: 42px;
  font-size: 16px;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px dotted rgba(232, 242, 224, .25);
  transition: padding-left .16s ease, background .16s ease, color .16s ease;
}

.foot dd a:hover { background: var(--green); color: var(--ink); padding-left: 9px; }

.foot-base {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 16px;
  font-size: 15px;
  color: var(--dim);
  border-top: 2px dashed rgba(135, 255, 113, .3);
}

.foot-base a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--green);
  text-decoration: none;
  border-bottom: 2px solid rgba(135, 255, 113, .4);
}

.foot-base a:hover { color: var(--ink); background: var(--green); }

/* ---------- 动效 ---------- */
html.reveal-ready .js-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}

html.reveal-ready .js-reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
  html.reveal-ready .js-reveal { opacity: 1; transform: none; }
}

/* ---------- 下拉（宽屏） ---------- */
@media (min-width: 901px) {
  .grp-list { display: none; }
  .grp:hover .grp-list,
  .grp:focus-within .grp-list { display: block; }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .topbar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 60;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    background: var(--ink-2);
    border-bottom: 2px dashed rgba(135, 255, 113, .45);
  }

  .menubtn {
    min-height: 44px;
    min-width: 68px;
    padding: 0 14px;
    font: inherit;
    font-weight: 700;
    color: var(--green);
    background: transparent;
    border: 2px solid var(--green);
    cursor: pointer;
    clip-path: polygon(0 0, 100% 0, 100% 74%, 88% 100%, 0 100%);
  }

  .rail {
    width: min(84vw, 300px);
    transform: translateX(-104%);
    transition: transform .28s ease;
    box-shadow: none;
  }

  body.menu-open .rail {
    transform: none;
    box-shadow: 12px 0 0 rgba(135, 255, 113, .18);
  }

  body.menu-open { overflow: hidden; }

  .main {
    margin-left: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding: 18px 16px 48px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-bottom: 18px;
  }

  .hero-copy { order: 1; }

  .hero-art {
    order: 2;
    height: 132px;
    min-height: 132px;
    clip-path: polygon(0 8%, 96% 0, 100% 90%, 4% 100%);
  }

  .hero-art img { min-height: 132px; }

  h1 { margin-top: 10px; }

  .side { position: static; }

  .foot {
    margin-left: 0;
    grid-template-columns: minmax(0, 1fr);
    padding: 28px 16px 22px;
  }

  .foot-base { margin-top: 2px; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .brand-name { font-size: 15px; }
  .foot-name { text-shadow: 3px 3px 0 var(--yellow); }
}

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