@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;500;600;700&family=Comic+Neue:wght@300;400;700&display=swap');

:root {
  --pink: #FF7A6B;
  --ink: #2A1B33;
  --cream: #FFD98E;
  --bg: #2A1B33;
  --bg2: #211330;
  --txt: #FFEAD1;
  --dim: #CBB6DA;
  --line: rgba(255, 217, 142, 0.3);
  --soft: rgba(255, 122, 107, 0.14);
  --font: 'Baloo 2', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at 12% -8%, #3d2456 0%, var(--bg) 42%, var(--bg2) 100%) fixed;
  color: var(--txt);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.72;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: var(--pink); color: var(--ink); }

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

a { color: var(--pink); }

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 60;
  padding: 0.65rem 1rem;
  background: var(--cream);
  color: var(--ink);
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip:focus { top: 0.75rem; }

/* ---------- 顶栏 ---------- */
.top {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding: 0.7rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: rgba(33, 19, 48, 0.72);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.2rem 0.35rem;
  color: var(--cream);
  font-weight: 700;
  font-size: 1.06rem;
  text-decoration: none;
  letter-spacing: 0.01em;
  border-radius: 4px;
}
.brand:hover { color: var(--pink); }

.dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 122, 107, 0.24);
  flex: 0 0 auto;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--cream);
  object-fit: cover;
}

.mainnav {
  flex: 1 1 240px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.mainnav p {
  display: flex;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
}
.mainnav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.3rem 0.68rem;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--txt);
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
}
.mainnav a::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink);
  flex: 0 0 auto;
}
.mainnav a:hover {
  background: var(--soft);
  border-color: var(--line);
  color: var(--cream);
}

