* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f3f4f6;
  color: #1f2937;
}

/* ---------- 居中卡片（领取 / 登录） ---------- */
.center-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.card-box {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
  padding: 32px 28px;
}
.title { margin: 0 0 22px; font-size: 22px; text-align: center; }

label { display: block; margin: 14px 0 6px; font-size: 14px; color: #4b5563; }
input[type=text], input[type=password] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  font-size: 15px;
}
input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row input { flex: 1; }
.captcha-row img { height: 44px; border-radius: 8px; cursor: pointer; border: 1px solid #e5e7eb; }

.btn-primary {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 16px;
  cursor: pointer;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-primary.small { width: auto; margin-top: 0; padding: 8px 16px; font-size: 14px; }

.alert { background: #fef2f2; color: #b91c1c; padding: 10px 12px; border-radius: 9px; font-size: 14px; margin-bottom: 6px; }
.hint { color: #4b5563; font-size: 14px; }
.result-ok { text-align: center; }
.secret {
  margin: 14px 0;
  padding: 16px;
  background: #ecfdf5;
  border: 1px dashed #10b981;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  word-break: break-all;
  font-family: ui-monospace, Consolas, monospace;
}
.meta { color: #6b7280; font-size: 13px; }
.btn-link { display: inline-block; margin-top: 8px; color: #2563eb; text-decoration: none; }
.btn-link.small { font-size: 14px; }

/* ---------- 移动端领取页 ---------- */
.claim-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #f3f4f6;
}
.claim-hero {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  padding: 34px 22px 26px;
  border-radius: 0 0 22px 22px;
}
.claim-hero h1 { margin: 0; font-size: 26px; }
.claim-sub { margin: 8px 0 0; font-size: 14px; opacity: .9; }

.claim-panel {
  flex: 1;
  background: #fff;
  margin: -14px 14px 0;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
}
.claim-panel label { margin: 18px 0 8px; font-size: 15px; color: #374151; }
.claim-panel label:first-child { margin-top: 4px; }
.claim-panel input[type=text],
.claim-panel input[type=tel] {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 11px;
  font-size: 16px; /* 16px 防止 iOS 自动放大 */
}
.claim-panel .captcha-row { display: flex; gap: 10px; }
.claim-panel .captcha-row input { flex: 1; }
.claim-panel .captcha-row img {
  height: 52px; width: 130px; border-radius: 11px;
  border: 1px solid #e5e7eb; cursor: pointer; flex: none;
}

.btn-primary.big {
  height: 54px;
  margin-top: 26px;
  font-size: 17px;
  font-weight: 600;
  border-radius: 12px;
}
.claim-tip { text-align: center; color: #9ca3af; font-size: 13px; margin: 12px 0 0; }

.result-ok { text-align: center; padding: 10px 0; }
.result-icon {
  width: 64px; height: 64px; line-height: 64px; margin: 8px auto 14px;
  background: #dcfce7; color: #16a34a; border-radius: 50%;
  font-size: 34px; font-weight: 700;
}
.btn-ghost {
  display: block; margin-top: 16px; padding: 13px;
  text-align: center; color: #2563eb; text-decoration: none;
  border: 1px solid #c7d2fe; border-radius: 11px; font-size: 15px;
}

/* 大屏时限制宽度并居中，移动端铺满 */
@media (min-width: 600px) {
  .claim-page { align-items: center; padding-top: 40px; }
  .claim-hero { width: 460px; border-radius: 22px 22px 0 0; }
  .claim-panel { width: 460px; margin: -14px 0 40px; }
}

/* ---------- 后台 ---------- */
.admin-wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px 40px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0; margin-bottom: 18px; border-bottom: 1px solid #e5e7eb;
}
.brand { font-size: 18px; font-weight: 700; }
.topbar nav a {
  margin-left: 18px; text-decoration: none; color: #4b5563; font-size: 15px;
}
.topbar nav a.active { color: #2563eb; font-weight: 600; }
.topbar nav a.logout { color: #ef4444; }

.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.stat {
  flex: 1; min-width: 120px; background: #fff; border-radius: 10px;
  padding: 14px 16px; box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.stat span { display: block; color: #6b7280; font-size: 13px; }
.stat b { font-size: 22px; }

.filters {
  display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap;
  background: #fff; padding: 16px; border-radius: 10px; margin-bottom: 16px;
}
.filters label { margin: 0; font-size: 13px; color: #4b5563; }
.filters select, .filters input[type=text] {
  display: block; margin-top: 5px; padding: 8px 10px;
  border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px;
}

.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.data-table th, .data-table td { padding: 11px 12px; text-align: left; font-size: 14px; border-bottom: 1px solid #f1f5f9; }
.data-table th { background: #f8fafc; color: #475569; font-weight: 600; }
.data-table .mono { font-family: ui-monospace, Consolas, monospace; }
.data-table .empty { text-align: center; color: #9ca3af; padding: 30px; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.tag-on { background: #dbeafe; color: #1d4ed8; }
.tag-off { background: #f3f4f6; color: #6b7280; }
.tag-used { background: #fee2e2; color: #b91c1c; }
.tag-free { background: #dcfce7; color: #15803d; }

.pager { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.pager-info { color: #6b7280; font-size: 14px; }

.import-form { background: #fff; padding: 22px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.import-form h2 { font-size: 15px; margin: 18px 0 8px; }
.import-form h2:first-child { margin-top: 0; }
.import-form textarea {
  width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 9px;
  font-family: ui-monospace, Consolas, monospace; font-size: 14px; resize: vertical;
}
.tip { color: #6b7280; font-size: 13px; background: #f8fafc; padding: 10px 12px; border-radius: 8px; }
.result-box { background: #ecfdf5; color: #065f46; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
