:root {
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", sans-serif;
  color: #242424;
  background: #f4f5f6;
  font-size: 13px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
textarea {
  outline-offset: 3px;
}
button {
  cursor: pointer;
  border: 1px solid #e2e5e9;
  background: #fff;
  border-radius: 10px;
  min-height: 40px;
  padding: 0 16px;
  color: inherit;
  white-space: nowrap;
}
button:hover {
  background: #f1f3f5;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button.primary {
  background: #242424;
  color: white;
  border-color: #242424;
}
button.primary:hover {
  background: #404040;
}
button.danger {
  color: #b3473c;
}
button.small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}
input,
textarea {
  border: 1px solid #dfe2e7;
  border-radius: 10px;
  padding: 11px 12px;
  background: white;
  color: inherit;
  min-width: 0;
}
textarea {
  resize: vertical;
  line-height: 1.9;
}
input:focus,
textarea:focus {
  outline: 2px solid #d9e7fc;
  border-color: #8baee1;
}
a {
  color: #2679f4;
  text-decoration: none;
}
h1 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
  letter-spacing: -0.25px;
}
h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
p {
  line-height: 1.8;
}
small,
.muted {
  color: #737b88;
  font-size: 12px;
}
.shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 200px;
  flex: none;
  padding: 28px 14px 20px;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  margin-bottom: 38px;
}
.brand svg {
  filter: brightness(0);
  width: 72px;
  height: 22px;
  flex: none;
}
.brand-copy {
  border-left: 1px solid #d4d7dd;
  padding-left: 9px;
  font-weight: 600;
  line-height: 1.3;
}
.brand-copy small {
  display: block;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 1px;
  margin-top: 4px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav button {
  border: 0;
  background: none;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 14px;
}
.nav button.active {
  background: #e7e9ec;
  font-weight: 500;
}
.nav button.active svg {
  color: #2679f4;
}
.nav svg,
.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}
.nav-label {
  font-size: 11px;
  color: #858c96;
  padding: 26px 14px 10px;
}
.sidebar-foot {
  margin-top: auto;
  padding-top: 30px;
}
.identity {
  padding: 14px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 34px;
  height: 34px;
  background: white;
  border: 1px solid #e6e8ec;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
}
.identity strong {
  display: block;
  font-size: 12px;
}
.identity small {
  font-size: 10px;
}
.logout {
  width: 100%;
  background: none;
  border: 0;
  color: #737b88;
}
.panel {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 18px;
  margin: 10px 10px 10px 200px;
  min-width: 0;
  flex: 1;
  padding: 28px clamp(24px, 2.5vw, 40px);
  min-height: calc(100vh - 20px);
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 27px;
}
.page-head p {
  margin: 5px 0 0;
  color: #7c818d;
  font-size: 12px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f5f6f7;
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 11px;
  white-space: nowrap;
}
.dot {
  width: 6px;
  height: 6px;
  background: #9aa1aa;
  border-radius: 50%;
}
.dot.ready {
  background: #509174;
}
.dot.loading {
  background: #d6a34e;
}
.dot.error {
  background: #c46c65;
}
.translate-card {
  border: 1px solid #e4e7eb;
  border-radius: 14px;
  overflow: visible;
}
.language-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #e8eaed;
}
.language-side {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.language-side:first-child {
  border-right: 1px solid #e8eaed;
}
.editors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: clamp(370px, 56vh, 660px);
  min-height: 0;
}
.editor {
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
  min-height: 0;
}
.editor:first-child {
  border-right: 1px solid #e8eaed;
}
.editor textarea {
  border: 0;
  border-radius: 0;
  resize: none;
  padding: 24px;
  min-height: 0;
  flex: 1;
  background: transparent;
  outline: none;
  font-size: 14px;
}
.editor.result {
  background: #fafbfc;
  border-radius: 0 0 14px 0;
}
.output {
  padding: 24px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.9;
  font-size: 14px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.output.empty {
  color: #959da8;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 45px;
  padding: 8px 20px;
  color: #858c96;
  font-size: 11px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}
.actions .hint {
  flex: 1;
  color: #7c818d;
  font-size: 12px;
  line-height: 1.7;
}
.status-line {
  font-size: 12px;
  color: #737b88;
  min-height: 23px;
  margin-top: 18px;
}
.select {
  position: relative;
  display: inline-block;
  min-width: 136px;
}
.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 136px;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0 10px;
}
.select-trigger svg,
#swap svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: #737b88;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.select-trigger svg {
  transition: transform 0.15s ease;
}
.select-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
#swap {
  display: grid;
  place-items: center;
}
.output.streaming::after {
  content: "";
  display: inline-block;
  vertical-align: -0.1em;
  width: 2px;
  height: 1em;
  margin-left: 4px;
  background: #2679f4;
  animation: cursor-blink 0.9s step-end infinite;
}
.status-line.busy::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid #dce5ef;
  border-top-color: #2679f4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes cursor-blink {
  50% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .output.streaming::after,
  .status-line.busy::before {
    animation: none;
  }
  .select-trigger svg {
    transition: none;
  }
}
.select-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 5px);
  left: 0;
  background: #fff;
  border: 1px solid #e3e6eb;
  border-radius: 10px;
  box-shadow: 0 8px 28px #16202e12;
  padding: 5px;
  width: max-content;
  min-width: 170px;
  max-height: 280px;
  overflow: auto;
}
.select-menu button {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  font-size: 12px;
}
.select-menu button[aria-selected="true"] {
  background: #eff4fc;
  color: #2679f4;
}
.card {
  border: 1px solid #e6e9ed;
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 18px;
}
.card h2 {
  margin-bottom: 12px;
}
.card p {
  color: #737b88;
  font-size: 12px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
}
.field input {
  width: 100%;
}
.table-wrap {
  overflow: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
.table th {
  background: #f6f7f8;
  color: #7c818d;
  font-weight: 500;
  padding: 12px 14px;
  white-space: nowrap;
}
.table td {
  border-bottom: 1px solid #edf0f2;
  padding: 16px 14px;
  line-height: 1.8;
}
.table .preview {
  max-width: 350px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 7px;
  background: #f1f3f5;
  color: #697482;
}
.badge.completed {
  color: #4b8068;
  background: #eef7f1;
}
.badge.failed {
  color: #a95e54;
  background: #fcf0ec;
}
.badge.running,
.badge.queued {
  color: #9c7a31;
  background: #faf5e8;
}
.empty-list {
  text-align: center;
  color: #949ba5;
  padding: 70px 20px;
  font-size: 12px;
}
.code {
  background: #f5f6f7;
  border: 1px solid #e6e9ed;
  border-radius: 10px;
  padding: 16px;
  font:
    12px/1.8 Consolas,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.model-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.model-card {
  padding: 22px;
  border: 1px solid #e5e8ec;
  border-radius: 14px;
}
.model-card.selected {
  border-color: #91b3df;
  background: #f9fbfe;
}
.model-card h2 {
  font-size: 18px;
  margin: 10px 0;
}
.model-card p {
  font-size: 12px;
  color: #737b88;
  line-height: 1.8;
}
.model-card .row {
  margin-top: 22px;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-box {
  width: 380px;
  max-width: 100%;
  background: #fff;
  border: 1px solid #e5e8ec;
  border-radius: 18px;
  padding: 36px;
}
.login-box .brand {
  margin-bottom: 30px;
  padding: 0;
}
.login-box h1 {
  margin-bottom: 6px;
  font-size: 18px;
}
.login-box p {
  font-size: 12px;
  color: #7c818d;
  margin: 0 0 25px;
}
.login-box form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.login-box button {
  margin-top: 8px;
}
a.sso-button {
  display: block;
  margin-top: 8px;
  padding: 11px 16px;
  border-radius: 10px;
  background: #242424;
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
a.sso-button:hover {
  background: #404040;
}
.error-text {
  color: #ad574d;
  font-size: 12px;
  line-height: 1.7;
  min-height: 18px;
}
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 200px;
  color: #7c818d;
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #e4e7eb;
  border-top-color: #747f8e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #292d32;
  color: white;
  border-radius: 10px;
  padding: 12px 20px;
  z-index: 100;
  max-width: 90vw;
  display: none;
  line-height: 1.6;
}
dialog {
  border: 1px solid #e3e6eb;
  border-radius: 18px;
  padding: 28px;
  width: 480px;
  max-width: calc(100% - 30px);
  box-shadow: 0 20px 80px #0002;
}
dialog::backdrop {
  background: #161c2638;
}
dialog h2 {
  font-size: 17px;
  margin-bottom: 22px;
}
dialog .row {
  justify-content: flex-end;
  margin-top: 22px;
}
.subtle-note {
  margin-top: 24px;
  font-size: 11px;
  color: #8b929d;
}
.stats {
  display: flex;
  gap: 24px;
  padding: 15px 0;
  color: #737b88;
  font-size: 12px;
}
.stats strong {
  color: #303741;
  font-weight: 600;
}
.section-width {
  max-width: 850px;
}
.account-form {
  max-width: 430px;
}
.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
  align-items: center;
  font-size: 12px;
  color: #7c818d;
}
.inline-error {
  background: #fcf1ed;
  border: 1px solid #f1d9d1;
  color: #9f5547;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 12px;
}
.quiet-button {
  border: 0;
  background: transparent;
  color: #737b88;
  min-height: 30px;
  padding: 0 8px;
}
.hidden {
  display: none !important;
}
@media (min-width: 1500px) {
  .editors {
    min-height: 440px;
  }
}
@media (max-width: 800px) {
  .sidebar {
    width: 150px;
    padding: 24px 8px;
  }
  .brand {
    padding: 0 4px;
    gap: 6px;
  }
  .brand svg {
    width: 60px;
  }
  .brand-copy {
    font-size: 12px;
  }
  .panel {
    margin-left: 150px;
    padding: 24px 18px;
  }
  .editors {
    grid-template-columns: 1fr;
    height: auto;
  }
  .editor:first-child {
    border-right: 0;
    border-bottom: 1px solid #e8eaed;
  }
  .editor textarea {
    min-height: 220px;
    height: 240px;
    flex: auto;
  }
  .output {
    min-height: 220px;
    height: 260px;
    flex: auto;
  }
  .model-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 540px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    width: auto;
    padding: 16px;
  }
  .brand {
    margin-bottom: 18px;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nav button {
    padding: 0 10px;
    min-height: 36px;
  }
  .nav-label,
  .sidebar-foot {
    display: none;
  }
  .panel {
    margin: 0 8px 8px;
    min-height: 80vh;
    padding: 20px 14px;
  }
  .page-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .language-side {
    padding: 9px 5px;
  }
  .select-trigger {
    min-width: 120px;
  }
  .actions {
    flex-wrap: wrap;
  }
  .actions .hint {
    flex-basis: 100%;
  }
  .sidebar .nav svg {
    width: 16px;
  }
  .page-head h1 {
    font-size: 19px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}
:root {
  color-scheme: light;
}
@media (max-width: 540px) {
  .sidebar-foot {
    display: flex !important;
    margin-top: 10px;
    padding: 0;
  }
  .sidebar-foot .identity {
    display: none;
  }
  .sidebar-foot .logout {
    width: auto;
    min-height: 32px;
    margin-left: auto;
    font-size: 12px;
  }
}
