@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;500;600;700&family=Rubik:wght@300;400;500;600;700&display=swap');

/* ============================================================
   CSS 变量 & 重置
   ============================================================ */
:root {
  --c-red: #ff0000;
  --c-pink: #ff1493;
  --c-dark: #261717;
  --c-dark2: #1a0f0f;
  --c-dark3: #0e0808;
  --c-text: #f5e6e6;
  --c-muted: #c8a0a0;
  --c-border: rgba(255,20,147,0.35);
  --c-card-bg: rgba(38,23,23,0.75);
  --c-overlay: rgba(14,8,8,0.6);
  --radius: 18px;
  --nav-h: 60px;
  --font-main: 'Nunito Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-display: 'Rubik', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  scroll-behavior: smooth;
}

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

html {
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body.dark-theme {
  font-family: var(--font-main);
  background-color: var(--c-dark3);
  color: var(--c-text);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: var(--nav-h);
}

a {
  color: var(--c-pink);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--c-red); }

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

ul, ol { list-style: none; }

/* ============================================================
   Aurora 背景
   ============================================================ */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.aurora-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(255,0,0,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 80% 70%, rgba(255,20,147,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 90% 80% at 50% 50%, rgba(38,23,23,0.95) 0%, #0e0808 100%);
  background-size: 200% 200%;
  animation: meshDrift 12s ease-in-out infinite alternate;
}

.aurora-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  mix-blend-mode: screen;
  opacity: 0.45;
  animation: glowFloat 10s ease-in-out infinite alternate;
}

.glow-1 {
  width: 55vw; height: 40vw;
  background: radial-gradient(circle, rgba(255,0,0,0.6) 0%, transparent 70%);
  top: -10%; left: -15%;
  animation-duration: 9s;
}

.glow-2 {
  width: 50vw; height: 45vw;
  background: radial-gradient(circle, rgba(255,20,147,0.55) 0%, transparent 70%);
  bottom: 10%; right: -10%;
  animation-duration: 11s;
  animation-delay: -3s;
}

.glow-3 {
  width: 35vw; height: 30vw;
  background: conic-gradient(from 180deg, rgba(255,0,0,0.4), rgba(255,20,147,0.4), transparent);
  top: 40%; left: 35%;
  animation-duration: 8s;
  animation-delay: -6s;
}

@keyframes meshDrift {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

@keyframes glowFloat {
  0% { transform: translate(0, 0) scale(1); opacity: 0.4; }
  50% { transform: translate(3%, 5%) scale(1.08); opacity: 0.55; }
  100% { transform: translate(-3%, -4%) scale(0.95); opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora-mesh, .aurora-glow {
    animation: none;
  }
}

/* ============================================================
   页头
   ============================================================ */
.site-header {
  position: relative;
  z-index: 10;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  background: rgba(14,8,8,0.5);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.brand-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-icon-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--c-red), var(--c-pink));
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.header-tagline {
  font-size: 0.8rem;
  color: var(--c-muted);
  line-height: 1.3;
  max-width: 300px;
  display: none;
}

@media (min-width: 600px) {
  .header-tagline { display: block; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero-wrap {
  position: relative;
  z-index: 5;
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  padding: 60px 32px 80px;
}

.hero-slash {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 0%,
    transparent 45%,
    rgba(255,0,0,0.12) 45%,
    rgba(255,20,147,0.08) 70%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-slash::after {
  content: '';
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  background: linear-gradient(
    115deg,
    rgba(38,23,23,0.9) 0%,
    rgba(38,23,23,0.7) 42%,
    transparent 55%
  );
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: right;
  max-width: 700px;
}

.hero-h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, var(--c-pink) 50%, var(--c-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: var(--c-muted);
  margin-bottom: 32px;
  line-height: 1.6;
}

.hero-cta {
  display: inline-block;
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--c-red), var(--c-pink));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  min-height: 44px;
  line-height: 1.2;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255,20,147,0.4);
  color: #fff;
}

/* ============================================================
   主内容区
   ============================================================ */
.site-main {
  position: relative;
  z-index: 5;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.content-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}

@media (min-width: 900px) {
  .content-section {
    grid-template-columns: 240px 1fr;
    grid-template-rows: auto auto;
  }
  .content-aside {
    grid-column: 1;
    grid-row: 1 / 3;
  }
  .content-figure {
    grid-column: 2;
    grid-row: 1;
  }
  .content-body {
    grid-column: 2;
    grid-row: 2;
  }
}

/* ============================================================
   侧边栏 Aside
   ============================================================ */
.content-aside {
  position: sticky;
  top: 80px;
}

.aside-card {
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 24px 20px;
  backdrop-filter: blur(10px);
}

.aside-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-pink);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  text-transform: none;
}

.aside-card .subtitle {
  font-size: 0.8rem;
  color: var(--c-muted);
  margin-bottom: 16px;
}

.aside-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aside-link {
  display: block;
  padding: 8px 12px;
  font-size: 0.88rem;
  color: var(--c-text);
  border-radius: 10px;
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  min-height: 40px;
  line-height: 1.4;
  display: flex;
  align-items: center;
}

