/* 批TGWDEV661：获授权账号的模拟身份内容池与发布任务控制台。 */
.simulated-operations-view {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #0f1a21;
}

.sim-software-assets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px,100%), 1fr)); gap: 8px; width: 100%; }
.sim-software-asset { display: grid; grid-template-columns: 24px minmax(0,1fr); align-items: start; padding: 8px; border: 1px solid #405863; gap: 4px; overflow: hidden; }
.sim-software-asset img { grid-column: 2; width: 100%; height: 110px; object-fit: contain; background: #0a171e; }
.sim-software-asset strong, .sim-software-asset small { grid-column: 2; overflow-wrap: anywhere; }
.sim-ai-preview { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(250px,100%),1fr)); gap: 10px; }
.sim-ai-preview article { padding: 10px; border: 1px solid #405863; min-width: 0; }
.sim-ai-preview p { white-space: pre-wrap; overflow-wrap: anywhere; }
.sim-community-ai { margin-top: 16px; }

.simulated-operations-head-actions,
.sim-form-actions,
.sim-actions,
.sim-table-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
}

#simulatedOperationsStatus.is-error { color: #ff8989; }
#simulatedOperationsStatus.is-success { color: #55e3a0; font-weight: 700; }

.simulated-operations-app {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0;
  color: #eef4f7;
}

.sim-console-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.sim-workspace-tabs {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
  padding: 6px 8px;
  border-bottom: 1px solid #324752;
  background: #0b171d;
}

.sim-workspace-tabs button {
  min-width: 0;
  min-height: 34px;
  padding: 4px 5px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sim-workspace-tabs button[aria-selected="true"] {
  border-color: #52d5a2;
  background: #17533c;
  color: #e7fff6;
  box-shadow: inset 0 0 0 1px #2b9d72;
}

.sim-workspace-scroll {
  min-width: 0;
  min-height: 0;
  padding: 8px 10px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.sim-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid #324752;
  background: #14242d;
}

.sim-metrics > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 52px;
  padding: 6px 9px;
  border-right: 1px solid #324752;
}

.sim-metrics > div:last-child { border-right: 0; }
.sim-metrics span { color: #9fb2bc; font-size: 12px; }
.sim-metrics strong { overflow-wrap: anywhere; color: #fff; font-size: 18px; line-height: 1.15; }
.sim-metrics > div:last-child strong { font-size: 13px; }

.sim-section {
  width: 100%;
  min-width: 0;
  margin-top: 0;
  border-top: 1px solid #38505b;
  background: #12212a;
}

.sim-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 8px 10px;
  background: #182b35;
}

.sim-section > header > div { display: grid; gap: 2px; min-width: 0; }
.sim-section h3 { margin: 0; font-size: 17px; letter-spacing: 0; }
.sim-section header span { color: #a7bac4; font-size: 12px; }

.sim-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
  border-top: 1px solid #2c414b;
}

.sim-table-wrap table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  background: #101d24;
}

.sim-table-wrap th,
.sim-table-wrap td {
  min-width: 0;
  padding: 6px 7px;
  border-right: 1px solid #2b404a;
  border-bottom: 1px solid #2b404a;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.sim-table-wrap th { position: sticky; top: 0; z-index: 1; background: #203540; color: #dce9ef; white-space: nowrap; }
.sim-table-wrap td > strong,
.sim-table-wrap td > small { display: block; }
.sim-table-wrap td > small { margin-top: 3px; color: #9fb1bc; line-height: 1.45; }
.sim-table-wrap input:not([type="checkbox"]),
.sim-table-wrap select { box-sizing: border-box; width: 100%; min-width: 0; }

.sim-identity-matrix { min-width: 0 !important; table-layout: fixed; }
.sim-identity-matrix th:nth-child(1) { width: 24%; }
.sim-identity-matrix th:nth-child(2) { width: 6%; }
.sim-identity-matrix th:nth-child(n+3):nth-child(-n+8) { width: 5%; }
.sim-identity-matrix th:nth-child(9) { width: 8%; }
.sim-identity-matrix th:nth-child(10) { width: 11%; }
.sim-identity-matrix th:nth-child(11) { width: 7%; }
.sim-identity-matrix th { padding-inline: 3px; font-size: 11px; text-align: center; white-space: normal; }
.sim-identity-matrix td { padding: 4px 3px; }
.sim-identity-cell { min-width: 0; }
.sim-identity-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-identity-cell small { font-size: 10px; }
.sim-matrix-check { width: auto; text-align: center !important; }
.sim-matrix-check input { width: 18px; height: 18px; accent-color: #24a56a; }

.sim-lottery-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  min-width: 170px;
}

.sim-check,
.sim-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 12px;
  white-space: nowrap;
}

.sim-check input,
.sim-switch input { width: 16px; height: 16px; margin: 0; accent-color: #24a56a; }

.sim-form,
.sim-task-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 9px 10px;
  padding: 10px;
  border-top: 1px solid #2c414b;
}

.sim-form label,
.sim-task-form > label {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  color: #ccdae1;
  font-size: 12px;
  font-weight: 700;
}

.sim-form :is(input, select, textarea),
.sim-task-form :is(input, select, textarea) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid #48616e;
  border-radius: 5px;
  background: #0b171d;
  color: #f3f7f9;
}

