/* 作业批改页面样式优化 - 增强版 */
/* 作者：小爱 */
/* 时间：2026-08-19 07:55 */
/* 修改：在保留原有功能基础上增强视觉优化 */

/* 引入全局变量 */
@import '../tokens.css';

/* ===== 页面容器 ===== */
.page-homework-grade {
  padding: var(--space-4);
  min-height: 100vh;
}

/* ===== 双栏布局 ===== */
.grade-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .grade-layout {
    grid-template-columns: 320px 1fr;
  }
}

/* ===== 队列列表 ===== */
.grade-queue {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.grade-queue-title {
  font-size: var(--font-md);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.grade-queue-item {
  display: flex;
  align-items: center;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  border-left: 3px solid transparent;
  background: var(--bg-page);
}

.grade-queue-item:hover {
  background: var(--bg-hover);
  border-left-color: var(--brand-green);
  transform: translateX(4px);
}

.grade-queue-item.active {
  background: var(--brand-green-light);
  border-left-color: var(--brand-green);
  box-shadow: var(--shadow-sm);
}

.grade-queue-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--brand-green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-lg);
  margin-right: var(--space-3);
  flex-shrink: 0;
  border: 2px solid var(--brand-green);
}

.grade-queue-info {
  flex: 1;
  min-width: 0;
}

.grade-queue-name {
  font-size: var(--font-base);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grade-queue-meta {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
}

.grade-queue-badge {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: white;
  font-size: var(--font-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--space-2);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

/* ===== 工作区 ===== */
.grade-workspace {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  min-height: 500px;
}

.grade-workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.grade-student-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.grade-student-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand-green-light) 0%, var(--brand-green) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-2xl);
  border: 3px solid var(--brand-green);
  box-shadow: var(--shadow-md);
}

.grade-student-name {
  font-size: var(--font-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.grade-student-class {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

/* ===== SOE四维评分 ===== */
.grade-soe-dims {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.grade-soe-dim {
  background: linear-gradient(135deg, var(--bg-page) 0%, var(--bg-card) 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  border: 1px solid var(--border-light);
  transition: all var(--dur-fast) var(--ease-out);
}

.grade-soe-dim:hover {
  border-color: var(--brand-green);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.grade-soe-dim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.grade-soe-dim-name {
  font-size: var(--font-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
}

.grade-soe-dim-score {
  font-size: var(--font-2xl);
  font-weight: var(--fw-bold);
  color: var(--brand-green);
  line-height: 1;
}

.grade-soe-dim-bar {
  height: 8px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.grade-soe-dim-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-green) 0%, var(--brand-green-hover) 100%);
  border-radius: var(--radius-full);
  transition: width var(--dur-base) var(--ease-out);
  box-shadow: var(--shadow-sm);
}

/* ===== 波形图 ===== */
.grade-waveform {
  background: var(--bg-page);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  border: 1px solid var(--border-light);
}

.grade-waveform-title {
  font-size: var(--font-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.grade-waveform-canvas {
  width: 100%;
  height: 120px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: inset var(--shadow-sm);
}

/* ===== 播放控制 ===== */
.grade-playback-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: var(--bg-page);
  border-radius: var(--radius-lg);
}

.grade-play-btn {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-hover) 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-2xl);
  color: white;
  transition: all var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-lg);
}

.grade-play-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-xl);
}

.grade-play-btn:active {
  transform: scale(0.95);
}

.grade-time-display {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  min-width: 80px;
  text-align: center;
}

/* ===== 评语区域 ===== */
.grade-comment-section {
  margin-bottom: var(--space-4);
}

.grade-comment-label {
  font-size: var(--font-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.grade-comment-textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--space-3);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  font-size: var(--font-base);
  color: var(--text-primary);
  background: var(--bg-input);
  resize: vertical;
  transition: all var(--dur-fast) var(--ease-out);
  line-height: var(--line-height-normal);
}

.grade-comment-textarea:focus {
  outline: none;
  border-color: var(--brand-green);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}

.grade-comment-textarea::placeholder {
  color: var(--text-disabled);
}

/* ===== 操作按钮 ===== */
.grade-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-light);
}

.grade-actions .btn {
  min-height: 44px;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-lg);
  font-weight: var(--fw-medium);
  transition: all var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-sm);
}

.grade-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.grade-actions .btn:active {
  transform: translateY(0);
}

/* ===== 空状态 ===== */
.grade-empty {
  text-align: center;
  padding: var(--space-10) var(--space-4);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-light);
}

.grade-empty__icon {
  font-size: var(--font-5xl);
  margin-bottom: var(--space-3);
  opacity: 0.5;
}

.grade-empty__text {
  font-size: var(--font-base);
  color: var(--text-tertiary);
  margin-bottom: var(--space-4);
}

/* ===== 加载状态 ===== */
.grade-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
}

.grade-loading__spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-light);
  border-top-color: var(--brand-green);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

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

/* ===== 响应式适配 ===== */
@media (min-width: 769px) {
  .page-homework-grade {
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .grade-soe-dims {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .grade-workspace {
    padding: var(--space-6);
  }
}

/* ===== 动画效果 ===== */
.grade-queue-item {
  animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.grade-soe-dim {
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}