/* ========================================
   Re.DEV — Cartographic Design System
   A digital terrain map aesthetic
   ======================================== */

/* ========== Design Tokens ========== */
:root {
  /* Core palette — inspired by topographic maps at dusk */
  --ink: #0a0e14;
  --slate: #111820;
  --ridge: #1a2332;
  --amber: #d4a053;
  --amber-dim: rgba(212,160,83,0.10);
  --amber-glow: rgba(212,160,83,0.25);
  --cyan: #2ca5c7;
  --cyan-dim: rgba(44,165,199,0.10);
  --ash: #e0e4e8;
  --fog: #7a8a9d;
  --shadow: rgba(0,0,0,0.5);

  /* Typography scale — modular scale 1.25 */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
  --text-5xl: 3rem;      /* 48px */

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========== Light Theme ========== */
[data-theme="light"] {
  --ink: #f8f9fa;
  --slate: #ffffff;
  --ridge: #e9ecef;
  --amber: #c78d3a;
  --amber-dim: rgba(199, 141, 58, 0.10);
  --amber-glow: rgba(199, 141, 58, 0.25);
  --cyan: #1a8fa8;
  --cyan-dim: rgba(26, 143, 168, 0.10);
  --ash: #212529;
  --fog: #6c757d;
  --shadow: rgba(0,0,0,0.1);
}

[data-theme="light"] body {
  background: var(--ink);
  color: var(--ash);
}

[data-theme="light"] nav {
  background: rgba(248, 249, 250, 0.9);
  border-bottom-color: var(--ridge);
}

[data-theme="light"] .loading-screen {
  background: var(--ink);
}

[data-theme="light"] body::before {
  background: linear-gradient(180deg, #f0f1f3 0%, var(--ink) 40%, #f5f6f8 100%);
}

[data-theme="light"] body::after {
  background-image: radial-gradient(circle, rgba(199, 141, 58, 0.05) 1px, transparent 1px);
}

/* 浅色模式 - 导航栏 */
[data-theme="light"] nav ul li a {
  color: #6c757d;
}

[data-theme="light"] nav ul li a:hover {
  color: #212529;
}

[data-theme="light"] nav ul li a.active {
  color: #212529;
}

[data-theme="light"] .nav-contact a {
  color: #6c757d;
}

[data-theme="light"] .nav-contact a:hover {
  color: #c78d3a;
}

[data-theme="light"] .nav-clock {
  color: #6c757d;
  background: rgba(199, 141, 58, 0.08);
  border-color: rgba(199, 141, 58, 0.15);
}

/* 浅色模式 - Hero 区域 */
[data-theme="light"] .hero-coord {
  color: rgba(199, 141, 58, 0.5);
}

[data-theme="light"] .hero h1 {
  color: #212529;
}

[data-theme="light"] .hero-description {
  color: #495057;
}

/* 浅色模式 - 卡片 */
[data-theme="light"] .card {
  background: #ffffff;
  border-color: #e9ecef;
}

[data-theme="light"] .card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .card-body h3 {
  color: #212529;
}

[data-theme="light"] .card-body p {
  color: #6c757d;
}

/* 浅色模式 - 区块 */
[data-theme="light"] .block {
  background: #ffffff;
  border-color: #e9ecef;
}

[data-theme="light"] .block h2 {
  color: #c78d3a;
}

[data-theme="light"] .block p,
[data-theme="light"] .block li {
  color: #495057;
}

/* 浅色模式 - 标题 */
[data-theme="light"] section h2 {
  color: #212529;
}

[data-theme="light"] .page-header h1 {
  color: #212529;
}

[data-theme="light"] .page-header p {
  color: #6c757d;
}

/* 浅色模式 - Footer */
[data-theme="light"] footer {
  border-top-color: #e9ecef;
}

[data-theme="light"] footer p {
  color: #6c757d;
}

/* 浅色模式 - 返回顶部按钮 */
[data-theme="light"] .back-to-top {
  background: #ffffff;
  border-color: #e9ecef;
  color: #c78d3a;
}

[data-theme="light"] .back-to-top:hover {
  background: #c78d3a;
  color: #ffffff;
}

/* 浅色模式 - 滚动进度条 */
[data-theme="light"] .scroll-progress {
  box-shadow: 0 0 10px rgba(199, 141, 58, 0.3);
}

/* 浅色模式 - 标签 */
[data-theme="light"] .tag {
  border-color: rgba(199, 141, 58, 0.25);
  color: #c78d3a;
  background: rgba(199, 141, 58, 0.08);
}

[data-theme="light"] .card-tags span {
  background: rgba(199, 141, 58, 0.08);
  color: #c78d3a;
  border-color: rgba(199, 141, 58, 0.15);
}

/* 浅色模式 - 代码块 */
[data-theme="light"] .code-block {
  background: #f8f9fa;
  border-color: #e9ecef;
  color: #1a8fa8;
}

/* 浅色模式 - 表格 */
[data-theme="light"] .info-table th {
  color: #c78d3a;
}

[data-theme="light"] .info-table td {
  color: #495057;
  border-bottom-color: #e9ecef;
}

/* ========== Theme Toggle Button ========== */
.theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--ridge);
  border-radius: 8px;
  background: var(--slate);
  color: var(--ash);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--amber);
  background: var(--amber-dim);
  transform: translateY(-2px);
}

