@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Orbitron:wght@700;900&display=swap');

:root {
  --ink: #26171a;
  --ink2: #342125;
  --ink3: #422a30;
  --rose: #eb879c;
  --pink: #ffb6c1;
  --fg: #f7eaed;
  --fg2: #cdb1b6;
  --line: rgba(235, 135, 156, 0.24);
  --line2: rgba(235, 135, 156, 0.5);
  --r: 10px;
  --soft: 0 2px 4px rgba(0, 0, 0, 0.35), 0 10px 26px rgba(0, 0, 0, 0.28);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'PingFang SC', 'Microsoft YaHei', monospace;
  --disp: 'Orbitron', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100%;
  padding-bottom: 118px;
  font-family: var(--mono);
  font-size: 17px;
  line-height: 1.8;
  color: var(--fg);
  background:
    radial-gradient(900px 520px at 10% -12%, rgba(235, 135, 156, 0.18), transparent 62%),
    radial-gradient(760px 480px at 96% 4%, rgba(255, 182, 193, 0.12), transparent 64%),
    var(--ink);
  background-attachment: fixed;
  overflow-x: hidden;
}

img,
svg,
video,
iframe { max-width: 100%; height: auto; }

a { color: var(--pink); text-decoration-color: var(--line2); text-underline-offset: 3px; }

p { margin: 0 0 14px; }

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

main { counter-reset: sec; min-width: 0; }

main > section {
  max-width: 1120px;
  min-width: 0;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
  scroll-margin-top: 26px;
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 45vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
  padding-block: clamp(30px, 7vh, 62px) clamp(28px, 6vh, 52px);
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: attr(data-mark);
  position: absolute;
  left: -0.05em;
  bottom: -0.24em;
  z-index: 0;
  max-width: 100%;
  font-family: var(--disp);
  font-weight: 900;
  font-size: clamp(74px, 17vw, 208px);
  line-height: 0.8;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: rgba(255, 182, 193, 0.075);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  min-width: 0;
}

.hero-kicker {
  margin: 0 0 10px;
  font-size: 16px;
  letter-spacing: 0.2em;
  color: var(--rose);
}

.hero h1 {
  margin: 0 0 14px;
  font-family: var(--disp);
  font-size: clamp(29px, 4.6vw, 52px);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -0.01em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.hero-lead {
  max-width: 54ch;
  margin: 0;
  color: var(--fg2);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.hero-figure {
  margin: 0;
  width: clamp(78px, 21vw, 126px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  background: rgba(255, 182, 193, 0.05);
}

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

.hero-glyph {
  width: 44%;
  aspect-ratio: 1;
  border: 2px solid var(--pink);
  border-radius: 8px;
  box-shadow: inset 0 0 20px rgba(255, 182, 193, 0.55), 0 0 18px rgba(235, 135, 156, 0.35);
}

/* ---------- 侧栏 ---------- */
.rail {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 16px 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(38, 23, 26, 0.66);
  backdrop-filter: blur(6px);
}

.rail-title {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--pink);
}

.subtitle {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg2);
  overflow-wrap: anywhere;
}

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

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

.rail-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--fg);
  font-size: 16px;
  text-decoration: none;
  transition: transform 220ms ease, border-color 220ms ease, background-color 220ms ease, color 220ms ease;
}

.rail-list a::before {
  content: counter(rail, decimal-leading-zero);
  flex: 0 0 auto;
  font-size: 16px;
  color: var(--rose);
  opacity: 0.85;
}

.rail-list a:hover {
  color: var(--pink);
  border-color: var(--line2);
  background: rgba(235, 135, 156, 0.1);
  transform: translateX(3px);
}

/* ---------- 正文 ---------- */
main > section[id] {
  counter-increment: sec;
  padding-block: 36px 14px;
  overflow-wrap: anywhere;
  animation: rise 280ms ease both;
}

main > section[id] + section[id] { border-top: 1px solid var(--line); }

main > section[id] h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 8px;
  font-family: var(--disp);
  font-size: clamp(21px, 2.6vw, 28px);
  font-weight: 700;
  line-height: 1.35;
}

main > section[id] h2::before {
  content: counter(sec, decimal-leading-zero);
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--rose);
}

main > section[id] h3 {
  margin: 26px 0 8px;
  font-family: var(--disp);
  font-size: 19px;
  line-height: 1.4;
  color: var(--pink);
}

main > section[id] p { max-width: 72ch; }

main > section[id] h2 + p,
main > section[id] h3 + p { color: var(--pink); font-size: 16px; }

main > section[id] ul,
main > section[id] ol { max-width: 72ch; padding-left: 1.25em; }

main > section[id] li { margin-block: 8px; }

main > section[id] li::marker { color: var(--rose); }

main > section[id] strong { color: var(--pink); font-weight: 500; }

main > section[id] > div {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(255, 182, 193, 0.035);
}

main > section[id] > div + div { margin-top: 14px; }

main > section[id] figure {
  margin: 18px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

main > section[id] img { display: block; max-width: 100%; border-radius: 6px; }

/* 表格：自身横向滚动，避免撑破 375px 视口 */
main > section[id] table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  border-radius: var(--r);
  font-size: 16px;
}

