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

/* ============================
   CSS 变量 & 基础重置
   ============================ */
:root {
  --c-lime: #80ff00;
  --c-green: #00ff00;
  --c-dark: #1f2617;
  --c-dark2: #151a0f;
  --c-dark3: #2a3520;
  --c-text: #e8f5d0;
  --c-muted: #9ab87a;
  --c-white: #ffffff;
  --c-card-bg: #243018;
  --c-border: #3a4d2a;
  --nav-h: 64px;
  --anchor-h: 44px;
  --font-main: 'Noto Sans Thai', 'Noto Sans SC', system-ui, sans-serif;
  --radius-card: 10px;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.45), 0 1px 4px rgba(128,255,0,0.08);
  --transition-std: 0.22s cubic-bezier(.4,0,.2,1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 17px;
  background: var(--c-dark2);
  color: var(--c-text);
}

body.body-root {
  font-family: var(--font-main);
  line-height: 1.65;
  background: var(--c-dark2);
  color: var(--c-text);
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: var(--c-lime); text-decoration: none; }
a:hover { color: var(--c-green); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
h1,h2,h3,h4 { line-height: 1.25; font-weight: 700; }

/* scroll-margin for anchor sections */
div[id] { scroll-margin-top: calc(var(--nav-h) + var(--anchor-h) + 8px); }

/* ============================
   布局外壳
   ============================ */
.site-wrap { position: relative; }

/* ============================
   顶部主导航
   ============================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--c-dark);
  border-bottom: 2.5px solid var(--c-lime);
  height: var(--nav-h);
  box-shadow: 0 2px 24px rgba(128,255,0,0.18);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
}

.brand-link { display: flex; align-items: center; gap: 8px; text-decoration: none; }

.brand-logo { height: 36px; width: auto; }
.brand-mark { height: 32px; width: auto; }

.brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-lime);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.header-sticker {
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--c-lime);
  color: var(--c-dark);
  padding: 2px 6px;
  border-radius: 3px;
  transform: rotate(-8deg);
  display: inline-block;
  position: absolute;
  top: -6px;
  right: -28px;
  letter-spacing: 0.08em;
  box-shadow: 2px 2px 0 var(--c-dark2);
}

.main-nav { flex: 1; overflow: hidden; }

.main-nav > ol {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.main-nav > ol::-webkit-scrollbar { display: none; }

.main-nav > ol > li { flex-shrink: 0; }

.nav-link {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--c-text);
  white-space: nowrap;
  border-radius: 6px;
  transition: background var(--transition-std), color var(--transition-std);
  text-decoration: none;
}
.nav-link:hover {
  background: var(--c-lime);
  color: var(--c-dark);
  text-decoration: none;
}

.header-search { flex-shrink: 0; }

.search-form {
  display: flex;
  align-items: center;
  background: var(--c-dark3);
  border: 1.5px solid var(--c-border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color var(--transition-std);
}
.search-form:focus-within { border-color: var(--c-lime); }

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--c-text);
  font-family: var(--font-main);
  font-size: 0.88rem;
  padding: 8px 12px;
  width: 140px;
}
.search-input::placeholder { color: var(--c-muted); }

.search-btn {
  background: var(--c-lime);
  border: none;
  cursor: pointer;
  color: var(--c-dark);
  font-size: 1.1rem;
  padding: 8px 12px;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: background var(--transition-std);
}
.search-btn:hover { background: var(--c-green); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 2px solid var(--c-lime);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bar {
  width: 20px;
  height: 2px;
  background: var(--c-lime);
  display: block;
  transition: transform var(--transition-std);
}

.mobile-nav {
  background: var(--c-dark);
  border-top: 1px solid var(--c-border);
  padding: 12px 20px 20px;
}
.mobile-nav ol { display: flex; flex-direction: column; gap: 4px; }
.mobile-nav .nav-link {
  width: 100%;
  font-size: 1rem;
  border-radius: 8px;
  padding: 0 16px;
}

/* ============================
   锚点粘性条
   ============================ */
.anchor-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: 190;
  background: var(--c-dark3);
  border-bottom: 2px solid var(--c-border);
  height: var(--anchor-h);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.anchor-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.anchor-bar-label {
  font-size: 0.72rem;
  color: var(--c-lime);
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
}

.anchor-list {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.anchor-list::-webkit-scrollbar { display: none; }
.anchor-list > li { flex-shrink: 0; }

.anchor-link {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  font-size: 0.78rem;
  color: var(--c-muted);
  border-radius: 4px;
  white-space: nowrap;
  transition: background var(--transition-std), color var(--transition-std);
  text-decoration: none;
}
.anchor-link:hover {
  background: rgba(128,255,0,0.12);
  color: var(--c-lime);
  text-decoration: none;
}

/* ============================
   跑马灯
   ============================ */
.marquee-strip {
  background: var(--c-lime);
  color: var(--c-dark);
  overflow: hidden;
  white-space: nowrap;
  padding: 6px 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.marquee-track {
  display: inline-flex;
  gap: 24px;
  animation: marquee-scroll 22s linear infinite;
}
.marquee-track span { flex-shrink: 0; }
.mx-dot { color: var(--c-dark3); }

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* ============================
   Hero
   ============================ */
.hero-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  background: var(--c-dark2);
}

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

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(140%) brightness(0.65);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(31,38,23,0.82) 30%, rgba(31,38,23,0.45) 100%);
}

