/**
 * 综合评分增强功能 - 样式表
 */

/* 评分配置详情页 */
.scoring-detail-page {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.scoring-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 25px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.scoring-header h2 {
  margin: 0 0 10px 0;
  font-size: 28px;
}

.scoring-header .meta {
  opacity: 0.9;
  font-size: 14px;
}

/* 操作按钮区 */
.scoring-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.scoring-actions .btn {
  padding: 10px 20px;
  font-size: 15px;
}

/* 评分项目区域 */
.scoring-items-section {
  background: #ffffff;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.scoring-items-section h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.weight-summary {
  font-size: 16px;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: bold;
}

.weight-summary.valid {
  background: #d4edda;
  color: #155724;
}

.weight-summary.invalid {
  background: #f8d7da;
  color: #721c24;
}

/* 评分项目卡片 */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scoring-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #667eea;
  transition: all 0.2s;
}

.scoring-item-card:hover {
  background: #e9ecef;
  transform: translateX(4px);
}

.item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.item-name {
  font-weight: 600;
  font-size: 15px;
}

.item-type {
  background: #667eea;
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.item-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.weight-input {
  width: 70px;
  padding: 6px 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  text-align: right;
  font-size: 14px;
}

/* 学生成绩表格 */
.scoring-results-section {
  background: #ffffff;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.scoring-results-section h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 20px;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.score-table th {
  background: #f8f9fa;
  padding: 12px 10px;
  text-align: center;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
  white-space: nowrap;
}

.score-table td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #e9ecef;
}

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

.total-col {
  background: #667eea !important;
  color: white !important;
}

.total-score {
  font-size: 16px;
  background: #f0f3ff;
  color: #667eea;
}

/* 导入对话框 */
.import-dialog {
  padding: 20px;
}

.import-dialog h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 22px;
  text-align: center;
}

.import-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.import-option-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.import-option-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.import-option-card .icon {
  font-size: 48px;
  margin-bottom: 10px;
}

.import-option-card .label {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.import-option-card .count {
  font-size: 13px;
  opacity: 0.9;
}

/* 导入模式选择 */
.import-mode-selector {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.import-mode-selector label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}

/* 作业/互评列表 */
.assignments-list,
.peer-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 15px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  background: #fafafa;
}

.assignment-import-item,
.peer-import-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: white;
  border-radius: 6px;
  margin-bottom: 10px;
  border: 1px solid #e9ecef;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.weight-input-small {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  text-align: right;
  font-size: 13px;
}

.selection-summary {
  padding: 12px;
  background: #e7f3ff;
  border-left: 4px solid #0066cc;
  border-radius: 4px;
  font-weight: 600;
  color: #0066cc;
}

/* 信息区域 */
.info-section {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.info-section p {
  margin: 5px 0;
}

.info-section ul {
  margin: 10px 0;
  padding-left: 20px;
}

.info-section .note {
  font-style: italic;
  color: #856404;
  margin-top: 10px;
}

/* 表单组 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #495057;
}

.form-input {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.weight-mode {
  display: flex;
  gap: 20px;
  margin-top: 15px;
}

.weight-mode label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* 对话框操作按钮 */
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #dee2e6;
}

/* 模态框样式 */
#importModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

#importModal.hidden {
  display: none;
}

#modalContent {
  background: white;
  border-radius: 12px;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 按钮样式增强 */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  background: #6c757d;
  color: white;
}

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

.btn-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
}

.btn-primary {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* 表格滚动容器 */
.table-wrapper {
  overflow-x: auto;
  margin-top: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .scoring-header {
    padding: 20px;
  }

  .scoring-header h2 {
    font-size: 22px;
  }

  .scoring-actions {
    flex-direction: column;
  }

  .scoring-actions .btn {
    width: 100%;
  }

  .import-options {
    grid-template-columns: 1fr;
  }

  .scoring-item-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .item-controls {
    width: 100%;
    justify-content: space-between;
  }

  #modalContent {
    max-width: 95%;
    margin: 20px;
  }
}

/* 滚动条美化 */
.assignments-list::-webkit-scrollbar,
.peer-list::-webkit-scrollbar,
#modalContent::-webkit-scrollbar {
  width: 8px;
}

.assignments-list::-webkit-scrollbar-track,
.peer-list::-webkit-scrollbar-track,
#modalContent::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.assignments-list::-webkit-scrollbar-thumb,
.peer-list::-webkit-scrollbar-thumb,
#modalContent::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.assignments-list::-webkit-scrollbar-thumb:hover,
.peer-list::-webkit-scrollbar-thumb:hover,
#modalContent::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 加载动画 */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
