@import url('https://fonts.googleapis.com/css2?family=Didact+Gothic&family=Poiret+One&display=swap');

:root {
  --red: #ff0000;
  --pink: #ff006e;
  --ink: #1a1a2e;
  --void: #0a0a14;
  --fg: #f6f1f8;
  --dim: rgba(246, 241, 248, 0.74);
  --faint: rgba(246, 241, 248, 0.55);
  --line: rgba(255, 0, 110, 0.28);
  --glow: rgba(255, 0, 110, 0.62);
  --deco: "Poiret One", "Didact Gothic", "PingFang SC", "Microsoft YaHei", sans-serif;
  --body: "Didact Gothic", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

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

body {
  margin: 0;
  background-color: var(--void);
  color: var(--fg);
  font: 400 17px/1.72 var(--body);
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 0, 110, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 0, 110, 0.075) 1px, transparent 1px),
    radial-gradient(circle at 18% 4%, rgba(255, 0, 110, 0.2), transparent 56%),
    radial-gradient(circle at 88% 12%, rgba(255, 0, 0, 0.14), transparent 48%);
  background-size: 46px 46px, 46px 46px, auto, auto;
  animation: gridDrift 22s linear infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.26) 0 1px, transparent 1px 4px);
  animation: flick 7s steps(60) infinite;
}

@keyframes gridDrift {
  to {
    background-position: 46px 46px, 46px 46px, 0 0, 0 0;
  }
}

@keyframes flick {
  0%, 100% { opacity: 0.85; }
  48% { opacity: 1; }
  52% { opacity: 0.78; }
  60% { opacity: 0.96; }
}

/* ---------- 左侧轨道 ---------- */

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px 18px 24px;
  background: rgba(10, 10, 20, 0.94);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  scrollbar-width: thin;
}

.brand {
  display: block;
  padding: 6px 4px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-family: var(--deco);
  font-size: 1.32rem;
  letter-spacing: 0.18em;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 0 14px var(--glow);
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 44px;
  padding: 11px 10px;
  border-radius: 18px;
  color: var(--dim);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, text-shadow 0.2s;
}

.rail-link .idx {
  font-family: var(--deco);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--red);
  text-shadow: 0 0 8px rgba(255, 0, 0, 0.7);
}

.rail-link:hover,
.rail-link:focus-visible {
  background: var(--ink);
  color: #fff;
  text-shadow: 0 0 12px var(--glow);
}

.rail-cta {
  display: block;
  margin-top: auto;
  padding: 14px 12px;
  min-height: 46px;
  border-radius: 18px;
  background: var(--pink);
  color: #0a0a14;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 0 24px rgba(255, 0, 110, 0.55);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.rail-cta:hover,
.rail-cta:focus-visible {
  background: var(--red);
  transform: translateY(-2px);
  box-shadow: 0 0 32px rgba(255, 0, 0, 0.7);
}

/* ---------- 主体 ---------- */

main {
  position: relative;
  z-index: 1;
  margin-left: 236px;
}

.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 26px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 28px 64px;
}

.post {
  border-radius: 18px;
  background: rgba(20, 20, 36, 0.76);
  overflow: hidden;
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 70vh;
  padding: 58px 26px 0;
  text-align: center;
  overflow: hidden;
}

.hero-ghost {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-62%);
  font-family: var(--deco);
  font-size: clamp(3.2rem, 14vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 0, 110, 0.5);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

.hero h1 {
  position: relative;
  margin: 0;
  max-width: 20em;
  font-family: var(--deco);
  font-weight: 400;
  font-size: clamp(1.85rem, 4.6vw, 3.1rem);
  line-height: 1.28;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow: 0 0 18px var(--glow), 0 0 44px rgba(255, 0, 0, 0.42);
  animation: glitch 8s steps(1) infinite;
}

@keyframes glitch {
  0%, 91%, 100% { transform: none; }
  92% { transform: translate(-2px, 0) skewX(-2deg); }
  94% { transform: translate(2px, -1px) skewX(1.6deg); }
  96% { transform: translate(-1px, 1px) skewX(-1deg); }
  98% { transform: translate(1px, 0) skewX(1deg); }
}

.hero-fig {
  margin: 0;
  width: 100%;
  max-width: 580px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 0 40px rgba(255, 0, 110, 0.32);
  animation: breathe 16s ease-in-out infinite alternate;
}

.hero-fig img,
.hero-img {
  display: block;
  width: 100%;
  height: auto;
}

@keyframes breathe {
  to { transform: scale(1.035); }
}

.post > h2 {
  margin: 36px 30px 12px;
  font-family: var(--deco);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: 0.16em;
  color: var(--pink);
  text-shadow: 0 0 16px var(--glow);
}

.post > hr {
  margin: 0 30px 26px;
  border: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), var(--pink), rgba(255, 0, 110, 0));
  box-shadow: 0 0 12px rgba(255, 0, 110, 0.5);
}

.body {
  padding: 0 30px 34px;
}

.body div {
  scroll-margin-top: 118px;
}

