@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@300;400;500;600;700&display=swap');

:root {
  --ink: #0d0d0d;
  --ink-2: #08060c;
  --pur: #8000ff;
  --mag: #ff00ff;
  --fg: #f3ebff;
  --mut: #bda9d8;
  --line: rgba(255, 0, 255, 0.24);
  --line-soft: rgba(128, 0, 255, 0.26);
  --glass: rgba(128, 0, 255, 0.08);
  --max: 1180px;
}

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

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--fg);
  font-family: Nunito, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0 1px,
    rgba(0, 0, 0, 0) 1px 4px
  );
  opacity: 0.55;
  mix-blend-mode: screen;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60vw 55vh at 88% -8%, rgba(255, 0, 255, 0.16), transparent 70%),
    radial-gradient(55vw 50vh at 4% 4%, rgba(128, 0, 255, 0.2), transparent 72%);
}

a {
  color: var(--fg);
  text-decoration: none;
}

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

h1,
h2,
h3 {
  font-family: Fredoka, Nunito, "PingFang SC", sans-serif;
  line-height: 1.25;
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

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

/* ---------- 顶栏：两行 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 13, 13, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brandrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 18px 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  color: #fff;
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-shadow: 0 0 12px rgba(255, 0, 255, 0.75), 0 0 30px rgba(128, 0, 255, 0.5);
}

.mark-img {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.contact {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--pur);
  border-radius: 4px;
  color: #e7d7ff;
  font-size: 16px;
  letter-spacing: 0.12em;
  background: rgba(128, 0, 255, 0.12);
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}

.contact:hover {
  color: #fff;
  background: rgba(255, 0, 255, 0.22);
  box-shadow: 0 0 16px rgba(255, 0, 255, 0.45);
}

.navwrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 18px 10px;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  margin-top: 4px;
  padding: 0 15px;
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--mag);
  border-radius: 4px;
  color: #ffd6ff;
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 16px;
  letter-spacing: 0.16em;
  background: rgba(255, 0, 255, 0.1);
  text-shadow: 0 0 10px rgba(255, 0, 255, 0.7);
}

.nav-toggle::-webkit-details-marker {
  display: none;
}

.nav-toggle::marker {
  content: "";
}

.nav-toggle::after {
  content: "+";
  color: var(--mag);
}

.nav-details[open] .nav-toggle::after {
  content: "−";
}

.navmenu {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.navmenu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #d6c6ee;
  font-size: 16px;
  transition: color 0.18s, border-color 0.18s, background 0.18s, text-shadow 0.18s;
}

.navmenu a:hover,
.navmenu a:focus-visible {
  color: #fff;
  border-color: var(--line-soft);
  background: var(--glass);
  text-shadow: 0 0 12px rgba(255, 0, 255, 0.8);
}

/* ---------- 主区：左栏 + 正文 ---------- */
.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 18px 48px;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.rail {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  position: sticky;
  top: 132px;
  padding-top: 22px;
}

.rail-box {
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--pur);
  border-radius: 4px;
  background: var(--glass);
  backdrop-filter: blur(8px);
}

.rail-box--alt {
  border-left-color: var(--mag);
}

.rail-t {
  font-size: 16px;
  letter-spacing: 0.22em;
  margin: 0 0 10px;
  color: #fff;
}

.rail-t span {
  position: relative;
  display: inline-block;
  padding-bottom: 6px;
}

.rail-t span::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 22px;
  height: 2px;
  background: var(--mag);
  box-shadow: 0 0 10px var(--mag);
}

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

.rail-menu a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 2px;
  border-bottom: 1px dashed rgba(255, 0, 255, 0.16);
  color: var(--mut);
  font-size: 16px;
  line-height: 1.5;
  transition: color 0.18s, padding-left 0.18s;
}

.rail-menu li:last-child a {
  border-bottom: 0;
}

.rail-menu a:hover {
  color: #fff;
  padding-left: 6px;
  text-shadow: 0 0 12px rgba(255, 0, 255, 0.7);
}

.rail-p {
  margin: 0;
}

.rail-a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #ffd6ff;
  font-size: 16px;
}

.rail-a:hover {
  border-color: var(--mag);
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 0, 255, 0.4);
}

.doc {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 22px;
  min-height: 100vh;
  padding: clamp(26px, 7vh, 64px) 0 34px;
  text-align: right;
}

