:root {
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #132236;
  background: #eef3f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --ink: #132236;
  --muted: #647386;
  --line: #dbe3ea;
  --line-strong: #c9d4df;
  --teal: #0f8f83;
  --teal-dark: #0a7169;
  --blue: #315fbe;
  --amber: #b7791f;
  --red: #c2413d;
  --green: #168a57;
  --shadow: 0 16px 38px rgba(22, 38, 54, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.candidate-shell {
  min-height: 100vh;
  max-width: 520px;
  margin: 0 auto;
  padding: 22px 18px 30px;
  background:
    linear-gradient(180deg, rgba(15, 143, 131, 0.12), transparent 230px),
    #f4f7fa;
}

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

.candidate-start {
  padding: 24px;
  margin-top: 18px;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #132236;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.brand-mark.large {
  width: 46px;
  height: 46px;
  font-size: 16px;
}

.candidate-start h1,
.result-panel h1,
.screen-message h1 {
  margin: 26px 0 10px;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: 0;
}

.start-copy,
.result-copy,
.screen-message p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.start-form {
  display: grid;
  gap: 15px;
  margin-top: 26px;
}

label {
  display: grid;
  gap: 8px;
  color: #344356;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.6;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 143, 131, 0.14);
}

.primary-button,
.secondary-button,
.icon-button,
.sidebar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.primary-button {
  background: var(--teal);
  color: #ffffff;
  padding: 0 16px;
}

.primary-button:hover {
  background: var(--teal-dark);
}

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

.secondary-button:hover {
  border-color: #9fb0be;
  background: #f8fbfd;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.wide {
  width: 100%;
}

.form-error,
.admin-error {
  border: 1px solid rgba(194, 65, 61, 0.24);
  border-radius: 8px;
  background: #fff5f4;
  color: var(--red);
  padding: 10px 12px;
  font-size: 13px;
}

.exam-mode {
  padding-bottom: 100px;
}

.exam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 2px 0;
}

.exam-header h1,
.admin-header h1 {
  margin: 2px 0 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
}

.muted-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.progress-pill,
.level-badge,
.level-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.progress-pill {
  min-width: 60px;
  min-height: 38px;
  background: #132236;
  color: #ffffff;
}

.progress-block {
  margin: 18px 0 14px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.progress-track,
.bar-track {
  width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7ee;
}

.progress-track {
  height: 8px;
}

.progress-fill,
.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.question-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scrollbar-width: none;
}

.question-nav::-webkit-scrollbar {
  display: none;
}

.nav-dot {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: #4a5b6e;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.nav-dot.done {
  border-color: rgba(15, 143, 131, 0.35);
  background: #e8f6f4;
  color: var(--teal-dark);
}

.nav-dot.active {
  background: #132236;
  color: #ffffff;
  border-color: #132236;
}

.question-panel {
  padding: 20px;
}

.question-topline {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.question-topline strong {
  color: var(--teal-dark);
}

.question-panel h2 {
  margin: 16px 0 18px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.45;
  letter-spacing: 0;
}

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

.option-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  line-height: 1.45;
}

.option-row.selected {
  border-color: rgba(15, 143, 131, 0.52);
  background: #eaf7f5;
}

.option-key {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #edf2f6;
  color: #39495a;
  font-weight: 900;
}

.option-row.selected .option-key {
  background: var(--teal);
  color: #ffffff;
}

.answer-textarea {
  min-height: 190px;
}

.exam-actions {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(520px, 100%);
  transform: translateX(-50%);
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(247, 250, 252, 0.94);
  backdrop-filter: blur(10px);
}

.result-panel {
  padding: 24px;
  margin-top: 18px;
  text-align: center;
}

.result-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: #e8f6f4;
  color: var(--teal);
}

.score-ring {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 20px auto 10px;
}

.score-ring strong {
  font-size: 54px;
  line-height: 1;
}

.score-ring span {
  color: var(--muted);
  font-weight: 800;
}

.submission-receipt {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  text-align: left;
}

.submission-receipt span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.submission-receipt strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.level-badge {
  min-height: 32px;
  padding: 0 12px;
  margin: 0 auto;
}

.level-badge.success,
.level-chip.success {
  background: #e5f6ee;
  color: var(--green);
}

.level-badge.good,
.level-chip.good {
  background: #e8f6f4;
  color: var(--teal-dark);
}

