/* === CSS 变量 === */
:root {
  --bg: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #555;
  --text-muted: #636e72;
  --brand-blue: #325AB4;
  --brand-blue-bg: #e8edf8;

  /* 五特质色 */
  --trait-1: #e94560;
  --trait-1-bg: #ffe8ec;
  --trait-1-border: #f0b8c2;
  --trait-2: #2980b9;
  --trait-2-bg: #dceeff;
  --trait-2-border: #a8c8e8;
  --trait-3: #00b894;
  --trait-3-bg: #d5f5e8;
  --trait-3-border: #8dd8bc;
  --trait-4: #8e44ad;
  --trait-4-bg: #ede0f5;
  --trait-4-border: #c8a8d8;
  --trait-5: #f39c12;
  --trait-5-bg: #fef0cc;
  --trait-5-border: #f0c060;

  --font-xl: 48px;
  --font-lg: 32px;
  --font-md: 24px;
  --font-sm: 20px;
  --font-xs: 16px;
}

/* === Reveal.js 全局覆盖 === */
.reveal {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.reveal .slides section {
  text-align: left;
  padding: 60px 60px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

/* 修复幻灯片内容偏右 —— 确保 Reveal.js 容器不居中挤压内容 */
.reveal .slides {
  text-align: left;
}

.reveal .slides > section {
  padding: 60px 60px;
  width: 100%;
  box-sizing: border-box;
}

.reveal h2 {
  font-size: var(--font-xl);
  font-weight: 900;
  color: var(--brand-blue);
  margin-bottom: 12px;
}

.reveal h3 {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.reveal p {
  font-size: var(--font-md);
  color: var(--text-secondary);
  line-height: 1.6;
}

.reveal ul {
  font-size: var(--font-md);
  color: var(--text-secondary);
  line-height: 1.8;
}

/* === 特质章节封面页 === */
.trait-cover {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 70vh;
}

.trait-cover .trait-number {
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 8px;
}

.trait-cover .trait-title {
  font-size: var(--font-xl);
  font-weight: 900;
  margin-bottom: 8px;
}

.trait-cover .trait-subtitle {
  font-size: var(--font-lg);
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.trait-cover .trait-badge {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: var(--font-md);
  font-weight: 600;
}

/* 五特质颜色变体 */
.trait-1 { color: var(--trait-1); }
.trait-1-bg { background: var(--trait-1-bg); border: 2px solid var(--trait-1-border); }
.trait-2 { color: var(--trait-2); }
.trait-2-bg { background: var(--trait-2-bg); border: 2px solid var(--trait-2-border); }
.trait-3 { color: var(--trait-3); }
.trait-3-bg { background: var(--trait-3-bg); border: 2px solid var(--trait-3-border); }
.trait-4 { color: var(--trait-4); }
.trait-4-bg { background: var(--trait-4-bg); border: 2px solid var(--trait-4-border); }
.trait-5 { color: var(--trait-5); }
.trait-5-bg { background: var(--trait-5-bg); border: 2px solid var(--trait-5-border); }

/* === 特质子页 === */
.reveal .slides section.trait-subpage {
  padding: 60px 80px 60px 0;
}

.trait-subpage .section-bar {
  width: 6px;
  height: 60px;
  border-radius: 3px;
  margin-right: 20px;
  flex-shrink: 0;
}

.trait-subpage .section-header {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
}

.trait-subpage .section-header h3 {
  margin: 0;
}

/* 图文左右分栏 */
.split-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.split-layout .split-image {
  flex: 0 0 320px;
}

.split-layout .split-image img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.split-layout .split-content {
  flex: 1;
}

/* 上图下文 */
.stack-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.stack-layout .stack-image img {
  max-height: 240px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 卡片列表 */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-item {
  padding: 16px 20px;
  border-radius: 8px;
  border-left: 4px solid;
  font-size: var(--font-md);
  color: var(--text);
}

/* 引文块 */
.quote-block {
  padding: 24px 32px;
  margin: 20px 0;
  border-radius: 8px;
  font-size: var(--font-md);
  font-style: italic;
  color: var(--text-muted);
  position: relative;
}

.quote-block::before {
  content: "\201C";
  font-size: 48px;
  color: var(--brand-blue);
  position: absolute;
  top: 4px;
  left: 12px;
  font-style: normal;
  line-height: 1;
}

.quote-block .quote-author {
  display: block;
  margin-top: 12px;
  font-size: var(--font-sm);
  font-style: normal;
  font-weight: 600;
  color: var(--text);
}

/* === 封面 === */
.cover-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 80vh;
}

.cover-slide .cover-portrait {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(50, 90, 180, 0.2);
  border: 4px solid var(--brand-blue);
}

.cover-slide h1 {
  font-size: 52px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
}

.cover-slide .cover-subtitle {
  font-size: var(--font-md);
  color: var(--text-muted);
  margin-bottom: 16px;
}

.cover-slide .cover-meta {
  font-size: var(--font-sm);
  color: var(--brand-blue);
  font-weight: 600;
}

/* === 引入页 === */
.intro-slide {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 70vh;
}

.intro-slide .stat-row {
  display: flex;
  gap: 32px;
  margin: 24px 0;
}

.intro-slide .stat-box {
  flex: 1;
  padding: 24px;
  border-radius: 8px;
  background: var(--brand-blue-bg);
  border: 2px solid #c8d6f0;
  text-align: center;
}

.intro-slide .stat-number {
  font-size: 48px;
  font-weight: 900;
  color: var(--brand-blue);
  display: block;
}

.intro-slide .stat-label {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-top: 4px;
}

/* === 结语页 === */
.closing-slide {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 70vh;
}

.closing-slide h2 {
  font-size: var(--font-lg);
}

.closing-slide .insight-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}

.closing-slide .insight-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  background: var(--brand-blue-bg);
  border-radius: 8px;
  border-left: 4px solid var(--brand-blue);
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

.closing-slide .insight-item strong {
  font-size: 22px;
  color: var(--text);
}

.closing-slide .insight-num {
  font-size: var(--font-lg);
  font-weight: 900;
  color: var(--brand-blue);
  line-height: 1;
  flex-shrink: 0;
}

.closing-slide .sources {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
}

/* === Fragment 分步揭示动画 === */
.reveal .slides section .fragment.fade-in {
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease;
}

.reveal .slides section .fragment.fade-in.visible {
  opacity: 1;
  visibility: visible;
}

.reveal .slides section .fragment.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.reveal .slides section .fragment.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === 进度条自定义 === */
.reveal .progress {
  height: 4px;
  background: rgba(50, 90, 180, 0.15);
}

.reveal .progress span {
  background: var(--brand-blue);
}

/* === 导航控件 === */
.reveal .controls {
  color: var(--brand-blue);
}

/* === 响应式 === */
@media (max-width: 768px) {
  .reveal .slides section {
    padding: 30px 24px;
  }
  .reveal h2 { font-size: 28px; }
  .reveal h3 { font-size: 22px; }
  .reveal p, .reveal ul { font-size: 16px; }
  .split-layout { flex-direction: column; gap: 20px; }
  .split-layout .split-image { flex: 0 0 auto; max-width: 100%; }
  .intro-slide .stat-row { flex-direction: column; gap: 12px; }
  .cover-slide h1 { font-size: 32px; }
}

/* === 双行 S 曲线时间线 === */
.timeline-container {
  width: 100%;
}

.timeline-grid {
  display: flex;
  flex-direction: column;
  gap: 52px;
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 20px 2% 10px;
}

/* 两行节点容器 */
.timeline-row {
  display: flex;
  gap: 2%;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.timeline-row-bottom {
  padding: 0 8%;
}

/* SVG S 曲线层 */
.timeline-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.timeline-curve {
  stroke-dasharray: 3000;
  stroke-dashoffset: 3000;
  transition: stroke-dashoffset 1.5s ease 0.3s;
}

.timeline-grid.timeline-enter .timeline-svg {
  animation: hue-shift 5s linear infinite;
  animation-delay: 1.8s;
}

@keyframes hue-shift {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.timeline-grid.timeline-enter .timeline-curve {
  stroke-dashoffset: 0;
}

/* 节点 */
.timeline-node {
  flex: 1 1 0;
  min-width: 0;
  max-width: 200px;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  transition-delay: calc(var(--i) * 0.08s + 0.4s);
}

.timeline-grid.timeline-enter .timeline-node {
  opacity: 1;
  transform: translateY(0);
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin: 0 auto 12px;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--trait-color);
}

.timeline-year {
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
}

.timeline-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.timeline-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.timeline-trait-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
