/* ==========================================================================
   污视界 Site Kit — 共享样式 /assets/site.css
   结构：Reset / 变量 / 基础排版 / 通用组件 / 头部 / 导航 / 页脚 / 交互
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  background:
    linear-gradient(rgba(177, 75, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(177, 75, 255, 0.035) 1px, transparent 1px),
    radial-gradient(1100px 700px at 85% -10%, rgba(177, 75, 255, 0.14), transparent 60%),
    radial-gradient(800px 600px at 8% 15%, rgba(41, 230, 255, 0.08), transparent 50%),
    var(--bg-deep);
  background-size: 44px 44px, 44px 44px, auto, auto, auto;
  background-attachment: fixed, fixed, scroll, scroll, scroll;
}

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

a {
  color: var(--neon-cyan);
}

button {
  font: inherit;
}

::selection {
  background: rgba(177, 75, 255, 0.42);
  color: #fff;
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: #2a2a42;
  border: 2px solid var(--bg-deep);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-purple);
}

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

/* ---------- CSS Variables ---------- */
:root {
  --bg-void: #05050a;
  --bg-deep: #0a0a12;
  --bg-dark: #10101a;
  --bg-panel: #141422;
  --bg-card: #1b1b2e;
  --ink: #e9e7f2;
  --ink-soft: #b7b3cd;
  --ink-dim: #7a7694;
  --neon-purple: #b14bff;
  --neon-pink: #ff3da6;
  --neon-cyan: #29e6ff;
  --line-soft: rgba(177, 75, 255, 0.16);
  --line: rgba(177, 75, 255, 0.32);
  --shadow-glow: 0 0 32px rgba(177, 75, 255, 0.2);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
}

h1 {
  font-size: clamp(32px, 5vw, 52px);
}

h2 {
  font-size: clamp(24px, 3.6vw, 36px);
}

h3 {
  font-size: 20px;
}

h4 {
  font-size: 16px;
}

.text-glow {
  background: linear-gradient(92deg, #ffffff 20%, var(--neon-purple) 55%, var(--neon-cyan) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Layout Helpers ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-right: 24px;
  padding-left: 24px;
}

.section {
  padding: 64px 0;
}

.section-head {
  margin-bottom: 32px;
}

.section-head h1,
.section-head h2 {
  margin-top: 8px;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.bento-grid > * {
  grid-column: span 4;
}

/* ---------- Skip Link ---------- */
.skip-link {
  position: fixed;
  top: -72px;
  left: 16px;
  z-index: 2000;
  display: inline-block;
  padding: 10px 20px;
  background: var(--neon-purple);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border-left: 4px solid var(--neon-cyan);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

#main-content {
  outline: none;
}

/* ---------- Screen Reader Only ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: color 0.24s, border-color 0.24s, box-shadow 0.24s, filter 0.24s;
  position: relative;
}

.btn::before {
  content: "●";
  font-size: 8px;
  color: var(--neon-purple);
  transition: color 0.24s;
}

.btn:hover {
  border-color: var(--neon-purple);
  box-shadow: 0 0 20px rgba(177, 75, 255, 0.2), inset 0 0 12px rgba(177, 75, 255, 0.08);
  color: #fff;
}

.btn:hover::before {
  color: var(--neon-cyan);
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  border: none;
  color: #fff;
  box-shadow: 0 4px 24px rgba(255, 61, 166, 0.28);
}

.btn-primary::before {
  color: rgba(255, 255, 255, 0.72);
}

.btn-primary:hover {
  filter: brightness(1.14);
  color: #fff;
  box-shadow: 0 8px 32px rgba(255, 61, 166, 0.42);
}

.btn-ghost {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.btn-ghost::before {
  content: "▹";
  font-size: 14px;
  color: var(--neon-cyan);
}

.btn-ghost:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(41, 230, 255, 0.18);
}

/* ---------- Section Kicker ---------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--neon-cyan);
}

.kicker::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  flex: none;
}

/* ---------- Card ---------- */
.card {
  position: relative;
  padding: 28px;
  background: linear-gradient(160deg, var(--bg-panel), rgba(20, 20, 34, 0.6));
  border: 1px solid var(--line-soft);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 28px;
  height: 28px;
  border-top: 2px solid var(--neon-purple);
  border-left: 2px solid var(--neon-purple);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--line);
  box-shadow: var(--shadow-glow);
}

.card-title {
  font-size: 18px;
  margin-bottom: 10px;
}

.card-body {
  font-size: 14px;
  color: var(--ink-dim);
  line-height: 1.8;
}

/* ---------- Tag ---------- */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--neon-pink);
  background: rgba(255, 61, 166, 0.06);
  border: 1px solid rgba(255, 61, 166, 0.35);
  padding: 2px 10px;
  margin-right: 6px;
  margin-bottom: 6px;
}

