* { box-sizing: border-box; }
html, body, #app { margin: 0; min-height: 100%; }
body {
  background: #eef1f6;
  color: #252b35;
  font: 15px/1.65 "Microsoft YaHei", system-ui, sans-serif;
}
:root { --el-color-primary: #3165ef; }
a { color: #3165ef; text-decoration: none; }

.login-card {
  width: min(420px, calc(100% - 32px));
  margin: 48px auto;
  background: #fff;
  border-radius: 16px;
  padding: 28px;
}
.login-card h1 { margin: 0 0 8px; font-size: 22px; }
.login-error {
  background: #fef3f2;
  border: 1px solid #fecdca;
  color: #b42318;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0 0 12px;
  font-size: 13px;
}

.teacher-shell {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  background: #f5f6f8;
}
.teacher-side {
  width: 168px;
  flex: none;
  background: #fff;
  border-right: 1px solid #e9ebef;
  padding: 16px 12px;
}
.brand { font-weight: 700; margin-bottom: 14px; white-space: nowrap; }
.teacher-nav a {
  display: block;
  padding: 8px 10px;
  color: #667085;
  border-radius: 8px;
  white-space: nowrap;
}
.teacher-nav a.router-link-active {
  background: #edf3ff;
  color: #3165ef;
  font-weight: 650;
}
.teacher-who {
  margin-top: 28px;
  padding-top: 12px;
  border-top: 1px solid #eef1f5;
  color: #667085;
  font-size: 13px;
}
.teacher-name { margin-bottom: 4px; }
.text-btn {
  background: none;
  border: 0;
  padding: 0;
  color: #3165ef;
  cursor: pointer;
  font: inherit;
}
.teacher-actions { white-space: nowrap; }
.teacher-main { flex: 1; min-width: 0; padding: 18px 22px; }
.page-title { margin: 0; font-size: 18px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.data-table { margin-top: 14px; }
.grade-layout { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }

@media (max-width: 759px) {
  .teacher-shell { flex-direction: column; }
  .teacher-side { width: 100%; display: flex; overflow-x: auto; white-space: nowrap; }
  .teacher-main { width: 100%; }
  .toolbar { flex-wrap: wrap; }
  .data-table { overflow-x: auto; }
  .data-table table { min-width: 720px; }
  .data-table th, .data-table td { white-space: nowrap; }
  .grade-layout { flex-direction: column; }
  .el-dialog { width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px); margin: 12px auto !important; }
  .teacher-side { align-items: center; gap: 8px; border-right: 0; border-bottom: 1px solid #e9ebef; }
  .teacher-side > * { flex: none; }
  .brand { margin-bottom: 0; }
  .teacher-nav { display: flex; flex-direction: row; }
  .teacher-who { margin-top: 0; padding-top: 0; border-top: 0; display: flex; gap: 8px; align-items: center; }
  .teacher-name { margin-bottom: 0; }
}

.data-table {
  background: #fff;
  border: 1px solid #e9ecf1;
  border-radius: 12px;
  overflow-x: auto;
}
.data-table table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  text-align: left;
  padding: 13px 16px;
  white-space: nowrap;
  vertical-align: middle;
}
.data-table th {
  background: #f8f9fc;
  color: #98a2b3;
  font-size: 13px;
  font-weight: 400;
}
.data-table td { border-top: 1px solid #eef1f5; }
.req-cell {
  display: inline-block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.ops { display: flex; gap: 10px; align-items: center; }
.text-btn.danger { color: #b42318; }
.text-btn:disabled { color: #c5ccd6; cursor: default; }
.muted { color: #667085; font-size: 13px; }
.batch-explain { margin: 0 0 14px; }
.import-detail {
  margin-top: 8px;
  max-height: 240px;
  overflow: auto;
  background: #f8f9fc;
  border-radius: 8px;
  padding: 8px 12px;
  line-height: 1.8;
}
.ok { color: #3e9963; }
.warn { color: #bb8c36; }
.tag {
  background: #fff5e5;
  color: #bb8c36;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
}
.hint { color: #98a2b3; font-weight: 400; }
.field-label { display: block; font-size: 13px; margin: 12px 0 6px; color: #344054; }
.dialog-error { margin-top: 10px; }
.hint-card {
  background: #fff;
  border: 1px solid #e9ecf1;
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
}
.warn-note {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 12px;
}
.file-dash {
  display: block;
  border: 1px dashed #bad0f9;
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  color: #386be6;
  background: #f8fbff;
  cursor: pointer;
}
.file-dash input { display: none; }
.example-box { width: 100%; flex: 1 0 100%; }
button.example-preview-link {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: none;
  cursor: zoom-in;
}
.example-preview-link { display: block; }
.app-root { min-height: 100%; }
.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(16, 18, 22, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 16px 16px;
}
.photo-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.photo-viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: #fff;
  color: #252b35;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
}
.example-preview {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  display: block;
  background: #f4f6f8;
  border: 1px solid #e6ebf2;
  border-radius: 10px;
}
.example-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
}
.example-actions .file-dash:not(.file-dash-inline) { width: 100%; }
.file-dash.file-dash-inline {
  display: inline-block;
  width: auto;
  padding: 8px 18px;
}
.example-thumb {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e6ebf2;
  display: block;
  background: #f4f6f8;
}
.class-bar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.class-search { width: 200px; }
.class-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.class-meta { margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.page-title .text-btn { font-size: 14px; font-weight: 400; margin-left: 8px; }
.tool-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-row { margin-top: 12px; }
.filter-select { width: 200px; }
.stack-form .el-select, .stack-form .el-input { width: 100%; }
.stack-form .el-input-number { width: 160px; }
.name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.class-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid #eef1f5; }
.section-label { display: block; margin-top: 18px; }
.search-input { max-width: 420px; margin-top: 12px; }
.search-row { margin-top: 12px; justify-content: flex-start; }
.teacher-bar { margin-top: 12px; }
.teacher-bar .search-input { margin-top: 0; }
.search-row .search-input { margin-top: 0; flex: 1; }
.filter-search { width: 220px; }
.inline-search { width: 240px; margin-top: 0; }
.template-head { display: flex; align-items: center; gap: 12px; }
.lesson-bar { margin-top: 18px; }
.lesson-bar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pager { display: flex; justify-content: flex-end; margin-top: 14px; max-width: 100%; overflow-x: auto; }
.pager .el-pagination { flex-wrap: wrap; row-gap: 8px; }
.grade-dialog .el-dialog__body { max-height: calc(100vh - 140px); overflow: auto; }
.grade-dialog .grade-canvas { max-height: min(420px, 46vh); }
.name-input { max-width: 360px; margin-top: 12px; }
.grade-info, .grade-comment {
  width: 100%;
  flex: none;
  background: #fff;
  border: 1px solid #e9ebef;
  border-radius: 12px;
  padding: 16px;
}
.grade-board { width: 100%; min-width: 0; }
.grade-zoom { margin-top: 12px; }
.grade-canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: min(880px, 100%);
  max-height: min(560px, 62vh);
  margin: 12px 0 0;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e6e8ed;
  border-radius: 10px;
  touch-action: none;
  cursor: crosshair;
  user-select: none;
}
.info-card {
  background: #fff;
  border: 1px solid #e9ecf1;
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
}
.student-name { display: block; margin-top: 10px; }
.comment-box { margin-top: 8px; }
.comment-action { margin-top: 12px; }
.el-button.solid-danger {
  --el-button-bg-color: #b42318;
  --el-button-border-color: #b42318;
  --el-button-hover-bg-color: #912018;
  --el-button-hover-border-color: #912018;
  --el-button-active-bg-color: #7a1b14;
  --el-button-active-border-color: #7a1b14;
  --el-button-text-color: #fff;
  --el-button-hover-text-color: #fff;
}

@media (max-width: 759px) {
  .class-bar-left { flex-wrap: wrap; }
  .class-search { width: 100%; }
  .lesson-bar-left { flex-wrap: wrap; }
  .inline-search { width: 100%; }
  .filter-select { width: 100%; }
  .name-grid { grid-template-columns: 1fr; }
  .grade-info, .grade-comment { width: 100%; }
}

.student-app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: linear-gradient(180deg, #e7f0ff 0%, #f4f7fb 240px, #f6f8fb 100%);
  display: flex;
  flex-direction: column;
}
.student-app.is-login { background: #eef1f6; }
.student-login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.student-login-main .login-card { margin: 0; width: min(420px, 100%); }
.student-login-sub { margin: 0 0 12px; }
.student-login-main .login-card h1 { font-size: 20px; margin-bottom: 0; }
.student-top {
  background: rgba(244, 247, 251, 0.92);
  padding: 16px 16px 8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
}
.student-top b { font-size: 18px; flex: 1; min-width: 0; }
.student-back { display: inline-flex; align-items: center; gap: 2px; color: #8b95a8; }
.student-back svg { width: 18px; height: 18px; }
.stu-head-art { width: 64px; height: 44px; flex: none; }
.student-body {
  flex: 1;
  padding: 18px 16px;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
.student-tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: #fff;
  box-shadow: 0 -6px 18px rgba(70, 100, 150, 0.06);
  z-index: 5;
  padding: 6px 0 env(safe-area-inset-bottom);
}
.student-tabs button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: 0;
  padding: 6px 0 8px;
  color: #b0b8c6;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.student-tabs svg { width: 22px; height: 22px; }
.student-tabs button.cur { color: #3d6ef5; font-weight: 600; }
.stu-title { margin: 4px 0 0; font-size: 28px; line-height: 1.25; color: #1c2434; font-weight: 700; }
.stu-sub { margin: 6px 0 0; color: #8b95a8; font-size: 13px; }
.stu-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.stu-hero-art { width: 96px; height: 72px; flex: none; margin-top: -4px; }
.stu-entry, .stu-action, .stu-profile, .stu-panel {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(70, 100, 150, 0.08);
}
.stu-entry, .stu-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  padding: 16px;
  margin-top: 12px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.stu-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  margin-top: 16px;
}
.stu-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #3d6ef5;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  flex: none;
}
.stu-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: none;
}
.stu-ico svg { width: 22px; height: 22px; }
.stu-ico.is-blue { background: #e8f1ff; color: #3d6ef5; }
.stu-ico.is-purple { background: #efeaff; color: #7b61ff; }
.stu-ico.is-gold { background: #fff4d6; color: #f5b400; }
.stu-ico.is-amber { background: #fff4e8; color: #f5a524; }
.stu-pill {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
}
.stu-pill.is-green { background: #e7f8ef; color: #1f9d5a; }
.stu-pill.is-amber { background: #fff4e8; color: #e09412; }
.stu-pill.is-blue { background: #e8f1ff; color: #3d6ef5; }
.stu-pill.is-muted { background: #f2f4f7; color: #98a2b3; }
.stu-req { display: flex; align-items: flex-start; gap: 10px; }
.stu-req .stu-ico { width: 36px; height: 36px; border-radius: 10px; }
.stu-req .stu-ico svg { width: 18px; height: 18px; }
.stu-file { min-height: 72px; border-radius: 14px; margin-top: 12px; }
.stu-note { position: relative; margin-top: 12px; }
.stu-note .el-textarea__inner { border-radius: 14px; padding-bottom: 26px; box-shadow: none; background: #f7f9fc; }
.stu-note-count { position: absolute; right: 12px; bottom: 8px; color: #c0c6d0; font-size: 12px; pointer-events: none; }
.stu-watermark { display: block; width: 160px; height: 110px; margin: 28px auto 0; opacity: 0.85; }
.stu-work-head { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.stu-done { display: inline-flex; align-items: center; gap: 4px; color: #1f9d5a; font-size: 13px; }
.stu-done svg { width: 16px; height: 16px; }
.stu-msg { margin-top: 8px; color: #3a4250; }
.stu-review-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.stu-review-actions .text-btn { display: inline-flex; align-items: center; gap: 4px; color: #3d6ef5; }
.stu-review-actions svg { width: 16px; height: 16px; }
.stu-pass-art { width: 88px; height: 72px; flex: none; margin-top: 4px; }
.stu-pass-card { margin-top: 18px; }
.stu-pass-label { display: flex; align-items: center; gap: 6px; margin: 16px 0 8px; font-weight: 600; color: #1c2434; }
.stu-pass-label:first-child { margin-top: 0; }
.stu-pass-label svg { width: 16px; height: 16px; color: #3d6ef5; }
.stu-pass-card .el-input__wrapper { background: #f4f7fb; border-radius: 10px; box-shadow: none; }
.stu-pass-hint { margin: 8px 0 0; color: #98a2b3; font-size: 12px; line-height: 1.5; }
.stu-pass-card .login-error { margin-top: 12px; }
.student-submit.el-button { height: 46px; border-radius: 12px; font-size: 16px; }
.stu-entry-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stu-entry-text b, .stu-action b { font-size: 16px; font-weight: 600; color: #1c2434; }
.stu-entry-text span { color: #98a2b3; font-size: 12px; }
.stu-chevron { color: #c5ccd6; flex: none; display: flex; }
.stu-chevron svg { width: 18px; height: 18px; }
.stu-panel { margin-top: 12px; padding: 16px 16px 4px; }
.stu-panel-head { display: flex; justify-content: space-between; align-items: center; }
.stu-panel-head b { font-size: 16px; }
.stu-count { background: #e8f1ff; color: #3d6ef5; border-radius: 8px; font-size: 12px; padding: 2px 8px; }
.stu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: 0;
  border-top: 1px solid #f2f4f8;
  padding: 14px 0;
  margin-top: 8px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.stu-action b { flex: 1; }
.stu-action.is-danger { background: #fff5f5; box-shadow: none; }
.stu-action.is-danger b, .stu-action.is-danger .stu-chevron { color: #f04444; }
.stu-action.is-danger .stu-ico { background: #ffe8e8; color: #f04444; }
.student-empty {
  min-height: 320px;
  display: grid;
  place-items: center;
  color: #98a2b3;
}
.student-card {
  background: #fff;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(70, 100, 150, 0.08);
  padding: 16px;
  margin-top: 12px;
}
.student-card:first-child { margin-top: 0; }
button.student-card {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button.student-card.student-lesson {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.student-lesson > span { white-space: nowrap; }
.student-go { color: #3165ef; }
.student-req { background: #f8f9fc; }
.student-example-label { margin-top: 10px; }
.student-upload-preview { margin-bottom: 10px; }
.student-shot {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e6e8ed;
  border-radius: 10px;
  margin-top: 10px;
  display: block;
}
.student-remain { margin: 10px 0; }
.student-reupload { margin-top: 16px; }
.student-message { margin-top: 10px; }
.student-submit { width: 100%; margin-top: 12px; }
.student-gap { margin-top: 10px; }
.student-section { display: block; margin-top: 16px; }
.student-work { margin-top: 12px; }
.student-grader { margin-top: 8px; }
.student-comment { background: #f7f9fd; }
.student-expand { margin-top: 10px; }
.file-dash.student-lock {
  margin-top: 12px;
  background: #f8f9fc;
  color: #98a2b3;
  border-style: solid;
  cursor: default;
  pointer-events: none;
}
label.student-ghost { cursor: pointer; }
.student-ghost input { display: none; }
.student-ghost {
  display: block;
  width: 100%;
  text-align: center;
  background: #fff;
  border: 1px solid #d7deea;
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 10px;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}
.student-profile { display: flex; gap: 10px; align-items: center; }
.student-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #eaf0fe;
  color: #3165ef;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: none;
}
.student-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.student-class { margin-top: 8px; }
button.student-card.student-link { color: #3165ef; }
.student-logout {
  display: block;
  width: 100%;
  margin-top: 14px;
  background: none;
  border: 0;
  color: #98a2b3;
  text-align: center;
  font: inherit;
  cursor: pointer;
}
