@import url('https://fonts.googleapis.com/css2?family=Karla:wght@300;400;500;600;700&family=Playfair+Display+SC:wght@400;700&display=swap');

:root {
  --ink: #1a1a2e;
  --ink-deep: #10101f;
  --red: #ff0000;
  --pink: #ff006e;
  --paper: #ffe9f1;
  --dim: #c8b6cf;
  --line: rgba(255, 0, 110, 0.34);
  --line-soft: rgba(255, 0, 110, 0.16);
  --glow-red: rgba(255, 0, 0, 0.55);
  --glow-pink: rgba(255, 0, 110, 0.55);
  --radius: 28px;
  --font-display: 'Playfair Display SC', 'Songti SC', 'Noto Serif SC', Georgia, serif;
  --font-body: 'Karla', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--ink);
  background-image:
    radial-gradient(58rem 38rem at 82% -12%, rgba(255, 0, 110, 0.22), transparent 62%),
    radial-gradient(46rem 32rem at -8% 8%, rgba(255, 0, 0, 0.16), transparent 62%),
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: auto, auto, 52px 52px, 52px 52px;
  background-attachment: fixed, fixed, scroll, scroll;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.32) 0,
    rgba(0, 0, 0, 0.32) 1px,
    rgba(255, 255, 255, 0.02) 2px,
    rgba(255, 255, 255, 0.02) 4px
  );
  opacity: 0.55;
  mix-blend-mode: overlay;
}

body.nav-open::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(8, 8, 18, 0.72);
  backdrop-filter: blur(3px);
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 0 14px rgba(255, 0, 110, 0.42);
  overflow-wrap: anywhere;
}

/* 顶栏 */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: linear-gradient(180deg, rgba(16, 16, 31, 0.96), rgba(16, 16, 31, 0.62));
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 10px 4px 4px;
  text-decoration: none;
  color: var(--paper);
  border: 1px solid transparent;
  border-radius: 999px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.logo:hover,
.logo:focus-visible {
  border-color: var(--line);
  box-shadow: 0 0 18px rgba(255, 0, 110, 0.28);
}

.mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--pink);
  background:
    linear-gradient(135deg, var(--red) 0 48%, transparent 48% 52%, var(--pink) 52% 100%);
  box-shadow: 0 0 14px var(--glow-pink), inset 0 0 10px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.mark .logo-img { width: 100%; height: 100%; object-fit: cover; }

.brand {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-shadow: 0 0 12px var(--glow-red);
}

.burger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--paper);
  background: rgba(255, 0, 110, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.burger:hover,
.burger:focus-visible {
  color: #fff;
  background: rgba(255, 0, 110, 0.2);
  box-shadow: 0 0 20px var(--glow-pink);
}

.burger-bars,
.burger-bars::before,
.burger-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  content: '';
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.burger-bars { position: relative; }
.burger-bars::before { position: absolute; top: -6px; left: 0; }
.burger-bars::after { position: absolute; top: 6px; left: 0; }

body.nav-open .burger-bars { background: transparent; }
body.nav-open .burger-bars::before { transform: translateY(6px) rotate(45deg); }
body.nav-open .burger-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* 抽屉导航 */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 70;
  width: min(340px, 84vw);
  padding: 86px 26px 32px;
  overflow-y: auto;
  background:
    linear-gradient(200deg, rgba(255, 0, 110, 0.14), transparent 45%),
    var(--ink-deep);
  border-right: 1px solid var(--line);
  box-shadow: 0 0 40px rgba(255, 0, 110, 0.22);
  transform: translateX(-102%);
  visibility: hidden;
  transition: transform 0.36s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.36s linear;
}

body.nav-open .drawer {
  transform: none;
  visibility: visible;
}

.drawer nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: navi;
}

.drawer nav li {
  border-bottom: 1px solid var(--line-soft);
  opacity: 0;
}

.drawer nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 12px 2px;
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--paper);
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.25s ease, text-shadow 0.25s ease;
}

.drawer nav a::after {
  counter-increment: navi;
  content: counter(navi, decimal-leading-zero);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: rgba(255, 0, 110, 0.7);
}

.drawer nav a:hover,
.drawer nav a:focus-visible {
  color: #fff;
  padding-left: 12px;
  text-shadow: 0 0 16px var(--glow-pink), 0 0 26px var(--glow-red);
}

body.nav-open .drawer li { animation: slideIn 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
body.nav-open .drawer li:nth-child(1) { animation-delay: 0.05s; }
body.nav-open .drawer li:nth-child(2) { animation-delay: 0.1s; }
body.nav-open .drawer li:nth-child(3) { animation-delay: 0.15s; }
body.nav-open .drawer li:nth-child(4) { animation-delay: 0.2s; }
body.nav-open .drawer li:nth-child(5) { animation-delay: 0.25s; }
body.nav-open .drawer li:nth-child(6) { animation-delay: 0.3s; }
body.nav-open .drawer li:nth-child(7) { animation-delay: 0.35s; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: none; }
}

/* 主体 */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 96px 18px 40px;
}

div { display: block; }

/* 首屏 */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  text-align: center;
  padding: 40px 4px 60px;
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.hero::before {
  left: 50%;
  bottom: 26px;
  width: min(260px, 70%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--pink), transparent);
  box-shadow: 0 0 14px var(--glow-pink);
}

