/* ============================================================
   卡密兑换系统 视觉样式 v2（全面美化）
   领取页：深蓝星空渐变 + 玻璃拟态 + 光晕动效（移动端优先）
   后台：深色顶栏 + 现代 SaaS 浅色工作区 + 渐变点缀
   ============================================================ */
:root {
  --blue: #2563eb;
  --blue-2: #0ea5e9;
  --cyan: #22d3ee;
  --green: #16a34a;
  --red: #dc2626;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6ecf4;
  --bg: #eef2f7;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 30px rgba(15, 23, 42, .06);
  --shadow-lg: 0 30px 70px rgba(2, 20, 60, .38);
  --g-brand: linear-gradient(135deg, #2563eb, #0ea5e9 55%, #22d3ee);
  --g-brand-2: linear-gradient(135deg, #1d4ed8, #0891b2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; }
.mono { font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace; letter-spacing: .4px; }
.strong { font-weight: 700; }
.dim { color: var(--muted); font-size: 12px; }

/* ============================================================
   领取页
   ============================================================ */
.page-redeem {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  overflow: hidden;
  background:
    radial-gradient(1100px 420px at 82% -8%, rgba(34, 211, 238, .4), transparent 62%),
    radial-gradient(900px 460px at -12% 112%, rgba(37, 99, 235, .5), transparent 62%),
    radial-gradient(700px 300px at 50% 120%, rgba(14, 165, 233, .28), transparent 60%),
    linear-gradient(168deg, #060d1f 0%, #0b1b3a 46%, #0a3a86 100%);
}
.page-redeem::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.6px),
    radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1.6px);
  background-size: 46px 46px, 92px 92px;
  background-position: 0 0, 23px 23px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 75%);
  pointer-events: none;
}
.page-redeem::after {
  content: "";
  position: absolute;
  width: 320px; height: 320px;
  top: -90px; right: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, .32), transparent 65%);
  filter: blur(4px);
  animation: float 11s ease-in-out infinite;
  pointer-events: none;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-14px, 18px) scale(1.07); }
}
@keyframes floatB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(10px, -16px) scale(1.05); }
}

