:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #1a2332;
  --muted: #5a6a7e;
  --line: #d8e0ea;
  --accent-blue: #1a4f8b;
  --accent-teal: #0f766e;
  --accent-amber: #b45309;
  --sea-red: #c0392b;
  --sea-red-deep: #922b21;
  --sea-red-soft: #fdf2f0;
  --sea-blue: #2471a3;
  --sea-blue-deep: #1a5276;
  --sea-blue-soft: #eef5fa;
  --nav-w: 26%;
  --touch: 48px;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(26, 35, 50, 0.08);
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button { font-family: inherit; }

#app {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* -------- LEFT NAV -------- */
.nav {
  width: var(--nav-w);
  min-width: 200px;
  max-width: 320px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--line);
  flex-shrink: 0;
}
.nav-head {
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.nav-head h1 {
  margin: 0;
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 700;
  color: var(--accent-blue);
  line-height: 1.3;
}
.nav-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.nav-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 10px 10px 20px;
}
.nav-group {
  margin: 14px 6px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: none;
  pointer-events: none;
  user-select: none;
}
.nav-group.g-wanxiang { color: #a9443a; }
.nav-group.g-dongxi { color: var(--sea-blue-deep); }
.nav-group.g-gaoli { color: var(--accent-blue); }

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 12px 12px;
  margin-bottom: 4px;
  cursor: pointer;
  color: var(--ink);
  font-size: clamp(15px, 1.5vw, 17px);
  font-weight: 600;
  line-height: 1.35;
  min-height: 44px;
  transition: background .12s, border-color .12s, color .12s;
}
.nav-item:active { transform: scale(0.99); }
.nav-item .nav-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.nav-item.active {
  background: #e8eef6;
  border-color: #c5d4e8;
  color: var(--accent-blue);
}
.nav-item.active .nav-sub { color: var(--accent-blue); opacity: 0.75; }
.nav-item.sea-red.active {
  background: var(--sea-red-soft);
  border-color: #f0c4bc;
  color: var(--sea-red-deep);
}
.nav-item.sea-blue.active {
  background: var(--sea-blue-soft);
  border-color: #b8d4e8;
  color: var(--sea-blue-deep);
}

/* -------- RIGHT STAGE -------- */
.stage {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
}

/* -------- OVERVIEW -------- */
.overview {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 16px;
  overflow: hidden;
}
.overview.hidden { display: none !important; }
.overview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.overview-head h2 {
  margin: 0;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  color: var(--accent-blue);
}
.overview-hint {
  font-size: 13px;
  color: var(--muted);
}

