:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: #1d1d1f;
  background: #f5f5f7;
  font-synthesis: none;
  line-height: 1.5;
  --blue: #0071e3;
  --muted: #6e6e73;
  --line: #e5e5ea;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 9px;
  padding: 9px 15px;
  background: #eaf2fd;
  color: #0065cc;
  white-space: nowrap;
}
button:hover {
  filter: brightness(0.97);
}
button.primary {
  background: var(--blue);
  color: #fff;
}
button.ghost {
  background: transparent;
  color: var(--muted);
}
button.danger {
  background: #fff0f0;
  color: #ba2530;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #65acff;
  outline-offset: 3px;
}
header {
  background: #ffffffde;
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  padding: 20px max(24px, calc((100vw - 1420px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
header h1 {
  font-size: 22px;
  letter-spacing: -0.7px;
  margin: 0;
}
header p {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mark {
  font-size: 23px;
  background: #eaf2fd;
  color: var(--blue);
  border-radius: 12px;
  padding: 6px 12px;
}
nav {
  display: flex;
  gap: 5px;
  padding: 18px 0 24px;
  flex-wrap: wrap;
}
nav button {
  background: transparent;
  color: var(--muted);
}
nav button.active {
  background: white;
  box-shadow: 0 2px 8px #0000000a;
  color: #1d1d1f;
  font-weight: 600;
}
.shell {
  max-width: 1468px;
  margin: auto;
  padding: 0 24px 60px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}
.stack {
  display: grid;
  gap: 20px;
}
.card {
  background: #fff;
  border: 1px solid #eeeef0;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 2px 4px #00000002;
  min-width: 0;
}
.card h2,
.section-title {
  font-size: 18px;
  letter-spacing: -0.4px;
  margin: 0 0 16px;
}
.card h3 {
  font-size: 15px;
  margin: 0 0 12px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.spread {
  justify-content: space-between;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 14px;
  margin: 12px 0;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  color: #515154;
}
.field input,
.field select,
.field textarea,
textarea.code {
  border: 1px solid #d2d2d7;
  border-radius: 9px;
  background: #fff;
  color: #1d1d1f;
  padding: 10px 11px;
  width: 100%;
  min-width: 0;
}
.field textarea {
  resize: vertical;
  min-height: 70px;
}
.field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}
.field.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0;
  overflow-wrap: anywhere;
}
.lead {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px;
}
.notice {
  font-size: 13px;
  background: #f2f7fe;
  border-radius: 10px;
  padding: 12px 14px;
  color: #335376;
  margin: 10px 0;
}
.notice.warning {
  background: #fff7e5;
  color: #85601a;
}
.notice.error {
  background: #fff0f0;
  color: #af2631;
  overflow-wrap: anywhere;
}
.pill {
  display: inline-block;
  font-size: 11px;
  background: #f2f2f7;
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 7px;
}
.money {
  font-size: 42px;
  font-weight: 650;
  letter-spacing: -1.7px;
  font-variant-numeric: tabular-nums;
  margin: 8px 0;
}
.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 18px 0;
}
.metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.metric strong {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.result {
  position: sticky;
  top: 20px;
}
.rows {
  display: grid;
  gap: 0;
}
.row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #f0f0f3;
  padding: 10px 0;
  font-size: 13px;
}
.row strong {
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  white-space: nowrap;
}
.row:last-child {
  border: 0;
}
.item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
}
.item .item {
  background: #fafafc;
}
details {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
}
summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 550;
  list-style-position: outside;
  margin-left: 15px;
}
details > div {
  padding-top: 10px;
}
.section-actions {
  margin-top: 14px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
td,
th {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
td.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table-wrap {
  overflow: auto;
  margin: 14px 0;
}
.selected-row {
  background: #f3f8ff;
}
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.library-tile {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 17px;
}
.library-tile h3 {
  margin: 0 0 5px;
  font-size: 15px;
}
.library-tile p {
  font-size: 12px;
  color: var(--muted);
}
.library-tile.disabled {
  opacity: 0.6;
}
dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: 90vh;
  border: 1px solid var(--line);
  border-radius: 19px;
  padding: 0;
  box-shadow: 0 24px 80px #0003;
}
dialog::backdrop {
  background: #17203050;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.dialog-head h2 {
  font-size: 18px;
  margin: 0;
}
.dialog-body {
  padding: 24px;
}
.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 24px;
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
}
textarea.code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
}
textarea.code {
  min-height: 170px;
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f5f5f7;
  padding: 15px;
  border-radius: 10px;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 36px 0;
}
.tabs-small {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #242426;
  color: white;
  max-width: min(700px, 90vw);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  z-index: 99;
  display: none;
}
#toast.visible {
  display: block;
}
#print {
  display: none;
}
.positive {
  color: #22834a;
}
.negative {
  color: #bb2632;
}
.strong {
  font-weight: 600;
}
.caption {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #86868b;
}
.bar {
  height: 5px;
  background: #e5edfa;
  border-radius: 5px;
  margin-top: 8px;
}
.bar span {
  height: 100%;
  display: block;
  background: var(--blue);
  border-radius: 5px;
}
.footer-note {
  font-size: 12px;
  color: var(--muted);
  padding: 20px 0;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
@media (max-width: 1000px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
  .card {
    padding: 18px;
  }
}
@media (max-width: 780px) {
  header {
    align-items: flex-start;
    padding: 18px;
  }
  .shell {
    padding: 0 14px 30px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .result {
    position: static;
  }
  .card {
    border-radius: 14px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  header .toolbar {
    max-width: 140px;
    justify-content: flex-end;
  }
  header h1 {
    font-size: 18px;
  }
  .money {
    font-size: 38px;
  }
  .dialog-body {
    padding: 16px;
  }
}
@media (max-width: 400px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .brand .mark {
    display: none;
  }
  nav button {
    padding: 8px 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
@media print {
  body {
    background: #fff;
  }
  #app,
  #toast,
  dialog {
    display: none !important;
  }
  #print {
    display: block;
    padding: 20px;
    font-size: 12px;
  }
  #print h1 {
    font-size: 24px;
  }
  #print .money {
    font-size: 30px;
  }
  #print table {
    break-inside: auto;
  }
  #print tr {
    break-inside: avoid;
  }
}

