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

:root {
  --pink: #eb879c;
  --pink-2: #ffb6c1;
  --ink: #26171a;
  --bg: #fff8f9;
  --bg-2: #fdeef1;
  --line: #f0d5db;
  --muted: #6d545a;
  --head: 138px;
  --wrap: 1180px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

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

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 99;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transition: top .24s ease;
}
.skip:focus { top: 12px; }

/* ---------- 页头 ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 248, 249, .95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 4px rgba(38, 23, 26, .06);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 12px 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .06em;
}

.brand-name { border-bottom: 3px solid var(--pink); padding-bottom: 1px; }

.logo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 1px solid var(--ink);
  background: #fff;
}

.logo-fallback {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--pink);
  color: #fff;
  border: 1px solid var(--ink);
  font-weight: 700;
  letter-spacing: 0;
}

.search {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--ink);
  background: #fff;
}

.search input {
  width: 152px;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.search input::placeholder { color: var(--muted); }

.search button {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid var(--ink);
  background: var(--pink-2);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .22s ease;
}

.search button:hover { background: var(--pink); }

.mainnav {
  border-top: 1px solid var(--line);
  background: #fff;
}

.mainnav ol {
  display: flex;
  gap: 6px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 8px 20px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}

.mainnav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 16px;
  white-space: nowrap;
  text-decoration: none;
  transition: background .22s ease, border-color .22s ease;
}

.mainnav a:hover,
.mainnav a:focus-visible { background: var(--bg-2); border-color: var(--pink); }

.mainnav a[aria-current="true"] {
  background: var(--pink);
  border-color: var(--ink);
  font-weight: 700;
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(var(--head) + 34px) 20px 96px;
  overflow: hidden;
  text-align: center;
  color: #fff;
  background: linear-gradient(168deg, #26171a 0%, #5c3239 52%, #eb879c 100%);
}

.hero-media { position: absolute; inset: 0; z-index: 0; }

.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(175deg, rgba(38, 23, 26, .84), rgba(38, 23, 26, .52));
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .58;
}

.hero-ghost {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  font-size: clamp(3.4rem, 17vw, 12rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: .1em;
  white-space: nowrap;
  color: rgba(255, 255, 255, .1);
  pointer-events: none;
  user-select: none;
}

.hero-copy { position: relative; z-index: 2; max-width: 900px; }

.hero h1 {
  margin: 0 0 30px;
  font-size: clamp(2rem, 6.6vw, 4.4rem);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: .01em;
  text-shadow: 0 2px 14px rgba(38, 23, 26, .45);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 26px;
  border: 1px solid #fff;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-weight: 700;
  letter-spacing: .12em;
  text-decoration: none;
  transition: background .26s ease, color .26s ease;
}

.hero-cta:hover,
.hero-cta:focus-visible { background: #fff; color: var(--ink); }

/* ---------- 主体 ---------- */
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  align-items: start;
  gap: 56px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 64px 20px 100px;
}

.prose { min-width: 0; }

.prose > section {
  padding: 42px 0 46px;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--head) + 16px);
}

.prose > section:first-child { border-top: 0; padding-top: 0; }

.prose p { margin: 0 0 16px; }

.prose h2 {
  margin: 0 0 18px;
  font-size: clamp(1.5rem, 3vw, 1.95rem);
  line-height: 1.3;
  letter-spacing: .01em;
}

.prose h2 > span,
.prose h3 > span { display: inline-block; position: relative; padding-bottom: 6px; }

.prose h2 > span::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  background: var(--pink-2);
}

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

.prose h3 > span::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--pink-2);
}

.prose ul,
.prose ol { margin: 0 0 18px; padding-left: 1.25em; }
.prose li { margin: .38em 0; }
.prose li::marker { color: var(--pink); }

.prose a {
  color: #a84158;
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--ink); }

.prose blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--pink);
  background: var(--bg-2);
}

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

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

.prose th { background: var(--bg-2); }

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

.prose > section.is-off { display: none; }

.page-top { padding: 0 0 30px; border-bottom: 1px solid var(--line); margin-bottom: 34px; }

.page-top h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4.4vw, 2.8rem);
  line-height: 1.2;
}

/* ---------- 侧栏 ---------- */
.rail {
  position: sticky;
  top: calc(var(--head) + 16px);
  padding: 20px 18px;
  border: 1px solid var(--ink);
  background: #fff;
}

.rail h2 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .14em;
}

.rail h2 > span { display: inline-block; padding-bottom: 4px; border-bottom: 2px solid var(--pink); }

.rail ul {
  display: grid;
  gap: 2px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.rail a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 8px;
  border-bottom: 1px dashed var(--line);
  font-size: 16px;
  text-decoration: none;
  transition: background .22s ease, padding-left .22s ease;
}

.rail a:hover,
.rail a:focus-visible { background: var(--bg-2); padding-left: 14px; }

.totop {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  font-size: 16px;
  text-decoration: none;
  transition: background .22s ease, border-color .22s ease;
}

.totop:hover { background: var(--bg-2); border-color: var(--pink); }

/* ---------- 页脚 ---------- */
.foot {
  background: var(--ink);
  color: #f7e6ea;
  padding: 0 20px 30px;
}

.foot-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 56px 0 38px;
  border-bottom: 1px solid rgba(255, 182, 193, .26);
}

.foot-cta h2 {
  margin: 0;
  font-size: clamp(1.7rem, 5vw, 2.8rem);
  line-height: 1.2;
  color: #fff;
  letter-spacing: .02em;
}

.foot-cta h2 > span { display: inline-block; padding-bottom: 6px; border-bottom: 4px solid var(--pink); }

.cta-link {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--pink-2);
  color: var(--pink-2);
  font-weight: 700;
  letter-spacing: .1em;
  text-decoration: none;
  transition: background .24s ease, color .24s ease;
}

.cta-link:hover,
.cta-link:focus-visible { background: var(--pink-2); color: var(--ink); }

.foot-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 26px 0;
  border-bottom: 1px solid rgba(255, 182, 193, .26);
}

.foot address {
  font-style: normal;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--pink-2);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  border-bottom: 1px solid transparent;
  color: #f7e6ea;
  font-size: 16px;
  text-decoration: none;
  transition: color .22s ease, border-color .22s ease;
}

.foot-links a:hover,
.foot-links a:focus-visible { color: #fff; border-bottom-color: var(--pink); }

.copy {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-top: 18px;
  font-size: 16px;
  color: rgba(247, 230, 234, .72);
}

/* ---------- 动效 ---------- */
.rv {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .28s ease, transform .28s ease;
}

.rv-in { opacity: 1; transform: none; }

/* ---------- 断点 ---------- */
@media (max-width: 960px) {
  main { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 48px 20px 76px; }
  .rail { position: static; order: 2; }
  .foot-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --head: 152px; }
  .bar { flex-wrap: wrap; padding: 10px 16px; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; flex: 1 1 auto; }
  .mainnav ol { padding: 8px 16px; }
  .hero { padding: calc(var(--head) + 20px) 16px 72px; }
  .hero-ghost { font-size: clamp(3rem, 22vw, 6rem); letter-spacing: .04em; }
  main { padding: 40px 16px 64px; }
  .prose > section { padding: 34px 0 38px; }
  .foot { padding: 0 16px 26px; }
  .foot-cta { padding: 42px 0 30px; }
}

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

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