:root {
  color-scheme: dark;
  --bg: #10141c;
  --card: #1b2230;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f7fb;
  --muted: #9aa6b8;
  --accent: #8eb6ff;
  --danger: #ffb4a8;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input, textarea { font: inherit; }
.top, .notice, .tools, .list, .empty {
  width: min(640px, calc(100% - 28px));
  margin-left: auto;
  margin-right: auto;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(18px + env(safe-area-inset-top)) 0 8px;
}
h1, h2 { margin: 0; font-weight: 650; }
.top p, .empty { color: var(--muted); }
.top p { margin: 4px 0 0; font-size: 13px; }
.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(142, 182, 255, 0.35);
  border-radius: 16px;
  background: #182236;
}
.notice p { margin: 0; font-size: 14px; }
.notice .actions { flex-shrink: 0; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 12px; }
.tools button, .sheet button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.add, .sheet button.add {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #2c6bed;
  color: white;
  cursor: pointer;
}
.list { display: grid; gap: 12px; padding-bottom: 28px; }
.card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}
.card h2 { font-size: 1rem; }
.code {
  grid-column: 1;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 2.4rem;
  letter-spacing: 0.16em;
  text-align: left;
  cursor: pointer;
}
.meta { grid-column: 1; color: var(--muted); font-size: 13px; }
.side { grid-row: 1 / span 3; grid-column: 2; display: grid; justify-items: center; gap: 8px; }
.ring {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#8eb6ff calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0);
}
.ring span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--card);
  font-size: 13px;
}
.remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.empty { text-align: center; }
.mask {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
}
.sheet {
  width: min(640px, 100%);
  display: grid;
  gap: 12px;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 16px 16px;
  background: #171d29;
}
label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
input, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10141c;
  color: var(--text);
  font-size: 16px;
}
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.actions button:first-child { background: transparent; color: var(--text); border: 1px solid var(--line); }
.error { margin: 0; color: var(--danger); }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 999px;
  background: #243049;
  color: white;
}
[hidden] { display: none !important; }
