/* ===== 全局基础 ===== */
:root {
  --green-primary: #2e7d32;
  --green-light: #4caf50;
  --green-soft: #e8f5e9;
  --green-border: #a5d6a7;
  --green-accent: #81c784;
  --green-dark: #1b5e20;
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #eeeeee;
  --gray-300: #e0e0e0;
  --gray-500: #9e9e9e;
  --gray-600: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;
  --red-light: #ffebee;
  --red-main: #e53935;
  --orange-light: #fff3e0;
  --orange-main: #f57c00;
  --blue-light: #e3f2fd;
  --blue-main: #1976d2;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.13);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --transition: all .22s cubic-bezier(.4,0,.2,1);
}

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

body {
  font-family: 'PingFang SC','Microsoft YaHei',sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* ===== 顶部导航 ===== */
.topbar {
  background: var(--white);
  border-bottom: 2px solid var(--green-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--green-primary), var(--green-light));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--green-primary);
  letter-spacing: .5px;
}

.logo-sub {
  font-size: 12px;
  color: var(--gray-500);
  margin-left: 2px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-class {
  background: var(--green-soft);
  color: var(--green-primary);
  border: 1px solid var(--green-border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 600;
}

.btn-admin {
  background: var(--green-soft);
  color: var(--green-primary);
  border: 1.5px solid var(--green-border);
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-admin:hover {
  background: var(--green-primary);
  color: white;
}

/* ===== 主布局 ===== */
.main-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

/* ===== 卡片通用 ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header-icon {
  width: 30px; height: 30px;
  background: var(--green-soft);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--green-primary);
  font-size: 15px;
  flex-shrink: 0;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
}

.card-header .card-sub {
  font-size: 12px;
  color: var(--gray-500);
  margin-left: auto;
}

.card-body { padding: 20px 22px; }

/* ===== 任务信息区 ===== */
.task-meta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.meta-tag.task { background: var(--green-soft); color: var(--green-primary); border: 1px solid var(--green-border); }
.meta-tag.type { background: var(--blue-light); color: var(--blue-main); border: 1px solid #90caf9; }
.meta-tag.status-open { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.meta-tag.status-closed { background: var(--gray-200); color: var(--gray-600); border: 1px solid var(--gray-300); }

/* ===== 任务描述区 ===== */
.task-desc {
  background: var(--green-soft);
  border-left: 4px solid var(--green-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--gray-800);
}

.task-desc p { margin-bottom: 6px; }
.task-desc p:last-child { margin-bottom: 0; }
.task-desc strong { color: var(--green-primary); }

/* 弹窗内任务说明——更大字号 */
.task-desc-modal {
  font-size: 17px;
  padding: 16px 20px;
  border-left-width: 5px;
  line-height: 1.7;
}

/* ===== 弹窗内列表工具栏 ===== */
.modal-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--gray-200);
}

.modal-list-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-list-count {
  font-size: 14px;
  font-weight: 400;
  color: var(--gray-500);
}

.modal-list-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== 提交列表 — 网格多列布局（讲台投屏版） ===== */
.submissions-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  align-items: start;
}

/* 空状态时退回单列 */
.submissions-list .empty-state {
  grid-column: 1 / -1;
}

.submission-item {
  border: 2.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  background: var(--white);
  display: flex;
  flex-direction: column;
}

.submission-item:hover {
  border-color: var(--green-accent);
  box-shadow: 0 6px 24px rgba(46,125,50,.15);
  transform: translateY(-2px);
}

/* ===== 卡片头部：头像 + 名字 + 查看按钮 ===== */
.sub-header-lg {
  padding: 20px 20px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.sub-avatar-lg {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-primary), var(--green-light));
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 22px;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(46,125,50,.30);
}

.sub-info-lg {
  flex: 1;
  min-width: 0;
}

.sub-name-lg {
  font-size: 26px;
  font-weight: 900;
  color: var(--gray-900);
  line-height: 1.15;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-meta-lg {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.sub-id-tag {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 500;
}

.sub-time-tag {
  font-size: 13px;
  color: var(--gray-500);
}

.sub-type-badge {
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
}

.sub-type-badge.flowchart { background: #e3f2fd; color: #1565c0; }
.sub-type-badge.code      { background: #f3e5f5; color: #6a1b9a; }
.sub-type-badge.doc       { background: var(--orange-light); color: var(--orange-main); }

/* 查看按钮右上角对齐 */
.sub-header-lg .btn-view {
  flex-shrink: 0;
  align-self: flex-start;
  font-size: 14px;
  padding: 8px 18px;
  white-space: nowrap;
}

/* ===== 通过状态徽标区（讲台投屏版，超大醒目） ===== */
.sub-grade-area {
  padding: 16px 20px;
  background: var(--white);
  flex: 1;
}

.sub-grade-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sub-verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 22px;
  border-radius: 28px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .3px;
}

.sub-verdict-badge.pass {
  background: #e8f5e9;
  color: #2e7d32;
  border: 2.5px solid #a5d6a7;
}
.sub-verdict-badge.warn {
  background: #fff3e0;
  color: #f57c00;
  border: 2.5px solid #ffcc80;
}
.sub-verdict-badge.fail {
  background: #ffebee;
  color: #e53935;
  border: 2.5px solid #ef9a9a;
}

.sub-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 13px;
  border-radius: 18px;
  font-size: 15px;
  color: var(--gray-600);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
}

.sub-meta-pill strong {
  color: var(--gray-900);
  font-weight: 800;
}

/* ===== 查看作业按钮区（兼容旧结构） ===== */
.sub-actions {
  padding: 10px 18px 14px;
  display: flex;
  gap: 10px;
}

/* 保留旧 .sub-header 等以防其他地方引用 */
.sub-header {
  padding: 13px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.sub-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-primary), var(--green-light));
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

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

.sub-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
}

.sub-time {
  font-size: 12px;
  color: var(--gray-500);
}

.sub-preview {
  padding: 14px 18px;
}

.btn-view {
  background: var(--green-soft);
  color: var(--green-primary);
  border: 2px solid var(--green-border);
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-view:hover {
  background: var(--green-primary);
  color: white;
  box-shadow: 0 3px 12px rgba(46,125,50,.25);
}

.btn-grade {
  background: linear-gradient(135deg, var(--green-primary), var(--green-light));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(46,125,50,.25);
}

.btn-grade:hover {
  box-shadow: 0 4px 16px rgba(46,125,50,.35);
  transform: translateY(-1px);
}

/* ===== 右侧控制面板 ===== */
.side-panel { display: flex; flex-direction: column; gap: 18px; }

/* 刷新按钮 */
.refresh-card {
  background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-light) 100%);
  border-radius: var(--radius-md);
  padding: 22px;
  text-align: center;
  box-shadow: var(--shadow-md);
  color: white;
}

