/* ==========================================
   SITE.CSS — 老司机污视界 共享样式基线
   深黑 #0D0D0F · 荧光紫 #D400FF
   电光蓝 #00E5FF · 酸性黄绿 #B6FF00
   ========================================== */

/* ---------- 变量 ---------- */
:root {
  --black: #0D0D0F;
  --ink: #1A1A1E;
  --purple: #D400FF;
  --blue: #00E5FF;
  --acid: #B6FF00;
  --paper: #F2E8D0;
  --silver: #C0C0C8;
  --dark-gray: #2A2A30;
  --font-head: "Noto Sans CJK Black", "Source Han Sans Heavy", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans CJK Regular", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Roboto Mono", "SFMono-Regular", Consolas, monospace;
  --header-h: 72px;
  --container-w: 1280px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --glow-purple: 0 0 10px rgba(212, 0, 255, .45), 0 0 32px rgba(212, 0, 255, .22);
  --glow-blue: 0 0 8px rgba(0, 229, 255, .45), 0 0 24px rgba(0, 229, 255, .2);
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  background: var(--black);
  color: var(--silver);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
  text-rendering: optimizeSpeed;
}

main { display: block; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }

::selection { background: var(--purple); color: #fff; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}

[hidden] { display: none !important; }

/* ---------- 布局基础 ---------- */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  position: relative;
  padding: 72px 0;
}
.section--tight { padding: 40px 0; }
.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 96px;
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--blue));
}

.page-body { padding: 40px 0 88px; }

.page-head {
  position: relative;
  padding: 64px 0 32px;
}
.page-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 160px;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--blue));
}
.page-head__title {
  font-family: var(--font-head);
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 900;
  line-height: 1.15;
  color: var(--paper);
  transform: skewX(-5deg);
}
.page-head__title em { font-style: normal; color: var(--purple); }
.page-head__lede {
  max-width: 680px;
  margin-top: 16px;
  font-size: 16px;
  color: var(--silver);
  line-height: 1.8;
}

.grid { display: grid; gap: 32px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.body-text {
  font-size: 16px;
  line-height: 1.9;
  color: var(--silver);
}
.body-text h2 {
  margin: 40px 0 12px;
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 900;
  color: var(--paper);
  transform: skewX(-5deg);
}
.body-text p { margin-bottom: 16px; }
.body-text a {
  color: var(--blue);
  border-bottom: 1px dashed var(--dark-gray);
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.body-text a:hover,
.body-text a:focus-visible {
  color: var(--purple);
  border-bottom-color: var(--purple);
}

/* ---------- 无障碍与滚动进度 ---------- */
.skip-link {
  position: fixed;
  top: -64px;
  left: 16px;
  z-index: 1300;
  padding: 10px 20px;
  background: var(--acid);
  color: var(--black);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  border-radius: 0 0 4px 4px;
  transition: top .3s var(--ease);
}
.skip-link:focus-visible { top: 0; }

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 1200;
  background: linear-gradient(90deg, var(--purple) 0%, var(--blue) 60%, var(--acid) 100%);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

#main-content { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ---------- 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--black);
  border-bottom: 1px solid var(--dark-gray);
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--purple) 0%, transparent 38%, transparent 62%, var(--blue) 100%);
  opacity: .65;
  pointer-events: none;
}
.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}

.site-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  flex-shrink: 0;
}
.site-brand__logo {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--purple);
  transform: skewX(-6deg);
  text-shadow: var(--glow-purple);
  white-space: nowrap;
}
.site-brand__meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .24em;
  color: var(--blue);
  transform: skewX(-6deg);
  text-shadow: 0 0 6px rgba(0, 229, 255, .5);
  white-space: nowrap;
}

.site-nav {
  height: 100%;
  flex-shrink: 0;
}
.site-nav__list {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 2px;
}
.site-nav__link {
  position: relative;
  display: inline-block;
  padding: 8px 12px;
  font-size: 14px;
  letter-spacing: .1em;
  color: var(--silver);
  white-space: nowrap;
  transition: color .3s var(--ease);
}
.site-nav__link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .3s var(--ease);
}
.site-nav__link:hover,
.site-nav__link:focus-visible { color: var(--blue); }
.site-nav__link:hover::after,
.site-nav__link:focus-visible::after { transform: scaleX(1); }
.site-nav__link[aria-current="page"] { color: var(--acid); }
.site-nav__link[aria-current="page"]::before {
  content: "//";
  margin-right: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--purple);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 10px 5px;
  border: 1px solid var(--dark-gray);
  border-radius: 3px;
  background: var(--ink);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.nav-toggle:hover,
