/* ==========================================
   OpsDash 二级 PPT 共用样式
   抽取自主 PPT，保证视觉一致
   ========================================== */

/* ===== 基础重置 ===== */
@page { size: 254mm 190.5mm landscape; margin: 0; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  font-size: 15px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  background: #0a0e1a;
}

/* ===== 色板 ===== */
:root {
  --deep: #0a1628;
  --deep-2: #0d1b30;
  --cyan: #00d4ff;
  --cyan-dim: rgba(0,212,255,0.12);
  --blue: #0284c7;
  --blue-2: #4f8cff;
  --purple: #8b5cf6;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --pink: #ec4899;
  --text-w: #f1f5f9;
  --text-dim: rgba(241,245,249,0.55);
  --card: rgba(255,255,255,0.04);
  --card-border: rgba(255,255,255,0.08);
  --glow-cyan: 0 0 40px rgba(0,212,255,0.15);
}

/* ===== Slide 容器 ===== */
.slide {
  width: 960px;
  height: 540px;
  margin: 20px auto;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  color: var(--text-w);
  background:
    radial-gradient(800px 400px at 15% 20%, rgba(0,212,255,0.06), transparent 70%),
    radial-gradient(600px 300px at 85% 80%, rgba(79,140,255,0.06), transparent 70%),
    linear-gradient(145deg, #0a1628 0%, #0d1b30 50%, #081021 100%);
}
.slide::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.slide-num {
  position: absolute; bottom: 16px; right: 24px;
  font-size: 11px; color: var(--text-dim);
  letter-spacing: 1px;
}
.slide-body {
  position: relative; z-index: 2;
  padding: 40px 52px;
  height: 100%;
  display: flex; flex-direction: column;
}

/* ===== 返回主 PPT 按钮（淡白色，悬浮可见不抢戏） ===== */
.back-link {
  position: absolute; top: 10px; right: 18px;
  z-index: 10;
  display: flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 99px;
  color: rgba(255,255,255,0.4);
  font-size: 10px; font-weight: 500;
  text-decoration: none;
  opacity: 0.75;
  transition: all 0.3s;
}
.back-link .svg-icon { width: 11px; height: 11px; stroke-width: 2; }
.back-link:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.35);
  color: #fff;
  opacity: 1;
  transform: translateX(-2px);
}

/* ===== 通用组件 ===== */
.badge {
  display: inline-block;
  padding: 4px 14px;
  background: var(--cyan-dim);
  border: 1px solid rgba(0,212,255,0.3);
  border-radius: 99px;
  font-size: 11px; color: var(--cyan);
  letter-spacing: 2px;
  font-weight: 500;
}
.section-title {
  font-size: 32px; font-weight: 800; line-height: 1.2;
  margin-bottom: 6px;
}
.section-title .grad {
  background: linear-gradient(120deg, #00d4ff, #4f8cff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-sub {
  font-size: 14px; color: var(--text-dim); line-height: 1.6;
  max-width: 680px;
}
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 18px 20px;
  backdrop-filter: blur(8px);
}

/* ===== SVG 图标 ===== */
.svg-icon {
  width: 22px; height: 22px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: transform 0.3s, stroke-width 0.3s;
}
.svg-icon.lg { width: 26px; height: 26px; }
.svg-icon.xl { width: 32px; height: 32px; stroke-width: 1.6; }
.svg-icon.sm { width: 16px; height: 16px; stroke-width: 2; }

/* ==========================================
   通用布局组件
   ========================================== */

/* 2/3/4 列网格 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; flex: 1; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; flex: 1; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; flex: 1; }
.flex-row { display: flex; gap: 16px; flex: 1; }

/* 功能卡片（二级 PPT 标准） */
.feat-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 18px 20px;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.35s,
              box-shadow 0.4s,
              background 0.35s;
  position: relative;
}
.feat-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(0,212,255,0.5);
  background: rgba(0,212,255,0.05);
  box-shadow:
    0 16px 40px rgba(0,0,0,0.5),
    0 0 0 1px rgba(0,212,255,0.35),
    0 0 32px rgba(0,212,255,0.2);
}
.feat-card .feat-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px;
}
.feat-card .feat-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.feat-card:hover .feat-icon { transform: scale(1.15) rotate(-6deg); }
.feat-card h3, .feat-card h4 {
  font-size: 14px; font-weight: 700;
}
.feat-card p {
  font-size: 12px; color: var(--text-dim); line-height: 1.6;
}

