:root {
  --accent: #d68a49;
  --accent-soft: #f0c08f;
  --accent-deep: #8d4c1f;
  --ocean: #164955;
  --ocean-glow: rgba(88, 175, 185, 0.24);
  --land-main: #8f693f;
  --land-alt: #b38b58;
  --panel-bg: rgba(25, 19, 15, 0.86);
  --panel-border: rgba(255, 226, 185, 0.14);
  --text-main: #f8f1e3;
  --text-soft: rgba(248, 241, 227, 0.75);
  --text-muted: rgba(248, 241, 227, 0.56);
  --shadow-soft: 0 18px 70px rgba(0, 0, 0, 0.28);
  --shadow-deep: 0 22px 85px rgba(0, 0, 0, 0.4);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(214, 138, 73, 0.2), transparent 24%),
    radial-gradient(circle at 80% 6%, rgba(88, 175, 185, 0.16), transparent 20%),
    linear-gradient(135deg, #120d0a 0%, #1c1611 52%, #23160d 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background:
    linear-gradient(transparent 97%, rgba(255, 255, 255, 0.25) 98%, transparent 99%),
    linear-gradient(90deg, transparent 97%, rgba(255, 255, 255, 0.2) 98%, transparent 99%);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

.page-shell {
  width: min(1460px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 22px;
  margin-bottom: 22px;
}

.hero-copy,
.hero-stats,
.panel {
  position: relative;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(33, 25, 18, 0.92), rgba(16, 13, 10, 0.92));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.hero-copy::after,
.hero-stats::after,
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 42%);
  pointer-events: none;
}

.hero-copy {
  padding: 34px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background:
    linear-gradient(180deg, rgba(33, 25, 18, 0.92), rgba(16, 13, 10, 0.92)),
    linear-gradient(90deg, var(--panel-border), transparent);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 28px 22px;
  background: rgba(255, 255, 255, 0.02);
}

.hero-stat-value {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.5rem, 2vw, 2.2rem);
  font-weight: 700;
  line-height: 1.05;
}

.hero-stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--accent-soft);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.8rem, 4vw, 4.8rem);
  line-height: 0.95;
}

.hero-summary {
  max-width: 68ch;
  margin: 18px 0 0;
  color: var(--text-soft);
  line-height: 1.75;
  font-size: 1.02rem;
}

.dashboard {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.panel {
  padding: 24px;
}

.panel-head,
.subhead,
.stage-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-badge,
.stage-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 226, 185, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
  font-size: 0.82rem;
  white-space: nowrap;
}

.stage-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.stage-chip {
  background: rgba(214, 138, 73, 0.14);
}

.stage-chip-muted {
  background: rgba(255, 255, 255, 0.05);
}

.timeline-block {
  margin-top: 22px;
}

.timeline-rail {
  display: grid;
  gap: 12px;
}

.timeline-button {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(255, 226, 185, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    rgba(255, 255, 255, 0.01);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.timeline-button:hover,
.timeline-button:focus-visible,
.species-card:hover,
.species-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 226, 185, 0.28);
  outline: none;
}

