:root {
  --bg: #f5f8fc;
  --panel: #ffffff;
  --line: #dfe5ef;
  --text: #1a2433;
  --muted: #64748b;
  --brand: #1565c0;
  --brand-soft: #e8f1ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -20%, #d7e7ff 0%, transparent 30%),
    radial-gradient(circle at 90% -10%, #e8f6ff 0%, transparent 25%),
    var(--bg);
}

.page {
  max-width: 1660px;
  margin: 24px auto;
  padding: 0 16px 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(15, 33, 61, 0.06);
}

.header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.title-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

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

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #334155;
  text-decoration: none;
  background: #fff;
  font-size: 13px;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 14px 20px 0;
}

.tab {
  border: 1px solid var(--line);
  background: #fff;
  color: #334155;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.filters {
  padding: 14px 20px;
  display: grid;
  grid-template-columns: auto 180px auto 180px auto 260px auto auto;
  gap: 10px;
  align-items: center;
}

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

.input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  font-size: 13px;
}

.input:focus {
  border-color: var(--brand);
}

.loan-filter.hidden {
  display: none;
}

.btn {
  height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-ghost {
  background: var(--brand-soft);
  color: var(--brand);
}

.btn-export {
  background: #0f766e;
  color: #fff;
}

.btn-export.hidden {
  display: none;
}

.stats {
  padding: 0 20px 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fafcff;
}

.stat .k {
  font-size: 12px;
  color: var(--muted);
}

.stat .v {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 700;
  color: #233247;
}

.meta {
  padding: 0 20px 12px;
  color: var(--muted);
  font-size: 13px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

.summary-table {
  min-width: 1600px;
}

.detail-table {
  min-width: 1900px;
}

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

th {
  position: sticky;
  top: 0;
  background: #f8fbff;
  z-index: 1;
  color: #334155;
}

td.num,
th.num {
  text-align: right;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 20px;
}

.row-link {
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 1440px) {
  .filters {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

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