/* 数字标签 */
.num-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; padding: 0 8px;
  border-radius: 14px;
  background: linear-gradient(120deg, var(--cyan), var(--blue-2));
  color: #fff;
  font-size: 13px; font-weight: 700;
}

/* 步骤线 */
.step-flow {
  display: flex; align-items: stretch; gap: 0;
}
.step-flow .step {
  flex: 1;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  position: relative;
}
.step-flow .step:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -11px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 2px;
  background: linear-gradient(90deg, rgba(0,212,255,0.6), rgba(0,212,255,0.1));
  z-index: 2;
}
.step-flow .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,212,255,0.15);
  border: 1px solid rgba(0,212,255,0.35);
  color: var(--cyan);
  font-size: 11px; font-weight: 700;
  margin-bottom: 6px;
}
.step-flow .step h5 { font-size: 12.5px; font-weight: 700; margin-bottom: 4px; }
.step-flow .step p { font-size: 11px; color: var(--text-dim); line-height: 1.5; }

/* 代码/配置块 */
.code-block {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 11px;
  line-height: 1.6;
  color: #c5e4ff;
  overflow: hidden;
}
.code-block .comment { color: rgba(197,228,255,0.45); }
.code-block .key { color: var(--cyan); }
.code-block .val { color: var(--green); }
.code-block .str { color: var(--orange); }

/* 数据表格 */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11.5px;
}
.data-table th, .data-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.data-table th {
  color: var(--cyan);
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom-color: rgba(0,212,255,0.25);
}
.data-table tr:hover td {
  background: rgba(0,212,255,0.03);
}

/* 指标卡 */
.metric-card {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex; flex-direction: column;
  gap: 4px;
}
.metric-card .m-num {
  font-size: 26px; font-weight: 800;
  background: linear-gradient(120deg, var(--cyan), var(--blue-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  line-height: 1;
}
.metric-card .m-label {
  font-size: 11px; color: var(--text-dim);
}

/* Tip 提示 */
.tip-box {
  padding: 10px 14px;
  background: rgba(0,212,255,0.06);
  border-left: 3px solid var(--cyan);
  border-radius: 0 6px 6px 0;
  font-size: 11.5px; color: var(--text-dim);
  line-height: 1.55;
}
.tip-box strong { color: var(--cyan); }
.tip-box.warn {
  background: rgba(245,158,11,0.06);
  border-left-color: var(--orange);
}
.tip-box.warn strong { color: var(--orange); }
.tip-box.danger {
  background: rgba(239,68,68,0.06);
  border-left-color: var(--red);
}
.tip-box.danger strong { color: var(--red); }

/* 图标列表 */
ul.icon-list { list-style: none; padding: 0; }
ul.icon-list li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 5px 0;
  font-size: 12px; line-height: 1.55; color: var(--text-dim);
}
ul.icon-list li .li-icon {
  width: 16px; height: 16px;
  color: var(--cyan); opacity: 0.75;
  margin-top: 2px; flex-shrink: 0;
}
ul.icon-list li strong { color: var(--text-w); }

/* ==========================================
   演示模式控制栏
   ========================================== */
#presenter-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(10,22,40,0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(0,212,255,0.15);
  padding: 10px 24px;
  text-align: center;
  z-index: 9999;
  font-size: 13px; color: var(--text-dim);
  transition: opacity 0.3s;
}
#presenter-bar kbd {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  color: var(--cyan);
}

/* ==========================================
   全屏演示模式（scale transform 等比放大）
   ========================================== */
body.presenting {
  overflow: hidden;
  background: #000;
}
body.presenting .slide {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  width: 960px;
  height: 540px;
  margin: 0;
  border-radius: 0;
  z-index: 1000;
  transform: translate(-50%, -50%) scale(var(--slide-scale, 1));
  transform-origin: center center;
}
body.presenting .slide.active { display: block; }
body.presenting #presenter-bar {
  opacity: 0;
  pointer-events: none;
}

