:root {
  --bg: #f5f6fa;
  --fg: #1f2430;
  --muted: #6b7280;
  --line: #e2e6ee;
  --accent: #2f6fed;
  --danger: #d64545;
  --ok: #2e9e5b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  padding: 48px 16px;
}

.card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 15px; margin: 20px 0 10px; }
section { margin-top: 8px; }
section + section { border-top: 1px solid var(--line); padding-top: 4px; }

.err { color: var(--danger); background: #fdecec; border: 1px solid #f5c6c6; border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.ok  { color: var(--ok); background: #eaf7f0; border: 1px solid #bfe6cf; border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; }

.code-input { display: flex; gap: 6px; align-items: center; margin: 12px 0; }
.code-input .box {
  width: 38px; height: 48px; text-align: center; font-size: 20px;
  border: 1px solid var(--line); border-radius: 8px; outline: none;
  text-transform: uppercase;
}
.code-input .box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15); }
.code-input .dash { color: var(--muted); font-size: 22px; margin: 0 4px; }

button {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 10px 16px; font-size: 14px; cursor: pointer;
}
button:hover { filter: brightness(0.95); }
button.danger { background: var(--danger); }

input[type="text"] {
  width: 100%; padding: 10px 12px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 8px; outline: none;
  text-transform: uppercase;
}
input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15); }

.stack { display: flex; flex-direction: column; gap: 10px; }

.qr { text-align: center; margin: 12px 0; }
.qr img { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 8px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; }
.actions form.inline { display: inline-block; margin-right: 6px; }
.actions button { padding: 6px 10px; font-size: 12px; }

.topnav { text-align: right; margin-bottom: 8px; }
.topnav form.inline { display: inline-block; }
button.linklike {
  background: none; color: var(--accent); padding: 0; border: none;
  font-size: 13px; cursor: pointer; text-decoration: none;
}
button.linklike:hover { filter: none; text-decoration: underline; }

code {
  background: #f0f2f7; border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 5px; font-size: 12px;
}