/* ========== Page Transitions ========== */
body {
  opacity: 1;
  transition: opacity 0.3s ease;
}

body.page-exit {
  opacity: 0;
}

body.page-enter {
  animation: pageEnter 0.3s ease forwards;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.page-loaded {
  animation: pageLoad 0.5s ease forwards;
}

@keyframes pageLoad {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ========== Lazy Load Images ========== */
img[data-src] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img[data-src].loaded {
  opacity: 1;
}

img[data-src].error {
  opacity: 0.5;
}

/* ========== Slide In Animation ========== */
.slide-in {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.slide-in.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ========== Scale In Animation ========== */
.scale-in {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

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

/* ========== Typography System ========== */
/* Display: Space Grotesk — geometric, modern, distinctive */
/* Body: Inter — optimized for screens, excellent CJK support */
/* Mono: JetBrains Mono — coding aesthetic, ligatures */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  background: var(--ink);
  color: var(--ash);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Display headings — distinctive geometric feel */
h1, h2, h3 {
  font-family: 'Space Grotesk', 'Noto Serif SC', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Code/mono elements */
code, pre, .mono, .nav-clock, .hero-coord {
  font-family: 'JetBrains Mono', 'Consolas', 'SF Mono', monospace;
}

/* ========== Background ========== */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -3;
  background:
    linear-gradient(180deg, #080c12 0%, var(--ink) 40%, #0c1218 100%);
}

/* Subtle dot grid — topographic map feel */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -2;
  background-image:
    radial-gradient(circle, rgba(212,160,83,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

#particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.15;
}

/* ========== Contour Canvas ========== */
#contourCanvas {
  position: absolute;
  top: 0; right: 0;
  width: 55%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* ========== Parallax Layers ========== */
.parallax-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 120%;
  pointer-events: none;
  will-change: transform;
}

.parallax-bg {
  z-index: -3;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(44, 165, 199, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(212, 160, 83, 0.03) 0%, transparent 40%);
}

.parallax-mid {
  z-index: -2;
  background:
    radial-gradient(circle at 30% 70%, rgba(212, 160, 83, 0.02) 0%, transparent 30%),
    radial-gradient(circle at 70% 40%, rgba(44, 165, 199, 0.015) 0%, transparent 25%);
}

.parallax-fg {
  z-index: -1;
  background:
    radial-gradient(circle at 50% 80%, rgba(212, 160, 83, 0.01) 0%, transparent 20%);
}

/* Parallax decorative elements */
.parallax-bg::before {
  content: '';
  position: absolute;
  top: 20%; left: 10%;
  width: 300px; height: 300px;
  border: 1px solid rgba(212, 160, 83, 0.03);
  border-radius: 50%;
  animation: float 20s ease-in-out infinite;
}

.parallax-bg::after {
  content: '';
  position: absolute;
  bottom: 30%; right: 15%;
  width: 200px; height: 200px;
  border: 1px solid rgba(44, 165, 199, 0.025);
  border-radius: 50%;
  animation: float 25s ease-in-out infinite reverse;
}

.parallax-mid::before {
  content: '';
  position: absolute;
  top: 40%; right: 25%;
  width: 150px; height: 150px;
  border: 1px dashed rgba(212, 160, 83, 0.02);
  transform: rotate(45deg);
  animation: float 30s ease-in-out infinite;
}

/* ========== Scroll Indicator ========== */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-10);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  z-index: 10;
  opacity: 0.6;
  animation: fadeInUp 1s ease 2s both;
}

.scroll-mouse {
  width: 24px;
  height: 38px;
  border: 2px solid var(--amber);
  border-radius: 12px;
  position: relative;
  opacity: 0.8;
}

.scroll-wheel {
  width: 3px;
  height: 8px;
  background: var(--amber);
  border-radius: 2px;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollWheel {
  0% { opacity: 1; top: 8px; }
  100% { opacity: 0; top: 22px; }
}

.scroll-indicator span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--fog);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 0.6; transform: translateX(-50%) translateY(0); }
}

/* ========== Navigation ========== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  z-index: 100;
  background: rgba(10, 14, 20, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(26, 35, 50, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
}

/* 左侧菜单 */
nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
}

