:root {
  --bg: #0f1115;
  --panel: #171a21;
  --border: #272b35;
  --text: #e6e8ec;
  --muted: #8b90a0;
  --accent: #4c8bf5;
  --ok: #3fb950;
  --warn: #d29922;
  --err: #f85149;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 1rem;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.hidden { display: none !important; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 820px;
  margin: 0 auto 1rem;
}

h1 { font-size: 1.25rem; margin: 0; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }

.login {
  max-width: 360px;
  margin: 15vh auto;
  padding: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.tabs {
  display: flex;
  gap: .25rem;
  max-width: 820px;
  margin: 0 auto 1rem;
  overflow-x: auto;
}

.tab {
  flex: 1;
  min-width: 72px;
  padding: .55rem .75rem;
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.tab.active { color: var(--text); border-color: var(--accent); }

.panel, .card {
  max-width: 820px;
  margin: 0 auto 1rem;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

label { display: block; margin-bottom: .85rem; color: var(--muted); font-size: .9rem; }

input, select, textarea {
  width: 100%;
  margin-top: .3rem;
  padding: .55rem .7rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  font: inherit;
}

textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

button {
  padding: .55rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  font: inherit;
  cursor: pointer;
}

button:disabled { opacity: .5; cursor: default; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
button.danger { background: transparent; color: var(--err); border: 1px solid var(--err); }

.toolbar { display: flex; gap: .5rem; margin-bottom: 1rem; }
.toolbar select { flex: 1; margin-top: 0; }

.item {
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
}
.item:last-child { border-bottom: none; }

.item-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.item-title { font-weight: 600; }
.item-meta { color: var(--muted); font-size: .82rem; }
.item-body {
  margin: .4rem 0 0;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .9rem;
}

.badge {
  display: inline-block;
  padding: .1rem .45rem;
  border-radius: 5px;
  font-size: .75rem;
}
.badge.ok { background: rgba(63,185,80,.15); color: var(--ok); }
.badge.pending { background: rgba(210,153,34,.15); color: var(--warn); }
.badge.failed { background: rgba(248,81,73,.15); color: var(--err); }
.badge.deduped { background: rgba(139,144,160,.15); color: var(--muted); }

.key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
  word-break: break-all;
  color: var(--muted);
}

.row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.hint { color: var(--muted); font-size: .85rem; margin: .2rem 0 .8rem; }
.error { color: var(--err); min-height: 1.2em; font-size: .9rem; }
.result { color: var(--ok); min-height: 1.2em; font-size: .9rem; }

@media (max-width: 600px) {
  body { padding: .5rem; }
  .panel, .card { padding: .75rem; }
}
