:root {
  color-scheme: light;
  --ink: #17253c;
  --muted: #596779;
  --line: #dce2ea;
  --accent: #2956c8;
  --mist: #edf2ff;
  --paper: #fff;
  --shadow: 0 8px 32px -23px #243c6059;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #f6f7fa;
  font-size: 15px;
}
* { box-sizing: border-box }
body { margin: 0; min-height: 100vh }
[hidden] { display: none !important }
input, select, textarea, button { font: inherit; color: inherit }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent }
button, .import-block label { cursor: pointer }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px;
  padding: 8px 15px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 14px; font-weight: 570; transition: background .18s, transform .18s, box-shadow .18s;
}
button:hover { background: #f3f5fa; box-shadow: 0 2px 8px #09204409 }
button:active { transform: translateY(1px) }
button:disabled { opacity: .53; pointer-events: none }
a { color: inherit; text-decoration: none }
button.primary { background: var(--accent); color: white; border-color: var(--accent) }
button.primary:hover { background: #2046a7 }
button.danger { color: #aa3226; background: #fff7f6 }
.wide { width: 100% }
:focus-visible { outline: 3px solid #6992ff; outline-offset: 2px }
svg { display: block; flex: none; width: 18px; height: 18px }
i { display: inline-flex; flex: none }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
.skip:focus { position: fixed; top: 10px; left: 10px; z-index: 10; padding: 8px; background: #fff }
.top { position: sticky; top: 0; z-index: 3; background: #fcfdfff2; border-bottom: 1px solid var(--line); backdrop-filter: blur(18px) }
.bar { max-width: 1356px; margin: auto; min-height: 68px; padding: 9px clamp(16px, 4vw, 60px); display: flex; align-items: center; gap: 28px }
.brand { display: inline-flex; align-items: center; gap: 11px; white-space: nowrap; font-size: 19px; letter-spacing: -.04em }
.brand-icon { width: 35px; height: 35px; display: grid; place-content: center; color: #fff; border-radius: 11px; background: linear-gradient(145deg,#4e83f0,#2752c0); box-shadow: inset 0 1px 0 #ffffff73 }
.brand-icon svg { width: 25px; height: 25px }
.brand-icon.large { width: 47px; height: 47px; border-radius: 14px; margin-bottom: 26px }
.brand-icon.large svg { width: 33px; height: 33px }
.global-nav { margin: 0 auto; display: flex; align-items: center; gap: 5px }
.global-nav a { display: flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 9px; color: var(--muted); font-size: 14px }
.global-nav a[aria-current=page] { color: var(--accent); background: var(--mist); font-weight: 640 }
.balance { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums }
.balance i { color: #a67528 }
#boot { margin: 18vh auto; color: var(--muted); text-align: center }
.app, .login-shell { max-width: 1280px; margin: 0 auto; padding: 34px clamp(16px, 4vw, 56px) 70px }
.page { animation: appear .22s ease-out }
@keyframes appear { from { opacity: .72; transform: translateY(3px) } to { opacity: 1; transform: translateY(0) } }
.page-heading, .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px }
.page-heading { margin-bottom: 25px }
h1, h2, p { margin: 0 }
h1 { font-size: clamp(29px,3.1vw,42px); font-weight: 715; line-height: 1.25; letter-spacing: -.065em }
h2 { font-size: 19px; line-height: 1.4; letter-spacing: -.03em }
.page-heading p, .muted { color: var(--muted); margin-top: 7px; line-height: 1.65 }
.buttons, .job-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap }
.steps { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 4px; background: #e9edf3; padding: 5px; border: 1px solid #e4e8ee; border-radius: 15px; margin-bottom: 20px }
.steps button { color: #526077; background: none; border-color: transparent; min-height: 42px; border-radius: 10px }
.steps button[aria-current=step] { color: #234faf; background: white; box-shadow: 0 1px 5px #2336561a }
.work-grid { display: grid; grid-template-columns: minmax(282px,.8fr) minmax(0,1.65fr); gap: 17px; align-items: start }
.surface { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); min-width: 0 }
.control { padding: clamp(18px,2vw,27px) }
.control-title { display: flex; align-items: flex-start; gap: 13px; padding-bottom: 20px; margin-bottom: 19px; border-bottom: 1px solid var(--line) }
.icon-tile { display: inline-grid; place-content: center; width: 41px; height: 41px; flex: none; color: #315fae; border-radius: 12px; background: var(--mist) }
.icon-tile svg { width: 22px; height: 22px }
.sub, .cost, .meta { color: var(--muted); font-size: 12px; line-height: 1.65 }
.control-title .sub { margin-top: 4px }
label { display: block; font-size: 13px; font-weight: 590 }
input:not([type=file]), select, textarea { width: 100%; min-width: 0; display: block; border: 1px solid #d5dce6; border-radius: 9px; background: #fff; padding: 10px 11px; font-size: 14px; line-height: 1.5 }
label input, label select, label textarea { margin-top: 6px }
textarea { resize: vertical; min-height: 82px }
::placeholder { color: #758293; opacity: 1 }
.fields, #layout-controls, #login-form { display: grid; gap: 15px }
.fields:not(:empty) { margin: 17px 0 }
.two, .export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.cost { margin: 15px 0 9px }
.mobile-switch { display: none }
.job-row { margin: 0 0 14px; padding: 6px 12px; background: #eaf1ff; border-radius: 10px; color: #325394; font-size: 13px }
.job-row button { margin-left: auto; min-height: 30px; padding: 4px 9px }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #4973d7 }
.import-block { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); position: relative }
.import-block label { display: inline-flex; gap: 7px; align-items: center; padding: 5px 0; color: #315899 }
.import-block input { position: absolute; width: 1px; height: 1px; opacity: 0 }
.import-block:focus-within label { outline: 2px solid #6992ff }
.paper { overflow: hidden; min-height: 548px }
.paper-bar { display: flex; align-items: center; justify-content: space-between; background: #fbfcfe; border-bottom: 1px solid var(--line); padding: 11px clamp(14px,2.1vw,29px) }
.paper-tabs { display: flex; gap: 4px }
.paper-tabs button { border-color: transparent; background: transparent; color: var(--muted); min-height: 32px; padding: 5px 11px }
.paper-tabs button[aria-pressed=true] { background: #eaf0fb; color: #294d91 }
#paper-state { font-size: 12px; color: var(--muted) }
.paper-inner { padding: clamp(20px,3.6vw,49px) clamp(18px,4.2vw,59px) 23px }
#doc-title { border: 0; padding: 0; background: transparent; border-radius: 2px; font-family: Georgia,"Songti SC",SimSun,serif; font-weight: 650; font-size: clamp(25px,3vw,38px); line-height: 1.4 }
.byline { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 12px 0 25px }
.byline .rule { height: 2px; width: 31px; background: #6187ce }
#doc-body { border: 0; border-radius: 2px; padding: 0; min-height: 345px; font-size: 16px; line-height: 1.9; background: transparent }
#preview { overflow-wrap: anywhere }
#preview p { white-space: pre-wrap }
.paper[data-theme=book] .paper-inner { background: #fffdf6 }
.paper[data-theme=blue] .paper-inner { background: #f5f9ff }
#result-panel { padding: clamp(18px,3vw,38px) }
.result-picker { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 12px }
#result-empty { display: grid; justify-items: center; align-content: center; min-height: 300px; gap: 8px; color: var(--muted); text-align: center }
#result-empty i { background: var(--mist); color: var(--accent); border-radius: 13px; padding: 13px; margin-bottom: 5px }
#result-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; margin: 12px 0 24px; max-height: 60vh; overflow: auto }
#result-meta { margin-top: 20px }
#notice, .decision { margin: 0 0 15px; padding: 12px 15px; border-radius: 10px; font-size: 14px; line-height: 1.5; border: 1px solid #cbdcf5; background: #f1f6ff; overflow-wrap: anywhere }
#notice[data-error=true], .decision { background: #fff6ed; color: #713d1d; border-color: #efdbca }
.decision { display: flex; align-items: center; justify-content: space-between; gap: 10px }
.library, .ledger { padding: clamp(18px,2.2vw,30px) }
.library-tools { display: flex; gap: 9px; margin-bottom: 15px }
.library-tabs { margin-bottom: 18px; padding-bottom: 13px; border-bottom: 1px solid var(--line) }
.pager { justify-content: center; margin-top: 12px; color: var(--muted); font-size: 13px }
.library-tools label { flex: 1 }
.library-tools input { margin: 0 }
.list-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line) }
.list-row:last-child { border-bottom: 0 }
.list-row>div { min-width: 0 }
.list-row strong, .list-row small { display: block; overflow-wrap: anywhere }
.list-row small { margin-top: 4px; color: var(--muted); font-size: 12px }
.empty { color: var(--muted); padding: 28px 0; text-align: center }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px }
.account-grid>div { padding: clamp(18px,2.4vw,33px) }
.account-grid i { color: var(--accent); margin-bottom: 11px }
.account-grid h2 { font-size: 14px; color: var(--muted) }
.account-grid strong { display: block; font-size: 34px; margin: 10px 0 }
.account-grid p { color: var(--muted); font-size: 13px }
.balance-card { background: linear-gradient(122deg,#f2f6ff,#fff) }
.section-heading { margin-bottom: 10px }
.login-shell { padding-top: clamp(28px,9vh,100px); display: grid; grid-template-columns: 1.1fr 1fr; min-height: min(80vh,690px) }
.login-art, .login-box { padding: clamp(26px,5vw,75px); display: flex; flex-direction: column; justify-content: center }
.login-art { position: relative; isolation: isolate; color: #183354; overflow: hidden; border-radius: 26px 0 0 26px; background: radial-gradient(ellipse at 70% 20%,#c4d3f3,transparent 62%),linear-gradient(145deg,#e5edfa,#cedcf2) }
.login-art h2 { font-size: clamp(25px,3.1vw,42px); letter-spacing: -.055em }
.login-art p { font-size: 15px; margin-top: 8px; line-height: 1.6 }
.folio { margin: 0 auto 50px; width: 170px; height: 184px; position: relative; transform: rotate(-8deg) }
.folio-front, .folio-back { position: absolute; inset: 0; border: 1px solid #d0d9e8; border-radius: 5px 12px 8px 5px; box-shadow: 4px 12px 30px #193e7426 }
.folio-back { transform: translate(15px,2px) rotate(17deg); background: #edf2fb }
.folio-front { display: flex; flex-direction: column; padding: 20px; background: linear-gradient(105deg,#fffef8,#fffcf1) }
.folio-rule { border-top: 3px solid #2f4b75 }
.folio-front b { font-family: "Songti SC",SimSun,serif; font-size: 56px; line-height: 1.3; margin: 5px 0; color: #374b6a }
.folio-lines, .folio-foot { border-top: 1px solid #a0a9b2; margin-top: 10px }
.folio-lines.short { width: 72% }
.folio-foot { margin-top: auto; width: 20%; border-top-width: 3px }
.login-box { background: white; border: 1px solid var(--line); border-left: none; border-radius: 0 26px 26px 0 }
.login-box h1 { font-size: clamp(25px,3vw,35px) }
.login-box .muted { font-size: 14px }
#login-form { margin-top: 29px }
.inline-error { color: #aa3226; font-size: 13px; line-height: 1.5 }
.inline-error:empty { display: none }
@media (max-width: 790px) {
  .bar { gap: 10px; padding: 9px 16px }
  .global-nav { gap: 1px }
  .global-nav a { padding: 8px 9px }
  .work-grid { grid-template-columns: minmax(230px,.78fr) minmax(0,1.15fr); gap: 12px }
  .app { padding: 24px 15px 60px }
  .steps button { gap: 5px; padding-inline: 5px }
  .login-shell { padding: 30px 16px }
}
@media (max-width: 620px) {
  .bar { flex-wrap: wrap; row-gap: 6px; padding-block: 8px }
  .brand { font-size: 17px }
  .brand-icon { height: 30px; width: 30px }
  .balance { margin-left: auto }
  .global-nav { order: 3; width: 100%; justify-content: center; border-top: 1px solid #edf0f4; padding-top: 4px }
  .global-nav a { flex: 1; justify-content: center; min-height: 34px }
  .page-heading { flex-wrap: wrap; margin-bottom: 15px }
  .steps { display: flex; overflow-x: auto; scrollbar-width: thin; margin-bottom: 12px }
  .steps button { flex: 1 0 56px; flex-direction: column; gap: 4px; font-size: 12px }
  .mobile-switch { display: flex; margin-bottom: 12px; gap: 4px }
  .mobile-switch button { flex: 1; background: transparent; border-color: transparent; border-radius: 7px }
  .mobile-switch button[aria-pressed=true] { color: #274f9a; background: #e8eef9 }
  .work-grid[data-mobile=control] .paper, .work-grid[data-mobile=paper] .control { display: none }
  .work-grid, .login-shell { grid-template-columns: 1fr }
  .paper { min-height: 375px }
  #doc-body { min-height: 225px }
  .login-art { display: none }
  .login-box { border: 1px solid var(--line); border-radius: 20px }
  .account-grid { gap: 8px }
  .decision, .list-row { flex-wrap: wrap }
  .export-grid { grid-template-columns: 1fr 1fr }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important }
}
