:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #d9dee7;
  --text: #18202f;
  --muted: #657188;
  --primary: #116b5f;
  --primary-strong: #0b4f46;
  --accent: #ba4f2a;
  --warn: #a16207;
  --danger: #b42318;
  --success: #147d4f;
  --soft: #eef4f3;
  --shadow: 0 12px 30px rgba(22, 34, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

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

button {
  border: 0;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.sidebar {
  background: #14213d;
  color: #f8fafc;
  padding: 24px 18px;
}

.brand {
  margin-bottom: 28px;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
}

.brand-subtitle {
  margin-top: 6px;
  color: #cad2e0;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  background: transparent;
  color: #dbe4f0;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.user-panel {
  margin-top: 28px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
  color: #ffffff;
  display: grid;
  gap: 10px;
}

.user-panel .muted {
  color: #cad2e0;
}

.main {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

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

h1 {
  margin-bottom: 6px;
  font-size: 28px;
}

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

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

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

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

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

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 112px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.compact-toolbar {
  margin-bottom: 10px;
}

.compact-toolbar h2 {
  margin-bottom: 0;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 9px 10px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
}

.btn.secondary {
  background: #e9edf3;
  color: var(--text);
}

.btn.danger {
  background: var(--danger);
}

.btn.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.btn:disabled {
  cursor: progress;
  opacity: 0.65;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
}

.audit-log-panel {
  grid-column: 1 / -1;
}

.user-management-panel {
  grid-column: 1 / -1;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  background: #edf0f5;
  color: #344054;
  font-size: 12px;
  white-space: nowrap;
}

.badge.success {
  background: #e6f4ee;
  color: var(--success);
}

.badge.warn {
  background: #fff4d6;
  color: var(--warn);
}

.badge.danger {
  background: #fde8e7;
  color: var(--danger);
}

.badge.info {
  background: var(--soft);
  color: var(--primary-strong);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 16px;
}

.file-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

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

.file-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.file-link {
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.file-link:hover {
  text-decoration: underline;
}

.checklist {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: #344054;
}

.verification-guide {
  border-left: 4px solid var(--accent);
  background: #fffaf7;
  color: #344054;
  display: grid;
  gap: 10px;
  padding: 10px 12px;
}

.guide-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.guide-title span {
  color: var(--muted);
  font-size: 12px;
}

.guide-note {
  color: var(--accent);
  font-size: 13px;
  line-height: 1.5;
}

.guide-points {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.guide-more {
  border-top: 1px solid #ead6cd;
  padding-top: 8px;
}

.guide-more summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.guide-grid ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.report-list,
.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}

.status-change-note {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 2px;
  margin-top: 6px;
}

.status-change-note span {
  color: #344054;
}

.status-change-panel {
  display: grid;
  gap: 10px;
}

.status-change-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-history-item {
  display: grid;
  gap: 4px;
}

.report-history-item {
  display: grid;
  gap: 8px;
}

.report-version-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.report-history-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-history-grid span,
.report-history-snapshot {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  color: #344054;
  font-size: 13px;
  padding: 8px 10px;
}

.report-version-compare {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 14px;
}

.report-compare-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.report-compare-heading h3 {
  font-size: 15px;
  margin: 0;
}

.report-compare-controls {
  align-items: end;
}

.report-compare-controls select {
  min-width: 0;
}

.report-compare-table table {
  min-width: 720px;
}

.report-compare-table th,
.report-compare-table td {
  font-size: 13px;
  padding: 10px 8px;
}

.report-compare-table tr.is-changed td {
  background: #fffbeb;
}

.report-compare-snapshots {
  display: grid;
  gap: 10px;
}

.report-history-snapshot {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.report-version-detail[open] {
  display: grid;
  gap: 10px;
}

.report-version-section {
  display: grid;
  gap: 8px;
}

.report-version-section h3 {
  font-size: 14px;
  margin: 0;
}

.report-version-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-version-table-wrap table {
  min-width: 760px;
}

.report-version-table-wrap th,
.report-version-table-wrap td {
  font-size: 13px;
  padding: 10px 8px;
}

.audit-current,
.audit-summary {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: #344054;
  font-size: 13px;
  padding: 9px 10px;
}

.audit-summary {
  display: grid;
  gap: 3px;
}

.inline-feedback {
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  padding: 10px 12px;
}

.inline-feedback.success {
  background: #eaf6ef;
  border: 1px solid #abd8bf;
  color: var(--success);
}

.inline-feedback.info {
  background: #eef6f5;
  border: 1px solid #bcd9d5;
  color: var(--primary-strong);
}

.audit-history {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.audit-history summary {
  color: var(--primary-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.candidate-flow {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px;
}

.public-header {
  margin-bottom: 22px;
}

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

.public-feedback {
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  padding: 10px 12px;
}

.public-feedback.error {
  background: #fde8e7;
  border: 1px solid #f2aaa4;
  color: var(--danger);
}

.public-feedback.info {
  background: #eef6f5;
  border: 1px solid #bcd9d5;
  color: var(--primary-strong);
}

.upload-alert {
  border: 1px solid #f4d08b;
  border-radius: 6px;
  background: #fff8e8;
  color: var(--warn);
  font-size: 13px;
  padding: 8px 10px;
}

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

.link-box {
  word-break: break-all;
  border: 1px dashed var(--line);
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px;
  color: #344054;
  font-size: 13px;
}

.copy-note {
  color: var(--success);
  font-size: 13px;
  margin-top: 8px;
}

.copy-note.inline {
  align-self: center;
  margin-top: 0;
}

.link-hint {
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  padding: 9px 10px;
}

.candidate-filter-panel {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
}

.candidate-filter-panel .toolbar {
  margin-bottom: 0;
}

.filter-grid {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 1.4fr) repeat(5, minmax(122px, 1fr)) auto;
}

.filter-submit {
  min-width: 92px;
}

.audit-filter-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
}

.requirement-add-form {
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
}

.requirement-list {
  display: grid;
  gap: 12px;
}

.requirement-card,
.review-checklist-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.review-checklist-list {
  display: grid;
  gap: 12px;
}

.evidence-field-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.user-add-form {
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
}

.user-list {
  display: grid;
  gap: 12px;
}

.user-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.checkbox-line {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.checkbox-line input {
  min-height: auto;
  width: auto;
}

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

  .sidebar {
    position: static;
  }

  .nav,
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .field-row,
  .filter-grid,
  .detail-layout,
  .upload-grid {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 18px;
  }

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

  .topbar-actions {
    justify-items: stretch;
  }
}
