:root {
  color: #171a1f;
  background: #f4f6f8;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
}

.grid-bg {
  background-color: #eef6f6;
  background-image:
    linear-gradient(rgba(20, 117, 111, .1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 117, 111, .1) 1px, transparent 1px);
  background-size: 42px 42px;
}

.docs-bg {
  background: #f5f7f9;
}

.docs-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 24px;
}

.docs-hero {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid #dce5ea;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbfc);
}

.docs-hero h1 {
  font-size: 32px;
}

.docs-hero p {
  max-width: 760px;
  color: #52606f;
  line-height: 1.7;
}

.docs-card {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 18px;
  border: 1px solid #d4e1e6;
  border-radius: 8px;
  background: #ffffff;
}

.docs-card span {
  color: #637178;
  font-size: 13px;
}

.docs-card code {
  color: #007a70;
  font-size: 16px;
  font-weight: 700;
}

.docs-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: start;
}

.docs-nav {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 8px;
}

.docs-nav a {
  padding: 8px 10px;
  border-radius: 8px;
  color: #334255;
}

.docs-nav a:hover {
  background: #edf5f5;
  color: #007a70;
}

.docs-content h2 {
  margin-bottom: 12px;
  font-size: 22px;
}

.docs-content h3 {
  margin: 18px 0 8px;
  font-size: 16px;
}

.docs-content p {
  color: #52606f;
  line-height: 1.7;
}

.docs-content pre {
  border: 1px solid #233142;
  background: #101820;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.flow-steps div {
  min-height: 100px;
  padding: 14px;
  border: 1px solid #d4e1e6;
  border-radius: 8px;
  background: #f8fbfc;
}

.flow-steps strong,
.flow-steps span {
  display: block;
}

.flow-steps strong {
  margin-bottom: 8px;
  color: #007a70;
}

.flow-steps span {
  color: #5d6b75;
  font-size: 13px;
  line-height: 1.5;
}

.wide-shell {
  max-width: 1420px;
  margin: 0 auto;
  padding: 28px 24px;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: #0a66c2;
  text-decoration: none;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.studio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: white;
  background: #0f4c81;
  font-weight: 700;
}

.grid-bg .mark {
  color: #007a70;
  background: #e8f6f4;
  border: 1px solid #bddbd7;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 24px;
  line-height: 1.2;
}

.muted {
  color: #657180;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button,
.button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: #0f4c81;
  cursor: pointer;
}

button.secondary,
.button.secondary {
  color: #1d2733;
  background: #e6ebf0;
}

button.danger {
  background: #a33a35;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.panel {
  border: 1px solid #dce2e8;
  border-radius: 8px;
  background: white;
}

.panel-pad {
  padding: 16px;
}

.metric {
  min-height: 96px;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.metric-box {
  min-height: 102px;
}

.metric-box span {
  display: block;
  color: #53666b;
}

.metric-box strong {
  display: block;
  margin-top: 8px;
  color: #007a70;
  font-size: 22px;
}

.metric-box .mini {
  width: 100%;
  margin-top: 10px;
}

.api-key-box {
  min-width: 0;
  grid-column: span 2;
}

.key-value {
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  padding: 0 9px;
  border: 1px solid #cfdbe2;
  border-radius: 8px;
  color: #0c766b;
  background: #f8fcfb;
  font-size: 13px;
  white-space: nowrap;
}

.key-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.key-actions .mini {
  margin-top: 10px;
}

.mono {
  font-family: "Cascadia Mono", Consolas, monospace;
}

.quickbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.active-tab {
  color: #007a70 !important;
  background: #e7f7f4 !important;
  border: 1px solid #62b8af;
}

.form-panel,
.records-panel {
  border-color: #86c8c0;
}

.section-kicker {
  margin-bottom: 10px;
  color: #007a70;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}

.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid #c7dadd;
  border-radius: 8px;
  background: #f5faf9;
}

.toggle-row input {
  width: 20px;
  min-height: 20px;
  accent-color: #098478;
}

.toggle-row small {
  display: block;
  margin-top: 5px;
  color: #637178;
}

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 96px;
  padding: 18px;
  border: 1px dashed #9fc9c5;
  border-radius: 8px;
  background: #f8fcfb;
  text-align: center;
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-zone.dragging {
  background: #e8f7f4;
}

.upload-icon {
  color: #098478;
  font-size: 30px;
  line-height: 1;
}

.asset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.asset-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 84px;
  padding: 6px;
  border: 1px solid #c7dadd;
  border-radius: 8px;
  background: #f8fcfb;
}

.asset-thumb {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  overflow: hidden;
  border-radius: 6px;
  background: #e6f0ef;
}

.asset-thumb img,
.asset-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #0b756c;
  font-size: 12px;
  font-weight: 800;
}

