@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 {
  --green: #87ff71;
  --blue: #01cdfe;
  --dark: #192617;
  --dark2: #0f1a0e;
  --dark3: #1e3020;
  --purple: #b967ff;
  --pink: #ff71ce;
  --text: #d4f5d0;
  --text-muted: #8fb88b;
  --radius-pill: 999px;
  --radius-card: 4px;
  --nav-h: 64px;
  --search-h: 44px;
  --header-h: calc(var(--nav-h) + var(--search-h));
  --font-serif: 'Noto Serif TC', 'Georgia', serif;
  --font-sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --glow-green: 0 0 8px #87ff71, 0 0 20px #87ff7166;
  --glow-blue: 0 0 8px #01cdfe, 0 0 20px #01cdfe66;
  --glow-purple: 0 0 8px #b967ff, 0 0 20px #b967ff66;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body.vaporwave-body {
  background-color: var(--dark);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── 扫描线与网格背景 ── */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  mix-blend-mode: multiply;
}

.grid-bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.grid-bg::before {
  content: '';
  display: block;
  position: absolute;
  bottom: 0;
  left: -50%;
  width: 200%;
  height: 60vh;
  background-image:
    linear-gradient(rgba(1, 205, 254, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(1, 205, 254, 0.15) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: rotateX(55deg);
  transform-origin: bottom center;
  mask-image: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 80%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 80%);
}

/* ── 辅助 ── */
.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;
}

/* ── 顶部导航 ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 26, 14, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(135, 255, 113, 0.2);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  gap: 0.5rem;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  flex-wrap: wrap;
  min-width: 0;
}

.nav-list.nav-right {
  justify-content: flex-end;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(135, 255, 113, 0.3);
  color: var(--green);
  text-decoration: none;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition);
  line-height: 1;
}

.nav-pill:hover,
.nav-pill:focus-visible {
  background: rgba(135, 255, 113, 0.12);
  border-color: var(--green);
  box-shadow: var(--glow-green);
  color: #fff;
  outline: none;
}

.brand-center {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0 0.5rem;
}

.brand-logo {
  height: 40px;
  width: auto;
}

.brand-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
  text-shadow: var(--glow-green);
  white-space: nowrap;
  letter-spacing: 0.04em;
  display: inline-block;
  padding: 0.5rem 0.25rem;
  min-height: 40px;
  line-height: 40px;
}

.header-search {
  display: flex;
  justify-content: center;
  height: var(--search-h);
  align-items: center;
  padding-bottom: 0.5rem;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(1, 205, 254, 0.07);
  border: 1px solid rgba(1, 205, 254, 0.3);
  border-radius: var(--radius-pill);
  padding: 0 0.7rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  max-width: 100%;
  width: min(320px, 100%);
}

.search-form:focus-within {
  border-color: var(--blue);
  box-shadow: var(--glow-blue);
}

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  width: 100%;
  height: 36px;
  caret-color: var(--blue);
  min-width: 0;
}

.search-input::placeholder { color: var(--text-muted); }

.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-height: 40px;
  min-width: 32px;
  transition: color var(--transition);
  flex-shrink: 0;
}

.search-btn:hover { color: var(--green); }

/* scroll-margin for sections */
div[id] {
  scroll-margin-top: calc(var(--header-h) + 12px);
}

/* ── Hero ── */
.hero-band {
  position: relative;
  z-index: 1;
  min-height: 45vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #0f1a0e 0%, #1a0e2a 50%, #0e1a24 100%);
  border-bottom: 1px solid rgba(185, 103, 255, 0.3);
  overflow: hidden;
  animation: hueShift 12s linear infinite alternate;
}

.hero-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 20% 50%, rgba(135, 255, 113, 0.08) 0%, transparent 70%),
              radial-gradient(ellipse 50% 70% at 80% 50%, rgba(1, 205, 254, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-media {
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(1, 205, 254, 0.2);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-media--placeholder {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #0e1a24 0%, #1a0e2a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-glow-orb {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(185, 103, 255, 0.5) 0%, rgba(1, 205, 254, 0.2) 50%, transparent 70%);
  animation: orbPulse 3s ease-in-out infinite;
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
}

.hero-copy {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}

.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--blue);
  text-shadow: var(--glow-blue);
}

.hero-h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--green);
  text-shadow: var(--glow-green);
  max-width: 480px;
  animation: glitch 6s ease-in-out infinite;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 360px;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.75rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--green), var(--blue));
  color: var(--dark);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: opacity var(--transition), box-shadow var(--transition);
  box-shadow: 0 0 16px rgba(135, 255, 113, 0.4);
}

.hero-cta:hover, .hero-cta:focus-visible {
  opacity: 0.88;
  box-shadow: 0 0 30px rgba(135, 255, 113, 0.6);
  outline: none;
}

/* ── 主体 ── */
.site-main {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1rem 3rem;
}

.main-article {
  width: 100%;
}

.content-section {
  width: 100%;
}

.content-with-aside {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2rem;
  align-items: start;
}

.content-body {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
  min-width: 0;
}

/* ── 正文排版 ── */
.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4 {
  font-family: var(--font-serif);
  color: var(--green);
  text-shadow: 0 0 6px rgba(135, 255, 113, 0.4);
  line-height: 1.3;
  margin: 2rem 0 0.75rem;
}

.content-body h2 { font-size: 1.4rem; }
.content-body h3 { font-size: 1.15rem; color: var(--blue); text-shadow: 0 0 6px rgba(1, 205, 254, 0.4); }
.content-body h4 { font-size: 1rem; }

.content-body p { margin-bottom: 1.2rem; }

