/* ==========================================================================
   CoachOS 先导介绍页 · PPT 逐帧放映样式系统
   ========================================================================== */

:root {
  --deck-bg: #0B1220;
  --deck-surface: #111C30;
  --slide-bg: #FFFFFF;
  --slide-subtle: #F8FAFC;
  --slide-border: #E2E8F0;
  --ink-1: #0F172A;
  --ink-2: #475569;
  --ink-3: #64748B;
  --ocean: #1456B8;
  --ocean-tint: #EFF6FF;
  --teal: #0D9488;
  --teal-tint: #F0FDFA;
  --amber: #EA580C;
  --amber-tint: #FFF7ED;
  --gold: #D97706;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: radial-gradient(circle at 20% 0%, #172542 0%, #0B1220 55%, #070C17 100%);
  color: #F8FAFC;
  font-family: 'Plus Jakarta Sans', 'Noto Sans SC', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.font-display {
  font-family: 'DM Serif Display', 'Noto Serif SC', serif;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

.hidden {
  display: none !important;
}

/* 顶部放映控制栏 */
.intro-topbar {
  height: 50px;
  padding: 0 18px;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 40;
}

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

.intro-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #1456B8, #0D9488);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 16px;
}

.intro-progress-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.intro-counter-pill {
  font-size: 12px;
  font-weight: 600;
  color: #CBD5E1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.22);
  padding: 4px 10px;
  border-radius: 999px;
}

.intro-frame-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.frame-dot {
  width: 20px;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.frame-dot.done {
  background: rgba(13, 148, 136, 0.65);
}

.frame-dot.active {
  width: 30px;
  background: #38BDF8;
}

.intro-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deck-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.07);
  color: #E2E8F0;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.16s ease;
  font-family: inherit;
}

.deck-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
}

.deck-btn-primary {
  background: linear-gradient(135deg, #1456B8, #0D9488);
  border-color: rgba(94, 234, 212, 0.35);
  color: #FFFFFF;
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.3);
}

.deck-btn-primary:hover {
  filter: brightness(1.08);
}

.deck-btn-light {
  background: #FFFFFF;
  color: var(--ink-1);
  border-color: var(--slide-border);
}

.deck-btn-light:hover {
  background: var(--ocean-tint);
  border-color: var(--ocean);
  color: var(--ocean);
}

/* 幻灯片主舞台 */
.intro-stage-wrap {
  max-width: 1760px;
  width: 100%;
  height: calc(100vh - 102px);
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.slide-canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--slide-bg);
  color: var(--ink-1);
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 20px 52px rgba(2, 6, 23, 0.5);
  padding: 20px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow-y: auto;
  animation: slideEnter 0.25s ease-out;
}

.slide-canvas.slide-arch {
  padding: 12px 16px;
  justify-content: flex-start;
  overflow: hidden;
}

.slide-canvas.slide-arch .slide-header {
  margin-bottom: 8px;
}

.slide-canvas.slide-arch .slide-title {
  font-size: 22px;
}

.slide-canvas.slide-arch .slide-sub {
  font-size: 12.5px;
  margin-top: 3px;
}

.slide-canvas.slide-hero {
  background: linear-gradient(135deg, #0F172A 0%, #153E75 56%, #0D6E68 100%);
  color: #FFFFFF;
  border-color: rgba(56, 189, 248, 0.28);
}

@keyframes slideEnter {
  from { opacity: 0.4; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.slide-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--ocean-tint);
  color: var(--ocean);
  margin-bottom: 8px;
}

.slide-hero .slide-eyebrow {
  background: rgba(56, 189, 248, 0.16);
  color: #7DD3FC;
  border: 1px solid rgba(125, 211, 252, 0.25);
}

.slide-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
}

.slide-sub {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
}

.slide-hero .slide-sub {
  color: #CBD5E1;
}

/* 逐帧显隐动效 */
[data-frame] {
  transition: opacity 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

[data-frame].frame-dimmed {
  opacity: 0.18;
  transform: translateY(6px);
  cursor: pointer;
}

[data-frame].frame-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-frame].frame-active {
  border-color: var(--ocean) !important;
  box-shadow: 0 10px 28px rgba(20, 86, 184, 0.14);
}

/* 卡片网格布局 */
.deck-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

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

.deck-card {
  background: var(--slide-subtle);
  border: 1.5px solid var(--slide-border);
  border-radius: 16px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deck-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}

