/* ============================================
   医学往事专题样式 - Medical Evolution Styles
   ============================================ */

/* 医学容器 */
.medical-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  z-index: 900;
  opacity: 0;
  transition: opacity 0.3s;
  overflow-y: auto;
}

.medical-container.active {
  opacity: 1;
}

/* 头部 */
.medical-header {
  text-align: center;
  padding: 30px 20px;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 10;
}

.medical-header h2 {
  margin: 0 0 10px 0;
  color: #2c3e50;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.medical-header p {
  margin: 0;
  color: #7f8c8d;
  font-size: 16px;
}

/* 主布局 */
.medical-layout {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 20px;
  gap: 30px;
  min-height: calc(100vh - 120px);
}

/* 左侧人体图 */
.body-map-section {
  flex: 0 0 300px;
  position: sticky;
  top: 130px;
  height: fit-content;
}

.body-map-container {
  background: white;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  position: relative;
}

.body-svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.body-hotspot {
  transition: all 0.3s;
  cursor: pointer;
}

.body-hotspot:hover {
  fill: #e74c3c !important;
}

.body-labels {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.body-label {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.95);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  text-align: center;
  line-height: 1.2;
}

.body-label span {
  display: block;
  font-weight: 600;
  color: #2c3e50;
}

.body-label small {
  display: block;
  color: #7f8c8d;
  font-size: 10px;
}

/* 图例 */
.body-legend {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.legend-item:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-icon {
  font-size: 16px;
}

.legend-name {
  font-size: 14px;
  color: #2c3e50;
  flex: 1;
}

/* 右侧时间轴 */
.timeline-section {
  flex: 1;
  min-width: 0;
}

.timeline-controls {
  background: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.category-filters .filter-btn {
  padding: 8px 16px;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.category-filters .filter-btn:hover {
  border-color: #3498db;
  color: #3498db;
}

.category-filters .filter-btn.active {
  background: #2c3e50;
  border-color: #2c3e50;
  color: white !important;
}

.time-range {
  color: #7f8c8d;
  font-size: 14px;
  padding-top: 10px;
  border-top: 1px solid #ecf0f1;
}

/* 时间轴容器 */
.timeline-container {
  position: relative;
  padding-left: 30px;
}

.timeline-line {
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #e0e0e0, #3498db, #e0e0e0);
}

/* 时间轴项目 */
.timeline-item {
  position: relative;
  margin-bottom: 20px;
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: all 0.3s;
  border-left: 4px solid transparent;
}

.timeline-item:hover {
  transform: translateX(10px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.timeline-item.highlighted {
  border-left-color: #e74c3c;
  background: #fff5f5;
}

.timeline-item.ancient {
  opacity: 0.8;
}

.timeline-item.prehistoric {
  opacity: 0.9;
}

.timeline-item.modern {
  border-left-color: #2ecc71;
}

.timeline-marker {
  position: absolute;
  left: -36px;
  top: 24px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  z-index: 2;
}

.timeline-content {
  margin-left: 10px;
}

.timeline-header {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  align-items: center;
}

.timeline-year {
  font-weight: 700;
  color: #2c3e50;
  font-size: 14px;
}

.timeline-period {
  font-size: 12px;
  color: #7f8c8d;
  background: #ecf0f1;
  padding: 2px 8px;
  border-radius: 10px;
}

.timeline-title {
  margin: 0 0 8px 0;
  color: #2c3e50;
  font-size: 18px;
}

.timeline-desc {
  margin: 0 0 12px 0;
  color: #555;
  font-size: 14px;
  line-height: 1.5;
}

.timeline-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-tags .tag {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.body-part-tag {
  background: #ecf0f1;
  color: #7f8c8d;
}

/* 详情面板 */
.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 500px;
  height: 100%;
  background: white;
  box-shadow: -5px 0 30px rgba(0,0,0,0.2);
  z-index: 1000;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s;
}

.detail-panel.show {
  transform: translateX(0);
}

.close-detail {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: none;
  background: #ecf0f1;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.close-detail:hover {
  background: #e74c3c;
  color: white;
}

.detail-content {
  padding: 60px 30px 30px;
}

.detail-header {
  border-bottom: 3px solid;
  padding-bottom: 20px;
  margin-bottom: 25px;
}

.detail-category {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  color: white;
  font-size: 13px;
  margin-bottom: 15px;
}

.detail-header h3 {
  margin: 0 0 15px 0;
  font-size: 24px;
  color: #2c3e50;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  color: #7f8c8d;
  font-size: 14px;
}

.detail-section {
  margin-bottom: 25px;
}

.detail-section h4 {
  color: #2c3e50;
  margin: 0 0 12px 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section p {
  color: #555;
  line-height: 1.7;
  margin: 0;
}

.detail-details {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
}

.detail-item {
  display: flex;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e0e0;
}

.detail-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.detail-key {
  flex: 0 0 100px;
  color: #7f8c8d;
  font-size: 13px;
  font-weight: 600;
}

.detail-val {
  flex: 1;
  color: #2c3e50;
  font-size: 14px;
}

.mini-body-map {
  width: 200px;
  height: 200px;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  margin: 0 auto;
}

.mini-body-map svg {
  width: 100%;
  height: 100%;
}

/* 视图切换按钮 */
.view-switcher {
  position: fixed;
  top: 80px;
  right: 320px;
  z-index: 1001;
  display: flex;
  background: white;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  overflow: hidden;
}

.view-btn {
  padding: 10px 20px;
  border: none;
  background: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-btn:hover {
  background: #f8f9fa;
}

.view-btn.active {
  background: #2c3e50;
  color: white;
}

/* 响应式 */
@media (max-width: 968px) {
  .medical-layout {
    flex-direction: column;
  }
  
  .body-map-section {
    flex: none;
    position: relative;
    top: 0;
    order: 2;
  }
  
  .body-map-container {
    max-width: 250px;
    margin: 0 auto;
  }
  
  .timeline-section {
    order: 1;
  }
  
  .detail-panel {
    max-width: 100%;
  }
  
  .view-switcher {
    top: 70px;
    right: 20px;
    transform: scale(0.9);
  }
}

@media (max-width: 480px) {
  .category-filters {
    justify-content: center;
  }
  
  .category-filters .filter-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .timeline-item {
    padding: 15px;
  }
  
  .timeline-marker {
    width: 24px;
    height: 24px;
    left: -32px;
    font-size: 12px;
  }
}
