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

:root {
  --ink: #26171a;
  --ink-2: #2f1e23;
  --ink-3: #3a262c;
  --rose: #eb879c;
  --rose-soft: #ffb6c1;
  --cream: #fbeef0;
  --text: #f0e1e4;
  --muted: #c9adb3;
  --line: rgba(255, 182, 193, 0.16);
  --r: 4px;
  --sh: 0 2px 4px rgba(0, 0, 0, 0.32), 0 16px 34px -18px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  --fast: 220ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: 'Noto Sans Thai', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.72;
  background: radial-gradient(1100px 540px at 92% -10%, #3c262d 0, rgba(38, 23, 26, 0) 62%) no-repeat, var(--ink);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

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

:focus-visible {
  outline: 2px solid var(--rose-soft);
  outline-offset: 2px;
}

.skip {
  position: fixed;
  z-index: 90;
  left: 12px;
  top: -70px;
  padding: 10px 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--r);
  background: var(--rose);
  color: #26171a;
  font-weight: 700;
  text-decoration: none;
  transition: top var(--fast);
}

.skip:focus {
  top: 12px;
}

/* 左侧竖排导航 */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 248px;
  padding: 20px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(52, 33, 39, 0.96), rgba(38, 23, 26, 0.97));
  border-right: 1px solid var(--line);
  box-shadow: 14px 0 34px -26px #000;
}

.brand {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r);
  background: linear-gradient(140deg, var(--rose-soft), var(--rose));
  box-shadow: var(--sh);
  text-decoration: none;
  transition: transform var(--fast), box-shadow var(--fast);
}

.brand:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35), 0 18px 28px -16px rgba(0, 0, 0, 0.7);
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--r);
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #26171a;
  box-shadow: 0 0 0 4px rgba(38, 23, 26, 0.16);
}

.find {
  display: grid;
  gap: 6px;
}

.find input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: border-color var(--fast), background var(--fast);
}

.find input::placeholder {
  color: #b19298;
}

.find input:focus {
  border-color: var(--rose);
  background: rgba(255, 255, 255, 0.06);
}

.find button {
  height: 44px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #26171a;
  background: linear-gradient(140deg, var(--rose-soft), var(--rose));
  border: 0;
  border-radius: var(--r);
  cursor: pointer;
  box-shadow: var(--sh);
  transition: transform var(--fast), filter var(--fast);
}

.find button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.find-state {
  margin: 0;
  font-size: 16px;
  color: var(--rose-soft);
}

.find-state:empty {
  display: none;
}

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

.rail nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--r);
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--fast), color var(--fast), transform var(--fast), border-color var(--fast);
}

.rail nav a::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-right: 10px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  transition: opacity var(--fast);
}

.rail nav a:hover {
  background: var(--ink-3);
  color: var(--cream);
  transform: translateX(2px);
}

.rail nav a:hover::before {
  opacity: 1;
}

.rail nav a[aria-current="true"] {
  color: #fff;
  background: rgba(235, 135, 156, 0.18);
  border-color: rgba(235, 135, 156, 0.45);
}

/* 内容区 */
.stage {
  margin-left: 248px;
  padding: 26px clamp(16px, 3vw, 40px) 44px;
  max-width: 1400px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: 28px;
  align-items: start;
}

main {
  min-width: 0;
}

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  min-height: min(45vh, 390px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(150deg, #342127, #26171a 62%);
  box-shadow: var(--sh);
}

.hero::before {
  content: "";
  position: absolute;
  left: -6%;
  bottom: -34%;
  width: 60%;
  height: 92%;
  background: linear-gradient(90deg, rgba(235, 135, 156, 0.36), rgba(235, 135, 156, 0));
  clip-path: polygon(0 0, 100% 62%, 100% 100%, 0 100%);
  transform: rotate(-3deg);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.28;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.lead {
  margin: 0;
  max-width: 36ch;
  font-size: 16px;
  color: var(--muted);
}

.hero-art {
  position: relative;
  overflow: hidden;
  clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%);
  background: linear-gradient(160deg, var(--rose), #a9566a 68%, #593039);
}

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

.hero-art--bare::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 46%),
    repeating-linear-gradient(135deg, rgba(38, 23, 26, 0.16) 0 10px, rgba(38, 23, 26, 0) 10px 20px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 24px;
  border-radius: var(--r);
  background: linear-gradient(140deg, var(--rose-soft), var(--rose));
  color: #26171a;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--sh);
  transition: transform var(--fast), filter var(--fast), box-shadow var(--fast);
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.34), 0 20px 32px -16px rgba(0, 0, 0, 0.72);
}

.btn--night {
  background: #26171a;
  color: var(--cream);
}

/* 正文 */
.doc {
  min-width: 0;
}

