:root {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  color: #172033;
  background: #f2f5fb;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(66, 133, 244, 0.16), transparent 32rem),
    #f2f5fb;
}

button {
  font: inherit;
}

.page-shell {
  width: min(100% - 32px, 720px);
  margin: 0 auto;
  padding: 28px 0 56px;
}

.card {
  padding: 24px;
  border: 1px solid #dfe5ef;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 45px rgba(43, 55, 82, 0.09);
}

.card + .card {
  margin-top: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #3667c8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(26px, 7vw, 38px);
  line-height: 1.18;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.intro,
.notice {
  color: #5f6c82;
  line-height: 1.7;
}

.source-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 22px 0;
}

.source-button,
.secondary-button,
.text-button {
  border: 1px solid #ccd5e4;
  color: #33415c;
  background: #fff;
  cursor: pointer;
}

.source-button {
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.source-button.active {
  border-color: #356fdc;
  color: #2059c1;
  background: #eef4ff;
  box-shadow: inset 0 0 0 1px #356fdc;
}

.source-button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.config-list {
  margin: 0 0 22px;
  border-top: 1px solid #edf0f5;
}

.config-list div {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #edf0f5;
}

.config-list dt {
  color: #718096;
}

.config-list dd {
  min-width: 0;
  margin: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

code {
  color: #254f9e;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.status-panel {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 78px;
  margin-bottom: 16px;
  padding: 15px;
  border-radius: 14px;
  background: #f7f9fc;
}

.status-panel p {
  margin: 5px 0 0;
  color: #68758a;
  line-height: 1.5;
}

.status-dot {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  margin-top: 5px;
  border-radius: 50%;
  background: #9aa6b8;
  box-shadow: 0 0 0 5px rgba(154, 166, 184, 0.15);
}

.status-dot.loading {
  background: #f2a100;
  box-shadow: 0 0 0 5px rgba(242, 161, 0, 0.15);
}

.status-dot.success {
  background: #1a9c5a;
  box-shadow: 0 0 0 5px rgba(26, 156, 90, 0.15);
}

.status-dot.error {
  background: #d64045;
  box-shadow: 0 0 0 5px rgba(214, 64, 69, 0.15);
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 52px;
  border-radius: 14px;
  font-weight: 800;
}

.primary-button {
  border: 0;
  color: #fff;
  background: #2869dc;
  box-shadow: 0 10px 20px rgba(40, 105, 220, 0.22);
  cursor: pointer;
}

.secondary-button {
  margin-top: 10px;
}

.notice {
  margin: 17px 0 0;
  font-size: 13px;
}

.log-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.text-button {
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13px;
}

.event-log {
  display: grid;
  gap: 8px;
  max-height: 360px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  overflow: auto;
}

.event-log li {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #42506a;
  background: #f7f9fc;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.event-log time {
  color: #7a879d;
}

@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 20px, 720px);
    padding-top: 10px;
  }

  .card {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .source-switch {
    grid-template-columns: 1fr;
  }
}
