:root {
  --brand-dark: #005b6b;
  --brand: #087f95;
  --brand-light: #35a6c8;
  --brand-soft: #eaf7fa;
  --ink: #102635;
  --muted: #657982;
  --line: #cfe2ea;
  --panel: #ffffff;
  --page: #f6fafb;
  --good: #0d7e68;
  --warning: #b98a25;
  --risk: #b33a3a;
  --shadow: 0 18px 44px rgba(0, 91, 107, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(0, 91, 107, 0.04) 0, rgba(0, 91, 107, 0.04) 240px, transparent 240px),
    var(--page);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 0 32px 0 12px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 268px;
  height: 68px;
  padding: 0;
  background: transparent;
  text-decoration: none;
}

.brand img {
  width: 220px;
  height: auto;
  padding: 0;
  background: transparent;
  border-radius: 0;
  object-fit: contain;
}

.stage-tabs {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: #f4f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stage-tabs button,
.stage-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 36px;
  padding: 0 14px;
  color: var(--muted);
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.stage-tabs button.active,
.stage-tabs a.active {
  color: #fff;
  background: var(--brand-dark);
  box-shadow: 0 8px 18px rgba(0, 91, 107, 0.2);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  width: min(1440px, calc(100% - 64px));
  margin: 24px auto 112px;
}

.main-flow {
  min-width: 0;
}

.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 128px;
  margin-bottom: 18px;
  padding: 28px 32px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand), var(--brand-light));
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand-light);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.page-title .eyebrow {
  color: rgba(255, 255, 255, 0.82);
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.2;
}

.page-title h1 {
  color: #fff;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.candidate-panel,
.question-toolbar,
.result-summary,
.empty-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.candidate-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 14px;
  padding: 18px;
  margin-bottom: 16px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  color: var(--ink);
  background: #fbfdfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

input,
select {
  padding: 0 12px;
}

textarea {
  min-height: 86px;
  padding: 10px 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(8, 127, 149, 0.12);
}

.question-toolbar {
  position: sticky;
  top: 88px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-left: 6px solid var(--brand-dark);
}

.question-toolbar span {
  margin-left: 10px;
  color: var(--muted);
  font-size: 13px;
}

.quick-actions {
  display: flex;
  gap: 8px;
}

.quick-actions button,
.submit-actions button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 700;
}

.quick-actions button,
.secondary {
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid var(--line);
}

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

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

.question-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 18px 18px 14px;
  background: linear-gradient(90deg, rgba(0, 91, 107, 0.05), rgba(53, 166, 200, 0.02));
  border-bottom: 1px solid var(--line);
}

.question-index {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--brand-dark);
  border-radius: 50%;
  font-weight: 800;
}