.level-badge.warn,
.level-chip.warn {
  background: #fff5dd;
  color: var(--amber);
}

.level-badge.risk,
.level-chip.risk {
  background: #fff1e8;
  color: #b45416;
}

.level-badge.danger,
.level-chip.danger {
  background: #fff0f0;
  color: var(--red);
}

.dimension-bars {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.dimension-bars.compact {
  text-align: left;
}

.dimension-row {
  display: grid;
  gap: 6px;
}

.dimension-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #35465a;
  font-size: 12px;
  font-weight: 800;
}

.dimension-label strong {
  color: var(--muted);
  white-space: nowrap;
}

.bar-track {
  height: 7px;
}

.screen-message {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: var(--bg);
}

.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #edf2f6;
}

.login-panel {
  display: grid;
  gap: 18px;
  width: min(390px, 100%);
  padding: 26px;
}

.login-panel h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  background: #edf2f6;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.admin-sidebar nav {
  display: grid;
  gap: 8px;
}

.admin-sidebar a,
.sidebar-link {
  justify-content: flex-start;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #45566a;
  font-weight: 800;
}

.admin-sidebar a.active,
.admin-sidebar a:hover,
.sidebar-link:hover {
  background: #eef7f6;
  color: var(--teal-dark);
}

.sidebar-link {
  margin-top: auto;
}

.admin-main {
  min-width: 0;
  padding: 24px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

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

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.summary-card {
  display: grid;
  gap: 6px;
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.summary-card strong {
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.summary-card small {
  color: #7a8796;
  font-weight: 700;
}

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

.candidate-list-panel,
.detail-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.candidate-list-panel {
  overflow: hidden;
}

.table-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 138px;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
}

.search-box input {
  height: auto;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.submission-table {
  display: grid;
}

.submission-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) 84px 82px 130px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

button.submission-row {
  cursor: pointer;
}

.submission-row.head {
  min-height: 42px;
  background: #f7fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.submission-row.selected {
  background: #ecf8f6;
}

.submission-row strong,
.submission-row small {
  display: block;
}

.submission-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.level-chip {
  width: 32px;
  height: 28px;
  font-style: normal;
}

.empty-state {
  padding: 36px 18px;
  color: var(--muted);
  text-align: center;
}

.detail-panel {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 18px;
}

.empty-detail {
  display: grid;
  place-items: center;
  min-height: 320px;
  color: var(--muted);
  text-align: center;
}

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

.detail-head h2 {
  margin: 4px 0;
  font-size: 24px;
  letter-spacing: 0;
}

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

.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-color: var(--line);
  background: #ffffff;
  color: #556679;
}

.icon-button.danger:hover {
  border-color: rgba(194, 65, 61, 0.32);
  background: #fff4f3;
  color: var(--red);
}

.score-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.score-summary strong {
  font-size: 38px;
  line-height: 1;
}

.score-summary span {
  color: var(--muted);
  font-weight: 800;
}

.conclusion {
  margin: 0;
  color: #344356;
  line-height: 1.7;
}

.detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}

.detail-meta span {
  min-height: 34px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f7fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.answer-review {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.answer-review h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.answer-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.answer-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.answer-title strong {
  color: var(--teal-dark);
  white-space: nowrap;
}

.answer-item p {
  max-height: 92px;
  overflow: auto;
  margin: 0;
  color: #415268;
  font-size: 13px;
  line-height: 1.6;
}

.answer-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.answer-item em {
  width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff5dd;
  color: var(--amber);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .admin-workspace {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 860px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .admin-sidebar nav {
    display: flex;
  }

  .sidebar-link {
    margin-top: 0;
    white-space: nowrap;
  }

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

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .candidate-shell {
    padding-inline: 14px;
  }

  .candidate-start,
  .question-panel,
  .result-panel {
    padding: 18px;
  }

  .candidate-start h1,
  .result-panel h1,
  .screen-message h1 {
    font-size: 28px;
  }

  .question-panel h2 {
    font-size: 18px;
  }

  .admin-main {
    padding: 16px;
  }

  .summary-grid,
  .table-toolbar,
  .detail-meta {
    grid-template-columns: 1fr;
  }

  .submission-row {
    grid-template-columns: minmax(0, 1.4fr) 58px 52px;
  }

  .submission-row span:last-child {
    display: none;
  }
}
