:root {
  --ink: #203637;
  --muted: #637576;
  --blue: #17646b;
  --paper: #f4f8f8;
  --line: #dce7e7;
  --white: #fff;
  --warn: #8a571b;
  --sans: "PingFang SC", "Microsoft YaHei", sans-serif;
}
* {
  box-sizing: border-box;
}
.compliance-overview { margin-block-end: 24px; }
.fact-row { padding-block: 12px; border-block-end: 1px solid var(--line); overflow-wrap: anywhere; }
.fact-row > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.fact-row p { margin-block: 6px; }
.fact-row a { margin-inline-end: 12px; }
.case-detail { padding-block: 16px; margin-block: 12px; border-block-start: 1px solid var(--line); overflow-wrap: anywhere; }
.case-detail h4 { font-size: 15px; margin-block: 20px 8px; }
.case-detail h4:first-child { margin-block-start: 0; }
.case-next { max-inline-size: 70ch; }
.case-field { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 12px; margin-block-end: 16px; }
.case-field select { width: 100%; }
.case-fields-group { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.case-packet { margin-block-start: 24px; }
.case-outcome { border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin-block: 12px; }
.case-outcome legend { font-weight: 600; padding-inline: 4px; }
.case-error { margin-block: 12px; }
@media(max-width:700px) { .case-field { grid-template-columns: minmax(0,1fr); } }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 14px/1.65 var(--sans);
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
.button {
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--blue);
  color: white;
  border-radius: 7px;
  padding: 9px 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
button:hover,
.button:hover {
  filter: brightness(0.96);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
.button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #79bac0;
  outline-offset: 3px;
}
.quiet {
  background: transparent;
  color: var(--blue);
  border-color: var(--line);
}
input,
textarea,
select {
  border: 1px solid #c9dada;
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  min-width: 0;
}
textarea {
  resize: vertical;
  width: 100%;
}
label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
label.button {
  flex-direction: row;
}
header {
  max-width: 1560px;
  margin: auto;
  padding: 25px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.seal {
  display: inline-grid;
  place-items: center;
  background: var(--blue);
  color: white;
  width: 42px;
  height: 46px;
  border-radius: 8px;
  font-size: 26px;
  font-family: "Songti SC", serif;
}
.brand strong {
  font-size: 20px;
}
.brand span:not(.seal) {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.month-label {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
main {
  max-width: 1560px;
  margin: auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 26px;
  align-items: start;
}
.work-area {
  min-width: 0;
}
nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}
nav button {
  background: none;
  color: var(--muted);
  border-radius: 0;
  padding: 13px 18px;
  border-bottom: 3px solid transparent;
}
nav button.selected {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 600;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
.section-head h1 {
  margin: 0 0 4px;
  font-size: 25px;
  letter-spacing: -0.5px;
  font-weight: 600;
}
.section-head p,
p.muted {
  margin: 0;
  color: var(--muted);
}
.totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #e7f1f2;
  padding: 22px 25px;
  gap: 20px;
  margin-bottom: 18px;
  border-radius: 8px;
}
.totals span {
  color: var(--muted);
  font-size: 12px;
}
.totals strong {
  display: block;
  font-size: 27px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.notice {
  background: #eef3f3;
  border-left: 3px solid #82aeb0;
  padding: 10px 14px;
  margin: 16px 0;
  color: #4d6668;
}
.notice.warn {
  background: #faf1e4;
  border-left-color: #c3924b;
  color: var(--warn);
}
.table-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
th {
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  padding: 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 17px 14px;
  border-bottom: 1px solid #edf2f2;
  vertical-align: top;
  font-size: 13px;
}
tbody tr:last-child td {
  border: 0;
}
td small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.money {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.mini {
  padding: 4px 8px;
  font-size: 12px;
  margin: 3px 4px 0 0;
}
.status {
  display: inline-block;
  font-size: 11px;
  background: #edf4f4;
  color: var(--blue);
  border-radius: 4px;
  padding: 2px 6px;
}
.status.draft {
  background: #fff0d9;
  color: #94601e;
}
.status.void {
  background: #f0f0f0;
  color: #788;
}
.empty {
  text-align: center;
  padding: 60px 25px;
  color: var(--muted);
  line-height: 2.2;
}
.footnote {
  color: var(--muted);
  font-size: 12px;
  margin-top: 18px;
  max-width: 72ch;
}
.task-row,
.doc-row,
.statement-row {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  margin: 12px 0;
}
.task-row h3 {
  margin: 0;
  font-size: 17px;
}
.task-top,
.doc-row,
.statement-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}
.dates {
  display: flex;
  gap: 24px;
  margin: 14px 0;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.dates strong {
  color: var(--ink);
  display: block;
  font-size: 15px;
  font-weight: 500;
}
.dates .unverified {
  color: var(--warn);
}
.task-row p {
  margin: 10px 0;
  font-size: 13px;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.task-row.done {
  opacity: 0.65;
}
.guide {
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.guide p {
  color: var(--muted);
  font-size: 12px;
}
pre {
  overflow: auto;
  font-size: 12px;
}
aside {
  position: sticky;
  top: 20px;
  margin-top: 10px;
  border: 1px solid #cddfe0;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}
.assistant-head {
  display: flex;
  gap: 12px;
  padding: 20px;
  background: #e8f2f2;
  align-items: center;
}
.assistant-head h2 {
  font-size: 16px;
  margin: 0;
}
.assistant-head p {
  font-size: 11px;
  color: var(--muted);
  margin: 3px 0 0;
}
.assistant-dot {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #23717a;
}
.messages {
  height: 360px;
  overflow: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.message {
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 12px 14px;
  border-radius: 7px;
  background: #f1f5f5;
  max-width: 100%;
}
.message.user {
  background: #e2eff0;
  margin-left: 20px;
}
.message.assistant {
  margin-right: 12px;
}
.message .role {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 5px;
}
#chat-form {
  padding: 14px;
  border-top: 1px solid var(--line);
}
#chat-text {
  border: 0;
  background: #f7f9f9;
  font-size: 13px;
  min-height: 90px;
}
.chat-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}
.chat-actions .button {
  font-size: 12px;
  padding: 7px 10px;
}
.assistant-note {
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
  padding: 0 18px;
}
.runtime {
  font-size: 11px;
  color: var(--muted);
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
footer {
  max-width: 1560px;
  margin: 30px auto;
  padding: 0 40px;
  color: #809293;
  font-size: 11px;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.login > div {
  width: min(400px, 90vw);
  padding: 35px;
}
.login h1 {
  font-size: 30px;
  margin: 20px 0 6px;
}
.login p {
  color: var(--muted);
  font-size: 13px;
}
.login form {
  margin: 25px 0;
  display: grid;
  gap: 14px;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  width: min(600px, 94vw);
  padding: 25px;
  color: var(--ink);
  max-height: 90vh;
}
dialog::backdrop {
  background: #163b3d55;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.dialog-head h2 {
  margin: 0;
  font-size: 20px;
}
#editor-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
#editor-fields .wide {
  grid-column: 1/-1;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 25px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #203637;
  color: #fff;
  padding: 12px 22px;
  border-radius: 8px;
  z-index: 10;
  max-width: 90vw;
  white-space: pre-wrap;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1100px) {
  main {
    padding: 0 24px;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
  }
  header {
    padding: 20px 24px;
  }
  .totals {
    padding: 18px;
  }
  .totals strong {
    font-size: 22px;
  }
  .section-head {
    align-items: start;
    flex-wrap: wrap;
  }
  .section-head h1 {
    font-size: 23px;
  }
}
@media (max-width: 850px) {
  main {
    grid-template-columns: 1fr;
  }
  aside {
    position: static;
  }
  .messages {
    height: 240px;
  }
  header {
    padding: 18px;
  }
  .month-label {
    font-size: 0;
  }
  .month-label input {
    font-size: 13px;
  }
  main {
    padding: 0 16px;
  }
  nav {
    gap: 0;
  }
  nav button {
    padding: 12px;
    font-size: 13px;
  }
  .totals {
    gap: 12px;
  }
  .totals strong {
    font-size: 21px;
  }
  .section-head h1 {
    font-size: 22px;
  }
  footer {
    padding: 0 18px;
  }
  #editor-fields {
    grid-template-columns: 1fr;
  }
  #editor-fields .wide {
    grid-column: auto;
  }
  .header-actions {
    gap: 8px;
  }
}
.loading {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}
.loading button {
  margin-left: 16px;
}
.form-error {
  background: #fff1ef;
  color: #913828;
  border: 1px solid #ecc0b7;
  padding: 12px 14px;
  margin-bottom: 18px;
  border-radius: 6px;
}
.form-error:focus {
  outline: 2px solid #913828;
  outline-offset: 2px;
}
[aria-invalid="true"] {
  border-color: #a04430;
}
.notice {
  border-left-width: 1px;
}
button:active,
.button:active {
  filter: brightness(0.88);
}
label.button:focus-visible {
  outline: 3px solid #79bac0;
  outline-offset: 3px;
}
td small,
.doc-row strong {
  overflow-wrap: anywhere;
}
::selection {
  background: #c2e4e5;
  color: #203637;
}
input,
textarea {
  caret-color: var(--blue);
}
@media (max-width: 850px) {
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .mini {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 10px;
  }
  .chat-actions .button {
    min-height: 44px;
  }
  .section-head > div:last-child {
    display: flex;
    gap: 8px;
  }
  .totals {
    padding: 16px 12px;
  }
  .totals strong {
    font-size: 19px;
  }
  td {
    font-size: 14px;
  }
}

footer {
  color: var(--muted);
}
td small {
  font-size: 12px;
}
.message .role {
  font-size: 12px;
}
.task-row.done {
  opacity: 1;
  background: #f1f5f5;
}
#chat-text::placeholder {
  color: var(--muted);
  opacity: 1;
}