.body div + div {
  margin-top: 38px;
  padding-top: 34px;
  border-top: 1px solid rgba(255, 0, 110, 0.18);
}

.body h2,
.body h3 {
  font-family: var(--deco);
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--pink);
  text-shadow: 0 0 14px rgba(255, 0, 110, 0.5);
}

.body h2 {
  margin: 0 0 10px;
  font-size: 1.42rem;
  line-height: 1.4;
}

.body h3 {
  margin: 26px 0 8px;
  font-size: 1.12rem;
  color: var(--red);
}

.body h2 + hr,
.body h3 + hr {
  margin: 0 0 18px;
  border: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--pink), rgba(255, 0, 110, 0));
  box-shadow: 0 0 10px rgba(255, 0, 110, 0.45);
}

.body p {
  margin: 0 0 1.05em;
}

.body ul,
.body ol {
  margin: 0 0 1.1em;
  padding-left: 1.35em;
}

.body li {
  margin-bottom: 0.45em;
}

.body a {
  color: var(--red);
  text-underline-offset: 3px;
  text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.body a:hover {
  color: var(--pink);
}

.body img {
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  margin: 6px 0 14px;
}

.body strong {
  color: #fff;
}

.body blockquote {
  margin: 0 0 1.2em;
  padding: 16px 20px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--dim);
}

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

/* ---------- 侧栏 ---------- */

.side {
  position: sticky;
  top: 26px;
  display: grid;
  gap: 14px;
}

.side-title {
  margin: 0;
  font-family: var(--deco);
  font-size: 0.92rem;
  letter-spacing: 0.24em;
  color: var(--red);
  text-shadow: 0 0 12px rgba(255, 0, 0, 0.65);
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.side-list a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 13px 16px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--dim);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.side-list a:hover,
.side-list a:focus-visible {
  background: var(--pink);
  color: #0a0a14;
  box-shadow: 0 0 22px rgba(255, 0, 110, 0.6);
}

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

.foot {
  position: relative;
  z-index: 1;
  margin-left: 236px;
  padding: 0 28px 44px;
  display: grid;
  gap: 18px;
}

.foot-cta a {
  display: block;
  padding: 30px 16px;
  border-radius: 18px;
  background: var(--red);
  color: #0a0a14;
  font-family: var(--deco);
  font-size: clamp(1.55rem, 4vw, 2.5rem);
  letter-spacing: 0.22em;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 0 34px rgba(255, 0, 0, 0.45);
  transition: background 0.2s, box-shadow 0.2s;
}

.foot-cta a:hover,
.foot-cta a:focus-visible {
  background: var(--pink);
  box-shadow: 0 0 44px rgba(255, 0, 110, 0.7);
}

.foot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 18px;
  padding: 14px 4px 0;
  border-top: 1px solid var(--line);
}

.foot-mark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  font-family: var(--deco);
  letter-spacing: 0.16em;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 0 12px var(--glow);
}

.foot-nav {
  flex: 0 1 auto;
}

.foot-nav dl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
  margin: 0;
  padding: 0;
}

.foot-nav dt {
  margin: 0;
  font-family: var(--deco);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--red);
}

.foot-nav dd {
  margin: 0;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 5px;
  color: var(--dim);
  font-size: 0.86rem;
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}

.foot-nav a:hover,
.foot-nav a:focus-visible {
  color: #fff;
  text-shadow: 0 0 12px var(--glow);
}

.copy {
  flex: 1 1 100%;
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--faint);
}

/* ---------- 焦点 ---------- */

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

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

@media (max-width: 960px) {
  .rail {
    position: sticky;
    inset: auto;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
    background: rgba(10, 10, 20, 0.97);
  }

  .brand {
    padding: 8px 2px;
    margin: 0;
    border: 0;
    font-size: 1.02rem;
    letter-spacing: 0.14em;
  }

  .rail-nav {
    order: 3;
    flex: 1 1 100%;
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .rail-nav::-webkit-scrollbar {
    display: none;
  }

  .rail-link {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 11px 11px;
    border-radius: 14px;
    font-size: 0.86rem;
    white-space: nowrap;
  }

  .rail-cta {
    order: 2;
    margin: 0 0 0 auto;
    padding: 12px 15px;
    font-size: 0.85rem;
  }

  main,
  .foot {
    margin-left: 0;
  }

  .wrap {
    grid-template-columns: minmax(0, 1fr);
    padding: 18px 15px 44px;
    gap: 20px;
  }

  .side {
    position: static;
  }

  .hero {
    min-height: 58vh;
    padding: 40px 18px 0;
  }

  .post > h2 {
    margin: 28px 20px 10px;
  }

  .post > hr {
    margin: 0 20px 22px;
  }

  .body {
    padding: 0 20px 28px;
  }

  .body div {
    scroll-margin-top: 136px;
  }

  .foot {
    padding: 0 15px 36px;
  }

  .foot-cta a {
    padding: 24px 12px;
  }
}

@media (max-width: 420px) {
  .hero h1 {
    letter-spacing: 0.06em;
  }

  .foot-nav dl {
    gap: 2px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

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