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

/* ===== 基础重置 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --black: #000000;
  --surface: #121212;
  --surface2: #1a1a2e;
  --surface3: #16213e;
  --midnight: #0f3460;
  --accent-blue: #4fc3f7;
  --accent-gold: #ffd54f;
  --accent-green: #69f0ae;
  --accent-purple: #ce93d8;
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --text-muted: #9e9e9e;
  --card-radius: 18px;
  --font-heading: 'Amatic SC', cursive;
  --font-body: 'Cabin', 'Segoe UI', system-ui, sans-serif;
  --nav-height: 64px;
  --transition: 0.25s ease;
}

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

body.dark-oled {
  background-color: var(--black);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-height) + 16px);
}

/* 给固定底导航留空间的 div scroll offset */
div[id] {
  scroll-margin-top: 80px;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition), text-shadow var(--transition);
}

a:hover,
a:focus-visible {
  color: var(--accent-gold);
  text-shadow: 0 0 10px var(--accent-gold);
  outline: none;
}

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

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

ol, ul {
  list-style: none;
}

/* ===== 页面包装 ===== */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== 顶部 Header ===== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid rgba(79, 195, 247, 0.15);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 80;
}

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

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-wrap img {
  height: 36px;
  width: auto;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(79, 195, 247, 0.6);
  line-height: 1;
}

.brand-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: auto;
  display: none;
}

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

/* ===== Hero ===== */
.hero-section {
  position: relative;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  overflow: hidden;
  background: linear-gradient(160deg, #000000 0%, #0a0a1a 50%, #000000 100%);
  padding: 40px 24px 32px;
}

.hero-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.dot-grid {
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle, rgba(79,195,247,0.18) 1px, transparent 1px);
  background-size: 28px 28px;
  animation: gridShift 20s linear infinite;
}

@keyframes gridShift {
  0% { background-position: 0 0; }
  100% { background-position: 28px 28px; }
}

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

.hero-content {
  position: relative;
  z-index: 1;
  text-align: right;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 8vw, 5rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  text-shadow: 0 0 10px rgba(79,195,247,0.4);
  letter-spacing: 2px;
}

.hero-sub {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.6;
}

.hero-cta {
  display: inline-block;
  background: linear-gradient(135deg, #0f3460, #4fc3f7);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 13px 32px;
  border-radius: var(--card-radius);
  letter-spacing: 1px;
  min-height: 48px;
  transition: transform var(--transition), box-shadow var(--transition);
  text-shadow: none;
}

.hero-cta:hover,
.hero-cta:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(79,195,247,0.45);
  color: #fff;
  text-shadow: none;
}

/* ===== 主内容 ===== */
.site-main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
  width: 100%;
}

/* div > figure/aside 交错结构 */
.content-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  position: relative;
}

@media (min-width: 900px) {
  .content-section {
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto auto 1fr;
    gap: 0 32px;
  }

  .content-aside {
    grid-column: 2;
    grid-row: 1;
  }

  .content-figure {
    grid-column: 2;
    grid-row: 2;
  }

  .page-content-wrap {
    grid-column: 1 / -1;
    grid-row: 3;
  }
}

/* 侧边栏 aside */
.content-aside {
  background: var(--surface);
  border-radius: var(--card-radius);
  padding: 24px 20px;
  border: 1px solid rgba(79,195,247,0.12);
  align-self: start;
}

@media (min-width: 900px) {
  .content-aside {
    grid-column: 1;
    grid-row: 1 / 4;
    position: sticky;
    top: 80px;
  }
}

.aside-title {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  color: var(--accent-blue);
  font-weight: 700;
  text-shadow: 0 0 8px rgba(79,195,247,0.4);
  margin-bottom: 4px;
}

.aside-nav-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  counter-reset: aside-counter;
}

.aside-nav-list li {
  counter-increment: aside-counter;
}

.aside-nav-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  transition: background var(--transition), color var(--transition);
  min-height: 40px;
}

.aside-nav-list li a::before {
  content: counter(aside-counter, decimal-leading-zero);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--accent-blue);
  min-width: 28px;
  text-align: center;
}

.aside-nav-list li a:hover,
.aside-nav-list li a:focus-visible {
  background: rgba(79,195,247,0.12);
  color: var(--accent-blue);
  text-shadow: none;
}

/* figure 装饰 */
.content-figure {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.deco-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79,195,247,0.4), transparent);
}

.deco-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue);
  animation: pulse 2.5s ease-in-out infinite;
}

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

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

/* 正文内容包装 */
.page-content-wrap {
  min-width: 0;
}

/* ===== page.content 内部样式 ===== */
.page-content-wrap div {
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

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

.page-content-wrap h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(255,255,255,0.15);
  line-height: 1.2;
}

.page-content-wrap h2 + p,
.page-content-wrap .subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-style: italic;
}

.page-content-wrap h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--accent-gold);
  margin: 20px 0 10px;
  letter-spacing: 1px;
}

.page-content-wrap p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 14px;
  max-width: 72ch;
}

