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

/* ===== 基础变量 ===== */
:root {
  --c-blue: #c8e0f4;
  --c-pink: #f5e0e8;
  --c-dark: #171f26;
  --c-blue-light: #ddeefb;
  --c-blue-dark: #a8c6e0;
  --c-pink-light: #faedf2;
  --c-pink-dark: #e0c4d0;
  --c-text: #1e2a35;
  --c-text-muted: #5a6a7a;
  --c-text-light: #8a9aaa;
  --c-white: #ffffff;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-raise: -5px -5px 15px rgba(255,255,255,0.85), 5px 5px 15px rgba(164,190,210,0.45);
  --shadow-press: inset 3px 3px 8px rgba(164,190,210,0.5), inset -3px -3px 8px rgba(255,255,255,0.75);
  --shadow-pink-raise: -5px -5px 15px rgba(255,255,255,0.85), 5px 5px 15px rgba(210,180,195,0.4);
  --shadow-card: -4px -4px 12px rgba(255,255,255,0.9), 4px 4px 12px rgba(150,185,215,0.4);
  --nav-width: 220px;
  --font: 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --transition: 150ms ease;
  --scroll-offset: 80px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
body.neu-body {
  font-family: var(--font);
  background: var(--c-blue);
  color: var(--c-text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input { font-family: inherit; }

/* ===== Scroll margin for anchor sections ===== */
section[id] { scroll-margin-top: var(--scroll-offset); }

/* ===== Page Shell ===== */
.page-shell {
  display: flex;
  min-height: 100vh;
}

/* ===== Side Header ===== */
.side-header {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  background: linear-gradient(160deg, var(--c-blue-light) 0%, var(--c-blue) 100%);
  box-shadow: 4px 0 24px rgba(150,185,215,0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 1rem;
  z-index: 200;
  border-right: 1px solid rgba(255,255,255,0.5);
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.brand-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, var(--c-blue-light), var(--c-blue));
  box-shadow: var(--shadow-raise);
  transition: box-shadow var(--transition), transform var(--transition);
  width: 100%;
  text-align: center;
}
.brand-link:hover {
  box-shadow: var(--shadow-press);
  transform: scale(0.98);
}
.brand-logo-img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-dark);
  letter-spacing: 0.03em;
  line-height: 1.3;
}

/* 竖排导航链接（桌面侧边栏内，隐藏显示由 JS 遮罩接管） */
.side-nav {
  display: none;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--c-blue-light), var(--c-blue));
  box-shadow: var(--shadow-raise);
  transition: box-shadow var(--transition), transform var(--transition);
  flex-shrink: 0;
  padding: 0;
}
.menu-toggle:hover {
  box-shadow: var(--shadow-press);
  transform: scale(0.96);
}
.hb-bar {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-dark);
  transition: transform var(--transition), opacity var(--transition);
}

/* ===== Fullscreen Nav Overlay ===== */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(200,224,244,0.97) 0%, rgba(245,224,232,0.97) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}
.nav-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.nav-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  min-height: 48px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--c-blue-light), var(--c-blue));
  box-shadow: var(--shadow-raise);
  font-size: 1.2rem;
  color: var(--c-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow var(--transition), transform var(--transition);
  padding: 0;
}
.nav-close:hover {
  box-shadow: var(--shadow-press);
  transform: scale(0.95);
}

.overlay-nav p {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.overlay-nav p a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2.5rem;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, var(--c-blue-light), var(--c-blue));
  box-shadow: var(--shadow-raise);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--c-dark);
  min-width: 240px;
  min-height: 48px;
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition), background var(--transition);
}
.overlay-nav p a:hover {
  background: linear-gradient(145deg, var(--c-pink-light), var(--c-pink));
  box-shadow: var(--shadow-pink-raise);
  transform: translateY(-2px);
}

/* ===== Content Shell ===== */
.content-shell {
  margin-left: var(--nav-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Main ===== */
.main-content {
  flex: 1;
}

.home-article {
  width: 100%;
}

/* ===== Hero Section ===== */
.hero-section {
  background: linear-gradient(135deg, var(--c-blue) 0%, var(--c-pink-light) 100%);
  min-height: 45vh;
  display: flex;
  align-items: center;
  padding: 3rem 2.5rem;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.hero-text {
  flex: 1;
  text-align: center;
}

.hero-h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--c-dark);
  line-height: 1.35;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.hero-desc {
  font-size: 1rem;
  color: var(--c-text-muted);
  line-height: 1.7;
  max-width: 420px;
  margin: 0 auto;
}

.hero-media {
  flex-shrink: 0;
  width: 240px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-raise);
}
.hero-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  object-fit: cover;
}