.hero-slash {
  position: absolute;
  right: 0;
  top: 0;
  width: 45%;
  height: 100%;
  background: rgba(128,255,0,0.07);
  clip-path: polygon(18% 0, 100% 0, 100% 100%, 0% 100%);
  mix-blend-mode: screen;
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: right;
  max-width: 640px;
  padding: 60px 48px 60px 24px;
}

.hero-eyebrow {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 18px;
}

.hero-h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: var(--c-lime);
  margin-bottom: 20px;
  text-shadow: 0 2px 24px rgba(0,0,0,0.6);
  animation: fade-up 0.7s ease both;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--c-text);
  margin-bottom: 32px;
  opacity: 0.9;
  animation: fade-up 0.7s 0.15s ease both;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--c-lime);
  color: var(--c-dark);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 8px;
  border: 2.5px solid transparent;
  transition: background var(--transition-std), transform var(--transition-std), box-shadow var(--transition-std);
  animation: fade-up 0.7s 0.28s ease both;
  min-height: 48px;
  text-decoration: none;
}
.hero-cta:hover {
  background: var(--c-green);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(128,255,0,0.35);
  text-decoration: none;
  color: var(--c-dark);
}

.hero-deco-stickers {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.deco-sticker {
  position: absolute;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: 4px;
  padding: 4px 10px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.4);
}
.ds1 {
  background: var(--c-lime);
  color: var(--c-dark);
  top: 18%;
  left: 12%;
  transform: rotate(-7deg);
  animation: jitter 2.8s infinite;
}
.ds2 {
  background: #ff3aff;
  color: #fff;
  top: 55%;
  left: 7%;
  transform: rotate(4deg);
  animation: jitter 3.3s 0.5s infinite;
}
.ds3 {
  background: #00cfff;
  color: #111;
  top: 34%;
  left: 22%;
  transform: rotate(-3deg);
  animation: jitter 2.5s 1s infinite;
}

@keyframes jitter {
  0%,100% { transform: rotate(-7deg) translate(0,0); }
  20% { transform: rotate(-9deg) translate(1px,-1px); }
  40% { transform: rotate(-5deg) translate(-1px,1px); }
  60% { transform: rotate(-8deg) translate(1px,0); }
  80% { transform: rotate(-6deg) translate(-1px,-1px); }
}
.ds2 { animation-name: jitter2; }
@keyframes jitter2 {
  0%,100% { transform: rotate(4deg) translate(0,0); }
  25% { transform: rotate(6deg) translate(-1px,1px); }
  50% { transform: rotate(3deg) translate(1px,-1px); }
  75% { transform: rotate(5deg) translate(0,1px); }
}
.ds3 { animation-name: jitter3; }
@keyframes jitter3 {
  0%,100% { transform: rotate(-3deg) translate(0,0); }
  33% { transform: rotate(-5deg) translate(1px,1px); }
  66% { transform: rotate(-1deg) translate(-1px,-1px); }
}

