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

:root {
  --green: #00ff80;
  --blue: #0000ff;
  --ink: #000000;
  --dim: #b9b9b9;
  --edge: #1c1c1c;
  --bar: 3px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 132px;
}

body {
  margin: 0;
  background-color: var(--ink);
  background-image: linear-gradient(to right, rgba(0, 255, 128, .07) 1px, transparent 1px);
  background-size: 72px 100%;
  color: #fff;
  font-family: 'Noto Sans Thai', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.72;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; }

/* ---------- 顶栏 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--ink);
  border-bottom: var(--bar) solid var(--green);
}

.top-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  background: var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 0;
  color: var(--green);
  text-decoration: none;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .02em;
}

.brand .mark {
  width: 28px;
  height: 28px;
  border: 2px solid var(--green);
  object-fit: cover;
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.call {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  border: 2px solid var(--green);
  color: var(--green);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: .04em;
}

.call:hover { background: var(--green); color: #000; }

.burger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 14px;
  border: 0;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .12em;
  cursor: pointer;
}

.burger-bar,
.burger-bar::before,
.burger-bar::after {
  display: block;
  width: 18px;
  height: 3px;
  background: currentColor;
}

.burger-bar { position: relative; }
.burger-bar::before,
.burger-bar::after { content: ''; position: absolute; left: 0; }
.burger-bar::before { top: -6px; }
.burger-bar::after { top: 6px; }

/* ---------- 锚点条 / 全屏菜单 ---------- */
.rail {
  position: relative;
  z-index: 1;
  background: var(--ink);
  border-top: 2px solid var(--edge);
}

