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

:root {
  --lime: #87ff71;
  --cyan: #01cdfe;
  --ink: #192617;
  --bg: #0a110c;
  --text: #e8f6e3;
  --mut: #9cb598;
  --line: rgba(135, 255, 113, 0.2);
  --panel: rgba(17, 29, 20, 0.86);
  --shadow: 0 20px 44px rgba(0, 0, 0, 0.5);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Cabin", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(90% 60% at 88% -12%, rgba(255, 113, 206, 0.42), transparent 62%),
    radial-gradient(70% 55% at 6% 112%, rgba(1, 205, 254, 0.3), transparent 62%),
    linear-gradient(180deg, rgba(255, 113, 206, 0.16), rgba(1, 205, 254, 0.13) 48%, rgba(185, 103, 255, 0.18) 100%),
    var(--bg);
}

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

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

img,
svg,
video,
iframe,
table,
pre {
  max-width: 100%;
}

img {
  height: auto;
  display: block;
}

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

/* ---------- 左侧竖排栏 ---------- */

.rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 156px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 14px 26px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 17, 12, 0.94), rgba(10, 17, 12, 0.72));
  backdrop-filter: blur(8px);
}

.mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--lime);
  font-size: 22px;
  font-weight: 700;
  background: rgba(135, 255, 113, 0.07);
  box-shadow: 0 0 18px rgba(135, 255, 113, 0.16) inset;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.mark img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.mark:hover,
.mark:focus-visible {
  border-color: var(--cyan);
  box-shadow: 0 0 22px rgba(1, 205, 254, 0.45);
  transform: translateY(-2px);
}

.rail-menu summary {
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 6px;
  font-size: 16px;
  letter-spacing: 0.22em;
  color: var(--mut);
  border-bottom: 1px solid var(--line);
  user-select: none;
}

.rail-menu summary::-webkit-details-marker {
  display: none;
}

.rail-menu summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.25s;
}

.rail-menu[open] summary::after {
  transform: rotate(-135deg) translateY(-2px);
}

.rail-menu summary:hover,
.rail-menu summary:focus-visible {
  color: var(--lime);
}

.rail-menu menu {
  display: grid;
  gap: 2px;
  padding-top: 10px;
}

.rail-menu a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 8px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--text);
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  transition: color 0.18s, background 0.18s, border-color 0.18s, transform 0.18s;
}

.rail-menu a:hover,
.rail-menu a:focus-visible,
.rail-menu a.on {
  color: var(--lime);
  border-left-color: var(--lime);
  background: rgba(135, 255, 113, 0.08);
  transform: translateX(3px);
  text-shadow: 0 0 12px rgba(135, 255, 113, 0.5);
}

/* ---------- 主区 ---------- */

main {
  margin-left: 156px;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 38px 30px 56px;
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.board,
.side,
.sheet {
  min-width: 0;
}

.side {
  position: sticky;
  top: 22px;
  padding: 20px 16px 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 38, 26, 0.82), rgba(12, 20, 14, 0.72));
  box-shadow: var(--shadow);
}

.side-t {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  color: var(--lime);
  text-shadow: 0 0 14px rgba(135, 255, 113, 0.4);
}

.side hr {
  margin: 12px 0 10px;
}

.side-nav menu {
  display: grid;
  gap: 1px;
}

.side-nav li {
  animation: rise 0.5s both;
}

.side-nav li:nth-child(1) { animation-delay: 0.03s; }
.side-nav li:nth-child(2) { animation-delay: 0.07s; }
.side-nav li:nth-child(3) { animation-delay: 0.11s; }
.side-nav li:nth-child(4) { animation-delay: 0.15s; }
.side-nav li:nth-child(5) { animation-delay: 0.19s; }
.side-nav li:nth-child(6) { animation-delay: 0.23s; }
.side-nav li:nth-child(7) { animation-delay: 0.27s; }

.side-nav a {
  display: block;
  min-height: 40px;
  padding: 8px 6px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--mut);
  border-bottom: 1px dashed rgba(135, 255, 113, 0.14);
  transition: color 0.18s, padding-left 0.18s;
}

.side-nav a:hover,
.side-nav a:focus-visible,
.side-nav a.on {
  color: var(--cyan);
  padding-left: 12px;
  text-shadow: 0 0 10px rgba(1, 205, 254, 0.55);
}

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

/* ---------- 正文纸面 ---------- */

.sheet {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overflow-wrap: break-word;
  padding: 30px 32px 40px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), rgba(11, 19, 13, 0.9));
  box-shadow: var(--shadow), 0 0 0 1px rgba(1, 205, 254, 0.06) inset;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  min-height: 70vh;
  text-align: right;
  padding: 3vh 0 26px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  position: relative;
  margin: 0;
  max-width: 24ch;
  font-family: "Amatic SC", "Cabin", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(2.3rem, 5.6vw, 4.4rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.03em;
  color: #f4fff0;
  text-shadow: 0 0 14px rgba(1, 205, 254, 0.55), 0 0 34px rgba(255, 113, 206, 0.35);
  animation: pulseGlow 6s ease-in-out infinite;
}

.hero h1::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--cyan);
  opacity: 0.55;
  clip-path: inset(0 0 58% 0);
  animation: glitch 7s steps(1) infinite;
  pointer-events: none;
}

@keyframes pulseGlow {
  0%, 100% {
    text-shadow: 0 0 14px rgba(1, 205, 254, 0.5), 0 0 30px rgba(255, 113, 206, 0.28);
  }
  50% {
    text-shadow: 0 0 20px rgba(135, 255, 113, 0.6), 0 0 42px rgba(255, 113, 206, 0.4);
  }
}