.hero-t {
  margin: 0;
  align-self: flex-end;
  max-width: 15ch;
  font-size: clamp(2.05rem, 5.6vw, 4.1rem);
  font-weight: 700;
  letter-spacing: 0.005em;
  color: #fff;
  text-shadow: 0 0 18px rgba(255, 0, 255, 0.8), 0 0 48px rgba(128, 0, 255, 0.6);
  animation: glitch 8s ease-in-out infinite;
}

@keyframes glitch {
  0%, 100% { transform: none; }
  44% { transform: skewX(-1.3deg) translateX(-2px); }
  48% { transform: skewX(1.3deg) translateX(2px); }
  52% { transform: none; }
}

.hero-img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 0 30px rgba(128, 0, 255, 0.35);
}

/* ---------- 正文卡片 ---------- */
.doc > section {
  position: relative;
  margin: 0 0 18px;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(128, 0, 255, 0.1), rgba(13, 13, 13, 0.35));
  backdrop-filter: blur(9px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.doc > section::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 14px;
  width: 46px;
  height: 1px;
  background: var(--mag);
  box-shadow: 0 0 10px var(--mag);
}

.doc > section.hero {
  border: 0;
  background: none;
  backdrop-filter: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.doc > section.hero::before {
  display: none;
}

section[id] {
  scroll-margin-top: 124px;
}

.doc h2 {
  color: #fff;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  text-shadow: 0 0 14px rgba(255, 0, 255, 0.55);
}

.doc h2 span,
.doc h3 span {
  position: relative;
  display: inline-block;
  padding-bottom: 5px;
}

.doc h2 span::after,
.doc h3 span::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--mag), rgba(128, 0, 255, 0));
  box-shadow: 0 0 12px rgba(255, 0, 255, 0.7);
}

.doc h3 {
  color: #f0e2ff;
  font-size: 16px;
  letter-spacing: 0.06em;
  margin-top: 1.6em;
}

.doc a {
  color: #ffb3ff;
  border-bottom: 1px solid rgba(255, 0, 255, 0.45);
}

.doc a:hover {
  color: #fff;
  border-bottom-color: var(--mag);
  text-shadow: 0 0 12px rgba(255, 0, 255, 0.8);
}

.doc ul,
.doc ol {
  padding-left: 1.25em;
  margin: 0 0 1em;
}

.doc li {
  margin-bottom: 0.4em;
}

.doc img {
  border: 1px solid var(--line);
  border-radius: 4px;
}

.doc blockquote {
  margin: 0 0 1em;
  padding: 10px 16px;
  border-left: 3px solid var(--mag);
  background: rgba(255, 0, 255, 0.07);
  color: #e8d9ff;
}

.doc strong {
  color: #fff;
}

/* ---------- 页脚 ---------- */
.foot {
  border-top: 1px solid var(--line);
  background: var(--ink-2);
  padding: 36px 0 18px;
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 18px;
}

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

.foot-col dt {
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 16px;
  letter-spacing: 0.2em;
  color: var(--mag);
  text-shadow: 0 0 12px rgba(255, 0, 255, 0.55);
  margin-bottom: 8px;
}

.foot-col dd {
  margin: 0;
}

.foot-col a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 0;
  color: var(--mut);
  font-size: 16px;
  line-height: 1.5;
}

.foot-col a:hover {
  color: #fff;
  text-shadow: 0 0 12px rgba(128, 0, 255, 0.9);
}

.foot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: var(--max);
  margin: 22px auto 0;
  padding: 14px 18px 0;
  border-top: 1px dashed rgba(255, 0, 255, 0.22);
}

.foot-bar p {
  margin: 0;
  font-size: 16px;
  color: #9d8cb6;
}

.to-top a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #ffd6ff;
  font-size: 16px;
}

.to-top a:hover {
  border-color: var(--mag);
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 0, 255, 0.4);
}

/* ---------- 动效 ---------- */
.js .doc > section {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js .doc > section.on {
  opacity: 1;
  transform: none;
}

/* ---------- 桌面：导航常开 ---------- */
@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .nav-details > .navmenu {
    display: flex;
    margin-top: 0;
  }

  .navwrap {
    padding-bottom: 8px;
    border-top: 1px dashed rgba(128, 0, 255, 0.25);
  }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 860px) {
  .shell {
    display: block;
    padding-bottom: 36px;
  }

  .rail {
    position: static;
    padding-top: 18px;
  }

  .hero {
    min-height: auto;
    padding-top: 28px;
  }

  .hero-t {
    font-size: clamp(1.9rem, 8.2vw, 2.6rem);
    max-width: 20ch;
  }

  .doc > section {
    padding: 22px 16px;
  }

  .foot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 420px) {
  .foot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .hero-t {
    animation: none;
  }

  .js .doc > section {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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