:root {
  color: #17202a;
  background: #eef1f4;
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
  --ink: #17202a;
  --muted: #63707c;
  --line: #cbd2d9;
  --surface: #ffffff;
  --accent: #1264a3;
  --accent-strong: #0b4f82;
  --success: #16845b;
  --warning: #a65a12;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

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

button,
a {
  min-height: 40px;
}

.topbar {
  height: 68px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f8fafc;
  background: #202a33;
  border-bottom: 3px solid #16845b;
}

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

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: #1264a3;
  border: 1px solid #55a0d4;
  border-radius: 6px;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 16px;
}

.brand div > span {
  margin-top: 2px;
  color: #adb8c2;
  font-size: 12px;
}

.release-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #34c88a;
  border-radius: 50%;
}

.mode-tabs {
  padding: 0 32px;
  display: flex;
  gap: 0;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.mode-tab {
  padding: 0 22px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}

.mode-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 700;
}

main {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 28px 32px 36px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(340px, 0.78fr);
  gap: 28px;
  align-items: start;
}

.install-tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 26px;
}

.section-heading,
.agent-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.platform-tabs {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: -6px 0 20px;
  padding: 3px;
  background: #e8edf0;
  border: 1px solid #d3dbe0;
  border-radius: 6px;
}

.platform-tab {
  min-width: 0;
  color: #596773;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
}

.platform-tab.active {
  color: #17242d;
  background: #ffffff;
  box-shadow: 0 1px 3px rgb(27 43 54 / 16%);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: 25px;
  line-height: 1.2;
}

.platform-badge {
  padding: 7px 9px;
  color: #34414d;
  background: #edf5fa;
  border: 1px solid #bad2e3;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}

form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: #33414d;
  font-size: 13px;
  font-weight: 700;
}

label:nth-child(2) {
  grid-column: 1 / -1;
}

input[type="text"],
input:not([type]) {
  width: 100%;
}

label > input:not([type="checkbox"]),
label > select {
  height: 42px;
  padding: 0 11px;
  color: var(--ink);
  background: #fbfcfd;
  border: 1px solid #aeb8c2;
  border-radius: 4px;
  outline: none;
}

label > input:focus,
label > select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 100, 163, 0.13);
}

label > small {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.4;
}

.toggle-row {
  grid-column: 1 / -1;
  min-height: 52px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f5f7f8;
  border: 1px solid #d5dbe0;
  border-radius: 4px;
}

.toggle-row span,
.toggle-row small {
  display: block;
}

.toggle-row small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 400;
}

.toggle-row input {
  width: 38px;
  height: 20px;
  accent-color: var(--accent);
}

.credential-status {
  margin: 17px 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #6f3d0e;
  background: #fff7e8;
  border-left: 3px solid var(--warning);
  font-size: 13px;
}

.status-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #ffffff;
  background: var(--warning);
  border-radius: 50%;
  font-weight: 800;
}

.credential-guide {
  margin: 0 0 17px;
  padding: 13px 0;
  border-top: 1px solid #d9dee3;
  border-bottom: 1px solid #d9dee3;
}

.credential-guide-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.credential-guide h2 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
}

.credential-guide-heading > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.credential-guide p {
  margin: 8px 0 0;
  color: #46535f;
  font-size: 12px;
  line-height: 1.55;
}

.credential-example {
  margin-top: 10px;
}

.credential-example > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.credential-example pre {
  margin: 0;
  padding: 9px 11px;
  overflow-x: auto;
  color: #dbe8ef;
  background: #1b252d;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
}

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

.command-block {
  border: 1px solid #293845;
  border-radius: 5px;
  overflow: hidden;
}

.command-heading {
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #d9e2e8;
  background: #27333d;
  font-size: 12px;
}

.launcher-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
}

.launcher-tab {
  min-height: 30px;
  padding: 0 10px;
  color: #b9c6cf;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.launcher-tab.active {
  color: #ffffff;
  border-bottom-color: #45c58a;
}

.command-block pre {
  min-height: 118px;
  max-height: 190px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #ebf6ff;
  background: #11191f;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.launcher-note {
  min-height: 20px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.quiet-button {
  min-height: 30px;
  padding: 0 10px;
  color: #ffffff;
  background: #3d4c58;
  border: 1px solid #687985;
  border-radius: 4px;
  cursor: pointer;
}

.actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

.actions.compact {
  margin: 0;
}

.primary-button,
.secondary-button {
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent-strong);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  color: #263440;
  background: #ffffff;
  border: 1px solid #9da9b3;
}

#action-status {
  min-height: 22px;
  margin-top: 10px;
  display: block;
  color: var(--success);
  font-size: 13px;
}

.product-preview {
  margin: 0;
  background: #dfe4e8;
  border: 1px solid #bac3ca;
  border-radius: 6px;
  overflow: hidden;
}

.product-preview img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  object-position: left top;
  background: #dfe4e8;
}

.product-preview figcaption {
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #ffffff;
  border-top: 1px solid var(--line);
}

.product-preview figcaption span {
  padding: 5px 7px;
  color: #33414d;
  background: #edf0f2;
  border-radius: 3px;
  font-size: 11px;
}

.agent-workspace {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 26px;
}

.agent-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}

.agent-grid aside {
  border-right: 1px solid var(--line);
  padding-right: 18px;
}

dl,
dt,
dd {
  margin: 0;
}

dl > div {
  padding: 10px 0;
  border-bottom: 1px solid #e1e5e8;
}

dt {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

dd {
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

#agent-contract {
  min-height: 480px;
  max-height: 68vh;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #dbe8ef;
  background: #121a20;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.6;
}

.hidden {
  display: none;
}

footer {
  min-height: 46px;
  padding: 10px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 28px;
  color: #586570;
  background: #ffffff;
  border-top: 1px solid var(--line);
  font-size: 11px;
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .product-preview {
    order: -1;
  }

  .product-preview img {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 620px) {
  .topbar {
    height: auto;
    min-height: 68px;
    padding: 12px 16px;
  }

  .release-state {
    align-self: flex-start;
  }

  .mode-tabs,
  main {
    padding-left: 16px;
    padding-right: 16px;
  }

  main {
    padding-top: 18px;
  }

  .install-tool,
  .agent-workspace {
    padding: 18px;
  }

  .section-heading,
  .agent-header {
    display: grid;
  }

  .credential-guide-heading {
    align-items: flex-start;
  }

  form {
    grid-template-columns: 1fr;
  }

  label,
  label:nth-child(2),
  .toggle-row {
    grid-column: 1;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .agent-grid {
    grid-template-columns: 1fr;
  }

  .agent-grid aside {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 12px;
  }

  .agent-grid dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
  }

  footer {
    justify-content: flex-start;
    padding-left: 16px;
    padding-right: 16px;
  }
}