#progress-bar {
  display: none;
  position: fixed; top: 0; left: 0;
  height: 3px;
  z-index: 10001;
  transition: width 0.3s ease;
  background: linear-gradient(90deg, var(--cyan), var(--blue-2), var(--cyan));
  background-size: 200% 100%;
  animation: gradientShift 3s linear infinite;
}
body.presenting #progress-bar { display: block; }

#slide-nav {
  display: none;
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 10001;
  gap: 6px;
}
body.presenting #slide-nav { display: flex; }
.nav-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}
.nav-dot.active {
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0,212,255,0.4);
  transform: scale(1.3);
}
.nav-dot.active::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: var(--cyan);
  animation: ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.nav-dot:hover { background: rgba(0,212,255,0.5); }

/* ==========================================
   动画关键帧
   ========================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(0,212,255,0.15), 0 0 40px rgba(0,212,255,0.08); }
  50%      { box-shadow: 0 0 40px rgba(0,212,255,0.35), 0 0 80px rgba(0,212,255,0.15); }
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes gridPan {
  from { background-position: 0 0; }
  to   { background-position: 40px 40px; }
}
@keyframes shimmer {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}
@keyframes ping {
  0% { transform: scale(1); opacity: 0.6; }
  80%, 100% { transform: scale(2.2); opacity: 0; }
}
@keyframes arrowFlow {
  0%, 100% { transform: translateX(0); opacity: 0.4; }
  50%      { transform: translateX(4px); opacity: 0.9; }
}

/* 封面背景网格轻微平移 */
.slide::before { animation: gridPan 16s linear infinite; }

/* 渐变文字流光 */
.grad {
  background-size: 200% 100%;
  animation: gradientShift 6s ease infinite;
}

/* 全屏入场动画：仅当前激活页触发 */
body.presenting .slide.active .badge,
body.presenting .slide.active .section-title,
body.presenting .slide.active .section-sub,
body.presenting .slide.active .feat-card,
body.presenting .slide.active .metric-card,
body.presenting .slide.active .step-flow .step,
body.presenting .slide.active .code-block,
body.presenting .slide.active .data-table,
body.presenting .slide.active .tip-box,
body.presenting .slide.active .num-badge,
body.presenting .slide.active ul.icon-list li {
  opacity: 0;
  animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body.presenting .slide.active .badge { animation-delay: 0.05s; }
body.presenting .slide.active .section-title { animation-delay: 0.15s; }
body.presenting .slide.active .section-sub { animation-delay: 0.30s; }

/* 错位延迟 — 网格/列表项 */
body.presenting .slide.active .feat-card:nth-child(1),
body.presenting .slide.active .metric-card:nth-child(1),
body.presenting .slide.active .step-flow .step:nth-child(1),
body.presenting .slide.active ul.icon-list li:nth-child(1) { animation-delay: 0.40s; }
body.presenting .slide.active .feat-card:nth-child(2),
body.presenting .slide.active .metric-card:nth-child(2),
body.presenting .slide.active .step-flow .step:nth-child(2),
body.presenting .slide.active ul.icon-list li:nth-child(2) { animation-delay: 0.50s; }
body.presenting .slide.active .feat-card:nth-child(3),
body.presenting .slide.active .metric-card:nth-child(3),
body.presenting .slide.active .step-flow .step:nth-child(3),
body.presenting .slide.active ul.icon-list li:nth-child(3) { animation-delay: 0.60s; }
body.presenting .slide.active .feat-card:nth-child(4),
body.presenting .slide.active .metric-card:nth-child(4),
body.presenting .slide.active .step-flow .step:nth-child(4),
body.presenting .slide.active ul.icon-list li:nth-child(4) { animation-delay: 0.70s; }
body.presenting .slide.active .feat-card:nth-child(5),
body.presenting .slide.active .step-flow .step:nth-child(5),
body.presenting .slide.active ul.icon-list li:nth-child(5) { animation-delay: 0.80s; }
body.presenting .slide.active .feat-card:nth-child(6),
body.presenting .slide.active ul.icon-list li:nth-child(6) { animation-delay: 0.90s; }
body.presenting .slide.active .code-block,
body.presenting .slide.active .data-table,
body.presenting .slide.active .tip-box { animation-delay: 0.50s; }

/* 兼容无障碍偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
