*, *::before, *::after { box-sizing: border-box; }
:root {
  color-scheme: light;
  --canvas: #eff5f4;
  --paper: #fff;
  --ink: #132d34;
  --muted: #4d6369;
  --line: #d6e4e2;
  --soft: #f1f7f6;
  --tint: #e4f3ee;
  --accent: #0d6959;
  --accent-dark: #0a4e43;
  --warning-bg: #fff4e4;
  --warning-ink: #794516;
  --success-bg: #eaf6ef;
  --success-ink: #196043;
  --error-bg: #fff1ef;
  --error-ink: #8c271c;
  --radius: 12px;
}
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font: 15px/1.55 "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: var(--accent); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid #3a8581; outline-offset: 3px; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 3; transform: translateY(-150%); background: var(--paper); padding: 9px 14px; }
.skip-link:focus { transform: none; }
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 22px 22px;
  color: #edf9f9;
  background: linear-gradient(150deg, #153740, #102832 76%);
  border-right: 1px solid #28414a;
}
.brand { display: inline-flex; gap: 10px; align-items: center; font-weight: 800; color: inherit; text-decoration: none; }
.rail .brand { margin-bottom: 51px; }
.mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 9px; color: #0b4e41; background: #d5f3e9; }
.mark::before {
  content: "";
  width: 16px;
  height: 14px;
  border: 1.5px solid;
  border-radius: 2px;
  background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat;
}
.steps { display: grid; gap: 6px; }
.step {
  display: grid;
  grid-template-columns: 29px 1fr;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  min-height: 64px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #eaf7f6;
  text-decoration: none;
  font-size: 14px;
}
.step small { display: block; color: #bed4d4; font-size: 12px; }
.step.inactive { color: #c2d5d6; }
a.step:hover, .step[aria-current] { background: #254951; border-color: #3d6269; }
.step-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; border: 1px solid #729195; font-family: Aptos, "Segoe UI", sans-serif; }
.step[aria-current] .step-number { color: #114e3f; background: #d5f3e9; border-color: #d5f3e9; font-weight: 750; }
.history-link { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 23px; padding: 10px; border-top: 1px solid #49656d; color: #e2f1f1; text-decoration: none; }
.history-link:hover, .history-link[aria-current] { background: #244852; color: #fff; }
.rail-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 16px; }
.group { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.avatar { display: grid; place-items: center; flex: 0 0 28px; height: 28px; width: 28px; background: #d5f3e9; color: #0c4e40; border-radius: 50%; }
.account-actions { display: flex; gap: 2px; }
.logout { display: inline-flex; align-items: center; min-height: 44px; padding: 0 7px; white-space: nowrap; border: 0; border-radius: 6px; background: transparent; color: #c9dede; font-size: 12px; text-decoration: none; }
.logout:hover, .logout[aria-current] { background: #244852; color: #fff; }
.content { width: 100%; max-width: 1360px; margin: 0 auto; padding: 37px 38px 40px; min-width: 0; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 25px; }
.eyebrow { margin-bottom: 8px; font-size: 13px; color: var(--accent); font-weight: 750; }
h1 { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.22; letter-spacing: -.035em; font-weight: 800; }
h2 { font-size: 18px; line-height: 1.35; font-weight: 800; }
h3 { font-size: 15px; line-height: 1.4; }
.page-head p.muted { margin-top: 9px; }
.muted { color: var(--muted); font-size: 13px; }
.help { font-size: 12px; color: var(--muted); margin-top: 5px; text-align: right; }
.money { font-family: Aptos, "Segoe UI", Arial, sans-serif; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--accent);
  background: var(--paper);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--tint); border-color: var(--accent); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn.primary:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.btn:disabled, .btn.primary:disabled { border-color: #cbdad7; background: #e0e9e6; color: #536a63; }
.btn.small { min-height: 38px; padding-inline: 12px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 24px #12473a0a; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; gap: 12px; }
.table-panel { overflow: hidden; }
.summary-panel .panel-head { border-top: 3px solid var(--accent); }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { border-top: 1px solid var(--line); text-align: left; padding: 14px 20px; }
thead th { padding-block: 10px; background: var(--soft); color: var(--muted); font-weight: 750; font-size: 13px; }
tbody th { font-weight: 750; }
tbody small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.numeric { text-align: right; white-space: nowrap; }
td.money { font-size: 16px; }
.subtotal { background: var(--soft); font-weight: 750; }
.summary-panel tbody th { white-space: nowrap; }
.panel-note { padding: 11px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.file-strip { display: flex; align-items: center; gap: 13px; padding: 14px 17px; margin-bottom: 19px; }
.file-info { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.file-info h2 { font-size: 15px; }
.file-info p { margin-top: 4px; }
.file-mark { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; color: var(--accent); background: var(--tint); border-radius: 8px; }
.icon { display: inline-block; position: relative; width: 16px; height: 16px; flex: 0 0 16px; }
.icon.file::before { content: ""; position: absolute; inset: 0 2px; border: 1.5px solid; border-radius: 2px; }
.icon.file::after { content: ""; position: absolute; left: 5px; top: 5px; width: 6px; height: 1.5px; background: currentColor; box-shadow: 0 4px 0 currentColor; }
.icon.clock::before { content: ""; position: absolute; inset: 1px; border: 1.5px solid; border-radius: 50%; }
.icon.clock::after { content: ""; position: absolute; left: 7px; top: 4px; width: 4px; height: 5px; border-left: 1.5px solid; border-bottom: 1.5px solid; }
.icon.download { border-bottom: 1.5px solid; }
.icon.download::before { content: ""; position: absolute; left: 7px; top: 0; width: 1.5px; height: 10px; background: currentColor; }
.icon.download::after { content: ""; position: absolute; left: 4px; top: 4px; width: 8px; height: 8px; transform: rotate(45deg); border-right: 1.5px solid; border-bottom: 1.5px solid; }
.badge { display: inline-flex; padding: 3px 8px; border-radius: 5px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.badge.success, .alert.success { background: var(--success-bg); color: var(--success-ink); }
.badge.warning { background: var(--warning-bg); color: var(--warning-ink); }
.alert { padding: 11px 14px; border: 1px solid var(--line); border-radius: 7px; margin: 0 0 13px; font-size: 14px; }
.alert.error { background: var(--error-bg); color: var(--error-ink); border-color: #efd0c9; }
.audit { padding: 14px 19px; margin-top: 16px; }
.audit-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.audit-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.audit-totals dt, .review-facts dt { color: var(--muted); font-size: 12px; }
.audit-totals dd { margin-top: 3px; font-weight: 750; overflow-wrap: anywhere; }
.review-section { margin-top: 25px; scroll-margin-top: 14px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 13px; }
.section-heading p { margin-top: 5px; }
.review-list { display: grid; gap: 10px; }
.review-item { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.review-item[open] { border-color: #9bbfba; }
summary { cursor: pointer; }
.review-item > summary { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) auto auto 12px; align-items: center; gap: 12px; padding: 13px 16px; min-height: 56px; }
.review-item > summary::-webkit-details-marker { display: none; }
.review-item > summary:hover { background: var(--soft); border-radius: 8px; }
.review-title { display: block; font-size: 14px; font-weight: 750; overflow-wrap: anywhere; }
.review-date { color: var(--muted); font-weight: 400; font-size: 12px; margin-inline-start: 6px; }
.review-memo { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.review-amount { font-weight: 750; }
.chevron { width: 8px; height: 8px; border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent); transform: rotate(45deg); }
.review-item[open] .chevron { transform: rotate(225deg); }
.review-body { border-top: 1px solid var(--line); padding: 16px; }
.review-facts { display: grid; grid-template-columns: minmax(0, 2fr) 1fr 1fr; gap: 12px; padding: 11px 14px; background: var(--soft); border-radius: 7px; margin-bottom: 14px; }
.review-facts dd { margin-top: 4px; font-size: 13px; overflow-wrap: anywhere; }
.allocation-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.quick { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.quick select { width: auto; min-width: 148px; min-height: 40px; }
.allocation-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.allocation-fields label { font-size: 13px; }
.allocation-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; }
.allocation-note { color: var(--muted); font-size: 13px; }
.allocation-note[data-state="error"] { color: var(--error-ink); }
.allocation-note[data-state="balanced"] { color: var(--success-ink); }
.confirmed { margin-top: 15px; }
.confirmed > summary { min-height: 44px; padding: 9px 0; color: var(--accent); font-weight: 750; }
.batch-footer { margin-top: 24px; }
.empty { padding: 20px; }
.empty a { margin-left: 9px; }
.empty p { margin: 10px 0; }
.ready-panel { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.pager { display: flex; align-items: center; justify-content: end; gap: 10px; padding: 12px 20px; color: var(--muted); }
.import-panel { width: min(100%, 750px); padding: 24px; }
.fields { display: grid; gap: 15px; margin-top: 17px; }
.fields label, .allocation-fields label { display: block; font-weight: 750; }
input:not([type=hidden]), select { width: 100%; max-width: 100%; min-height: 44px; color: var(--ink); background: var(--paper); border: 1px solid #bacfcb; border-radius: 6px; padding: 8px 10px; }
.fields label input, .allocation-fields label input { display: block; margin-top: 5px; }
.file-drop { display: grid; justify-items: start; gap: 9px; padding: 17px; border-radius: 8px; background: var(--soft); border: 1px dashed #9dbab5; }
.file-drop input { height: auto; }
.file-drop input::file-selector-button { min-height: 30px; margin-right: 10px; border: 0; border-radius: 4px; background: var(--tint); color: var(--accent); cursor: pointer; }
.actions { display: flex; justify-content: flex-end; gap: 10px; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: linear-gradient(148deg, #12353e 0 28%, #eff5f4 28% 100%); }
.auth-card { width: min(100%, 440px); padding: 26px; }
.auth-card .brand { margin-bottom: 20px; }
.auth-card h1 { font-size: 29px; margin-bottom: 8px; }
.auth-card .alert { margin-top: 12px; }
.filing { margin-top: 18px; text-align: center; font-size: 12px; }
.filing a { color: var(--muted); }

@media (max-width: 1040px) {
  .shell { grid-template-columns: 201px minmax(0, 1fr); }
  .rail { padding-inline: 15px; }
  .content { padding-inline: 23px; }
  .allocation-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 740px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; display: grid; grid-template-columns: 1fr auto; gap: 7px 10px; padding: 13px 15px; }
  .rail .brand { margin-bottom: 0; }
  .steps { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .step { min-height: 45px; padding: 5px; grid-template-columns: 21px 1fr; gap: 5px; font-size: 12px; }
  .step small { display: none; }
  .step-number { width: 21px; height: 21px; }
  .history-link { padding: 6px; margin: 0; width: auto; border: 0; font-size: 13px; }
  .rail-footer { grid-row: 3; grid-column: 1 / -1; padding: 0; }
  .rail-footer .logout { min-height: 38px; }
  .content { padding: 25px 15px; }
  .page-head { align-items: start; flex-direction: column; margin-bottom: 18px; }
  .help { text-align: left; }
  .file-strip { flex-wrap: wrap; }
  .file-info { flex-basis: calc(100% - 58px); }
  .file-strip .btn { margin-left: auto; }
  .panel-head, .panel-note { padding-inline: 12px; }
  th, td { padding-inline: 10px; }
  .review-item > summary { grid-template-columns: minmax(0, 1fr) auto 10px; gap: 6px 8px; padding: 10px; }
  .review-summary { grid-column: 1; grid-row: 1 / 3; }
  .review-amount { grid-column: 2; grid-row: 1; text-align: right; }
  .review-item .badge { grid-column: 2; grid-row: 2; font-size: 11px; }
  .chevron { grid-column: 3; grid-row: 1 / 3; }
  .review-body { padding: 11px; }
  .review-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-facts div:first-child { grid-column: 1 / -1; }
  .audit-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .allocation-heading { flex-wrap: wrap; }
}
