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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --mute: #585858;
  --line: #d6d6d6;
  --soft: #f3f3f3;
  --r: 28px;
  --gut: clamp(16px, 4vw, 56px);
  --sans: 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', '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;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: inherit; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 16px;
  transition: top .18s ease;
}

.skip:focus { top: 10px; }

/* ---------- 报头 ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-top: 8px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.brandline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px var(--gut) 4px;
}

.rule {
  display: block;
  height: 2px;
  background: var(--ink);
  width: 100%;
  max-width: 120px;
}

.brand {
  margin: 0;
  font-size: clamp(21px, 3.2vw, 30px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.1;
  text-align: center;
}

.brand a { text-decoration: none; }

.cta {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 20px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.cta:hover,
.cta:focus-visible {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}

.menu ol {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 2px var(--gut) 8px;
  list-style: none;
}

.menu li:nth-child(3) { margin-right: auto; }

.menu a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 16px;
  text-decoration: none;
  border-radius: 999px;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease;
}

.menu a::before {
  content: '';
  display: block;
  flex: none;
  width: 7px;
  height: 7px;
  background: currentColor;
}

.menu li:nth-child(2n) a::before { border-radius: 50%; }
.menu li:nth-child(3n) a::before { width: 13px; height: 3px; }
.menu li:nth-child(4n) a::before { transform: rotate(45deg); }
.menu li:nth-child(5n) a::before { width: 8px; height: 8px; border-radius: 50% 50% 50% 0; }

.menu a:hover,
.menu a:focus-visible,
.menu a.on {
  background: var(--ink);
  color: var(--paper);
}

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

/* ---------- 网格骨架 ---------- */

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  column-gap: clamp(28px, 4.4vw, 72px);
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gut);
}

.hero {
  grid-column: 1 / -1;
}

.rail {
  grid-column: 2;
  grid-row: 2;
}

.flow {
  grid-column: 1;
  grid-row: 2;
}

/* ---------- 首屏 ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: stretch;
  min-height: calc(100vh - 160px);
  padding: 30px 0 46px;
  border-bottom: 2px solid var(--ink);
}

.hero-figure {
  position: relative;
  margin: 0;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--soft);
  min-height: 340px;
}

.hero-void {
  width: 100%;
  height: 100%;
  min-height: 340px;
  background: repeating-linear-gradient(135deg, #000 0 2px, #fff 2px 13px);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  will-change: transform;
}

.badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  transform: rotate(-3deg);
}

.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: right;
  padding-bottom: 6px;
}

.hero-text h1 {
  margin: 0 0 22px;
  font-size: clamp(38px, 7vw, 90px);
  line-height: 1.03;
  letter-spacing: -0.05em;
  font-weight: 700;
}

.hero-desc {
  margin: 0 0 0 auto;
  max-width: 34ch;
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.75;
  color: var(--mute);
  border-top: 1px solid var(--ink);
  padding-top: 16px;
}

/* ---------- 侧边 ---------- */

.rail {
  position: sticky;
  top: 156px;
  align-self: start;
  padding-top: clamp(40px, 6vw, 64px);
}

.rail-card {
  border: 2px solid var(--ink);
  border-bottom-width: 9px;
  border-radius: var(--r);
  padding: 22px 20px 18px;
  background: var(--paper);
}

.rail-card h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.rail-card hr {
  border: 0;
  border-top: 2px solid var(--ink);
  width: 44px;
  margin: 10px 0 14px;
}

.rail-list {
  counter-reset: railnav;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.rail-list li { counter-increment: railnav; }

.rail-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
}

.rail-list a::before {
  content: counter(railnav, decimal-leading-zero);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--mute);
  flex: none;
}

.rail-list a:hover,
.rail-list a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
.rail-list a.on { font-weight: 700; }

.rail-top {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 16px;
  text-decoration: none;
}

.rail-top:hover,
.rail-top:focus-visible {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}

/* ---------- 正文 ---------- */

.flow { padding-top: clamp(40px, 6vw, 64px); }

.flow article {
  margin-top: clamp(46px, 7vw, 100px);
  padding-top: clamp(28px, 4.6vw, 56px);
  border-top: 1px solid var(--ink);
  scroll-margin-top: 170px;
}