.question-title {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.45;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.question-meta span {
  padding: 5px 8px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px solid #d7edf2;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.current-score {
  min-width: 70px;
  padding: 8px 10px;
  text-align: center;
  color: var(--brand-dark);
  background: #f8fcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.question-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.82fr);
  gap: 18px;
  padding: 16px 18px 18px;
}

.rubric,
.follow-up {
  margin-bottom: 14px;
}

.rubric strong,
.follow-up strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.rubric p,
.follow-up p,
.result-summary p,
.score-note {
  color: var(--muted);
  line-height: 1.65;
}

.score-buttons {
  display: grid;
  grid-template-columns: repeat(6, minmax(42px, 1fr));
  gap: 8px;
}

.score-buttons button {
  min-height: 36px;
  color: var(--ink);
  background: #f8fcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
}

.score-buttons button.selected {
  color: #fff;
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.answer-stack {
  display: grid;
  gap: 10px;
}

.score-panel {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.score-ring {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  height: 156px;
  margin-bottom: 16px;
  color: var(--brand-dark);
  background:
    radial-gradient(circle at center, #fff 56%, transparent 57%),
    conic-gradient(var(--brand-light) var(--score-progress, 0%), #e3eef2 0);
  border-radius: 50%;
}

.score-ring span {
  font-size: 48px;
  font-weight: 900;
}

.score-ring small {
  color: var(--muted);
  font-weight: 700;
}

.match-badge {
  width: 100%;
  padding: 10px 12px;
  text-align: center;
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
}

.match-badge.excellent {
  background: var(--good);
}

.match-badge.good {
  background: var(--brand);
}

.match-badge.warning {
  background: var(--warning);
}

.match-badge.risk {
  background: var(--risk);
}

.score-note {
  margin: 12px 0 18px;
  font-size: 13px;
}

.score-stats {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}

.score-stats div,
.decision-box {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: #f8fcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.decision-box {
  display: grid;
}

.decision-box span {
  color: var(--muted);
  font-size: 13px;
}

.decision-box strong {
  font-size: 20px;
}

.result-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 20px;
  border-left: 6px solid var(--brand-dark);
}

.result-summary h2 {
  margin-bottom: 8px;
}

.result-summary p {
  margin-bottom: 0;
}

.result-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  min-width: 150px;
  color: var(--brand-dark);
}

.result-score span {
  font-size: 46px;
  font-weight: 900;
}

.result-score small {
  color: var(--muted);
  font-weight: 800;
}

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

.result-grid > div,
.empty-panel {
  padding: 14px;
  background: #f8fcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.result-grid span,
.result-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.result-grid strong {
  display: block;
  margin: 4px 0;
  color: var(--brand-dark);
  font-size: 24px;
}

.empty-panel {
  color: var(--muted);
}

.submit-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 14px 32px;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 32px rgba(0, 91, 107, 0.1);
  backdrop-filter: blur(16px);
}

.submit-bar span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.submit-actions {
  display: flex;
  gap: 10px;
}

.primary {
  color: #fff;
  background: var(--brand-dark);
  border: 1px solid var(--brand-dark);
  box-shadow: 0 10px 24px rgba(0, 91, 107, 0.25);
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  text-decoration: none;
  border-radius: 8px;
}

.admin-layout {
  width: min(1360px, calc(100% - 48px));
  margin: 24px auto 48px;
}

.admin-hero,
.records-panel {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(0, 91, 107, 0.96), rgba(8, 127, 149, 0.9)),
    var(--brand-dark);
}

.admin-hero .eyebrow,
.admin-hero h1 {
  color: #fff;
}

.admin-actions {
  display: flex;
  gap: 10px;
}

.admin-actions .secondary {
  background: #fff;
}

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

.admin-stats > div {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-stats span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.admin-stats strong {
  display: block;
  margin-top: 8px;
  color: var(--brand-dark);
  font-size: 30px;
}

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

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

th,
td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--brand-dark);
  font-size: 13px;
  white-space: nowrap;
  background: #f3fafb;
}

td {
  color: var(--text);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .score-panel {
    position: static;
    order: -1;
  }

  .score-ring {
    width: 160px;
    margin-right: auto;
    margin-left: auto;
  }
}

@media (max-width: 820px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 16px 12px 0;
  }

  .brand {
    align-self: flex-start;
    justify-content: flex-start;
    width: min(268px, 100%);
    height: 54px;
    padding-left: 0;
  }

  .brand img {
    width: min(220px, 78vw);
  }

  .stage-tabs {
    margin-left: 16px;
    overflow-x: auto;
  }

  .layout {
    width: calc(100% - 24px);
    margin-top: 14px;
  }

  .admin-layout {
    width: calc(100% - 24px);
    margin-top: 14px;
  }

  .page-title,
  .question-toolbar,
  .submit-bar,
  .admin-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .candidate-panel,
  .question-body,
  .admin-stats,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .result-summary {
    grid-template-columns: 1fr;
  }

  .question-head {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .current-score {
    grid-column: 1 / -1;
    width: 100%;
  }

  .score-buttons {
    grid-template-columns: repeat(4, minmax(52px, 1fr));
  }

  .submit-actions {
    width: 100%;
  }

  .admin-actions {
    flex-direction: column;
  }

  .submit-actions button {
    flex: 1;
  }
}
