:root {
  --ink: #172026;
  --muted: #66727c;
  --line: #d9e0e4;
  --surface: #ffffff;
  --band: #f5f7f8;
  --accent: #0f6f6a;
  --accent-strong: #0a5753;
  --warning: #b56a00;
  --danger: #b42318;
  --ok: #1f7a4d;
  --focus: #2b7fff;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--band);
  letter-spacing: 0;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.brand img {
  width: auto;
  height: 46px;
  object-fit: contain;
}

.brand span {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-size: 16px;
  line-height: 1.2;
}

.brand small,
.site-footer,
.field-caption,
.hint,
.lead,
.section-title p,
small {
  color: var(--muted);
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  font-size: 14px;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.intro-band,
.admin-head,
.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 28px;
  align-items: start;
  margin-bottom: 22px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

h2 {
  margin-bottom: 4px;
  font-size: 22px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 1.35;
}

.lead {
  max-width: 760px;
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.7;
}

.notice,
.login-panel,
.result-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.notice {
  display: grid;
  gap: 8px;
  line-height: 1.65;
}

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

.form-section,
.detail-section {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.section-title {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.section-title span {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #dcefed;
  color: var(--accent-strong);
  font-weight: 800;
}

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

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

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

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

label,
fieldset {
  min-width: 0;
}

label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c8d1d7;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  background: #fff;
}

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

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: transparent;
}

.choice-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 12px;
  border: 1px solid #c8d1d7;
  border-radius: 6px;
}

.choice-line legend {
  width: 100%;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 700;
}

.choice-line label,
.check-grid label,
.consent-list label {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
  line-height: 1.45;
}

input[type="radio"],
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

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

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

.conditional[hidden] {
  display: none;
}

.conditional {
  margin-top: 16px;
  padding: 16px;
  border-left: 4px solid var(--accent);
  background: #f3faf9;
}

.split-line {
  height: 1px;
  margin: 22px 0;
  background: var(--line);
}

.subsection {
  margin-top: 20px;
}

.field-caption {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

.hint {
  line-height: 1.6;
}

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

.upload-tile {
  display: grid;
  gap: 10px;
  min-height: 116px;
  padding: 16px;
  border: 1px dashed #9eb1bb;
  border-radius: 8px;
  background: #fbfcfc;
}

.upload-tile span {
  font-weight: 700;
}

.upload-tile small {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  background: #e6f2f1;
  color: var(--accent-strong);
  font-weight: 700;
}

.consent-list {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0 16px;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 750;
  background: #fff;
  cursor: pointer;
}

button.primary,
.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

button:hover,
.button-link:hover {
  text-decoration: none;
  filter: brightness(0.96);
}

.flash-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 16px auto 0;
}

.flash {
  margin-bottom: 8px;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
}

.flash.error {
  border-color: #efb5ac;
  color: var(--danger);
  background: #fff5f3;
}

.flash.success {
  border-color: #acd7bf;
  color: var(--ok);
  background: #f1faf5;
}

.login-panel,
.result-panel {
  width: min(520px, 100%);
  margin: 44px auto;
}

.login-panel form {
  display: grid;
  gap: 16px;
}

.summary-list,
.detail-grid {
  display: grid;
  gap: 12px;
}

.summary-list div,
.detail-item {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-actions,
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  justify-content: flex-end;
}

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

.stats-row div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stats-row strong {
  display: block;
  font-size: 28px;
}

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

.filter-bar {
  justify-content: flex-start;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.filter-bar label {
  min-width: 180px;
}

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

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

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

th {
  color: #47545d;
  background: #f8fafb;
  font-size: 13px;
}

td small {
  display: block;
  margin-top: 3px;
}

.risk {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.risk.high {
  color: var(--danger);
  background: #ffe7e3;
}

.risk.medium {
  color: var(--warning);
  background: #fff1d8;
}

.risk.low {
  color: var(--ok);
  background: #e8f6ee;
}

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

.back-link {
  display: inline-flex;
  margin-bottom: 10px;
}

.status-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

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

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

.long-text {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.long-text p {
  min-height: 24px;
  white-space: pre-wrap;
}

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

.attachment-list a {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 90px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding: 20px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
}

@media (max-width: 900px) {
  .intro-band,
  .admin-head,
  .detail-head {
    grid-template-columns: 1fr;
  }

  .grid.two,
  .grid.four,
  .detail-grid,
  .upload-grid,
  .check-grid,
  .check-grid.compact,
  .stats-row {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    justify-content: flex-start;
  }

  .attachment-list a {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand img {
    height: 40px;
  }

  main {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  h1 {
    font-size: 28px;
  }

  .form-section,
  .detail-section {
    padding: 16px;
  }

  .choice-line {
    align-items: flex-start;
    flex-direction: column;
  }
}
