:root {
  --sand: #ece2cf;
  --sand-2: #d4c4a8;
  --sand-3: #e0d3ba;
  --ink: #172623;
  --ink-2: #3a534b;
  --teal: #5cc6b0;
  --teal-d: #277f6e;
  --clay: #b06748;
  --line: rgba(23, 38, 35, 0.2);
  --line-soft: rgba(23, 38, 35, 0.11);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: "Noto Sans Thai", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.78;
  font-weight: 400;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.42;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}

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

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

a { color: var(--teal-d); }

/* ---------- 头部：品牌行 + 菜单行 ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--sand-2);
  border-bottom: 2px solid var(--ink);
}

.head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px clamp(14px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  text-decoration: none;
  color: var(--ink);
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  background: var(--ink);
  color: var(--sand);
  border-bottom: 3px solid var(--teal);
}

.mark-img { width: 36px; height: 36px; object-fit: cover; }

.mark-txt { font-size: 18px; font-weight: 700; letter-spacing: 0.04em; line-height: 1; }

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.contact {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-bottom-width: 3px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  letter-spacing: 0.06em;
  background: var(--sand);
  transition: background 0.25s ease-out, color 0.25s ease-out;
}

.contact:hover { background: var(--ink); color: var(--sand); }

.head-nav { background: var(--sand-3); }

.head-nav ol {
  display: flex;
  align-items: stretch;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.head-nav ol::-webkit-scrollbar { display: none; }

.head-nav li { flex: 0 0 auto; }

.head-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 clamp(12px, 2vw, 20px);
  font-size: 16px;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  border-right: 1px solid var(--line-soft);
  box-shadow: inset 0 -3px 0 transparent;
  transition: color 0.2s ease-out, box-shadow 0.2s ease-out, background 0.2s ease-out;
}

.head-nav a:hover,
.head-nav a:focus-visible {
  color: var(--ink);
  background: var(--sand);
  box-shadow: inset 0 -3px 0 var(--teal);
}

/* ---------- 首屏 ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  min-height: calc(100svh - 100px);
  border-bottom: 2px solid var(--ink);
  background-image: radial-gradient(rgba(23, 38, 35, 0.17) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -6px -6px;
}

.hero-fig {
  margin: 0;
  position: relative;
  overflow: hidden;
  background: var(--ink);
  border-right: 2px solid var(--ink);
}

.hero-img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  will-change: transform;
}

.hero-art {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  background-image:
    repeating-linear-gradient(45deg, rgba(92, 198, 176, 0.22) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(-45deg, rgba(212, 196, 168, 0.16) 0 2px, transparent 2px 18px);
  background-color: var(--ink);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
  padding: clamp(26px, 6vw, 80px) clamp(20px, 5vw, 64px);
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(30px, 5.2vw, 62px);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: 0.01em;
  max-width: 15ch;
}

.hero-copy h1::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin: 22px auto 0;
  background: var(--teal);
}

.hero-lead {
  margin: 0;
  max-width: 32ch;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-2);
}

/* ---------- 正文 + 侧栏 ---------- */
.body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  border-bottom: 2px solid var(--ink);
}

.prose {
  padding: clamp(26px, 5vw, 64px) clamp(20px, 4.5vw, 60px);
  max-width: 78ch;
  min-width: 0;
}

.prose div {
  padding-bottom: 34px;
  margin-bottom: 34px;
  border-bottom: 1px dashed var(--line);
  scroll-margin-top: 116px;
}

.prose div:last-child { border-bottom: 0; margin-bottom: 0; }

.prose h2 {
  margin: 0 0 12px;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.32;
  font-weight: 700;
  padding-left: 14px;
  border-left: 5px solid var(--teal);
}

.prose h3 {
  margin: 26px 0 10px;
  font-size: 19px;
  line-height: 1.45;
}

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

.prose p.subtitle,
.prose p.subhead,
.prose p.desc,
.prose p.lead {
  color: var(--ink-2);
  font-size: 17px;
}

.prose ul,
.prose ol { margin: 0 0 16px; padding-left: 22px; }

.prose li { margin-bottom: 8px; }

