body {
  margin: 0;
  background: #f5f7fb;
  color: #223042;
  font: 14px/1.6 "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

a {
  color: #1d66d2;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

.tester-page {
  max-width: 1560px;
  margin: 0 auto;
  padding: 24px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 6px 0 8px;
  font-size: 30px;
  line-height: 1.2;
}

.page-eyebrow {
  margin: 0;
  color: #1d66d2;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-desc {
  margin: 0;
  color: #5c6b7a;
}

.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.panel {
  background: #ffffff;
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(25, 52, 93, 0.08);
}

.panel-head {
  padding: 18px 20px 0;
}

.panel-head h2,
.preview-head h3,
.custom-panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.panel-head p,
.custom-desc,
.api-note,
.api-variant-tip,
.panel-tip {
  margin: 8px 0 0;
  color: #617284;
}

.auth-panel {
  padding-bottom: 36px;
  margin-bottom: 20px;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-item span,
.field-head span,
.custom-row label span {
  font-size: 13px;
  color: #4d5d70;
  font-weight: 600;
}

.form-item-full {
  grid-column: 1 / -1;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c8d4e3;
  border-radius: 10px;
  padding: 10px 12px;
  box-sizing: border-box;
  background: #ffffff;
  color: #223042;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #1d66d2;
  box-shadow: 0 0 0 4px rgba(29, 102, 210, 0.12);
}

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

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 20px 0;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.btn-primary {
  background: #1d66d2;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(29, 102, 210, 0.22);
}

.btn-secondary {
  background: #e9f1ff;
  color: #1d66d2;
}

.btn-light {
  background: #edf2f7;
  color: #425469;
}

.panel-tip {
  padding: 14px 20px 0;
}

.auth-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.auth-progress {
  min-width: 220px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #edf5ff 0%, #f8fbff 100%);
  border: 1px solid #d6e4fb;
  color: #1d66d2;
  font-weight: 700;
  line-height: 1.5;
}

.auth-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 20px 0;
}

.auth-guide-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: #f5f8fd;
  border: 1px solid #dce6f4;
  color: #4d6075;
  font-size: 13px;
  font-weight: 700;
}

.auth-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 10px 20px 0;
}

.auth-step-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  padding: 16px;
  border: 1px solid #dce5f1;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(29, 102, 210, 0.08), transparent 32%),
    linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
}

.auth-step-head {
  display: flex;
  align-items: center;
}

.auth-step-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 18px;
}

.auth-step-index {
  margin: 0;
  color: #1d66d2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-step-title-text {
  color: #223042;
}

.auth-step-note {
  margin: 0;
  color: #617284;
}

.auth-step-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.auth-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.step-state {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef3f8;
  color: #6b7d90;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.step-state.is-ready {
  background: #e8f7ee;
  color: #1f8a4c;
}

.step-state.is-active {
  background: #e9f1ff;
  color: #1d66d2;
}

.auth-tip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.auth-tip-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fdf1dc;
  color: #a56205;
  font-size: 12px;
  font-weight: 700;
}

.main-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
}

.sidebar-panel {
  overflow: hidden;
}

.search-box {
  padding: 16px 20px 0;
}

.api-sidebar {
  max-height: calc(100vh - 320px);
  overflow: auto;
  padding: 12px 14px 18px;
}

.api-sidebar-group + .api-sidebar-group {
  margin-top: 14px;
}

.api-sidebar-group-title {
  padding: 8px 10px;
  color: #4a5e77;
  font-weight: 700;
}

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

.api-list-item {
  display: block;
  border: 1px solid #e1e8f2;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fbfdff;
  cursor: pointer;
}

.api-list-item:hover {
  border-color: #b9ccec;
  background: #f4f8ff;
}

.api-list-item.active {
  border-color: #1d66d2;
  background: #eaf2ff;
  box-shadow: inset 0 0 0 1px rgba(29, 102, 210, 0.08);
}

.api-list-item strong {
  display: block;
  color: #203248;
}

.api-list-item span {
  display: block;
  color: #617284;
  font-size: 12px;
}

