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

:root{
  --ink:#F3F0E9;
  --paper:#FBFAF6;
  --navy:#1F3A5F;
  --navy-2:#14273F;
  --flame:#FF6B4A;
  --rule:3px solid var(--navy);
  --fm:'Noto Sans Thai','PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;
}

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

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

body{
  margin:0;
  padding-bottom:104px;
  background:var(--ink);
  color:var(--navy);
  font-family:var(--fm);
  font-size:17px;
  font-weight:400;
  line-height:1.8;
}

img{max-width:100%;height:auto;display:block}
p{margin:0 0 1em}
strong{font-weight:700}
a{color:var(--navy)}
:focus-visible{outline:3px solid var(--flame);outline-offset:3px}

/* ---------- 底部固定条 ---------- */
.dock{
  position:fixed;
  left:0;right:0;bottom:0;
  z-index:80;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 14px;
  background:var(--navy);
  border-top:3px solid var(--flame);
}

.brandmark{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:48px;
  min-height:48px;
  background:var(--ink);
  border:3px solid var(--ink);
  color:var(--navy);
  font-weight:700;
  font-size:22px;
  line-height:1;
  text-decoration:none;
  transition:background .16s ease,color .16s ease,border-color .16s ease;
}
.brandmark:hover,.brandmark:focus-visible{background:var(--flame);border-color:var(--flame);color:var(--navy)}
.brandmark .mark{width:30px;height:30px}
.mark-txt{display:block;padding:0 2px}

.sheets{position:relative}
.sheets>summary{
  list-style:none;
  display:inline-flex;
  align-items:center;
  gap:9px;
  min-height:48px;
  padding:0 20px;
  background:var(--flame);
  border:3px solid var(--flame);
  color:var(--navy);
  font-weight:700;
  font-size:17px;
  letter-spacing:.02em;
  cursor:pointer;
  transition:background .16s ease,color .16s ease,border-color .16s ease;
}
.sheets>summary::-webkit-details-marker{display:none}
.sheets>summary::after{content:"";width:9px;height:9px;border-right:3px solid currentColor;border-bottom:3px solid currentColor;transform:translateY(-3px) rotate(-135deg)}
.sheets[open]>summary{background:var(--ink);border-color:var(--ink)}
.bars{font-size:19px;line-height:1;transform:translateY(-1px)}

.sheets menu{
  position:absolute;
  right:0;
  bottom:calc(100% + 14px);
  margin:0;
  padding:6px;
  width:min(78vw,330px);
  max-height:62vh;
  overflow:auto;
  list-style:none;
  background:var(--paper);
  border:3px solid var(--navy);
}
.sheets menu li+li{border-top:2px solid rgba(31,58,95,.18)}
.sheets menu a{
  display:flex;
  align-items:center;
  min-height:48px;
  padding:10px 14px;
  text-decoration:none;
  font-weight:500;
  transition:background .16s ease,color .16s ease;
}
.sheets menu a:hover,.sheets menu a:focus-visible{background:var(--navy);color:var(--ink)}

/* ---------- 首屏 ---------- */
.hero{
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:flex-end;
  min-height:45vh;
  padding:clamp(24px,6vw,72px);
  padding-bottom:clamp(40px,7vw,88px);
  background:var(--navy);
  color:var(--ink);
}
.hero-copy{position:relative;z-index:2;max-width:780px}
.hero h1{
  margin:0 0 18px;
  font-size:clamp(2.4rem,8.5vw,6rem);
  line-height:.98;
  font-weight:700;
  letter-spacing:-.02em;
  word-break:break-word;
}
.hero .lead{
  margin:0;
  max-width:54ch;
  font-size:clamp(1rem,2.2vw,1.12rem);
  line-height:1.7;
  font-weight:300;
  color:var(--ink);
  opacity:.92;
}

.blade{
  position:absolute;
  top:0;right:0;bottom:0;
  width:min(44%,400px);
  margin:0;
  background:var(--flame);
  clip-path:polygon(26% 0,100% 0,100% 100%,0 100%);
  z-index:1;
  will-change:transform;
}

/* ---------- 主体 ---------- */
.stage{
  display:grid;
  grid-template-columns:230px minmax(0,1fr);
  gap:clamp(20px,4vw,48px);
  max-width:1200px;
  margin:0 auto;
  padding:clamp(22px,4vw,48px) clamp(16px,4vw,40px) 48px;
  background:var(--ink);
  border-top:3px solid var(--navy);
}

.rail{
  align-self:start;
  position:sticky;
  top:24px;
}
.rail h2{
  margin:0 0 10px;
  font-size:1.02rem;
  font-weight:700;
  letter-spacing:.1em;
}
.rail hr{
  width:44px;
  height:4px;
  border:0;
  margin:0 0 16px;
  background:var(--flame);
}
.rail menu{
  list-style:none;
  margin:0;
  padding:0;
  border-left:3px solid var(--navy);
}
.rail menu a{
  display:flex;
  align-items:center;
  min-height:44px;
  margin-left:-3px;
  padding:6px 0 6px 13px;
  border-left:3px solid transparent;
  font-size:15.5px;
  line-height:1.4;
  text-decoration:none;
  transition:border-color .16s ease,background .16s ease;
}
.rail menu a:hover,.rail menu a:focus-visible{
  border-left-color:var(--flame);
  background:rgba(255,107,74,.14);
}

