:root {
  --ink: #17151c;
  --muted: #6c6875;
  --line: #ddd9e4;
  --page: #f4f3f8;
  --panel: #ffffff;
  --purple: #2e1754;
  --purple-deep: #20103e;
  --purple-soft: #ede7f7;
  --green: #6de38c;
  --green-deep: #167a46;
  --blue-soft: #eef7ff;
  --blue-line: #c9dfef;
  --blue-focus: #3478c9;
  --danger: #b83f50;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 42px;
  padding: 0 40px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #211b29;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--purple-deep);
  background: var(--green);
  font-weight: 900;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--muted);
  font-size: 13px;
}

.nav a {
  padding: 22px 0 19px;
  border-bottom: 3px solid transparent;
}

.nav a:hover,
.nav a.active {
  color: var(--purple);
  border-bottom-color: var(--purple);
}

.health {
  margin-left: auto;
  color: #4d4a55;
  font-size: 12px;
  white-space: nowrap;
}

.health i,
.secure i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green-deep);
}

.hero {
  color: #ffffff;
  background: var(--purple-deep);
  border-bottom: 5px solid var(--green);
}

.hero-inner {
  width: min(1180px, calc(100% - 48px));
  min-height: 286px;
  margin: 0 auto;
  padding: 52px 0 45px;
}

.hero-kicker,
.kicker {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.hero h1 {
  margin: 10px 0 12px;
  font-size: 46px;
  line-height: 1.15;
  font-weight: 780;
}

.hero h1 span {
  margin-left: 10px;
  color: var(--green);
}

.hero p {
  max-width: 650px;
  margin: 0;
  color: #d9d1e7;
  font-size: 15px;
}

.route-summary {
  display: flex;
  gap: 8px;
  margin-top: 27px;
}

.route-summary span {
  min-width: 67px;
  padding: 6px 11px;
  border: 1px solid #5a4578;
  border-radius: 4px;
  color: #ede8f5;
  background: #342053;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.workbench-panel {
  width: min(1180px, calc(100% - 48px));
  margin: 32px auto 0;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 34px rgba(35, 22, 57, 0.07);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.section-head .kicker {
  color: var(--green-deep);
}

.section-head h2 {
  margin: 4px 0 0;
  font-size: 25px;
  line-height: 1.25;
}

.secure {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.72fr);
  gap: 0;
}

.form-panel {
  min-width: 0;
  padding: 28px 30px 4px 0;
}

.status-panel {
  min-width: 0;
  padding: 28px 0 4px 28px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 23px;
}

.panel-title > span {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #ffffff;
  background: var(--purple);
  font-size: 11px;
  font-weight: 800;
}

.panel-title h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.panel-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0 0 18px;
}

.field > span,
.route-field legend {
  color: #47424f;
  font-size: 12px;
  font-weight: 700;
}

.field small {
  color: var(--muted);
  font-weight: 400;
}

.field input,
.field textarea,
.proxy-unit textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cec9d5;
  border-radius: 6px;
  outline: none;
  color: var(--ink);
  background: #ffffff;
}

.field input {
  height: 42px;
  padding: 0 12px;
}

.field textarea,
.proxy-unit textarea {
  padding: 10px 12px;
  resize: vertical;
  overflow-wrap: anywhere;
}

.field input:focus,
.field textarea:focus,
.proxy-unit textarea:focus {
  border-color: var(--blue-focus);
  box-shadow: 0 0 0 3px rgba(52, 120, 201, 0.13);
}

.route-field {
  padding: 0;
  border: 0;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.route {
  position: relative;
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
}

.route:hover {
  border-color: #9e91b1;
}

.route:focus-within {
  outline: 3px solid var(--blue-focus);
  outline-offset: 2px;
}

.route.active {
  border-color: var(--purple);
  background: var(--purple-soft);
}

.route input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.route-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--purple);
  background: #eeeaf3;
  font-size: 12px;
  font-weight: 900;
}

.route.active .route-icon {
  color: #ffffff;
  background: var(--purple);
}

.route > span:last-child {
  min-width: 0;
  display: grid;
}

.route b,
.route small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route b {
  font-size: 12px;
}

.route small {
  color: var(--muted);
  font-size: 10px;
}

.proxy-box {
  min-width: 0;
  margin: 22px 0 18px;
  padding: 18px;
  border: 1px solid var(--blue-line);
  border-radius: 8px;
  background: var(--blue-soft);
}

.proxy-box-head,
.proxy-unit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.proxy-box-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--blue-line);
}

.proxy-box-head h4 {
  margin: 0;
  font-size: 15px;
}

.proxy-box-head p {
  margin: 3px 0 0;
  color: #586d7c;
  font-size: 11px;
}

.proxy-box-head > span {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 4px;
  color: #275c7d;
  background: #dceefa;
  font-size: 10px;
  font-weight: 700;
}

.proxy-unit {
  min-width: 0;
  padding-top: 15px;
}

.proxy-unit + .proxy-unit {
  margin-top: 16px;
  border-top: 1px solid var(--blue-line);
}

.proxy-unit-head {
  margin-bottom: 7px;
}

.proxy-unit-head label {
  color: #29343c;
  font-size: 12px;
  font-weight: 750;
}

.proxy-unit-head span {
  color: #567083;
  font-size: 9px;
  font-weight: 800;
}

.proxy-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}

.secondary,
.primary,
.copy,
.icon-button {
  cursor: pointer;
}

