@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&family=Noto+Serif+TC:wght@400;500;600;700&display=swap');

:root {
  --red: #ff0000;
  --mag: #ff006e;
  --ink: #1a1a2e;
  --ink-2: #14141f;
  --ink-3: #0b0b14;
  --cyan: #00e5ff;
  --text: #ece7f5;
  --dim: #a29ac0;
  --line: rgba(255, 0, 110, 0.3);
  --line-soft: rgba(255, 0, 110, 0.16);
  --serif: 'Noto Serif TC', 'Songti SC', serif;
  --sans: 'Noto Sans TC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --r: 28px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.8;
  color: var(--text);
  background-color: var(--ink-3);
  background-image:
    radial-gradient(circle at 18% -6%, rgba(255, 0, 110, 0.22), transparent 52%),
    radial-gradient(circle at 88% 8%, rgba(255, 0, 0, 0.18), transparent 48%),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: auto, auto, 36px 36px, 36px 36px;
  background-attachment: fixed, fixed, fixed, fixed;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.32) 0 1px,
    rgba(0, 0, 0, 0) 1px 3px
  );
  opacity: 0.5;
}

a {
  color: #ff77a5;
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover { color: #ffffff; }

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.01em;
}

ol, ul { margin: 0; padding: 0; list-style: none; }

/* ---------- 顶部：品牌行 + 菜单行 ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 11, 20, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.brandrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 18px;
  border-bottom: 1px dashed var(--line-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: #fff;
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-shadow: 0 0 8px rgba(255, 0, 110, 0.85), 0 0 22px rgba(255, 0, 0, 0.45);
}

.brand .mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--mag);
  border-radius: 10px;
  color: var(--mag);
  font-size: 0.95rem;
  box-shadow: 0 0 12px rgba(255, 0, 110, 0.6) inset;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.totop {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: var(--dim);
  background: rgba(255, 0, 110, 0.07);
}

.totop:hover { color: #fff; border-color: var(--mag); }

.navrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 14px 8px;
}

.navlist {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

.navlist a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: 0.94rem;
  letter-spacing: 0.04em;
  border-bottom: 2px solid transparent;
}

.navlist a:hover,
.navlist a:focus-visible {
  color: #fff;
  background: rgba(255, 0, 110, 0.14);
  border-bottom-color: var(--red);
  box-shadow: 0 0 16px rgba(255, 0, 110, 0.35);
}

.pulldown { position: relative; flex: none; }

.pulldown summary {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #fff;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(180deg, rgba(255, 0, 110, 0.2), rgba(255, 0, 0, 0.12));
}

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

.pulldown-body {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 172px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(14, 14, 26, 0.98);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 0, 110, 0.2) inset;
}

.pulldown-body a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
}

.pulldown-body a:hover { background: rgba(255, 0, 110, 0.16); color: #fff; }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 45vh;
  padding: 40px 20px 0;
  text-align: center;
  overflow: hidden;
  border-bottom: 2px solid var(--line);
}

.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 120px;
  background: linear-gradient(to top, rgba(255, 0, 110, 0.16), transparent);
  pointer-events: none;
}

.badge {
  margin: 0;
  padding: 6px 18px;
  border: 1px solid var(--mag);
  border-radius: 999px;
  color: #ffd7e6;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  background: rgba(255, 0, 110, 0.12);
  box-shadow: 0 0 22px rgba(255, 0, 110, 0.45), 0 0 24px rgba(255, 0, 110, 0.3) inset;
  animation: float 5s ease-in-out infinite;
}

.hero-h1 {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(2rem, 6.4vw, 3.5rem);
  line-height: 1.24;
  color: #fff;
  text-shadow:
    0 0 6px rgba(255, 0, 110, 0.9),
    0 0 26px rgba(255, 0, 0, 0.7),
    3px 3px 0 rgba(255, 0, 110, 0.28);
  animation: glitch 7s steps(1) infinite;
}

.hero-fig {
  margin: 8px 0 0;
  width: min(100%, 880px);
  border: 2px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 0 0 6px rgba(255, 0, 110, 0.08), 0 26px 60px rgba(0, 0, 0, 0.65);
}

.hero-img { width: 100%; border-radius: calc(var(--r) - 4px); }

/* ---------- 主体：左栏 + 正文 ---------- */
.stage {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 20px 64px;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.rail {
  position: sticky;
  top: 132px;
  padding: 18px 16px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255, 0, 110, 0.14), rgba(255, 0, 110, 0.03));
  box-shadow: 0 0 0 1px rgba(255, 0, 110, 0.18) inset, 0 20px 46px rgba(0, 0, 0, 0.5);
}

.rail-h {
  margin: 0 0 4px;
  font-size: 1.16rem;
  color: #fff;
  letter-spacing: 0.16em;
  text-shadow: 0 0 12px rgba(255, 0, 110, 0.7);
}

