:root {
  --bg: #f5efe3;
  --panel: rgba(255, 252, 245, 0.92);
  --panel-strong: #fffdf8;
  --text: #1f2a28;
  --muted: #6c736e;
  --line: rgba(40, 58, 52, 0.12);
  --accent: #0e7a63;
  --accent-deep: #0b5c4a;
  --warn: #c7602b;
  --shadow: 0 18px 40px rgba(49, 44, 33, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(14, 122, 99, 0.14), transparent 26%),
    radial-gradient(circle at bottom right, rgba(199, 96, 43, 0.12), transparent 28%),
    linear-gradient(180deg, #fbf7ee 0%, #f3ead8 100%);
  min-height: 100vh;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 480px);
}

.login-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.login-card {
  padding: 32px;
}

.hero-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #6ac39f);
  color: white;
  font-weight: 800;
  letter-spacing: 0.08em;
}

h1,
h2 {
  margin: 0;
}

.login-card p,
.eyebrow,
.panel p,
.panel-subtitle,
label span,
.tips,
th,
.badge,
.stat-card span {
  color: var(--muted);
}

.stack,
.form-grid,
.app-shell,
.log-list {
  display: grid;
  gap: 16px;
}

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

.full,
.action-row {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
}

textarea {
  resize: vertical;
}

button {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  background: var(--accent-deep);
}

button.secondary {
  background: #dde9e4;
  color: var(--text);
}

button.danger {
  background: #b4472f;
  color: white;
}

button.danger:hover {
  background: #8f321f;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.locked-field {
  background: rgba(233, 230, 220, 0.62);
  color: var(--muted);
  cursor: not-allowed;
}

.notice {
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
}

.notice.error {
  background: rgba(199, 96, 43, 0.1);
  color: var(--warn);
}

.notice.warn {
  background: rgba(199, 96, 43, 0.08);
  color: #8a461f;
  margin: 14px 0;
}

.notice.success {
  background: rgba(14, 122, 99, 0.12);
  color: var(--accent-deep);
}

.hidden {
  display: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 28px 28px 8px;
}

.topbar-actions,
.panel-title-row,
.api-actions,
.switch-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.badge,
.inline-code {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
}

.app-shell {
  padding: 20px 28px 32px;
}

.panel {
  padding: 22px;
}

.two-col {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.6fr 1fr;
}

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

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

.stat-card {
  background: var(--panel-strong);
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--line);
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.result-box,
.log-item,
table {
  background: var(--panel-strong);
}

.result-box {
  min-height: 220px;
  border-radius: 18px;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
}

.small-result {
  min-height: 120px;
  margin-top: 16px;
}

.result-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.result-title strong {
  font-size: 18px;
}

.result-title span {
  color: var(--accent-deep);
  font-weight: 700;
}

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

.kv-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.58);
  min-width: 0;
}

.kv-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.kv-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  padding: 18px;
  background: rgba(255, 255, 255, 0.45);
}

.compact-table {
  border: 1px solid var(--line);
  border-radius: 16px;
}

.raw-json {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.raw-json summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.raw-json pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  margin-bottom: 0;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 18px;
  overflow: hidden;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.log-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}

.log-item pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0 0;
  font-size: 12px;
}

@media (max-width: 920px) {
  .form-grid,
  .two-col,
  .bottom-grid,
  .stats-grid,
  .kv-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-shell,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }
}