.sim-task-form textarea { resize: vertical; font: inherit; line-height: 1.55; }

.sim-form textarea { resize: vertical; }
.sim-form label small,
.sim-task-form label small { color: #96aab4; font-weight: 400; }
.sim-task-form > label.sim-switch {
  display: inline-flex;
  align-items: center;
  align-self: end;
  min-height: 36px;
  font-weight: 700;
}
.sim-task-form > label.sim-switch input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
}
.sim-form-wide { grid-column: 1 / -1; }
.sim-form-actions { justify-content: flex-end; align-self: end; min-height: 36px; }

.sim-task-identities {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #3b535f;
}

.sim-task-identities > div { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.sim-task-identities > button { justify-self: start; }
.sim-table-toolbar { justify-content: space-between; padding: 7px 10px; border-top: 1px solid #2c414b; color: #a8bac4; font-size: 12px; }
.sim-actions { flex-wrap: wrap; white-space: nowrap; }
.sim-actions button { min-height: 30px; padding: 4px 8px; }
.sim-actions .is-danger { border-color: #944b50; color: #ffd9dc; background: #52282d; }

.sim-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid #536974;
  border-radius: 4px;
  color: #d8e4ea;
  background: #253740;
  white-space: nowrap;
}

.sim-status--running,
.sim-status--ready,
.sim-status--success { border-color: #27815a; color: #b8f2d5; background: #153e2d; }
.sim-status--paused { border-color: #9a7838; color: #ffe2a5; background: #493a1d; }
.sim-status--failed,
.sim-status--cancelled,
.sim-status--disabled { border-color: #8a464b; color: #ffc9cd; background: #47252a; }
.sim-status--completed { border-color: #39769a; color: #c7eaff; background: #17394d; }
.sim-status--scheduled,
.sim-status--published { border-color: #27815a; color: #b8f2d5; background: #153e2d; }
.sim-empty { padding: 28px !important; color: #98abb5; text-align: center !important; }
.sim-access-error { display: grid; gap: 8px; place-content: center; min-height: 260px; color: #ffb0b0; text-align: center; }

.sim-tabs {
  display: flex;
  gap: 6px;
  min-width: 0;
  padding: 8px 10px;
  overflow-x: hidden;
  border-top: 1px solid #2c414b;
  border-bottom: 1px solid #2c414b;
  background: #101d24;
}

.sim-tabs button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 5px 14px;
}

.sim-tabs button[aria-selected="true"] {
  border-color: #52d5a2;
  background: #17533c;
  color: #d8ffef;
  box-shadow: inset 0 0 0 1px #2b9d72;
}

.sim-play-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: #2c414b;
}

.sim-play-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  min-width: 0;
  padding: 9px;
  background: #101d24;
}

.sim-play-select {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 3px 7px;
  min-width: 0;
}

.sim-play-select input { grid-row: 1 / span 2; width: 18px; height: 18px; margin: 0; accent-color: #24a56a; }
.sim-play-select strong { overflow-wrap: anywhere; font-size: 13px; }
.sim-play-select span { color: #8fa7b2; font-size: 11px; }

.sim-play-row textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 76px;
  padding: 7px 8px;
  border: 1px solid #48616e;
  border-radius: 4px;
  background: #08141a;
  color: #f3f7f9;
  font: 13px/1.5 "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  resize: vertical;
}

.sim-input-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(54px, 1fr));
  align-content: center;
  gap: 5px;
}

.sim-input-actions button { min-height: 31px; padding: 4px 7px; }
.sim-task-form--compact { grid-template-columns: repeat(5, minmax(130px, 1fr)); }
.sim-inline-empty { color: #ffcf7d; font-size: 12px; }

.sim-target-context {
  grid-column: 1 / -1;
  min-height: 38px;
  padding: 8px 10px;
  border-left: 3px solid #3aa982;
  background: #0c181e;
  color: #b9cad2;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.sim-form-actions--wide { grid-column: 1 / -1; }
.sim-comment-content { min-width: 0; max-width: 520px; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.sim-log-details { border-top: 1px solid #2c414b; }
.sim-log-details > summary { padding: 10px; color: #c8d8df; cursor: pointer; font-weight: 700; }

@media (max-width: 900px) {
  .sim-workspace-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sim-workspace-scroll { padding: 7px 8px 20px; }
  .sim-metrics > div { min-height: 46px; padding: 5px 6px; }
  .sim-metrics span { font-size: 10px; }
  .sim-metrics strong { font-size: 16px; }
  .sim-form,
  .sim-task-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sim-play-list { grid-template-columns: minmax(0, 1fr); }
  .sim-play-row { grid-template-columns: 125px minmax(0, 1fr); }
  .sim-input-actions { grid-column: 2; display: flex; flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .sim-workspace-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 5px 6px; }
  .sim-workspace-tabs button { min-height: 31px; padding: 3px; font-size: 11px; }
  .sim-workspace-scroll { padding: 6px 6px 18px; scrollbar-gutter: auto; }
  .sim-metrics > div { min-height: 42px; padding: 4px; text-align: center; }
  .sim-metrics > div:last-child { border-right: 0; }
  .sim-metrics span { font-size: 9px; line-height: 1.2; }
  .sim-metrics strong,
  .sim-metrics > div:last-child strong { font-size: 12px; }
  .simulated-operations-view .workspace-head { align-items: center; }
  .simulated-operations-view .workspace-head span { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .simulated-operations-head-actions button { min-width: 0; padding: 5px 8px; }
  .sim-form,
  .sim-task-form { grid-template-columns: minmax(0, 1fr); }
  .sim-form-wide,
  .sim-task-identities { grid-column: 1; }
  .sim-section > header { align-items: flex-start; }
  .sim-section > header { flex-direction: column; }
  .sim-play-row { grid-template-columns: minmax(0, 1fr); }
  .sim-play-select,
  .sim-input-actions { grid-column: 1; }
  .sim-input-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sim-input-actions button { min-width: 0; padding-inline: 3px; }
  .sim-target-context,
  .sim-form-actions--wide { grid-column: 1; }

  .sim-table-wrap { border-top: 0; }
  .sim-identity-matrix,
  .sim-identity-matrix tbody { display: block; width: 100%; }
  .sim-identity-matrix thead { display: none; }
  .sim-identity-matrix tr {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: 7px;
    border: 1px solid #344b56;
    background: #263c46;
  }
  .sim-identity-matrix td {
    display: grid;
    min-width: 0;
    padding: 5px 4px;
    border: 0;
    background: #101d24;
    text-align: center;
  }
  .sim-identity-matrix td::before {
    content: attr(data-label);
    color: #8fa5af;
    font-size: 9px;
    line-height: 1.2;
  }
  .sim-identity-matrix .sim-identity-cell {
    grid-column: 1 / -1;
    display: block;
    padding: 7px 8px;
    text-align: left;
  }
  .sim-identity-matrix .sim-identity-cell::before { content: none; }
  .sim-identity-cell strong { white-space: normal; }
  .sim-identity-matrix td:nth-child(9),
  .sim-identity-matrix td:nth-child(10) { grid-column: span 2; }
  .sim-identity-matrix td:nth-child(11) { grid-column: 1 / -1; }
  .sim-identity-matrix td:nth-child(11) button { width: 100%; }
  .sim-identity-matrix .sim-switch { justify-content: center; }

  .sim-responsive-table,
  .sim-responsive-table tbody { display: block; width: 100%; }
  .sim-responsive-table thead { display: none; }
  .sim-responsive-table tr {
    display: block;
    margin-bottom: 7px;
    border: 1px solid #344b56;
    background: #101d24;
  }
  .sim-responsive-table td {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 7px;
    align-items: start;
    width: auto;
    padding: 6px 7px;
    border-right: 0;
    text-align: left;
  }
  .sim-responsive-table td::before {
    content: attr(data-label);
    color: #8fa5af;
    font-size: 10px;
    font-weight: 700;
  }
  .sim-responsive-table td[colspan] { display: block; }
  .sim-comment-content { min-width: 0; max-width: none; }
}
