:root {
  --app-ink: #20262d;
  --app-muted: #65717d;
  --app-border: #dfe3e7;
  --app-surface: #ffffff;
  --app-canvas: #f5f7f8;
  --app-accent: #176b5b;
  --app-accent-hover: #105448;
  --app-amber: #a76513;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--app-ink);
  background: var(--app-canvas);
  letter-spacing: 0;
}

a,
button,
input,
select,
textarea {
  letter-spacing: 0;
}

a {
  color: var(--app-accent);
}

a:hover {
  color: var(--app-accent-hover);
}

.workspace-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.app-header {
  min-height: 58px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface);
}

.app-header__inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--app-ink);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.app-brand:hover {
  color: var(--app-ink);
}

.app-brand img {
  flex: 0 0 36px;
  object-fit: contain;
  border-radius: 6px;
}

.app-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.app-nav a,
.nav-command {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 0;
  border-radius: 4px;
  color: #4f5b66;
  background: transparent;
  font: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.app-nav a:hover,
.app-nav a[aria-current="page"],
.nav-command:hover {
  color: var(--app-ink);
  background: #eef1f2;
}

.app-nav form {
  margin: 0;
}

.app-main {
  min-height: calc(100vh - 59px);
}

.auth-shell {
  min-height: calc(100vh - 59px);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-panel {
  width: min(100%, 400px);
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: var(--app-surface);
  box-shadow: 0 12px 28px rgba(32, 38, 45, 0.08);
}

.auth-shell--wide .auth-panel {
  width: min(100%, 480px);
}

.auth-panel__header,
.auth-form,
.auth-panel__footer {
  padding: 22px 24px;
}

.auth-panel__header {
  padding-bottom: 4px;
}

.auth-panel__header h1,
.page-heading h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.section-kicker {
  margin: 0 0 6px;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.form-field {
  min-width: 0;
}

.form-label {
  margin-bottom: 7px;
  color: #36414b;
  font-weight: 600;
}

.form-control:focus {
  border-color: var(--app-accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.14);
}

.field-error {
  margin-top: 5px;
  color: #b42318;
  font-size: 13px;
}

.auth-panel__footer {
  border-top: 1px solid var(--app-border);
  color: var(--app-muted);
  text-align: center;
}

.btn-primary {
  border-color: var(--app-accent);
  background: var(--app-accent);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--app-accent-hover);
  background: var(--app-accent-hover);
}

.page-stack {
  display: grid;
  gap: 26px;
  padding: 30px 0 48px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--app-border);
}

.identity-block {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--app-muted);
  overflow-wrap: anywhere;
}

.status-label,
.count-label {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.status-label--student {
  color: #176b5b;
  background: #e6f3f0;
}

.status-label--teacher {
  color: #8b520d;
  background: #fff0d7;
}

.data-section,
.filter-section,
.detail-band {
  min-width: 0;
}

.section-heading {
  min-height: 42px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2,
.detail-band h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.count-label {
  color: var(--app-muted);
  background: #e9edef;
}

.empty-state-panel {
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px dashed #bcc5cb;
  border-radius: 6px;
  background: var(--app-surface);
  text-align: center;
}

.empty-state-panel strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.empty-state-panel p,
.muted-state {
  margin: 0;
  color: var(--app-muted);
}

.empty-state-panel--warning {
  border-color: #d7ad70;
  background: #fffaf1;
}

.empty-state-panel--error {
  border-color: #dfaca8;
  background: #fff8f7;
}

.framework-placeholder {
  min-height: 300px;
}

.filter-section {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--app-border);
}

.filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.filter-field {
  min-width: 0;
}

.filter-field label {
  display: block;
  margin-bottom: 7px;
  color: #36414b;
  font-size: 13px;
  font-weight: 600;
}

.filter-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.result-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: var(--app-surface);
}

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

.result-table--teacher {
  min-width: 1080px;
}

.result-table th,
.result-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #e8ebed;
  text-align: left;
  vertical-align: top;
}

