:root {
  color-scheme: light;
  --ledger-canvas: #e3ebe7;
  --ledger-paper: #fbfdfc;
  --ledger-white: #ffffff;
  --ledger-ink: #16231c;
  --ledger-muted: #65726b;
  --ledger-line: #cbd6d0;
  --ledger-line-strong: #aebdb5;
  --ledger-green: #176b5a;
  --ledger-green-dark: #105143;
  --ledger-green-soft: #e5f0ec;
  --ledger-red: #a9473f;
  --ledger-red-soft: #f5e7e5;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ledger-paper);
  color: var(--ledger-ink);
}

button,
input {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(55, 93, 120, 0.34);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 9px 13px;
  border-radius: 4px;
  background: var(--ledger-ink);
  color: #fff;
}

.skip-link:focus {
  transform: translateY(0);
}

.login-layout {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(560px, 1.18fr) minmax(430px, 0.82fr);
}

.ledger-stage {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  border-right: 1px solid var(--ledger-line-strong);
  background: var(--ledger-canvas);
}

.ledger-stage::before,
.ledger-stage::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.ledger-stage::before {
  top: 0;
  right: 72px;
  bottom: 0;
  width: 1px;
  background: rgba(23, 107, 90, 0.18);
}

.ledger-stage::after {
  right: 0;
  bottom: 72px;
  left: 0;
  height: 1px;
  background: rgba(23, 107, 90, 0.18);
}

.login-brand {
  position: absolute;
  top: 30px;
  left: clamp(28px, 4vw, 66px);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--ledger-green);
  border-radius: 5px;
  background: var(--ledger-green);
  color: #fff;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 19px;
  font-weight: 760;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--ledger-muted);
  font-size: 10px;
}

.closing-copy {
  position: absolute;
  top: clamp(118px, 16vh, 178px);
  left: clamp(28px, 4vw, 66px);
  z-index: 2;
}

.stage-kicker,
.auth-kicker {
  color: var(--ledger-green-dark);
  font-size: 11px;
  font-weight: 750;
}

.stage-kicker {
  display: inline-flex;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--ledger-green);
}

.closing-copy h1 {
  max-width: 420px;
  margin: 18px 0 0;
  font-family: FangSong, STFangsong, "Songti SC", serif;
  font-size: 58px;
  font-weight: 700;
  line-height: 1.13;
}

.daybook {
  position: absolute;
  right: clamp(30px, 5vw, 82px);
  bottom: clamp(70px, 9vh, 100px);
  width: clamp(340px, 34vw, 500px);
  height: clamp(310px, 43vh, 410px);
  transform: rotate(-1.4deg);
}

.book-binding {
  position: absolute;
  top: 20px;
  bottom: 14px;
  left: 0;
  width: 22px;
  border: 1px solid #667a70;
  background: #657c71;
  box-shadow: -10px 12px 24px rgba(22, 35, 28, 0.15);
}

.book-binding::before,
.book-binding::after {
  position: absolute;
  right: 4px;
  left: 4px;
  height: 1px;
  background: rgba(255, 255, 255, 0.36);
  content: "";
}

.book-binding::before {
  top: 32%;
}

.book-binding::after {
  bottom: 32%;
}

.ledger-page {
  position: absolute;
  inset: 0 0 0 16px;
  padding: 24px 28px 25px 38px;
  border: 1px solid var(--ledger-line-strong);
  background: var(--ledger-paper);
  box-shadow: 0 24px 50px rgba(22, 35, 28, 0.18);
}

.ledger-page::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 24px;
  width: 1px;
  background: rgba(169, 71, 63, 0.32);
  content: "";
}

.ledger-page-head,
.ledger-columns,
.ledger-entry,
.ledger-total {
  display: grid;
  align-items: center;
}

.ledger-page-head {
  grid-template-columns: 1fr auto;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ledger-ink);
  font-family: Consolas, "Microsoft YaHei UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.ledger-page-head time {
  color: var(--ledger-muted);
  font-weight: 500;
}

.ledger-columns {
  grid-template-columns: 0.65fr 1fr 0.8fr;
  min-height: 38px;
  border-bottom: 1px solid var(--ledger-line-strong);
  color: var(--ledger-muted);
  font-size: 10px;
}

.ledger-columns span:last-child {
  text-align: right;
}

.ledger-entry {
  min-height: 48px;
  grid-template-columns: 0.65fr 1fr 0.8fr;
  border-bottom: 1px solid var(--ledger-line);
  font-family: Consolas, "Microsoft YaHei UI", sans-serif;
  font-size: 11px;
}

.ledger-entry i {
  width: 62%;
  height: 5px;
  background: var(--ledger-line);
}

.ledger-entry strong {
  justify-self: end;
  color: var(--ledger-green);
  font-size: 10px;
}

.ledger-entry.is-pending strong {
  color: var(--ledger-red);
}

.ledger-total {
  min-height: 62px;
  grid-template-columns: 1fr auto;
  font-size: 12px;
}

.ledger-total strong {
  font-family: Consolas, monospace;
  font-size: 22px;
}

.closing-stamp {
  position: absolute;
  right: 25px;
  bottom: 18px;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  transform: rotate(-8deg);
  border: 2px solid rgba(169, 71, 63, 0.72);
  color: var(--ledger-red);
  font-family: FangSong, STFangsong, serif;
  font-size: 18px;
  font-weight: 800;
}

.auth-panel {
  display: grid;
  min-height: 680px;
  place-items: center;
  padding: 48px clamp(34px, 5vw, 84px);
  background: var(--ledger-white);
}

