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

:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --ink: #000;
  --paper: #fffdf5;
  --line: 3px solid #000;
  --sh: 5px 5px 0 #000;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans Thai", -apple-system, "PingFang SC", "Microsoft YaHei", "Heiti SC", sans-serif;
  font-size: 17px;
  line-height: 1.72;
  font-weight: 400;
  overflow-x: hidden;
  padding-top: 76px;
}

a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: var(--line); margin: 0 0 22px; }

/* ---------- 左侧导轨 ---------- */
.rail {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70;
  background: #fff;
  border-bottom: var(--line);
  padding: 10px 14px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  max-height: 100svh;
  overflow-y: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border: var(--line);
  border-radius: 10px;
  background: var(--blue);
  box-shadow: 4px 4px 0 #000;
  padding: 7px 10px;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  min-height: 44px;
}
.brand .logo { width: 28px; height: 28px; border: 2px solid #000; background: #fff; }
.brand:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }

.burger {
  margin-left: auto;
  border: var(--line);
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 10px 18px;
  min-height: 44px;
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
}
.burger:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }

.rail-nav { display: none; width: 100%; margin-top: 12px; }
body.menu-open .rail-nav { display: block; }

.nav-main {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-main a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 11px 14px;
  border: var(--line);
  border-radius: 10px;
  background: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s, transform .12s, box-shadow .12s;
}
.nav-main a:hover,
.nav-main a.on { background: var(--blue); box-shadow: 4px 4px 0 #000; transform: translate(-2px, -2px); }

.grps {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 3px dashed #000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.grp { border: var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.grp summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  background: var(--red);
  color: #fff;
  list-style: none;
}
.grp summary::-webkit-details-marker { display: none; }
.grp[open] summary { border-bottom: var(--line); }
.grp ul { list-style: none; margin: 0; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.grp ul a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 12px;
  border: 2px solid #000;
  border-radius: 8px;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
}
.grp ul a:hover { background: var(--blue); }

.nav-main li.dim, .grp li.dim { display: none; }

.find { margin-top: 16px; }
.find-in {
  width: 100%;
  padding: 12px 14px;
  border: var(--line);
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 16px;
  min-height: 44px;
  color: #000;
}
.find-in:focus { outline: none; background: #e8f6ff; box-shadow: 4px 4px 0 #000; }

/* ---------- 版心 ---------- */
.layout { display: block; padding: 0 0 44px; }
.main { min-width: 0; }
.post { min-width: 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 90px 20px 110px;
  background: var(--blue);
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 94%, 0 100%);
}
.hero--slim { min-height: 56svh; padding: 70px 20px 80px; }
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero--img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(59, 177, 255, .55);
  z-index: 1;
}
.hero-box { position: relative; z-index: 2; text-align: center; max-width: 920px; }

.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 8.4vw, 5.4rem);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #fff;
  -webkit-text-stroke: 2px #000;
  text-shadow: 6px 6px 0 #000;
  overflow-wrap: anywhere;
}
.hero-sub {
  display: inline-block;
  margin: 20px auto 0;
  max-width: 32ch;
  padding: 10px 16px;
  background: #000;
  color: #fff;
  border: var(--line);
  border-radius: 10px;
  font-size: 1rem;
  line-height: 1.55;
  box-shadow: 5px 5px 0 var(--red);
}

/* ---------- 正文 ---------- */
.post { counter-reset: sec; }

.post > div {
  position: relative;
  counter-increment: sec;
  padding: 40px 18px 34px;
  border-top: var(--line);
  background: var(--paper);
  scroll-margin-top: 84px;
}
.post > div::before {
  content: counter(sec, decimal-leading-zero);
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  line-height: 1;
  font-weight: 700;
  color: var(--blue);
  opacity: .32;
  pointer-events: none;
}

.post h2 {
  display: inline-block;
  margin: 0;
  padding: 8px 14px;
  font-size: clamp(1.35rem, 3.6vw, 1.9rem);
  line-height: 1.3;
  background: var(--blue);
  border: var(--line);
  border-radius: 10px;
  box-shadow: 4px 4px 0 #000;
  position: relative;
  z-index: 1;
}
.post h2 + hr { border: 0; border-top: var(--line); margin: 16px 0 26px; }