.refresh-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  opacity: .9;
}

.refresh-desc {
  font-size: 12px;
  opacity: .75;
  margin-bottom: 16px;
}

.btn-refresh {
  background: white;
  color: var(--green-primary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.btn-refresh:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

.btn-refresh.spinning .btn-refresh-icon {
  animation: spin .6s linear 1;
}

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

.refresh-counter {
  margin-top: 12px;
  font-size: 12px;
  opacity: .8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.counter-dots {
  display: flex; gap: 4px;
}

.counter-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  transition: var(--transition);
}

.counter-dot.filled {
  background: white;
}

/* 课堂进度 */
.progress-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
}

.progress-item.active {
  background: var(--green-soft);
  border-color: var(--green-border);
}

.progress-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--gray-300);
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.progress-item.active .progress-num {
  background: var(--green-primary);
  color: white;
}

.progress-item.done .progress-num {
  background: var(--green-accent);
  color: white;
}

.progress-label { font-size: 13px; color: var(--gray-700); }
.progress-item.active .progress-label { color: var(--green-primary); font-weight: 600; }

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-item {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--green-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-500);
}

.empty-icon { font-size: 36px; margin-bottom: 10px; }
.empty-text { font-size: 14px; }

/* ===== 弹窗通用 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

/* 通用弹窗（查看作业等） */
.modal-box {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 1100px;
  max-height: 94vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(.95) translateY(12px);
  transition: transform .22s cubic-bezier(.4,0,.2,1);
}

/* 任务详情弹窗——尽量撑大，适合讲台投屏 */
.task-modal-box {
  max-width: 98vw;
  width: 98vw;
  max-height: 96vh;
  height: 96vh;
  border-radius: var(--radius-md);
}

