:root {
  color-scheme: dark;
  --bg: #071015;
  --bg-2: #0a141a;
  --panel: #111d25;
  --panel-2: #0e1920;
  --panel-3: #14222b;
  --line: #233742;
  --line-soft: #1a2a33;
  --text: #dce8ed;
  --muted: #8198a4;
  --muted-2: #5f737e;
  --green: #5ee0b5;
  --green-2: #20c997;
  --cyan: #2dd4bf;
  --blue: #5aa7ff;
  --yellow: #ffad42;
  --red: #ff6b6b;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  color: var(--text);
  background: radial-gradient(circle at 50% -20%, rgba(45, 212, 191, 0.12), transparent 34%), var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 13px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: var(--green);
  text-decoration: none;
}

label {
  display: grid;
  gap: 6px;
  color: #b6cad3;
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 9px;
  color: var(--text);
  background: #0c171e;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input::placeholder,
textarea::placeholder {
  color: #6f8792;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(94, 224, 181, 0.75);
  box-shadow: 0 0 0 2px rgba(94, 224, 181, 0.12);
}

input[type="file"]::file-selector-button {
  min-height: 27px;
  margin-right: 10px;
  border: 1px solid rgba(94, 224, 181, 0.38);
  border-radius: 4px;
  padding: 4px 9px;
  color: #dffff6;
  background: rgba(94, 224, 181, 0.12);
  font-weight: 800;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 11px;
  color: var(--text);
  background: #12212a;
  cursor: pointer;
}

button:hover {
  border-color: rgba(94, 224, 181, 0.4);
  background: #172a34;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button svg {
  width: 15px;
  height: 15px;
}

.primary {
  border-color: rgba(94, 224, 181, 0.75);
  color: #032019;
  background: linear-gradient(90deg, #5ee0b5, #29c7a2);
  font-weight: 900;
}

.danger {
  border-color: rgba(255, 107, 107, 0.4);
  color: #ffd1d1;
}

.icon-btn {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.login-box {
  display: grid;
  gap: 15px;
  width: 420px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 24px;
  background: rgba(17, 29, 37, 0.96);
  box-shadow: var(--shadow);
}

.login-brand,
.product-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(94, 224, 181, 0.55);
  border-radius: 4px;
  color: var(--green);
  background: rgba(94, 224, 181, 0.1);
  font-weight: 900;
}

.brand-mark.small {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

.login-brand h1 {
  font-size: 20px;
}

.login-brand p,
.login-box p {
  color: var(--muted);
}

.ops-shell {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  grid-template-rows: 48px minmax(0, 1fr);
  min-height: 100vh;
}

.global-topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line-soft);
  border-left: 0;
  border-right: 0;
  padding: 0 14px;
  background: rgba(12, 22, 28, 0.96);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.product-title strong {
  font-size: 14px;
}

.top-status {
  display: flex;
  justify-content: flex-end;
  gap: 28px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.top-status b {
  color: var(--text);
}

.state-dot {
  position: relative;
  padding-left: 13px;
  color: var(--green) !important;
}

.state-dot::before {
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--green);
  content: "";
  transform: translateY(-50%);
}

.state-dot.paused {
  color: var(--yellow) !important;
}

.state-dot.paused::before {
  background: var(--yellow);
}

.top-actions,
.panel-actions,
.history-actions,
.form-actions,
.pager,
.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-btn {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.side-nav {
  border-right: 1px solid var(--line-soft);
  padding: 24px 10px;
  background: #081218;
}

.menu {
  display: grid;
  gap: 7px;
}

.menu-item {
  justify-content: flex-start;
  min-height: 36px;
  border-color: transparent;
  color: #b7c7ce;
  background: transparent;
}

.menu-item:hover,
.menu-item.active {
  border-color: rgba(94, 224, 181, 0.24);
  color: var(--green);
  background: rgba(94, 224, 181, 0.12);
}

.ops-main {
  min-width: 0;
  padding: 15px 16px 22px;
}

.page-heading {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(17, 29, 37, 0.94);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border-bottom: 1px solid var(--line-soft);
  padding: 0 14px;
}

.panel-head h3 {
  font-size: 15px;
}

.overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 12px;
}

.wide-panel {
  min-height: 210px;
}

.compact-panel {
  min-height: 210px;
}

.ring-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.ring-card {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px;
  background: #10202a;
}

.ring-card h4 {
  margin-bottom: 10px;
  font-size: 14px;
}

.ring-card p,
.mini-stats {
  color: var(--muted);
  font-size: 12px;
}

.mini-stats {
  display: flex;
  gap: 18px;
  margin-top: 12px;
}

.ring {
  display: grid;
  width: 116px;
  height: 116px;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, #10202a 0 55%, transparent 56%),
    conic-gradient(var(--ring-color) var(--pct), #2b3a41 0);
}

.ring-browser {
  --ring-color: var(--green);
}

.ring-http {
  --ring-color: var(--yellow);
}

.ring strong {
  color: var(--ring-color);
  font-size: 24px;
}

.ring span {
  margin-top: -42px;
  color: var(--muted);
  font-size: 12px;
}

.status-list,
.failure-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.status-row,
.failure-row {
  display: grid;
  grid-template-columns: 1fr 52px 52px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.status-row b,
.failure-row b {
  color: var(--text);
  text-align: right;
}

.status-row em {
  color: var(--muted-2);
  font-style: normal;
  text-align: right;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--muted);
}

.status-dot.queued,
.pill.queued {
  --pill-color: var(--blue);
}

.status-dot.running,
.pill.running {
  --pill-color: var(--green);
}

.status-dot.submitted,
.pill.submitted {
  --pill-color: var(--yellow);
}

.status-dot.polling,
.pill.polling {
  --pill-color: var(--cyan);
}

.status-dot.succeeded,
.pill.succeeded,
.pill.active,
.pill.unused {
  --pill-color: var(--green);
}

.status-dot.failed,
.pill.failed,
.pill.timeout,
.pill.disabled,
.pill.session_expired,
.pill.risk_limited {
  --pill-color: var(--red);
}

.trend-chart {
  padding: 12px 16px 16px;
}

.trend-chart svg {
  display: block;
  width: 100%;
  height: 176px;
}

.grid-lines line {
  stroke: rgba(129, 152, 164, 0.18);
  stroke-width: 1;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  color: var(--muted);
  font-size: 11px;
}

.chart-legend i {
  display: inline-block;
  width: 9px;
  height: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

.inline-form,
.import-form,
.table-toolbar,
.settings-form,
.generate-form,
.docs {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}

.account-form {
  grid-template-columns: 1.1fr 1fr 2fr 1.35fr 1.25fr 1.25fr 0.7fr auto;
  align-items: end;
}

.import-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  padding-top: 0;
}

.key-form {
  grid-template-columns: 360px auto;
  align-items: end;
}

.table-toolbar {
  grid-template-columns: 140px 140px minmax(260px, 1fr) auto auto;
  align-items: end;
  border-top: 1px solid var(--line-soft);
}

.search-label {
  min-width: 320px;
}

.list-summary {
  align-self: center;
  color: var(--muted);
  white-space: nowrap;
}

.table-wrap,
.task-table-wrap {
  overflow: auto;
  margin: 0 14px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #0d181f;
}

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

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: #b9cbd3;
  background: #101d25;
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

.account-table,
.api-key-table,
.task-table {
  min-width: 1040px;
}

.task-table {
  min-width: 1180px;
}

.account-table strong,
.api-key-table strong,
.task-id strong {
  color: var(--text);
}

td small,
.task-id small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid color-mix(in srgb, var(--pill-color, var(--muted)) 48%, transparent);
  border-radius: 3px;
  padding: 2px 7px;
  color: var(--pill-color, var(--muted));
  background: color-mix(in srgb, var(--pill-color, var(--muted)) 12%, transparent);
  font-size: 11px;
  font-weight: 800;
}

.pill.used,
.pill.low_credits {
  --pill-color: var(--yellow);
}

.concurrency-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.concurrency-cell input {
  width: 54px;
  min-height: 28px;
}

.table-actions {
  flex-wrap: nowrap;
}

.table-actions button {
  min-height: 26px;
  padding: 4px 7px;
  font-size: 11px;
}

.compact-actions {
  min-width: 250px;
}

.session-cell-input,
.key-cell-input {
  min-width: 280px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
}

.account-credential-details summary,
.row-details summary {
  color: var(--green);
  cursor: pointer;
}

.account-credential-details textarea,
.account-credential-details input {
  margin-top: 6px;
}

.row-error,
.task-error {
  color: #ffd1d1;
}

.generate-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 360px;
  gap: 12px;
}

.generate-form label {
  gap: 5px;
}

.file-summary {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.form-actions {
  justify-content: space-between;
}

.upload-list {
  display: grid;
  min-height: 42px;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  max-height: 360px;
  overflow: auto;
  gap: 7px;
  align-items: stretch;
  color: var(--muted);
}

.empty-upload {
  display: flex;
}

.upload-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0c171e;
}

.upload-thumb {
  display: grid;
  aspect-ratio: 4 / 3;
  place-items: center;
  border-bottom: 1px solid var(--line-soft);
  background: #071015;
}

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

.upload-thumb audio {
  width: calc(100% - 12px);
}

.upload-file-icon {
  color: var(--green);
  font-weight: 900;
  text-transform: uppercase;
}

.upload-meta {
  display: grid;
  gap: 2px;
  padding: 7px;
}

.upload-meta strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-meta small {
  color: var(--muted);
  font-size: 11px;
}

.upload-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  border-color: rgba(255, 107, 107, 0.42);
  padding: 0;
  color: #ffd1d1;
  background: rgba(7, 16, 21, 0.82);
  font-size: 16px;
  line-height: 1;
}