.page-content-wrap ul,
.page-content-wrap ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.page-content-wrap ul { list-style: disc; }
.page-content-wrap ol { list-style: decimal; }

.page-content-wrap li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.page-content-wrap a {
  color: var(--accent-blue);
  border-bottom: 1px solid rgba(79,195,247,0.3);
}

.page-content-wrap a:hover {
  border-bottom-color: var(--accent-gold);
}

.page-content-wrap table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.page-content-wrap th {
  background: var(--surface2);
  color: var(--accent-blue);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}

.page-content-wrap td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: var(--text-secondary);
}

.page-content-wrap tr:hover td {
  background: rgba(79,195,247,0.05);
}

/* 卡片式块 */
.page-content-wrap blockquote {
  background: var(--surface);
  border-left: 3px solid var(--accent-blue);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin: 20px 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* ===== 底部固定导航 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 20, 0.96);
  border-top: 1px solid rgba(79,195,247,0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: var(--nav-height);
}

.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 8px;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.bottom-nav-inner::-webkit-scrollbar {
  display: none;
}

/* 品牌居中项 */
.nav-brand-center {
  order: 4;
  flex-shrink: 0;
}

.nav-brand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f3460, #4fc3f7);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  min-height: 52px;
  text-decoration: none;
  box-shadow: 0 0 16px rgba(79,195,247,0.4);
  transition: transform var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}

.nav-brand-btn:hover,
.nav-brand-btn:focus-visible {
  transform: scale(1.1);
  box-shadow: 0 0 24px rgba(79,195,247,0.7);
  text-shadow: none;
}

.nav-brand-text {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  line-height: 1;
  text-align: center;
}

/* nav items 排列 */
.bottom-nav-inner li:nth-child(1) { order: 1; }
.bottom-nav-inner li:nth-child(2) { order: 2; }
.bottom-nav-inner li:nth-child(3) { order: 3; }
/* brand center */
.bottom-nav-inner li:nth-child(4) { order: 4; }
.bottom-nav-inner li:nth-child(5) { order: 5; }
.bottom-nav-inner li:nth-child(6) { order: 6; }
.bottom-nav-inner li:nth-child(7) { order: 7; }
.bottom-nav-inner li:nth-child(8) { order: 8; }

.bottom-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  min-height: 48px;
  min-width: 48px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  text-shadow: none;
}

.bottom-nav-link span {
  display: block;
}

.bottom-nav-link:hover,
.bottom-nav-link:focus-visible {
  color: var(--accent-blue);
  background: rgba(79,195,247,0.1);
  text-shadow: 0 0 8px rgba(79,195,247,0.5);
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--surface);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 24px 20px;
  margin-bottom: var(--nav-height);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}

.footer-logo-col {
  flex-shrink: 0;
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(79,195,247,0.4);
  text-decoration: none;
}

.footer-brand:hover {
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(255,213,79,0.5);
}

.footer-nav ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
}

.footer-nav a {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 4px 0;
  transition: color var(--transition);
  text-shadow: none;
}

.footer-nav a:hover {
  color: var(--accent-blue);
  text-shadow: none;
}

.footer-copy-col {
  text-align: right;
  flex-shrink: 0;
}

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

.footer-notice {
  font-size: 0.78rem;
  color: rgba(158,158,158,0.6);
  margin-top: 4px;
}

/* ===== 响应式 ===== */
@media (max-width: 767px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 14px;
  }

  .footer-copy-col {
    text-align: center;
  }

  .footer-nav ol {
    justify-content: center;
  }

  .hero-section {
    padding: 32px 16px 28px;
    align-items: center;
  }

  .hero-content {
    text-align: right;
    align-items: flex-end;
  }

  .site-main {
    padding: 24px 16px;
  }

  .content-aside {
    display: none;
  }
}

@media (min-width: 900px) {
  .content-section {
    grid-template-columns: 220px 1fr;
  }
}

/* ===== 动效：Stagger List ===== */
@media (prefers-reduced-motion: no-preference) {
  .aside-nav-list li {
    opacity: 0;
    transform: translateX(-16px);
    animation: staggerIn 0.4s ease forwards;
  }

  .aside-nav-list li:nth-child(1) { animation-delay: 0.05s; }
  .aside-nav-list li:nth-child(2) { animation-delay: 0.1s; }
  .aside-nav-list li:nth-child(3) { animation-delay: 0.15s; }
  .aside-nav-list li:nth-child(4) { animation-delay: 0.2s; }
  .aside-nav-list li:nth-child(5) { animation-delay: 0.25s; }
  .aside-nav-list li:nth-child(6) { animation-delay: 0.3s; }
  .aside-nav-list li:nth-child(7) { animation-delay: 0.35s; }

  @keyframes staggerIn {
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  .page-content-wrap div {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

  .page-content-wrap div.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 辅助 ===== */
.subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 16px;
  font-style: italic;
}

/* scrollbar 风格 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--black);
}
::-webkit-scrollbar-thumb {
  background: rgba(79,195,247,0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(79,195,247,0.6);
}
