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

/* ============================================================
   CSS 变量 & 基础重置
   ============================================================ */
:root {
  --c-primary: #ff0000;
  --c-accent: #ff1493;
  --c-dark: #261717;
  --c-dark-2: #341f1f;
  --c-dark-3: #4a2828;
  --c-dark-4: #1a0e0e;
  --c-text: #f5e6e6;
  --c-text-muted: #c9a0a0;
  --c-text-dim: #8a5c5c;
  --c-glow: rgba(255, 20, 147, 0.35);
  --c-glow-r: rgba(255, 0, 0, 0.3);
  --nav-width: 220px;
  --font-title: 'Playfair Display SC', 'Noto Serif SC', Georgia, serif;
  --font-body: 'Karla', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --scroll-offset: 80px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--c-dark-4);
}

body.aurora-body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-text);
  background: var(--c-dark);
  overflow-x: hidden;
  min-height: 100vh;
}

/* 流光极光背景动画 */
body.aurora-body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(255, 0, 0, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 70%, rgba(255, 20, 147, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse 100% 100% at 50% 50%, rgba(38, 23, 23, 0.95) 40%, transparent 100%),
    conic-gradient(from 0deg at 30% 40%, rgba(255,0,0,0.08) 0deg, rgba(255,20,147,0.12) 120deg, rgba(255,0,0,0.06) 240deg, rgba(255,20,147,0.08) 360deg);
  background-size: 200% 200%, 200% 200%, 100% 100%, 200% 200%;
  animation: auroraBg 12s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes auroraBg {
  0% {
    background-position: 0% 0%, 100% 100%, center, 0% 0%;
    filter: saturate(1.1) brightness(1.0);
  }
  50% {
    background-position: 60% 30%, 40% 60%, center, 60% 40%;
    filter: saturate(1.3) brightness(1.05);
  }
  100% {
    background-position: 100% 60%, 0% 20%, center, 100% 100%;
    filter: saturate(1.2) brightness(0.98);
  }
}

/* ============================================================
   页面骨架
   ============================================================ */
.page-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================================================
   左侧固定竖排导航（footer 承载）
   ============================================================ */
.sidebar-nav {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--nav-width);
  background: linear-gradient(180deg, rgba(26,14,14,0.97) 0%, rgba(52,31,31,0.95) 100%);
  border-right: 1px solid rgba(255, 20, 147, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sidebar-nav::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(255,20,147,0.6) 30%, rgba(255,0,0,0.6) 60%, transparent);
  animation: sideGlow 8s ease-in-out infinite alternate;
}

@keyframes sideGlow {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

.sidebar-brand {
  padding: 24px 16px 20px;
  border-bottom: 1px solid rgba(255, 20, 147, 0.15);
  flex-shrink: 0;
}

.brand-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform var(--transition);
}

.brand-logo-link:hover {
  transform: scale(1.08);
}

.brand-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid rgba(255, 20, 147, 0.5);
}

.brand-text-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  border: 2px solid rgba(255, 20, 147, 0.5);
  box-shadow: 0 0 20px var(--c-glow);
  letter-spacing: 0;
}

.sidebar-links {
  flex: 1;
  padding: 20px 0 20px;
  display: flex;
  flex-direction: column;
}

/* 导航 dl/dt/dd 结构 */
.nav-dl {
  list-style: none;
  width: 100%;
}

.nav-item {
  width: 100%;
}

.nav-link {
  display: block;
  padding: 12px 20px;
  color: var(--c-text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
  transition: color var(--transition), background var(--transition), padding-left var(--transition);
  min-height: 44px;
  display: flex;
  align-items: center;
  position: relative;
  border-left: 2px solid transparent;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 2px;
  height: 60%;
  background: linear-gradient(180deg, var(--c-primary), var(--c-accent));
  transition: transform var(--transition);
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 20, 147, 0.08);
  padding-left: 26px;
}

.nav-link:hover::before {
  transform: translateY(-50%) scaleY(1);
}

.nav-contact {
  margin-top: 16px;
  padding: 0 16px;
  border-top: 1px solid rgba(255, 20, 147, 0.12);
  padding-top: 16px;
}

.nav-contact-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--c-accent);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 4px;
  transition: color var(--transition), text-shadow var(--transition);
}

.nav-contact-link:hover {
  color: #fff;
  text-shadow: 0 0 12px var(--c-glow);
}

/* ============================================================
   主内容区
   ============================================================ */
.main-wrapper {
  margin-left: var(--nav-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.site-main {
  flex: 1;
  width: 100%;
}

/* 结构抽签: main > article > div */
.content-article {
  width: 100%;
}

/* ============================================================
   Hero 区块
   ============================================================ */
.hero-section {
  position: relative;
  min-height: 45vh;
  display: flex;
  align-items: center;
  padding: 48px 48px 40px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(26,14,14,0.9) 0%, rgba(74,40,40,0.5) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-accent);
  box-shadow: 0 0 12px var(--c-accent);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 12px var(--c-accent); }
  50% { opacity: 0.7; transform: scale(1.3); box-shadow: 0 0 24px var(--c-accent), 0 0 40px var(--c-glow); }
}