.rail p {
  display: flex;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.rail p::-webkit-scrollbar { display: none; }

.rail a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 14px;
  border-right: 2px solid var(--edge);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.rail a:hover { background: var(--green); color: #000; }
.rail a.is-on { background: var(--blue); color: #fff; }

.rail.is-open {
  position: fixed;
  inset: 0;
  z-index: 1;
  padding: 92px 18px 28px;
  overflow-y: auto;
  background: var(--ink);
  border-top: 0;
}

.rail.is-open p {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.rail.is-open a {
  padding: 18px 6px;
  border-right: 0;
  border-bottom: 2px solid var(--edge);
  font-size: 22px;
  font-weight: 700;
  white-space: normal;
}

.rail.is-open a.is-on { background: transparent; color: var(--green); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 45vh;
  padding: 42px 18px 46px;
  overflow: hidden;
  background: var(--blue);
  border-bottom: 4px solid var(--green);
  scroll-margin-top: 132px;
}

.hero-in {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 860px;
}

.hero-ico img {
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  border: 3px solid var(--green);
  object-fit: cover;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 6.4vw, 60px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.01em;
  color: #fff;
}

.lead {
  max-width: 46ch;
  margin: 0;
  padding-left: 14px;
  border-left: 4px solid var(--green);
  font-size: 17px;
  color: #ededed;
}

.ghost {
  position: absolute;
  right: -2vw;
  bottom: -2vw;
  z-index: 1;
  font-size: clamp(78px, 23vw, 260px);
  font-weight: 700;
  line-height: .8;
  letter-spacing: -.03em;
  color: rgba(0, 255, 128, .22);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

/* ---------- 主体栅格 ---------- */
.grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
}

.side {
  position: sticky;
  top: 136px;
  padding: 26px 18px 32px;
  border-right: var(--bar) solid var(--green);
  background: #080808;
}

.side-h {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--green);
}

.subtitle {
  margin: 0 0 18px;
  font-size: 16px;
  letter-spacing: .12em;
  color: var(--dim);
}

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

.side-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 0;
  border-bottom: 2px solid var(--edge);
  color: #fff;
  font-size: 16px;
  text-decoration: none;
}

.side-list a::before {
  counter-increment: sk;
  content: counter(sk, decimal-leading-zero);
  margin-right: 10px;
  color: var(--green);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.side-list a:hover { color: var(--green); }

/* ---------- 正文 ---------- */
.content {
  min-width: 0;
  padding: 30px 18px 64px;
}

.content > div {
  scroll-margin-top: 132px;
  padding-top: 26px;
  margin-top: 34px;
  border-top: 3px solid var(--edge);
}

.content > div:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.content h2 {
  margin: 0 0 18px;
  padding: 10px 14px;
  background: var(--blue);
  color: #fff;
  font-size: clamp(21px, 3.4vw, 30px);
  font-weight: 700;
  line-height: 1.3;
}

.content h3 {
  margin: 30px 0 10px;
  padding-left: 12px;
  border-left: 6px solid var(--green);
  color: var(--green);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.content h4 {
  margin: 22px 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
}

.content p { margin: 0 0 16px; }

.content a {
  color: var(--green);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.content ul,
.content ol {
  margin: 0 0 18px;
  padding-left: 24px;
}

.content li { margin-bottom: 8px; }
.content li::marker { color: var(--green); }

.content strong { color: var(--green); font-weight: 700; }

.content figure {
  margin: 24px 0;
  padding: 12px;
  background: var(--blue);
}

.content figure img { width: 100%; }

.content figcaption {
  margin-top: 8px;
  font-size: 16px;
  color: #d8d8d8;
}

.content blockquote {
  margin: 24px 0;
  padding: 14px 18px;
  border-left: 6px solid var(--green);
  background: #0c0c0c;
  color: #dcdcdc;
}

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

.content table {
  width: 100%;
  margin: 22px 0;
  border-collapse: collapse;
  font-size: 16px;
}

.content th,
.content td {
  padding: 10px 12px;
  border: 2px solid #262626;
  text-align: left;
  vertical-align: top;
}

.content th { background: #101010; color: var(--green); }

.content hr {
  margin: 28px 0;
  border: 0;
  border-top: 3px solid var(--green);
}

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 24px;
  padding: 34px 18px 0;
  border-top: 4px solid var(--green);
  background: var(--ink);
}

.foot-main {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 26px;
  max-width: 1180px;
  margin: 0 auto;
}

.fbrand strong {
  display: block;
  font-size: clamp(40px, 11vw, 104px);
  font-weight: 700;
  line-height: .88;
  letter-spacing: -.03em;
  color: var(--green);
}

.fbrand p {
  max-width: 42ch;
  margin: 16px 0 0;
  font-size: 16px;
  color: var(--dim);
}

.foot-nav p {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  margin: 0;
}

.foot-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 0;
  border-bottom: 2px solid var(--edge);
  font-size: 16px;
  text-decoration: none;
}

.foot-nav a:hover { color: var(--green); }

.foot-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  margin: 30px auto 0;
  padding: 12px 0 22px;
  border-top: 3px solid var(--edge);
}

.copy { font-size: 16px; color: var(--dim); }

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

/* ---------- 动效 ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .hero-in { animation: rise .4s steps(5, end) both; }
  .side-list li { animation: rise .38s steps(5, end) both; }

  .side-list li:nth-child(2) { animation-delay: .05s; }
  .side-list li:nth-child(3) { animation-delay: .1s; }
  .side-list li:nth-child(4) { animation-delay: .15s; }
  .side-list li:nth-child(5) { animation-delay: .2s; }
  .side-list li:nth-child(6) { animation-delay: .25s; }
  .side-list li:nth-child(7) { animation-delay: .3s; }

  .ghost { will-change: transform; }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 860px) {
  .grid { grid-template-columns: minmax(0, 1fr); }

  .side {
    position: static;
    padding: 22px 16px 26px;
    border-right: 0;
    border-bottom: var(--bar) solid var(--green);
  }

  .side-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

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

@media (max-width: 480px) {
  body { font-size: 17px; }

  .hero { min-height: 45vh; padding: 34px 16px 40px; }

  .content { padding: 24px 16px 54px; }

  .side-list { grid-template-columns: minmax(0, 1fr); }

  .foot-nav p { grid-template-columns: minmax(0, 1fr); }
}

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