:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-2: #f9fbfd;
  --paper: #f2f5f8;
  --line: #d8dde5;
  --line-strong: #98a4b3;
  --text: #202124;
  --muted: #646a73;
  --gold: #1f7a68;
  --green: #1f7a68;
  --rose: #a33a3a;
  --blue: #315f8c;
  --shadow: 0 14px 34px rgba(32, 33, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

body::before {
  content: none;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: 0;
}

.sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.tabs {
  display: flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f5;
}

button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
}

button:hover,
button.active {
  border-color: var(--line-strong);
  background: #1f7a68;
  color: #ffffff;
}

main {
  padding: 18px 28px 48px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 420px) minmax(150px, 210px) 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(120, 198, 163, 0.12);
}

.counter {
  justify-self: end;
  color: var(--muted);
  font-size: 13px;
}

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

.metric {
  min-height: 62px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  margin-top: 4px;
  color: var(--gold);
  font-size: 21px;
  font-weight: 950;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 14px;
}

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: #98a4b3;
  background: var(--panel-2);
}

.thumb {
  display: grid;
  place-items: center;
  height: 216px;
  border-bottom: 1px solid var(--line);
  background: #eef2f5;
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.body {
  padding: 13px 14px 15px;
}

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

.name {
  min-height: 44px;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.38;
}

.status {
  display: inline-flex;
  margin: 9px 0 10px;
  border: 1px solid rgba(111, 150, 119, 0.52);
  border-radius: 6px;
  padding: 5px 9px;
  background: rgba(111, 150, 119, 0.14);
  color: #1f7a68;
  font-size: 12px;
  font-weight: 850;
}

.note,
.next {
  color: #3d434c;
  font-size: 13px;
  line-height: 1.62;
}

.next {
  margin-top: 8px;
  color: var(--muted);
}

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

.gallery-pill {
  border: 1px solid rgba(111, 134, 168, 0.42);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(111, 134, 168, 0.13);
  color: #315f8c;
  font-size: 11px;
}

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

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(24, 32, 41, 0.58);
  backdrop-filter: blur(8px);
}

.modal.open {
  display: flex;
}

.modal-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  width: min(1180px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 26px 78px rgba(0, 0, 0, 0.55);
}

.modal-media {
  display: grid;
  place-items: center;
  min-height: 420px;
  overflow: auto;
  background: #eef2f5;
}

.modal-media img {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
}

.modal-side {
  overflow: auto;
  padding: 18px;
}

.modal-meta {
  margin-bottom: 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.modal-name {
  margin-bottom: 12px;
  font-size: 22px;
  font-weight: 950;
  line-height: 1.25;
}

.modal-status {
  display: inline-flex;
  margin-bottom: 14px;
  border: 1px solid rgba(232, 199, 111, 0.5);
  border-radius: 6px;
  padding: 6px 10px;
  background: rgba(232, 199, 111, 0.11);
  color: #6f3911;
  font-size: 12px;
  font-weight: 900;
}

.modal-note,
.modal-next {
  color: #3d434c;
  font-size: 13px;
  line-height: 1.62;
}

.modal-next {
  margin-top: 8px;
  color: var(--muted);
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  width: 100%;
  padding: 12px;
}

.modal-shot {
  overflow: hidden;
  margin: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: white;
  cursor: pointer;
}

.modal-shot img {
  width: 100%;
  height: 180px;
  object-fit: contain;
}

.modal-shot figcaption {
  border-top: 1px solid #ece6d9;
  padding: 8px 9px;
  color: #1b1d1b;
  font-size: 12px;
  line-height: 1.45;
}

.close {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 90;
  background: rgba(0, 0, 0, 0.55);
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: 1fr;
    padding: 14px 16px;
  }

  main {
    padding: 14px 16px 36px;
  }

  .tabs {
    overflow: auto;
  }

  .toolbar,
  .overview,
  .modal-card {
    grid-template-columns: 1fr;
  }

  .counter {
    justify-self: start;
  }

  .modal-media {
    min-height: 280px;
  }
}