.badge-text {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--c-accent);
  text-transform: uppercase;
}

.hero-h1 {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 0 40px rgba(255, 0, 0, 0.4), 0 2px 4px rgba(0,0,0,0.5);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

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

/* Hero 极光装饰球 */
.hero-deco {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
}

.orb-1 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,0,0,0.6) 0%, transparent 70%);
  right: -60px;
  top: -80px;
  animation: orbFloat1 10s ease-in-out infinite alternate;
}

.orb-2 {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255,20,147,0.7) 0%, transparent 70%);
  right: 120px;
  bottom: -60px;
  animation: orbFloat2 12s ease-in-out infinite alternate;
}

.orb-3 {
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(255,100,0,0.5) 0%, transparent 70%);
  right: 300px;
  top: 20px;
  animation: orbFloat3 9s ease-in-out infinite alternate;
}

@keyframes orbFloat1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-30px, 20px) scale(1.15); }
}
@keyframes orbFloat2 {
  0% { transform: translate(0, 0) scale(1.1); }
  100% { transform: translate(20px, -25px) scale(0.9); }
}
@keyframes orbFloat3 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-15px, 30px) scale(1.2); }
}

/* ============================================================
   内容区：aside 左 + body 右
   ============================================================ */
.content-section {
  display: flex;
  gap: 0;
  padding: 0;
  min-height: 60vh;
}

/* aside 在内容左侧 */
.content-aside {
  width: 180px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
  background: rgba(26, 14, 14, 0.6);
  border-right: 1px solid rgba(255, 20, 147, 0.12);
  padding: 32px 0 32px;
}

.aside-inner {
  padding: 0 12px;
}

.aside-title {
  font-family: var(--font-title);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--c-text-dim);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 20, 147, 0.2);
}

.aside-title span {
  display: inline;
}

.aside-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.aside-nav-list li {
  width: 100%;
}

.aside-link {
  display: block;
  padding: 8px 10px;
  font-size: 0.75rem;
  color: var(--c-text-dim);
  text-decoration: none;
  border-radius: var(--radius-sm);
  line-height: 1.4;
  transition: color var(--transition), background var(--transition);
  min-height: 40px;
  display: flex;
  align-items: center;
}

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

.content-body {
  flex: 1;
  padding: 40px 48px 60px;
  min-width: 0;
  max-width: 860px;
}

/* ============================================================
   正文内容样式（page.content 注入的 HTML）
   ============================================================ */
.content-body h2 {
  font-family: var(--font-title);
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 700;
  color: #fff;
  margin: 48px 0 16px;
  padding-top: 16px;
  line-height: 1.3;
  position: relative;
}

.content-body h2 > span {
  display: inline;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.content-body h3 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-text);
  margin: 32px 0 12px;
  line-height: 1.4;
}

.content-body h3 > span {
  display: inline;
  color: var(--c-accent);
}

.content-body p {
  margin-bottom: 16px;
  color: var(--c-text-muted);
  font-size: 1rem;
  line-height: 1.8;
}

.content-body ul,
.content-body ol {
  margin: 12px 0 20px 20px;
  color: var(--c-text-muted);
}

.content-body li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.content-body a {
  color: var(--c-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 20, 147, 0.3);
  transition: color var(--transition), border-color var(--transition);
}

.content-body a:hover {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
}

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

.content-body em {
  color: var(--c-accent);
  font-style: normal;
}

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

/* 正文中的 div（page.content 里的7个div） */
.content-body div {
  scroll-margin-top: var(--scroll-offset);
  padding: 32px 0;
  border-bottom: 1px solid rgba(255, 20, 147, 0.1);
}

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

/* 图片 */
.content-body img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}

/* ============================================================
   页脚 footer > div×n
   ============================================================ */
.site-footer {
  background: var(--c-dark-4);
  border-top: 1px solid rgba(255, 20, 147, 0.15);
  padding: 0;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-primary), var(--c-accent), transparent);
  animation: footerLine 8s ease-in-out infinite alternate;
}

@keyframes footerLine {
  0% { opacity: 0.4; background-position: 0%; }
  100% { opacity: 1; background-position: 100%; }
}

.footer-brand-section {
  padding: 28px 48px 12px;
  text-align: center;
}

.footer-brand-name {
  font-family: var(--font-title);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 50%, #fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  filter: drop-shadow(0 0 30px rgba(255, 20, 147, 0.3));
  animation: brandGlow 10s ease-in-out infinite alternate;
}

@keyframes brandGlow {
  0% { filter: drop-shadow(0 0 20px rgba(255, 0, 0, 0.3)); }
  100% { filter: drop-shadow(0 0 40px rgba(255, 20, 147, 0.5)); }
}