/* Draw.io 架构页分屏展示 */
.arch-split {
  display: grid;
  grid-template-columns: minmax(0, 3.1fr) minmax(250px, 1fr);
  gap: 14px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.arch-diagram-box {
  background: #FFFFFF;
  border: 1px solid var(--slide-border);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.arch-svg-frame {
  background: #FFFFFF;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.arch-svg-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.arch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.arch-layer-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.layer-pill-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--slide-border);
  background: #FFFFFF;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.layer-pill-btn.active {
  background: var(--ocean);
  color: #FFFFFF;
  border-color: var(--ocean);
}

.arch-notes-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  justify-content: flex-start;
}

.arch-note-card {
  background: var(--slide-subtle);
  border: 1.5px solid var(--slide-border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.55;
}

/* 封面与结尾特色组件 */
.hero-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.hero-kpi-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  padding: 14px 16px;
}

.hero-kpi-item .num {
  font-size: 24px;
  font-weight: 700;
  color: #5EEAD4;
}

.hero-kpi-item .lbl {
  font-size: 12px;
  color: #CBD5E1;
  margin-top: 4px;
}

.entry-portal-card {
  background: #FFFFFF;
  border: 1.5px solid var(--slide-border);
  border-radius: 16px;
  padding: 20px;
  text-decoration: none;
  color: var(--ink-1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.18s ease;
}

.entry-portal-card:hover {
  border-color: var(--ocean);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(20, 86, 184, 0.12);
}

/* 底部控制坞 */
.intro-bottombar {
  height: 52px;
  padding: 0 18px;
  background: rgba(11, 18, 32, 0.9);
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chapter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  max-width: 65vw;
}

.chap-pill {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  color: #94A3B8;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.chap-pill.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
  color: #E0F2FE;
}

/* 目录总览与高清灯箱浮层 */
.deck-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 12, 23, 0.84);
  backdrop-filter: blur(8px);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.deck-modal-box {
  background: #FFFFFF;
  color: var(--ink-1);
  border-radius: 18px;
  max-width: 1080px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 26px;
}

.deck-modal-box.lightbox-full {
  max-width: calc(100vw - 20px);
  width: calc(100vw - 20px);
  height: calc(100vh - 20px);
  max-height: calc(100vh - 20px);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.deck-modal-box.lightbox-full > :not(.lightbox-viewport) {
  flex-shrink: 0;
}

.lightbox-viewport {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  background: #FFFFFF;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-viewport img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* 浏览器全屏边缘铺满优化 */
body.is-fullscreen .intro-topbar,
:fullscreen body .intro-topbar {
  height: 44px;
  padding: 0 14px;
}

body.is-fullscreen .intro-bottombar,
:fullscreen body .intro-bottombar {
  height: 46px;
  padding: 0 14px;
}

body.is-fullscreen .intro-stage-wrap,
:fullscreen body .intro-stage-wrap {
  max-width: none;
  height: calc(100vh - 90px);
  padding: 4px 6px;
}

body.is-fullscreen .slide-canvas,
:fullscreen body .slide-canvas {
  border-radius: 12px;
  padding: 16px 22px;
}

body.is-fullscreen .slide-canvas.slide-arch,
:fullscreen body .slide-canvas.slide-arch {
  padding: 8px 10px;
}

body.is-fullscreen .arch-split,
:fullscreen body .arch-split {
  grid-template-columns: minmax(0, 3.6fr) minmax(240px, 1fr);
  gap: 10px;
}

body.is-fullscreen .arch-diagram-box,
:fullscreen body .arch-diagram-box {
  padding: 4px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.overview-tile {
  text-align: left;
  background: var(--slide-subtle);
  border: 1.5px solid var(--slide-border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  font-family: inherit;
}

.overview-tile.active {
  border-color: var(--ocean);
  background: var(--ocean-tint);
}

@media (max-width: 1024px) {
  .intro-stage-wrap {
    height: auto;
    min-height: calc(100vh - 102px);
  }
  .arch-split,
  .deck-grid-3,
  .deck-grid-4,
  .hero-kpi-row,
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .slide-canvas {
    height: auto;
    padding: 24px 20px;
    min-height: 520px;
  }
  .arch-svg-frame {
    min-height: 260px;
  }
  .chapter-pills {
    display: none;
  }
}
