:root {
  --pink: #e8628c;
  --pink-soft: #fde8ef;
  --text: #3b2f33;
  --muted: #8a7a80;
  --bg: #fff8fa;
  --card: #ffffff;
  --line: #f3d6df;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px; line-height: 1.6;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 16px; }
h1 { font-size: 20px; margin: 4px 0 12px; }
.intro { background: var(--pink-soft); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.btn {
  display: inline-block; border: 0; border-radius: 999px; padding: 9px 18px;
  background: var(--pink); color: #fff; font-size: 15px; cursor: pointer; text-decoration: none;
}
.btn.ghost { background: #fff; color: var(--pink); border: 1px solid var(--pink); }
.btn:disabled { opacity: .5; }

/* 顾客选图页 */
.bar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 0; }
.code-form { display: flex; gap: 8px; }
.code-form input {
  flex: 1; min-width: 0; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 16px; text-transform: uppercase;
}
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.tabs button {
  flex: none; border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 999px; padding: 5px 14px; font-size: 14px; cursor: pointer;
}
.tabs button.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(5, 1fr); } }
.cell { background: var(--card); border-radius: 10px; overflow: hidden; cursor: pointer; }
.cell .img { aspect-ratio: 3 / 5; display: flex; align-items: center; justify-content: center; }
.cell img { max-width: 100%; max-height: 100%; display: block; }
.cell .code { text-align: center; font-size: 13px; padding: 4px 0; color: var(--muted); }
.empty, .loading { text-align: center; color: var(--muted); padding: 24px 0; }

.overlay {
  position: fixed; inset: 0; background: rgba(40, 20, 30, .75); z-index: 20;
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.overlay.show { display: flex; }
.panel { background: #fff; border-radius: 16px; padding: 16px; max-width: 420px; width: 100%; text-align: center; }
.panel img { max-width: 100%; max-height: 60vh; border-radius: 8px; }
.panel .code { font-size: 18px; font-weight: 600; margin: 8px 0; }
.panel .actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 30;
  background: rgba(40, 20, 30, .9); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; display: none; max-width: 86vw; text-align: center;
}

/* 提取结果 */
.result img.original { width: 100%; border-radius: 10px; background: #fff; display: block; margin: 12px 0; }
.message { text-align: center; padding: 60px 16px; color: var(--muted); }

/* 后台 */
.admin nav { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.admin nav a { color: var(--text); text-decoration: none; }
.admin nav a.on { color: var(--pink); font-weight: 600; }
.admin nav .right { margin-left: auto; color: var(--muted); }
.card { background: #fff; border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin: 0 0 10px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat { background: var(--pink-soft); border-radius: 10px; padding: 8px 14px; min-width: 96px; }
.stat b { display: block; font-size: 20px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: normal; }
.admin input[type=text], .admin input[type=number], .admin input[type=password], .admin select, .admin textarea {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; font-family: inherit;
}
.admin textarea { width: 100%; min-height: 70px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ok { color: #2f8f5b; }
.err { color: #c2334d; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #eee; }
.tag.unused { background: #eef3ff; color: #3858b8; }
.tag.opened { background: #fff4e0; color: #a86a00; }
.tag.claimed { background: #e6f6ee; color: #2f8f5b; }
.tag.void { background: #f1f1f1; color: #888; }
.login { max-width: 340px; margin: 60px auto; }
.login input { width: 100%; margin-bottom: 10px; }
.muted { color: var(--muted); font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, monospace; }