.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(ellipse at 12% 20%, #e8f1ff, transparent 60%), #f5f5f7;
}
.auth-card {
  width: min(100%, 430px);
  padding: 38px;
  border: 1px solid #fff;
  border-radius: 28px;
  background: #fffffff2;
  box-shadow: 0 16px 60px #24365612;
}
.auth-card h1 {
  font-size: 30px;
  letter-spacing: -0.04em;
  margin: 10px 0 14px;
}
.auth-mark {
  font-size: 40px;
  color: #007aff;
}
.auth-card form {
  display: grid;
  gap: 16px;
  margin: 28px 0 16px;
}
.auth-card > .field {
  margin: 20px 0 12px;
}
.auth-card > button {
  margin: 8px 8px 8px 0;
}
.auth-card input {
  width: 100%;
}
.auth-card input[type="checkbox"] {
  width: 18px;
}
.auth-card .check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-message {
  color: #b3261e;
  font-size: 14px;
  min-height: 20px;
}
.security-card {
  width: min(100%, 740px);
}
.key-row {
  display: flex;
  gap: 10px;
  align-items: end;
  border-top: 1px solid #e5e5ea;
  margin-top: 20px;
  padding-top: 12px;
}
.key-row .field {
  flex: 1;
}
.preserve-lines {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
header {
  flex-wrap: wrap;
  gap: 16px;
}
.pill.warning {
  background: #fff2d6;
  color: #855200;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #76b3ff;
  outline-offset: 3px;
}
@media (max-width: 780px) {
  header .toolbar {
    max-width: none;
    justify-content: flex-start;
  }
  .auth-card {
    padding: 26px;
  }
  .key-row {
    flex-wrap: wrap;
  }
  .key-row .field {
    min-width: 100%;
  }
}
@page {
  size: A4;
  margin: 16mm;
}
@media print {
  #print {
    padding: 0;
  }
  #print .table-wrap {
    overflow: visible;
  }
  #print th,
  #print td {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #print thead {
    display: table-header-group;
  }
  #print h1 {
    break-after: avoid;
  }
  #print .hint {
    color: #444;
  }
}
