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

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

:root {
  --ink: #171f26;
  --blue: #c8e0f4;
  --pink: #f5e0e8;
  --sh: -6px -6px 16px rgba(255, 255, 255, .92), 7px 7px 18px rgba(23, 31, 38, .14);
  --sh-s: -3px -3px 9px rgba(255, 255, 255, .95), 4px 4px 11px rgba(23, 31, 38, .13);
  --in: inset -4px -4px 10px rgba(255, 255, 255, .95), inset 4px 4px 10px rgba(23, 31, 38, .14);
  --rail: 86px;
}

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

body {
  margin: 0;
  padding-left: var(--rail);
  min-height: 100vh;
  font-family: 'Noto Sans Thai', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-weight: 400;
  line-height: 1.75;
  color: var(--ink);
  background: linear-gradient(168deg, #e7eef7 0%, #edf0f5 46%, #f5e8ef 100%);
  background-attachment: fixed;
}

body.locked { overflow: hidden; }

a { color: inherit; }

small {
  display: block;
  font-size: .68rem;
  line-height: 1.5;
  letter-spacing: .3em;
  color: rgba(23, 31, 38, .45);
  margin-bottom: .3rem;
}

h1, h2, h3 { line-height: 1.3; }

.skip {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 120;
  padding: 12px 18px;
  border-radius: 12px;
  background: #f2f5fa;
  box-shadow: var(--sh-s);
  text-decoration: none;
  font-size: .85rem;
}

.skip:focus {
  left: calc(var(--rail) + 12px);
}

/* 左侧竖排导轨 */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 18px 0 22px;
  background: linear-gradient(170deg, #e4ecf7, #f6e9ef);
  box-shadow: 6px 0 20px rgba(23, 31, 38, .1);
}

.brand {
  display: block;
  writing-mode: vertical-rl;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .24em;
  padding: 12px 9px;
  border-radius: 14px;
  background: linear-gradient(145deg, #dfe9f5, #f6eaf0);
  box-shadow: var(--sh-s);
  transition: box-shadow .15s ease, transform .15s ease;
}

.brand:active {
  box-shadow: var(--in);
  transform: scale(.98);
}

.brand-t { display: block; }

.burger {
  width: 56px;
  min-height: 52px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, #dfe9f5, #f6eaf0);
  box-shadow: var(--sh-s);
  font: inherit;
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: box-shadow .15s ease, transform .15s ease;
}

.burger:active {
  box-shadow: var(--in);
  transform: scale(.96);
}

.rail-contact {
  margin-top: auto;
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 12px;
  background: linear-gradient(145deg, #dfe9f5, #f6eaf0);
  box-shadow: var(--sh-s);
  font-size: .84rem;
  text-decoration: none;
  letter-spacing: .1em;
}

.rail-contact:active { box-shadow: var(--in); }

/* 全屏遮罩菜单 */
.veil {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px clamp(20px, 6vw, 64px) 44px;
  background: linear-gradient(160deg, #e2ecf8, #f8e8f0);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.veil.on {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.veil-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.veil-brand {
  font-weight: 700;
  letter-spacing: .3em;
  font-size: .95rem;
}

.veil-close {
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, #dfe9f5, #f6eaf0);
  box-shadow: var(--sh-s);
  font: inherit;
  font-size: .85rem;
  color: var(--ink);
  cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease;
}

.veil-close:active {
  box-shadow: var(--in);
  transform: scale(.97);
}

.veil-nav { margin: auto 0; }

.veil-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  max-width: 540px;
}

.veil-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 8px 18px;
  border-radius: 16px;
  background: linear-gradient(145deg, #e2ebf7, #f8e9f1);
  box-shadow: var(--sh-s);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: box-shadow .15s ease, transform .15s ease;
}

.veil-list a:active {
  box-shadow: var(--in);
  transform: scale(.99);
}

.veil-list .no,
.side-list .no {
  font-size: .7rem;
  color: rgba(23, 31, 38, .42);
  min-width: 1.3em;
}

/* 首屏：文上图下，右对齐，点阵底纹 */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: clamp(26px, 5vw, 56px) clamp(20px, 4vw, 48px) clamp(28px, 5vw, 46px);
  text-align: right;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(23, 31, 38, .17) 1.1px, transparent 1.1px);
  background-size: 19px 19px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), rgba(0, 0, 0, .08));
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), rgba(0, 0, 0, .08));
}

.hero-txt {
  position: relative;
  z-index: 1;
  margin-left: auto;
  max-width: 36ch;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.7rem, 5.2vw, 3.4rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.01em;
}

.hero-desc {
  margin: 0 0 4px;
  margin-left: auto;
  max-width: 30ch;
  font-size: .95rem;
  line-height: 1.7;
  color: rgba(23, 31, 38, .62);
}