@media (prefers-reduced-motion: reduce) {
  .deco-sticker, .hero-h1, .hero-desc, .hero-cta { animation: none; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================
   贴纸组件
   ============================ */
.sticker {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 4px;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.4);
}
.sticker-hot { background: #ff3a3a; color: #fff; transform: rotate(-5deg); }
.sticker-free { background: var(--c-lime); color: var(--c-dark); transform: rotate(3deg); }
.sticker-green { background: var(--c-green); color: var(--c-dark); }

/* ============================
   主内容区
   ============================ */
.site-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.content-section {
  display: grid;
  grid-template-columns: 1fr 260px;
  grid-template-rows: auto 1fr;
  gap: 32px 36px;
  align-items: start;
}

/* figure 装饰块 */
.content-figure {
  grid-column: 1;
  grid-row: 1;
  background: var(--c-card-bg);
  border-radius: var(--radius-card);
  border: 2px solid var(--c-border);
  padding: 20px 24px;
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.content-figure::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 6px; height: 100%;
  background: var(--c-lime);
}
.figure-deco { display: flex; gap: 10px; flex-wrap: wrap; }
.fig-tag {
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(128,255,0,0.12);
  color: var(--c-lime);
  border: 1.5px solid var(--c-lime);
  border-radius: 4px;
  padding: 3px 10px;
  letter-spacing: 0.06em;
}
.fig-tag-alt {
  background: rgba(0,255,0,0.08);
  color: var(--c-green);
  border-color: var(--c-green);
}

/* aside 侧边栏 */
.content-aside {
  grid-column: 2;
  grid-row: 1 / 3;
  background: var(--c-card-bg);
  border-radius: var(--radius-card);
  border: 2px solid var(--c-border);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
  position: sticky;
  top: calc(var(--nav-h) + var(--anchor-h) + 16px);
}

.aside-title {
  font-size: 0.92rem;
  color: var(--c-lime);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.aside-title::before {
  content: '';
  display: inline-block;
  width: 4px; height: 18px;
  background: var(--c-lime);
  border-radius: 2px;
}
.aside-title-inner { font-weight: 700; letter-spacing: 0.04em; }

.aside-list { display: flex; flex-direction: column; gap: 4px; }

.aside-link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  font-size: 0.88rem;
  color: var(--c-text);
  border-radius: 6px;
  border: 1.5px solid transparent;
  transition: background var(--transition-std), border-color var(--transition-std), color var(--transition-std);
  text-decoration: none;
}
.aside-link:hover {
  background: rgba(128,255,0,0.1);
  border-color: var(--c-lime);
  color: var(--c-lime);
  text-decoration: none;
}

.aside-sticker-box {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

/* 正文内容体 */
.content-body {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}

/* ============================
   page.content 内部的 div 样式
   ============================ */
.content-body div {
  margin-bottom: 56px;
  padding: 36px 40px;
  background: var(--c-card-bg);
  border-radius: var(--radius-card);
  border: 1.5px solid var(--c-border);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.content-body div.in-view {
  opacity: 1;
  transform: translateY(0);
}
.content-body div::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 4px;
  background: linear-gradient(90deg, var(--c-lime), var(--c-green));
  border-radius: 0 var(--radius-card) 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .content-body div {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.content-body h2 {
  font-size: 1.45rem;
  color: var(--c-lime);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.content-body h2 > span { display: inline; }

.content-body h3 {
  font-size: 1.1rem;
  color: var(--c-green);
  margin: 20px 0 10px;
}
.content-body h3 > span { display: inline; }

.content-body p {
  margin-bottom: 14px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-text);
}

.content-body ul, .content-body ol {
  margin: 12px 0 16px 20px;
  list-style: disc;
}
.content-body ol { list-style: decimal; }
.content-body li {
  margin-bottom: 6px;
  font-size: 1rem;
  line-height: 1.7;
}

.content-body a {
  color: var(--c-lime);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.content-body a:hover { color: var(--c-green); }

.content-body strong { color: var(--c-lime); font-weight: 700; }
.content-body em { font-style: italic; color: var(--c-green); }

.content-body blockquote {
  border-left: 4px solid var(--c-lime);
  padding: 10px 18px;
  margin: 16px 0;
  background: rgba(128,255,0,0.05);
  border-radius: 0 6px 6px 0;
  color: var(--c-muted);
  font-style: italic;
}

.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.92rem;
}
.content-body th, .content-body td {
  border: 1px solid var(--c-border);
  padding: 8px 14px;
  text-align: left;
}
.content-body th {
  background: rgba(128,255,0,0.1);
  color: var(--c-lime);
  font-weight: 700;
}

/* ============================
   页脚
   ============================ */
.site-footer {
  background: var(--c-dark);
  border-top: 3px solid var(--c-lime);
  padding: 0;
}

.footer-cta-block {
  background: linear-gradient(135deg, var(--c-dark3) 0%, #1a2b11 100%);
  padding: 40px 20px;
  text-align: center;
  border-bottom: 1.5px solid var(--c-border);
  position: relative;
  overflow: hidden;
}
.footer-cta-block::before {
  content: '';
  position: absolute;
  top: -40px; left: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(128,255,0,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.footer-cta-text {
  font-size: 1.2rem;
  color: var(--c-text);
  margin-bottom: 20px;
  font-weight: 500;
}

.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 32px;
  background: var(--c-lime);
  color: var(--c-dark);
  font-size: 1rem;
  font-weight: 700;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: background var(--transition-std), transform var(--transition-std), box-shadow var(--transition-std);
  text-decoration: none;
}
.footer-cta-btn:hover {
  background: var(--c-green);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(128,255,0,0.3);
  text-decoration: none;
  color: var(--c-dark);
}

.footer-cols {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 20px 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.footer-dl dt, .footer-dl dd { margin: 0; padding: 0; }

.footer-dt {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--c-lime);
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-dt::before {
  content: '';
  display: inline-block;
  width: 3px; height: 14px;
  background: var(--c-lime);
  border-radius: 2px;
}
.footer-dt > span { display: inline; }

.footer-dl dd {
  font-size: 0.88rem;
  color: var(--c-muted);
  margin-bottom: 8px;
  line-height: 1.6;
}

.footer-link {
  color: var(--c-muted);
  text-decoration: none;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color var(--transition-std);
  padding: 0;
}
.footer-link:hover { color: var(--c-lime); text-decoration: none; }

.footer-bottom {
  border-top: 1.5px solid var(--c-border);
  padding: 16px 20px;
  text-align: center;
}
.copyright {
  font-size: 0.8rem;
  color: var(--c-muted);
  letter-spacing: 0.04em;
}

/* ============================
   响应式
   ============================ */
@media (max-width: 900px) {
  .content-section {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .content-figure { grid-column: 1; grid-row: 1; }
  .content-aside {
    grid-column: 1;
    grid-row: 2;
    position: static;
  }
  .content-body { grid-column: 1; grid-row: 3; }

  .footer-cols { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-cols .footer-dl:last-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  :root { --nav-h: 58px; }

  .main-nav { display: none; }
  .header-search { display: none; }
  .nav-toggle { display: flex; }

  .hero-content {
    text-align: left;
    padding: 48px 20px 40px;
  }
  .hero-eyebrow { justify-content: flex-start; }

  .content-body div { padding: 24px 20px; }

  .footer-cols { grid-template-columns: 1fr; }
  .footer-cols .footer-dl:last-child { grid-column: 1; }

  .search-input { width: 100px; }
}

@media (max-width: 400px) {
  .brand-text { font-size: 0.95rem; }
  .hero-h1 { font-size: 1.7rem; }
}

/* ============================
   app.js 用到的辅助状态
   ============================ */
.mobile-nav[hidden] { display: none; }
.mobile-nav:not([hidden]) { display: block; }
