:root {
  color-scheme: dark;
  --bg: #0f1115;
  --card: #171a21;
  --line: #262b36;
  --text: #e6e6e6;
  --muted: #9aa0ac;
  --accent: #4f8cff;
}

* { box-sizing: border-box; }

/* `hidden` 属性必须优先于任何 display 规则，否则带 display 的容器会忽略它。 */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 24px 16px 64px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.topbar h1 { font-size: 22px; margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.card h2 { font-size: 16px; margin: 0 0 16px; }

input[type="password"], input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #10131a;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 12px;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  color: #fff;
}
button.primary { background: var(--accent); }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
button.danger { background: #d24b4b; }
button.small { padding: 6px 10px; font-size: 13px; }

.drop {
  display: block;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  margin-bottom: 12px;
  cursor: pointer;
}
.drop input { display: none; }

.msg { margin: 10px 0 0; min-height: 20px; font-size: 13px; }
.msg.err { color: #ff7b7b; }
.msg.ok { color: #6fd08c; }

.upload-preview {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px;
}
.upload-preview img {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: 8px; background: #000; flex: none;
}
.upload-preview span { color: var(--muted); font-size: 13px; min-width: 0; word-break: break-all; }
.upload-preview button { margin-left: auto; flex: none; }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: #1f232d; border: 1px solid var(--line); color: var(--text);
  padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 99;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}
.toast.ok { color: #6fd08c; }
.toast.err { color: #ff7b7b; }

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

.list { display: flex; flex-direction: column; gap: 12px; }

.item {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px;
}
.item img.thumb {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: 8px; background: #000; flex: none;
}
.item .meta { flex: 1; min-width: 0; }
.item .meta .code { font-family: ui-monospace, monospace; font-weight: 600; }
.item .meta .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.item .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.item .qr { width: 56px; height: 56px; image-rendering: pixelated; }