.hero-art {
  position: relative;
  z-index: 1;
  margin: 0 0 0 auto;
  width: 100%;
  max-width: 520px;
}

.hero-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 40vh;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: var(--sh);
}

/* 正文区 */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px clamp(18px, 3vw, 32px) 72px;
}

.stage {
  display: grid;
  grid-template-columns: 202px minmax(0, 1fr);
  gap: 38px;
  align-items: start;
}

.side {
  align-self: start;
  position: sticky;
  top: 24px;
  padding: 20px 14px;
  border-radius: 16px;
  background: linear-gradient(155deg, #e3ecf7, #f7e8f0);
  box-shadow: var(--sh-s);
}

.side h2 {
  margin: 0 0 .85rem;
  font-size: .98rem;
  letter-spacing: .1em;
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
}

.side-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: .84rem;
  line-height: 1.4;
  text-decoration: none;
  color: rgba(23, 31, 38, .78);
}

.side-list a:hover,
.side-list a:focus-visible {
  background: rgba(255, 255, 255, .72);
  box-shadow: var(--sh-s);
}

.doc {
  min-width: 0;
  max-width: 74ch;
  font-size: 1rem;
}

.doc div {
  background: rgba(255, 255, 255, .52);
  padding: 26px clamp(16px, 2.4vw, 26px);
  margin: 0 0 22px;
  scroll-margin-top: 84px;
}

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

.doc > *:first-child { margin-top: 0; }

.doc h2 {
  margin: 0 0 .9rem;
  font-size: clamp(1.28rem, 2.6vw, 1.72rem);
  font-weight: 700;
}

.doc h3 {
  margin: 1.6rem 0 .5rem;
  font-size: 1.12rem;
  font-weight: 600;
}

.doc p {
  margin: 0 0 1rem;
  line-height: 1.85;
}

.doc ul,
.doc ol {
  margin: 0 0 1.1rem;
  padding-left: 1.25em;
}

.doc li {
  margin-bottom: .45rem;
  line-height: 1.8;
}

.doc a {
  color: #2b4d66;
  text-underline-offset: 3px;
}

.doc blockquote {
  margin: 1.2rem 0;
  padding: 16px 20px;
  background: rgba(245, 224, 232, .72);
}

.doc img,
.doc iframe,
.doc video {
  display: block;
  max-width: 100%;
  height: auto;
  border: 0;
}

.doc iframe { width: 100%; aspect-ratio: 16 / 9; }

.doc code {
  font-size: .92em;
  padding: 1px 5px;
  background: rgba(200, 224, 244, .6);
}

/* 页脚 */
.foot {
  max-width: 1120px;
  margin: 26px auto 0;
  padding: 0 clamp(18px, 3vw, 32px) 52px;
}

.foot div { padding: 26px 0; }

.foot-brand p {
  margin: 0;
  font-size: clamp(2.4rem, 13vw, 7.5rem);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.02em;
  color: rgba(23, 31, 38, .18);
  word-break: break-all;
}

.foot-links h2 {
  margin: 0 0 .9rem;
  font-size: .98rem;
  letter-spacing: .1em;
}

.foot-links dl {
  display: grid;
  grid-template-columns: 2.2em minmax(0, 1fr);
  gap: 4px 14px;
  margin: 0;
  max-width: 640px;
}

.foot-links dt {
  font-size: .74rem;
  letter-spacing: .1em;
  color: rgba(23, 31, 38, .42);
  line-height: 2.4;
}

.foot-links dd { margin: 0; }

.foot-links dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: .92rem;
  text-decoration: none;
}

.foot-links dd a:hover { text-decoration: underline; text-underline-offset: 3px; }

.foot-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 22px;
  font-size: .85rem;
  color: rgba(23, 31, 38, .6);
  text-align: center;
}

.foot-base p { margin: 0; }

.foot-base a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: linear-gradient(145deg, #dfe9f5, #f6eaf0);
  box-shadow: var(--sh-s);
  color: var(--ink);
  text-decoration: none;
}

.foot-base a:active {
  box-shadow: var(--in);
  transform: scale(.98);
}

@media (max-width: 880px) {
  :root { --rail: 64px; }
  .rail { gap: 12px; padding: 14px 0 18px; }
  .brand { font-size: .86rem; padding: 10px 7px; }
  .burger { width: 48px; min-height: 48px; font-size: .76rem; }
  .rail-contact { min-height: 44px; font-size: .78rem; }
  .hero { min-height: 62vh; }
  .hero-desc { max-width: 26ch; }
  .stage { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .side { position: static; top: auto; }
  .foot-brand p { font-size: clamp(2.1rem, 15vw, 4.6rem); }
}

@media (max-width: 430px) {
  .hero { padding-top: 20px; gap: 12px; }
  .doc div { padding: 22px 14px; }
}

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

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