* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px 20px;
  text-align: center;
  margin-bottom: 30px;
  border-radius: 8px;
}

.header h1 {
  font-size: 28px;
  margin-bottom: 10px;
}

.header a {
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,0.2);
  padding: 8px 16px;
  border-radius: 4px;
  margin: 0 5px;
}

.header a:hover {
  background: rgba(255,255,255,0.3);
}

.card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #555;
}

select, input[type="text"], textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

textarea {
  resize: vertical;
  min-height: 200px;
  font-family: inherit;
}

button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin-right: 10px;
  margin-bottom: 10px;
}

button:hover {
  opacity: 0.9;
}

button.secondary {
  background: #95a5a6;
}

button.secondary.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

button.danger {
  background: #e74c3c;
}

.option-item {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.option-item input[type="text"] {
  flex: 1;
}

.question-list {
  max-height: 400px;
  overflow-y: auto;
}

.question-item {
  padding: 15px;
  border-bottom: 1px solid #eee;
}

.question-item:last-child {
  border-bottom: none;
}

.question-item h4 {
  margin-bottom: 8px;
  color: #667eea;
}

.question-item .actions {
  margin-top: 10px;
}

.question-item .actions button {
  margin-right: 10px;
  padding: 6px 12px;
  font-size: 12px;
}

.quiz-container .question {
  margin-bottom: 20px;
}

.quiz-container .question h3 {
  margin-bottom: 15px;
}

.options label {
  display: flex;
  align-items: flex-start;
  padding: 10px;
  margin-bottom: 8px;
  background: #f8f9fa;
  border-radius: 4px;
  cursor: pointer;
  font-weight: normal;
}

.options label:hover {
  background: #e9ecef;
}

.options input {
  margin-right: 10px;
  margin-top: 4px;
}

.options label.correct {
  background: #d4edda;
  border: 1px solid #28a745;
}

.options label.wrong {
  background: #f8d7da;
  border: 1px solid #dc3545;
}

.explanation {
  margin-top: 15px;
  padding: 15px;
  background: #fff3cd;
  border-radius: 4px;
  border-left: 4px solid #ffc107;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.stats {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.stat-item {
  flex: 1;
  text-align: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 4px;
}

.stat-item .number {
  font-size: 28px;
  font-weight: bold;
  color: #667eea;
}

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

.filters select {
  flex: 1;
  min-width: 200px;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 4px;
  color: white;
  z-index: 1001;
  animation: slideIn 0.3s ease;
}

.toast.success {
  background: #28a745;
}

.toast.error {
  background: #dc3545;
}

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

/* 折叠式卡片样式 */
.module-card {
  background: white;
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  cursor: pointer;
  background: #fafafa;
  transition: all 0.3s ease;
  user-select: none;
}

.module-header:hover {
  background: #f5f5f5;
}

.module-header h2 {
  font-size: 28px;
  color: #1a1a2e;
  margin: 0;
  font-weight: 700;
}

.module-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.module-points-count {
  font-size: 20px;
  color: #888;
  font-weight: 500;
}

.module-arrow {
  font-size: 28px;
  color: #888;
  transition: transform 0.3s ease;
}

.module-card.collapsed .module-arrow {
  transform: rotate(180deg);
}

.module-content {
  max-height: 5000px;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
}

.module-card.collapsed .module-content {
  max-height: 0;
}

.knowledge-point-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-top: 1px solid #f0f0f0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.knowledge-point-item:hover {
  background: #f8f9ff;
}

.kp-left {
  flex: 1;
}

.kp-name {
  font-size: 24px;
  color: #1a1a2e;
  font-weight: 500;
  margin-bottom: 12px;
}

.kp-type-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  background: #e8f0ff;
  color: #667eea;
}

.kp-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.kp-count {
  font-size: 20px;
  color: #888;
  font-weight: 500;
}

.kp-stars {
  display: flex;
  gap: 4px;
}

.kp-stars .star {
  font-size: 24px;
  color: #ddd;
}

.kp-stars .star.filled {
  color: #ffc107;
}

.kp-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}

.kp-menu .menu-dot {
  width: 6px;
  height: 6px;
  background: #667eea;
  border-radius: 50%;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .header {
    padding: 20px 15px;
  }
  
  .stats {
    flex-direction: column;
  }
  
  .filters {
    flex-direction: column;
  }
  
  .filters select {
    min-width: auto;
  }
  
  .module-header {
    padding: 18px 20px;
  }
  
  .module-header h2 {
    font-size: 22px;
  }
  
  .knowledge-point-item {
    padding: 18px 20px;
  }
  
  .kp-name {
    font-size: 20px;
  }
}
