@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;
  --paper: #ffffff;
  --line: #232323;
  --mute: #9a9a9a;
  --bar: 240px;
  --r: 28px;
  --f: "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 99;
  background: var(--green);
  color: #000;
  font-weight: 700;
  padding: 12px 18px;
  text-decoration: none;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- 左侧固定竖排导航 ---------- */
.bar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--bar);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 14px;
  background: #000;
  border-right: 4px solid var(--green);
  overflow-y: auto;
  z-index: 60;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  background: var(--green);
  color: #000;
  border: 3px solid var(--paper);
  text-decoration: none;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}
.brand .mark-img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  display: block;
}

.menu {
  border-top: 3px solid var(--blue);
  border-bottom: 3px solid var(--blue);
}

summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 4px;
  color: var(--green);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.18em;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "＋";
  margin-left: auto;
  color: var(--paper);
  font-weight: 700;
  letter-spacing: 0;
}
details[open] summary::after { content: "－"; }

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0 0 10px;
  display: grid;
  gap: 2px;
}
.menu-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 8px;
  color: var(--paper);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-left: 4px solid transparent;
}
.menu-list a:hover,
.menu-list a:focus-visible {
  background: var(--blue);
  border-left-color: var(--green);
}

.cta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 12px;
  background: var(--green);
  color: #000;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  border: 3px solid #000;
  box-shadow: inset 0 0 0 3px var(--green);
}
.cta:hover { background: var(--blue); color: #fff; box-shadow: inset 0 0 0 3px var(--blue); }

/* ---------- 主区 ---------- */
.main { margin-left: var(--bar); }

.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
  padding: 32px 20px 0;
  border-bottom: 4px solid var(--green);
  background: #000;
}

.hero-txt {
  text-align: center;
  padding: 10px 0 24px;
}

.badge {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  border-radius: var(--r);
  padding: 5px 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0.4em 0 0.45em;
  font-size: clamp(2.1rem, 8vw, 4.5rem);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero .subtitle {
  margin: 0 auto;
  max-width: 48ch;
  color: var(--green);
  font-size: 16px;
  line-height: 1.65;
}

.hero-fig {
  margin: 0;
  border-top: 4px solid var(--green);
  overflow: hidden;
  max-height: 46vh;
  background: var(--blue);
}
.hero-img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  will-change: transform;
}

/* ---------- 内容流 + 右侧栏 ---------- */
.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.flow > article {
  padding: 34px 20px 40px;
  border-bottom: 3px solid var(--line);
  scroll-margin-top: 96px;
}
.flow > article:nth-child(odd) { border-left: 8px solid var(--green); }
.flow > article:nth-child(even) { border-left: 8px solid var(--blue); }

.flow > article h2 {
  margin: 0 0 0.5em;
  font-size: clamp(1.45rem, 4.6vw, 2.3rem);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.flow > article p.subtitle {
  margin: 0 0 1.3em;
  padding-bottom: 0.8em;
  border-bottom: 2px solid var(--line);
  color: var(--green);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.flow > article p,
.flow > article li { max-width: 66ch; }
.flow > article p { margin: 0 0 1em; }
.flow > article ul,
.flow > article ol { margin: 0 0 1.1em; padding-left: 1.35em; }
.flow > article li { margin: 0.45em 0; }

.flow > article h3 {
  margin: 1.5em 0 0.5em;
  font-size: 1.16rem;
  font-weight: 700;
  color: var(--green);
}

.flow > article a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.flow > article strong { color: var(--green); }

.flow > article blockquote {
  margin: 1.3em 0;
  padding: 14px 18px;
  border-left: 6px solid var(--blue);
  background: #0a0a0a;
  color: #e8e8e8;
}

.flow > article img {
  display: block;
  margin: 1.2em 0;
  border: 3px solid var(--line);
  height: auto;
}

.flow > article pre {
  overflow-x: auto;
  padding: 14px;
  border: 3px solid var(--line);
  background: #080808;
  font-size: 15px;
}

/* ---------- 侧栏 ---------- */
.side {
  margin: 26px 20px 34px;
  padding: 20px 18px;
  border: 4px solid var(--green);
  border-radius: var(--r);
  background: #050505;
}
.side h2 {
  margin: 0 0 0.25em;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--green);
}
.side p.subtitle {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--mute);
}

.anchors {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}
.anchors a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 13px;
  border: 2px solid #333;
  border-radius: var(--r);
  color: var(--paper);
  text-decoration: none;
  font-size: 15px;
}
.anchors a:hover,
.anchors a:focus-visible {
  border-color: var(--green);
  color: var(--green);
}

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin-left: 0;
  padding: 22px 20px;
  border-top: 4px solid var(--green);
  background: #000;
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--green);
  color: #000;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.foot-brand .mark,
.foot-brand .mark-img {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
}
.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  color: var(--paper);
  text-decoration: none;
  font-size: 15px;
  border-bottom: 2px solid var(--blue);
}
.foot-nav a:hover,
.foot-nav a:focus-visible { color: var(--green); border-bottom-color: var(--green); }

.foot-copy {
  font-size: 14px;
  color: var(--mute);
  letter-spacing: 0.05em;
}

/* ---------- 动效 ---------- */
.js .flow > article {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.22s steps(2, end), transform 0.22s steps(2, end);
}
.js .flow > article.in {
  opacity: 1;
  transform: none;
}
.js .hero-img { transition: transform 0s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .flow > article { opacity: 1; transform: none; transition: none; }
}

/* ---------- 桌面双栏 ---------- */
@media (min-width: 1000px) {
  .flow { grid-template-columns: minmax(0, 1fr) 288px; }
  .flow > article { grid-column: 1; padding: 44px 36px 52px; }
  .side {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    margin: 30px 20px;
  }
  .foot { padding: 24px 36px; }
}

/* ---------- 移动端 ---------- */
@media (max-width: 899px) {
  body { font-size: 16px; }

  .bar {
    position: sticky;
    top: 0;
    bottom: auto;
    left: auto;
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-right: 0;
    border-bottom: 4px solid var(--green);
    overflow: visible;
  }

  .brand { width: 46px; height: 46px; border-width: 2px; font-size: 22px; }
  .brand .mark-img { width: 40px; height: 40px; }

  .menu {
    position: relative;
    flex: 1 1 auto;
    border-top: 0;
    border-bottom: 0;
    min-width: 0;
  }
  summary { padding: 10px 8px; }

  .menu-list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: min(300px, calc(100vw - 20px));
    max-height: 68vh;
    overflow-y: auto;
    background: #000;
    border: 3px solid var(--green);
    padding: 6px;
    z-index: 80;
  }

  .cta { margin-top: 0; min-height: 44px; padding: 9px 12px; font-size: 14px; letter-spacing: 0.04em; }

  .main { margin-left: 0; }
  .hero { min-height: 64vh; padding: 22px 16px 0; }
  .hero-txt { padding: 4px 0 18px; }
  .flow > article { padding: 28px 16px 34px; border-left-width: 6px; scroll-margin-top: 86px; }
  .side { margin: 22px 16px 30px; }
  .foot { margin-left: 0; padding: 18px 16px; justify-content: flex-start; }
  .foot-copy { width: 100%; }
}

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