.nav-toggle.is-active {
  border-color: var(--purple);
  box-shadow: 0 0 14px rgba(212, 0, 255, .25);
}
.nav-toggle__box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 20px;
  height: 16px;
}
.nav-toggle__line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--purple);
  transition: transform .3s var(--ease), opacity .2s var(--ease), background .3s var(--ease);
}
.nav-toggle.is-active .nav-toggle__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  background: var(--blue);
}
.nav-toggle.is-active .nav-toggle__line:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-active .nav-toggle__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  background: var(--blue);
}
.nav-toggle__text {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .2em;
  color: var(--silver);
  line-height: 1;
}

/* ---------- 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: 88px;
  padding-top: 64px;
  background: #0A0A0C;
  border-top: 1px solid var(--dark-gray);
  background-image:
    linear-gradient(rgba(212, 0, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, .035) 1px, transparent 1px);
  background-size: 48px 48px;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--purple) 0%, var(--blue) 55%, transparent 100%);
  pointer-events: none;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
}

.site-footer__brand .site-brand { margin-bottom: 16px; }
.site-footer__brand .site-brand__logo { font-size: 26px; }
.site-footer__tagline {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--blue);
  margin-bottom: 14px;
}
.site-footer__trust {
  font-size: 13px;
  line-height: 2;
  color: var(--silver);
  border-left: 2px solid var(--purple);
  padding-left: 14px;
  opacity: .9;
}

.footer-heading {
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--acid);
}
.footer-heading::before { content: "// "; color: var(--purple); }

.footer-list li { margin-bottom: 10px; }
.footer-list a {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  color: var(--silver);
  transition: color .3s var(--ease), padding-left .3s var(--ease);
}
.footer-list a::before {
  content: "›";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  color: var(--purple);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.footer-list a:hover,
.footer-list a:focus-visible {
  color: var(--blue);
  padding-left: 24px;
}
.footer-list a:hover::before,
.footer-list a:focus-visible::before { opacity: 1; }

.footer-notes li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--silver);
}
.footer-notes li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--purple);
}

.footer-rev {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--purple);
}
.footer-rev::before { content: "// "; color: var(--dark-gray); }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 18px 0 24px;
  border-top: 1px solid var(--dark-gray);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--silver);
}
.site-footer__icp::before { content: "ICP "; color: var(--purple); }

/* ---------- 按钮 / 标签 / 版本行 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border: 1px solid transparent;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .08em;
  transform: skewX(-5deg);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
}
.btn > * { transform: skewX(5deg); }
.btn--primary {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 0 16px rgba(212, 0, 255, .22);
}
.btn--primary:hover,
.btn--primary:focus-visible {
  box-shadow: 0 0 30px rgba(212, 0, 255, .45);
  transform: skewX(-5deg) translateY(-2px);
}
.btn--ghost {
  border-color: var(--dark-gray);
  color: var(--blue);
  background: transparent;
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 16px rgba(0, 229, 255, .18);
  transform: skewX(-5deg) translateY(-2px);
}

.tag {
  display: inline-block;
  position: relative;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  background: var(--acid);
  color: var(--black);
}
.tag::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 8px;
  height: 8px;
  background: var(--purple);
  pointer-events: none;
}
.tag--blue { background: var(--blue); color: var(--black); }
.tag--purple { background: var(--purple); color: #fff; }

.version-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--blue);
}
.version-line::before {
  content: "◆";
  font-size: 9px;
  color: var(--purple);
}

/* ---------- 章节标题 / 面包屑 ---------- */
.section-head { margin-bottom: 40px; }
.section-head__label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--blue);
}
.section-head__label::before {
  content: "";
  display: inline-block;
  width: 36px;
  height: 2px;
  background: var(--purple);
}
.section-head__title {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
  color: var(--paper);
  transform: skewX(-5deg);
  letter-spacing: .02em;
}
.section-head__title em { font-style: normal; color: var(--purple); }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--dark-gray);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--silver);
}
.breadcrumb a { color: var(--blue); transition: color .3s var(--ease); }
.breadcrumb a:hover,
.breadcrumb a:focus-visible { color: var(--purple); }
.breadcrumb__sep { color: var(--dark-gray); }
.breadcrumb__current { color: var(--acid); }

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  padding: 26px;
  background: var(--ink);
  border: 1px solid var(--dark-gray);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 30px;
  height: 30px;
  border-top: 2px solid var(--purple);
  border-left: 2px solid var(--purple);
  opacity: 0;
  transition: opacity .3s var(--ease);
  pointer-events: none;
}
.card:hover,
.card:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 26px rgba(212, 0, 255, .14);
  transform: translateY(-3px);
}
.card:hover::before,
.card:focus-within::before { opacity: 1; }
.card__title {
  margin-bottom: 8px;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 900;
  color: var(--paper);
}
.card__desc {
  font-size: 14px;
  line-height: 1.75;
  color: var(--silver);
}
.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* ---------- 图片容器 ---------- */
.img-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--ink);
  border: 1px solid var(--dark-gray);
  isolation: isolate;
}
.img-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: repeating-linear-gradient(0deg, rgba(13, 13, 15, .35) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.img-frame::after {
  content: "";
  position: absolute;
  right: -18%;
  bottom: -35%;
  width: 55%;
  height: 55%;
  z-index: 1;
  background: linear-gradient(135deg, transparent 42%, rgba(212, 0, 255, .22) 52%, transparent 64%);
  pointer-events: none;
}
.img-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.92) contrast(1.06);
  transition: transform .4s var(--ease), filter .4s var(--ease);
}
.img-frame:hover img,
.img-frame:focus-within img {
  transform: scale(1.04);
  filter: saturate(1.12) contrast(1.02);
}
.img-frame--wide { aspect-ratio: 16 / 9; }
.img-frame--tall { aspect-ratio: 3 / 4; }
.img-frame__capture {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--acid);
  background: rgba(13, 13, 15, .78);
  border: 1px solid var(--dark-gray);
  pointer-events: none;
}