.timeline-button.active {
  border-color: rgba(214, 138, 73, 0.52);
  background:
    linear-gradient(135deg, rgba(214, 138, 73, 0.18), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 0 0 1px rgba(214, 138, 73, 0.12);
}

.timeline-age {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.timeline-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.timeline-desc {
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.55;
}

.slider-block {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  color: var(--text-soft);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.era-overview {
  margin-top: 28px;
}

.era-overview h3 {
  font-size: 1.95rem;
  line-height: 1.02;
}

.era-meta {
  margin: 10px 0 0;
  color: var(--accent-soft);
  font-size: 0.92rem;
}

.era-summary {
  margin: 16px 0 0;
  color: var(--text-soft);
  line-height: 1.8;
}

.plate-card,
.species-strip,
.climate-card,
.factors-card {
  margin-top: 24px;
}

.subhead-note {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.plate-list {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.plate-list li {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  line-height: 1.65;
  border: 1px solid rgba(255, 226, 185, 0.08);
}

.map-stage {
  padding-bottom: 20px;
}

.map-frame {
  position: relative;
  margin-top: 22px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 226, 185, 0.16);
  background:
    radial-gradient(circle at 50% 50%, rgba(88, 175, 185, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(16, 63, 72, 0.88), rgba(9, 26, 34, 0.98));
  box-shadow: var(--shadow-deep);
}

.paleo-map {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1000 / 540;
}

.map-overlay {
  position: absolute;
  top: 20px;
  z-index: 2;
}

.map-overlay-left {
  left: 20px;
}

.map-overlay-right {
  right: 20px;
}

.overlay-card,
.legend-card {
  min-width: 172px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 19, 24, 0.66);
  backdrop-filter: blur(12px);
}

.overlay-label,
.legend-title {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.overlay-card strong {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.15;
}

.overlay-note {
  display: block;
  margin-top: 8px;
  color: var(--text-soft);
  line-height: 1.5;
  font-size: 0.86rem;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.86rem;
}

.legend-row + .legend-row {
  margin-top: 10px;
}

.legend-icon {
  position: relative;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
}

.legend-land {
  border-radius: 50%;
  background: var(--accent);
}

.legend-sea {
  transform: rotate(45deg);
  background: #6fd7ee;
}

.legend-freshwater {
  border-radius: 4px;
  background: #91e99d;
}

.legend-air::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 13px solid #ffdd7a;
}

.legend-line {
  flex: 0 0 18px;
  width: 18px;
  height: 0;
  border-top: 2px dashed rgba(255, 243, 214, 0.75);
}

.species-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.species-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 226, 185, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    rgba(255, 255, 255, 0.02);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.species-card.active {
  border-color: rgba(214, 138, 73, 0.5);
  background:
    linear-gradient(135deg, rgba(214, 138, 73, 0.16), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.02);
}

.species-type {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.species-card h4 {
  font-size: 1.08rem;
}

.species-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
  font-size: 0.85rem;
}

.detail-panel {
  display: grid;
  gap: 24px;
}

.detail-card,
.climate-card,
.factors-card {
  position: relative;
  z-index: 1;
}

.species-detail {
  margin-top: 18px;
}

.detail-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.type-pill,
.location-pill,
.fact-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  font-size: 0.82rem;
  border: 1px solid rgba(255, 226, 185, 0.12);
}

.detail-title {
  font-size: 2rem;
  line-height: 1;
}

.detail-summary {
  margin: 14px 0 0;
  color: var(--text-soft);
  line-height: 1.8;
}

.detail-facts,
.detail-insights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.detail-section-title {
  margin-top: 22px;
  color: var(--accent-soft);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-note {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 226, 185, 0.08);
}

.metric-card span {
  display: block;
}

.metric-label {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.metric-value {
  margin-top: 8px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.45rem;
  line-height: 1.05;
}

.metric-note {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.5;
}

.factor-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.factor-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 226, 185, 0.08);
}

.factor-card h4 {
  font-size: 1rem;
}

.factor-card p {
  margin: 8px 0 0;
  color: var(--text-soft);
  line-height: 1.65;
  font-size: 0.9rem;
}

.footer-note {
  margin-top: 18px;
  padding: 18px 6px 0;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  font-size: 0.86rem;
}

.map-grid-line {
  stroke: rgba(235, 249, 252, 0.1);
  stroke-width: 1;
}

.map-equator {
  stroke: rgba(255, 217, 153, 0.4);
  stroke-width: 2.5;
  stroke-dasharray: 10 10;
}

.ocean-label,
.continent-label {
  font-family: "Manrope", sans-serif;
  fill: rgba(251, 248, 236, 0.8);
  letter-spacing: 0.08em;
}

.continent-label {
  font-weight: 700;
  font-size: 14px;
}

.ocean-label {
  font-size: 12px;
  text-transform: uppercase;
}

.continent-shape {
  fill: var(--land-main);
  stroke: rgba(252, 235, 194, 0.3);
  stroke-width: 2.4;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.22));
}

.continent-shape.alt {
  fill: var(--land-alt);
}

.tectonic-line {
  fill: none;
  stroke: rgba(255, 244, 214, 0.72);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 7 9;
}

.species-marker {
  cursor: pointer;
  transition: transform 180ms ease;
}

.species-marker:hover,
.species-marker:focus-visible {
  transform: scale(1.08);
  outline: none;
}

.species-marker[data-selected="true"] .marker-outline {
  opacity: 1;
}

.marker-outline {
  fill: none;
  stroke: rgba(255, 248, 231, 0.86);
  stroke-width: 2;
  opacity: 0;
}

.marker-fill-land {
  fill: var(--accent);
}

.marker-fill-sea {
  fill: #74d7ee;
}

.marker-fill-freshwater {
  fill: #8fe49b;
}

.marker-fill-air {
  fill: #f7d974;
}

.marker-pulse {
  fill: rgba(255, 255, 255, 0.12);
  transform-box: fill-box;
  transform-origin: center;
  animation: pulse 2.6s ease-out infinite;
}

.selected-label-bg {
  fill: rgba(10, 21, 27, 0.82);
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
}

.selected-label-text {
  fill: #f9f3e6;
  font-size: 12px;
  font-weight: 600;
}

@keyframes pulse {
  0% {
    opacity: 0.9;
    transform: scale(0.82);
  }

  100% {
    opacity: 0;
    transform: scale(2.15);
  }
}

@media (max-width: 1220px) {
  .dashboard {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .detail-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .page-shell {
    width: min(100vw - 18px, 100%);
    padding-top: 18px;
  }

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

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

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

  .detail-panel {
    grid-template-columns: 1fr;
  }

  .map-overlay {
    position: static;
  }

  .map-frame {
    padding: 14px;
  }

  .overlay-card,
  .legend-card {
    min-width: 0;
    margin-top: 12px;
  }

  .map-overlay-right .legend-card,
  .map-overlay-left .overlay-card {
    width: fit-content;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .hero-copy,
  .panel {
    padding: 18px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

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

  .species-list {
    grid-template-columns: 1fr;
  }

  .stage-head,
  .panel-head,
  .subhead {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