.auth-shell {
  width: min(100%, 390px);
}

.auth-heading {
  margin-bottom: 34px;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.auth-kicker svg {
  width: 16px;
  height: 16px;
}

.auth-heading h2 {
  margin: 13px 0 9px;
  font-size: 31px;
  font-weight: 780;
  line-height: 1.2;
}

.auth-heading p {
  margin: 0;
  color: var(--ledger-muted);
  font-size: 14px;
  line-height: 1.7;
}

.login-form {
  display: grid;
  gap: 19px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  font-size: 12px;
  font-weight: 700;
}

.field-control {
  position: relative;
  display: flex;
  height: 50px;
  align-items: center;
  border: 1px solid var(--ledger-line-strong);
  border-radius: 5px;
  background: var(--ledger-paper);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field-control:focus-within {
  border-color: var(--ledger-green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(23, 107, 90, 0.1);
}

.field-control > svg {
  width: 18px;
  height: 18px;
  margin-left: 15px;
  flex: 0 0 auto;
  color: var(--ledger-muted);
}

.field-control input {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 14px 0 11px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
}

.password-control input {
  padding-right: 7px;
}

.password-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  margin-right: 3px;
  flex: 0 0 42px;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ledger-muted);
}

.password-toggle:hover {
  background: var(--ledger-green-soft);
  color: var(--ledger-green-dark);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.form-message {
  min-height: 20px;
  margin-top: -4px;
  color: var(--ledger-red);
  font-size: 12px;
  line-height: 1.55;
}

.form-message:empty {
  min-height: 8px;
}

.field-control.has-error {
  border-color: var(--ledger-red);
  background: var(--ledger-red-soft);
}

.login-button {
  position: relative;
  display: grid;
  width: 100%;
  height: 50px;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0 17px;
  border: 1px solid var(--ledger-green);
  border-radius: 5px;
  background: var(--ledger-green);
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  transition: background 160ms ease, transform 160ms ease;
}

.login-button:hover:not(:disabled) {
  background: var(--ledger-green-dark);
  transform: translateY(-1px);
}

.login-button:active:not(:disabled) {
  transform: translateY(0);
}

.button-label {
  justify-self: start;
}

.button-arrow {
  width: 18px;
  height: 18px;
}

.button-spinner {
  position: absolute;
  right: 17px;
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-spin 700ms linear infinite;
}

.login-button.is-loading .button-arrow {
  visibility: hidden;
}

.login-button.is-loading .button-spinner {
  display: block;
}

.login-button:disabled {
  opacity: 0.72;
}

@keyframes login-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 1400px) {
  .login-layout {
    grid-template-columns: minmax(760px, 1.32fr) minmax(500px, 0.68fr);
  }

  .daybook {
    right: 9vw;
  }
}

@media (max-width: 980px) {
  .login-layout {
    display: block;
  }

  .ledger-stage {
    min-height: 238px;
    border-right: 0;
    border-bottom: 1px solid var(--ledger-line-strong);
  }

  .ledger-stage::before {
    right: 38px;
  }

  .ledger-stage::after {
    bottom: 31px;
  }

  .login-brand {
    top: 22px;
    left: 24px;
  }

  .closing-copy {
    top: 91px;
    left: 24px;
  }

  .closing-copy h1 {
    margin-top: 11px;
    font-size: 35px;
    line-height: 1.12;
  }

  .daybook {
    right: 35px;
    bottom: -77px;
    width: 340px;
    height: 260px;
  }

  .ledger-page {
    padding: 20px 22px 20px 34px;
  }

  .ledger-entry {
    min-height: 38px;
  }

  .ledger-total,
  .closing-stamp {
    display: none;
  }

  .auth-panel {
    min-height: calc(100vh - 238px);
    min-height: calc(100dvh - 238px);
    padding: 48px 28px;
  }
}

@media (max-width: 620px) {
  .ledger-stage {
    min-height: 200px;
  }

  .login-brand {
    top: 17px;
    left: 18px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-mark svg {
    width: 19px;
    height: 19px;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .closing-copy {
    top: 79px;
    left: 18px;
  }

  .stage-kicker {
    font-size: 9px;
  }

  .closing-copy h1 {
    margin-top: 9px;
    font-size: 29px;
  }

  .daybook {
    right: -82px;
    bottom: -88px;
    width: 315px;
    height: 242px;
    opacity: 0.82;
  }

  .auth-panel {
    min-height: calc(100vh - 200px);
    min-height: calc(100dvh - 200px);
    place-items: start center;
    padding: 38px 22px 32px;
  }

  .auth-heading {
    margin-bottom: 27px;
  }

  .auth-heading h2 {
    margin-top: 10px;
    font-size: 27px;
  }

  .login-form {
    gap: 16px;
  }
}

@media (max-width: 360px) {
  .ledger-stage {
    min-height: 166px;
  }

  .login-brand {
    top: 13px;
  }

  .brand-copy small,
  .stage-kicker {
    display: none;
  }

  .closing-copy {
    top: 66px;
  }

  .closing-copy h1 {
    margin: 0;
    font-size: 27px;
  }

  .daybook {
    right: -130px;
    bottom: -105px;
    opacity: 0.68;
  }

  .auth-panel {
    min-height: calc(100vh - 166px);
    min-height: calc(100dvh - 166px);
    padding: 30px 18px 24px;
  }

  .auth-heading {
    margin-bottom: 23px;
  }

  .auth-heading h2 {
    font-size: 25px;
  }

  .auth-heading p {
    font-size: 13px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