nav ul li {
  height: 64px;
  display: flex;
  align-items: center;
}

nav ul li a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 20px;
  color: var(--fog);
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  transition: color 0.25s ease;
  white-space: nowrap;
}

/* Hover effect */
nav ul li a:hover {
  color: var(--ash);
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 100%;
  height: 2px;
  background: var(--amber);
  border-radius: 1px;
  transition: transform 0.3s ease;
}

nav ul li a:hover::after {
  transform: translateX(-50%) scaleX(0.8);
}

nav ul li a.active::after {
  transform: translateX(-50%) scaleX(0.8);
}

/* 激活状态：白色 + 金色下划线 */
nav ul li a.active {
  color: #ffffff;
}

nav ul li a.active::after {
  transform: translateX(-50%) scaleX(1);
  background: var(--amber);
}

/* 右侧联系方式 */
.nav-contact {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-contact a {
  display: flex;
  align-items: center;
  height: 64px;
  color: var(--fog);
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
  transition: color 0.25s ease;
  white-space: nowrap;
}

.nav-contact a:hover {
  color: var(--amber);
}

/* Clock */
.nav-clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--fog);
  letter-spacing: 0.1em;
  padding: 6px 12px;
  background: rgba(212, 160, 83, 0.06);
  border: 1px solid rgba(212, 160, 83, 0.12);
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

/* ========== Containers ========== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 100px var(--space-6) var(--space-16);
}

.container.wide {
  max-width: 1100px;
}

.page-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.page-header h1 {
  font-family: 'Space Grotesk', 'Noto Serif SC', sans-serif;
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--ash);
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

.page-header h1 span {
  color: var(--amber);
  position: relative;
}

.page-header h1 span::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--amber), transparent);
  border-radius: 2px;
}

.page-header p {
  font-size: var(--text-lg);
  color: var(--fog);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ========== Sections ========== */
section {
  padding: var(--space-20) var(--space-10);
  max-width: 1100px;
  margin: 0 auto;
}

section h2 {
  font-family: 'Space Grotesk', 'Noto Serif SC', sans-serif;
  font-size: var(--text-2xl);
  font-weight: 600;
  text-align: center;
  color: var(--ash);
  margin-bottom: var(--space-12);
  letter-spacing: 0.02em;
}

section h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--amber), var(--cyan));
  margin: var(--space-4) auto 0;
  border-radius: 1px;
}

/* ========== Blocks ========== */
.block {
  background: var(--slate);
  border: 1px solid var(--ridge);
  border-radius: 8px;
  padding: var(--space-8);
  margin-bottom: var(--space-5);
  transition: border-color 0.3s;
}

.block:hover {
  border-color: rgba(26, 35, 50, 0.8);
}

.block h2 {
  font-family: 'Space Grotesk', 'Noto Serif SC', sans-serif;
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-5);
  color: var(--amber);
  border-left: 3px solid var(--amber);
  padding-left: var(--space-4);
  letter-spacing: 0.02em;
}

.block p, .block li {
  font-size: var(--text-sm);
  color: var(--fog);
  line-height: 1.8;
}

.block ul {
  padding-left: var(--space-5);
}

.block li {
  margin-bottom: var(--space-2);
}

.block li::marker {
  color: var(--amber);
}

/* ========== Cards ========== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-10);
}

.card {
  background: var(--slate);
  border: 1px solid var(--ridge);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.4s var(--ease-out);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
}

/* Subtle gradient border on hover — topographic contour feel */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  padding: 1px;
  background: linear-gradient(135deg, var(--amber), transparent 50%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  pointer-events: none;
  z-index: 1;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--amber-dim);
}

.card:hover::before {
  opacity: 1;
}