/* ===== Body Section ===== */
.body-section {
  padding: 2.5rem;
  background: var(--c-blue);
}

.body-layout {
  display: flex;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  align-items: flex-start;
}

/* ===== Aside ===== */
.side-aside {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 1.5rem;
}

.aside-inner {
  background: linear-gradient(145deg, var(--c-blue-light), var(--c-blue));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 1.25rem 1rem;
}

.aside-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-text-muted);
  margin-bottom: 0.85rem;
  letter-spacing: 0.06em;
}
.aside-title span { display: inline; }

.aside-nav-list { display: flex; flex-direction: column; gap: 0.4rem; }
.aside-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--c-text);
  background: linear-gradient(145deg, var(--c-blue-light), var(--c-blue));
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), transform var(--transition), background var(--transition);
  min-height: 40px;
  line-height: 1.4;
}
.aside-link:hover {
  background: linear-gradient(145deg, var(--c-pink-light), var(--c-pink));
  box-shadow: var(--shadow-pink-raise);
  transform: translateX(3px);
}

/* ===== Body Content (page.content injection) ===== */
.body-content {
  flex: 1;
  min-width: 0;
}

/* Content styles for injected HTML */
.body-content h2 {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 700;
  color: var(--c-dark);
  margin: 2rem 0 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--c-blue-dark);
}
.body-content h2 span { display: inline; }
.body-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--c-text);
  margin: 1.5rem 0 0.65rem;
}
.body-content h3 span { display: inline; }

.body-content section {
  background: linear-gradient(145deg, var(--c-blue-light), var(--c-blue));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 1.75rem 1.5rem;
  margin-bottom: 2rem;
  transition: box-shadow 200ms ease;
}
.body-content section:hover {
  box-shadow: -6px -6px 18px rgba(255,255,255,0.9), 6px 6px 18px rgba(150,185,215,0.5);
}

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

.body-content a {
  color: #2a6fa8;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}
.body-content a:hover { color: var(--c-dark); }

.body-content ul, .body-content ol {
  padding-left: 1.2rem;
  margin-bottom: 0.9rem;
}
.body-content ul { list-style: disc; }
.body-content ol { list-style: decimal; }
.body-content li {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 0.35rem;
  color: var(--c-text);
}

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

.body-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.body-content th, .body-content td {
  padding: 0.7rem 1rem;
  text-align: left;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(150,185,215,0.3);
}
.body-content th {
  background: linear-gradient(90deg, var(--c-blue-dark), var(--c-blue));
  font-weight: 600;
  color: var(--c-dark);
}
.body-content tr:last-child td { border-bottom: none; }
.body-content tr:nth-child(even) td { background: rgba(200,224,244,0.3); }

/* ===== Footer ===== */
.site-footer {
  background: linear-gradient(160deg, var(--c-dark) 0%, #1e2d3d 100%);
  color: var(--c-blue-light);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: 0;
  padding: 3rem 2.5rem 0;
}

.footer-brand-section,
.footer-nav-section,
.footer-contact-section,
.footer-legal-section {
  padding: 1.5rem 1.25rem;
}

.footer-brand-section {
  border-right: 1px solid rgba(200,224,244,0.15);
}

.footer-logo-name {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-blue);
  margin-bottom: 0.6rem;
  letter-spacing: 0.04em;
}

.footer-tagline {
  font-size: 0.88rem;
  color: var(--c-blue-dark);
  line-height: 1.6;
}

.footer-nav-section {
  border-right: 1px solid rgba(200,224,244,0.15);
}

.footer-col-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-pink);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}
.footer-col-title span { display: inline; }

.footer-link-list { display: flex; flex-direction: column; gap: 0.45rem; }
.footer-link-list a {
  font-size: 0.88rem;
  color: var(--c-blue-light);
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0.25rem 0;
  transition: color var(--transition);
  opacity: 0.85;
}
.footer-link-list a:hover { color: var(--c-pink); opacity: 1; }

.footer-contact-section {
  border-right: 1px solid rgba(200,224,244,0.15);
}

.footer-contact-info {
  font-size: 0.88rem;
  color: var(--c-blue-light);
  margin-bottom: 1rem;
  opacity: 0.85;
}
.footer-contact-info a { color: var(--c-blue); text-decoration: underline; }
.footer-contact-info a:hover { color: var(--c-pink); }

