:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f0f5f3;
  --text: #1e2428;
  --muted: #68757d;
  --border: #dce2e5;
  --accent: #1f8a70;
  --accent-strong: #166c58;
  --blue: #2b64b1;
  --amber: #a45c12;
  --danger: #b3261e;
  --shadow: 0 14px 45px rgba(31, 42, 48, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(440px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-row,
.title-block,
.topbar-actions,
.panel-heading,
.method-row {
  display: flex;
  align-items: center;
}

.brand-row {
  gap: 14px;
  margin-bottom: 26px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  background: #12362f;
  color: #ffffff;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark.compact {
  width: 38px;
  height: 38px;
  font-size: 13px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  font-weight: 760;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
  font-weight: 720;
  line-height: 1.2;
}

p,
.hint-text {
  color: var(--muted);
  font-size: 13px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

input,
select {
  height: 40px;
  padding: 0 12px;
}

textarea {
  padding: 10px 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 138, 112, 0.16);
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.primary-button {
  width: 100%;
  margin-top: 16px;
  padding: 0 16px;
  background: var(--accent);
  color: #ffffff;
}

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

.secondary-button,
.ghost-button {
  padding: 0 14px;
  background: #edf1f3;
  color: var(--text);
}

.secondary-button:hover,
.ghost-button:hover {
  background: #e2e8eb;
}

.icon-button {
  width: 40px;
  background: #edf1f3;
  color: var(--text);
}

.form-message {
  min-height: 20px;
  margin-top: 12px;
  color: var(--muted);
}

.form-message.error {
  color: var(--danger);
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.title-block {
  gap: 12px;
  min-width: 0;
}

.topbar-actions {
  gap: 10px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(420px, 1.2fr);
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 24px;
}

.column,
.stack {
  display: grid;
  align-content: start;
  gap: 18px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(31, 42, 48, 0.05);
}

.panel-heading {
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.panel > form,
.panel > .code-block,
.panel > .list-table,
.panel > .form-message {
  margin: 18px;
}

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

.span-2 {
  grid-column: span 2;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
}

.fixed-account {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.fixed-account span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.fixed-account strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 760;
}

.check-row input {
  width: 16px;
  height: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 760;
}

.status-pill.mock {
  background: #fff5e9;
  color: var(--amber);
}

.status-pill.remote {
  background: #eaf7f2;
  color: var(--accent-strong);
}

.result-panel {
  min-height: 460px;
}

.code-block {
  overflow: auto;
  min-height: 360px;
  max-height: 620px;
  padding: 14px;
  background: #111719;
  color: #d9f0e8;
  border-radius: 6px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.code-block.small {
  min-height: 118px;
  max-height: 340px;
}

.call-form {
  display: grid;
  gap: 14px;
}

.method-row {
  gap: 10px;
}

.method-row select {
  width: 120px;
  flex: 0 0 auto;
}

.lower-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 28px;
}

.list-table {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
}

.list-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcfc;
}

.list-item strong {
  color: var(--text);
  font-size: 13px;
}

.list-item span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  background: #12362f;
  color: #ffffff;
  border-radius: 6px;
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

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

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .secondary-button {
    flex: 1;
  }

  .workspace,
  .lower-grid {
    padding-right: 14px;
    padding-left: 14px;
  }

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

  .span-2 {
    grid-column: auto;
  }

  .method-row {
    align-items: stretch;
    flex-direction: column;
  }

  .method-row select {
    width: 100%;
  }
}
