:root {
  --bg: #f6f3ee;
  --panel: #ffffff;
  --ink: #16201b;
  --muted: #66706b;
  --line: #d9ded8;
  --accent: #0f766e;
  --accent-strong: #0b5d56;
  --accent-soft: #dff3ef;
  --warn: #a15c00;
  --warn-soft: #fff3dc;
  --ok: #137333;
  --ok-soft: #e5f4e8;
  --bad: #b42318;
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans CJK SC",
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.12), transparent 260px),
    var(--bg);
}

button {
  cursor: pointer;
  font: inherit;
}

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

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  line-height: 1.35;
}

.summary {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 122px;
  justify-content: center;
  padding: 12px 16px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  white-space: nowrap;
}

.summary span:first-child {
  color: var(--accent-strong);
  font-size: 28px;
  font-weight: 800;
}

.notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #eed7a7;
  border-radius: 8px;
  background: var(--warn-soft);
  color: #674000;
  font-weight: 700;
  line-height: 1.6;
}

.collector {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  min-height: calc(100vh - 216px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(30, 42, 35, 0.08);
  overflow: hidden;
}

.name-panel {
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 16px;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: #fbfcfb;
}

.upload-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.name-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  align-content: start;
  gap: 8px;
  padding-right: 4px;
  overflow: visible;
}

.name-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 7px 8px 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.name-button:hover {
  border-color: #b9c4bd;
  background: #f7f9f8;
}

.name-button.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  transform: translateX(2px);
}

.name-button.is-uploaded:not(.is-selected) {
  background: #f7fbf7;
}

.student-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge.waiting {
  background: #eef1ee;
  color: var(--muted);
}

.selected-person {
  min-height: 60px;
}

#selected-name-label {
  color: var(--ink);
}

button:focus-visible,
.drop-zone:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
}

.drop-zone {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 190px;
  padding: 22px;
  border: 2px dashed #9ab7ae;
  border-radius: 8px;
  background: #fbfdfc;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.drop-zone.is-disabled {
  border-color: #d1d8d3;
  background: #fafafa;
  color: var(--muted);
}

.upload-icon {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.drop-zone.is-disabled .upload-icon {
  background: #eef1ee;
  color: var(--muted);
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.upload-icon svg {
  width: 30px;
  height: 30px;
}

.drop-title {
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
}

.drop-rule {
  color: var(--muted);
  line-height: 1.55;
}

.drop-rule span {
  color: var(--accent-strong);
  font-weight: 800;
}

.selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  color: var(--muted);
}

.selected-file[hidden] {
  display: none;
}

.icon-button,
.secondary-button,
#upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.icon-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  background: transparent;
  color: var(--muted);
}

.icon-button:hover {
  background: #eef1ee;
  color: var(--ink);
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

#upload-button {
  min-width: 136px;
  padding: 0 18px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

#upload-button:hover:not(:disabled) {
  background: var(--accent-strong);
}

#upload-button:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.secondary-button {
  padding: 0 12px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-button:hover {
  border-color: #b9c4bd;
  background: #f7f8f7;
}

.status-message {
  min-height: 24px;
  color: var(--muted);
  font-weight: 700;
}

.status-message.ok {
  color: var(--ok);
}

.status-message.bad {
  color: var(--bad);
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 1280px);
    padding-top: 22px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .summary {
    justify-content: flex-start;
  }

  .collector {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .name-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .name-list {
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  }

  .upload-panel {
    padding: 18px;
  }

  .drop-zone {
    align-items: flex-start;
    flex-direction: column;
    min-height: 210px;
    padding: 18px;
  }

  .drop-title {
    font-size: 18px;
  }

  #upload-button {
    width: 100%;
  }
}