.subscribe-form { display: flex; flex-direction: column; gap: 0.5rem; }
.sub-label { font-size: 0.8rem; color: var(--c-blue-dark); }
.sub-row { display: flex; gap: 0.5rem; }
.sub-input {
  flex: 1;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(200,224,244,0.25);
  background: rgba(255,255,255,0.07);
  color: var(--c-blue-light);
  font-size: 0.88rem;
  outline: none;
  min-height: 40px;
  transition: border-color var(--transition);
}
.sub-input::placeholder { color: rgba(200,224,244,0.4); }
.sub-input:focus { border-color: var(--c-blue); }

.sub-btn {
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--c-pink), var(--c-pink-dark));
  color: var(--c-dark);
  font-size: 0.88rem;
  font-weight: 600;
  min-height: 40px;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.25);
  transition: box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}
.sub-btn:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 12px rgba(0,0,0,0.35);
}
.sub-btn:active { transform: scale(0.97); }

.footer-legal-section {}
.footer-legal-text {
  font-size: 0.82rem;
  color: var(--c-blue-dark);
  line-height: 1.65;
  opacity: 0.8;
  margin-bottom: 0.75rem;
}
.footer-policy-link {
  font-size: 0.82rem;
  color: var(--c-pink);
  text-decoration: underline;
}
.footer-policy-link:hover { color: var(--c-blue); }

.footer-bottom {
  grid-column: 1 / -1;
  padding: 1.25rem 1.25rem;
  border-top: 1px solid rgba(200,224,244,0.12);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.footer-copyright {
  font-size: 0.82rem;
  color: var(--c-blue-dark);
  opacity: 0.7;
}
.footer-icp {
  font-size: 0.78rem;
  color: rgba(200,224,244,0.4);
}

/* ===== Parallax / Micro-interaction ===== */
@media (prefers-reduced-motion: no-preference) {
  .body-content section {
    will-change: transform;
  }
  .parallax-item {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .site-footer {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-brand-section { border-right: 1px solid rgba(200,224,244,0.15); border-bottom: 1px solid rgba(200,224,244,0.1); }
  .footer-nav-section { border-right: none; border-bottom: 1px solid rgba(200,224,244,0.1); }
  .footer-contact-section { border-right: 1px solid rgba(200,224,244,0.15); }
}

@media (max-width: 768px) {
  :root {
    --nav-width: 0px;
    --scroll-offset: 60px;
  }

  .side-header {
    width: 100%;
    height: 56px;
    flex-direction: row;
    padding: 0 1rem;
    border-right: none;
    border-bottom: 1px solid rgba(200,224,244,0.4);
    box-shadow: 0 4px 16px rgba(150,185,215,0.3);
  }

  .brand-block { flex-direction: row; gap: 0.5rem; width: auto; flex: 1; }
  .brand-link {
    flex-direction: row;
    padding: 0.5rem 0.75rem;
    box-shadow: none;
    background: none;
    gap: 0.5rem;
    min-height: 44px;
  }
  .brand-link:hover { box-shadow: none; transform: none; }
  .brand-name { font-size: 1rem; }

  .content-shell {
    margin-left: 0;
    padding-top: 56px;
  }

  .hero-section {
    min-height: 40vh;
    padding: 2rem 1.25rem;
  }
  .hero-inner {
    flex-direction: column-reverse;
    gap: 1.5rem;
  }
  .hero-media { width: 140px; }
  .hero-h1 { font-size: 1.5rem; }

  .body-section { padding: 1.5rem 1rem; }
  .body-layout { flex-direction: column; }
  .side-aside {
    width: 100%;
    position: static;
  }
  .aside-nav-list { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
  .aside-link { font-size: 0.82rem; padding: 0.5rem 0.75rem; min-height: 44px; }

  .site-footer {
    grid-template-columns: 1fr;
    padding: 2rem 1.25rem 0;
  }
  .footer-brand-section,
  .footer-nav-section,
  .footer-contact-section,
  .footer-legal-section {
    border-right: none;
    border-bottom: 1px solid rgba(200,224,244,0.1);
    padding: 1.25rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .hero-h1 { font-size: 1.3rem; }
  .overlay-nav p a { min-width: 200px; font-size: 1rem; padding: 0.75rem 1.5rem; min-height: 48px; }
  .body-content section { padding: 1.25rem 1rem; }
  .body-content h2 { font-size: 1.1rem; }
  .sub-row { flex-direction: column; }
  .sub-btn { width: 100%; }
}

/* ===== Accessibility ===== */
:focus-visible {
  outline: 3px solid var(--c-dark);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

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