/* Left accent bar — like a map legend marker */
.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 0;
  background: linear-gradient(to bottom, var(--amber), var(--cyan));
  transition: height 0.5s var(--ease-out);
  z-index: 2;
}

.card:hover::after {
  height: 100%;
}

.card-img {
  height: 180px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

/* Subtle zoom on hover */
.card-img img {
  transition: transform 0.6s var(--ease-out);
}

.card:hover .card-img img {
  transform: scale(1.05);
}

/* Contour pattern overlay on card images */
.card-img::after {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    linear-gradient(to bottom, transparent 60%, var(--slate)),
    radial-gradient(ellipse at 30% 50%, rgba(212,160,83,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.card-body { padding: var(--space-6); }

.card-body h3 {
  font-family: 'Space Grotesk', 'Noto Serif SC', sans-serif;
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--ash);
  letter-spacing: -0.01em;
  transition: color 0.3s;
}

.card:hover .card-body h3 {
  color: #fff;
}

.card-body p {
  font-size: var(--text-sm);
  color: var(--fog);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.card-tags {
  display: flex; gap: var(--space-2); flex-wrap: wrap;
}

.card-tags span {
  padding: var(--space-1) var(--space-3);
  border-radius: 4px;
  font-size: var(--text-xs);
  font-family: 'JetBrains Mono', monospace;
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(212,160,83,0.12);
  letter-spacing: 0.03em;
  transition: all 0.3s;
}

.card:hover .card-tags span {
  background: rgba(212,160,83,0.15);
  border-color: rgba(212,160,83,0.25);
}

.card-date {
  font-size: var(--text-xs);
  color: var(--fog);
  margin-top: var(--space-3);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
}

.card-video-hint {
  display: inline-block;
  margin-top: 12px;
  padding: 5px 12px;
  background: var(--amber-dim);
  border: 1px solid rgba(212,160,83,0.2);
  border-radius: 2px;
  font-size: 11px;
  color: var(--amber);
  transition: all 0.3s;
}

.card:hover .card-video-hint {
  background: rgba(212,160,83,0.2);
  border-color: var(--amber);
}

/* ========== Detail page components ========== */
.page-header .icon {
  font-size: 56px;
  margin-bottom: var(--space-5);
  display: block;
  animation: float 3s ease-in-out infinite;
}

.page-header .tags {
  margin-top: var(--space-5);
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

.page-header .tag {
  padding: var(--space-2) var(--space-4);
  border-radius: 6px;
  font-size: var(--text-xs);
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid rgba(212,160,83,0.2);
  color: var(--amber);
  background: var(--amber-dim);
  letter-spacing: 0.05em;
  transition: all 0.3s;
}

.page-header .tag:hover {
  background: rgba(212,160,83,0.2);
  border-color: rgba(212,160,83,0.3);
}

.screenshot-placeholder {
  width: 100%;
  min-height: 240px;
  background: var(--ridge);
  border: 1px dashed rgba(212,160,83,0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fog);
  font-size: var(--text-sm);
  margin: var(--space-4) 0;
}

.screenshot-container {
  margin: var(--space-4) 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--ridge);
}

.screenshot-container img {
  max-width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s var(--ease-out);
}

.screenshot-container:hover img {
  transform: scale(1.02);
}

.img-caption, .video-caption {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--fog);
  margin-top: var(--space-3);
  font-style: italic;
  letter-spacing: 0.05em;
}

/* ========== Video demo ========== */
.video-container {
  margin: var(--space-4) 0;
}

.video-placeholder {
  width: 100%;
  min-height: 240px;
  background: var(--ridge);
  border: 1px dashed rgba(212,160,83,0.15);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--fog);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.4s var(--ease-out);
}

.video-placeholder:hover {
  border-color: var(--amber);
  background: var(--slate);
  transform: translateY(-2px);
}

.video-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--amber-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--amber);
  margin-bottom: var(--space-4);
  border: 1px solid rgba(212,160,83,0.2);
  transition: all 0.4s var(--ease-out);
}

.video-placeholder:hover .video-icon {
  background: rgba(212,160,83,0.2);
  border-color: var(--amber);
  transform: scale(1.1);
}

.video-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--fog);
  margin-top: var(--space-2);
  letter-spacing: 0.05em;
}

video {
  width: 100%;
  border-radius: 8px;
  background: #000;
}

