/* === FONTS === */
@font-face {
  font-family: 'DouyinSans';
  src: url('./fonts/DouyinSansBold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('./fonts/Outfit-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Outfit';
  src: url('./fonts/Outfit-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'JetBrainsMono';
  src: url('./fonts/JetBrainsMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Silkscreen';
  src: url('./fonts/Silkscreen-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

/* === CSS VARIABLES === */
:root {
  --bg: #080c14;
  --bg2: #0f1626;
  --bg3: #162032;
  --ink: #dfe6f0;
  --ink2: #c8d2e0;
  --muted: #6b7d9a;
  --rule: #1e3050;
  --accent: #00e5ff;
  --accent-glow: rgba(0, 229, 255, 0.15);
  --accent-glow-strong: rgba(0, 229, 255, 0.25);
  --accent2: #f0a030;
  --accent2-glow: rgba(240, 160, 48, 0.15);
  --accent3: #ff5e5b;
  --success: #4ade80;
  --font-heading: 'DouyinSans', 'Outfit', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  --font-body: 'Outfit', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  --font-mono: 'JetBrainsMono', 'Consolas', monospace;
  --font-pixel: 'Silkscreen', 'Microsoft YaHei', monospace;
  --max-width: 1200px;
  --radius: 6px;
  --radius-lg: 12px;
}

/* === LIGHT MODE (KV 酸橙色板) === */
html[data-theme="light"] {
  --bg: #FDF5E6;
  --bg2: #F5ECD8;
  --bg3: #EBE0C8;
  --ink: #3D2B1F;
  --ink2: #4D3B2F;
  --muted: #8A7A6A;
  --rule: #D8C8B0;
  --accent: #D4734A;
  --accent-glow: rgba(212, 115, 74, 0.12);
  --accent-glow-strong: rgba(212, 115, 74, 0.2);
  --accent2: #5B9BD5;
  --accent2-glow: rgba(91, 155, 213, 0.12);
  --accent3: #cc4040;
  --success: #3a8a50;
}
html[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(212, 115, 74, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 60%, rgba(91, 155, 213, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, rgba(212, 115, 74, 0.04) 0%, transparent 40%);
}
html[data-theme="light"] body::after {
  background-image:
    linear-gradient(rgba(212, 115, 74, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 115, 74, 0.03) 1px, transparent 1px);
}
html[data-theme="light"] nav { background: rgba(253, 245, 230, 0.85); }
html[data-theme="light"] .nav-links { background: rgba(253, 245, 230, 0.95); }
html[data-theme="light"] .hero-panel {
  background: rgba(253, 245, 230, 0.84);
  border: 1px solid rgba(212, 115, 74, 0.22);
  box-shadow:
    0 0 0 1px rgba(212, 115, 74, 0.06),
    0 8px 40px rgba(0,0,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.6);
}
html[data-theme="light"] .film-item .film-yr { background: rgba(255, 255, 255, 0.7); }
html[data-theme="light"] .film-item .film-cap { background: linear-gradient(transparent, rgba(253, 245, 230, 0.85)); }
html[data-theme="light"] .b-hero { background: linear-gradient(180deg, rgba(253,245,230,0.2) 0%, rgba(253,245,230,0.55) 50%, rgba(253,245,230,0.92) 100%); }
html[data-theme="light"] .panel-tagline .line1 { text-shadow: 0 0 20px rgba(212, 115, 74, 0.22); }
html[data-theme="light"] .panel-name:hover { text-shadow: 0 0 12px rgba(212, 115, 74, 0.3); }
html[data-theme="light"] .panel-btn {
  background: rgba(212, 115, 74, 0.05);
  border-color: rgba(212, 115, 74, 0.18);
}
html[data-theme="light"] .panel-btn:hover {
  border-color: rgba(212, 115, 74, 0.4);
  background: rgba(212, 115, 74, 0.09);
}
html[data-theme="light"] .nav-logo-img {
  display: none;
}
html[data-theme="light"] .nav-logo {
  width: 28px;
  height: 28px;
}
html[data-theme="light"] .nav-logo::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: #5B9BD5;
  -webkit-mask: url('../assets/logo-icon.webp') center / contain no-repeat;
  mask: url('../assets/logo-icon.webp') center / contain no-repeat;
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}
/* === GLOBAL LINK RESET (防止Safari自动识别电话号码/邮箱变蓝色下划线) === */
a { color: inherit; text-decoration: none; background-color: transparent; -webkit-text-decoration-skip: objects; }
a:visited, a:link, a:active { color: inherit; text-decoration: none; }
/* 移动端Safari自动生成的电话/邮箱链接 */
a[href^="tel:"], a[href^="mailto:"] { color: inherit; text-decoration: none; }
a[href^="tel"]:visited, a[href^="mailto:"]:visited { color: inherit; }

/* === BACKGROUND TEXTURE === */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(0, 229, 255, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 60%, rgba(240, 160, 48, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, rgba(0, 229, 255, 0.02) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* === CONTAINER === */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem; position: relative; z-index: 1; }

/* === NAV === */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  transition: all 0.3s;
}
nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-family: var(--font-heading); font-size: 1.1rem; color: var(--accent); letter-spacing: 0.05em; text-decoration: none; }
.nav-logo-img { height: 28px; width: auto; display: block; vertical-align: middle; }
.nav-logo:hover { text-shadow: 0 0 12px var(--accent-glow); }
.nav-links { display: flex; gap: 1.5rem; list-style: none; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
  transition: color 0.3s;
  text-transform: uppercase;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-lang {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--accent);
  border: 1px solid var(--rule);
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  cursor: pointer;
  background: transparent;
  transition: all 0.3s;
  display: inline-block;
  line-height: 1.2;
}
.nav-lang:hover { border-color: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.nav-theme {
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  color: var(--accent);
  border: 1px solid var(--rule);
  padding: 0.25rem 0.45rem;
  border-radius: 3px;
  cursor: pointer;
  background: transparent;
  transition: all 0.3s;
  line-height: 1.2;
}
.nav-theme:hover { border-color: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }

/* Page padding to account for fixed nav */
.page-content { padding-top: 5rem; }

/* === SECTION === */
.section { padding: 5rem 0; position: relative; z-index: 1; }
.section-header { margin-bottom: 3rem; }
.section-tag {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  display: block;
}
.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}
.section-title .num { color: var(--accent); opacity: 0.5; margin-right: 0.5rem; }
.section-desc {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 600px;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 0.7rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  text-transform: uppercase;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 0 32px var(--accent-glow); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.btn-ghost {
  background: transparent;
  border: 1px dashed var(--rule);
  color: var(--muted);
  cursor: not-allowed;
}
.btn-ghost:hover { border-color: var(--muted); }
.btn-sm { font-size: 0.72rem; padding: 0.45rem 1rem; }

/* === PROJECT CARDS === */
.project-card {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.project-card:hover { border-color: var(--accent); box-shadow: 0 0 24px var(--accent-glow); }
.project-card-header {
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}
.project-card-header h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.03em;
}
.project-card-header .meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.project-card-header .meta span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  background: var(--bg3);
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  border: 1px solid var(--rule);
}
.project-card-body {
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.project-card-body .info h4 {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.project-card-body .info p { color: var(--muted); font-size: 0.85rem; line-height: 1.7; margin-bottom: 0.7rem; }
.project-card-body .info .highlight-list { list-style: none; margin-top: 0.5rem; }
.project-card-body .info .highlight-list li {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.3rem 0;
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}
.project-card-body .info .highlight-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.65rem;
}
.project-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.project-metric {
  background: var(--bg3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.project-metric .metric-num {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--accent);
  line-height: 1;
}
.project-metric .metric-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.3rem;
  letter-spacing: 0.04em;
}

/* === IMAGE SLOTS === */
.project-images {
  padding: 0 2rem 2rem;
}
.project-images h4 {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.image-slot {
  aspect-ratio: 16/10;
  background: var(--bg3);
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.image-slot:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.image-slot .slot-icon {
  font-family: var(--font-pixel);
  font-size: 1.5rem;
  opacity: 0.5;
}
.image-slot .slot-label { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.05em; }
.image-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-slot.filled { border-style: solid; border-color: var(--rule); }
.image-slot.filled .slot-icon, .image-slot.filled .slot-label { display: none; }

/* === CATEGORY INTRO === */
.category-intro {
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: var(--bg2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.category-intro h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}
.category-intro p { color: var(--muted); font-size: 0.85rem; }
.category-intro .target-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.8rem; }
.category-intro .target-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent2);
  background: rgba(240, 160, 48, 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  border: 1px solid rgba(240, 160, 48, 0.2);
}

/* === FOOTER === */
footer {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 4rem;
  position: relative;
  z-index: 1;
}

/* === ANIMATIONS === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.6s ease-out forwards; }
.fade-up-d1 { animation-delay: 0.1s; opacity: 0; }
.fade-up-d2 { animation-delay: 0.2s; opacity: 0; }
.fade-up-d3 { animation-delay: 0.3s; opacity: 0; }
.fade-up-d4 { animation-delay: 0.4s; opacity: 0; }

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 4px var(--accent-glow); }
  50% { box-shadow: 0 0 16px var(--accent-glow); }
}

/* === HAMBURGER MENU === */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 1.2rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-body);
  line-height: 1;
}
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* === BACK TO TOP === */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--accent);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  z-index: 90;
  font-family: var(--font-body);
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.back-to-top:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-2px);
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .project-card-body { grid-template-columns: 1fr; }
  .image-grid { grid-template-columns: repeat(2, 1fr); }

  /* 导航改为三列 grid：左侧汉堡、中间 LOGO 绝对居中、右侧按钮组 */
  nav .container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    justify-content: normal;
  }
  .nav-toggle { display: block; grid-column: 1; justify-self: start; }
  .nav-logo { grid-column: 2; justify-self: center; }
  .nav-actions { grid-column: 3; justify-self: end; }
  .nav-links {
    display: none;
    grid-column: 1 / -1;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(8, 12, 20, 0.95);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--rule);
    gap: 0.5rem;
  }
  .nav-links.nav-open { display: flex; }
  .nav-links a { padding: 0.5rem 0; font-size: 0.9rem; }
  .back-to-top { bottom: 1.5rem; right: 1rem; width: 38px; height: 38px; font-size: 1rem; }
}
@media (max-width: 600px) {
  .container { padding: 0 1rem; }
  .image-grid { grid-template-columns: 1fr; }
  .section { padding: 2.5rem 0; }
  .section-title { font-size: 1.4rem; }
  .section-header { margin-bottom: 1.5rem; }
  body { font-size: 15px; }
  .project-card-header { padding: 1.2rem 1rem 1rem; }
  .project-card-body { padding: 1rem; }
  .project-images { padding: 0 1rem 1.2rem; }
  .project-card-header h3 { font-size: 1.1rem; }
  .project-metric .metric-num { font-size: 1.3rem; }
  .page-content { padding-top: 4rem; }
  nav { padding: 0.7rem 0; }
  .btn { font-size: 0.75rem; padding: 0.55rem 1.1rem; }
  footer { margin-top: 2rem; padding: 1.5rem 0; font-size: 0.7rem; }
}

/* ---- Contact CTA ---- */
.contact-cta {
  padding: 3rem 0;
  border-top: 1px solid var(--rule);
  text-align: center;
}
.contact-cta-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 0.8rem;
}
.contact-cta-desc {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
}
.contact-cta-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2rem;
}
.cta-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}
.cta-link:hover { color: var(--accent); }
.cta-link .cta-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
}
.contact-cta-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
}
.contact-cta-footer p {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin: 0;
}

@media (max-width: 600px) {
  .contact-cta-links { flex-direction: column; gap: 0.8rem; align-items: center; }
}

/* ---- Starfield Background ---- */
#pixelCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}
.scanlines {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
  opacity: 0.4;
}

/* ============================================================
   WORLD MAP HERO — removed (2026-08-21): no hero background map
   ============================================================ */
