:root {
  --paper: #ffffff;
  --mist: #f5f5f5;
  --ink: #1f1f1f;
  --ink-2: #4b4b4b;
  --ink-3: #7a7a7a;
  --line: #e3e3e3;
  --line-2: #ededed;
  --radius: 18px;
  --el-1: 0 1px 2px rgba(31, 31, 31, 0.06), 0 2px 6px rgba(31, 31, 31, 0.05);
  --el-2: 0 2px 6px rgba(31, 31, 31, 0.07), 0 12px 24px -10px rgba(31, 31, 31, 0.14);
  --el-3: 0 6px 16px rgba(31, 31, 31, 0.09), 0 24px 46px -16px rgba(31, 31, 31, 0.18);
  --el-4: 0 10px 28px rgba(31, 31, 31, 0.12), 0 44px 74px -24px rgba(31, 31, 31, 0.24);
  --rail: 278px;
}

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

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

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

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

p {
  margin: 0;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

menu,
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- 左侧固定栏 ---------- */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--rail);
  padding: 30px 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-right: 1px solid var(--line);
  box-shadow: var(--el-2);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  min-height: 46px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: var(--el-1);
}

.brand-dot {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--ink);
  box-shadow: var(--el-2);
  flex: 0 0 auto;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rail-title {
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.rail-nav .subtitle {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
  margin-bottom: 10px;
}

.menu-details {
  position: relative;
}

.menu-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: var(--mist);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.menu-details > summary::-webkit-details-marker {
  display: none;
}

.menu-details > summary::after {
  content: "＋";
  font-size: 15px;
  color: var(--ink-3);
  line-height: 1;
}

.menu-details[open] > summary::after {
  content: "－";
}

.menu-details > summary:hover {
  background: var(--paper);
  box-shadow: var(--el-2);
}

.menu-details > menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 4px;
}

.menu-details[open] > menu {
  display: flex;
}

.rail-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink-2);
  background: transparent;
  box-shadow: 0 0 0 rgba(31, 31, 31, 0);
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease, color 0.22s ease;
}

.rail-menu a::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 3px;
  background: var(--line);
  flex: 0 0 auto;
  transition: background 0.22s ease, transform 0.22s ease;
}

.rail-menu a:hover,
.rail-menu a:focus-visible {
  background: var(--paper);
  color: var(--ink);
  transform: translateX(4px);
  box-shadow: var(--el-2);
}

.rail-menu a:hover::before,
.rail-menu a:focus-visible::before {
  background: var(--ink);
  transform: rotate(45deg);
}

.rail-contact {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  font-weight: 500;
  box-shadow: var(--el-3);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.rail-contact:hover {
  transform: translateY(-2px);
  box-shadow: var(--el-4);
}

/* ---------- 主区 ---------- */
.stage {
  position: relative;
  margin-left: var(--rail);
  min-height: 100vh;
  z-index: 1;
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: 100px 26px 130px;
  overflow: hidden;
  background: var(--paper);
  border-bottom: 1px solid var(--line-2);
}

.hero-layer {
  position: absolute;
  z-index: 0;
  border-radius: 30px;
  background: var(--mist);
  border: 1px solid var(--line-2);
}

.hero-layer.l1 {
  width: 250px;
  height: 250px;
  left: 6%;
  top: 10%;
  box-shadow: var(--el-2);
  animation: drift-a 21s ease-in-out infinite alternate;
}

.hero-layer.l2 {
  width: 168px;
  height: 168px;
  right: 8%;
  bottom: 16%;
  border-radius: 50%;
  box-shadow: var(--el-3);
  animation: drift-b 16s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from {
    transform: translateY(-14px) rotate(-9deg);
  }
  to {
    transform: translateY(16px) rotate(5deg);
  }
}

@keyframes drift-b {
  from {
    transform: translateY(12px) rotate(14deg);
  }
  to {
    transform: translateY(-18px) rotate(-4deg);
  }
}

.hero-body {
  position: relative;
  z-index: 3;
  max-width: 940px;
  text-align: center;
  will-change: transform;
}

.hero-title {
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-cue {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  box-shadow: var(--el-3);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.hero-cue:hover {
  transform: translateX(-50%) translateY(-3px);
  box-shadow: var(--el-4);
}

.hero-slant {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 82px;
  z-index: 1;
  background: var(--mist);
  clip-path: polygon(0 68%, 100% 0, 100% 100%, 0 100%);
}

/* ---------- 正文 ---------- */
.wrap {
  position: relative;
  z-index: 2;
  max-width: 880px;
  margin: 0 auto;
  padding: 46px 24px 90px;
}

.sheet {
  position: relative;
}

.prose > article {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 30px 26px 38px;
  margin-bottom: 26px;
  box-shadow: var(--el-2);
  scroll-margin-top: 96px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.prose > article::after {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 16px;
  height: 3px;
  border-radius: 3px;
  background: var(--ink);
  opacity: 0.88;
  transition: height 0.3s ease;
}

.prose > article:nth-child(even) {
  margin-left: 20px;
}

.prose > article:nth-child(3n + 1) {
  z-index: 3;
}

.prose > article:nth-child(3n + 2) {
  z-index: 2;
}

.prose > article:hover {
  box-shadow: var(--el-4);
  transform: translateY(-3px);
}

.prose > article:hover::after {
  height: 5px;
}

.prose h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  line-height: 1.32;
  letter-spacing: -0.02em;
  margin: 2px 0 10px;
}

.prose h2 + p,
.prose p.subtitle {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-3);
  margin: 0 0 18px;
}

.prose h3 {
  font-size: 1.18rem;
  line-height: 1.4;
  margin: 26px 0 10px;
}

.prose p {
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink-2);
  margin: 0 0 16px;
}

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

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: #c7c7c7;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-color: var(--ink);
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink-2);
  margin-bottom: 8px;
}