.stream{min-width:0;counter-reset:sec}
.stream>article{
  counter-increment:sec;
  padding:clamp(26px,4vw,46px) 0;
  border-top:3px solid rgba(31,58,95,.22);
  scroll-margin-top:24px;
}
.stream>article:first-child{border-top:0;padding-top:0}
.stream>article:nth-child(even){
  background:var(--paper);
  padding-left:clamp(14px,2.4vw,26px);
  padding-right:clamp(14px,2.4vw,26px);
}
.stream>article>h2{
  position:relative;
  margin:0 0 12px;
  padding-left:clamp(50px,8vw,66px);
  font-size:clamp(1.45rem,4.2vw,2.05rem);
  line-height:1.25;
  font-weight:700;
  letter-spacing:-.01em;
}
.stream>article>h2::before{
  content:counter(sec,decimal-leading-zero);
  position:absolute;
  left:0;
  top:.2em;
  padding:3px 8px;
  background:var(--flame);
  color:var(--navy-2);
  font-size:.85rem;
  font-weight:700;
  letter-spacing:.08em;
  line-height:1.4;
}
.stream>article>hr{
  width:76px;
  height:4px;
  border:0;
  margin:0 0 22px;
  background:var(--navy);
}

.stream h3{
  margin:30px 0 8px;
  font-size:1.22rem;
  font-weight:700;
  line-height:1.4;
}
.stream h3+hr{
  width:52px;
  height:3px;
  border:0;
  margin:0 0 16px;
  background:var(--flame);
}
.stream h4{margin:22px 0 6px;font-size:1.05rem}
.stream a{
  text-decoration:underline;
  text-decoration-thickness:2px;
  text-underline-offset:3px;
  transition:background .16s ease,color .16s ease;
}
.stream a:hover{background:var(--flame);text-decoration:none;color:var(--navy-2)}
.stream ul,.stream ol{margin:0 0 1em;padding-left:1.25em}
.stream li{margin-bottom:.45em}
.stream blockquote{
  margin:0 0 1.1em;
  padding:16px 20px;
  border-left:6px solid var(--flame);
  background:var(--paper);
  font-weight:500;
}
.stream table{
  width:100%;
  border-collapse:collapse;
  margin:0 0 1.1em;
  font-size:.96rem;
}
.stream th,.stream td{
  border:2px solid var(--navy);
  padding:10px 12px;
  text-align:left;
  vertical-align:top;
}
.stream th{background:var(--navy);color:var(--ink);font-weight:700}
.stream figure{margin:0 0 1.1em}
.stream figcaption{margin-top:6px;font-size:.92rem;line-height:1.5;opacity:.8}
.stream pre{
  margin:0 0 1.1em;
  padding:16px;
  background:var(--navy-2);
  color:var(--ink);
  overflow:auto;
  font-size:.9rem;
  line-height:1.6;
  border-radius:0;
}
.stream code{font-size:.94em}
.stream hr{height:3px;border:0;background:rgba(31,58,95,.3);margin:24px 0}

/* ---------- 页脚 ---------- */
.colophon{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:18px 26px;
  padding:clamp(28px,5vw,46px) clamp(16px,4vw,40px) 30px;
  background:var(--navy);
  color:var(--ink);
  border-top:6px solid var(--flame);
  font-size:.96rem;
}
.colophon p{margin:0;line-height:1.7}
.colophon .col-brand strong{font-size:1.35rem;letter-spacing:.02em}
.colophon .col-jump{display:flex;flex-wrap:wrap;gap:0 16px}
.colophon .col-jump a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  color:var(--ink);
  text-decoration:none;
  border-bottom:2px solid transparent;
  transition:border-color .16s ease,color .16s ease;
}
.colophon .col-jump a:hover,.colophon .col-jump a:focus-visible{border-bottom-color:var(--flame);color:var(--flame)}
.colophon .col-top a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:0 14px;
  background:var(--flame);
  color:var(--navy-2);
  font-weight:700;
  text-decoration:none;
  transition:background .16s ease;
}
.colophon .col-top a:hover{background:var(--ink)}
.colophon small{
  grid-column:1/-1;
  padding-top:14px;
  border-top:2px solid rgba(243,240,233,.28);
  font-size:.85rem;
  line-height:1.6;
  opacity:.88;
}

/* ---------- 动效 ---------- */
.reveal{
  opacity:0;
  transform:translateY(20px);
  transition:opacity .5s ease,transform .5s ease;
}
.reveal.in{opacity:1;transform:none}

/* ---------- 断点 ---------- */
@media (max-width:900px){
  .stage{grid-template-columns:minmax(0,1fr);gap:24px}
  .rail{position:static}
  .rail h2{font-size:.95rem}
  .rail menu{
    display:flex;
    gap:8px;
    overflow-x:auto;
    padding-bottom:8px;
    border-left:0;
  }
  .rail menu li{flex:0 0 auto}
  .rail menu a{
    min-height:44px;
    margin:0;
    padding:9px 13px;
    border:2px solid var(--navy);
    font-size:15px;
    white-space:nowrap;
  }
  .rail menu a:hover,.rail menu a:focus-visible{background:var(--flame);border-color:var(--flame)}
}

@media (max-width:760px){
  .colophon{grid-template-columns:1fr 1fr}
  .colophon .col-brand{grid-column:1/-1}
}

@media (max-width:640px){
  body{font-size:16.5px}
  .hero{
    min-height:52vh;
    padding-bottom:110px;
  }
  .blade{
    top:auto;
    left:0;
    right:0;
    bottom:0;
    width:100%;
    height:86px;
    clip-path:polygon(0 58%,100% 0,100% 100%,0 100%);
  }
  .stream>article>h2{padding-left:0}
  .stream>article>h2::before{
    position:static;
    display:inline-block;
    margin-bottom:10px;
    margin-right:0;
  }
  .stream>article>h2{display:block}
  .stream th,.stream td{padding:8px 9px;font-size:.9rem}
  .colophon{grid-template-columns:1fr}
  .colophon .col-brand{grid-column:auto}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .reveal{opacity:1;transform:none;transition:none}
  .blade{transform:none!important}
}

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