:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1d2430;
  --muted: #687385;
  --line: #d9dee7;
  --soft-line: #e8ebf0;
  --accent: #1267b2;
  --accent-dark: #0c4d86;
  --good: #156b3f;
  --warn: #a14f00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 960px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.shell {
  width: min(1380px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 16px 0 32px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 10px;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.endpoint {
  color: var(--muted);
  font-size: 13px;
  padding-bottom: 4px;
}

.query-panel,
.voucher {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.query-form {
  display: grid;
  grid-template-columns: 110px 110px 140px 140px 140px 96px;
  gap: 12px;
  align-items: end;
  padding: 12px 14px;
}

label span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
}

input {
  width: 100%;
  height: 34px;
  border: 1px solid #c8cfda;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  background: #fff;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 103, 178, 0.12);
}

button {
  height: 34px;
  border: 1px solid var(--accent-dark);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.status {
  min-height: 34px;
  padding: 10px 2px 7px;
  color: var(--muted);
  font-size: 14px;
}

.status.error {
  color: #b42318;
}

.status.ok {
  color: var(--good);
}

.results {
  display: grid;
  gap: 12px;
}

.voucher {
  overflow: hidden;
}

.voucher-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.voucher-title h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.voucher-title .amount {
  white-space: nowrap;
  color: var(--muted);
  font-size: 14px;
}

.voucher-body {
  display: grid;
  gap: 8px;
  padding: 8px 16px 14px;
}

.section-title {
  margin: 0 0 7px;
  font-size: 15px;
  font-weight: 700;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}

.detail-table th,
.detail-table td {
  border: 1px solid var(--soft-line);
  padding: 7px 9px;
  vertical-align: middle;
}

.voucher-header-section {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.voucher-detail-section {
  min-width: 0;
}

.compact-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fcfdff;
}

.compact-header-cell {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  white-space: nowrap;
}

.compact-header-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.compact-header-value {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-summary .compact-header-value {
  overflow: visible;
  white-space: normal;
  word-break: break-word;
}

.compact-summary {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  flex: 1 1 220px;
  min-width: 0;
}

.compact-key {
  max-width: 190px;
}

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

.detail-table {
  width: 100%;
  border-style: hidden;
}

.detail-table .col-index {
  width: 58px;
}

.detail-table .col-summary {
  width: 360px;
}

.detail-table .col-code {
  width: 116px;
}

.detail-table .col-subject {
  width: 170px;
}

.detail-table .col-money {
  width: 120px;
}

.detail-table .col-assist {
  width: 190px;
}

.detail-table thead th {
  background: #f3f5f8;
  color: #3b4656;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.detail-table .num,
.detail-table .index {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.detail-table .index {
  width: 56px;
}

.detail-table .code {
  width: 118px;
}

.detail-table .money {
  width: 118px;
}

.detail-table td {
  white-space: normal;
  word-break: break-word;
}

.detail-table .summary {
  min-width: 360px;
}

.detail-table .assist-col,
.detail-table .assist-value {
  min-width: 190px;
  color: #354052;
}

.empty {
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  body {
    min-width: 0;
  }

  .shell {
    width: calc(100vw - 24px);
  }

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

  .compact-meta {
    flex-wrap: wrap;
  }
}
