:root {
  --brand: #146c45;
  --brand-hover: #0d5535;
  --canvas: #f8fafc;
  --surface: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --danger: #a52231;
  --positive: #e6f3ea;
  --scroll-thumb: #81958a;
  --scroll-track: #edf2ee;
  --scroll-hover: #526e5e;
  --scroll-active: #146c45;
  --font-body: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  --font-display: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  --font-data: "Cascadia Code", Consolas, monospace;
  --radius: 8px;
  --space: 24px;
}
* {
  box-sizing: border-box;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  scrollbar-width: thin;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: var(--scroll-track);
}
*::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border: 2px solid var(--scroll-track);
  border-radius: 8px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-hover);
}
*::-webkit-scrollbar-thumb:active {
  background: var(--scroll-active);
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.6 var(--font-body);
}
a {
  color: var(--brand);
  text-underline-offset: 3px;
  cursor: pointer;
}
a:hover {
  color: var(--brand-hover);
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
button {
  min-height: 42px;
  padding: 9px 17px;
  background: var(--brand);
  color: white;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}
button:hover:not(:disabled) {
  background: var(--brand-hover);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button.secondary {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}
button.secondary:hover:not(:disabled) {
  background: var(--canvas);
}
button.danger {
  background: var(--danger);
  border-color: var(--danger);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
input,
textarea,
select {
  min-height: 42px;
  border: 1px solid #95a89b;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 12px;
  max-width: 100%;
}
input,
textarea {
  width: 100%;
}
input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}
textarea {
  resize: none;
  min-height: 120px;
  overflow-y: auto;
}
select {
  cursor: pointer;
}
[aria-invalid="true"] {
  border-color: var(--danger);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font: 600 24px / 1.35 var(--font-display);
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}
h2 {
  font: 600 18px/1.4 var(--font-display);
  margin-bottom: 16px;
}
h3 {
  font-size: 16px;
  margin-bottom: 12px;
}
small,
.muted {
  color: var(--muted);
}
.topbar {
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 2;
  margin-left: 288px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  font: 600 22px var(--font-display);
  color: var(--ink);
}
.brand-logo {
  flex: none;
  object-fit: contain;
}
nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
nav a {
  font-size: 14px;
  text-decoration: none;
}
.language-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
main {
  margin-left: 288px;
  padding: 24px 32px 48px;
  min-height: calc(100vh - 64px);
  min-width: 0;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin: 12px 0 24px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--space);
  margin-bottom: 20px;
  min-width: 0;
}
.stamp {
  border-left: 5px solid var(--brand);
}
.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
  align-items: start;
}
.panel.login {
  max-width: 448px;
  margin: 40px auto;
  padding: 36px;
  box-shadow: 0 1px 3px #0f172a12;
}
.intro {
  max-width: 760px;
  margin: 65px auto;
}
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.field {
  display: block;
  margin-bottom: 18px;
}
.field > label {
  display: block;
  font-weight: 600;
  margin-bottom: 7px;
}
.field-error {
  color: var(--danger);
  min-height: 22px;
  margin-top: 4px;
  font-size: 13px;
}
.password-row {
  display: flex;
  gap: 8px;
}
.password-row input {
  min-width: 0;
}
.password-row button {
  flex-shrink: 0;
}
#notice {
  min-height: 28px;
  color: var(--brand);
  overflow-wrap: anywhere;
}
#notice.error {
  color: var(--danger);
}
.badge {
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--canvas);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 12px;
  white-space: nowrap;
}
.badge.good {
  color: var(--brand);
  background: var(--positive);
  border-color: var(--positive);
}
.mono {
  font-family: var(--font-data);
  overflow-wrap: anywhere;
}
.meta {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 9px 16px;
  font-size: 14px;
  margin: 0;
}
dt {
  color: var(--muted);
  overflow-wrap: anywhere;
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.data-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 18px;
}
.data-section:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.data-list {
  display: grid;
  gap: 0;
}
.data-row {
  display: grid;
  grid-template-columns: minmax(140px, 35%) 1fr;
  gap: 20px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.data-row:last-child {
  border-bottom: 0;
}
.data-key {
  color: var(--muted);
}
.data-value {
  white-space: pre-wrap;
}
details {
  margin: 8px 0;
}
summary {
  cursor: pointer;
  padding: 8px 0;
  font-weight: 600;
}
summary:hover {
  color: var(--brand);
}
.nested {
  margin-left: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--line);
}
.attachments {
  list-style: none;
  padding: 0;
  margin: 0;
}
.attachments li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 288px;
  height: 100dvh;
  max-width: calc(100vw - 32px);
  max-height: none;
  margin: 0;
  padding: 20px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: var(--surface);
}
.sidebar-heading,
.topbar-context {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.sidebar-heading {
  justify-content: space-between;
  min-height: 40px;
}
.nav-label {
  margin: 36px 12px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.workspace-navigation {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.workspace-navigation .nav-item {
  display: block;
  width: 100%;
  border: 0;
  min-height: 44px;
  padding: 11px 12px;
  text-align: left;
  text-decoration: none;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  white-space: normal;
}
.workspace-navigation .nav-item:hover {
  background: var(--canvas);
}
.workspace-navigation .nav-item[aria-current="page"] {
  background: var(--positive);
  color: var(--brand);
  font-weight: 600;
}
.topbar-brand,
#open-navigation,
#close-navigation {
  display: none;
}
.icon-button {
  min-width: 42px;
  padding: 4px;
  font-size: 22px;
}
#page-context {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.topbar-actions {
  flex-shrink: 0;
  gap: 12px;
}
.topbar-actions select {
  min-height: 36px;
  padding: 6px 9px;
  border-color: var(--line);
}
#session-actions:empty {
  display: none;
}
#session-actions button {
  min-height: 36px;
  padding: 6px 12px;
}
[hidden] {
  display: none !important;
}
body[data-mode="login"] .topbar,
body[data-mode="login"] main {
  margin-left: 0;
}
body[data-mode="login"] #page-context,
body[data-mode="login"] #open-navigation {
  display: none;
}
body[data-mode="login"] .topbar-brand {
  display: flex;
}
.login-logo {
  display: block;
  margin: 0 auto 24px;
  object-fit: contain;
}
.login h1 {
  text-align: center;
  margin-bottom: 32px;
  font-size: 22px;
}
.login .actions button {
  width: 100%;
}
body[data-mode="login"] #notice {
  max-width: 448px;
  margin: 0 auto;
}
@media (max-width: 1023px) {
  .topbar,
  main {
    margin-left: 0;
  }
  .topbar {
    padding: 0 20px;
  }
  #open-navigation,
  #close-navigation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .reader-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .topbar {
    padding: 0 16px;
    gap: 8px;
  }
  .topbar-context {
    gap: 8px;
  }
  #page-context {
    max-width: 110px;
    font-size: 12px;
  }
  .topbar-actions {
    gap: 6px;
  }
  #session-actions button {
    max-width: 90px;
    font-size: 12px;
  }
  .panel.login {
    margin: 24px auto;
    padding: 24px;
  }
  .brand {
    font-size: 19px;
  }
}
.table-wrap {
  overflow: auto;
  max-height: max(220px, calc(100dvh - 300px));
  scrollbar-gutter: stable;
  min-height: 220px;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 14px;
}
th {
  position: sticky;
  top: 0;
  background: var(--canvas);
  color: var(--muted);
  font-weight: 600;
}
th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
td {
  max-width: 280px;
  overflow-wrap: anywhere;
}
td button {
  font-size: 13px;
  padding: 6px 12px;
  min-height: 36px;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
}
.empty {
  padding: 44px 20px;
  color: var(--muted);
  text-align: center;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  width: min(580px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 28px;
  color: var(--ink);
  overflow-y: auto;
  box-shadow: 0 18px 80px #192d2526;
}
dialog::backdrop {
  background: #192d2570;
}
.checks {
  display: grid;
  gap: 10px;
  margin: 12px 0 20px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
}
.secret-output {
  min-height: 80px;
  font: 14px var(--font-data);
}
.skip {
  position: fixed;
  left: 20px;
  top: -80px;
  background: white;
  padding: 12px;
  z-index: 5;
}
.skip:focus {
  top: 10px;
}
@media (max-width: 760px) {
  .topbar {
    padding: 0 16px;
    height: 64px;
  }
  nav {
    gap: 12px;
  }
  .topbar-actions a {
    display: none;
  }
  main {
    padding: 24px 16px;
  }
  .reader-layout {
    grid-template-columns: 1fr;
  }
  .heading {
    flex-direction: column;
    gap: 10px;
  }
  .panel {
    padding: 20px;
  }
  .data-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .meta {
    grid-template-columns: minmax(0, 44%) minmax(0, 1fr);
  }
  .intro {
    margin: 24px auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    transition: none;
  }
}
@media (forced-colors: active) {
  * {
    scrollbar-color: auto;
  }
  button,
  .badge {
    border: 1px solid ButtonText;
  }
}