.result-table th {
  color: #4d5964;
  background: #f8f9fa;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.result-table tbody tr:last-child td {
  border-bottom: 0;
}

.result-table tbody tr:hover {
  background: #fbfcfc;
}

.result-table__primary {
  color: var(--app-ink);
  font-weight: 600;
}

.result-table__nowrap,
.result-table__action {
  white-space: nowrap;
}

.result-table__summary {
  min-width: 230px;
  color: #505c66;
  line-height: 1.55;
}

.result-table__action {
  text-align: right;
}

.review-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.review-status--passed {
  color: #126151;
  background: #e4f3ef;
}

.review-status--warning {
  color: #86520e;
  background: #fff0d7;
}

.review-status--failed,
.review-status--error {
  color: #a12a21;
  background: #fde9e7;
}

.pagination-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding-top: 16px;
  color: var(--app-muted);
  font-size: 13px;
}

.pagination-nav a,
.pagination-nav span {
  min-width: 56px;
  text-align: center;
}

.pagination-nav strong {
  color: #4f5b66;
  font-weight: 600;
}

.detail-overview {
  padding: 20px;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: var(--app-surface);
}

.detail-metadata {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 24px;
  margin: 0;
}

.detail-metadata div {
  min-width: 0;
}

.detail-metadata dt {
  margin-bottom: 5px;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 600;
}

.detail-metadata dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.review-content,
.issue-list,
.submission-photo-grid {
  min-width: 0;
}

.submission-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.submission-photo {
  min-width: 0;
  color: var(--app-text);
  text-decoration: none;
}

.submission-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  border: 1px solid var(--app-border);
  border-radius: 4px;
  background: #f4f6f7;
}

.submission-photo span {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--app-muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submission-photo:hover img,
.submission-photo:focus-visible img {
  border-color: var(--app-amber);
}

.review-summary {
  margin: 0;
  color: #37424c;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.issue-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.issue-item {
  padding: 15px 16px;
  border: 1px solid var(--app-border);
  border-left: 3px solid var(--app-amber);
  border-radius: 4px;
  background: var(--app-surface);
}

.issue-item__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.issue-item__heading strong {
  overflow-wrap: anywhere;
}

.issue-item__heading span {
  flex: 0 0 auto;
  color: var(--app-muted);
  font-size: 12px;
}

.issue-item p {
  margin: 8px 0 0;
  color: var(--app-muted);
  overflow-wrap: anywhere;
}

.detail-band {
  min-height: 130px;
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid var(--app-border);
}

.muted-state {
  min-height: 80px;
  display: grid;
  place-items: center;
  border: 1px dashed #c9d0d5;
  border-radius: 6px;
  background: var(--app-surface);
}

.error-page {
  min-height: calc(100vh - 59px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.error-page h1,
.error-code {
  margin: 0;
}

.error-page h1 {
  font-size: 24px;
}

.error-code {
  color: var(--app-amber);
  font-size: 44px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .workspace-shell {
    width: min(100% - 20px, 1180px);
  }

  .app-header__inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
  }

  .app-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .app-main,
  .auth-shell,
  .error-page {
    min-height: calc(100vh - 104px);
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .identity-block {
    justify-content: flex-start;
  }

  .detail-band {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .filter-form,
  .detail-metadata {
    grid-template-columns: 1fr;
  }

  .filter-actions .btn {
    flex: 1 1 0;
  }

  .pagination-nav {
    justify-content: space-between;
    gap: 8px;
  }

  .issue-item__heading {
    flex-direction: column;
    gap: 5px;
  }
}

@media (min-width: 641px) and (max-width: 980px) {
  .filter-form,
  .detail-metadata {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-actions {
    grid-column: 1 / -1;
  }
}

/* 账号标注：开发人员等身份徽章，账号管理、学生名单、项目组共用。 */
.account-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  vertical-align: middle;
}
.account-badge--dev {
  background: #fdf3e7;
  border: 1px solid #ecd0ac;
  color: #a35d1a;
}