:root {
  --ink: #172b43;
  --muted: #63758a;
  --line: #e3e9f0;
  --blue: #235fe5;
  --canvas: #f6f8fb;
  --success: #117c55;
  --error: #bb2538;
  --page-width: 1180px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--canvas);
  font:
    15px/1.6 -apple-system,
    BlinkMacSystemFont,
    'PingFang SC',
    'Microsoft YaHei',
    sans-serif;
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  width: 100%;
  max-width: var(--page-width);
  min-height: 80px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
  color: var(--ink);
}
.brand img {
  display: block;
  width: 170px;
  height: auto;
}
.brand-sub {
  border-left: 1px solid var(--line);
  padding-left: 20px;
  font-size: 14px;
  line-height: 24px;
  color: var(--muted);
  white-space: nowrap;
}
nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--muted);
  white-space: nowrap;
}
nav a:hover {
  background: #f5f7fb;
  text-decoration: none;
}
nav a[aria-current='page'] {
  background: #eff4ff;
  color: var(--blue);
  font-weight: 600;
}
.session {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}
main {
  width: 100%;
  max-width: var(--page-width);
  margin: 36px auto 48px;
  padding: 0 24px;
  flex: 1;
}
h1,
h2,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  line-height: 1.4;
  letter-spacing: -0.6px;
  margin-bottom: 9px;
  text-wrap: balance;
}
h2 {
  font-size: 18px;
  margin-bottom: 24px;
}
.eyebrow {
  color: var(--blue);
  font-size: 11px;
  letter-spacing: 1.8px;
  font-weight: 700;
  margin-bottom: 8px;
}
.muted,
.help {
  color: var(--muted);
}
.help {
  font-size: 12px;
  margin: 8px 0 20px;
}
.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.page-title p {
  margin-bottom: 0;
}
.tag {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.card {
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 6px 22px #18345404;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}
button:hover,
.button:hover {
  background: #f0f5fd;
  text-decoration: none;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.primary:hover {
  background: #174cc2;
}
.link {
  border: 0;
  background: transparent;
  padding: 4px;
  color: var(--blue);
}
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  border: 1px solid #cdd7e3;
  border-radius: 8px;
  min-width: 0;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #84adff;
  outline-offset: 3px;
}
.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.wide {
  grid-column: 1/-1;
}
.help {
  display: block;
  font-weight: 400;
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin-top: 18px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  white-space: nowrap;
}
th {
  text-align: left;
  background: #f7f9fc;
  font-weight: 500;
  color: var(--muted);
}
th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
td small {
  display: block;
  color: var(--muted);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
td button {
  font-size: 12px;
  min-height: 36px;
  margin-right: 8px;
}
td select {
  min-width: 145px;
}
td .check input {
  width: 20px;
  height: 20px;
  min-height: 0;
}
.amount {
  font-variant-numeric: tabular-nums;
}
.positive {
  color: var(--success);
}
.negative {
  color: var(--error);
}
.empty {
  text-align: center;
  padding: 32px;
  color: var(--muted);
}
.login {
  max-width: 470px;
  margin: 40px auto;
}
.login .button {
  width: 100%;
  margin: 12px 0;
}
.card + .card {
  margin-top: 24px;
}
.card h2 {
  margin-bottom: 10px;
}
.notice {
  padding: 18px;
  background: #f7f9fc;
  border-radius: 8px;
  margin-top: 24px;
  font-size: 13px;
}
.notice p {
  margin: 6px 0 12px;
  color: var(--muted);
}
fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
}
legend {
  font-size: 13px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.check input {
  display: inline-block;
  width: 18px;
  min-height: 18px;
  margin: 0;
}
.tag {
  display: inline-block;
  padding: 3px 8px;
  background: #f4f7fc;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
}
.tag.positive {
  background: #e9f7ef;
  border-color: #bde2d0;
}
.tag.negative {
  background: #fff1f1;
  border-color: #f2c5ca;
}
#message {
  padding: 0;
  margin: 0 0 18px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
#message:empty {
  display: none;
}
#message.error {
  color: var(--error);
}
#next-page {
  margin-top: 20px;
}
#detail-content {
  overflow-wrap: anywhere;
}
#detail-content dl {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  font-size: 13px;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
pre {
  background: #f7f9fc;
  padding: 18px;
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.7 monospace;
}
dialog {
  width: min(600px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
}
dialog::backdrop {
  background: #172b4366;
}
dialog textarea {
  font: 12px/1.7 monospace;
  resize: vertical;
}
footer {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 22px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}
.skip {
  position: fixed;
  top: -80px;
  left: 16px;
  background: white;
  padding: 14px;
  z-index: 10;
}
.skip:focus {
  top: 8px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1040px) {
  .header-inner {
    gap: 16px;
    flex-wrap: wrap;
  }
  nav {
    order: 3;
    width: 100%;
  }
  .session {
    margin-left: auto;
  }
}
@media (max-width: 760px) {
  .header-inner {
    padding: 14px 16px;
    gap: 12px;
  }
  .brand img {
    width: 148px;
  }
  .brand-sub {
    padding-left: 12px;
    font-size: 12px;
  }
  .brand {
    gap: 12px;
  }
  nav {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    font-size: 12px;
    gap: 4px;
  }
  nav a {
    padding: 8px 5px;
  }
  .session {
    font-size: 12px;
  }
  main {
    padding: 0 16px;
    margin: 28px auto 36px;
  }
  .card {
    padding: 22px;
  }
  .page-title {
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  h1 {
    font-size: 26px;
  }
  .filters,
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .card + .card {
    margin-top: 18px;
  }
  footer {
    display: block;
    padding: 20px 16px;
  }
  footer span {
    display: block;
  }
  .login {
    margin: 18px auto;
  }
  #detail-content dl {
    grid-template-columns: 95px minmax(0, 1fr);
  }
}
@media (max-width: 480px) {
  .brand-sub {
    display: none;
  }
  .filters,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .wide {
    grid-column: auto;
  }
  .session {
    gap: 8px;
  }
  .header-inner .session {
    margin-left: auto;
  }
  .brand img {
    width: 136px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
