/* ===========================================
   Topic Detail Page - 专题详情页面样式
   基于 speaker-detail.css 扩展，保持一致性
   =========================================== */

/* 重置和基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    sans-serif;
  line-height: 1.55;
  color: #1a1f33;
  overflow-x: hidden;
  font-size: 15px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* 配色变量 */
:root {
  --primary-dark: #1a1f3a;
  --primary-blue: #2d3561;
  --gradient-start: #ff6b35;
  --gradient-end: #8b5cf6;
  --accent-orange: #ff6b35;
  --accent-purple: #8b5cf6;
  --text-white: #ffffff;
  --text-light: #f8fafc;
  --text-gray: #64748b;
  --text-dark: #1e293b;
  --background-light: #f8fafc;
  --card-background: #ffffff;
  --border-color: #e2e8f0;
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-large: 0 10px 25px rgba(0, 0, 0, 0.15);
  --transition-speed: 0.3s;
}

/* 跳过链接 */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-dark);
  color: var(--text-white);
  padding: 8px;
  text-decoration: none;
  z-index: 100;
  border-radius: 4px;
}

.skip-link:focus {
  top: 6px;
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  transition: all var(--transition-speed) ease;
  border: none;
  cursor: pointer;
  /*font-size: 16px;*/
  line-height: 1;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  color: var(--text-white);
  box-shadow: var(--shadow-medium);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-large);
}

.btn-secondary {
  background: var(--card-background);
  color: var(--text-dark);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--background-light);
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

/* 页面沿用全局导航样式（styles.css），移除专题页的本地覆盖以保持一致性 */

/* 专题详情页基础样式 */
.topic-detail-body {
  background: var(--background-light);
  min-height: 100vh;
  padding-top: 80px;
}

/* 专题标题区域 */
.topic-hero-section {
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--primary-blue) 100%
  );
  color: var(--text-white);
  padding: 60px 0 80px;
  position: relative;
  overflow: hidden;
  margin-top: -20px;
}

.topic-hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="rgba(255,255,255,0.05)"><polygon points="0,0 1000,100 1000,0"/></svg>')
    no-repeat bottom;
  background-size: cover;
}

.topic-hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 60px;
  align-items: center;
}

/* 面包屑导航 */
.topic-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  opacity: 0.9;
}

.breadcrumb-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

.breadcrumb-link:hover {
  color: var(--text-white);
}

.breadcrumb-separator {
  color: rgba(255, 255, 255, 0.6);
}

.breadcrumb-current {
  color: var(--text-white);
  font-weight: 500;
}

/* 专题标题 */
.topic-main-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin: 0 0 20px 0;
  line-height: 1.1;
  background: linear-gradient(
    135deg,
    var(--text-white) 0%,
    var(--text-light) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topic-subtitle {
  font-size: 1.25rem;
  line-height: 1.6;
  margin: 0 0 32px 0;
  opacity: 0.9;
  max-width: 600px;
}

/* 专题元信息 */
.topic-meta-info {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.meta-label {
  font-size: 0.8rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-value {
  font-size: 1rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

/* 操作按钮 */
.topic-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.topic-hero-image {
  position: relative;
  z-index: 2;
}

.hero-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: var(--shadow-large);
}

/* 通用区域样式 */
.topic-section {
  padding: 40px 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
  color: var(--primary-dark);
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  border-radius: 2px;
}

/* 专题介绍区域 */
.topic-intro-section {
  background: #f8fafc;
}

.topic-intro-content {
  max-width: 800px;
  margin: 0 auto;
}

.topic-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #4a5568;
  margin-bottom: 20px;
}

.topic-description p {
  margin-bottom: 24px;
}

.topic-description p:last-child {
  margin-bottom: 0;
}

.topic-highlights {
  background: transparent;
  padding: 30px;
  border-radius: 16px;
  border-left: none;
}

.highlights-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0 0 20px 0;
  padding-bottom: 10px;
}

.highlights-list {
  list-style: none;
  padding: 0;
}

.highlights-list li {
  position: relative;
  padding-left: 0;
  margin-bottom: 12px;
  font-size: 1rem;
  line-height: 1.6;
  color: #4a5568;
  list-style: none;
}

.highlights-list li::before {
  content: none;
  display: none;
}

/* 内容规划区域 */
.topic-content-section {
  background: #f8fafc;
}

.content-schedule {
  max-width: 1000px;
  margin: 0 auto;
}

/* 时间线样式（仅用于专题日程） */
.timeline {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding-left: 32px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 20px 0;
}
.timeline-dot {
  position: absolute;
  left: 16px;
  top: 32px;
  width: 16px;
  height: 16px;
  background: var(--accent-orange);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: var(--shadow-light);
}
.timeline-time {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-dark);
  text-align: center;
  background: var(--background-light);
  padding: 12px 16px;
  border-radius: 12px;
  align-self: flex-start;
}
.timeline-content {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.timeline-content .speaker-avatar-small {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-orange);
}
.timeline-content .speaker-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.timeline-content .speaker-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
}
.timeline-content .speaker-title {
  font-size: 0.95rem;
  color: var(--text-gray);
  margin: 0;
}
.timeline-content .speaker-topic {
  font-size: 1rem;
  color: var(--text-dark);
  font-weight: 500;
  margin: 0;
}