.prose li::marker { color: var(--teal-d); }

.prose figure {
  margin: 22px 0;
  border-bottom: 3px solid var(--teal);
  background: var(--sand-3);
}

.prose figure img { width: 100%; }

.prose figcaption {
  padding: 8px 12px;
  font-size: 15.5px;
  color: var(--ink-2);
  border-top: 1px solid var(--line-soft);
}

.prose blockquote {
  margin: 20px 0;
  padding: 12px 18px;
  background: var(--sand-3);
  border-left: 4px solid var(--clay);
  color: var(--ink-2);
}

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

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  margin: 18px 0;
  background: var(--sand-3);
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}

.prose th { background: var(--sand-2); }

.prose strong { font-weight: 700; }

.prose a { text-decoration: underline; text-underline-offset: 3px; }

.prose img { max-width: 100%; height: auto; }

.prose time { font-size: 15.5px; color: var(--ink-2); }

/* ---------- 侧栏 ---------- */
.side {
  position: sticky;
  top: 104px;
  align-self: start;
  padding: 26px 22px 30px;
  border-left: 2px solid var(--ink);
  background: var(--sand-3);
  border-bottom: 4px solid var(--teal);
}

.side h2 {
  margin: 0 0 6px;
  font-size: 21px;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.side .subtitle {
  margin: 0;
  font-size: 15.5px;
  letter-spacing: 0.1em;
  color: var(--teal-d);
}

.side-nav { margin-top: 18px; }

.side-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.side-nav li { border-bottom: 1px solid var(--line-soft); }

.side-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.2s ease-out, padding-left 0.2s ease-out;
}

.side-nav a:hover {
  color: var(--ink);
  padding-left: 6px;
  box-shadow: inset 0 -2px 0 var(--teal);
}

.side-hint {
  margin: 18px 0 0;
  font-size: 15.5px;
  color: var(--ink-2);
  word-break: break-all;
}

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  font-size: 15.5px;
  text-decoration: none;
  color: var(--sand);
  background: var(--ink);
  border-bottom: 3px solid var(--teal);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 22px;
  padding: 12px clamp(14px, 4vw, 44px);
  background: var(--ink);
  color: var(--sand-2);
  border-top: 4px solid var(--teal);
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  letter-spacing: 0.12em;
}

.foot-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--sand-2);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--teal);
  font-weight: 700;
}

.foot-mark .mark-img { width: 34px; height: 34px; }

.foot-nav ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 11px;
  font-size: 15.5px;
  color: var(--sand-2);
  text-decoration: none;
  opacity: 0.88;
}

.foot-nav a:hover { opacity: 1; color: var(--teal); }

.foot-copy {
  font-size: 15.5px;
  letter-spacing: 0.06em;
  opacity: 0.75;
}

/* ---------- 滚动出现 ---------- */
.js .prose .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.62s ease-out, transform 0.62s ease-out;
}

.js .prose .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .prose .reveal { opacity: 1; transform: none; transition: none; }
  .hero-img { transform: none; }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .site-head { position: static; }

  .hero { grid-template-columns: 1fr; min-height: 0; }

  .hero-copy {
    order: 1;
    padding: 28px 20px 26px;
  }

  .hero-copy h1 { font-size: clamp(27px, 8.4vw, 40px); max-width: 18ch; }

  .hero-fig {
    order: 2;
    border-right: 0;
    border-top: 2px solid var(--ink);
    height: 54vw;
    min-height: 170px;
    max-height: 300px;
  }

  .body-grid { grid-template-columns: 1fr; }

  .prose { padding: 26px 20px 30px; max-width: none; }

  .prose div { scroll-margin-top: 16px; }

  .side {
    position: static;
    border-left: 0;
    border-top: 2px solid var(--ink);
    padding: 24px 20px 28px;
  }

  .foot { justify-content: flex-start; }
}

@media (max-width: 480px) {
  body { font-size: 16.5px; }
  .head-nav a { padding: 0 12px; font-size: 15.5px; }
  .foot-nav a { padding: 0 9px; }
  .brand-name { font-size: 18px; letter-spacing: 0.1em; }
}

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