:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  color: #e4eeef;
  background: #0c141a;
  font-synthesis: none;
  font-size: 14px;
  --line: #293941;
  --muted: #90a6b1;
  --accent: #62d9c6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--accent);
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #3e625e;
  border-radius: 8px;
  background: #164d46;
  color: #e6fff8;
  min-height: 39px;
  padding: 8px 15px;
  cursor: pointer;
  white-space: nowrap;
}
button:hover,
.button:hover {
  background: #216158;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.secondary,
.button.secondary {
  background: #18262e;
  border-color: var(--line);
  color: #ccdbe1;
}
button.danger {
  background: #572c32;
  border-color: #87434d;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #354853;
  background: #101c24;
  color: #edf5f7;
  border-radius: 7px;
  padding: 10px 12px;
  min-height: 41px;
}
textarea {
  resize: vertical;
  line-height: 1.6;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #4cb9a8;
  outline-offset: 1px;
}
label {
  display: grid;
  gap: 7px;
  color: #a8bdc7;
  font-size: 13px;
}
header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0 4vw;
  background: #101c23;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f4fffc;
  font-weight: 750;
  font-size: 23px;
  letter-spacing: 1px;
}
.mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: #63dbc3;
  color: #102e2b;
  border-radius: 10px;
  font-size: 24px;
}
.subbrand {
  font-size: 12px;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 400;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
nav,
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
nav a {
  color: #aac1ca;
}
main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 36px 4vw 60px;
}
h1 {
  font-size: 31px;
  letter-spacing: -0.5px;
  margin: 0 0 12px;
}
h2 {
  font-size: 19px;
  margin: 0 0 18px;
}
h3 {
  font-size: 15px;
  margin: 0 0 12px;
}
p {
  line-height: 1.7;
  color: #a3bac5;
}
small,
.muted {
  color: var(--muted);
  line-height: 1.6;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}
.eyebrow {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 12px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 23px;
  background: linear-gradient(145deg, #16262f, #111f27);
}
.card h2 {
  line-height: 1.4;
}
.study-card {
  display: flex;
  flex-direction: column;
  min-height: 215px;
}
.study-card .row {
  margin-top: auto;
  padding-top: 18px;
}
.study-card p {
  margin: 0 0 16px;
}
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: #9cd8ca;
  border: 1px solid #34594f;
  border-radius: 5px;
  padding: 3px 7px;
  width: max-content;
}
.empty {
  padding: 55px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.auth {
  max-width: 440px;
  margin: 7vh auto;
}
.auth h1 {
  font-size: 27px;
}
.form {
  display: grid;
  gap: 18px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.full {
  grid-column: 1/-1;
}
.notice {
  border-left: 3px solid #7abdb1;
  padding: 12px 16px;
  background: #172d31;
  color: #b9d6d9;
  line-height: 1.7;
  margin: 0 0 20px;
}
.error {
  color: #f5a5ac;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.6;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(340px, 0.86fr);
  gap: 22px;
  align-items: start;
}
.stack {
  display: grid;
  gap: 20px;
}
.chat {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 20px;
  height: min(780px, calc(100vh - 125px));
  min-height: 500px;
}
.chatlog {
  flex: 1;
  overflow: auto;
  padding-right: 5px;
  min-height: 180px;
  scrollbar-width: thin;
}
.message {
  padding: 13px 15px;
  border-radius: 10px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-bottom: 13px;
  background: #1b303a;
}
.message.user {
  background: #19483f;
  margin-left: 25px;
}
.message.system {
  background: transparent;
  color: #7fa69f;
  font-size: 12px;
  padding: 7px 3px;
}
.message.error {
  border: 1px solid #76444a;
  color: #efadb2;
}
.chat form {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}
.chat .row {
  justify-content: space-between;
}
.job {
  border-top: 1px solid var(--line);
  padding: 12px 0;
  display: grid;
  gap: 6px;
}
.job .row {
  justify-content: space-between;
}
.job pre {
  max-height: 140px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 11px;
  color: #edabb4;
}
.status.completed {
  color: #8de2bb;
}
.status.failed,
.status.interrupted {
  color: #f3a3a9;
}
.status.running,
.status.queued {
  color: #eed29c;
}
.toolbar {
  margin: 16px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.toolbar button,
.toolbar a {
  font-size: 12px;
  min-height: 33px;
  padding: 6px 10px;
}
details {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
summary {
  cursor: pointer;
  margin-bottom: 14px;
  color: #b3d7d0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
td,
th {
  text-align: left;
  padding: 12px 7px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  color: var(--muted);
  font-weight: 400;
}
.table-wrap {
  overflow: auto;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  border: 1px solid #4b7971;
  padding: 13px 22px;
  background: #183b36;
  z-index: 1000;
  border-radius: 9px;
  box-shadow: 0 6px 40px #0007;
  display: none;
}
dialog {
  background: #15252e;
  color: #e0edf0;
  border: 1px solid #38545e;
  border-radius: 13px;
  padding: 28px;
  width: min(650px, 92vw);
  max-height: 90vh;
}
dialog::backdrop {
  background: #0009;
}
dialog .close {
  float: right;
  background: none;
  border: none;
  min-height: 28px;
  padding: 0 5px;
  font-size: 22px;
}
code {
  word-break: break-all;
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
}
.help {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.warning {
  color: #e8cc94;
}
.metrics {
  display: flex;
  gap: 24px;
  padding: 10px 0;
}
.metrics strong {
  display: block;
  font-size: 22px;
  color: #e4f7f1;
}
.metrics span {
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .chat {
    position: static;
    height: 620px;
  }
  .subbrand {
    display: none;
  }
  header {
    padding: 0 20px;
  }
  main {
    padding: 25px 20px 45px;
  }
  .intro {
    align-items: flex-start;
  }
  h1 {
    font-size: 26px;
  }
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}
@media (max-width: 520px) {
  .fields {
    grid-template-columns: 1fr;
  }
  .intro {
    flex-direction: column;
    gap: 12px;
  }
  .card {
    padding: 18px;
  }
  .brand {
    font-size: 20px;
    gap: 8px;
  }
  nav {
    gap: 12px;
    font-size: 12px;
  }
  nav button {
    padding: 6px 9px;
    min-height: 30px;
  }
  .auth {
    margin-top: 4vh;
  }
  .workspace {
    display: block;
  }
  .workspace > .stack {
    margin-bottom: 20px;
  }
  h1 {
    font-size: 24px;
  }
  .metrics {
    gap: 16px;
  }
}
