* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f4f6f8;
  color: #172033;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 50px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 20px 24px;
  border-radius: 12px;
  background: #111827;
  color: #fff;
}

.topbar p,
h1,
h2 {
  margin: 0;
}

.topbar p {
  margin-bottom: 6px;
  color: #9ca3af;
  font-size: 13px;
}

h1 {
  font-size: 28px;
}

h2 {
  margin-bottom: 16px;
  font-size: 20px;
}

.panel {
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.hidden {
  display: none;
}

input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font: inherit;
  outline: none;
}

input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

button {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.primary {
  background: #2563eb;
  color: #fff;
}

.primary.small {
  width: auto;
  min-width: 110px;
}

.secondary {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
}

.danger {
  margin-left: 10px;
  background: #ef4444;
  color: #fff;
}

.login-panel {
  max-width: 420px;
}

.login-panel .primary {
  width: 100%;
  margin-top: 12px;
}

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

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
}

.qr-line {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 18px 0 4px;
}

#qrPreview {
  display: none;
  width: 92px;
  height: 92px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  object-fit: contain;
  background: #f9fafb;
}

#qrPreview.show {
  display: block;
}

.file-box {
  flex: 1;
}

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

.summary h2 {
  color: #111827;
}

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

.nums div {
  padding: 14px;
  border-radius: 10px;
  background: #f3f4f6;
}

.nums strong {
  display: block;
  font-size: 34px;
  line-height: 1;
}

.nums span {
  display: block;
  margin-top: 8px;
  color: #6b7280;
  font-size: 13px;
}

.query-row {
  display: grid;
  grid-template-columns: 190px 190px 110px;
  gap: 12px;
  align-items: center;
}

.range-total {
  margin-top: 14px;
  color: #4b5563;
}

.range-total b {
  margin-left: 14px;
  color: #111827;
  font-size: 20px;
}

.table {
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.tr {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid #eef0f3;
}

.tr span:not(:first-child) {
  text-align: center;
}

.th {
  background: #f9fafb;
  color: #4b5563;
  font-weight: 800;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.time-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.time-item span {
  color: #6b7280;
  font-size: 13px;
}

.empty {
  padding: 18px;
  color: #9ca3af;
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  transform: translateY(20px);
  opacity: 0;
  min-width: 160px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  transition: 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 760px) {
  .summary-grid,
  .form-grid,
  .form-grid.two,
  .query-row {
    grid-template-columns: 1fr;
  }

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