:root {
  color-scheme: light;
  --bg: #f3f6f4;
  --panel: #ffffff;
  --ink: #18232c;
  --muted: #61707a;
  --line: #d7e0e3;
  --green: #15785f;
  --green-soft: #e9f4f0;
  --blue: #226b9a;
  --blue-soft: #eaf2f8;
  --red: #a43e3a;
  --red-soft: #fff1ef;
  --yellow: #9a6a12;
  --yellow-soft: #fff5dd;
  --header: #14252d;
  --shadow: 0 14px 32px rgba(24, 35, 44, 0.07);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea,
summary {
  outline-color: var(--blue);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 34px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 7px;
  font-size: 23px;
}

h3 {
  margin-bottom: 10px;
  font-size: 17px;
}

h4 {
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.6;
}

p {
  color: var(--muted);
  line-height: 1.65;
}

a {
  color: var(--blue);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 138px;
  padding: 24px 36px;
  background: var(--header);
  color: #f7fbfc;
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 18px;
}

.team-logo {
  flex: 0 0 auto;
  width: 100px;
  height: 91px;
  object-fit: contain;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.28));
}

.brand-block {
  min-width: 0;
}

.brand-block p {
  margin-bottom: 0;
  color: #c3d2d7;
}

.eyebrow,
.section-kicker {
  margin-bottom: 6px;
  color: #78c8af;
  font-size: 13px;
  font-weight: 800;
}

.portal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #f7fbfc;
  font-weight: 700;
  text-decoration: none;
}

.button-link {
  cursor: pointer;
}

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

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  width: min(1180px, calc(100% - 36px));
  margin: auto auto 0;
  padding: 22px 0 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.icp-link {
  justify-self: center;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
}

.icp-link:hover {
  color: var(--blue);
  text-decoration: underline;
}

.version-label {
  justify-self: end;
  color: var(--muted);
  white-space: nowrap;
}

.admin-identity {
  display: grid;
  min-width: 130px;
  margin-right: 6px;
  text-align: right;
}

.admin-identity strong {
  color: #f7fbfc;
  font-size: 14px;
}

.admin-identity small {
  color: #aebfc5;
  font-size: 12px;
}

.stepbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 760px;
  margin: 18px auto 0;
  padding: 0 18px;
}

.stepbar span {
  position: relative;
  padding: 10px 12px;
  border-bottom: 3px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.stepbar span.active {
  border-color: var(--green);
  color: var(--green);
}

.student-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 20px;
  width: min(1460px, calc(100% - 36px));
  margin: 18px auto 36px;
}