.upload-list span,
.task-ref-list a,
.task-ref-list span {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 7px;
  color: #cfe0e6;
  background: #0c171e;
  font-size: 12px;
}

.empty-upload {
  display: flex;
  align-items: center;
}

.upload-preview {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px;
  background: #0c171e;
}

.upload-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  padding: 0;
  background: rgba(7, 17, 23, 0.82);
  color: #d8e7ec;
}

.upload-remove svg {
  width: 13px;
  height: 13px;
}

.upload-preview img,
.upload-preview video {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 3px;
  object-fit: cover;
  background: #071117;
}

.upload-preview figcaption {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.upload-preview strong,
.upload-preview small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-preview strong {
  color: #d8e7ec;
  font-size: 12px;
  font-weight: 600;
}

.upload-preview small {
  color: var(--muted);
  font-size: 11px;
}

.audio-preview audio {
  width: 100%;
  height: 28px;
}

.upload-icon {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 3px;
  background: #071117;
  color: var(--muted);
}

.mode-preview,
.mode-select-grid,
.account-pool {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.mode-select-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
  margin: 8px 0 16px;
}

.mode-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
  color: var(--muted);
  background: #0f1c24;
  text-align: left;
}

.mode-card.active,
.mode-card:has(input:checked) {
  border-color: rgba(94, 224, 181, 0.75);
  color: var(--text);
  background: rgba(94, 224, 181, 0.08);
}