.hero::after {
  inset: auto 0 32px;
  height: 46px;
  background: repeating-linear-gradient(90deg, rgba(255, 0, 110, 0.22) 0 3px, transparent 3px 13px);
  mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
  opacity: 0.5;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 8px 18px;
  font-size: 15px;
  letter-spacing: 0.18em;
  color: #ffd7e6;
  border: 1px solid var(--pink);
  border-radius: 999px;
  background: rgba(255, 0, 110, 0.12);
  box-shadow: 0 0 20px rgba(255, 0, 110, 0.3) inset, 0 0 18px rgba(255, 0, 110, 0.24);
  animation: bob 4.5s ease-in-out infinite;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px var(--red);
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.hero-title {
  position: relative;
  margin: 0;
  max-width: 15em;
  font-size: clamp(2.4rem, 10.5vw, 5.6rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.45),
    0 0 28px var(--glow-pink),
    0 0 52px var(--glow-red);
}

.hero-title::before,
.hero-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.85;
}

.hero-title::before {
  color: var(--pink);
  clip-path: polygon(0 4%, 100% 4%, 100% 44%, 0 44%);
  animation: glitch-a 4.2s steps(2, end) infinite;
}

.hero-title::after {
  color: var(--red);
  clip-path: polygon(0 58%, 100% 58%, 100% 96%, 0 96%);
  animation: glitch-b 3.4s steps(2, end) infinite;
}

@keyframes glitch-a {
  0%, 82%, 100% { transform: translate(0, 0); opacity: 0.8; }
  84% { transform: translate(-3px, -2px) skewX(-4deg); opacity: 1; }
  88% { transform: translate(3px, 1px) skewX(3deg); }
  92% { transform: translate(-2px, 0); }
}

@keyframes glitch-b {
  0%, 78%, 100% { transform: translate(0, 0); opacity: 0.7; }
  80% { transform: translate(4px, 2px) skewX(5deg); opacity: 1; }
  86% { transform: translate(-4px, -1px) skewX(-3deg); }
  94% { transform: translate(2px, 1px); }
}

/* 正文章节 */
div > section:not(.hero) {
  position: relative;
  max-width: 40em;
  margin: 0 auto 26px;
  padding: 28px 22px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(170deg, rgba(255, 0, 110, 0.07), rgba(255, 0, 0, 0.02) 55%, transparent);
  scroll-margin-top: 92px;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

div > section:not(.hero):hover {
  border-color: rgba(255, 0, 110, 0.6);
  transform: translateY(-3px);
}

div > section:not(.hero)::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 22px;
  width: 34px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--red), var(--pink));
  box-shadow: 0 0 12px var(--glow-red);
}

div > section:not(.hero) > h2:first-child { margin-top: 22px; }

h2 {
  margin: 1.6em 0 0.5em;
  font-size: clamp(1.45rem, 4.6vw, 1.95rem);
}

h3 {
  margin: 1.4em 0 0.4em;
  font-size: clamp(1.18rem, 3.6vw, 1.35rem);
  color: #ffd9e6;
}

p { margin: 0 0 1.05em; }

p.subtitle,
p.subhead,
p.lead,
p.desc {
  margin: -0.1em 0 1.2em;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--dim);
  border-left: 2px solid var(--pink);
  padding-left: 12px;
}

ul, ol { margin: 0 0 1.15em; padding-left: 1.35em; }

li { margin: 0.35em 0; }

li::marker { color: var(--pink); }

div a {
  color: #ffb3ce;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 0, 110, 0.5);
  transition: color 0.2s ease, border-color 0.2s ease, text-shadow 0.2s ease;
}

div a:hover,
div a:focus-visible {
  color: #fff;
  border-color: #fff;
  text-shadow: 0 0 14px var(--glow-pink);
}

blockquote {
  margin: 1.3em 0;
  padding: 14px 18px;
  border-left: 3px solid var(--red);
  border-radius: 0 16px 16px 0;
  background: rgba(255, 0, 0, 0.07);
  color: #ffdfe8;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 16px;
}

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

th { background: rgba(255, 0, 110, 0.1); color: #fff; }

img { border-radius: 18px; border: 1px solid var(--line-soft); }

strong { color: #fff; }

/* 页脚 */
.foot {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px 26px;
  max-width: 1080px;
  margin: 30px auto 0;
  padding: 26px 20px 34px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  color: var(--dim);
}

.foot-brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow: 0 0 12px var(--glow-red);
}

.foot-links {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.foot-links a {
  display: inline-block;
  min-height: 40px;
  padding: 8px 0;
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

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

.foot-copy { justify-self: end; letter-spacing: 0.06em; }

/* 回到顶部 */
.to-top {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 80;
  min-height: 44px;
  padding: 11px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--paper);
  background: rgba(16, 16, 31, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s linear, box-shadow 0.25s ease;
}

body.scrolled .to-top {
  visibility: visible;
  opacity: 1;
  transform: none;
}

.to-top:hover,
.to-top:focus-visible { box-shadow: 0 0 20px var(--glow-pink); }

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

@media (max-width: 760px) {
  main { padding: 84px 14px 30px; }
  .hero { min-height: 62vh; padding: 26px 2px 46px; }
  .hero-title { font-size: clamp(2.1rem, 11.5vw, 3.4rem); }
  .brand { font-size: 15px; }
  div > section:not(.hero) { padding: 24px 16px 26px; border-radius: 22px; }
  .foot {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 6px;
    padding: 22px 16px 30px;
  }
  .foot-copy { justify-self: start; }
  .to-top { right: 12px; bottom: 12px; }
}

@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;
  }
  .hero-title::before,
  .hero-title::after { opacity: 0.7; }
}

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