.redeem-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.redeem-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .97), rgba(244, 248, 255, .92));
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  border-radius: 26px;
  padding: 36px 28px 26px;
  box-shadow:
    0 30px 70px rgba(2, 20, 60, .42),
    inset 0 1px 0 rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .55);
  animation: cardIn .55s cubic-bezier(.2, .8, .3, 1.05) both;
}
/* 卡片顶部渐变光条 */
.redeem-card::before {
  content: "";
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: var(--g-brand);
  box-shadow: 0 4px 18px rgba(14, 165, 233, .55);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(22px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.brand { text-align: center; margin-bottom: 26px; }
.brand-logo {
  width: 64px; height: 64px; line-height: 64px;
  margin: 0 auto 15px;
  border-radius: 20px;
  font-size: 28px; font-weight: 800; color: #fff;
  background: var(--g-brand);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .45), inset 0 1px 0 rgba(255, 255, 255, .45);
  position: relative;
}
.brand-logo::after {
  content: ""; position: absolute; inset: -8px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(37, 99, 235, .4), rgba(34, 211, 238, .25));
  filter: blur(14px);
  z-index: -1;
}
.brand h1 {
  font-size: 24px; font-weight: 800; letter-spacing: .5px;
  background: var(--g-brand-2);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand .sub { color: #7c8aa0; font-size: 13.5px; margin-top: 7px; }

.key-input {
  width: 100%;
  padding: 16px 14px;
  font-size: 17px;
  letter-spacing: 2px;
  text-align: center;
  border: 2px solid #dfe7f2;
  border-radius: 16px;
  outline: none;
  background: #fbfdff;
  transition: border-color .2s, box-shadow .2s, background .2s;
  font-family: "SF Mono", Consolas, Menlo, monospace;
}
.key-input:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, .13), 0 8px 24px rgba(37, 99, 235, .1);
}
.key-input::placeholder { letter-spacing: 0; color: #a7b3c4; font-size: 13.5px; font-family: inherit; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 14px;
  cursor: pointer; font-size: 15px; font-weight: 700;
  padding: 13px 22px;
  transition: transform .08s, box-shadow .2s, opacity .15s, filter .2s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary {
  color: #fff;
  background: var(--g-brand);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .38), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn.primary:hover:not(:disabled) {
  filter: brightness(1.07);
  box-shadow: 0 12px 30px rgba(37, 99, 235, .48), inset 0 1px 0 rgba(255, 255, 255, .35);
  transform: translateY(-1px);
}
.btn-block { width: 100%; margin-top: 16px; }
.btn.ghost { background: #eef3fa; color: var(--ink-2); }
.btn.ghost:hover { background: #e4ecf7; }
.btn.sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; }
.btn.green { background: linear-gradient(135deg, #16a34a, #22c55e); color: #fff; box-shadow: 0 6px 16px rgba(22, 163, 74, .3); }
.btn.green:hover { filter: brightness(1.06); }
.btn.red { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; box-shadow: 0 6px 16px rgba(220, 38, 38, .3); }

.loading {
  text-align: center; color: var(--muted); font-size: 14px;
  padding: 16px 0;
}
.loading::before {
  content: "";
  display: inline-block; width: 16px; height: 16px;
  margin-right: 8px; vertical-align: -2px;
  border: 2.5px solid #c7d6ea; border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tips { text-align: center; color: #9aa8ba; font-size: 12px; margin-top: 20px; }

/* PC 端左侧品牌区（窄屏隐藏） */
.redeem-side { display: none; }
@media (min-width: 960px) {
  .redeem-wrap { gap: 64px; }
  .redeem-side { display: block; width: 400px; color: #fff; position: relative; z-index: 1; }
  .redeem-card { max-width: 440px; }
  .redeem-card .brand { display: none; }
  .side-logo {
    width: 64px; height: 64px; line-height: 64px; text-align: center;
    border-radius: 20px; font-size: 28px; font-weight: 800; color: #fff;
    background: var(--g-brand);
    box-shadow: 0 12px 28px rgba(37, 99, 235, .5), inset 0 1px 0 rgba(255, 255, 255, .45);
    position: relative;
  }
  .side-logo::after {
    content: ""; position: absolute; inset: -8px;
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(37, 99, 235, .4), rgba(34, 211, 238, .25));
    filter: blur(14px);
    z-index: -1;
  }
  .side-brand h2 {
    font-size: 32px; font-weight: 800; margin: 18px 0 10px; letter-spacing: .5px;
    text-shadow: 0 2px 20px rgba(14, 165, 233, .35);
  }
  .side-brand p { color: rgba(255, 255, 255, .72); font-size: 14.5px; }
  .side-steps { margin: 36px 0 32px; display: flex; flex-direction: column; gap: 14px; }
  .step-item {
    display: flex; gap: 14px; align-items: flex-start;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 16px; padding: 15px 16px;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    transition: transform .2s, background .2s, border-color .2s;
  }
  .step-item:hover { transform: translateX(6px); background: rgba(255, 255, 255, .13); border-color: rgba(34, 211, 238, .35); }
  .step-num {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 11px;
    background: var(--g-brand);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .45);
  }
  .step-item b { font-size: 15px; }
  .step-item p { color: rgba(255, 255, 255, .68); font-size: 12.5px; margin-top: 4px; }
  .side-tip { color: rgba(255, 255, 255, .6); font-size: 13px; border-top: 1px solid rgba(255, 255, 255, .15); padding-top: 18px; }
  .side-admin-link { color: #7dd3fc; }
}

.result { margin-top: 8px; }
.result .err {
  background: #fef2f2; color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 16px; padding: 15px 16px;
  font-size: 14px; text-align: center;
  animation: cardIn .3s ease both;
}

.ok-check { text-align: center; animation: cardIn .35s cubic-bezier(.2, .8, .3, 1.1) both; }
.product-tag {
  display: inline-block;
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  color: #1d4ed8;
  font-size: 12px; font-weight: 700; padding: 6px 16px; border-radius: 999px;
  margin-bottom: 12px;
  border: 1px solid rgba(37, 99, 235, .15);
}
.product-name {
  font-size: 30px; font-weight: 800;
  background: var(--g-brand-2);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 10px;
}
.product-desc { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.confirm-hint { color: #475569; font-size: 13px; margin: 2px 0 16px; }

.ok-claim { animation: pop .4s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes pop {
  0% { opacity: 0; transform: scale(.92) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.ok-claim .success-badge {
  display: inline-block;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff; font-size: 13px; font-weight: 700;
  padding: 8px 22px; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(22, 163, 74, .4), inset 0 1px 0 rgba(255, 255, 255, .35);
  margin-bottom: 16px;
}
.claim-product { font-size: 17px; font-weight: 700; margin-bottom: 16px; }
.field {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #f7fafd; border: 1px solid var(--line); border-radius: 13px;
  padding: 12px 14px; margin-bottom: 10px; text-align: left;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field:focus-within { border-color: #93c5fd; background: #fbfdff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .07); }
.field > span { color: var(--muted); font-size: 13px; flex-shrink: 0; width: 62px; }
.group-title {
  font-size: 12px; font-weight: 700; color: #2563eb;
  margin: 4px 0 8px; text-align: left;
  display: flex; align-items: center; gap: 6px;
}
.group-title::before {
  content: ""; width: 3px; height: 13px; border-radius: 2px;
  background: var(--g-brand);
}
.group-title:first-child { margin-top: 0; }
.field .val {
  flex: 1; font-size: 15px; word-break: break-all; font-weight: 600;
  font-family: "SF Mono", Consolas, Menlo, monospace;
}
.copy {
  flex-shrink: 0;
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  color: #1d4ed8; border: 1px solid rgba(37, 99, 235, .15);
  font-size: 12px; font-weight: 600; padding: 6px 13px; border-radius: 9px; cursor: pointer;
  transition: background .15s, transform .08s;
}
.copy:hover { background: #dbeafe; }
.copy:active { transform: scale(.95); }
.save-tip { color: #9aa8ba; font-size: 12px; margin-top: 14px; text-align: center; }

/* ============================================================
   后台登录页
   ============================================================ */
.page-login {
  position: relative;
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  overflow: hidden;
  background:
    radial-gradient(1000px 460px at 100% 0%, rgba(34, 211, 238, .35), transparent 60%),
    radial-gradient(900px 460px at 0% 100%, rgba(37, 99, 235, .5), transparent 62%),
    linear-gradient(165deg, #060d1f, #0b1b3a 55%, #0a3a86);
}
.page-login::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.6px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 75%);
  pointer-events: none;
}
.page-login::after {
  content: "";
  position: absolute;
  width: 280px; height: 280px;
  bottom: -100px; left: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129, 140, 248, .3), transparent 65%);
  animation: floatB 12s ease-in-out infinite;
  pointer-events: none;
}
.login-card {
  position: relative;
  z-index: 1;
  width: 100%; max-width: 380px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .97), rgba(244, 248, 255, .92));
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  border-radius: 24px;
  padding: 40px 30px 30px;
  box-shadow: 0 30px 70px rgba(2, 20, 60, .42), inset 0 1px 0 rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .55);
  animation: cardIn .55s cubic-bezier(.2, .8, .3, 1.05) both;
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: var(--g-brand);
  box-shadow: 0 4px 18px rgba(14, 165, 233, .55);
}
.login-logo {
  width: 58px; height: 58px; line-height: 58px;
  margin: 0 auto 16px;
  border-radius: 18px;
  font-size: 26px; font-weight: 800; color: #fff; text-align: center;
  background: var(--g-brand);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .45), inset 0 1px 0 rgba(255, 255, 255, .45);
  position: relative;
}
.login-logo::after {
  content: ""; position: absolute; inset: -8px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(37, 99, 235, .4), rgba(34, 211, 238, .25));
  filter: blur(14px);
  z-index: -1;
}
.login-card h2 {
  font-size: 22px; font-weight: 800; text-align: center;
  background: var(--g-brand-2);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-card .sub { color: var(--muted); font-size: 13px; margin: 7px 0 26px; text-align: center; }
.form-item { margin-bottom: 17px; }
.form-item label { display: block; font-size: 13px; color: #475569; margin-bottom: 7px; font-weight: 600; }
.form-item input {
  width: 100%; padding: 13px 14px; font-size: 15px;
  border: 2px solid #dfe7f2; border-radius: 13px; outline: none;
  background: #fbfdff; transition: border-color .2s, box-shadow .2s;
}
.form-item input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.login-error { color: var(--red); font-size: 13px; margin-bottom: 14px; text-align: center; }

/* ============================================================
   后台管理页（现代 SaaS）
   ============================================================ */
.page-admin {
  min-height: 100vh;
  background:
    radial-gradient(900px 320px at 100% 0%, rgba(37, 99, 235, .08), transparent 60%),
    radial-gradient(800px 300px at 0% 100%, rgba(14, 165, 233, .07), transparent 60%),
    linear-gradient(180deg, #f4f7fc, #edf1f8);
}
.admin-topbar {
  background: linear-gradient(90deg, #0a1329, #0d1f45 55%, #10306b);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 26px;
  position: sticky; top: 0; z-index: 30;
  box-shadow: 0 6px 24px rgba(2, 20, 60, .35);
  border-bottom: 1px solid rgba(34, 211, 238, .25);
}
.admin-title {
  font-size: 16px; font-weight: 800; letter-spacing: .3px;
  display: flex; align-items: center; gap: 10px;
}
.admin-title::before {
  content: ""; display: inline-block; width: 11px; height: 11px;
  border-radius: 4px;
  background: var(--g-brand);
  box-shadow: 0 0 14px rgba(34, 211, 238, .9);
}
.admin-user { display: flex; align-items: center; gap: 16px; }
.admin-user a {
  color: #93c5fd; font-size: 13px; font-weight: 600;
  padding: 7px 13px; border-radius: 10px;
  transition: background .15s, color .15s;
}
.admin-user a:hover { background: rgba(255, 255, 255, .1); color: #dbeafe; }
.admin-user a:last-child { color: #fca5a5; }
.admin-user a:last-child:hover { background: rgba(220, 38, 38, .18); color: #fecaca; }

.admin-nav {
  display: flex; gap: 4px; overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px 20px;
  position: sticky; top: 52px; z-index: 29;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
  scrollbar-width: none;
}
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav .tab {
  border: none; background: transparent; cursor: pointer;
  font-size: 13.5px; color: #5b6b82; font-weight: 600;
  padding: 9px 16px; white-space: nowrap;
  border-radius: 12px;
  transition: color .18s, background .18s, box-shadow .18s;
}
.admin-nav .tab:hover { color: var(--blue); background: #f0f5fd; }
.admin-nav .tab.active {
  color: #fff;
  background: var(--g-brand);
  box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}

.admin-main { max-width: 1140px; margin: 0 auto; padding: 26px 20px 80px; }
.panel { animation: fadeIn .28s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 统计卡片 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.stat-card {
  position: relative;
  background: #fff; border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 13px;
  transition: transform .18s, box-shadow .22s;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 14px; right: 14px;
  height: 2.5px;
  border-radius: 0 0 4px 4px;
  background: var(--g-brand);
  opacity: .85;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(15, 23, 42, .12); }
.stat-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--c, #2563eb), color-mix(in srgb, var(--c, #2563eb) 72%, white));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--c, #2563eb) 38%, transparent);
}
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value {
  font-size: 26px; font-weight: 800; margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

/* 内容卡片 */
.card {
  background: #fff; border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px;
  border: 1px solid rgba(226, 232, 240, .7);
}
.card-title { font-size: 15.5px; font-weight: 800; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card-title::before {
  content: "";
  width: 4px; height: 15px; border-radius: 2px;
  background: var(--g-brand);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head .card-title { margin-bottom: 0; }
.head-actions { display: flex; gap: 8px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 15px; }
.toolbar select, .toolbar input[type=number] {
  padding: 9px 12px; font-size: 13px;
  border: 1px solid #d9e2ee; border-radius: 11px;
  background: #fff; font-family: inherit; color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.toolbar select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }

/* 表格 */
.table-wrap {
  overflow-x: auto;
  border: 1px solid #e9eef6;
  border-radius: 14px;
}
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 600px; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #eef2f7; vertical-align: top; }
.table th {
  color: #5b6b82; font-weight: 700; background: #f6f9fd; white-space: nowrap; font-size: 12.5px;
}
.table th:first-child { border-radius: 14px 0 0 0; }
.table th:last-child { border-radius: 0 14px 0 0; }
.table td { word-break: break-all; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f5f9ff; }
.table tr:last-child td { border-bottom: none; }
.table .empty { text-align: center; color: #9aa8ba; padding: 36px 0; }

.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.badge { display: inline-block; font-size: 12px; padding: 4px 12px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: #dcfce7; color: #15803d; }
.badge.danger { background: #fee2e2; color: #b91c1c; }
.badge.muted { background: #f1f5f9; color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.op-link { color: var(--blue); cursor: pointer; font-size: 13px; font-weight: 600; margin-right: 12px; }
.op-link:hover { text-decoration: underline; }
.op-link.danger { color: var(--red); }

.form-card { max-width: 540px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(6, 13, 31, .6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .18s ease both;
}
.modal {
  position: relative;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border-radius: 22px;
  padding: 28px 26px 24px;
  width: 100%; max-width: 480px;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 34px 80px rgba(2, 20, 60, .4);
  border: 1px solid rgba(255, 255, 255, .7);
  animation: pop .3s cubic-bezier(.2, .8, .3, 1.15) both;
}
.modal::before {
  content: "";
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: var(--g-brand);
  box-shadow: 0 4px 16px rgba(14, 165, 233, .5);
}
.modal h3 { font-size: 17px; font-weight: 800; margin-bottom: 20px; }
.modal label { display: block; font-size: 13px; color: #475569; margin-bottom: 14px; font-weight: 600; }
.modal input, .modal textarea, .modal select {
  width: 100%; margin-top: 7px; padding: 11px 13px; font-size: 14px;
  border: 1.5px solid #d9e2ee; border-radius: 11px; outline: none;
  font-family: inherit; color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.modal input:focus, .modal textarea:focus, .modal select:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.modal textarea { resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal .file-hint { color: #94a3b8; font-size: 12px; margin-top: 2px; font-weight: 400; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 42px;
  transform: translateX(-50%) translateY(24px);
  background: rgba(15, 23, 42, .92);
  color: #fff; font-size: 14px;
  padding: 13px 26px; border-radius: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity .28s, transform .28s;
  z-index: 100;
  box-shadow: 0 16px 40px rgba(2, 20, 60, .4);
  border: 1px solid rgba(255, 255, 255, .12);
  max-width: 86vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: rgba(220, 38, 38, .94); }

/* 窄屏适配 */
@media (max-width: 640px) {
  .admin-main { padding: 16px 12px 64px; }
  .admin-topbar { padding: 13px 16px; }
  .admin-nav { padding: 8px; top: 49px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .redeem-card { padding: 30px 20px 24px; }
  .card-head { flex-wrap: wrap; }
  .head-actions { flex-wrap: wrap; }
  .modal { padding: 24px 18px 20px; }
}

/* ========== 批量兑换模式 ========== */
.mode-tabs {
  display: flex;
  gap: 6px;
  background: #eef3fa;
  border: 1px solid #e2e9f3;
  border-radius: 16px;
  padding: 5px;
  margin-bottom: 20px;
}
.mode-tab {
  flex: 1;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s;
}
.mode-tab.active {
  background: var(--g-brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .4);
}
.batch-step { display: flex; flex-direction: column; gap: 12px; }
.batch-step[hidden] { display: none; }
.batch-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 128px;
  padding: 14px;
  font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink);
  background: #f8fafc;
  border: 2px solid #dfe7f2;
  border-radius: 14px;
  outline: none;
  resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.batch-input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.batch-actions { display: flex; gap: 10px; }
.batch-actions .btn { flex: 1; }
.batch-tip { font-size: 12px; color: #94a3b8; text-align: center; }
.batch-summary { font-size: 15px; margin-bottom: 14px; color: var(--ink-2); }
.batch-summary b.ok { color: #16a34a; }
.batch-summary b.fail { color: #dc2626; }
.br-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.br-item {
  background: #f8fafc;
  border: 1px solid #e5ecf5;
  border-radius: 16px;
  padding: 14px;
  text-align: left;
  transition: box-shadow .2s, border-color .2s;
}
.br-item:hover { box-shadow: 0 8px 22px rgba(15, 23, 42, .08); border-color: #c9dcf5; }
.br-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.br-key { font-size: 13px; color: #2563eb; font-weight: 600; word-break: break-all; }
.br-badge { font-size: 12px; font-weight: 700; padding: 3px 11px; border-radius: 999px; white-space: nowrap; }
.br-badge.ok { background: #dcfce7; color: #15803d; }
.br-badge.fail { background: #fee2e2; color: #b91c1c; }
.br-product { font-size: 15px; font-weight: 700; color: var(--ink); margin: 6px 0 10px; }
.br-group {
  font-size: 12px;
  color: #2563eb;
  font-weight: 700;
  margin: 10px 0 6px;
  padding-left: 8px;
  border-left: 3px solid #0ea5e9;
}
.br-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed #e2e9f3;
  font-size: 13px;
}
.br-field > span { color: #94a3b8; flex-shrink: 0; }
.br-val { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; word-break: break-all; text-align: right; }
