* {
  box-sizing: border-box;
}
html {
  color-scheme: dark;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font:
    15px/1.6 Inter,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
}
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
select {
  cursor: pointer;
}
button,
input,
textarea,
select {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 7px 13px;
}
button:hover {
  border-color: var(--brand);
  background: var(--wash);
}
button.primary,
#add,
button.active {
  background: var(--brand);
  color: var(--on);
  border-color: var(--brand);
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #679dff;
  outline-offset: 3px;
}
input {
  min-width: 0;
}
input:not([type="checkbox"]),
textarea {
  width: 100%;
}
input[type="checkbox"] {
  accent-color: var(--brand);
}
fieldset {
  margin: 18px 0;
  border: 0;
  padding: 0;
}
legend,
label {
  font-size: 14px;
  font-weight: 560;
}
fieldset label {
  padding: 7px 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
input + label {
  margin-top: 12px;
}
label:not(fieldset label) {
  display: block;
  margin-bottom: 5px;
}
.actions,
.tools,
.setup-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.tools,
.setup-bar {
  justify-content: space-between;
}
.tools {
  margin-bottom: 18px;
}
header {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 clamp(20px, 4vw, 68px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.logo {
  width: 25px;
  height: 27px;
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  transform: skewY(-13deg);
}
.logo i {
  height: 70%;
  background: var(--brand);
}
.logo i:nth-child(2) {
  height: 97%;
}
.logo i:nth-child(3) {
  height: 83%;
}
header b {
  font-size: 21px;
  letter-spacing: -1.3px;
}
header small {
  border-left: 1px solid var(--line);
  padding-left: 13px;
}
#identity {
  margin-left: auto;
  font-size: 13px;
}
#logout {
  font-size: 12px;
  padding: 4px 10px;
}
main {
  max-width: 1480px;
  margin: 0 auto;
  padding: 30px clamp(18px, 4.6vw, 72px) 78px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(30px, 3.4vw, 54px);
  line-height: 1.2;
  letter-spacing: -0.055em;
  font-weight: 670;
}
h2 {
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: -0.03em;
}
h3 {
  font-size: 17px;
  margin: 18px 0 9px;
}
small,
.sub,
.hint {
  color: var(--muted);
}
.hero {
  position: relative;
  overflow: hidden;
  padding: 28px 28px 28px 32px;
  background: var(--paper);
  isolation: isolate;
}
.hero p {
  margin-top: 9px;
  font-size: 14px;
}
.hero section {
  position: relative;
  z-index: 2;
}
.art {
  position: absolute;
  right: 8%;
  top: 50%;
  width: 118px;
  height: 92px;
  transform: translateY(-36%) rotate(-30deg) skewX(31deg);
  z-index: -1;
}
.art i {
  position: absolute;
  inset: 0;
  background: var(--paper);
  border: 1.5px solid var(--brand);
  box-shadow: 3px 3px 0 var(--wash);
  transform: translate(calc(var(--i) * 5px), calc(var(--i) * -8px));
}
.art i:last-child {
  background:
    repeating-linear-gradient(0deg, transparent 0 9px, #89a2ef 10px 11px),
    #cad8fc;
}
.tabs {
  display: flex;
  gap: 4px;
  margin: 18px 0;
}
.tabs:empty {
  display: none;
}
.grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
}
.grid:has(#roster[hidden]) {
  display: none;
}
#roster,
#detail,
#tools,
#login {
  background: var(--paper);
  padding: 22px;
  border: 1px solid var(--line);
  min-width: 0;
}
#heading {
  margin-bottom: 16px;
}
#personal {
  margin-top: 18px;
}
#filter {
  background: var(--panel);
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px 6px;
  font-size: 14px;
}
th {
  color: var(--muted);
  font-size: 12px;
}
td button {
  font-size: 12px;
  padding: 3px 8px;
}
.selected {
  background: var(--wash);
}
.agent-setup {
  padding-top: 18px;
}
.agent-setup > p {
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0 16px;
}
.setup-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}
.setup-bar {
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}
.setup-bar b {
  font-size: 13px;
}
.setup-bar button {
  font-size: 13px;
  padding: 7px 12px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  font:
    14px/1.8 "IBM Plex Mono",
    Menlo,
    "PingFang SC",
    monospace;
}
pre code {
  font: inherit;
}
.setup-block pre,
details pre {
  padding: 15px 18px;
}
details {
  margin-top: 12px;
  font-size: 13px;
}
summary {
  cursor: pointer;
  width: fit-content;
}
details p {
  margin: 10px 0;
}
.document-row,
.identity,
.history li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.document-row small {
  margin-left: 12px;
}
.danger,
.off {
  color: #a1393e;
}
.history {
  margin: 4px 0;
  padding: 0;
  list-style: none;
}
.history span,
.history small {
  display: block;
}
dialog {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand);
  border-radius: var(--radius);
  max-width: min(460px, 90vw);
  padding: 26px;
  box-shadow: 0 16px 70px #1116;
}
dialog::backdrop {
  background: #101a2c77;
}
dialog h2,
dialog p,
dialog .actions {
  margin: 10px 0;
}
#status:not(:empty) {
  background: var(--wash);
  border-left: 3px solid var(--brand);
  padding: 8px 18px;
  margin-bottom: 12px;
}
#login {
  max-width: 440px;
  margin: 9vh auto;
}
#login h1 {
  font-size: 36px;
  margin-bottom: 24px;
}
#login button {
  width: 100%;
  margin-top: 16px;
}
.net {
  font:
    12px Menlo,
    monospace;
  letter-spacing: 0;
  color: var(--muted);
}
.tabs button {
  font-size: 13px;
}
.setup-notice:empty {
  display: none;
}
body.dark {
  color-scheme: dark;
  --paper: #20282f;
  --bg: #151b20;
  --ink: #f1f1e9;
  --muted: #abb8c1;
  --line: #43505a;
  --wash: #323f48;
  --brand: #e8bb70;
  --on: #231c12;
  --panel: #182026;
  --radius: 3px;
}
body.dark header {
  height: 68px;
  background: var(--bg);
}
body.dark .hero {
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding: 10px 0 25px;
}
body.dark h1 {
  font-size: clamp(30px, 3vw, 44px);
}
body.dark .art {
  height: 64px;
  width: 94px;
  right: 5%;
}
body.dark .art i {
  background: #273138;
  border-color: #80929b;
  box-shadow: none;
}
body.dark .art i:last-child {
  background: repeating-linear-gradient(90deg, #475058 0 3px, #273138 4px 7px);
  border-color: var(--brand);
}
body.dark #tools {
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
body.dark #tools > h2 {
  grid-column: 1/-1;
  margin: 18px 0;
}
body.dark #tools > .actions {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: stretch;
  padding: 10px 18px 0 0;
}
body.dark #tools > .actions button {
  text-align: left;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  padding: 11px 12px;
  color: var(--muted);
}
body.dark #tools > .actions button.chosen {
  border-left-color: var(--brand);
  color: var(--ink);
  background: var(--wash);
}
body.dark #tools > .actions + div {
  padding: 22px 24px;
  background: var(--paper);
  border-left: 1px solid var(--line);
  min-width: 0;
}
body.dark .agent-setup {
  padding: 0;
}
body.dark .setup-bar {
  background: #29343c;
}
body.dark .grid {
  grid-template-columns: 1.6fr 1fr;
}
body.dark #roster {
  border: 0;
  padding-left: 0;
  background: transparent;
}
body.dark #detail {
  border: 0;
  border-left: 2px solid var(--brand);
}
body.dark .danger,
body.dark .off {
  color: #ffb7ac;
}
@media (max-width: 760px) {
  main {
    padding: 20px 14px 72px;
  }
  header {
    padding: 0 14px;
    height: 55px;
    gap: 8px;
  }
  header b {
    font-size: 18px;
  }
  header small,
  .net {
    display: none;
  }
  .art {
    opacity: 0.42;
    right: -30px;
  }
  .hero {
    padding: 20px 14px;
  }
  .grid,
  body.dark .grid {
    grid-template-columns: 1fr;
  }
  body.dark #tools {
    display: block;
  }
  body.dark #tools > .actions {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0 0 12px;
  }
  body.dark #tools > .actions + div {
    padding: 16px;
  }
  .setup-bar {
    padding: 8px;
  }
  input,
  select,
  textarea {
    max-width: 100%;
  }
  td,
  th {
    padding: 7px 3px;
  }
  #identity {
    font-size: 11px;
  }
  h2 {
    font-size: 20px;
  }
}
header b {
  letter-spacing: 0;
  font-size: 17px;
}
body:has(#login:not([hidden])) header {
  display: none;
}
body:has(#login:not([hidden])) main {
  max-width: none;
  padding: 0;
}
#login:not([hidden]) {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  margin: 0;
  max-width: none;
  padding: 0;
  border: 0;
  min-height: 100svh;
}
.shelf-identity {
  padding: clamp(34px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.shelf-symbol {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 26px;
}
.shelf-symbol i {
  display: block;
  height: 22px;
  width: 7px;
  background: var(--brand);
}
.shelf-symbol i:nth-child(3) {
  transform: rotate(-17deg);
  margin-left: 4px;
  height: 27px;
}
.shelf-identity h1 {
  font:
    500 clamp(28px, 3.5vw, 54px)/1.4 "Songti SC",
    "STSong",
    serif;
  letter-spacing: 0.025em;
  margin: 25px 0;
}
.shelf-identity h1 span {
  display: block;
}
.bookrow {
  height: 150px;
  display: flex;
  align-items: end;
  gap: 4px;
  max-width: 390px;
  border-bottom: 3px solid var(--line);
  margin: 10px 0;
}
.bookrow i {
  position: relative;
  width: 20%;
  height: 81%;
  border: 1px solid var(--muted);
  border-radius: 3px 5px 0 0;
  background: linear-gradient(
    90deg,
    var(--panel),
    var(--wash) 10%,
    var(--paper) 12%
  );
}
.bookrow i:nth-child(2) {
  height: 98%;
  width: 23%;
}
.bookrow i:nth-child(3) {
  height: 68%;
}
.bookrow i:last-child {
  height: 88%;
  transform: rotate(-13deg);
  transform-origin: right bottom;
  margin-left: 6%;
}
.bookrow i:before {
  content: "";
  position: absolute;
  top: 13%;
  left: 22%;
  width: 50%;
  height: 22%;
  border: 3px double var(--brand);
}
.bookrow i:after {
  content: "";
  position: absolute;
  bottom: 14%;
  left: 20%;
  width: 60%;
  height: 4%;
  border-block: 1px solid var(--muted);
}
.sign {
  align-self: center;
  max-width: 450px;
  width: 100%;
  margin: auto;
  padding: 32px;
}
.sign h2 {
  font-size: 29px;
}
.sign .hint {
  font-size: 12px;
  margin: 10px 0 18px;
}
body:has(#login:not([hidden])) #status:not(:empty) {
  position: absolute;
  right: 5%;
  top: 2em;
}
@media (max-width: 760px) {
  header b {
    font-size: 14px;
  }
  .shelf-identity {
    padding: 23px 24px;
    min-height: 190px;
  }
  .bookrow {
    height: 50px;
    width: 120px;
    align-self: end;
    margin-top: -58px;
  }
  .shelf-identity h1 {
    font-size: 26px !important;
  }
  .shelf-symbol {
    height: 20px;
  }
  .shelf-symbol i {
    height: 14px;
  }
  .shelf-symbol i:last-child {
    height: 18px;
  }
  #login:not([hidden]) {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    padding-bottom: 45px;
  }
  .sign {
    padding: 24px;
  }
  .shelf-identity h1 {
    margin: 20px 0 8px;
  }
  body:has(#login:not([hidden])) #status:not(:empty) {
    position: static;
  }
}
.bookrow i:last-child {
  transform-origin: left bottom;
}
.art i:nth-child(1) {
  --i: 0;
}
.art i:nth-child(2) {
  --i: 1;
}
.art i:nth-child(3) {
  --i: 2;
}
.art i:nth-child(4) {
  --i: 3;
}
.art i:nth-child(5) {
  --i: 4;
}
table {
  overflow-wrap: anywhere;
}
#rows {
  overflow-x: auto;
}
.sign h2 {
  margin-bottom: 20px;
}
.art {
  pointer-events: none;
}
@media (max-width: 760px) {
  header {
    height: auto;
    min-height: 55px;
    flex-wrap: wrap;
  }
  header b {
    letter-spacing: 0;
  }
  #identity {
    overflow-wrap: anywhere;
  }
  .sign {
    align-self: start;
  }
}