.footer-copy-section {
  padding: 12px 48px 24px;
  text-align: center;
  border-top: 1px solid rgba(255, 20, 147, 0.08);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--c-text-dim);
  line-height: 1.6;
}

.footer-icp {
  font-size: 0.75rem;
  color: var(--c-text-dim);
  margin-top: 4px;
  opacity: 0.7;
}

/* ============================================================
   滚动偏移（吸顶导航 / 固定侧边）
   ============================================================ */
div[id] {
  scroll-margin-top: 24px;
}

/* ============================================================
   Hover 微交互 & 视差
   ============================================================ */
.content-body div {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.content-body div:hover {
  transform: translateX(4px);
}

/* ============================================================
   响应式 - 平板
   ============================================================ */
@media (max-width: 1024px) {
  :root {
    --nav-width: 180px;
  }

  .hero-section {
    padding: 36px 32px 32px;
    min-height: 40vh;
  }

  .content-body {
    padding: 32px 32px 48px;
  }

  .footer-brand-section,
  .footer-copy-section {
    padding-left: 32px;
    padding-right: 32px;
  }
}

/* ============================================================
   响应式 - 移动端 ≤768px
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --nav-width: 0px;
  }

  .page-shell {
    flex-direction: column;
  }

  /* 移动端：侧边导航变顶部横条 */
  .sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid rgba(255, 20, 147, 0.25);
    z-index: 200;
    overflow-y: visible;
    overflow-x: auto;
    padding: 0;
  }

  .sidebar-brand {
    padding: 8px 14px;
    border-bottom: none;
    border-right: 1px solid rgba(255, 20, 147, 0.15);
    flex-shrink: 0;
    height: 56px;
    display: flex;
    align-items: center;
  }

  .brand-text-icon,
  .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }

  .sidebar-links {
    padding: 0;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar-links::-webkit-scrollbar {
    display: none;
  }

  .nav-dl {
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .nav-item {
    width: auto;
    flex-shrink: 0;
  }

  .nav-link {
    padding: 0 14px;
    height: 56px;
    font-size: 0.78rem;
    min-height: 44px;
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
  }

  .nav-link::before {
    top: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 2px;
  }

  .nav-link:hover {
    padding-left: 14px;
  }

  .nav-link:hover::before {
    transform: translateX(-50%) scaleX(1);
  }

  .nav-contact {
    margin-top: 0;
    padding: 0 14px;
    border-top: none;
    border-left: 1px solid rgba(255, 20, 147, 0.12);
    flex-shrink: 0;
    height: 56px;
    display: flex;
    align-items: center;
  }

  .nav-contact-link {
    min-height: 44px;
    font-size: 0.75rem;
    padding: 0;
    white-space: nowrap;
  }

  .main-wrapper {
    margin-left: 0;
    margin-top: 56px;
  }

  .hero-section {
    padding: 32px 20px 28px;
    min-height: 38vh;
  }

  .hero-h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .hero-desc {
    font-size: 0.9rem;
  }

  .orb-1 { width: 180px; height: 180px; }
  .orb-2 { width: 140px; height: 140px; }
  .orb-3 { display: none; }

  /* 移动端内容区：aside 折叠到顶部横向 */
  .content-section {
    flex-direction: column;
  }

  .content-aside {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid rgba(255, 20, 147, 0.12);
    padding: 16px 0;
    overflow-y: visible;
    overflow-x: auto;
    background: rgba(26, 14, 14, 0.8);
  }

  .aside-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .aside-inner::-webkit-scrollbar { display: none; }

  .aside-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.68rem;
  }

  .aside-nav-list {
    flex-direction: row;
    gap: 4px;
    flex-shrink: 0;
  }

  .aside-link {
    white-space: nowrap;
    padding: 6px 10px;
    min-height: 40px;
    font-size: 0.72rem;
    border-radius: 2px;
    background: rgba(255, 20, 147, 0.05);
  }

  .content-body {
    padding: 24px 20px 40px;
  }

  .content-body h2 {
    font-size: 1.2rem;
    margin: 32px 0 12px;
  }

  .content-body h3 {
    font-size: 1rem;
  }

  .content-body div:hover {
    transform: none;
  }

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

  .footer-copy-section {
    padding: 10px 20px 20px;
  }

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

/* ============================================================
   超小屏 ≤375px
   ============================================================ */
@media (max-width: 375px) {
  .hero-section {
    padding: 24px 16px 20px;
  }

  .content-body {
    padding: 20px 16px 32px;
  }

  .hero-h1 {
    font-size: 1.4rem;
  }
}

/* ============================================================
   可访问性 - 减少动效
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  body.aurora-body::before {
    animation: none;
    background-position: center;
  }
}

/* ============================================================
   无障碍 - 焦点样式
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
   滚动条美化
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--c-dark-4);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--c-primary), var(--c-accent));
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--c-accent);
}
