:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #20242a;
  --muted: #6b7280;
  --line: #d9e0e7;
  --teal: #0f766e;
  --teal-soft: #e6f4f1;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #b42318;
  --green: #287a45;
  --shadow: 0 10px 30px rgba(25, 35, 45, 0.08);
}

* {
  box-sizing: border-box;
}

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

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

button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.ghost {
  background: transparent;
}

.danger {
  color: var(--red);
}

.full {
  width: 100%;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-box {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 800;
}

.brand-mark.small {
  width: 38px;
  height: 38px;
}

.login-box h1 {
  margin: 18px 0 20px;
  font-size: 24px;
}

label {
  display: grid;
  gap: 7px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 118px;
  resize: vertical;
  line-height: 1.5;
}

.form-error {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
}

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

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

.sidebar {
  background: #172026;
  color: #eff5f4;
  padding: 20px 14px;
}

.side-title {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.side-title span {
  display: block;
  color: #a9b7bc;
  font-size: 12px;
  margin-top: 3px;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar nav button {
  justify-content: flex-start;
  text-align: left;
  background: transparent;
  color: #dce6e5;
  border-color: transparent;
}

.sidebar nav button.active,
.sidebar nav button:hover {
  background: #24343a;
  border-color: #34525a;
}

.workspace {
  min-width: 0;
}

.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h1 {
  margin: 0;
  font-size: 23px;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 8px;
}

.content {
  padding: 24px 28px 48px;
}

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

.stats {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.job-stats {
  margin-bottom: 16px;
}

.stat,
.panel,
.asset-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat {
  padding: 16px;
}

.stat-link {
  text-align: left;
  min-height: 92px;
}

.stat-link:hover,
.click-row:hover {
  border-color: #a8c9c4;
  background: #f2fbf8;
}

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

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

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

.panel-head h2 {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.form-grid .wide {
  grid-column: span 2;
}

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

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

.click-row {
  cursor: pointer;
}

.inline-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--ink);
}

.inline-check input {
  width: auto;
  min-height: auto;
}

.random-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfb;
}

.random-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.random-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.random-group textarea {
  min-height: 130px;
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: start center;
  overflow: auto;
  padding: 32px 18px;
  background: rgba(17, 24, 39, 0.42);
}

.modal {
  width: min(960px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.25);
  padding: 18px;
}

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

.modal-head h2 {
  margin: 0;
}

.modal-head button {
  width: 38px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

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

.select-cell {
  width: 46px;
  text-align: center;
}

.select-cell input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

th {
  color: #53606a;
  background: #f7fafc;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

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

.badge.ok {
  color: var(--green);
  background: #e8f5ed;
}

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

.badge.bad {
  color: var(--red);
  background: #fdecea;
}

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

.asset-card {
  position: relative;
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease, opacity 120ms ease;
}

.asset-card.is-featured {
  border-color: #d7a928;
  box-shadow: 0 0 0 2px rgba(245, 210, 115, 0.55), var(--shadow);
}

.asset-card.is-selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.34), 0 16px 34px rgba(15, 118, 110, 0.16);
  transform: translateY(-1px);
}

.feature-ribbon {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 3px 10px 3px 7px;
  border: 1px solid rgba(245, 210, 115, 0.72);
  border-radius: 8px;
  background: linear-gradient(135deg, #1c2329, #3a2f13);
  color: #ffe39b;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(23, 32, 38, 0.24);
}

.crown-mark {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f5d273;
  color: #172026;
  font-size: 13px;
  line-height: 1;
}

.asset-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #f1f5f8;
  display: block;
  cursor: zoom-in;
}

.asset-card .asset-body {
  padding: 12px;
}

.asset-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.asset-card p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
}

.event-box {
  max-height: 300px;
  overflow: auto;
  background: #111820;
  color: #d9e7df;
  padding: 12px;
  border-radius: 8px;
  font-family: Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.pickup-body {
  min-height: 100vh;
  background: #edf2f0;
  color: #172026;
}

body.viewer-open,
.pickup-body.viewer-open {
  overflow: hidden;
}

.pickup-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 14px max(110px, env(safe-area-inset-bottom));
}

.pickup-hero,
.pickup-summary,
.pickup-empty,
.pickup-actions-bar,
.pickup-aftercare {
  border: 1px solid rgba(23, 32, 38, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 42px rgba(23, 32, 38, 0.08);
}

.pickup-hero {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.pickup-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pickup-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #172026;
  color: #f5d273;
  font-weight: 900;
}

.pickup-brand span {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.pickup-brand h1 {
  margin: 3px 0 0;
  font-size: 23px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pickup-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef5f7;
  color: #31566a;
  font-weight: 800;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.pickup-status.ok {
  background: #e8f5ed;
  border-color: #b9e1c7;
  color: var(--green);
}

.pickup-status.warn {
  background: #fff5df;
  border-color: #f0d28d;
  color: var(--amber);
}

.pickup-status.bad {
  background: #fdecea;
  border-color: #f2b7b0;
  color: var(--red);
}

.pickup-summary {
  display: grid;
  grid-template-columns: 0.8fr 1.35fr 0.8fr;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
}

.pickup-summary div {
  min-width: 0;
}

.pickup-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.pickup-summary strong {
  display: block;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.pickup-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.pickup-image-card {
  position: relative;
  display: block;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 38, 0.12);
  border-radius: 8px;
  background: #dfe7e5;
  box-shadow: 0 12px 28px rgba(23, 32, 38, 0.12);
}

.pickup-image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #f1f5f8;
}

.pickup-image-card span {
  position: absolute;
  left: 8px;
  top: 8px;
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(23, 32, 38, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.pickup-image-card .featured-mark {
  position: absolute;
  right: 10px;
  bottom: 10px;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(23, 32, 38, 0.88);
  color: #f5d273;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.pickup-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 260px;
  margin-top: 14px;
  padding: 26px;
  text-align: center;
  color: var(--muted);
}

.pickup-empty strong {
  color: #172026;
  font-size: 20px;
}

.pickup-actions-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 0.58fr;
  gap: 8px;
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 8px 8px 0 0;
}

.pickup-actions-bar button {
  min-height: 48px;
  font-weight: 800;
}

.pickup-hint {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.pickup-aftercare {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.pickup-aftercare strong {
  color: var(--ink);
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(8, 12, 16, 0.94);
  padding: max(14px, env(safe-area-inset-top)) 12px max(78px, env(safe-area-inset-bottom));
}

.image-viewer img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border-radius: 8px;
  background: #111820;
}

.viewer-close,
.viewer-nav {
  position: fixed;
  z-index: 55;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.viewer-close {
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  font-size: 30px;
}

.viewer-nav {
  top: 50%;
  width: 42px;
  height: 54px;
  padding: 0;
  transform: translateY(-50%);
  font-size: 38px;
}

.viewer-nav.prev {
  left: 8px;
}

.viewer-nav.next {
  right: 8px;
}

.viewer-caption {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.viewer-caption strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.viewer-caption span {
  flex: 0 0 auto;
  color: #f5d273;
  font-weight: 800;
}

.viewer-download {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.viewer-download:hover {
  background: rgba(255, 255, 255, 0.26);
}

.viewer-download.is-active {
  border-color: rgba(245, 210, 115, 0.78);
  background: rgba(245, 210, 115, 0.22);
  color: #ffe39b;
}

@media (min-width: 720px) {
  .pickup-shell {
    padding-top: 28px;
  }

  .pickup-hero {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .pickup-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .pickup-brand h1 {
    font-size: 28px;
  }

  .pickup-actions-bar {
    grid-template-columns: 1fr 180px;
  }
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
  }

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

  .side-title {
    margin-bottom: 10px;
    padding-bottom: 10px;
  }

  .topbar {
    height: auto;
    padding: 16px;
    gap: 12px;
    align-items: flex-start;
  }

  .content {
    padding: 16px;
  }

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

  .form-grid .wide,
  .form-grid .full-row {
    grid-column: 1 / -1;
  }

}

@media (max-width: 560px) {
  .sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    display: grid;
  }

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

  .pickup-actions-bar {
    grid-template-columns: 1fr;
  }

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

  .viewer-nav {
    width: 36px;
    height: 48px;
  }
}