.aside-link:hover {
  border-color: var(--c-border);
  background: rgba(255,20,147,0.08);
  color: var(--c-pink);
}

/* ============================================================
   Figure 装饰
   ============================================================ */
.content-figure {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px;
  background: linear-gradient(135deg, rgba(255,0,0,0.06), rgba(255,20,147,0.06));
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  overflow: hidden;
  position: relative;
}

.figure-deco {
  display: flex;
  gap: 16px;
  align-items: center;
}

.deco-dot {
  display: block;
  border-radius: 50%;
  animation: dotPulse 3s ease-in-out infinite;
}

.dot-r {
  width: 40px; height: 40px;
  background: radial-gradient(circle, var(--c-red), transparent);
  animation-delay: 0s;
}
.dot-p {
  width: 56px; height: 56px;
  background: radial-gradient(circle, var(--c-pink), transparent);
  animation-delay: -1s;
}
.dot-d {
  width: 32px; height: 32px;
  background: radial-gradient(circle, rgba(255,20,147,0.6), transparent);
  animation-delay: -2s;
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .deco-dot { animation: none; }
}

/* ============================================================
   正文内容 (page.content 来的 HTML)
   ============================================================ */
.content-body {
  line-height: 1.75;
  font-size: 1rem;
}

.content-body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 700;
  color: #fff;
  margin: 48px 0 12px;
  padding-top: 24px;
  letter-spacing: -0.01em;
  border-top: 1px solid var(--c-border);
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

.content-body h2:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.content-body h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-pink);
  margin: 28px 0 10px;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

.content-body p {
  margin-bottom: 16px;
  color: var(--c-text);
}

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

.content-body ul li {
  padding: 4px 0 4px 20px;
  position: relative;
  color: var(--c-text);
}

.content-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-red), var(--c-pink));
}

.content-body ol {
  counter-reset: ol-counter;
}

.content-body ol li {
  counter-increment: ol-counter;
  padding: 4px 0 4px 24px;
  position: relative;
  color: var(--c-text);
}

.content-body ol li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--c-pink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.content-body a {
  color: var(--c-pink);
  border-bottom: 1px solid rgba(255,20,147,0.3);
  transition: border-color 0.2s, color 0.2s;
}
.content-body a:hover {
  color: var(--c-red);
  border-color: var(--c-red);
}

.content-body strong {
  color: #fff;
  font-weight: 700;
}

.content-body blockquote {
  border-left: 3px solid var(--c-pink);
  padding: 12px 20px;
  margin: 20px 0;
  background: rgba(255,20,147,0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--c-muted);
  font-style: italic;
}

.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.9rem;
  border-radius: var(--radius);
  overflow: hidden;
}

.content-body th {
  background: rgba(255,20,147,0.15);
  color: var(--c-pink);
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
}

.content-body td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,20,147,0.12);
  color: var(--c-text);
}

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

/* article 内的 scroll offset */
.content-body article,
article[id] {
  scroll-margin-top: calc(var(--nav-h) + 20px);
}

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 5;
  border-top: 1px solid var(--c-border);
  background: rgba(14,8,8,0.85);
  backdrop-filter: blur(12px);
  padding-bottom: var(--nav-h);
}

.footer-brand-section {
  padding: 40px 24px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,20,147,0.15);
}

.footer-brand-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--c-red), var(--c-pink), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

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

.footer-nav-section {
  padding: 20px 24px;
}

.footer-nav {
  max-width: 1000px;
  margin: 0 auto;
}

.footer-dl {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  justify-content: center;
  align-items: center;
}

.footer-dl dt,
.footer-dl dd {
  display: inline;
}

.footer-dl .nav-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--c-muted);
  border-radius: 10px;
  border: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  min-height: 40px;
  white-space: nowrap;
}

.footer-dl .nav-link:hover {
  border-color: var(--c-border);
  color: var(--c-pink);
  background: rgba(255,20,147,0.08);
}

/* ============================================================
   底部固定导航条（主导航）
   ============================================================ */
.bottom-nav-bar {
  display: none;
}

/* 底部固定条通过 body::after 之类不合适，
   用 JS 动态插入的形式处理 */

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 899px) {
  .content-section {
    grid-template-columns: 1fr;
  }

  .content-aside {
    position: static;
    order: -1;
  }

  .aside-nav-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .hero-wrap {
    padding: 40px 20px 60px;
    min-height: 42vh;
  }

  .hero-inner {
    text-align: right;
  }

  .aside-nav-list {
    grid-template-columns: 1fr;
  }

  .footer-brand-name {
    font-size: clamp(1.8rem, 10vw, 3rem);
  }
}

/* ============================================================
   卡片（page.content 内可能生成）
   ============================================================ */
.card,
.content-body .card {
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover,
.content-body .card:hover {
  border-color: rgba(255,20,147,0.6);
  transform: translateY(-2px);
}

/* ============================================================
   滚动条美化（仅 webkit）
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--c-dark3);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--c-red), var(--c-pink));
  border-radius: 3px;
}

/* ============================================================
   选中文字
   ============================================================ */
::selection {
  background: rgba(255,20,147,0.35);
  color: #fff;
}

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