.mode-card input {
  width: auto;
  min-height: 0;
}

.mode-card b {
  color: var(--text);
}

.mode-hint {
  color: var(--muted);
  font-size: 12px;
}

.mode-label {
  display: inline-flex;
  max-width: 220px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

.mode-card span,
.setting-section small {
  color: var(--muted);
  font-size: 12px;
}

.account-chips,
.task-ref-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 8px;
  color: var(--text);
  background: #0c171e;
}

.account-chip small {
  color: var(--green);
}

.muted-chip,
.empty {
  color: var(--muted);
}

.json-preview,
pre {
  min-height: 260px;
  margin: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
  color: #d7e6eb;
  background: #081218;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.settings-form {
  gap: 16px;
}

.setting-section {
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 14px;
}

.setting-section h4 {
  margin-bottom: 8px;
  color: var(--green);
}

.setting-label {
  margin-top: 8px;
  color: #b6cad3;
}

.setting-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.setting-switches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-bottom: 0;
}

.switch-line,
.compact-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.switch-line input,
.compact-check input {
  width: auto;
  min-height: 0;
  accent-color: var(--green);
}

.video-link {
  display: inline-flex;
  color: var(--green);
}

.row-details {
  position: relative;
}

.floating-detail {
  position: absolute;
  right: 0;
  z-index: 5;
  display: grid;
  width: 360px;
  gap: 8px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
  background: #0b151c;
  box-shadow: var(--shadow);
  white-space: normal;
}

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

code {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  color: #d7e6eb;
  background: #081218;
}

.doc-block {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 12px;
}

.code-head {
  display: flex;
  justify-content: space-between;
}

.empty {
  margin: 0 14px 14px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 18px;
  text-align: center;
}

.compact-empty {
  margin: 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: 420px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 14px;
  color: var(--text);
  background: #101d25;
  box-shadow: var(--shadow);
}

.toast.ok {
  border-color: rgba(94, 224, 181, 0.55);
}

.toast.error {
  border-color: rgba(255, 107, 107, 0.6);
}

tr[data-provider="dreamina"] [data-account-action="save-http-template"],
tr[data-provider="dreamina"] [data-account-action="refresh-http-template"] {
  display: none;
}

@media (max-width: 1280px) {
  body {
    min-width: 1024px;
  }

  .overview-layout,
  .generate-grid {
    grid-template-columns: 1fr;
  }

  .account-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