.surface {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.main-surface,
.evaluation-surface {
  min-width: 0;
  padding: 24px;
}

.section-heading,
.candidate-summary,
.detail-header,
.list-heading,
.question-section-head,
.save-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading p,
.candidate-summary p,
.detail-header p {
  margin-bottom: 0;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.practice-onboarding {
  margin-bottom: 28px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.practice-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  list-style: none;
}

.practice-flow li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  min-height: 105px;
  padding: 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.practice-flow strong {
  display: block;
  margin-bottom: 5px;
}

.practice-flow p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.flow-number {
  color: #d8541c;
  font-size: 18px;
  font-weight: 900;
}

.direction-fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.direction-fieldset legend {
  margin-bottom: 3px;
  padding: 0;
  font-size: 17px;
  font-weight: 800;
}

.field-help {
  margin-bottom: 13px;
  font-size: 14px;
}

.direction-draw-rule {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 14px;
  margin-bottom: 16px;
  border-left: 4px solid var(--green);
  padding: 10px 12px;
  background: #eff8f5;
  line-height: 1.55;
}

.direction-draw-rule strong {
  color: var(--green);
}

.direction-draw-rule span {
  color: var(--muted);
}

.direction-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.direction-card {
  --direction-accent: var(--green);
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.direction-card.mechanical {
  --direction-accent: #d8541c;
}

.direction-card.electrical {
  --direction-accent: #087aa8;
}

.direction-card.vision {
  --direction-accent: #b13e3b;
}

.direction-card.functional {
  --direction-accent: #9a6a12;
}

.direction-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.direction-card-body {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 132px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--direction-accent);
  border-radius: 7px;
  padding: 14px;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.direction-card:hover .direction-card-body {
  border-color: var(--direction-accent);
  transform: translateY(-2px);
}

.direction-card input:focus-visible + .direction-card-body {
  outline: 3px solid rgba(34, 107, 154, 0.2);
  outline-offset: 2px;
}

.direction-card input:checked + .direction-card-body,
.direction-card.selected .direction-card-body {
  border-color: var(--direction-accent);
  box-shadow: inset 0 0 0 1px var(--direction-accent), 0 8px 18px rgba(24, 35, 44, 0.08);
}

.direction-card input:checked + .direction-card-body::after {
  position: absolute;
  top: 13px;
  right: 13px;
  content: "✓";
  color: var(--direction-accent);
  font-size: 17px;
  font-weight: 900;
}

.direction-index {
  margin-bottom: 9px;
  color: var(--direction-accent);
  font-size: 12px;
  font-weight: 900;
}

.direction-card-body strong {
  margin-bottom: 8px;
  line-height: 1.35;
}

.direction-card-body > span:last-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.direction-preview {
  --direction-accent: var(--green);
  min-height: 116px;
  border-left: 4px solid var(--line);
  padding: 18px 20px;
  background: #f7f9f9;
}

.direction-preview.mechanical {
  --direction-accent: #d8541c;
}

.direction-preview.electrical {
  --direction-accent: #087aa8;
}

.direction-preview.vision {
  --direction-accent: #b13e3b;
}

.direction-preview.functional {
  --direction-accent: #9a6a12;
}

.direction-preview.mechanical,
.direction-preview.electrical,
.direction-preview.vision,
.direction-preview.functional {
  border-left-color: var(--direction-accent);
}

.direction-preview h3,
.direction-preview p {
  margin-bottom: 0;
}

.direction-preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.direction-preview-heading .section-kicker {
  color: var(--direction-accent);
}

.direction-selected-mark {
  flex: 0 0 auto;
  padding: 5px 8px;
  background: #fff;
  color: var(--direction-accent);
  font-size: 12px;
  font-weight: 800;
}

.direction-question-note {
  margin-top: 12px;
  border-left: 3px solid var(--direction-accent);
  padding-left: 10px;
  color: var(--direction-accent);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.direction-preview-grid {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1.2fr;
  gap: 18px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.direction-preview-grid section {
  min-width: 0;
}

.direction-preview-grid h4 {
  margin-bottom: 7px;
  font-size: 14px;
}

.direction-preview-grid ol {
  margin: 0;
  padding-left: 20px;
}

.direction-preview-grid li,
.direction-preview-grid p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topic-list span {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.form-section-heading {
  margin-top: 6px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.form-section-heading h3,
.form-section-heading p {
  margin-bottom: 3px;
}

.form-section-heading p {
  font-size: 13px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 700;
}

.wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
}

input,
select {
  min-height: 43px;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(34, 107, 154, 0.11);
}

.form-actions,
.draw-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.form-actions {
  margin-top: 4px;
}

button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary-btn {
  background: var(--green);
  color: #fff;
}

.secondary-btn {
  background: var(--blue);
  color: #fff;
}

.ghost-btn {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.text-btn {
  margin-left: auto;
  background: transparent;
  color: var(--blue);
}

.status-message {
  margin-bottom: 18px;
  border-left: 4px solid var(--blue);
  padding: 11px 14px;
  background: var(--blue-soft);
  color: var(--blue);
  line-height: 1.5;
}

.status-message[data-tone="success"] {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.status-message[data-tone="error"] {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.candidate-summary {
  margin-bottom: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.summary-status {
  display: grid;
  justify-items: end;
  gap: 8px;
  text-align: right;
}

.summary-status strong {
  color: var(--muted);
  font-size: 14px;
}

.status-badge,
.candidate-row-status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--yellow);
  font-size: 12px;
  font-weight: 800;
}

.status-badge.confirmed,
.candidate-row-status.confirmed {
  background: var(--green-soft);
  color: var(--green);
}

.lock-notice,
.admin-warning {
  margin-bottom: 20px;
  border-left: 4px solid var(--yellow);
  padding: 11px 14px;
  background: var(--yellow-soft);
  color: #65490f;
  line-height: 1.55;
}

.lock-notice.confirmed {
  border-color: var(--green);
  background: var(--green-soft);
  color: #175944;
}

.question-columns,
.evaluation-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.question-section,
.evaluation-group {
  min-width: 0;
}

.question-section-head {
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 9px;
  border-bottom: 2px solid var(--line);
}

.question-section-head h3,
.question-section-head span {
  margin: 0;
}

.question-section-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.question-list {
  display: grid;
  gap: 10px;
}

.question-card,
.evaluation-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 14px;
  background: #fff;
}

.question-card h4,
.evaluation-card h4 {
  margin-bottom: 0;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  margin-bottom: 8px;
}

.tag,
.source-label {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 7px;
  border-radius: 4px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.tag.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.question-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.draw-actions {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.learning-guide {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.guide-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.guide-columns section {
  padding-top: 2px;
}

.guide-columns ul {
  margin: 0;
  padding-left: 20px;
}

.guide-columns li {
  margin: 7px 0;
  color: var(--muted);
  line-height: 1.55;
}

.resource-section {
  grid-column: 1 / -1;
}

.resource-section ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  padding: 0;
  list-style: none;
}

.resource-section li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.source-label {
  flex: 0 0 auto;
}

.source-label.bilibili {
  background: #fff0f4;
  color: #a93859;
}

.student-aside {
  align-self: start;
  position: sticky;
  top: 18px;
  padding: 20px;
}

.student-aside section + section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.stack-form {
  display: grid;
  gap: 12px;
}

.rule-panel dl,
.candidate-profile {
  margin: 0;
}

.rule-panel dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.rule-panel dt,
.rule-panel dd {
  margin: 0;
}

.rule-panel dd {
  color: var(--green);
  font-weight: 800;
}

.aside-note p {
  margin: 6px 0 0;
  font-size: 14px;
}

.login-shell {
  display: grid;
  min-height: calc(100vh - 138px);
  place-items: center;
  padding: 24px;
}

.login-panel {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 28px;
}

.login-panel h2,
.login-panel p {
  margin-bottom: 0;
}

.form-error {
  min-height: 24px;
  color: var(--red);
}

.admin-workspace {
  width: min(1680px, calc(100% - 32px));
  margin: 18px auto 34px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stats-row div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 13px 16px;
  background: #fff;
}

.stats-row span {
  color: var(--muted);
}

.stats-row strong {
  color: var(--green);
  font-size: 28px;
}

.admin-tabs {
  display: flex;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-tabs button {
  min-width: 132px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

.admin-tabs button.active {
  border-bottom-color: var(--green);
  color: var(--green);
}

.admin-tabs span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  margin-left: 5px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--yellow);
  font-size: 12px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.candidate-browser {
  min-width: 0;
  overflow: hidden;
}

.search-form {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.search-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.list-heading {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.candidate-list {
  display: grid;
  max-height: calc(100vh - 360px);
  overflow-y: auto;
}

.candidate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 70px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 11px 14px;
  background: #fff;
  text-align: left;
}

.candidate-row:hover,
.candidate-row.selected {
  background: #f0f7f5;
}

.candidate-row.selected {
  box-shadow: inset 4px 0 var(--green);
}

.candidate-row-main {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.candidate-row-main strong,
.candidate-row-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-row-main small {
  color: var(--muted);
  font-weight: 500;
}

.candidate-row-status {
  flex: 0 0 auto;
}

.list-empty,
.empty-state {
  display: grid;
  min-height: 160px;
  place-content: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state {
  min-height: 420px;
}

.empty-state p {
  margin: 8px 0 0;
}

.detail-header {
  margin-bottom: 16px;
}

.total-panel {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: baseline;
  gap: 5px;
  min-width: 150px;
  color: var(--muted);
}

.total-panel strong {
  color: var(--green);
  font-size: 34px;
}

.candidate-profile {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 20px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.candidate-profile div {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.candidate-profile dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.candidate-profile dd {
  margin: 0;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.evaluation-card details {
  margin: 12px 0;
  border-left: 3px solid var(--blue);
  padding: 8px 10px;
  background: var(--blue-soft);
}

.evaluation-card summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 800;
}

.evaluation-card details p {
  margin: 8px 0 0;
  color: #38586b;
}

.score-entry {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.number-input-wrap {
  display: grid;
  grid-template-columns: 58px auto;
  align-items: center;
  gap: 5px;
}

.number-input-wrap input {
  min-height: 40px;
}

.number-input-wrap span {
  color: var(--muted);
}

.score-note textarea {
  min-height: 66px;
}

.overall-evaluation {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.save-row {
  align-items: center;
}

#saveStatus {
  color: var(--green);
  font-weight: 700;
}

.management-surface {
  min-width: 0;
  padding: 22px;
}

.management-heading p {
  margin-bottom: 0;
}

.management-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 210px auto;
  gap: 12px;
  align-items: end;
  margin: 20px 0 8px;
}

.account-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(180px, 1fr) minmax(200px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 20px 0 8px;
}

.account-table {
  min-width: 760px;
}

.account-role {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.account-role.super {
  background: var(--green-soft);
  color: var(--green);
}

.protected-account {
  color: var(--muted);
  font-size: 13px;
}

.management-message {
  min-height: 28px;
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
}

.management-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  background: #fff;
}

.management-table th,
.management-table td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.management-table th {
  background: #eef4f5;
  color: var(--muted);
  font-size: 13px;
}

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

.management-table td strong,
.management-table td small {
  display: block;
}

.management-table td small {
  margin-top: 3px;
  color: var(--muted);
}

.management-status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--yellow);
  font-size: 12px;
  font-weight: 800;
}

.management-status.confirmed {
  background: var(--green-soft);
  color: var(--green);
}

.table-action {
  min-height: 34px;
  border-color: var(--line);
  padding: 0 10px;
  background: #fff;
  color: var(--blue);
  font-size: 13px;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.table-action.danger {
  border-color: #efc7c3;
  background: var(--red-soft);
  color: var(--red);
}

.table-empty {
  height: 140px;
  color: var(--muted);
  text-align: center !important;
}

@media (max-width: 1100px) {
  .direction-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .direction-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .direction-preview-grid section:last-child {
    grid-column: 1 / -1;
  }

  .student-shell {
    grid-template-columns: 1fr;
  }

  .student-aside {
    position: static;
  }

  .admin-grid {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .evaluation-columns {
    grid-template-columns: 1fr;
  }

  .candidate-list {
    max-height: 560px;
  }

  .account-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 780px) {
  .topbar {
    display: grid;
    min-height: 0;
    padding: 20px 16px;
  }

  .brand-lockup {
    align-items: flex-start;
    gap: 12px;
  }

  .team-logo {
    width: 72px;
    height: 65px;
  }

  h1 {
    font-size: 29px;
  }

  .portal-link {
    width: fit-content;
  }

  .admin-identity {
    min-width: 0;
    margin-right: auto;
    text-align: left;
  }

  .site-footer {
    grid-template-columns: 1fr;
    width: calc(100% - 32px);
    padding-bottom: 20px;
    text-align: center;
  }

  .footer-brand,
  .icp-link,
  .version-label {
    justify-self: center;
  }

  .student-shell,
  .admin-workspace {
    width: calc(100% - 20px);
  }

  .main-surface,
  .evaluation-surface {
    padding: 17px;
  }

  .form-grid,
  .practice-flow,
  .direction-grid,
  .direction-preview-grid,
  .question-columns,
  .guide-columns,
  .resource-section ul,
  .candidate-profile,
  .overall-evaluation {
    grid-template-columns: 1fr;
  }

  .practice-flow {
    border-top: 0;
  }

  .practice-flow li {
    min-height: 0;
    border-top: 1px solid var(--line);
  }

  .direction-card-body {
    min-height: 106px;
  }

  .direction-draw-rule {
    grid-template-columns: 1fr;
  }

  .direction-preview-grid section:last-child {
    grid-column: 1;
  }

  .resource-section,
  .wide {
    grid-column: 1;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    width: 100%;
    overflow: hidden;
  }

  .admin-tabs button {
    flex: 1;
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
  }

  .management-toolbar {
    grid-template-columns: 1fr;
  }

  .account-form {
    grid-template-columns: 1fr;
  }

  .management-toolbar button {
    width: 100%;
  }

  .candidate-list {
    max-height: 360px;
  }

  .candidate-summary,
  .detail-header {
    display: grid;
  }

  .summary-status {
    justify-items: start;
    text-align: left;
  }

  .total-panel {
    justify-content: start;
  }

  .score-entry {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .text-btn {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .stepbar {
    padding: 0 10px;
  }

  .stepbar span {
    padding: 9px 4px;
    font-size: 12px;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .stats-row div {
    min-height: 58px;
  }

  .score-entry {
    grid-template-columns: 1fr;
  }

  .draw-actions button,
  .form-actions button {
    width: 100%;
  }
}

/* Personal technical notes homepage */
.notes-home {
  background: #f5f7f6;
}

.notes-nav {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 72px;
  padding: 10px max(24px, calc((100% - 1180px) / 2));
  border-bottom: 1px solid rgba(215, 224, 227, 0.88);
  background: rgba(255, 255, 255, 0.96);
}

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

.notes-brand img {
  width: 52px;
  height: 48px;
  object-fit: contain;
}

.notes-nav nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.notes-nav nav a {
  min-height: 40px;
  padding: 10px 12px;
  color: #475761;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.notes-nav nav a:hover,
.notes-nav nav a.active {
  color: var(--green);
}

.notes-nav nav .nav-action {
  border-radius: 6px;
  background: var(--green);
  color: #fff;
}

.notes-nav nav .nav-action:hover {
  background: #0f644f;
  color: #fff;
}

.notes-hero {
  overflow: hidden;
  min-height: min(610px, calc(100vh - 72px));
  background: #17272f;
  color: #fff;
}

.notes-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 410px);
  align-items: center;
  gap: 64px;
  width: min(1180px, calc(100% - 48px));
  min-height: inherit;
  margin: 0 auto;
  padding: 68px 0 84px;
}

.notes-hero-copy {
  max-width: 760px;
}

.notes-overline {
  margin-bottom: 14px;
  color: #7fd0b7;
  font-size: 14px;
  font-weight: 800;
}

.notes-hero h1 {
  max-width: 820px;
  margin-bottom: 22px;
  font-size: 62px;
  line-height: 1.12;
}

.notes-hero-copy > p:not(.notes-overline) {
  max-width: 700px;
  margin-bottom: 30px;
  color: #cbd8dc;
  font-size: 18px;
}

.notes-actions,
.project-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.notes-actions .primary-btn,
.project-links .primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.ghost-light-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.ghost-light-btn:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.notes-hero-logo {
  width: min(100%, 390px);
  height: auto;
  justify-self: end;
  object-fit: contain;
  filter: drop-shadow(0 24px 42px rgba(0, 0, 0, 0.34));
}

.notes-band,
.project-band,
.about-band {
  padding: 72px 0;
}

.notes-content {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.notes-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 34px;
}

.notes-section-heading > p {
  max-width: 470px;
  margin-bottom: 5px;
  text-align: right;
}

.note-list {
  border-top: 1px solid var(--line);
}

.note-list article {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-height: 118px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
}

.note-list h3,
.note-list p {
  margin-bottom: 3px;
}

.note-index {
  color: #df5a1f;
  font-size: 22px;
  font-weight: 900;
}

.note-state {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.project-band {
  background: #eaf1f3;
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(360px, 1fr);
  gap: 34px 64px;
  align-items: start;
}

.project-layout > div:first-child p:last-child {
  max-width: 650px;
}

.project-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid #c9d7dc;
  border-left: 1px solid #c9d7dc;
}

.project-facts div {
  min-height: 96px;
  padding: 18px;
  border-right: 1px solid #c9d7dc;
  border-bottom: 1px solid #c9d7dc;
}

.project-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.project-facts dd {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.project-links {
  grid-column: 1 / -1;
}

.project-features {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #c9d7dc;
  border-left: 1px solid #c9d7dc;
}

.project-features > div {
  min-width: 0;
  min-height: 128px;
  padding: 18px;
  border-right: 1px solid #c9d7dc;
  border-bottom: 1px solid #c9d7dc;
}

.project-features strong,
.project-features span {
  display: block;
}

.project-features strong {
  margin-bottom: 8px;
  color: var(--green);
  font-size: 15px;
}

.project-features span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.project-source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid #17272f;
  border-radius: 6px;
  padding: 0 16px;
  background: #17272f;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.project-source-link:hover {
  border-color: #0f644f;
  background: #0f644f;
  color: #fff;
  transform: translateY(-1px);
}

.external-mark {
  color: #7fd0b7;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.text-link {
  padding: 10px 4px;
  font-weight: 800;
  text-decoration: none;
}

.about-band {
  background: #fff;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
  gap: 64px;
}

.about-layout > p {
  margin: 0;
  font-size: 17px;
}

.notes-footer {
  margin-top: 0;
}

@media (max-width: 860px) {
  .notes-nav {
    align-items: flex-start;
    padding: 10px 16px;
  }

  .notes-nav nav {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .notes-nav nav a:not(.nav-action) {
    display: none;
  }

  .notes-hero-inner {
    grid-template-columns: 1fr;
    gap: 26px;
    width: calc(100% - 32px);
    padding: 48px 0 58px;
  }

  .notes-hero h1 {
    font-size: 42px;
  }

  .notes-hero-logo {
    width: min(66vw, 280px);
    justify-self: start;
  }

  .notes-content {
    width: calc(100% - 32px);
  }

  .notes-section-heading,
  .about-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .notes-section-heading > p {
    max-width: none;
    text-align: left;
  }

  .project-layout {
    grid-template-columns: 1fr;
  }

  .project-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-links {
    grid-column: 1;
  }
}

@media (max-width: 520px) {
  .notes-brand span {
    font-size: 16px;
  }

  .notes-hero {
    min-height: auto;
  }

  .notes-hero h1 {
    font-size: 36px;
  }

  .notes-hero-copy > p:not(.notes-overline) {
    font-size: 16px;
  }

  .notes-band,
  .project-band,
  .about-band {
    padding: 52px 0;
  }

  .note-list article {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
  }

  .note-state {
    grid-column: 2;
  }

  .project-facts {
    grid-template-columns: 1fr;
  }

  .project-features {
    grid-template-columns: 1fr;
  }

  .project-features > div {
    min-height: 0;
  }
}
