﻿/* 华夏文明 - 第二期功能样式 */

/* 事件讲解卡片 */
.event-playback-card {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: linear-gradient(135deg, rgba(42, 31, 16, 0.96), rgba(74, 55, 40, 0.96));
  color: #f3eee4;
  border: 1px solid #c9a96e;
  border-radius: 12px;
  padding: 16px 24px;
  z-index: 9998;
  max-width: 480px;
  width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: 'Noto Serif SC', serif;
  pointer-events: auto;
}

.event-playback-card.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.event-playback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.event-voice-toggle {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(201, 169, 110, 0.4);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.event-voice-toggle:hover {
  background: rgba(255,255,255,0.2);
}

.event-voice-toggle.active {
  background: rgba(232, 200, 130, 0.3);
  border-color: #e8c882;
}

.event-playback-year {
  font-size: 13px;
  color: #e8c882;
  font-weight: 600;
}

.event-playback-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.event-playback-desc {
  font-size: 14px;
  line-height: 1.6;
  color: #d4c4a8;
  margin-bottom: 8px;
}

.event-playback-place {
  font-size: 12px;
  color: #a89880;
}

.event-play-speech-btn {
  margin-top: 10px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #c9a96e, #a88b4a);
  color: #2a1f10;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  display: none;
}

.event-play-speech-btn.show {
  display: inline-block;
}

.event-play-speech-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201, 169, 110, 0.4);
}

/* 帝王世系面板 */
.emperor-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #faf6ee;
  border: 1px solid #c9b896;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  z-index: 9999;
  width: 560px;
  max-width: 94vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  font-family: 'Noto Serif SC', serif;
}

.emperor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #e0d5c0;
  font-size: 16px;
  font-weight: 600;
  color: #4a3728;
  background: linear-gradient(135deg, #f5ede0, #ede0cc);
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

.emperor-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.emperor-dynasty-select {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid #e0d5c0;
  flex-shrink: 0;
}

.dynasty-tab {
  padding: 5px 12px;
  border: 1px solid #c9b896;
  background: #fff;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  color: #6b5344;
  transition: all 0.2s;
}

.dynasty-tab:hover {
  background: #f5ede0;
}

.dynasty-tab.active {
  background: linear-gradient(135deg, #8b6914, #6b4423);
  color: #f3eee4;
  border-color: #6b4423;
}

.emperor-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.emperor-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid #e8e0d0;
  border-radius: 8px;
  transition: all 0.2s;
}

.emperor-item:hover {
  border-color: #c9a96e;
  box-shadow: 0 2px 8px rgba(139, 105, 20, 0.15);
}

.emperor-index {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #8b6914, #6b4423);
  color: #f3eee4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.emperor-info {
  flex: 1;
}

.emperor-name {
  font-size: 15px;
  font-weight: 700;
  color: #4a3728;
  margin-bottom: 2px;
}

.emperor-reign {
  font-size: 12px;
  color: #8b7355;
  margin-bottom: 4px;
}

.emperor-note {
  font-size: 13px;
  color: #6b5344;
  line-height: 1.5;
}

.emperor-empty {
  text-align: center;
  color: #a09080;
  padding: 40px;
}

/* 学习笔记导出面板 */
.export-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #faf6ee;
  border: 1px solid #c9b896;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  z-index: 9999;
  width: 520px;
  max-width: 94vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  font-family: 'Noto Serif SC', serif;
}

.export-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #e0d5c0;
  font-size: 16px;
  font-weight: 600;
  color: #4a3728;
  background: linear-gradient(135deg, #f5ede0, #ede0cc);
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

.export-body {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.export-textarea {
  flex: 1;
  width: 100%;
  min-height: 300px;
  padding: 12px;
  border: 1px solid #c9b896;
  border-radius: 8px;
  background: #fff;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #4a3728;
  resize: none;
  overflow-y: auto;
}

.export-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.export-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s;
}

.export-btn:hover {
  transform: translateY(-1px);
}

.export-btn.copy {
  background: linear-gradient(135deg, #8b6914, #6b4423);
  color: #f3eee4;
}

.export-btn.download {
  background: linear-gradient(135deg, #2d5a3d, #1a3d2a);
  color: #f3eee4;
}

/* Toast 提示 */
.toast-msg {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(42, 31, 16, 0.95);
  color: #f3eee4;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 10001;
  opacity: 0;
  transition: all 0.3s;
  font-family: 'Noto Serif SC', serif;
  pointer-events: none;
  border: 1px solid #c9a96e;
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 工具栏按钮激活状态 */
.learning-btn.active {
  background: linear-gradient(135deg, #8b6914, #6b4423) !important;
  color: #f3eee4 !important;
}

/* 面板关闭按钮通用 */
.panel-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #8b7355;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.panel-close:hover {
  background: #e0d5c0;
  color: #4a3728;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .emperor-panel, .export-panel {
    width: 96vw;
    max-height: 90vh;
  }
  .event-playback-card {
    top: 60px;
    padding: 12px 16px;
  }
  .event-playback-title {
    font-size: 17px;
  }
  .emperor-dynasty-select {
    padding: 8px 12px;
  }
  .dynasty-tab {
    padding: 4px 10px;
    font-size: 11px;
  }
  .export-textarea {
    min-height: 200px;
  }
}