.content-body a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

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

.content-body ul, .content-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.2rem;
}

.content-body li { margin-bottom: 0.4rem; }

.content-body div {
  padding: 2.5rem 0;
  border-bottom: 1px solid rgba(135, 255, 113, 0.12);
}

.content-body div:last-child { border-bottom: none; }

/* h2 + subtitle pattern */
.content-body h2 + .subtitle,
.content-body h2 + p.subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

/* ── aside ── */
.main-aside {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.aside-block {
  background: rgba(1, 205, 254, 0.05);
  border: 1px solid rgba(1, 205, 254, 0.2);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  transition: border-color var(--transition);
}

.aside-block:hover { border-color: rgba(1, 205, 254, 0.45); }

.aside-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--green);
  text-shadow: 0 0 6px rgba(135, 255, 113, 0.35);
  margin-bottom: 0.25rem;
}

.aside-block .subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  display: block;
}

.aside-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.aside-link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.aside-link:hover, .aside-link:focus-visible {
  color: var(--blue);
  border-color: rgba(1, 205, 254, 0.4);
  background: rgba(1, 205, 254, 0.07);
  outline: none;
}

.aside-notice { background: rgba(185, 103, 255, 0.05); border-color: rgba(185, 103, 255, 0.2); }
.aside-notice:hover { border-color: rgba(185, 103, 255, 0.45); }
.aside-notice .aside-title { color: var(--purple); text-shadow: 0 0 6px rgba(185, 103, 255, 0.35); }

.aside-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── 页脚 ── */
.site-footer {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, var(--dark) 0%, var(--dark2) 100%);
  border-top: 1px solid rgba(135, 255, 113, 0.2);
}

.footer-top-section {
  padding: 2.5rem 0 0;
}

.footer-top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem 1.5rem;
  border-bottom: 1px solid rgba(135, 255, 113, 0.12);
}

.footer-brand-big {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  font-weight: 700;
  color: var(--green);
  text-shadow: var(--glow-green);
  letter-spacing: 0.04em;
  line-height: 1;
  display: block;
}

.footer-cols {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1rem 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  align-items: start;
}

.footer-col {
  min-width: 0;
}

.footer-col-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue);
  text-shadow: 0 0 6px rgba(1, 205, 254, 0.35);
  margin-bottom: 0.25rem;
}

.footer-col-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  display: block;
}

.footer-col-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.footer-nav-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-link {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  transition: color var(--transition);
}

.footer-link:hover { color: var(--green); }

.footer-bottom-section {
  border-top: 1px solid rgba(135, 255, 113, 0.1);
}

.footer-bottom-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-bottom-links {
  display: flex;
  gap: 1.25rem;
}

.footer-bottom-link {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.footer-bottom-link:hover { color: var(--green); }

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Glitch animation ── */
@keyframes glitch {
  0%, 100% { text-shadow: var(--glow-green); }
  20% { text-shadow: 3px 0 var(--blue), -3px 0 var(--pink), var(--glow-green); }
  40% { text-shadow: -3px 0 var(--blue), 3px 0 var(--pink), var(--glow-green); }
  60% { text-shadow: var(--glow-green); }
}

/* ── hue-rotate animation ── */
@keyframes hueShift {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(30deg); }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .content-with-aside {
    grid-template-columns: 1fr 220px;
  }

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

@media (max-width: 768px) {
  :root {
    --nav-h: 56px;
    --search-h: 40px;
  }

  .header-inner {
    padding: 0 0.75rem;
  }

  .site-nav {
    gap: 0.3rem;
  }

  .nav-pill {
    font-size: 0.72rem;
    padding: 0 0.5rem;
    min-height: 40px;
  }

  .brand-text {
    font-size: 0.88rem;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2rem 0.75rem;
  }

  .hero-media { order: 2; }
  .hero-copy {
    order: 1;
    align-items: flex-start;
    text-align: left;
  }

  .hero-h1 { text-align: left; }

  .content-with-aside {
    grid-template-columns: 1fr;
  }

  .main-aside {
    position: static;
  }

  .site-main {
    padding: 2rem 0.75rem 2.5rem;
  }

  .footer-cols {
    grid-template-columns: 1fr 1fr;
    padding: 1.5rem 0.75rem 1.5rem;
  }

  .footer-top {
    padding: 0 0.75rem 1.25rem;
  }

  .footer-bottom-bar {
    padding: 1rem 0.75rem;
  }
}

@media (max-width: 480px) {
  :root {
    --nav-h: 52px;
    --search-h: 40px;
  }

  .header-inner {
    padding: 0 0.5rem;
  }

  .nav-list {
    gap: 0.15rem;
  }

  .nav-pill {
    font-size: 0.65rem;
    padding: 0 0.4rem;
    min-height: 40px;
  }

  .brand-text {
    font-size: 0.78rem;
    padding: 0 0.15rem;
  }

  .search-form {
    width: 100%;
  }

  .hero-inner {
    padding: 1.5rem 0.5rem;
  }

  .site-main {
    padding: 1.5rem 0.5rem 2rem;
  }

  .footer-cols {
    grid-template-columns: 1fr;
    padding: 1.25rem 0.5rem 1.25rem;
  }

  .footer-top {
    padding: 0 0.5rem 1rem;
  }

  .footer-bottom-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 0.5rem;
  }
}

/* ── prefers-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;
  }
  .hero-band { animation: none; }
  .hero-h1 { animation: none; text-shadow: var(--glow-green); }
  .hero-glow-orb { animation: none; }
  .reveal { opacity: 1; transform: none; }
}
