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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f0f0;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #f7f7f7, #fbfbfb);
  color: #006644;
  padding: 10px;
  text-align: center;
}

.header h1 {
  font-size: 1.2em;
  margin-bottom: 10px;
  font-weight: 700;
}

.header p {
  font-size: 1em;
  opacity: 0.9;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #006644, #008156);
}

.stat-card {
  background: white;
  padding: 15px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-number {
  font-size: 1.2em;
  font-weight: bold;
  color: #006644;
  margin-bottom: 10px;
}

.stat-label {
  color: #666;
  font-size: 1em;
}

.progress-section {
  padding: 15px;
}

.section-title {
  font-size: 1.2em;
  margin-bottom: 20px;
  color: #333;
  text-align: center;
}

.courses-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.courses-table th {
  background: linear-gradient(135deg, #006644, #008156);
  color: white;
  padding: 20px;
  text-align: left;
  font-weight: 600;
}

.courses-table td {
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.courses-table tr:hover {
  background: #f8f9fa;
}

.course-name {
  font-weight: 600;
  color: #333;
  font-size: 1.1em;
}

.episode-input {
  width: 80px;
  padding: 10px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  text-align: center;
  font-size: 1em;
  transition: border-color 0.3s ease;
}

.episode-input:focus {
  outline: none;
  border-color: #667eea;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #006644, #008156);
  transition: width 0.3s ease;
  border-radius: 10px;
}

.progress-text {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 5px;
}

.overall-progress {
  text-align: center;
  padding: 30px;
  background: linear-gradient(135deg, #006644, #008156);
  color: white;
}

.overall-progress h2 {
  font-size: 2em;
  margin-bottom: 10px;
}

.overall-progress .progress-number {
  font-size: 3em;
  font-weight: bold;
  margin-bottom: 10px;
}

.loading {
  text-align: center;
  padding: 50px;
  color: #666;
}

.error {
  text-align: center;
  padding: 50px;
  color: #e74c3c;
}

.progress-controls {
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

.control-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 12px 24px;
  margin: 0 8px;
  border-radius: 25px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.control-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.save-btn {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.clear-btn {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.export-btn {
  background: linear-gradient(135deg, #f39c12, #e67e22);
}

.import-btn {
  background: linear-gradient(135deg, #3498db, #2980b9);
}

.save-btn:hover {
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.clear-btn:hover {
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.export-btn:hover {
  box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

.import-btn:hover {
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* 添加课程输入框样式 */
.add-course-container {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  flex-wrap: wrap;
}

#addCourseInput {
  flex: 1;
  min-width: 300px;
  max-width: 500px;
  padding: 15px 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.9);
  color: rgb(12, 12, 12);
  font-size: 1em;
  font-weight: 500;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#addCourseInput::placeholder {
  color: rgba(112, 112, 112, 0.7);
  font-weight: 400;
}

#addCourseInput:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

#addCourseInput:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.15);
}

.add-btn {
  background: linear-gradient(135deg, #006644, #008a5c) !important;
  white-space: nowrap;
}

.add-btn:hover {
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4) !important;
}

.add-btn:hover {
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4) !important;
}

/* 删除按钮样式 */
.delete-btn {
  background: #fff !important;
  padding: 8px 12px;
  font-size: 0.8em;
  white-space: nowrap;
}

.delete-btn:hover {
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4) !important;
}

/* 弹窗样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: #fff;
  margin: 5% auto;
  padding: 30px;
  border-radius: 20px;
  width: 80%;
  max-width: 600px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  position: relative;
}

.modal-header {
  text-align: center;
  margin-bottom: 10px;
}

.modal-title {
  color: #006644;
  font-size: 1.5em;
  margin: 0;
  margin-bottom: 10px;
  font-weight: 600;
}

.modal-textarea {
  width: 100%;
  height: 300px;
  padding: 15px;
  border: linear-gradient(135deg, #006644, #008a5c);
  border-radius: 10px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.95);
  resize: vertical;
  box-sizing: border-box;
}

.modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.modal-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 100px;
}

.modal-btn-primary {
  background: linear-gradient(135deg, #006644, #008a5c);
  color: white;
}

.modal-btn-secondary {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
  color: white;
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.close {
  position: absolute;
  right: 20px;
  top: 20px;
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close:hover {
  color: #ff6b6b;
}

@media (max-width: 768px) {
  .container {
    margin: 10px;
    border-radius: 15px;
  }

  .header h1 {
    font-size: 1.2em;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 20px;
  }

  .courses-table {
    font-size: 0.9em;
  }

  .courses-table th,
  .courses-table td {
    padding: 15px 10px;
  }
}