/* ---------- 故障文字 / 堆叠面板 ---------- */
.glitch-text {
  position: relative;
  display: inline-block;
}
.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(0, 0);
  transition: opacity .2s var(--ease);
}
.glitch-text::before { color: var(--blue); }
.glitch-text::after { color: var(--purple); }
.glitch-text:hover::before,
.glitch-text:hover::after { opacity: .85; }
.glitch-text:hover::before { animation: glitch-a .45s steps(2, jump-none) 1; }
.glitch-text:hover::after { animation: glitch-b .55s steps(3, jump-none) 1; }
@keyframes glitch-a {
  0% { clip-path: inset(0 0 70% 0); transform: translate(-3px, -1px); }
  30% { clip-path: inset(30% 0 40% 0); transform: translate(3px, 0); }
  60% { clip-path: inset(60% 0 10% 0); transform: translate(-2px, 1px); }
  100% { clip-path: inset(80% 0 0 0); transform: translate(2px, 0); }
}
@keyframes glitch-b {
  0% { clip-path: inset(10% 0 60% 0); transform: translate(3px, 1px); }
  40% { clip-path: inset(50% 0 20% 0); transform: translate(-3px, 0); }
  70% { clip-path: inset(80% 0 0 0); transform: translate(2px, -1px); }
  100% { clip-path: inset(0 0 70% 0); transform: translate(-2px, 0); }
}

.panel-stack {
  display: flex;
  flex-direction: column;
  gap: 56px;
}
.panel-stack > * {
  position: relative;
  z-index: 1;
}
.panel-stack > *:nth-child(even) { transform: translateX(36px); }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .grid--3,
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 90;
    height: auto;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 10px 24px 22px;
    background: rgba(13, 13, 15, .98);
    border-top: 2px solid var(--purple);
    border-bottom: 2px solid var(--purple);
    box-shadow: 0 24px 48px rgba(0, 0, 0, .5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }
  .site-nav[data-open] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    gap: 0;
  }
  .site-nav__item { border-bottom: 1px solid var(--dark-gray); }
  .site-nav__item:last-child { border-bottom: 0; }
  .site-nav__link {
    display: block;
    width: 100%;
    padding: 14px 6px;
    font-size: 16px;
  }
  .site-nav__link::after { display: none; }
}

@media (max-width: 768px) {
  .site-footer__grid { grid-template-columns: 1fr; gap: 40px; }
  .site-footer { margin-top: 56px; padding-top: 44px; }
  .site-brand__meta { display: none; }
  .site-brand__logo { font-size: 18px; }
  .section { padding: 48px 0; }
  .panel-stack > *:nth-child(even) { transform: none; }
  .site-footer__bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: 1fr; }
}

/* ---------- 弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .scroll-progress { display: none; }
  .glitch-text::before,
  .glitch-text::after { display: none; }
}