.subtitle {
  margin: 0 0 14px;
  color: var(--dim);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
}

.toc { display: grid; gap: 2px; }

.toc a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 10px;
  border-left: 2px solid rgba(255, 0, 110, 0.35);
  border-radius: 0 10px 10px 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.toc a:hover {
  color: #fff;
  background: rgba(255, 0, 110, 0.16);
  border-left-color: var(--red);
}

.doc {
  min-width: 0;
  padding: 4px 2px 0;
}

.doc > div {
  padding: 10px 0 34px;
  border-bottom: 2px solid var(--line-soft);
}

.doc > div:last-child { border-bottom: 0; padding-bottom: 8px; }

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

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

.doc h3 {
  margin: 1.3em 0 0.3em;
  font-size: 1.14rem;
  color: #ffd7e6;
}

.doc p { margin: 0 0 1em; }

.doc p.subtitle,
.doc p.subhead,
.doc p.lead,
.doc p.desc {
  margin: -0.1em 0 1em;
  color: var(--dim);
  font-size: 0.92rem;
  letter-spacing: 0.05em;
}

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

.doc ul { list-style: square; }
.doc ol { list-style: decimal; }

.doc li { margin: 0.35em 0; }

.doc li::marker { color: var(--mag); }

.doc blockquote {
  margin: 0 0 1em;
  padding: 12px 18px;
  border-left: 3px solid var(--mag);
  border-radius: 0 18px 18px 0;
  background: rgba(255, 0, 110, 0.08);
  color: #f4eaf6;
}

.doc strong { color: #fff; }

.doc code {
  font-family: ui-monospace, 'Courier New', monospace;
  font-size: 0.92em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 0, 110, 0.16);
  color: #ffd7e6;
}

.doc figure { margin: 0 0 1.2em; }

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

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 0.95rem;
}

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

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

/* 底部强调线卡片感 */
.doc > div > *:not(h2):not(h3):not(p.subtitle) { max-width: 68ch; }

/* ---------- 页脚 ---------- */
.foot {
  border-top: 2px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 0, 110, 0.08), rgba(0, 0, 0, 0.55));
  padding: 34px 20px 26px;
  overflow: hidden;
}

.mega {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.2rem, 13vw, 7rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: rgba(255, 0, 110, 0.24);
  text-shadow: 0 0 30px rgba(255, 0, 110, 0.45);
  word-break: break-all;
}

.cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  max-width: 1180px;
  margin: 0 auto;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-soft);
}

.cols dl { margin: 0; }

.cols dt {
  margin-bottom: 10px;
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-shadow: 0 0 10px rgba(255, 0, 110, 0.6);
}

.cols dd {
  margin: 0 0 4px;
  color: var(--dim);
  font-size: 0.9rem;
  line-height: 1.7;
}

.cols dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 2px 2px;
  color: var(--text);
  border-bottom: 1px solid transparent;
}

.cols dd a:hover { color: #fff; border-bottom-color: var(--mag); }

.copy {
  max-width: 1180px;
  margin: 18px auto 0;
  text-align: center;
  color: #857ca3;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
}

/* ---------- 动效 ---------- */
@keyframes glitch {
  0%, 92%, 100% { transform: none; }
  93% { transform: skewX(-6deg) translateX(-2px); }
  94% { transform: skewX(5deg) translateX(2px); }
  96% { transform: translateY(-1px); }
  98% { transform: none; }
}

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

html.js .doc > div,
html.js .toc li,
html.js .cols > dl,
html.js .hero-fig {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.62s ease, transform 0.62s cubic-bezier(0.2, 0.7, 0.3, 1);
}

html.js .doc > div.in,
html.js .toc li.in,
html.js .cols > dl.in,
html.js .hero-fig.in {
  opacity: 1;
  transform: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding-top: 26px;
  }

  .rail {
    position: static;
    padding: 16px;
  }

  .toc {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 8px;
  }

  .cols { grid-template-columns: minmax(0, 1fr); gap: 18px; }

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

@media (max-width: 760px) {
  body { font-size: 16px; }

  .navrow { justify-content: flex-start; }

  .navlist {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .navlist::-webkit-scrollbar { display: none; }

  .pulldown { order: 2; margin-left: auto; }

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

  .hero-h1 { max-width: 18ch; }
}

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

  .brand { font-size: 1rem; letter-spacing: 0.03em; }

  .stage { padding-left: 16px; padding-right: 16px; }

  .foot { padding-left: 16px; padding-right: 16px; }
}

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

  .badge,
  .hero-h1 { animation: none; }

  html.js .doc > div,
  html.js .toc li,
  html.js .cols > dl,
  html.js .hero-fig {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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