main > section[id] th,
main > section[id] td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  overflow-wrap: anywhere;
}

main > section[id] th { color: var(--pink); font-weight: 500; }

/* 代码块：同样自带滚动 */
main > section[id] pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(0, 0, 0, 0.32);
  font-size: 16px;
  line-height: 1.7;
}

main > section[id] pre code { display: block; min-width: max-content; }

main > section[id] > * { animation: rise 260ms ease both; }
main > section[id] > :nth-child(2) { animation-delay: 40ms; }
main > section[id] > :nth-child(3) { animation-delay: 80ms; }
main > section[id] > :nth-child(4) { animation-delay: 120ms; }
main > section[id] > :nth-child(5) { animation-delay: 160ms; }
main > section[id] > :nth-child(6) { animation-delay: 200ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 页脚 ---------- */
.site-foot {
  margin-top: clamp(40px, 8vh, 86px);
  padding-bottom: 14px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(66, 42, 48, 0.55), rgba(38, 23, 26, 0));
}

.site-foot > section {
  max-width: 1120px;
  min-width: 0;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

.foot-top { padding-block: 30px 10px; }

.foot-brand {
  margin: 0;
  font-family: var(--disp);
  font-weight: 900;
  font-size: clamp(38px, 9vw, 92px);
  line-height: 0.94;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  color: rgba(235, 135, 156, 0.16);
  -webkit-text-stroke: 1px rgba(235, 135, 156, 0.6);
}

.foot-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding-block: 18px 26px;
}

.foot-nav { min-width: 0; }

.foot-nav dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
  margin: 0;
}

.foot-nav dt {
  grid-column: 1 / -1;
  margin-top: 12px;
  font-size: 16px;
  letter-spacing: 0.24em;
  color: var(--rose);
}

.foot-nav dt:first-child { margin-top: 0; }

.foot-nav dd { margin: 0; min-width: 0; }

.foot-nav dd a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  color: var(--fg);
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
}

.foot-nav dd a:hover { color: var(--pink); border-bottom-color: var(--line2); }

.foot-col { min-width: 0; }

.foot-col p { margin: 0; font-size: 16px; color: var(--fg2); overflow-wrap: anywhere; }

.foot-lead { line-height: 1.7; }

.foot-copy {
  padding-block: 14px;
  border-top: 1px solid var(--line);
}

.foot-copy p { margin: 0; font-size: 16px; color: var(--fg2); }

/* ---------- 底部固定条 ---------- */
.dock {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px clamp(10px, 3vw, 26px) calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(38, 23, 26, 0.9);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line2);
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.3), 0 -14px 34px rgba(0, 0, 0, 0.4);
}

.dock-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.dock-side { display: flex; flex-wrap: wrap; gap: 2px; min-width: 0; }
.dock-side--l { justify-content: flex-end; }
.dock-side--r { justify-content: flex-start; }

.dock a,
.dock summary {
  display: inline-flex;
  align-items: center;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--fg);
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease, background-color 200ms ease;
}

.dock a:hover,
.dock summary:hover,
.drop[open] summary {
  color: var(--pink);
  border-color: var(--line2);
  background: rgba(255, 182, 193, 0.1);
}

.dock-brand {
  font-family: var(--disp);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--pink);
  padding-inline: 14px;
}

.drop { position: relative; }

.drop summary { list-style: none; }
.drop summary::-webkit-details-marker { display: none; }
.drop summary::after {
  content: '+';
  margin-left: 6px;
  color: var(--rose);
}
.drop[open] summary::after { content: '−'; }

.drop-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 70;
  display: grid;
  gap: 2px;
  width: 190px;
  max-width: calc(100vw - 24px);
  padding: 8px;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  background: var(--ink2);
  box-shadow: var(--soft);
}

.drop-panel a { width: 100%; }

.dock-contact {
  border-color: var(--line2);
  color: var(--pink);
  padding-inline: 14px;
}

/* ---------- 断点 ---------- */
@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 292px;
    align-items: start;
    column-gap: 38px;
  }
}

@media (min-width: 760px) {
  .foot-cols { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 820px) {
  body { padding-bottom: 178px; }
  .dock { padding-inline: 10px; }
  .dock-nav { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
  .dock-brand { order: -1; justify-self: center; padding-block: 8px; }
  .dock-side { justify-content: center; }
  .dock-side--l { justify-content: center; }
  .dock-side--r { justify-content: center; }
  .dock a,
  .dock summary { padding: 9px 8px; }
  .dock-contact { align-self: center; justify-self: center; }
  .drop-panel { width: 172px; }
}

@media (max-width: 480px) {
  .hero-copy { gap: 12px; }
  .hero h1 { font-size: 27px; }
  .hero-lead { font-size: 16px; }
  .foot-nav dl { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  main > section[id],
  main > section[id] > * { animation: none; }
  .rail-list a,
  .dock a,
  .dock summary,
  .foot-nav dd a { transition: none; }
  .rail-list a:hover { transform: none; }
}

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