@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Merriweather:wght@300;400;700&display=swap');

:root {
  --ink: #0d0d0d;
  --ink-2: #141018;
  --ink-3: #1c1426;
  --violet: #8000ff;
  --magenta: #ff00ff;
  --text: #ece6f5;
  --dim: #a99fb8;
  --line: rgba(128, 0, 255, 0.38);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Noto Sans Mono", monospace;
  --serif: "Abril Fatface", "Merriweather", "Songti SC", "Noto Serif SC", Georgia, serif;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--mono);
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.14;
  margin: 0;
}

a { color: #ff9bff; }

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

small {
  display: block;
  font-size: 16px;
  letter-spacing: 0.32em;
  color: var(--magenta);
  text-shadow: 0 0 12px rgba(255, 0, 255, 0.6);
  margin: 0 0 4px;
}

/* 顶栏 */
.hud {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 13, 13, 0.93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 16px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  color: #fff;
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  text-shadow: 0 0 14px rgba(255, 0, 255, 0.75);
}

.mark {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--violet), var(--magenta));
  color: #0d0d0d;
  font-size: 13px;
  line-height: 1;
  text-shadow: none;
  object-fit: contain;
}

.contact {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(128, 0, 255, 0.2);
  color: #efddff;
  text-decoration: none;
  font-size: 16px;
  letter-spacing: 0.1em;
}

.contact:hover { background: var(--violet); color: #fff; }

.menu-line {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2px 16px 10px;
}

.nav summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 0, 255, 0.14);
  color: #f4e6ff;
  letter-spacing: 0.2em;
  cursor: pointer;
  list-style: none;
  font-size: 16px;
}

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

.nav summary::after {
  content: "▾";
  color: var(--magenta);
  font-size: 14px;
}

.nav[open] summary::after { content: "▴"; }

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

.nav-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 16px;
  background: var(--ink-3);
  color: #ded3ee;
  text-decoration: none;
  font-size: 16px;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  background: var(--violet);
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.55);
}

/* 首屏 */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: #120a1c;
}

.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.3) contrast(1.18) brightness(0.72);
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(72% 72% at 50% 44%, rgba(128, 0, 255, 0.5), rgba(13, 13, 13, 0.15) 58%, rgba(13, 13, 13, 0.96) 100%),
    linear-gradient(180deg, rgba(13, 13, 13, 0.8), transparent 42%, rgba(13, 13, 13, 0.9));
}

.hero-text {
  max-width: 900px;
  padding: 0 20px;
  text-align: center;
}

.hero-text h1 {
  font-size: clamp(2rem, 8vw, 4.5rem);
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 0 16px rgba(255, 0, 255, 0.8), 0 0 52px rgba(128, 0, 255, 0.75);
  animation: glitch 8s infinite steps(1, end);
}

.hero-cue {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-top: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 0, 255, 0.65);
  color: #ffd6ff;
  text-decoration: none;
  font-size: 18px;
  box-shadow: 0 0 22px rgba(255, 0, 255, 0.35) inset;
}

.hero-cue:hover { background: rgba(255, 0, 255, 0.2); }

@keyframes glitch {
  0%, 90%, 100% { transform: none; }
  91% { transform: skewX(-2.5deg) translateX(-3px); }
  93% { transform: skewX(2deg) translateX(3px); }
  95% { transform: skewX(-1deg) translateX(-1px); }
  97% { transform: none; }
}

/* 主体骨架 */
.frame {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 16px 0;
}

.rail {
  background: var(--ink-2);
  border-radius: 28px;
  padding: 22px 18px;
  height: max-content;
}

.rail-title {
  font-size: 1.35rem;
  color: #fff;
  margin: 2px 0 14px;
  text-shadow: 0 0 16px rgba(128, 0, 255, 0.85);
}

.rail-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rail-menu a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--ink-3);
  color: #cbbddf;
  text-decoration: none;
  font-size: 16px;
}

.rail-menu a:hover { background: var(--magenta); color: #12001a; }

.main { min-width: 0; }

/* 正文 */
.post-body { display: block; }

.post-body article {
  background: var(--ink-2);
  border-radius: 28px;
  padding: 28px 20px;
  margin-bottom: 22px;
  scroll-margin-top: 150px;
}

.post-body article > h2,
.post-body article > h3 { margin-top: 0; }

.post-body h2 {
  font-size: clamp(1.5rem, 5vw, 2.05rem);
  color: #fff;
  margin: 0 0 14px;
  text-shadow: 0 0 20px rgba(128, 0, 255, 0.9);
}

.post-body h3 {
  font-size: 1.22rem;
  color: #ffd9ff;
  margin: 24px 0 10px;
}

.post-body p { margin: 0 0 16px; color: #ded6ea; }

.post-body ul,
.post-body ol { margin: 0 0 16px; padding-left: 22px; }

.post-body li { margin-bottom: 8px; }

.post-body strong { color: #fff; }

.post-body a { color: #ff9bff; }

.post-body blockquote {
  margin: 0 0 18px;
  padding: 12px 16px;
  background: var(--ink-3);
  border-left: 3px solid var(--magenta);
  border-radius: 18px;
  color: #e7daff;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  display: block;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  margin: 0 0 16px;
}

.post-body th,
.post-body td {
  padding: 9px 8px;
  text-align: left;
  border-bottom: 1px solid #2c2040;
}

.post-body code {
  font-family: var(--mono);
  font-size: 15px;
  background: #251a35;
  padding: 1px 6px;
  border-radius: 6px;
}

/* 页脚 */
.foot {
  max-width: 1180px;
  margin: 52px auto 0;
  padding: 30px 16px 34px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  border-top: 1px solid var(--line);
}

.foot-col {
  background: var(--ink-2);
  border-radius: 28px;
  padding: 20px 18px;
}

.foot-col h2 {
  font-size: 1.15rem;
  color: #fff;
  margin: 0 0 12px;
  text-shadow: 0 0 14px rgba(255, 0, 255, 0.6);
}

.foot-col menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.foot-col a {
  display: flex;
  align-items: center;
  min-height: 42px;
  color: #c9bcdd;
  text-decoration: none;
  font-size: 16px;
}

.foot-col a:hover { color: var(--magenta); }

.to-top { color: #efddff !important; }

.copy {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  padding-top: 12px;
  text-align: center;
  color: #8d81a3;
  font-size: 16px;
  letter-spacing: 0.1em;
}

/* 滚动显现 */
.rv { opacity: 0; transform: translateY(16px); }

.rv.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

@media (min-width: 640px) {
  .post-body article { padding: 34px 30px; }
  .foot { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .nav summary { display: none; }
  .menu-line { padding-bottom: 12px; }
}

@media (min-width: 980px) {
  .frame {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 40px;
    padding-top: 60px;
  }
  .rail { position: sticky; top: 132px; }
  .rail-menu { display: grid; gap: 4px; }
  .rail-menu a {
    border-radius: 14px;
    padding: 6px 10px;
    background: transparent;
    border-left: 2px solid rgba(128, 0, 255, 0.45);
  }
  .rail-menu a:hover { border-left-color: var(--magenta); }
  .post-body article { padding: 40px 36px; }
}

@media (min-width: 1000px) {
  .foot { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-text h1 { animation: none; }
  .rv { opacity: 1; transform: none; transition: none; }
}

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