.workspace-panel {
  overflow: hidden;
}

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

.api-group {
  margin: 0 0 4px;
  color: #1d66d2;
  font-weight: 700;
}

.api-method {
  margin: 8px 0 0;
  color: #617284;
  font-family: "Consolas", "Courier New", monospace;
}

.api-note,
.api-variant-tip {
  margin: 0 20px;
  padding: 12px 14px;
  border-radius: 12px;
}

.api-note {
  background: #f5f9ff;
  border: 1px solid #d9e6fb;
}

.api-variant-tip {
  margin-top: 12px;
  background: #fff8e7;
  border: 1px solid #f0ddb1;
  color: #7c5d16;
}

.api-form-panel {
  padding: 16px 20px 0;
}

.field-table-wrap {
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}

.field-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.field-table thead th {
  padding: 14px 16px;
  border-bottom: 1px solid #dbe4f0;
  background: #f6f9fe;
  color: #506174;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.field-table tbody td {
  padding: 16px;
  border-bottom: 1px solid #e6edf6;
  vertical-align: top;
  background: #ffffff;
}

.field-table tbody tr:last-child td {
  border-bottom: none;
}

.param-col-name {
  width: 220px;
}

.param-col-type {
  width: 96px;
}

.param-col-value {
  width: 36%;
}

.param-col-desc {
  width: auto;
}

.param-name-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.field-name {
  font-family: "Consolas", "Courier New", monospace;
  color: #203248;
  font-weight: 600;
}

.field-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  line-height: 1.8;
}

.field-tag-required {
  background: #ffefef;
  color: #c94f4f;
}

.field-tag-optional {
  background: #edf2f7;
  color: #607184;
}

.param-type-badge {
  display: inline-flex;
  align-items: center;
  min-width: 58px;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff4e8;
  color: #d97412;
  font-size: 12px;
  font-weight: 700;
  text-transform: lowercase;
}

.param-label-text {
  color: #203248;
  font-weight: 600;
}

.field-desc {
  margin: 6px 0 0;
  color: #617284;
  font-size: 13px;
  line-height: 1.6;
}

.field-table input,
.field-table select,
.field-table textarea {
  border-radius: 8px;
  padding: 9px 12px;
}

.field-table textarea {
  min-height: 92px;
}

.field-table input::placeholder,
.field-table textarea::placeholder {
  color: #8a99aa;
}

.custom-panel {
  padding: 18px 20px 0;
}

.custom-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

#btn-add-custom-field {
  background: #1d66d2;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(29, 102, 210, 0.18);
}

#btn-add-custom-field:hover {
  background: #1758b3;
}

.custom-row {
  display: grid;
  grid-template-columns: 180px 140px 1fr 110px;
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}

.custom-row [data-remove-custom] {
  align-self: end;
  min-height: 40px;
  padding: 8px 16px;
}

.workspace-buttons {
  padding-top: 20px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
}

.preview-box {
  border: 1px solid #e1e8f2;
  border-radius: 16px;
  background: #fbfdff;
  overflow: hidden;
}

.preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #e1e8f2;
}

.preview-head span {
  color: #617284;
  font-size: 12px;
}

.preview-box textarea {
  min-height: 280px;
  border: none;
  border-radius: 0;
  background: #10161f;
  color: #d9e6ff;
  font-family: "Consolas", "Courier New", monospace;
}

.empty-block {
  padding: 28px;
  border: 1px dashed #cfd9e8;
  border-radius: 14px;
  background: #fafcff;
  color: #617284;
}

@media (max-width: 1280px) {
  .main-layout {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .auth-steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .tester-page {
    padding: 16px;
  }

  .page-header,
  .api-head,
  .custom-panel-head,
  .auth-panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .main-layout,
  .preview-grid,
  .custom-row {
    grid-template-columns: 1fr;
  }

  .api-sidebar {
    max-height: none;
  }

  .field-table-wrap {
    overflow-x: auto;
  }

  .field-table {
    min-width: 760px;
  }

  .auth-step-grid {
    grid-template-columns: 1fr;
  }
}
