:root {
  --bg: #f4f7f6;
  --panel: #ffffff;
  --ink: #173b43;
  --muted: #6b7b80;
  --line: #d9e4e2;
  --brand: #16827b;
  --brand-dark: #0f6762;
  --soft: #eaf4f2;
  --warn: #b35b00;
  --shadow: 0 10px 28px rgba(20, 55, 58, 0.08);
}

* {
  box-sizing: border-box;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0;
  font-size: 24px;
}

p {
  margin: 6px 0 0;
}

.topbar p,
.hint {
  color: var(--muted);
  font-size: 14px;
}

.actions,
.inline-grid,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(360px, 600px) 1fr;
  gap: 18px;
  padding: 18px;
}

.left,
.right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.panel.accent {
  border-top: 3px solid var(--brand);
}

.panel-title {
  margin-bottom: 12px;
  color: #08776f;
  font-size: 18px;
  font-weight: 700;
}

button,
.button,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover,
.file-button:hover {
  background: var(--brand-dark);
}

.button.ghost,
.file-button {
  background: #eef6f5;
  color: var(--brand-dark);
  border: 1px solid #cfe3df;
}

.button.ghost:hover,
.file-button:hover {
  background: #dcefed;
}

.file-button input {
  display: none;
}

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

textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: block;
  color: #42595f;
  font-size: 14px;
  font-weight: 700;
}

label > input,
label > select {
  margin-top: 6px;
}

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

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #cfdad8;
  border-radius: 6px;
  background: #fff;
}

.checks input {
  width: auto;
  min-height: auto;
}

.warning {
  min-height: 20px;
  color: var(--warn);
  font-weight: 700;
}

.remark-photo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.draft-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.draft-list.empty {
  min-height: 54px;
  align-items: center;
  justify-content: center;
  color: #8a989c;
}

.draft-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdfd;
}

.draft-card strong {
  display: block;
  margin-bottom: 4px;
}

.dashboard {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

.metric {
  padding: 12px;
  border-radius: 6px;
  background: var(--soft);
}

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

.metric b {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

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

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

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

th {
  background: var(--soft);
  color: #056c66;
  font-weight: 800;
}

td.note {
  max-width: 280px;
  color: #52666b;
}

.danger {
  background: #fff0ec;
  color: #a33b1f;
  border: 1px solid #f2c6ba;
}

.danger:hover {
  background: #ffe4dc;
}

@media (max-width: 900px) {
  .topbar,
  .dashboard {
    display: block;
  }

  .actions,
  .filters {
    margin-top: 12px;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 10px;
  }

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

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tr {
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
  }

  td {
    border-bottom: 0;
    padding: 8px 10px;
  }

  td::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 76px;
    color: #08776f;
    font-weight: 800;
  }
}
