/* ===== LOGOS 统一科学大模型 — 样式 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  background: #fbf7ef;
  color: #231f1a;
  line-height: 1.7;
}

#app { display: flex; min-height: 100vh; }

#sidebar {
  width: 280px; background: #fffdf8; border-right: 1px solid #e8ded0;
  padding: 24px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-header { margin-bottom: 20px; }
.sidebar-header h2 { font-size: 18px; font-weight: 700; color: #2d2924; }
.course-subtitle { font-size: 13px; color: #766f66; margin-top: 4px; }
#lesson-list { flex: 1; }
.lesson-btn {
  display: block; width: 100%; text-align: left; padding: 10px 14px;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  font-size: 14px; color: #231f1a; cursor: pointer; margin-bottom: 6px; transition: all 0.15s;
}
.lesson-btn:hover { background: #f5f0eb; }
.lesson-btn.active { background: #2d2924; color: #fffdf8; border-color: #2d2924; }
.lesson-btn .lesson-num { display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; background: #e8ded0; font-size: 11px; font-weight: 600; margin-right: 8px; }
.lesson-btn.active .lesson-num { background: #fffdf8; color: #2d2924; }
.lesson-btn .check { float: right; color: #15803d; font-weight: 700; }
.progress-summary { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e8ded0; }
#progress-text { font-size: 13px; color: #766f66; }
.progress-bar { height: 6px; background: #e8ded0; border-radius: 3px; margin-top: 8px; overflow: hidden; }
#progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #2d2924, #c2410c); border-radius: 3px; transition: width 0.5s ease; }

#main { flex: 1; padding: 40px 48px; max-width: 820px; }

#course-header { text-align: center; padding: 80px 0; }
#course-header h1 { font-size: 32px; font-weight: 700; margin-bottom: 12px; color: #2d2924; }
.course-desc { font-size: 16px; color: #766f66; max-width: 600px; margin: 0 auto 28px; }

.btn-primary, .btn-secondary {
  padding: 12px 28px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; border: none; transition: all 0.15s;
}
.btn-primary { background: #2d2924; color: #fffdf8; }
.btn-primary:hover { background: #c2410c; }
.btn-secondary { background: #e8ded0; color: #231f1a; }
.btn-secondary:hover { background: #d4ccc4; }

#lesson-view { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.lesson-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; color: #2d2924; }
.lesson-subtitle { font-size: 14px; color: #766f66; margin-bottom: 24px; }

.objectives { margin-bottom: 24px; }
.objectives h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: #2d2924; }
.objectives ul { list-style: none; }
.objectives li { position: relative; padding-left: 20px; margin-bottom: 6px; font-size: 14px; color: #444; }
.objectives li::before { content: "🎯"; position: absolute; left: 0; top: 0; font-size: 12px; }

.content-block { margin-bottom: 24px; }
.content-block p { margin-bottom: 14px; font-size: 15px; color: #333; line-height: 1.8; }
.content-block code {
  background: #f1eee9; padding: 2px 6px; border-radius: 4px; font-size: 13px; color: #c2410c;
}
.content-block pre {
  background: #2d2924; color: #e8ded0; padding: 16px; border-radius: 8px; overflow-x: auto; font-size: 13px; line-height: 1.6; margin-bottom: 14px;
}

#flashcard-section { margin-bottom: 32px; }
#flashcard-section h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: #2d2924; }
.flashcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.flashcard {
  perspective: 1000px; height: 180px; cursor: pointer;
}
.flashcard-inner {
  position: relative; width: 100%; height: 100%; transition: transform 0.5s; transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
  position: absolute; inset: 0; backface-visibility: hidden;
  padding: 20px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.flashcard-front { background: #fffdf8; border: 1px solid #e8ded0; }
.flashcard-front p { font-size: 14px; font-weight: 600; color: #2d2924; text-align: center; }
.flashcard-back { background: #2d2924; color: #fffdf8; transform: rotateY(180deg); }
.flashcard-back p { font-size: 13px; line-height: 1.6; text-align: center; }

#quiz-section { margin-bottom: 32px; }
#quiz-section h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: #2d2924; }
.quiz-item { margin-bottom: 20px; }
.quiz-q { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: #2d2924; }
.quiz-option {
  display: block; width: 100%; text-align: left; padding: 12px 16px;
  border: 1px solid #e8ded0; border-radius: 8px; background: #fffdf8;
  font-size: 14px; cursor: pointer; margin-bottom: 8px; transition: all 0.15s;
}
.quiz-option:hover { border-color: #2d2924; }
.quiz-option.correct { border-color: #15803d; background: #ecfdf5; color: #15803d; }
.quiz-option.wrong { border-color: #b45309; background: #fef7ec; color: #b45309; }
.quiz-option.disabled { cursor: default; opacity: 0.7; }
.quiz-option.reveal-correct { border-color: #15803d; }
.quiz-feedback {
  margin-top: 8px; padding: 10px 14px; border-radius: 8px; font-size: 13px; line-height: 1.6; display: none;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.correct { background: #ecfdf5; color: #065f46; }
.quiz-feedback.wrong { background: #fef7ec; color: #92400e; }

#source-section h3 { font-size: 18px; font-weight: 700; margin-bottom: 12px; color: #2d2924; }
.source-list { display: flex; flex-direction: column; gap: 8px; }
.source-link {
  display: inline-block; padding: 10px 16px; background: #fffdf8; border: 1px solid #e8ded0;
  border-radius: 8px; text-decoration: none; font-size: 14px; color: #2d2924; transition: all 0.15s;
}
.source-link:hover { border-color: #2d2924; background: #f5f0eb; }

.lesson-nav-bottom {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 40px; padding-top: 24px; border-top: 1px solid #e8ded0;
}
#lesson-progress-label { font-size: 13px; color: #766f66; }

#review-section { animation: fadeIn 0.3s ease; }
#review-section h2 { font-size: 22px; font-weight: 700; margin-bottom: 20px; }
.review-card {
  padding: 20px; background: #fffdf8; border-radius: 12px; margin-bottom: 16px;
  border: 1px solid #e8ded0;
}
.review-card h4 { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: #2d2924; }
.review-card p { font-size: 14px; color: #555; line-height: 1.6; }
.review-card .status { display: inline-block; margin-top: 8px; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.review-card .status.done { background: #ecfdf5; color: #15803d; }
.review-card .status.pending { background: #fef7ec; color: #b45309; }
#btn-restart { margin-top: 24px; }

@media (max-width: 768px) {
  #app { flex-direction: column; }
  #sidebar { width: 100%; height: auto; position: static; padding: 16px; border-right: none; border-bottom: 1px solid #e8ded0; }
  #main { padding: 24px 20px; }
  #course-header { padding: 40px 0; }
  #course-header h1 { font-size: 24px; }
  .flashcard-grid { grid-template-columns: 1fr; }
}