/* ---------- Divider ---------- */
.divider {
  height: 1px;
  border: none;
  margin: 48px 0;
  background: linear-gradient(90deg, transparent, rgba(177, 75, 255, 0.5), rgba(41, 230, 255, 0.4), transparent);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-dim);
}

.breadcrumb a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--neon-cyan);
}

.breadcrumb-item[aria-current="page"] {
  color: var(--neon-cyan);
}

.breadcrumb-sep {
  color: var(--neon-purple);
  pointer-events: none;
}

/* ---------- Prose ---------- */
.prose {
  max-width: 72ch;
  font-size: 15px;
  line-height: 1.95;
  color: var(--ink-soft);
}

.prose p {
  margin-bottom: 1.4em;
}

.prose h2,
.prose h3 {
  color: var(--ink);
  margin: 1.6em 0 0.6em;
}

.prose h2:first-child,
.prose h3:first-child {
  margin-top: 0;
}

.prose a {
  color: var(--neon-cyan);
  text-underline-offset: 4px;
}

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

.prose ul,
.prose ol {
  padding-left: 1.4em;
  margin-bottom: 1.4em;
}

.prose li {
  margin-bottom: 0.4em;
}

/* ---------- Image Frame ---------- */
.img-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, rgba(177, 75, 255, 0.16), transparent 40%, rgba(41, 230, 255, 0.1)),
    var(--bg-panel);
  border: 1px solid var(--line-soft);
}

.img-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, 0.14) 3px 4px);
  mix-blend-mode: overlay;
}

.img-frame[data-caption]::before {
  content: attr(data-caption);
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--neon-cyan);
  background: rgba(10, 10, 18, 0.78);
  border-left: 2px solid var(--neon-cyan);
}

.img-frame.is-16x9 {
  aspect-ratio: 16 / 9;
}

.img-frame.is-1x1 {
  aspect-ratio: 1 / 1;
}

.img-frame.is-portrait {
  aspect-ratio: 3 / 4;
}

/* ---------- Skill Path ---------- */
.path {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.path-step {
  position: relative;
  min-height: 64px;
  padding: 0 0 32px 64px;
}

.path-step:last-child {
  padding-bottom: 0;
}

.path-step::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 4px;
  bottom: -12px;
  width: 1px;
  background: linear-gradient(var(--neon-purple), rgba(177, 75, 255, 0.08));
}

.path-step:last-child::before {
  display: none;
}

.path-step::after {
  content: attr(data-index);
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--neon-cyan);
  background: var(--bg-panel);
  border: 1px solid var(--line);
}

.path-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.path-note {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-dim);
}

/* ---------- Expandable Group ---------- */
.qitem {
  border: 1px solid var(--line-soft);
  background: rgba(20, 20, 34, 0.5);
  margin-bottom: 12px;
  transition: border-color 0.24s, box-shadow 0.24s;
}

.qitem[open] {
  border-color: var(--line);
  box-shadow: 0 0 20px rgba(177, 75, 255, 0.1);
}

.qitem summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

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

.qitem summary::after {
  content: "+";
  flex: none;
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
  color: var(--neon-cyan);
  transition: transform 0.24s;
}

.qitem[open] summary::after {
  content: "−";
}

.qitem-body {
  padding: 0 20px 18px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-dim);
}