/* ========== Code & Tables ========== */
.code-block {
  background: #080c12;
  border: 1px solid var(--ridge);
  border-radius: 8px;
  padding: var(--space-6);
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-sm);
  color: var(--cyan);
  overflow-x: auto;
  margin: var(--space-4) 0;
  white-space: pre-wrap;
  line-height: 1.7;
  position: relative;
}

/* Subtle gradient border on code blocks */
.code-block::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(44, 165, 199, 0.2), transparent 50%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-4) 0;
}

.info-table th, .info-table td {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  border-bottom: 1px solid var(--ridge);
  font-size: var(--text-sm);
}

.info-table th {
  color: var(--amber);
  width: 140px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.info-table td {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
}

.highlight {
  color: var(--amber);
  font-weight: 600;
}

/* ========== Animations ========== */
/* Smooth reveal animations */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  will-change: opacity, transform;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays — like contour lines appearing */
.fade-in:nth-child(1) { transition-delay: 0.08s; }
.fade-in:nth-child(2) { transition-delay: 0.16s; }
.fade-in:nth-child(3) { transition-delay: 0.24s; }
.fade-in:nth-child(4) { transition-delay: 0.32s; }
.fade-in:nth-child(5) { transition-delay: 0.40s; }
.fade-in:nth-child(6) { transition-delay: 0.48s; }

/* Slide in from left — for timeline items */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale up reveal — for cards */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Floating animation — for decorative elements */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Pulse glow — for accent elements */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 var(--amber-glow); }
  50% { box-shadow: 0 0 20px 4px var(--amber-glow); }
}

/* Map grid scan line — signature animation */
@keyframes gridScan {
  0% { transform: translateY(-100%); opacity: 0; }
  10% { opacity: 0.3; }
  90% { opacity: 0.3; }
  100% { transform: translateY(100vh); opacity: 0; }
}

/* ========== Realtime Clock ========== */
.nav-clock {
  font-family: 'Consolas', 'SF Mono', monospace;
  font-size: 12px;
  color: var(--fog);
  letter-spacing: 1px;
  padding: 4px 10px;
  background: rgba(212, 160, 83, 0.06);
  border: 1px solid rgba(212, 160, 83, 0.1);
  border-radius: 3px;
}

/* ========== Contact Section ========== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
  max-width: 800px;
  margin: 0 auto;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-6);
  background: var(--slate);
  border: 1px solid var(--ridge);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all 0.4s var(--ease-out);
}

.contact-item:hover {
  transform: translateY(-4px);
  border-color: var(--amber-dim);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

.contact-icon {
  font-size: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--amber-dim);
  border-radius: 10px;
  flex-shrink: 0;
}

.contact-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--fog);
  margin-bottom: var(--space-1);
  letter-spacing: 0.05em;
}

.contact-value {
  font-size: var(--text-sm);
  color: var(--ash);
  font-weight: 500;
}

/* Wechat Modal */
.wechat-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.wechat-modal.show {
  display: flex;
  opacity: 1;
}

.wechat-modal img {
  max-width: 300px;
  border-radius: 12px;
  border: 2px solid var(--amber);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ========== Progress Bar ========== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--amber), var(--cyan));
  z-index: 1000;
  transition: width 0.1s;
  box-shadow: 0 0 10px rgba(212, 160, 83, 0.5);
}

/* ========== Back to Top ========== */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  background: var(--slate);
  border: 1px solid var(--ridge);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--amber);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s var(--ease-out);
  z-index: 100;
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--amber);
  color: var(--ink);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(212, 160, 83, 0.3);
}

/* ========== Loading Screen ========== */
.loading-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}