.flow > article:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.flow h2 {
  margin: 0 0 4px;
  font-size: clamp(25px, 3.8vw, 42px);
  line-height: 1.16;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.flow h2 + hr {
  display: block;
  width: 96px;
  height: 0;
  border: 0;
  border-top: 4px solid var(--ink);
  margin: 12px 0 28px;
}

.flow hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 34px 0;
}

.flow h3 {
  margin: 34px 0 14px;
  font-size: clamp(19px, 2.3vw, 25px);
  line-height: 1.35;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.flow p {
  margin: 0 0 22px;
  font-size: 17px;
  line-height: 1.85;
  max-width: 66ch;
}

.flow > article:first-child > p:first-of-type::first-letter {
  float: left;
  font-size: 4.4em;
  line-height: 0.78;
  padding: 8px 14px 0 0;
  font-weight: 700;
}

.flow blockquote {
  margin: 34px 0;
  padding: 6px 0 6px clamp(16px, 2.4vw, 28px);
  border-left: 5px solid var(--ink);
  font-size: clamp(19px, 2.6vw, 27px);
  line-height: 1.42;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.flow blockquote p {
  margin: 0 0 12px;
  font-size: inherit;
  line-height: inherit;
  max-width: 46ch;
}

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

.flow figure {
  margin: 34px 0;
  border-radius: var(--r);
  overflow: hidden;
}

.flow figure img { width: 100%; display: block; }

.flow figcaption {
  font-size: 16px;
  line-height: 1.6;
  color: var(--mute);
  padding: 10px 2px 0;
}

.flow ul,
.flow ol {
  margin: 0 0 22px;
  padding-left: 24px;
  line-height: 1.8;
}

.flow li { margin: 9px 0; }

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

.flow a:hover,
.flow a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.flow strong { font-weight: 700; }

.flow code,
.flow pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
}

.flow pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: 18px;
  background: var(--soft);
}

.flow table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.6;
}

.flow th,
.flow td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.flow th {
  border-bottom: 2px solid var(--ink);
  font-weight: 700;
}

@media (min-width: 1000px) {
  .flow > article > ul {
    column-count: 2;
    column-gap: 44px;
  }
}

/* ---------- 页脚 ---------- */

footer {
  margin-top: clamp(60px, 9vw, 130px);
  background: var(--ink);
  color: var(--paper);
  padding: clamp(34px, 6vw, 64px) var(--gut) clamp(22px, 4vw, 38px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "b b"
    "c t";
  gap: 18px 12px;
  align-items: end;
  border-bottom: 10px solid var(--ink);
}

.foot-brand {
  grid-area: b;
  margin: 0;
  font-size: clamp(50px, 15vw, 170px);
  line-height: 0.86;
  letter-spacing: -0.055em;
  font-weight: 700;
  word-break: break-word;
}

.foot-copy {
  grid-area: c;
  font-size: 16px;
  opacity: 0.85;
}

.foot-top {
  grid-area: t;
  justify-self: end;
  font-size: 16px;
}

.foot-top a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  color: var(--paper);
  border: 1px solid var(--paper);
  border-radius: 999px;
  text-decoration: none;
}

.foot-top a:hover,
.foot-top a:focus-visible {
  background: var(--paper);
  color: var(--ink);
}

/* ---------- 动效 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- 窄屏 ---------- */

@media (max-width: 900px) {
  main {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 18px 0 34px;
    gap: 22px;
  }

  .hero-figure { min-height: 230px; max-height: 48vh; }
  .hero-void { min-height: 230px; }
  .hero-text { text-align: left; padding-bottom: 0; }
  .hero-desc { margin: 0; max-width: none; }

  .flow { grid-row: auto; order: 1; }
  .rail { grid-row: auto; order: 2; position: static; padding-top: 8px; }

  .menu ol {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding-top: 4px;
  }

  .menu li:nth-child(3) { margin-right: 0; }
  .rule { max-width: 40px; }
  .brandline { padding-top: 6px; }
  .cta { padding: 8px 16px; }
  .flow article { scroll-margin-top: 190px; }
}

@media (max-width: 520px) {
  .menu a { padding: 9px 11px; gap: 7px; }
  .menu a::before { display: none; }
  .hero-text h1 { margin-bottom: 16px; }
  footer { grid-template-columns: 1fr; grid-template-areas: "b" "c" "t"; }
  .foot-top { justify-self: start; }
}

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

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