/* ---------- Header ---------- */
.site-header-wrap {
  position: sticky;
  top: 0;
  z-index: 800;
  background: rgba(10, 10, 18, 0.84);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-purple), var(--neon-cyan), transparent);
  opacity: 0.55;
  pointer-events: none;
}

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 62px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.brand-glyph {
  display: block;
  width: 22px;
  height: 22px;
  flex: none;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow: 0 0 14px rgba(177, 75, 255, 0.55);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-cn {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.brand-en {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--ink-dim);
}

/* ---------- Navigation ---------- */
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  counter-reset: navIdx;
}

.nav-link {
  counter-increment: navIdx;
  position: relative;
  padding: 10px 14px;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link::before {
  content: "[" counter(navIdx, decimal-leading-zero) "]";
  margin-right: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--neon-purple);
  transition: color 0.2s;
}

.nav-link:hover {
  color: #fff;
}

.nav-link:hover::before {
  color: var(--neon-pink);
}

.nav-link[aria-current="page"] {
  color: var(--neon-cyan);
}

.nav-link[aria-current="page"]::before {
  color: var(--neon-cyan);
}

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
}

/* ---------- Nav Toggle ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--line-soft);
  cursor: pointer;
  transition: border-color 0.24s;
}

.nav-toggle:hover {
  border-color: var(--neon-purple);
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  background: var(--neon-cyan);
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.is-active .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-active .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-active .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  margin-top: 96px;
  background:
    radial-gradient(800px 400px at 20% 0%, rgba(177, 75, 255, 0.1), transparent 60%),
    var(--bg-void);
  border-top: 1px solid var(--line-soft);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-purple), var(--neon-pink), transparent);
  opacity: 0.5;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 32px;
  padding: 56px 0 40px;
}

.footer-brand .brand {
  margin-bottom: 4px;
}

.brand-footer .brand-glyph {
  width: 24px;
  height: 24px;
}

.footer-tagline {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
}

.footer-title {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--neon-purple);
}

.footer-nav a,
.footer-legal a {
  display: block;
  padding: 2px 0;
  font-size: 14px;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.2s, padding-left 0.2s;
}

.footer-nav a:hover,
.footer-legal a:hover {
  color: var(--neon-cyan);
  padding-left: 4px;
}

.footer-contact span {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  color: var(--ink-dim);
}

.footer-note {
  margin-top: 14px;
  padding-left: 12px;
  border-left: 2px solid var(--neon-purple);
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-dim);
}

.footer-bottom {
  border-top: 1px solid rgba(177, 75, 255, 0.12);
}

.footer-bottom-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 16px;
  padding-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
}

.footer-icp {
  color: var(--ink-dim);
}

/* ---------- Progress Bar ---------- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  z-index: 1500;
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-pink), var(--neon-cyan));
  box-shadow: 0 0 12px rgba(41, 230, 255, 0.6);
  pointer-events: none;
}

/* ---------- Back to Top ---------- */
.top-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1300;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--neon-cyan);
  background: rgba(10, 10, 18, 0.86);
  border: 1px solid var(--line);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.top-btn:hover {
  color: #fff;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(41, 230, 255, 0.3);
}

.top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* ---------- Scroll Reveal ---------- */
html.has-js [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

html.has-js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (min-width: 768px) and (max-width: 1099px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento-grid > * {
    grid-column: span 6;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 767px) {
  body {
    background-attachment: scroll;
  }

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

  .section {
    padding: 48px 0;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .bento-grid > * {
    grid-column: 1 / -1;
  }

  .nav-toggle {
    display: flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - 62px);
    overflow-y: auto;
    padding: 8px 0 16px;
    background: rgba(10, 10, 18, 0.96);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  }

  .site-header[data-open] .nav {
    display: flex;
  }

  .nav-link {
    padding: 12px 24px;
    font-size: 15px;
    border-left: 3px solid transparent;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link[aria-current="page"] {
    border-left-color: var(--neon-cyan);
  }

  body.nav-open {
    overflow: hidden;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    padding-top: 40px;
  }

  .footer-bottom-inner {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 479px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html.has-js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .card:hover {
    transform: none;
  }

  .top-btn {
    transition: none;
  }
}
