:root {
  color: #17201b;
  background: #f5f7f4;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid #9dafaa;
  border-radius: 6px;
  padding: 8px 11px;
  color: #17201b;
  background: #ffffff;
  cursor: pointer;
}

button:hover {
  border-color: #22796d;
  color: #11594f;
}

input {
  min-width: 0;
  width: 100%;
  border: 1px solid #aebdb6;
  border-radius: 6px;
  padding: 9px 10px;
  background: #ffffff;
}

pre {
  min-height: 180px;
  overflow: auto;
  margin: 0;
  border-radius: 6px;
  padding: 12px;
  color: #dceee8;
  background: #12201a;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.topbar,
.panel-head,
.actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar {
  justify-content: space-between;
  margin-bottom: 14px;
}

.topbar h1,
.topbar p,
.panel h2,
.summary-card h2 {
  margin: 0;
}

.topbar p {
  margin-top: 5px;
  color: #65736e;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid #d1dbd6;
}

.tab-button {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 10px 14px;
  background: transparent;
  color: #53635d;
  font-weight: 700;
}

.tab-button:hover,
.tab-button.is-active {
  color: #11594f;
  border-bottom-color: #22796d;
}

.tab-panel {
  display: grid;
  gap: 14px;
}

.tab-panel[hidden] {
  display: none;
}

.grid,
.summary-grid {
  display: grid;
  gap: 14px;
}

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

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.test-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.test-summary-grid span {
  display: grid;
  gap: 5px;
  min-height: 58px;
  border: 1px solid #dce6e1;
  border-radius: 6px;
  padding: 9px 10px;
  color: #62726b;
  background: #f7faf8;
  font-size: 13px;
  line-height: 1.25;
}

.test-summary-grid strong {
  display: block;
  color: #17201b;
  font-size: 17px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.test-summary-grid span:nth-child(4),
.test-summary-grid span:nth-child(11) {
  grid-column: span 2;
}

.test-summary-grid span:nth-child(4) strong {
  font-size: 14px;
}

.lower-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.panel,
.summary-card {
  display: grid;
  gap: 12px;
  border: 1px solid #d1dbd6;
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.panel-head {
  justify-content: space-between;
}

.primary-actions {
  flex-wrap: wrap;
  align-items: flex-start;
}

.overview-actions-panel {
  gap: 10px;
}

.failure-panel,
.current-version-panel,
.invite-acceptance-panel,
.one-click-console,
.report-panel,
.manual-test-panel,
.state-debug-section {
  margin-top: 0;
}

.failure-notice {
  border: 1px solid #dce6e1;
  border-radius: 6px;
  padding: 10px 12px;
  color: #52625b;
  background: #f7faf8;
}

.failure-list {
  display: grid;
  gap: 8px;
}

.failure-item {
  border: 1px solid #f0c8c1;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff6f4;
}

.failure-item strong {
  display: block;
  margin-bottom: 4px;
}

.failure-meta {
  color: #6b5a55;
  font-size: 12px;
}

.failure-suggestion {
  margin-top: 6px;
  color: #7a3e25;
  font-size: 12px;
  line-height: 1.45;
}

.overview-acceptance-grid,
.debug-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.overview-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid #dce6e1;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}

.overview-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.overview-card h3,
.overview-card p {
  margin: 0;
}

.overview-card h3 {
  font-size: 15px;
}

.overview-card p {
  color: #5b6a64;
  line-height: 1.45;
}

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

.module-entry-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid #dce6e1;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}

.module-entry-card h3,
.module-entry-card p {
  margin: 0;
}

.module-entry-card h3 {
  font-size: 15px;
}

.module-entry-card p {
  color: #5b6a64;
  font-size: 13px;
  line-height: 1.45;
}

.module-entry-card button {
  justify-self: start;
}

.test-groups {
  display: grid;
  gap: 10px;
}

.test-groups-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.test-group {
  border: 1px solid #dce6e1;
  border-radius: 8px;
  background: #fbfdfb;
}

.test-group[open] {
  background: #ffffff;
}

.test-group-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  cursor: pointer;
}

.test-group-summary::marker,
.debug-summary::marker {
  color: #60716b;
}

.test-group-title {
  font-weight: 700;
}

.test-action-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.test-action-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.test-action-item button {
  width: 100%;
  min-height: 38px;
  text-align: left;
}

.test-action-item button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.test-status {
  justify-content: center;
  min-width: 64px;
}

.manual-test-panel,
.state-debug-section {
  display: grid;
  gap: 12px;
  border: 1px solid #d1dbd6;
  border-radius: 8px;
  background: #ffffff;
}

.manual-test-grid,
.debug-state-grid {
  padding: 0 14px 14px;
}

.debug-section {
  min-width: 0;
  border: 1px solid #d1dbd6;
  border-radius: 8px;
  background: #ffffff;
}

details.debug-section:not([open]) > :not(summary),
details.manual-test-panel:not([open]) > :not(summary),
details.test-group:not([open]) > :not(summary) {
  display: none;
}

.debug-section[open] {
  display: grid;
  gap: 10px;
}

.debug-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
}

.debug-toggle-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #b9c8c2;
  border-radius: 6px;
  padding: 4px 10px;
  color: #42524b;
  background: #ffffff;
  font-size: 12px;
  font-weight: 400;
}

.debug-section[open] > .debug-summary .debug-toggle-label,
.manual-test-panel[open] > .debug-summary .debug-toggle-label {
  color: #11594f;
  border-color: #22796d;
}

.debug-section > button {
  justify-self: start;
  margin: 0 12px;
}

.debug-section > pre {
  margin: 0 12px 12px;
}

.report-file-row {
  border: 1px solid #dce6e1;
  border-radius: 6px;
  padding: 9px 10px;
  color: #5d6d66;
  background: #f7faf8;
}

.report-file-row strong {
  color: #17201b;
  overflow-wrap: anywhere;
}

.report-preview-details > pre {
  max-height: 520px;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.report-stats span {
  min-height: 34px;
  border: 1px solid #dce6e1;
  border-radius: 6px;
  padding: 8px 10px;
  color: #5d6d66;
  background: #f7faf8;
}

.report-stats strong {
  color: #17201b;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.button-row {
  flex-wrap: wrap;
  align-items: flex-start;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  color: #3f5049;
  background: #eef3ef;
  font-size: 12px;
}

.badge.ok {
  color: #0e6a45;
  background: #e0f4eb;
}

.badge.warn {
  color: #84520e;
  background: #fff1d7;
}

.badge.bad {
  color: #8f2f25;
  background: #ffe7e2;
}

dl {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 7px 10px;
  margin: 0;
}

dt {
  color: #65736e;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.log-panel {
  margin-top: 0;
}

#logs {
  display: grid;
  gap: 8px;
  margin: 0 12px 12px;
  padding-left: 22px;
}

#logs li {
  padding: 7px 0;
  border-bottom: 1px solid #e5ece8;
}

@media (max-width: 1100px) {
  .grid,
  .summary-grid,
  .lower-grid,
  .test-summary-grid,
  .overview-acceptance-grid,
  .module-entry-grid,
  .debug-grid,
  .report-stats,
  .test-action-list {
    grid-template-columns: 1fr;
  }

  .test-summary-grid span:nth-child(4),
  .test-summary-grid span:nth-child(11) {
    grid-column: auto;
  }

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

  .tabs {
    overflow-x: auto;
  }

  .tab-button {
    white-space: nowrap;
  }
}