.asset-card strong {
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e7f4f1;
  color: #0b756c;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
}

.asset-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 1;
  width: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 999px;
  border-color: #c6d8d8;
  background: rgba(255, 255, 255, .94);
  color: #22313a;
  line-height: 1;
}

.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #dce8e9;
}

.submit-row strong {
  display: block;
  margin-top: 4px;
  color: #b26a00;
}

.record-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.records-list {
  display: grid;
  gap: 16px;
}

.record-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 12px;
  border: 1px solid #91c9c3;
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
}

.record-card h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #667780;
  font-size: 13px;
}

.progress-line {
  height: 5px;
  margin: 12px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #d9e7e5;
}

.progress-line span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0b8678, #9a6200);
}

.link-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.link-row div {
  padding: 10px;
  border: 1px solid #d1e2e3;
  border-radius: 8px;
  background: #f6fbfa;
}

.link-row small,
.link-row strong {
  display: block;
}

.record-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(58px, 1fr));
  gap: 8px;
  align-content: start;
}

.record-actions button,
.record-actions .button {
  min-height: 80px;
  padding: 0 8px;
  color: #132126;
  font-weight: 700;
  text-align: center;
}

.task-dialog {
  width: min(720px, calc(100vw - 28px));
  border: 1px solid #91c9c3;
  border-radius: 8px;
}

.task-dialog::backdrop {
  background: rgba(0, 0, 0, .28);
}

.event-list {
  display: grid;
  gap: 10px;
}

.event-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #d1e2e3;
  border-radius: 8px;
  background: #f7fbfa;
}

.event-item span {
  color: #667780;
  font-size: 12px;
}

.event-item p {
  margin: 0;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.columns {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  margin-top: 14px;
}

.console-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  align-items: start;
}

.creator-panel {
  position: sticky;
  top: 16px;
}

.works-panel {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-head h2 {
  margin-bottom: 4px;
}

.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stack {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #394452;
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #ccd5de;
  border-radius: 8px;
  padding: 8px 10px;
  color: #171a1f;
  background: white;
  outline: 0;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #0f4c81;
  box-shadow: 0 0 0 3px rgba(15, 76, 129, .12);
}

.table-wrap {
  overflow: auto;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
}

.task-card {
  overflow: hidden;
  border: 1px solid #dce2e8;
  border-radius: 8px;
  background: #ffffff;
}

.task-video {
  display: grid;
  place-items: center;
  aspect-ratio: 9 / 16;
  max-height: 420px;
  background: #10151b;
}

.task-video video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.task-empty {
  padding: 20px;
  color: #d6dee8;
  text-align: center;
}

.task-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.task-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.prompt-snippet {
  margin: 0;
  color: #52606f;
  font-size: 13px;
  line-height: 1.45;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.task-actions a,
.task-actions button {
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  border-radius: 8px;
  font-size: 13px;
}

.task-actions a {
  color: white;
  background: #0f4c81;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #e7ebef;
  text-align: left;
  vertical-align: top;
}

th {
  color: #556171;
  background: #f8fafb;
  font-weight: 600;
}

code,
pre {
  font-family: "Cascadia Mono", Consolas, monospace;
}

pre {
  overflow: auto;
  padding: 14px;
  border-radius: 8px;
  color: #eef5ff;
  background: #151b22;
  line-height: 1.5;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8eef5;
  color: #334255;
  font-size: 12px;
}

.pill.running,
.pill.queued {
  background: #fff3cc;
  color: #71530b;
}

.pill.succeeded {
  background: #dff4e8;
  color: #145c38;
}

.pill.failed,
.pill.canceled {
  background: #fde3df;
  color: #84322c;
}

.notice {
  padding: 12px 14px;
  border: 1px solid #cfe0ef;
  border-radius: 8px;
  background: #eef6ff;
}

.subtle {
  color: #52606f;
  background: #f7fafc;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 26px;
  color: #657180;
  text-align: center;
}

.login {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 18px;
}

.login-card {
  width: min(100%, 380px);
}

.login-brand {
  margin-bottom: 18px;
}

.login form button {
  width: 100%;
}

@media (max-width: 880px) {
  .grid,
  .columns,
  .console-layout,
  .metric-row,
  .form-grid-4,
  .form-grid-3,
  .record-card,
  .link-row,
  .docs-hero,
  .docs-grid,
  .flow-steps {
    grid-template-columns: 1fr;
  }

  .creator-panel {
    position: static;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .quickbar,
  .studio-head,
  .submit-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .record-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .docs-nav {
    position: static;
  }
}

@media (max-width: 520px) {
  .shell {
    padding: 14px;
  }

  .two-fields,
  .task-actions {
    grid-template-columns: 1fr;
  }

  .task-grid {
    grid-template-columns: 1fr;
    padding: 0 12px 12px;
  }
}