.hsearch {
  display: flex;
  gap: 0.35rem;
  flex: 0 0 auto;
  margin-left: auto;
}
.hsearch input,
.sub-form input {
  min-height: 44px;
  width: 9rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--txt);
  font-family: inherit;
  font-size: 1rem;
}
.hsearch input::placeholder,
.sub-form input::placeholder { color: #a993bb; }

.hsearch button,
.sub-form button {
  min-height: 44px;
  padding: 0 0.85rem;
  border: 1px solid var(--pink);
  border-radius: 4px;
  background: var(--pink);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.hsearch button:hover,
.sub-form button:hover { background: var(--cream); border-color: var(--cream); }

/* ---------- 粘性锚点条 ---------- */
.stickybar {
  position: sticky;
  top: 0;
  z-index: 25;
  background: rgba(33, 19, 48, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.stickybar nav {
  overflow-x: auto;
  padding: 0.1rem clamp(0.6rem, 3vw, 1.5rem);
}
.stickybar p {
  display: flex;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
}
.stickybar a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.2rem 0.62rem;
  border-radius: 4px;
  color: var(--dim);
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
}
.stickybar a:hover {
  color: var(--cream);
  background: rgba(255, 217, 142, 0.13);
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: 4.5rem 1.5rem 5.5rem;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(158deg, #42285c 0%, var(--bg) 58%, #241636 100%);
  clip-path: polygon(0 0, 100% 0, 100% 93%, 0 100%);
}

.hero-slash {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 16px;
  background: linear-gradient(90deg, var(--pink), var(--cream) 62%, var(--pink));
}

.hero-art { position: absolute; inset: 0; }

.hero-pic {
  position: absolute;
  z-index: 1;
  width: min(230px, 26vw);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 2px solid rgba(255, 217, 142, 0.55);
  border-radius: 4px;
  opacity: 0.9;
  transform: rotate(var(--r, 0deg));
  animation: floaty 7s ease-in-out infinite;
}
.hero-pic.p1 { --r: -7deg; left: 1.5%; top: 13%; }
.hero-pic.p2 { --r: 6deg; right: 1.5%; bottom: 15%; animation-delay: -3.2s; }

@keyframes floaty {
  0%, 100% { transform: rotate(var(--r, 0deg)) translateY(0); }
  50% { transform: rotate(var(--r, 0deg)) translateY(-13px); }
}

.hero-txt {
  position: relative;
  z-index: 2;
  max-width: 46rem;
}

.kicker {
  display: inline-block;
  margin: 0 0 0.6rem;
  font-size: 1rem;
  letter-spacing: 0.24em;
  background: linear-gradient(90deg, var(--cream), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: breathe 3.6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero h1 {
  margin: 0.2rem 0 1rem;
  font-size: clamp(2.1rem, 7.2vw, 4.5rem);
  line-height: 1.14;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.01em;
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.18);
}

.hero h1 .ch {
  display: inline-block;
  animation: dropIn 0.62s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
}
.hero h1 .ch:nth-child(3n) { color: var(--pink); }
.hero h1 .ch:nth-child(4n) { color: var(--cream); }

@keyframes dropIn {
  0% { opacity: 0; transform: translateY(-26px) rotate(-8deg); }
  62% { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) rotate(0); }
}

.hero-sub {
  margin: 0 auto;
  max-width: 34rem;
  color: var(--txt);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ---------- 主体骨架 ---------- */
main { padding: 0 clamp(1rem, 4vw, 2rem) 4.5rem; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}

.base {
  min-width: 0;
  order: 1;
  padding-top: 2rem;
}

div[id] { scroll-margin-top: 78px; }

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

.prose > div[id] { padding-top: 0.4rem; }
.prose > div[id] + div[id] {
  margin-top: 2.6rem;
  padding-top: 2.4rem;
  border-top: 1px dashed var(--line);
}

.prose p {
  margin: 0 0 1.1rem;
  line-height: 1.85;
  max-width: 68ch;
}

.prose h2 {
  margin: 0 0 0.15rem;
  font-size: clamp(1.35rem, 3.2vw, 1.9rem);
  line-height: 1.34;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.01em;
}

.prose h3 {
  margin: 1.6rem 0 0.45rem;
  font-size: 1.16rem;
  color: var(--cream);
}

.prose hr,
.rail hr {
  border: 0;
  height: 4px;
  width: 66px;
  margin: 0.55rem 0 1.15rem;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--pink), var(--cream));
}

.prose ul,
.prose ol {
  margin: 0 0 1.15rem;
  padding-left: 1.35rem;
}
.prose li { margin: 0.32rem 0; }
.prose li::marker { color: var(--pink); }

.prose a {
  color: var(--pink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 2px;
}
.prose a:hover { color: var(--cream); }

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.prose blockquote {
  margin: 1.25rem 0;
  padding: 0.65rem 1rem;
  border-left: 4px solid var(--pink);
  border-radius: 0 4px 4px 0;
  background: rgba(255, 122, 107, 0.1);
  color: var(--txt);
}

.prose code {
  font-family: 'Comic Neue', ui-monospace, monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

div.hit {
  background: rgba(255, 122, 107, 0.09);
  box-shadow: 0 0 0 1px rgba(255, 122, 107, 0.45);
  border-radius: 4px;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

/* ---------- 侧栏 ---------- */
.rail {
  order: 2;
  position: sticky;
  top: 82px;
  margin-top: 2rem;
  padding: 1rem 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.22);
}

.rail-t {
  margin: 0;
  font-size: 1rem;
  color: var(--cream);
  letter-spacing: 0.06em;
}

.rail hr { height: 3px; width: 42px; margin: 0.45rem 0 0.8rem; }

.rail-nav ul {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.28rem 0.35rem;
  border-radius: 4px;
  color: var(--dim);
  font-size: 1rem;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.rail-nav a:hover {
  color: var(--cream);
  border-left-color: var(--pink);
  background: rgba(255, 217, 142, 0.09);
}

.totop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--pink);
  border-radius: 4px;
  color: var(--pink);
  font-size: 1rem;
  text-decoration: none;
}
.totop:hover { background: var(--pink); color: var(--ink); }

/* ---------- 页脚 ---------- */
.sitefoot {
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  padding: 2rem clamp(1rem, 4vw, 2rem) 1.5rem;
}

.footrow {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
}

.footlogo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--cream);
  font-weight: 700;
  font-size: 1.04rem;
  text-decoration: none;
}
.footlogo:hover { color: var(--pink); }

.footnav {
  flex: 1 1 240px;
  min-width: 0;
  overflow-x: auto;
}
.footnav p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
  margin: 0;
}
.footnav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  color: var(--dim);
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
}
.footnav a:hover { color: var(--cream); background: rgba(255, 217, 142, 0.1); }

.sub-form { display: flex; gap: 0.35rem; }
.sub-form input { width: 10rem; }

.copy {
  max-width: 1180px;
  margin: 1.35rem auto 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  color: var(--dim);
  font-size: 1rem;
}

/* ---------- 滚动揭示 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.62s ease, transform 0.62s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; }
  .rail {
    position: static;
    order: 2;
    margin-top: 0.5rem;
  }
  .base { order: 1; }
  .rail-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
  }
  .rail-nav a {
    border-left: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.25rem 0.6rem;
  }
}

@media (max-width: 760px) {
  .top { row-gap: 0.5rem; }
  .mainnav { order: 3; flex-basis: 100%; }
  .hsearch input { width: 7rem; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero {
    min-height: 62vh;
    padding: 3rem 1rem 4rem;
    clip-path: polygon(0 0, 100% 0, 100% 96%, 0 100%);
  }
  .hero-pic { width: 34vw; opacity: 0.45; }
  .hero-pic.p1 { left: -4%; top: 8%; }
  .hero-pic.p2 { right: -4%; bottom: 10%; }
  .hero h1 { text-shadow: 0 4px 0 rgba(0, 0, 0, 0.22); }
  .hero-sub { font-size: 1rem; }
  .sub-form input { width: 8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

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