.secondary {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #9fbfd4;
  border-radius: 6px;
  color: #244d68;
  background: #ffffff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.secondary:hover {
  border-color: #5c91b3;
  background: #f8fcff;
}

.secondary:disabled,
.primary:disabled,
.icon-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.proxy-diagnostic {
  min-width: 0;
  color: #586d7c;
  font-size: 11px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.proxy-diagnostic.pending {
  color: #7f641d;
}

.proxy-diagnostic.success {
  color: var(--green-deep);
}

.proxy-diagnostic.warning,
.proxy-diagnostic.error {
  color: var(--danger);
}

.billing-note {
  min-height: 49px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 11px 13px;
  border-left: 3px solid var(--green-deep);
  background: #f3f8f4;
}

.billing-note span {
  color: #4b5c50;
  font-size: 11px;
  font-weight: 700;
}

.billing-note strong {
  color: #2f4937;
  font-size: 12px;
  text-align: right;
}

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

.form-footer {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 8px;
}

.form-error {
  flex: 1;
  min-width: 0;
  color: var(--danger);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.primary {
  min-width: 120px;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--purple);
  font-size: 13px;
  font-weight: 750;
}

.primary:hover {
  background: #3b1d69;
}

.status-title {
  padding-bottom: 19px;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #5c5764;
  background: #ffffff;
  font-size: 21px;
  line-height: 1;
}

.status-summary {
  display: flex;
  align-items: center;
  gap: 11px;
}

.status-dot {
  flex: 0 0 11px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #a9a5af;
}

.status-dot.queued,
.status-dot.running {
  background: #d39b2d;
}

.status-dot.succeeded {
  background: var(--green-deep);
}

.status-dot.failed,
.status-dot.cancelled {
  background: var(--danger);
}

.status-summary > div:nth-child(2) {
  min-width: 0;
  display: grid;
}

.status-summary strong {
  font-size: 14px;
}

.status-summary span {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.status-summary > b {
  margin-left: auto;
  font-size: 20px;
}

.progress {
  height: 6px;
  margin: 18px 0 23px;
  overflow: hidden;
  border-radius: 3px;
  background: #e9e6ed;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green-deep);
  transition: width 0.2s ease;
}

.diagnostics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.diagnostics div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.diagnostics span {
  color: var(--muted);
  font-size: 10px;
}

.diagnostics b {
  min-width: 0;
  overflow: hidden;
  color: #3e3945;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-head,
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #4b4652;
  font-size: 11px;
  font-weight: 700;
}

.log-head {
  margin-top: 22px;
}

.log-head span:last-child {
  color: var(--muted);
  font-weight: 400;
}

.logs {
  min-height: 255px;
  max-height: 360px;
  margin: 9px 0 20px;
  padding: 13px;
  overflow: auto;
  border-radius: 6px;
  color: #cfe8d6;
  background: #17141d;
  font: 11px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.result {
  min-width: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.copy {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #4b4652;
  background: #ffffff;
  font-size: 11px;
}

.result a {
  display: block;
  min-width: 0;
  margin-top: 10px;
  color: #2368aa;
  font-size: 11px;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.status-error {
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px solid #eccbd1;
  border-radius: 6px;
  color: var(--danger);
  background: #fff5f6;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.footer-band {
  width: min(1180px, calc(100% - 48px));
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 820px) {
  .topbar {
    gap: 22px;
    padding: 0 24px;
  }

  .nav {
    display: none;
  }

  .hero-inner,
  .workbench-panel,
  .footer-band {
    width: min(100% - 32px, 720px);
  }

  .hero-inner {
    min-height: 250px;
    padding: 42px 0 38px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .workbench-panel {
    padding: 24px;
  }

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

  .form-panel {
    padding: 26px 0 30px;
  }

  .status-panel {
    padding: 28px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .logs {
    min-height: 190px;
  }
}

@media (max-width: 390px) {
  .topbar {
    min-height: 58px;
    padding: 0 16px;
  }

  .brand {
    font-size: 12px;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
  }

  .health {
    font-size: 10px;
  }

  .hero-inner,
  .workbench-panel,
  .footer-band {
    width: calc(100% - 24px);
  }

  .hero-inner {
    min-height: 232px;
    padding: 34px 0 30px;
  }

  .hero h1 {
    font-size: 31px;
  }

  .hero h1 span {
    display: block;
    margin: 3px 0 0;
  }

  .hero p {
    font-size: 13px;
  }

  .route-summary {
    margin-top: 22px;
  }

  .route-summary span {
    min-width: 0;
    flex: 1;
  }

  .workbench-panel {
    margin-top: 18px;
    padding: 18px 14px;
  }

  .section-head {
    align-items: flex-start;
    padding-bottom: 18px;
  }

  .section-head h2 {
    font-size: 21px;
  }

  .secure {
    margin-top: 4px;
    font-size: 10px;
  }

  .form-panel {
    padding-top: 22px;
  }

  .route-grid,
  .field-row {
    grid-template-columns: 1fr;
  }

  .route {
    min-height: 54px;
  }

  .proxy-box {
    padding: 14px 12px;
  }

  .proxy-box-head {
    align-items: flex-start;
  }

  .proxy-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .secondary {
    flex: 1 1 108px;
  }

  .proxy-diagnostic {
    flex: 1 0 100%;
    padding-top: 2px;
  }

  .billing-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .billing-note strong {
    text-align: left;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .primary {
    width: 100%;
  }

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

  .diagnostics div:last-child {
    grid-column: 1 / -1;
  }

  .footer-band {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }
}