.doc > article {
  padding: 30px 0 34px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 26px;
}

.doc > .hero + article {
  border-top: 0;
  padding-top: 28px;
}

.doc h2 {
  position: relative;
  margin: 0 0 14px;
  padding-left: 14px;
  font-size: clamp(22px, 2.6vw, 29px);
  line-height: 1.35;
  color: #fff;
}

.doc h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.34em;
  bottom: 0.3em;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(var(--rose), var(--rose-soft));
}

.doc h3 {
  margin: 22px 0 10px;
  font-size: 20px;
  line-height: 1.4;
  color: var(--rose-soft);
}

.doc p {
  margin: 0 0 16px;
  max-width: 68ch;
}

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

.doc ul,
.doc ol {
  margin: 0 0 18px;
  padding-left: 1.3em;
  max-width: 66ch;
}

.doc li {
  margin: 6px 0;
}

.doc a {
  color: var(--rose-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc strong {
  color: var(--cream);
}

.doc img {
  height: auto;
  border-radius: var(--r);
  box-shadow: var(--sh);
  margin: 6px 0 18px;
}

.doc blockquote {
  margin: 0 0 18px;
  padding: 14px 18px;
  border-left: 4px solid var(--rose);
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
}

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

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

.doc th {
  color: var(--rose-soft);
  font-weight: 600;
}

/* 右侧 aside */
.side {
  position: sticky;
  top: 24px;
  align-self: start;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(170deg, var(--ink-2), var(--ink));
  box-shadow: var(--sh);
}

.side h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  color: #fff;
}

.subtitle {
  margin: 4px 0 14px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
}

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

.side-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 10px;
  border-bottom: 1px dashed var(--line);
  border-radius: var(--r);
  color: var(--muted);
  font-size: 16px;
  text-decoration: none;
  transition: background var(--fast), color var(--fast), padding-left var(--fast);
}

.side-list a:hover {
  background: var(--ink-3);
  color: #fff;
  padding-left: 14px;
}

.side-top {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--rose-soft);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--fast), color var(--fast);
}

.side-top:hover {
  background: rgba(235, 135, 156, 0.16);
  color: #fff;
}

/* 页脚 */
.base {
  margin-left: 248px;
  padding: 34px clamp(16px, 3vw, 40px) 26px;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 22px 28px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(58, 38, 44, 0.4), rgba(38, 23, 26, 0.92));
}

.cta-block {
  padding: 24px 22px;
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--rose-soft), var(--rose));
  color: #26171a;
  box-shadow: var(--sh);
}

.cta-block h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
  color: #26171a;
}

.cta-block .subtitle {
  margin: 6px 0 16px;
  color: rgba(38, 23, 26, 0.74);
}

.foot-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--ink-2);
  color: var(--muted);
  font-size: 16px;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.26);
  transition: background var(--fast), color var(--fast), transform var(--fast);
}

.foot-links a:hover {
  background: var(--ink-3);
  color: var(--cream);
  transform: translateY(-1px);
}

.foot-base {
  grid-column: 1 / -1;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 16px;
}

.foot-base p {
  margin: 0;
}

@media (max-width: 980px) {
  .rail {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    width: auto;
    height: auto;
    padding: 10px 14px 0;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px 10px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 26px -20px #000;
  }

  .brand,
  .brand img {
    width: 40px;
    height: 40px;
  }

  .find {
    grid-column: 2;
    grid-template-columns: 1fr auto;
    gap: 6px;
  }

  .find-state {
    grid-column: 1 / -1;
  }

  .rail nav {
    grid-column: 1 / -1;
  }

  .rail nav ul {
    display: flex;
    gap: 6px;
    padding-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .rail nav li {
    flex: 0 0 auto;
  }

  .rail nav a {
    white-space: nowrap;
    min-height: 44px;
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.025);
  }

  .stage {
    margin-left: 0;
    padding: 16px 14px 28px;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    max-width: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-copy {
    order: 1;
    padding: 24px 18px;
  }

  .hero h1 {
    font-size: clamp(26px, 7vw, 34px);
  }

  .hero-art {
    order: 2;
    height: 180px;
    clip-path: polygon(0 12%, 100% 0, 100% 100%, 0 100%);
  }

  .doc > article {
    scroll-margin-top: 122px;
  }

  .side {
    position: static;
  }

  .base {
    margin-left: 0;
    padding: 24px 14px 22px;
    grid-template-columns: 1fr;
  }

  .cta-block,
  .foot-base {
    grid-column: 1;
  }
}

@media (max-width: 520px) {
  .stage {
    padding: 12px 12px 24px;
  }

  .cta-block {
    padding: 20px 18px;
  }

  .hero-copy {
    padding: 20px 14px;
  }

  .doc > article {
    padding: 24px 0 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

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