.loading-screen.hide {
  opacity: 0;
  visibility: hidden;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 2px solid var(--ridge);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  margin-top: var(--space-5);
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--fog);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ========== Edit mode ========== */
.admin-bar {
  position: fixed;
  top: 64px;
  left: 0;
  width: 100%;
  z-index: 99;
  background: linear-gradient(90deg, var(--amber), #e17055);
  color: var(--ink);
  padding: var(--space-3) var(--space-5);
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  font-weight: 600;
  display: none;
  text-align: center;
  letter-spacing: 0.05em;
}

.admin-bar button {
  background: var(--ink);
  color: var(--amber);
  border: none;
  padding: var(--space-2) var(--space-4);
  border-radius: 4px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  margin-left: var(--space-3);
  transition: all 0.3s;
}

.admin-bar button:hover {
  background: var(--slate);
  transform: translateY(-1px);
}

[contenteditable="true"] {
  outline: 1px dashed rgba(212,160,83,0.3) !important;
  outline-offset: 4px;
  cursor: text;
}

[contenteditable="true"]:focus {
  outline: 1px solid var(--amber) !important;
}

/* ========== Footer ========== */
footer {
  text-align: center;
  padding: var(--space-10) var(--space-6);
  font-size: var(--text-xs);
  color: var(--fog);
  border-top: 1px solid var(--ridge);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
}

footer a {
  color: var(--amber);
  text-decoration: none;
  transition: color 0.3s;
}

footer a:hover {
  color: var(--ash);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  nav {
    padding: 0 20px;
    height: 56px;
  }

  nav ul li {
    height: 56px;
  }

  nav ul li a {
    padding: 0 14px;
    font-size: 15px;
  }

  .nav-contact {
    gap: 12px;
  }

  .nav-contact a {
    font-size: 12px;
    height: 56px;
  }

  .nav-clock {
    display: none;
  }

  .container {
    padding: 72px 20px 40px;
  }

  #contourCanvas {
    width: 100%;
    opacity: 0.3;
  }
}

@media (max-width: 600px) {
  section {
    padding: 50px 16px;
  }

  nav ul {
    gap: 0;
  }

  nav ul li a {
    padding: 0 10px;
    font-size: 14px;
    letter-spacing: 0;
  }

  .nav-contact a {
    font-size: 11px;
    padding: 0 8px;
  }

  .gallery {
    grid-template-columns: 1fr;
  }
}

/* ========== Additional Micro-interactions ========== */

/* Smooth focus states for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Selection color */
::selection {
  background: rgba(212, 160, 83, 0.3);
  color: var(--ash);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--ink);
}

::-webkit-scrollbar-thumb {
  background: var(--ridge);
  border-radius: 4px;
}

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

/* Smooth page transitions */
@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container {
  animation: pageEnter 0.6s var(--ease-out) both;
}

/* Gradient text utility */
.gradient-text {
  background: linear-gradient(135deg, var(--amber), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glass morphism utility */
.glass {
  background: rgba(17, 24, 32, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(26, 35, 50, 0.6);
}

/* Map coordinate marker — signature element */
.map-marker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--amber);
  opacity: 0.6;
  letter-spacing: 0.1em;
}

.map-marker::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--amber);
  border-radius: 50%;
  animation: pulseGlow 2s ease-in-out infinite;
}

/* Topographic line decoration */
.topo-line {
  position: relative;
}

.topo-line::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--amber), transparent);
  opacity: 0.3;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }

  .parallax-layer {
    transform: none !important;
  }
}

/* ========== Comments Section ========== */
#comments-container {
  max-width: 700px;
  margin: 0 auto;
}

.comment-form {
  background: var(--slate);
  border: 1px solid var(--ridge);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: var(--fog);
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--ink);
  border: 1px solid var(--ridge);
  border-radius: 6px;
  color: var(--ash);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.3s ease;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--amber);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--fog);
  opacity: 0.6;
}

.btn-submit {
  display: inline-block;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--amber), #e17055);
  color: var(--ink);
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 160, 83, 0.3);
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-item {
  background: var(--slate);
  border: 1px solid var(--ridge);
  border-radius: 8px;
  padding: 20px;
  transition: border-color 0.3s ease;
}

.comment-item:hover {
  border-color: rgba(212, 160, 83, 0.2);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  flex-shrink: 0;
}

.comment-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ash);
}

.comment-time {
  font-size: 12px;
  color: var(--fog);
  margin-left: auto;
}

.comment-delete {
  background: transparent;
  border: 1px solid var(--ridge);
  color: var(--fog);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.comment-delete:hover {
  border-color: #e17055;
  color: #e17055;
}

.comment-body {
  font-size: 14px;
  color: var(--ash);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.no-comments {
  text-align: center;
  padding: 40px;
  color: var(--fog);
  font-size: 14px;
  background: var(--slate);
  border: 1px dashed var(--ridge);
  border-radius: 8px;
}

/* 浅色主题适配 */
[data-theme="light"] .comment-form {
  background: #ffffff;
  border-color: #e9ecef;
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea {
  background: #f8f9fa;
  border-color: #e9ecef;
  color: #212529;
}

[data-theme="light"] .comment-item {
  background: #ffffff;
  border-color: #e9ecef;
}

[data-theme="light"] .comment-body {
  color: #212529;
}

[data-theme="light"] .no-comments {
  background: #ffffff;
  border-color: #e9ecef;
}
