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

/* 世界历史对照面板 */
.world-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.3);
  z-index: 9999;
  width: 560px;
  max-width: 94vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  font-family: 'Noto Serif SC', serif;
}

.world-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);
  flex-shrink: 0;
}

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

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

.world-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.world-period {
  font-size: 15px;
  font-weight: 700;
  color: #8b6914;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: #f5ede0;
  border-radius: 6px;
  text-align: center;
}

.world-timeline {
  position: relative;
  padding-left: 20px;
  border-left: 2px solid #c9a96e;
}

.world-event {
  position: relative;
  margin-bottom: 16px;
  padding-left: 16px;
}

.world-event::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 6px;
  width: 10px;
  height: 10px;
  background: #8b6914;
  border-radius: 50%;
  border: 2px solid #faf6ee;
}

.world-event-year {
  font-size: 13px;
  font-weight: 700;
  color: #8b6914;
  margin-bottom: 2px;
}

.world-event-title {
  font-size: 15px;
  font-weight: 700;
  color: #4a3728;
  margin-bottom: 4px;
}

.world-event-desc {
  font-size: 13px;
  color: #6b5344;
  line-height: 1.6;
}

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

/* 地理知识面板 */
.geo-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.3);
  z-index: 9999;
  width: 520px;
  max-width: 94vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  font-family: 'Noto Serif SC', serif;
}

.geo-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);
  flex-shrink: 0;
}

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

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

.geo-cat-btn {
  padding: 6px 14px;
  border: 1px solid #c9b896;
  background: #fff;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  color: #6b5344;
  transition: all 0.2s;
}

.geo-cat-btn:hover {
  background: #f5ede0;
}

.geo-cat-btn.active {
  background: linear-gradient(135deg, #2d5a3d, #1a3d2a);
  color: #f3eee4;
  border-color: #1a3d2a;
}

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

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

.geo-item:hover {
  border-color: #2d5a3d;
  box-shadow: 0 2px 8px rgba(45, 90, 61, 0.15);
}

.geo-name {
  font-size: 15px;
  font-weight: 700;
  color: #2d5a3d;
  margin-bottom: 6px;
}

.geo-desc {
  font-size: 13px;
  color: #6b5344;
  line-height: 1.7;
}

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

/* 错题本面板 */
.wrong-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.3);
  z-index: 9999;
  width: 520px;
  max-width: 94vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  font-family: 'Noto Serif SC', serif;
}

.wrong-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);
  flex-shrink: 0;
}

.wrong-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.wrong-empty {
  text-align: center;
  color: #28a745;
  padding: 40px;
  font-size: 15px;
}

.wrong-item {
  padding: 14px;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  border-left: 4px solid #dc3545;
}

.wrong-q {
  font-size: 14px;
  font-weight: 700;
  color: #4a3728;
  margin-bottom: 6px;
  line-height: 1.5;
}

.wrong-hint {
  font-size: 12px;
  color: #8b7355;
  margin-bottom: 8px;
  padding: 4px 8px;
  background: #f5ede0;
  border-radius: 4px;
}

.wrong-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.wrong-opt {
  font-size: 13px;
  padding: 6px 10px;
  background: #f8f5f0;
  border-radius: 4px;
  color: #6b5344;
}

.wrong-opt.correct {
  background: #d4edda;
  color: #155724;
  font-weight: 600;
}

.wrong-actions {
  text-align: right;
}

.wrong-remove-btn {
  padding: 5px 12px;
  border: 1px solid #28a745;
  background: #fff;
  color: #28a745;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.wrong-remove-btn:hover {
  background: #28a745;
  color: #fff;
}

/* 每日一题卡片 */
.daily-card {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 340px;
  background: #faf6ee;
  border: 1px solid #c9b896;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  z-index: 9998;
  font-family: 'Noto Serif SC', serif;
  overflow: hidden;
  animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideIn {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.daily-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(135deg, #8b6914, #6b4423);
  color: #f3eee4;
}

.daily-title {
  font-size: 14px;
  font-weight: 700;
}

.daily-header .panel-close {
  color: #f3eee4;
  padding: 2px 6px;
}

.daily-header .panel-close:hover {
  background: rgba(255,255,255,0.2);
}

.daily-body {
  padding: 14px;
}

.daily-q {
  font-size: 14px;
  font-weight: 700;
  color: #4a3728;
  margin-bottom: 12px;
  line-height: 1.5;
}

.daily-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.daily-opt:hover {
  background: #f5ede0;
  border-color: #8b6914;
}

.daily-opt.result {
  cursor: default;
}

.daily-opt.result.correct {
  background: #d4edda;
  border-color: #28a745;
  color: #155724;
  font-weight: 600;
}

.daily-opt.result.wrong {
  background: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

.daily-result {
  margin-top: 10px;
  padding: 8px;
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.daily-result.pass {
  background: #d4edda;
  color: #155724;
}

.daily-result.fail {
  background: #f8d7da;
  color: #721c24;
}

.daily-explain {
  margin-top: 8px;
  padding: 10px;
  background: #f5ede0;
  border-radius: 6px;
  font-size: 12px;
  color: #6b5344;
  line-height: 1.6;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .world-panel, .geo-panel, .wrong-panel {
    width: 96vw;
    max-height: 90vh;
  }
  .daily-card {
    width: calc(100vw - 40px);
    right: 20px;
    bottom: 80px;
  }
  .world-dynasty-select, .geo-categories {
    padding: 8px 12px;
  }
  .dynasty-tab, .geo-cat-btn {
    padding: 4px 10px;
    font-size: 11px;
  }
}