@keyframes glitch {
  0%, 88%, 100% {
    transform: none;
    opacity: 0.45;
  }
  90% {
    transform: translate(-3px, 1px);
    opacity: 0.7;
  }
  92% {
    transform: translate(3px, -2px);
    opacity: 0.35;
  }
  94% {
    transform: translate(-2px, 2px);
    opacity: 0.6;
  }
}

.lede {
  margin: 0;
  max-width: 48ch;
  font-size: 17px;
  line-height: 1.85;
  color: var(--mut);
}

.hero-fig {
  margin: 6px 0 0;
  width: 100%;
}

.hero-fig .hero-img {
  width: 100%;
  max-height: 42vh;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.sheet div {
  padding: 28px 0 10px;
  scroll-margin-top: 34px;
}

.sheet [id] {
  scroll-margin-top: 34px;
}

.sheet div + div {
  border-top: 1px dashed rgba(135, 255, 113, 0.14);
}

.sheet h2 {
  margin: 0 0 6px;
  font-family: "Amatic SC", "Cabin", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: 0.04em;
  color: #f2ffed;
  text-shadow: 0 0 12px rgba(135, 255, 113, 0.35);
}

.sheet h3 {
  margin: 24px 0 6px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--lime);
  letter-spacing: 0.02em;
}

.sheet p {
  margin: 0 0 16px;
}

.sheet h2 + p,
.sheet hr + p {
  margin-top: 4px;
}

.sheet ul,
.sheet ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.sheet li {
  margin: 0 0 8px;
}

.sheet li::marker {
  color: var(--cyan);
}

.sheet strong {
  color: var(--lime);
  font-weight: 600;
}

.sheet a {
  color: var(--cyan);
  border-bottom: 1px solid rgba(1, 205, 254, 0.35);
  transition: color 0.18s, border-color 0.18s, text-shadow 0.18s;
}

.sheet a:hover,
.sheet a:focus-visible {
  color: var(--lime);
  border-color: var(--lime);
  text-shadow: 0 0 10px rgba(135, 255, 113, 0.5);
}

.sheet blockquote {
  margin: 0 0 18px;
  padding: 12px 18px;
  border-left: 3px solid var(--cyan);
  background: rgba(1, 205, 254, 0.07);
  border-radius: 0 12px 12px 0;
  color: #d6ecd2;
}

.sheet pre {
  margin: 0 0 18px;
  padding: 12px 14px;
  overflow-x: auto;
  border-radius: 12px;
  background: rgba(1, 205, 254, 0.08);
  border: 1px solid rgba(1, 205, 254, 0.22);
}

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

.sheet th,
.sheet td {
  padding: 10px 12px;
  border: 1px solid rgba(135, 255, 113, 0.16);
  text-align: left;
  overflow-wrap: break-word;
}

.sheet th {
  background: rgba(135, 255, 113, 0.09);
  color: var(--lime);
}

hr {
  height: 1px;
  border: 0;
  margin: 10px 0 20px;
  background: linear-gradient(90deg, var(--lime), var(--cyan) 45%, transparent);
  opacity: 0.7;
}

/* ---------- 页脚 ---------- */

footer {
  margin-left: 156px;
  border-top: 1px solid var(--line);
  background: rgba(10, 17, 12, 0.7);
}

.foot-in {
  max-width: 1160px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 20px;
  font-size: 16px;
  color: var(--mut);
}

.foot-mark {
  color: var(--lime);
  letter-spacing: 0.06em;
  text-shadow: 0 0 12px rgba(135, 255, 113, 0.4);
}

.foot-in nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 4px;
  min-width: 0;
}

.foot-in nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 9px;
  color: var(--text);
  border-radius: 8px;
  transition: color 0.18s, background 0.18s;
}

.foot-in nav a:hover,
.foot-in nav a:focus-visible,
.foot-in nav a.on {
  color: var(--cyan);
  background: rgba(1, 205, 254, 0.1);
}

.copy {
  margin: 0;
  color: var(--mut);
}

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

/* ---------- 窄屏 ---------- */

@media (max-width: 960px) {
  .rail {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    bottom: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mark {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
  }

  .rail-menu {
    flex: 0 0 auto;
    min-width: 0;
  }

  .rail-menu summary {
    border-bottom: 0;
    padding: 10px 12px;
    letter-spacing: 0.12em;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .rail-menu[open] menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2px;
    padding: 10px 12px 14px;
    background: #0d1610;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 22px 40px rgba(0, 0, 0, 0.6);
  }

  .rail-menu a {
    min-height: 44px;
  }

  main,
  footer {
    margin-left: 0;
  }

  .wrap {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px 14px 40px;
    gap: 22px;
  }

  .board {
    order: 1;
  }

  .side {
    position: static;
    order: 2;
  }

  .side-nav a:hover,
  .side-nav a:focus-visible,
  .side-nav a.on {
    padding-left: 8px;
  }

  .sheet {
    padding: 20px 18px 28px;
    overflow-x: auto;
  }

  .sheet table {
    display: block;
    overflow-x: auto;
    white-space: normal;
  }

  .hero {
    min-height: 0;
    padding-top: 6px;
    gap: 14px;
  }

  .hero h1 {
    font-size: clamp(2rem, 9vw, 2.9rem);
  }

  .hero-fig .hero-img {
    max-height: 34vh;
  }

  .sheet div {
    scroll-margin-top: 82px;
  }

  .sheet [id] {
    scroll-margin-top: 82px;
  }
}

@media (max-width: 420px) {
  .foot-in {
    gap: 4px 10px;
  }

  .foot-in nav a {
    padding: 8px 7px;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

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