.prose li::marker {
  color: var(--ink-3);
}

.prose strong {
  color: var(--ink);
  font-weight: 700;
}

.prose blockquote {
  margin: 0 0 18px;
  padding: 14px 18px;
  border-left: 3px solid var(--ink);
  border-radius: 0 12px 12px 0;
  background: var(--mist);
  box-shadow: var(--el-1);
}

.prose blockquote p {
  margin: 0;
  color: var(--ink);
}

.prose img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 0 0 18px;
  box-shadow: var(--el-2);
}

.prose figure {
  margin: 0 0 18px;
}

.prose figcaption {
  font-size: 15px;
  color: var(--ink-3);
  margin-top: 8px;
}

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

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

.prose th {
  background: var(--mist);
  color: var(--ink);
}

/* ---------- 页脚 ---------- */
.foot {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 34px;
  padding: 42px 26px 30px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 26px 26px 0 0;
  box-shadow: var(--el-4);
}

.foot-brand {
  flex: 0 0 auto;
}

.foot-logo {
  font-size: clamp(1.55rem, 3.6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.foot-nav {
  flex: 1 1 280px;
}

.foot-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 16px;
  color: #e6e6e6;
  transition: background 0.2s ease, color 0.2s ease;
}

.foot-nav a:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.foot-copy {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  color: #c2c2c2;
}

.foot-copy p {
  margin: 0;
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ededed;
  font-size: 16px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.to-top:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.5);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- 入场 ---------- */
.anim .prose > article {
  opacity: 0;
}

.anim .prose > article.in {
  opacity: 1;
  transition: opacity 0.55s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .rail {
    position: sticky;
    inset: auto;
    top: 0;
    width: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--el-2);
    overflow: visible;
  }

  .brand {
    padding: 0;
    min-height: 44px;
    gap: 8px;
  }

  .brand-name {
    font-size: 15px;
    max-width: 42vw;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .rail-nav {
    margin-left: auto;
    flex-direction: row;
    align-items: center;
  }

  .rail-title,
  .rail-nav .subtitle {
    display: none;
  }

  .menu-details > summary {
    margin-bottom: 0;
    min-width: 84px;
    justify-content: center;
    gap: 6px;
    background: var(--mist);
    border: 1px solid var(--line);
    border-radius: 999px;
  }

  .menu-details > menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(262px, 78vw);
    max-height: 62vh;
    overflow-y: auto;
    padding: 10px;
    background: var(--paper);
    border-radius: 16px;
    border: 1px solid var(--line);
    box-shadow: var(--el-4);
    z-index: 60;
  }

  .rail-menu a {
    min-height: 44px;
    font-size: 16px;
  }

  .rail-menu a:hover {
    transform: none;
  }

  .rail-contact {
    margin-top: 0;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 16px;
    font-size: 15px;
    border-radius: 999px;
  }

  .stage {
    margin-left: 0;
  }

  .hero {
    min-height: 62vh;
    padding: 74px 18px 112px;
  }

  .hero-layer.l1 {
    width: 170px;
    height: 170px;
    left: -6%;
    top: 8%;
  }

  .hero-layer.l2 {
    width: 118px;
    height: 118px;
    right: -4%;
    bottom: 22%;
  }

  .hero-title {
    font-size: clamp(1.85rem, 8.4vw, 2.7rem);
    letter-spacing: -0.028em;
  }

  .hero-slant {
    height: 66px;
  }

  .wrap {
    padding: 30px 14px 64px;
  }

  .prose > article {
    padding: 24px 18px 34px;
    margin-bottom: 18px;
    scroll-margin-top: 86px;
  }

  .prose > article:nth-child(even) {
    margin-left: 0;
  }

  .prose > article::after {
    left: 18px;
    right: 18px;
    bottom: 14px;
  }

  .prose > article:hover {
    transform: none;
  }

  .prose p,
  .prose li {
    font-size: 16.5px;
  }

  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 30px 18px 24px;
    border-radius: 20px 20px 0 0;
  }

  .foot-nav {
    flex: 1 1 auto;
    width: 100%;
  }

  .foot-copy {
    margin-left: 0;
    align-items: flex-start;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .brand-name {
    max-width: 34vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-layer,
  .rail-contact,
  .hero-cue,
  .prose > article,
  .prose > article::after,
  .rail-menu a,
  .menu-details > summary {
    animation: none !important;
    transition: none !important;
  }

  .anim .prose > article {
    opacity: 1;
  }
}

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