.modal-overlay.show .modal-box {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 18px 28px 16px;
  border-bottom: 2px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--gray-900);
  flex: 1;
}

/* 任务详情弹窗标题更大 */
.task-modal-box .modal-header h2 {
  font-size: 22px;
}

.modal-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.modal-close:hover { background: var(--gray-300); color: var(--gray-900); }

.modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 24px 28px;
}

/* ===== 作业查看弹窗 ===== */
.view-section { margin-bottom: 32px; }
.view-section-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--green-primary);
  letter-spacing: .3px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--green-border);
}

/* 测试输出块（大字） */
.view-output-block {
  background: #1e1e1e;
  border-radius: 10px;
  padding: 20px 24px;
  font-family: 'Consolas','Fira Code','Courier New', monospace;
  font-size: 18px;
  color: #d4d4d4;
  line-height: 2;
  white-space: pre-wrap;
}

/* 学生备注块（大字） */
.view-note-block {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  padding: 20px;
  font-size: 18px;
  color: var(--gray-700);
  line-height: 1.9;
}

.image-viewer {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.image-viewer img {
  max-width: 100%;
  display: block;
}

.image-placeholder {
  text-align: center;
  padding: 40px;
  color: var(--gray-500);
}

.image-placeholder i { font-size: 40px; display: block; margin-bottom: 10px; }

/* ===== 代码展示 ===== */
.code-block {
  background: #1e1e1e;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}

.code-block-header {
  background: #2d2d2d;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-lang {
  color: #9cdcfe;
  font-size: 13px;
  font-weight: 600;
}

.code-copy-btn {
  background: transparent;
  border: 1px solid #555;
  color: #aaa;
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.code-copy-btn:hover { border-color: #9cdcfe; color: #9cdcfe; }

.code-block pre {
  padding: 20px;
  overflow-x: auto;
  font-family: 'Consolas','Fira Code','Courier New',monospace;
  font-size: 13px;   /* 默认，查看弹窗用 .code-block-large 覆盖 */
  line-height: 1.75;
  color: #d4d4d4;
}

/* 查看作业弹窗内代码——超大字，后排清晰可见 */
.code-block-large pre {
  font-size: 19px;
  line-height: 1.9;
  padding: 26px 28px;
}

.code-block-large .code-block-header {
  padding: 12px 22px;
}

.code-block-large .code-lang {
  font-size: 15px;
}

.code-block-large .code-copy-btn {
  font-size: 14px;
  padding: 6px 16px;
}

.code-keyword { color: #569cd6; }
.code-type { color: #4ec9b0; }
.code-string { color: #ce9178; }
.code-comment { color: #6a9955; }
.code-number { color: #b5cea8; }
.code-method { color: #dcdcaa; }

/* ===== 批改结果（查看弹窗内，大字版） ===== */
.grade-result {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.grade-result-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.grade-result-header.pass { background: var(--green-soft); border-bottom: 2px solid var(--green-border); }
.grade-result-header.fail { background: var(--red-light); border-bottom: 2px solid #ef9a9a; }
.grade-result-header.warn { background: var(--orange-light); border-bottom: 2px solid #ffcc80; }

.grade-icon { font-size: 40px; }

.grade-verdict {
  font-size: 24px;
  font-weight: 800;
}

.grade-result-header.pass .grade-verdict { color: var(--green-primary); }
.grade-result-header.fail .grade-verdict { color: var(--red-main); }
.grade-result-header.warn .grade-verdict { color: var(--orange-main); }

.grade-score {
  margin-left: auto;
  font-size: 42px;
  font-weight: 900;
  color: var(--green-primary);
  line-height: 1;
}

.grade-result-header.fail .grade-score { color: var(--red-main); }
.grade-result-header.warn .grade-score { color: var(--orange-main); }

.grade-metrics {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--gray-200);
}

.grade-metric {
  flex: 1;
  padding: 18px 14px;
  text-align: center;
  border-right: 1px solid var(--gray-200);
}

.grade-metric:last-child { border-right: none; }
.grade-metric-val { font-size: 22px; font-weight: 800; color: var(--gray-900); }
.grade-metric-label { font-size: 13px; color: var(--gray-500); margin-top: 4px; }

.grade-suggestions {
  padding: 20px 24px;
}

.grade-suggestions h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.suggestion-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  line-height: 1.7;
}

.suggestion-item.good { background: var(--green-soft); color: var(--green-dark); }
.suggestion-item.warn { background: var(--orange-light); color: #bf360c; }
.suggestion-item.error { background: var(--red-light); color: #b71c1c; }
.suggestion-item.info { background: var(--blue-light); color: #0d47a1; }

.suggestion-dot { flex-shrink: 0; margin-top: 2px; font-size: 16px; }

/* ===== 加载动画 ===== */
.grading-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px;
  gap: 16px;
}

.grading-spinner {
  width: 52px; height: 52px;
  border: 4px solid var(--green-soft);
  border-top-color: var(--green-primary);
  border-radius: 50%;
  animation: rotate .8s linear infinite;
}

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

.grading-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 280px;
}

.grading-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--gray-500);
  transition: var(--transition);
}

.grading-step.active { color: var(--green-primary); font-weight: 600; }
.grading-step.done { color: var(--gray-700); }

.step-icon { width: 18px; font-size: 13px; text-align: center; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }
  .side-panel { order: -1; }
  .stats-grid { grid-template-columns: repeat(4,1fr); }
  .topbar-inner { padding: 0 16px; }
}

@media (max-width: 500px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .modal-box { border-radius: var(--radius-md); }
  .grade-metrics { flex-wrap: wrap; }
  .grade-metric { min-width: 50%; }
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

/* ===== 通知 toast ===== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gray-900);
  color: white;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: all .3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.green { background: var(--green-primary); }

/* ===== 图片灯箱 ===== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.lightbox-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}

.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  color: white;
  font-size: 28px;
  cursor: pointer;
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}

.lightbox-close:hover { background: rgba(255,255,255,.3); }

/* ===== 选项卡 ===== */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 18px;
}

.tab-btn {
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.tab-btn.active {
  color: var(--green-primary);
  border-bottom-color: var(--green-primary);
}

.tab-btn:hover:not(.active) { color: var(--gray-700); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== fadeIn 动画（批改结果出现） ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== 内嵌批改触发区 ===== */
.grade-inline-trigger {
  border-top: 2px dashed var(--green-border);
  margin-top: 4px;
  padding-top: 20px;
}

/* ===== 去掉旧的 hidden-sub 模糊效果（现在直接不渲染，保留类以防万一） ===== */
.hidden-sub { display: none !important; }

/* ===== 任务详情弹窗内嵌刷新按钮（大号版） ===== */
.btn-refresh-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 22px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  background: linear-gradient(135deg, var(--green-primary), var(--green-light));
  color: white;
  border: none;
  box-shadow: 0 2px 10px rgba(46,125,50,.30);
  white-space: nowrap;
}
.btn-refresh-inline:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 18px rgba(46,125,50,.40);
}
.btn-refresh-inline[data-done="true"] {
  background: var(--gray-200);
  color: var(--gray-500);
  box-shadow: none;
  cursor: default;
}
.btn-refresh-inline[data-done="true"]:hover {
  transform: none;
}
.btn-refresh-inline.spinning .btn-refresh-icon {
  display: inline-block;
  animation: spin .6s linear 1;
}

/* ===== 刷新按钮 spinning 动画修正 ===== */
.btn-refresh.spinning .btn-refresh-icon {
  display: inline-block;
  animation: spin .6s linear 1;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ===== 内嵌批改结果区域过渡 ===== */
#grade-inline-area {
  margin-top: 6px;
}

/* ===== 批改按钮（查看弹窗内） ===== */
.btn-grade {
  background: linear-gradient(135deg, var(--green-primary), var(--green-light));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(46,125,50,.25);
}
.btn-grade:hover {
  box-shadow: 0 4px 16px rgba(46,125,50,.38);
  transform: translateY(-1px);
}
.btn-grade:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

/* ===== 查看弹窗 view-section 间距修正 ===== */
.view-section { margin-bottom: 22px; }
.view-section:last-child { margin-bottom: 0; }

/* ===== 提交项预览图片缩略图 ===== */
.sub-preview img {
  border-radius: 6px;
  border: 1px solid var(--gray-200);
}

/* ===== 响应式补充 ===== */
@media (max-width: 600px) {
  .grade-metrics { flex-wrap: wrap; }
  .grade-metric  { min-width: 50%; }
  .admin-topbar-inner { gap: 8px; }
}