.floor {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1.1fr;
  grid-template-rows: 1.05fr 0.95fr 1.05fr;
  gap: 10px;
  padding: 8px;
  background: linear-gradient(180deg, #e8eef6 0%, #f7fafc 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}
.floor::before {
  content: "展区示意 · 点色块也可跳转";
  position: absolute;
  left: 14px; bottom: 8px;
  font-size: 11px; color: var(--muted);
  pointer-events: none;
  z-index: 1;
}

.zone-card {
  border: none;
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 0;
  transition: transform .12s ease, filter .12s ease;
  position: relative;
  overflow: hidden;
  user-select: none;
}
.zone-card[data-jump]:active { transform: scale(0.98); filter: brightness(0.95); }
.zone-card .z-title {
  font-size: clamp(20px, 2.8vw, 34px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.02em;
  width: 100%;
}
.zone-card .z-sub {
  margin-top: 6px;
  font-size: clamp(12px, 1.4vw, 16px);
  font-weight: 600;
  opacity: 0.92;
  line-height: 1.3;
  width: 100%;
}

.z-weiti { background: linear-gradient(145deg, var(--sea-red), var(--sea-red-deep)); grid-area: 1 / 1 / 2 / 2; }
.z-zhihui { background: linear-gradient(145deg, var(--sea-red), var(--sea-red-deep)); grid-area: 1 / 3 / 2 / 4; }
.z-weicao { background: linear-gradient(145deg, var(--sea-blue), var(--sea-blue-deep)); grid-area: 1 / 2 / 2 / 3; }
.z-dongxi {
  background: linear-gradient(145deg, var(--sea-blue), var(--sea-blue-deep));
  grid-area: 3 / 1 / 4 / 2;
  padding: 10px 12px;
  align-self: end;
  max-height: 70%;
}
.z-dongxi .z-title { font-size: clamp(18px, 2.4vw, 28px); }
.z-dongxi .z-sub { margin-top: 4px; font-size: clamp(11px, 1.2vw, 14px); }
.z-talk {
  background: #7f8c8d;
  grid-area: 2 / 3 / 3 / 4;
  cursor: default;
  opacity: 0.85;
  filter: saturate(0.7);
}

.z-ball {
  background: transparent;
  box-shadow: none;
  grid-area: 3 / 2 / 4 / 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  gap: 6px;
  padding: 0;
  cursor: default;
}
.z-ball .ball-label,
.z-gaoli .ball-label {
  grid-column: 1 / -1;
  font-size: clamp(12px, 1.3vw, 15px);
  font-weight: 700;
  padding: 0 2px;
}
.z-ball .ball-label { color: var(--sea-blue-deep); }
.z-gaoli .ball-label { color: var(--ink); }
.z-ball .inner {
  background: linear-gradient(145deg, var(--sea-blue), var(--sea-blue-deep));
  border: none;
  border-radius: var(--radius);
  padding: 12px 10px;
  color: #fff;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  box-shadow: var(--shadow);
}
.z-ball .inner .z-title,
.z-gaoli .inner .z-title {
  font-size: clamp(16px, 2.2vw, 26px);
  font-weight: 800;
  line-height: 1.2;
}
.z-ball .inner:active,
.z-gaoli .inner:active { filter: brightness(0.95); }

.z-gaoli {
  background: transparent;
  box-shadow: none;
  grid-area: 3 / 3 / 4 / 4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  gap: 6px;
  padding: 0;
  cursor: default;
}
.z-gaoli .inner {
  border: none;
  border-radius: var(--radius);
  padding: 12px 10px;
  color: #fff;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  box-shadow: var(--shadow);
}
.z-gaoli .inner.sea-red { background: linear-gradient(145deg, var(--sea-red), var(--sea-red-deep)); }
.z-gaoli .inner.sea-blue { background: linear-gradient(145deg, var(--sea-blue), var(--sea-blue-deep)); }

.corridor {
  grid-area: 2 / 1 / 3 / 3;
  border: 1.5px dashed #b7c4d4;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  background: rgba(255,255,255,.9);
  min-height: 0;
  overflow: hidden;
  z-index: 2;
}
.guide-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 4px 6px;
  border-radius: 8px;
}
.guide-card.guide-red { background: rgba(192,57,43,.04); }
.guide-card.guide-blue { background: rgba(36,113,163,.05); }
.guide-tag {
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 700;
  color: var(--accent-blue);
}
.guide-lead {
  margin: 0;
  font-size: clamp(12px, 1.2vw, 14px);
  font-weight: 700;
}
.guide-red .guide-lead { color: var(--sea-red); }
.guide-blue .guide-lead { color: var(--sea-blue); }
.guide-body {
  margin: 0;
  font-size: clamp(11px, 1.15vw, 13px);
  line-height: 1.4;
  color: var(--ink);
}
.guide-body strong { font-weight: 700; color: var(--accent-blue); }

/* -------- DECK (horizontal cards) -------- */
.deck {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 16px 10px;
}
.deck.hidden { display: none !important; }

.deck-meta {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  min-height: 28px;
}
.deck-meta .chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  background: #e8eef6;
  color: var(--accent-blue);
  font-weight: 600;
}
.deck-meta .chip.duration { background: #ecf7f5; color: var(--accent-teal); }
.deck-meta .chip.kind {
  background: #f3f0ff;
  color: #5b4bb7;
}
.deck-meta .chip.kind.case { background: #fff4e6; color: var(--accent-amber); }
.deck-meta .chip.plate { cursor: default; }
.deck-meta button.chip {
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
.deck-meta .chip.jump {
  background: #f3f0ff;
  color: #5b4bb7;
}
.deck-meta .chip.jump.active {
  background: #5b4bb7;
  color: #fff;
}
.deck-meta .chip.case-jump {
  background: #fff4e6;
  color: var(--accent-amber);
  border: 1px solid rgba(217, 119, 6, 0.35);
  margin-left: 4px;
}
.deck-meta .chip.case-jump.active {
  background: var(--accent-amber);
  color: #fff;
  border-color: transparent;
}

.deck-viewport {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  border-radius: 16px;
  touch-action: pan-y;
}
.deck-track {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 0.28s ease;
  will-change: transform;
}
.slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  padding: 2px 4px;
  overflow: hidden;
  display: flex;
}
.slide-card {
  flex: 1;
  min-height: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.slide-card.tone-red { border-top: 3px solid rgba(192,57,43,.45); }
.slide-card.tone-blue { border-top: 3px solid rgba(36,113,163,.45); }

.slide-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
  flex-shrink: 0;
}
.slide-title {
  margin: 0 0 10px;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  flex-shrink: 0;
}
.slide-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  font-size: clamp(15px, 1.7vw, 19px);
  line-height: 1.58;
  color: var(--ink);
}
.slide-body p {
  margin: 0 0 10px;
}
.slide-body p:last-child { margin-bottom: 0; }
.slide-body strong { color: var(--accent-blue); font-weight: 700; }

.kp-list {
  margin: 0;
  padding-left: 1.25em;
}
.kp-list li {
  margin: 0 0 12px;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.5;
  font-weight: 700;
}
.kp-list li:nth-child(3n+1) { color: var(--accent-blue); }
.kp-list li:nth-child(3n+2) { color: var(--accent-teal); }
.kp-list li:nth-child(3n+3) { color: var(--accent-amber); }
.kp-list li:last-child { margin-bottom: 0; }

/* Case slide: image + text compact */
.slide-card.case-slide-card {
  padding: 14px 16px;
}
.case-gallery {
  position: relative;
  flex: 0 0 42%;
  max-height: 48%;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
  margin-bottom: 10px;
  flex-shrink: 1;
  min-height: 120px;
}
.case-track-inner { width: 100%; height: 100%; }
.case-frame {
  display: none;
  width: 100%;
  height: 100%;
}
.case-frame.active { display: block; }
.case-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.case-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.88);
  color: #1a2332;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.case-nav.prev { left: 8px; }
.case-nav.next { right: 8px; }
.case-dots {
  position: absolute;
  left: 0; right: 0; bottom: 8px;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}
.case-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255,255,255,.45);
  cursor: pointer;
}
.case-dot.active { background: #fff; }

.case-text {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.case-text h3 {
  margin: 0 0 6px;
  font-size: clamp(16px, 1.8vw, 20px);
  color: var(--accent-teal);
  flex-shrink: 0;
  line-height: 1.3;
}
.case-text p {
  margin: 0;
  font-size: clamp(13px, 1.4vw, 16px);
  line-height: 1.55;
  color: var(--ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
}

.deck-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 0 4px;
}
.deck-btn {
  min-width: 120px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent-blue);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(26,35,50,.06);
}
.deck-btn:active { background: #eef3f9; }
.deck-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.deck-counter {
  min-width: 72px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Side chevrons for large screens */
.deck-side {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.92);
  color: var(--accent-blue);
  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.deck-side.prev { left: 8px; }
.deck-side.next { right: 8px; }
@media (min-width: 1100px) {
  .deck-side { display: flex; }
  .deck-viewport { margin: 0 52px; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(26,35,50,.92);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50;
  max-width: 80vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hidden { display: none !important; }

@media (max-width: 900px) {
  :root { --nav-w: 34%; }
  .floor {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .z-weiti, .z-weicao, .z-zhihui, .z-talk, .z-dongxi, .z-ball, .z-gaoli {
    grid-area: auto;
  }
  .corridor {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    order: -1;
  }
  .z-ball, .z-gaoli { min-height: 110px; }
  .deck-side { display: none; }
  .deck-viewport { margin: 0; }
}

.overview-prose {
  font-size: clamp(14px, 1.55vw, 17.5px);
  line-height: 1.55;
}
.overview-prose p { margin: 0 0 8px; }
.overview-prose p:last-child { margin-bottom: 0; }

/* Audience segment tags — glanceable on reception cards */
.audience {
  font-weight: 800;
  font-size: 1.28em;
  line-height: 1.35;
  color: var(--accent-blue);
  letter-spacing: 0.02em;
}
.audience-line {
  margin: 10px 0 8px;
}
.overview-prose .audience,
.slide-body .audience {
  font-size: clamp(18px, 2.15vw, 24px);
  font-weight: 800;
  color: var(--accent-blue);
}
.slide-body .audience {
  display: inline;
}
