:root {
  --bg: #f5f7fb;
  --ink: #111827;
  --muted: #64748b;
  --line: #d8e0eb;
  --panel: #ffffff;
  --dark: #101827;
  --dark-soft: #162033;
  --red: #d71920;
  --blue: #2563eb;
  --cyan: #00a6c8;
  --green: #168a5b;
  --shadow: 0 18px 55px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.progress {
  position: fixed;
  z-index: 80;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--red), var(--cyan), var(--blue));
}

.topbar {
  position: sticky;
  z-index: 60;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 48px);
  color: #fff;
  background: rgba(16, 24, 39, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand img {
  width: 80px;
  height: auto;
}

.topbar nav {
  display: flex;
  gap: 18px;
}

.topbar a {
  color: rgba(255, 255, 255, 0.74);
  text-decoration: none;
  font-size: 14px;
}

.map-hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.75fr) minmax(560px, 1.25fr);
  gap: 28px;
  align-items: stretch;
  min-height: calc(100vh - 64px);
  padding: 42px clamp(18px, 4vw, 56px) 26px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(16, 24, 39, 0.96), rgba(28, 38, 58, 0.91)),
    radial-gradient(circle at 20% 10%, rgba(0, 166, 200, 0.28), transparent 42%),
    radial-gradient(circle at 90% 30%, rgba(215, 25, 32, 0.25), transparent 32%);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 620px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.hero-copy h1 {
  margin: 0;
  font-size: 56px;
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-copy p:not(.kicker) {
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 17px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary,
.secondary,
.video-btn,
.chips button {
  border: 0;
  border-radius: 6px;
  font-weight: 800;
}

.primary,
.video-btn {
  padding: 12px 18px;
  color: #fff;
  background: var(--red);
  box-shadow: 0 12px 28px rgba(215, 25, 32, 0.22);
}

.secondary {
  padding: 12px 18px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.digital-map {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  min-height: 640px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.digital-map::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.36;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
}

.map-layer {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}

.systems {
  grid-template-columns: repeat(3, 1fr);
}

.roles {
  grid-template-columns: repeat(4, 1fr);
}

.system-node,
.role-node {
  min-height: 82px;
  padding: 13px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  text-align: left;
  font-weight: 900;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.system-node small,
.role-node small {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.system-node:hover,
.role-node:hover,
.role-node.active {
  transform: translateY(-2px);
  border-color: rgba(0, 166, 200, 0.7);
  background: rgba(0, 166, 200, 0.16);
}

.factory-line {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.factory-line::before,
.factory-line::after {
  content: "";
  position: absolute;
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 166, 200, 0.65), transparent);
}

.factory-line::after {
  transform: rotate(90deg);
}

.factory-core {
  z-index: 2;
  width: min(440px, 90%);
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(16, 24, 39, 0.82);
  text-align: center;
}

.factory-core span {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.factory-core strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.25;
}

.moving-dot {
  position: absolute;
  z-index: 3;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(0, 166, 200, 0.95);
  animation: moveDot 5s linear infinite;
}

.dot-two {
  animation-delay: -1.6s;
  background: var(--red);
}

.dot-three {
  animation-delay: -3.2s;
  background: #f59e0b;
}

@keyframes moveDot {
  0% { transform: translate(-260px, -90px); }
  25% { transform: translate(240px, -90px); }
  50% { transform: translate(240px, 90px); }
  75% { transform: translate(-260px, 90px); }
  100% { transform: translate(-260px, -90px); }
}

.role-focus,
.section {
  padding: 64px clamp(18px, 4vw, 56px);
}

.role-focus {
  display: grid;
  grid-template-columns: minmax(260px, 0.55fr) minmax(420px, 1.45fr);
  gap: 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.role-focus aside {
  padding-right: 20px;
}

.role-focus h2,
.section-head h2 {
  margin: 0;
  font-size: 40px;
  line-height: 1.12;
}

.role-focus p,
.section-head p {
  color: var(--muted);
  line-height: 1.75;
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.focus-card {
  min-height: 176px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.focus-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.focus-card span {
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.focus-card strong {
  display: block;
  margin: 12px 0;
  font-size: 19px;
  line-height: 1.3;
}

.focus-card small {
  color: var(--muted);
  line-height: 1.55;
}

.section-head {
  max-width: 860px;
  margin-bottom: 28px;
}

.general-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.general-card,
.scene-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.general-card {
  display: flex;
  flex-direction: column;
  min-height: 330px;
  padding: 22px;
}

.general-card span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.general-card h3 {
  margin: 12px 0;
  font-size: 24px;
}

.general-card p {
  color: var(--muted);
  line-height: 1.68;
}

.general-card strong {
  display: block;
  margin: auto 0 16px;
  color: var(--dark);
  line-height: 1.55;
}

.scenes-section {
  background: #eef3f8;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 min(430px, 100%);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.search span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
}

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

.chips button {
  padding: 9px 12px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
}

.chips button.active {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.scene-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  align-items: start;
}

.scene-index {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 104px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.scene-index button {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px;
  color: var(--ink);
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font-size: 13px;
}

.scene-index button:hover {
  background: #f1f5f9;
}

.scene-index span {
  color: var(--red);
  font-weight: 900;
}

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

.scene-card {
  padding: 22px;
}

.scene-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.scene-card-head span {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: #fff;
  border-radius: 6px;
  background: var(--dark);
  font-size: 12px;
  font-weight: 800;
}

.scene-card-head strong {
  font-size: 24px;
  line-height: 1.25;
  text-align: right;
}

.meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 16px;
}

.meta div {
  min-width: 0;
  padding: 10px;
  border-radius: 6px;
  background: #f8fafc;
}

.meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.meta dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.scene-card p {
  color: #475569;
  line-height: 1.72;
}

.process {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.process span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #dbe6f2;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
}

.process b {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #fff;
  border-radius: 50%;
  background: var(--blue);
  font-size: 11px;
}

.value-line {
  margin: 18px 0;
  padding: 14px;
  color: #7f1d1d;
  border-left: 4px solid var(--red);
  background: #fff1f2;
  font-weight: 800;
  line-height: 1.55;
}

.card-actions {
  min-height: 42px;
}

.no-video {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
  font-size: 13px;
}

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.72);
}

.modal.show {
  display: flex;
}

.modal-card {
  width: min(980px, 96vw);
  overflow: hidden;
  border-radius: 8px;
  background: #0f172a;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-head button {
  width: 34px;
  height: 34px;
  color: #fff;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 24px;
  line-height: 1;
}

.modal video {
  display: block;
  width: 100%;
  max-height: 72vh;
  background: #000;
}

@media (max-width: 1180px) {
  .map-hero,
  .role-focus,
  .scene-layout {
    grid-template-columns: 1fr;
  }

  .digital-map {
    min-height: 580px;
  }

  .scene-index {
    position: static;
    max-height: 260px;
  }

  .general-grid,
  .focus-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar nav {
    width: 100%;
    overflow-x: auto;
  }

  .map-hero {
    padding-top: 28px;
  }

  .hero-copy h1 {
    font-size: 36px;
  }

  .role-focus h2,
  .section-head h2 {
    font-size: 30px;
  }

  .factory-core strong {
    font-size: 22px;
  }

  .systems,
  .roles,
  .general-grid,
  .focus-grid,
  .cards,
  .meta {
    grid-template-columns: 1fr;
  }

  .digital-map {
    min-height: auto;
  }

  .factory-line {
    min-height: 210px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    flex-basis: auto;
  }

  .scene-card-head {
    display: block;
  }

  .scene-card-head strong {
    display: block;
    margin-top: 10px;
    text-align: left;
  }

  @keyframes moveDot {
    0% { transform: translate(-120px, -72px); }
    25% { transform: translate(120px, -72px); }
    50% { transform: translate(120px, 72px); }
    75% { transform: translate(-120px, 72px); }
    100% { transform: translate(-120px, -72px); }
  }
}
