:root {
  --bg: #050711;
  --bg-alt: #090b18;
  --card-bg: rgba(15, 18, 40, 0.9);
  --accent: #4fd1c5;
  --accent-soft: rgba(79, 209, 197, 0.18);
  --accent-strong: #63f7df;
  --text: #f5f7ff;
  --muted: #9ca3c7;
  --border-subtle: rgba(148, 163, 184, 0.25);
  --chip-bg: rgba(15, 118, 110, 0.18);
  --danger: #fb7185;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.65);

  --grid-line: rgba(15, 23, 42, 0.7);
  --glow-soft: 0 0 35px rgba(56, 189, 248, 0.35);
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, -system, sans-serif;
  background: radial-gradient(circle at top left, #1f2937 0, #020617 42%, #000 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  pointer-events: none;
}

/* 漂浮的霓虹背景云雾 */
body::before {
  background:
    radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(circle at 80% 10%, rgba(45, 212, 191, 0.23), transparent 65%),
    radial-gradient(circle at 20% 90%, rgba(14, 165, 233, 0.18), transparent 60%),
    radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.18), transparent 60%);
  filter: blur(40px);
  opacity: 0.8;
  animation: bg-drift 28s ease-in-out infinite alternate;
}

/* 细网格线背景，增强科技感 */
body::after {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 120px 120px;
  mix-blend-mode: soft-light;
  opacity: 0.5;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.4));
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.65);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: radial-gradient(circle at 20% 20%, var(--accent-strong), transparent 60%),
    radial-gradient(circle at 80% 80%, #22d3ee, transparent 60%);
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.65);
  animation: pulse 2.8s ease-in-out infinite;
}

.brand-text h1 {
  margin: 0;
  font-size: 18px;
}

.brand-text p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
}

.nav a {
  position: relative;
  color: var(--muted);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent), var(--accent-strong));
  transition: width 0.2s ease-out;
}

.nav a:hover,
.nav a:focus {
  color: var(--text);
}

.nav a:hover::after,
.nav a:focus::after {
  width: 100%;
}

.nav a.active {
  color: var(--text);
}

.nav a.active::after {
  width: 100%;
}

main {
  padding-bottom: 40px;
}

.section {
  padding: 48px 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.alt {
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), rgba(15, 23, 42, 0.95));
}

/* 仅在 JS 启用时，才启用滚动浮现动画，避免无 JS 时内容被隐藏 */
.js-ready .section {
  opacity: 0;
  transform: translateY(12px);
}

.js-ready .section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero {
  padding-top: 32px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 28px;
  align-items: flex-start;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.hero-title {
  margin: 14px 0 8px;
  font-size: clamp(26px, 3vw, 32px);
  background: linear-gradient(120deg, var(--accent-strong), #22d3ee, #818cf8);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  color: transparent;
  animation: title-shimmer 12s ease-in-out infinite;
}

.hero-subtitle {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.hero-contact-inline {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
}

.hero-highlights {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.mini-stat {
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(10, 14, 30, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.mini-stat strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text);
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hero-side {
  position: relative;
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 18px 18px 16px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}

.card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-soft), var(--glow-soft);
  border-color: rgba(56, 189, 248, 0.7);
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.1), var(--card-bg));
}

.key-stats h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid rgba(45, 212, 191, 0.35);
  font-size: 12px;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.5);
  border-color: rgba(56, 189, 248, 0.9);
  background: rgba(15, 118, 110, 0.35);
}

.section-header h2 {
  margin: 0 0 6px;
  font-size: 22px;
  background: linear-gradient(120deg, var(--text), var(--accent-strong));
  -webkit-background-clip: text;
  color: transparent;
  display: inline-block;
}

.section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.skills-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.advantage-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.advantage-card {
  position: relative;
  padding-left: 22px;
  border-left: 3px solid transparent;
  border-image: linear-gradient(180deg, var(--accent-strong), #818cf8) 1;
  overflow: hidden;
}

.advantage-card .adv-icon {
  font-size: 24px;
  margin-bottom: 6px;
  filter: saturate(0.8);
}

.advantage-card .adv-num {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 48px;
  font-weight: 900;
  color: rgba(79, 209, 197, 0.06);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.advantage-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--accent-strong);
}

.advantage-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.section-body {
  margin-top: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: flex-start;
}

ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.timeline {
  margin-top: 18px;
  border-left: 2px solid rgba(79, 209, 197, 0.25);
  padding-left: 20px;
}

.timeline-item {
  position: relative;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: var(--card-bg);
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.timeline-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-soft), var(--glow-soft);
  border-color: rgba(56, 189, 248, 0.5);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid var(--accent-strong);
  background: var(--bg);
  box-shadow: 0 0 10px rgba(79, 209, 197, 0.4);
}

.timeline-item::after {
  content: "";
  position: absolute;
  left: -21px;
  top: 25px;
  width: 8px;
  height: 2px;
  background: rgba(79, 209, 197, 0.35);
}

.timeline-meta {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 12px;
  color: var(--accent-strong);
}

.timeline-item h3 {
  margin: 8px 0 6px;
  font-size: 15px;
}

.map-layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.map-card {
  padding: 10px;
}

.career-map {
  width: 100%;
  min-height: 420px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  overflow: hidden;
}

.map-side h3 {
  margin: 0 0 10px;
}

.map-location-list {
  display: grid;
  gap: 10px;
}

.map-location-item {
  width: 100%;
  text-align: left;
  background: rgba(79, 209, 197, 0.04);
  border: 1px solid rgba(79, 209, 197, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.map-location-item:hover {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.1);
  transform: translateY(-1px);
}

.map-location-item.active {
  border-color: rgba(56, 189, 248, 0.9);
  background: rgba(56, 189, 248, 0.16);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25) inset;
}

.map-location-item .meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.map-active-desc {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.leaflet-container {
  background: #0b1220;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.leaflet-popup-content {
  margin: 10px 12px;
  line-height: 1.45;
}

.project {
  position: relative;
  overflow: hidden;
}

.project::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #818cf8, #22d3ee);
  border-radius: 16px 16px 0 0;
}

.project h3 {
  margin-top: 4px;
}

.project-meta {
  display: inline-block;
  margin: 4px 0 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 12px;
  color: var(--accent-strong);
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.contact-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px 24px;
  padding: 24px;
}

.contact-item {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(79, 209, 197, 0.04);
  border: 1px solid rgba(79, 209, 197, 0.12);
  transition: background 0.2s;
}

.contact-item:hover {
  background: rgba(79, 209, 197, 0.08);
}

.contact-item span:first-child {
  color: var(--muted);
  margin-right: 4px;
}

.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  padding: 16px 0 24px;
  background: radial-gradient(circle at bottom, rgba(30, 64, 175, 0.28), #020617 55%);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .nav {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .career-map {
    min-height: 340px;
  }

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

/* 动画定义 */
@keyframes bg-drift {
  0% {
    transform: translate3d(-10px, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(20px, -10px, 0) scale(1.05);
  }
  100% {
    transform: translate3d(-15px, 10px, 0) scale(1.02);
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 14px rgba(45, 212, 191, 0.5);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 34px rgba(45, 212, 191, 0.9);
    transform: scale(1.06);
  }
}

@keyframes title-shimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