.post h3 {
  margin: 0 0 .7em;
  font-size: 1.16rem;
  line-height: 1.45;
  padding-left: 12px;
  border-left: 7px solid var(--red);
}
.post h3 + hr { margin: 10px 0 20px; }

.post p { max-width: 68ch; margin: 0 0 1.05em; }
.post ul, .post ol { padding-left: 1.45em; margin: 0 0 1.2em; max-width: 66ch; }
.post ul { list-style: square; }
.post li { margin: .35em 0; }

.post a {
  color: #000;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.post a:hover { background: var(--red); color: #fff; text-decoration: none; }

.post strong { background: var(--blue); padding: 0 .18em; box-shadow: 2px 2px 0 #000; }

.post blockquote {
  margin: 0 0 1.4em;
  padding: 14px 18px;
  border: var(--line);
  border-left-width: 9px;
  border-radius: 0 10px 10px 0;
  background: #fff;
  max-width: 64ch;
}

.post figure { margin: 0 0 1.4em; }
.post figcaption { font-size: .9rem; margin-top: 6px; color: #222; }
.post img { border: var(--line); border-radius: 10px; }

.post table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.4em;
  font-size: .96rem;
}
.post th, .post td { border: 2px solid #000; padding: 8px 10px; text-align: left; }
.post th { background: var(--blue); }

.post > div.rv { opacity: 0; transform: translateY(16px); }
.post > div.in { opacity: 1; transform: none; transition: opacity .42s ease, transform .42s ease; }

/* ---------- 侧栏 ---------- */
.side { padding: 26px 18px 0; display: flex; flex-direction: column; gap: 18px; }

.card {
  border: var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 14px 14px 16px;
}
.card h2 {
  display: inline-block;
  margin: 0;
  padding: 4px 11px;
  font-size: 1rem;
  line-height: 1.4;
  background: var(--red);
  color: #fff;
  border: var(--line);
  border-radius: 8px;
}
.card h2 + hr { margin: 12px 0 14px; }

.side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.side-list a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 11px;
  border: 2px solid #000;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
}
.side-list a:hover { background: var(--blue); }

/* ---------- 页脚 ---------- */
.foot {
  background: #000;
  color: #fff;
  border-top: var(--line);
  padding: 34px 18px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.foot-brand {
  margin: 0;
  font-size: clamp(2.2rem, 13vw, 6rem);
  line-height: .95;
  font-weight: 700;
  letter-spacing: -.03em;
  color: #fff;
  -webkit-text-stroke: 2px var(--blue);
  overflow-wrap: anywhere;
}
.foot-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 18px;
  font-size: .95rem;
}
.foot-links { display: flex; gap: 18px; }
.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #fff;
  text-decoration: none;
  border-bottom: 3px solid var(--blue);
  padding: 4px 0;
}
.foot-links a:hover { background: var(--red); }

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 15px;
  border: var(--line);
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 4px 4px 0 #000;
}
.to-top:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }

/* ---------- 桌面 ---------- */
@media (min-width: 1024px) {
  body { padding-top: 0; padding-left: 268px; }

  .rail {
    right: auto;
    bottom: 0;
    width: 268px;
    border-bottom: 0;
    border-right: var(--line);
    padding: 22px 20px 28px;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 14px;
    overflow-y: auto;
  }
  .brand { font-size: 1.08rem; padding: 10px 12px; }
  .brand .logo { width: 34px; height: 34px; }
  .burger { display: none; }
  .rail-nav { display: block; }

  .layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 34px;
    padding: 26px 32px 64px;
  }
  .side { position: sticky; top: 26px; align-self: start; padding: 0; }
  .post > div { padding: 46px 34px 40px; scroll-margin-top: 26px; }
  .hero { clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%); }
  .foot { padding: 46px 32px 30px; }
  .to-top { right: 28px; bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .post > div.rv { opacity: 1; transform: none; transition: none; }
  .nav-main a { transition: none; }
}
</｜DSML｜ parameter>
</｜DSML｜ invoke>
</｜DSML｜ calls>

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