@media (max-width: 768px) {
  .timeline {
    padding-left: 0;
  }
  .timeline::before {
    left: 0;
  }
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .timeline-time {
    width: fit-content;
    margin-left: 24px;
  }
  .timeline-dot {
    left: -8px;
    top: 28px;
  }
}

.schedule-item {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: var(--card-background);
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-light);
  transition:
    transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
  border-left: none;
  border: 1px solid #e2e8f0;
}

.schedule-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-large);
}

.schedule-item:last-child {
  margin-bottom: 0;
}

.schedule-time {
  flex-shrink: 0;
  width: 120px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-dark);
  text-align: center;
  background: var(--background-light);
  padding: 16px;
  border-radius: 12px;
  align-self: flex-start;
}

.schedule-content {
  flex: 1;
}

.schedule-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 16px 0;
  line-height: 1.4;
}

.speaker-info {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--background-light);
  border-radius: 12px;
}

.speaker-avatar-small {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-orange);
}

.speaker-details {
  flex: 1;
}

.speaker-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 4px 0;
}

.speaker-title {
  font-size: 0.9rem;
  color: var(--text-gray);
  margin: 0;
}

/* 统一到上方的 .topic-description 定义，移除重复规则 */

/* 相关演讲者区域 */
.topic-speakers-section {
  background: white;
}

.speakers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.speaker-card {
  background: var(--card-background);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  transition: all var(--transition-speed) ease;
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.speaker-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-large);
}

.speaker-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 20px;
  object-fit: cover;
  border: 3px solid var(--accent-orange);
}

.speaker-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 8px 0;
}

.speaker-title {
  font-size: 0.9rem;
  color: var(--text-gray);
  margin: 0 0 16px 0;
}

.speaker-topic {
  font-size: 1rem;
  color: var(--text-dark);
  font-weight: 500;
  margin: 0 0 20px 0;
}

.speaker-link {
  color: var(--accent-orange);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-speed) ease;
}

.speaker-link:hover {
  color: var(--primary-dark);
}

.topic-speakers-section .speaker-card-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1f3a;
  margin: 0 0 8px 0;
}

.topic-speakers-section .speaker-card-title {
  color: #ff6b35;
  font-weight: 500;
  margin: 0 0 4px 0;
}

.topic-speakers-section .speaker-card-company {
  color: #64748b;
  font-size: 0.9rem;
  margin: 0 0 12px 0;
}

.topic-speakers-section .speaker-card-topic {
  color: #4a5568;
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 0 0 20px 0;
  font-weight: 500;
}

.topic-speakers-section .speaker-card-link {
  display: inline-block;
  color: #ff6b35;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border: 2px solid #ff6b35;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.topic-speakers-section .speaker-card-link:hover {
  background: #ff6b35;
  color: white;
}

/* 行动区域 */
.topic-action-section {
  background: linear-gradient(
    135deg,
    var(--accent-orange) 0%,
    var(--accent-purple) 100%
  );
  color: white;
  text-align: center;
}

.action-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 16px 0;
}

.action-content p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin: 0 0 32px 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.action-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* 相关专题推荐 */
.related-topics-section {
  background: var(--background-light);
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.topic-card {
  background: var(--card-background);
  border-radius: 16px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow-light);
  transition: all var(--transition-speed) ease;
  border: 1px solid var(--border-light);
}

.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-large);
}

.topic-card-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 16px 0;
}

.topic-card-description {
  color: var(--text-gray);
  line-height: 1.6;
  margin: 0 0 24px 0;
  font-size: 1rem;
}

.topic-card-link {
  display: inline-block;
  background: linear-gradient(
    135deg,
    var(--accent-orange),
    var(--accent-purple)
  );
  color: white;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  transition: all var(--transition-speed) ease;
}

