:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  background: #eef4f8;
  color: #17283a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f7fbff 0%, #edf4f8 100%);
  min-height: 100vh;
}

a {
  color: #155e9f;
  text-decoration: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(18px, 4vw, 52px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #d8e4ee;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 800;
  color: #102a43;
  white-space: nowrap;
}

.topbar nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar form {
  margin: 0;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 32px auto 72px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #45677f;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

h1,
h2,
h3 {
  margin: 0 0 12px;
  color: #102a43;
  letter-spacing: 0;
}

p {
  line-height: 1.7;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
}

.card {
  background: #ffffff;
  border: 1px solid #d9e6ef;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 14px 32px rgba(22, 45, 70, 0.08);
}

.competition-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.card-meta,
.deadline,
.empty,
small,
.muted {
  color: #5d7083;
}

.card-meta {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 10px;
  background: #eaf4ff;
  font-size: 13px;
  font-weight: 800;
}

.card-meta.closed {
  background: #f6e7e7;
  color: #8a2d2d;
}

.requirement-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.requirement-preview span {
  border: 1px solid #cfe0ec;
  border-radius: 999px;
  padding: 4px 9px;
  background: #f8fbfe;
  font-size: 13px;
}

.countdown-card {
  min-width: 220px;
  border: 1px solid #b9d3e8;
  border-radius: 8px;
  padding: 14px 16px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(22, 45, 70, 0.08);
}

.countdown-card span {
  display: block;
  color: #5d7083;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
}

.countdown-card strong {
  display: block;
  color: #155e9f;
  font-size: 24px;
  line-height: 1.2;
}

.countdown-card.closed strong {
  color: #8a2d2d;
}

.btn,
button,
.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #bfd0df;
  background: #ffffff;
  color: #18344f;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.nav-button {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 14px;
}

.btn.primary,
button.primary {
  background: #155e9f;
  color: #ffffff;
  border-color: #155e9f;
}

.form {
  display: grid;
  gap: 18px;
}

.narrow {
  max-width: 460px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.field-row.compact {
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 240px);
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid #b9cddd;
  background: #fbfdff;
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 12px;
  color: #102a43;
  font: inherit;
}

textarea {
  resize: vertical;
}

.section-title {
  display: grid;
  gap: 4px;
}

.section-title p {
  margin: 0;
  color: #5d7083;
}

.materials {
  display: grid;
  gap: 12px;
}

.requirement-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.requirement-item {
  display: grid;
  grid-template-columns: 1fr minmax(160px, auto);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid #d9e6ef;
  border-radius: 8px;
  background: #f8fbfe;
}

.requirement-item p {
  margin: 6px 0 0;
  color: #5d7083;
}

.requirement-item span {
  color: #155e9f;
  font-weight: 800;
  text-align: right;
}

.upload-box {
  gap: 14px;
  padding: 18px;
  border: 1px dashed #9fbbd1;
  border-radius: 8px;
  background: #f8fbfe;
}

.upload-box span {
  display: grid;
  gap: 4px;
}

.material {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 360px);
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid #d9e6ef;
  border-radius: 8px;
  background: #f8fbfe;
}

.material span {
  display: grid;
  gap: 4px;
}

.material em {
  color: #45677f;
  font-size: 13px;
  font-style: normal;
}

.requirement-editor {
  display: grid;
  gap: 10px;
}

.requirement-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.8fr) minmax(150px, 0.8fr) 42px;
  gap: 10px;
  align-items: center;
}

.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.icon-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.result {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.result .score {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e5f2ff;
  color: #155e9f;
  font-size: 28px;
  font-weight: 900;
  flex: 0 0 auto;
}

.score.complete {
  background: #e7f7ee;
  color: #12643b;
}

.score.needs_fix,
.score.late {
  background: #fff3da;
  color: #8c5200;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff7d6;
  border: 1px solid #f0d987;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid #dce7f0;
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #42576b;
  background: #f4f8fb;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #eaf4ff;
  color: #155e9f;
  font-weight: 800;
  white-space: nowrap;
}

.badge.ok,
.badge.complete {
  background: #e7f7ee;
  color: #12643b;
}

.badge.missing,
.badge.format_error,
.badge.needs_fix,
.badge.late,
.badge.backup-not_configured,
.badge.backup-failed {
  background: #fff3da;
  color: #8c5200;
}

.badge.backup-backed_up {
  background: #e7f7ee;
  color: #12643b;
}

@media (max-width: 820px) {
  .topbar,
  .page-head,
  .result {
    align-items: flex-start;
    flex-direction: column;
  }

  .material,
  .requirement-row,
  .requirement-item,
  .field-row.compact {
    grid-template-columns: 1fr;
  }

  .requirement-item span {
    text-align: left;
  }

  .icon-button {
    width: 100%;
  }
}
