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

/* 古今地名标注 */
.modern-place-label {
  font-size: 9px;
  fill: #8b7355;
  opacity: 0.75;
  font-family: 'Noto Sans SC', sans-serif;
  pointer-events: none;
}

/* 朝代对比面板 */
.compare-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: 420px;
  max-width: 92vw;
  font-family: 'Noto Serif SC', serif;
}

.compare-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;
}

.compare-body {
  padding: 20px;
}

.compare-select-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.compare-select-group {
  flex: 1;
}

.compare-select-group label {
  display: block;
  font-size: 13px;
  color: #6b5344;
  margin-bottom: 6px;
}

.dynasty-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #c9b896;
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: #4a3728;
}

.compare-start-btn {
  width: 100%;
  background: linear-gradient(135deg, #8b6914, #6b4423);
  color: #f3eee4;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s;
}

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

.compare-hint {
  margin-top: 12px;
  font-size: 12px;
  color: #8b7355;
  text-align: center;
  line-height: 1.5;
}

/* 对比分屏视图 */
.compare-view {
  position: fixed;
  inset: 0;
  background: #1a1208;
  z-index: 10000;
  display: flex;
  flex-direction: column;
}

.compare-close-bar {
  padding: 10px 20px;
  background: #2a1f10;
  display: flex;
  justify-content: flex-end;
}

.compare-exit-btn {
  background: #8b4513;
  color: #f3eee4;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.compare-screens {
  flex: 1;
  display: flex;
  position: relative;
}

.compare-screen {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.compare-screen-label {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(74, 55, 40, 0.9);
  color: #f3eee4;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 600;
  z-index: 10;
  font-family: 'Noto Serif SC', serif;
}

.compare-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.compare-divider {
  width: 4px;
  background: #c9a96e;
  flex-shrink: 0;
}

/* 测验面板 */
.quiz-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: 480px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  font-family: 'Noto Serif SC', serif;
}

.quiz-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;
  position: sticky;
  top: 0;
}

.quiz-body {
  padding: 20px;
}

.quiz-score {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #8b4513;
  margin-bottom: 16px;
}

.quiz-type-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.quiz-type-btn {
  flex: 1;
  padding: 10px 6px;
  border: 1px solid #c9b896;
  background: #fff;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  color: #6b5344;
  transition: all 0.2s;
  line-height: 1.4;
}

.quiz-type-btn:hover {
  background: #f5ede0;
}

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

.quiz-question-area {
  min-height: 200px;
}

.quiz-empty-hint {
  text-align: center;
  color: #a09080;
  padding: 40px 20px;
  font-size: 14px;
  line-height: 1.6;
}

.quiz-question {
  font-size: 16px;
  font-weight: 600;
  color: #4a3728;
  margin-bottom: 8px;
}

.quiz-hint {
  font-size: 14px;
  color: #8b7355;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: #f5ede0;
  border-radius: 6px;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.quiz-option-btn {
  padding: 12px;
  border: 1px solid #c9b896;
  background: #fff;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  color: #4a3728;
  transition: all 0.2s;
  text-align: left;
}

.quiz-option-btn:hover:not(:disabled) {
  background: #f5ede0;
  border-color: #8b6914;
}

.quiz-option-btn.correct {
  background: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.quiz-option-btn.wrong {
  background: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

.quiz-option-btn:disabled {
  cursor: default;
  opacity: 0.8;
}

.quiz-selected-order {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  min-height: 32px;
}

.order-item {
  background: #ede0cc;
  color: #6b4423;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.quiz-feedback {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 12px;
}

.quiz-feedback.correct {
  background: #d4edda;
  color: #155724;
}

.quiz-feedback.wrong {
  background: #f8d7da;
  color: #721c24;
}

.quiz-next-btn {
  width: 100%;
  background: linear-gradient(135deg, #8b6914, #6b4423);
  color: #f3eee4;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}

/* 历史名词悬浮提示 */
.term-tooltip {
  position: fixed;
  width: 300px;
  background: rgba(42, 31, 16, 0.96);
  color: #f3eee4;
  border: 1px solid #c9a96e;
  border-radius: 8px;
  padding: 12px 14px;
  z-index: 10001;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  font-family: 'Noto Serif SC', serif;
  pointer-events: none;
}

.term-tooltip-title {
  font-size: 14px;
  font-weight: 700;
  color: #e8c882;
  margin-bottom: 6px;
}

.term-tooltip-body {
  font-size: 12px;
  line-height: 1.7;
  color: #d4c4a8;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .compare-panel, .quiz-panel {
    width: 94vw;
  }
  .quiz-options {
    grid-template-columns: 1fr;
  }
  .quiz-type-btn {
    font-size: 11px;
    padding: 8px 4px;
  }
  .compare-screens {
    flex-direction: column;
  }
  .compare-divider {
    width: 100%;
    height: 4px;
  }
  .modern-place-label {
    font-size: 7px;
  }
}