.topic-card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.animate-in {
  animation: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .topic-hero-section {
    padding: 0px 0 40px;
  }

  .topic-main-title {
    font-size: 2rem;
  }

  .topic-subtitle {
    font-size: 1.1rem;
  }

  .topic-meta {
    gap: 12px;
  }

  .topic-actions {
    flex-direction: column;
    align-items: center;
  }

  .topic-intro-section,
  .topic-content-section,
  .topic-speakers-section,
  .topic-action-section,
  .related-topics-section {
    padding: 40px 0;
  }

  .schedule-item {
    flex-direction: column;
    gap: 20px;
    padding: 24px;
  }

  .schedule-time {
    width: auto;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .topics-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .topic-card {
    padding: 32px 24px;
  }

  .action-buttons {
    flex-direction: column;
    align-items: center;
  }

  .action-content h2 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .topic-main-title {
    font-size: 1.75rem;
  }

  .topic-breadcrumb {
    font-size: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .topic-meta {
    flex-direction: column;
    gap: 8px;
  }

  .schedule-item {
    padding: 20px;
  }

  .schedule-content h3 {
    font-size: 1.1rem;
  }

  .speaker-avatar-small {
    width: 36px;
    height: 36px;
  }

  .speakers-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .speaker-card {
    padding: 24px;
  }

  .topic-card {
    padding: 24px 20px;
  }

  .action-content h2 {
    font-size: 1.75rem;
  }

  .action-content p {
    font-size: 1rem;
  }
}

/* 打印样式 */
@media print {
  /*  .navbar, */
  .back-to-top,
  .topic-actions,
  .action-buttons,
  .topic-card-link {
    display: none;
  }

  .topic-hero-section {
    background: #1a1f3a;
    color: black;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .topic-main-title {
    -webkit-text-fill-color: initial;
    color: black;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .topic-hero-section {
    background: #000;
    color: #fff;
  }

  .btn-secondary,
  .btn-outline {
    border-width: 3px;
  }

  .highlight-item {
    border: 2px solid #000;
  }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 延迟加载图片样式 */
img.lazy {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img.lazy.loaded {
  opacity: 1;
}

/* 返回顶部按钮样式 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--accent-orange);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-large);
  transition: all var(--transition-speed) ease;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ====== 移动端时间被遮挡修复（确保小黄点与时间精确对齐且不重叠） ====== */
.timeline {
  overflow: visible;
}
.timeline::before {
  z-index: 0;
}

/* 统一层级：小黄点与时间线在下，时间文本在上 */
.timeline-item .timeline-dot {
  z-index: 0;
}
.timeline-item .timeline-time {
  position: relative;
  z-index: 1;
  /* 确保可读的背景与圆角（保持与原设计一致） */
  background: var(--background-light);
  border-radius: 12px;
}

/* 取消旧移动端规则的横向偏移干扰，改用网格列对齐 */
@media (max-width: 768px) {
  .timeline-item {
    grid-template-columns: 18px 64px 1fr !important; /* 加宽时间列，避免与黄点重叠 */
    column-gap: 10px;
  }
  .timeline-item .timeline-time {
    margin-left: 0 !important;
    width: auto !important;
    text-align: left !important;
    display: flex;
    align-items: center;
  }
  .timeline::before {
    left: 9px !important;
  }
}

/* 桌面端也锁定层级，避免偶发重叠 */
@media (min-width: 769px) {
  .timeline-item {
    grid-template-columns: 20px minmax(56px, 80px) 1fr !important;
    column-gap: 12px;
  }
  .timeline::before {
    left: 10px !important;
  }
}

/* ===== 时间轴小黄点与时间文本精确对齐（覆盖修复） ===== */
.timeline {
  padding-left: 0 !important; /* 交给网格列控制横向布局 */
  position: relative;
}
.timeline::before {
  left: 10px !important; /* 与第一列中线对齐：20px 列宽的一半 */
}

.timeline-item {
  display: grid !important;
  grid-template-columns: 20px minmax(56px, 80px) 1fr; /* 黄点 / 时间 / 内容 */
  align-items: center; /* 垂直方向居中对齐 */
  column-gap: 12px;
  position: relative;
  min-height: 32px;
}

.timeline-item .timeline-dot {
  position: static !important; /* 清理旧的绝对定位 */
  left: auto !important;
  top: auto !important;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-orange);
  border: 2px solid #fff;
  box-shadow: var(--shadow-light);
  grid-column: 1;
  justify-self: center; /* 水平居中到第一列中线 */
  align-self: center; /* 垂直居中 */
}

.timeline-item .timeline-time {
  position: static !important; /* 确保不受旧定位干扰 */
  grid-column: 2;
  justify-self: start; /* 时间文本靠左 */
  align-self: center;
  display: flex;
  align-items: center; /* 文本在容器中垂直居中 */
  line-height: 1.2;
  height: 1.2em; /* 基线稳定 */
  font-variant-numeric: tabular-nums; /* 数字等宽便于视觉对齐 */
  text-align: left !important; /* 与时间列保持一致 */
}

.timeline-item .timeline-content {
  grid-column: 3;
}

/* 若更偏好基线对齐，可启用以下基线策略（保留中心对齐为主） */
/*
@supports (align-items: baseline) {
  .timeline-item { align-items: baseline; }
  .timeline-item .timeline-dot { align-self: center; }
  .timeline-item .timeline-time { align-self: baseline; }
}
*/

/* 移动端：缩窄列宽并保持对齐 */
@media (max-width: 768px) {
  .timeline::before {
    left: 9px !important;
  }
  .timeline-item {
    grid-template-columns: 18px 56px 1fr;
    column-gap: 10px;
  }
  .timeline-item .timeline-time {
    font-size: 0.95rem;
  }
}
