/* ==========================================================================
   卡密兑换系统 · 全站样式（用户端 + 管理后台共用）
   ========================================================================== */

:root {
  --bg: #060911;
  --bg-soft: #0a0f1d;
  --panel: rgba(17, 23, 40, 0.72);
  --panel-solid: #111726;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9edf8;
  --muted: #8d98b8;
  --muted-2: #6b7694;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #fb7185;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.85);
  --font: "Inter", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Cascadia Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 12% -10%, rgba(124, 92, 255, 0.28), transparent 62%),
    radial-gradient(760px 480px at 96% 4%, rgba(34, 211, 238, 0.16), transparent 58%),
    radial-gradient(600px 500px at 50% 110%, rgba(124, 92, 255, 0.14), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

::selection {
  background: rgba(124, 92, 255, 0.4);
}

/* --------------------------------- 滚动条 -------------------------------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
  background-clip: content-box;
}

/* --------------------------------- 通用件 -------------------------------- */

.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(124, 92, 255, 0.35);
  background: rgba(124, 92, 255, 0.12);
  color: #bfb2ff;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

.primary-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 22px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(120deg, #7c5cff, #4f8cff 52%, #22d3ee);
  color: #fff;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: 0.02em;
  box-shadow: 0 14px 34px -14px rgba(94, 110, 255, 0.9);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 18px 40px -14px rgba(94, 110, 255, 1);
}

.primary-btn:active:not(:disabled) {
  transform: translateY(0);
}

.primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.28);
}

.ghost-btn:active {
  transform: translateY(1px);
}

.ghost-btn.danger {
  color: #ffb3bf;
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.1);
}

.ghost-btn.danger:hover {
  background: rgba(251, 113, 133, 0.18);
}

.ghost-btn.small,
.primary-btn.small {
  padding: 6px 11px;
  font-size: 12.5px;
  border-radius: 9px;
  width: auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.field > label,
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: #c4cbe0;
  letter-spacing: 0.01em;
}

.field .hint {
  font-size: 12px;
  color: var(--muted-2);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(6, 9, 17, 0.66);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
  font-family: var(--mono);
  font-size: 13.5px;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(124, 92, 255, 0.8);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
  background: rgba(6, 9, 17, 0.86);
}

input.code-input {
  font-family: var(--mono);
  font-size: 19px;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
  padding: 17px 15px;
  font-weight: 600;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) calc(1em + 2px), calc(100% - 14px) calc(1em + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
}

.switch input {
  appearance: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  flex: none;
  margin: 0;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.switch input:checked {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
}

.switch input:checked::after {
  transform: translateX(18px);
}

/* --------------------------------- Toast -------------------------------- */

.toast-wrap {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(17, 23, 40, 0.95);
  border: 1px solid var(--border-strong);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
  font-size: 14px;
  font-weight: 600;
  animation: toast-in 0.24s ease;
  max-width: min(92vw, 460px);
}

.toast.ok {
  border-color: rgba(52, 211, 153, 0.5);
  color: #a7f3d0;
}

.toast.err {
  border-color: rgba(251, 113, 133, 0.5);
  color: #fecdd3;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   用户端
   ========================================================================== */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 24px 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #060911;
  font-size: 17px;
  box-shadow: 0 10px 24px -10px rgba(124, 92, 255, 0.9);
}

.user-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 24px 60px;
}

.hero {
  text-align: center;
  padding: 26px 0 24px;
}

.hero h1 {
  margin: 18px auto 12px;
  max-width: 760px;
  font-size: clamp(26px, 4.6vw, 42px);
  line-height: 1.18;
  background: linear-gradient(120deg, #ffffff 12%, #c3b8ff 52%, #8ee9ff 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .sub {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
}

.notice {
  display: none;
  align-items: flex-start;
  gap: 10px;
  max-width: 620px;
  margin: 20px auto 0;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.08);
  color: #fcd34d;
  font-size: 13.5px;
  text-align: left;
  line-height: 1.55;
}

.notice.show {
  display: flex;
}

.notice .ic {
  flex: none;
}

.redeem-wrap {
  max-width: 520px;
  margin: 0 auto;
}

.redeem-card {
  padding: 26px 26px 28px;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: rgba(6, 9, 17, 0.6);
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
  transition: color 0.16s ease, background 0.16s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: rgba(124, 92, 255, 0.2);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.42);
}

.panel {
  animation: fade-up 0.22s ease;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-msg {
  min-height: 20px;
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--err);
  text-align: center;
}

.form-msg.ok {
  color: var(--ok);
}

.form-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  color: var(--muted-2);
  font-size: 12.5px;
  text-align: center;
}

/* 兑换结果 */
.result {
  max-width: 520px;
  margin: 20px auto 0;
  padding: 24px;
  animation: pop 0.28s ease;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.result.ok {
  border-color: rgba(52, 211, 153, 0.4);
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.08), rgba(17, 23, 40, 0.86));
}

.result.bad {
  border-color: rgba(251, 113, 133, 0.4);
  background: linear-gradient(180deg, rgba(251, 113, 133, 0.08), rgba(17, 23, 40, 0.86));
}

.result-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.result-ic {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  font-size: 21px;
  flex: none;
}

.result.ok .result-ic {
  background: rgba(52, 211, 153, 0.16);
  color: var(--ok);
}

.result.bad .result-ic {
  background: rgba(251, 113, 133, 0.14);
  color: var(--err);
}

.result-head h3 {
  font-size: 17px;
}

.result-head .small {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}

.content-box {
  position: relative;
  margin: 14px 0 12px;
  padding: 15px 16px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(6, 9, 17, 0.72);
  font-family: var(--mono);
  font-size: 13.5px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d7e3ff;
  line-height: 1.7;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(17, 23, 40, 0.95);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.copy-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.3);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 12.5px;
  color: var(--muted-2);
}

.meta-row b {
  color: var(--muted);
  font-weight: 600;
}

/* 物品列表 */
.products {
  max-width: 1080px;
  margin: 44px auto 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 18px;
}

.section-head .muted {
  font-size: 13px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 14px;
}

.product {
  display: flex;
  gap: 14px;
  padding: 18px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.product:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 92, 255, 0.42);
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.12), rgba(255, 255, 255, 0.02));
}

.product .ic {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: rgba(124, 92, 255, 0.16);
  font-size: 21px;
}

.product h4 {
  font-size: 15px;
  margin-bottom: 4px;
}

.product p {
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stock-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
}

.stock-tag.low {
  background: rgba(251, 191, 36, 0.13);
  color: #fcd34d;
}

.stock-tag.out {
  background: rgba(251, 113, 133, 0.13);
  color: #fda4af;
}

.empty-hint {
  padding: 26px;
  text-align: center;
  color: var(--muted-2);
  font-size: 13.5px;
  border: 1px dashed var(--border);
  border-radius: 14px;
}

.site-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px 44px;
  color: var(--muted-2);
  font-size: 12.5px;
  text-align: center;
}

.site-footer .dot {
  margin: 0 8px;
  opacity: 0.5;
}

/* ==========================================================================
   管理后台
   ========================================================================== */

/* 登录 */
.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 34px 32px 30px;
}

.login-card .brand {
  justify-content: center;
  font-size: 18px;
}

.login-card .lead {
  margin: 10px 0 26px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

.login-hint {
  margin-top: 16px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.26);
  background: rgba(251, 191, 36, 0.07);
  color: #fcd34d;
  font-size: 12.5px;
  line-height: 1.6;
}

/* 布局 */
.admin-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 16px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13, 18, 32, 0.95), rgba(8, 12, 22, 0.92));
  backdrop-filter: blur(14px);
}

.sidebar .brand {
  margin: 0 6px 18px;
  font-size: 15.5px;
}

.sidebar .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 15px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13.8px;
  font-weight: 600;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item .ic {
  font-size: 15px;
  width: 18px;
  text-align: center;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-item.active {
  background: rgba(124, 92, 255, 0.18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.34);
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 6px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted-2);
}

.sidebar-foot .who {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 600;
}

.content {
  min-width: 0;
  padding: 26px 30px 60px;
}

.content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.content-head h1 {
  font-size: 21px;
}

.content-head .desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.head-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.warn-banner {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
  font-size: 13px;
}

.warn-banner.show {
  display: flex;
}

/* 统计卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(152px, 1fr));
  gap: 13px;
  margin-bottom: 22px;
}

.stat {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
}

.stat .label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.stat .value {
  margin-top: 6px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat .foot {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted-2);
}

.stat.hl {
  border-color: rgba(124, 92, 255, 0.4);
  background: linear-gradient(160deg, rgba(124, 92, 255, 0.2), rgba(34, 211, 238, 0.06));
}

/* 面板 / 表格 */
.panel-card {
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(13, 18, 32, 0.72);
  margin-bottom: 18px;
}

.panel-card > h3 {
  font-size: 15px;
  margin-bottom: 14px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar .grow {
  flex: 1;
  min-width: 160px;
}

.toolbar input[type="search"],
.toolbar select {
  width: auto;
  padding: 9px 13px;
  font-size: 13.5px;
  border-radius: 10px;
}

.toolbar input[type="search"] {
  flex: 0 1 280px;
  min-width: 170px;
}

.toolbar select {
  flex: 0 0 auto;
  min-width: 130px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.2px;
  min-width: 640px;
}

table.data th {
  position: sticky;
  top: 0;
  padding: 11px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(9, 13, 24, 0.96);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

table.data tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

table.data td.num {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

table.data td.actions {
  text-align: right;
  white-space: nowrap;
}

table.data td.actions button {
  margin-left: 6px;
}

table.data .code-cell {
  font-family: var(--mono);
  font-size: 13px;
  color: #cfd8f5;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.unused {
  background: rgba(52, 211, 153, 0.13);
  color: #6ee7b7;
}

.badge.used {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.badge.expired {
  background: rgba(251, 191, 36, 0.13);
  color: #fcd34d;
}

.badge.disabled {
  background: rgba(251, 113, 133, 0.13);
  color: #fda4af;
}

.badge.on {
  background: rgba(52, 211, 153, 0.13);
  color: #6ee7b7;
}

.badge.off {
  background: rgba(148, 163, 184, 0.12);
  color: #9aa6bd;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

.pager .pages {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pager button {
  min-width: 34px;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.pager button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pager button.cur {
  background: rgba(124, 92, 255, 0.24);
  border-color: rgba(124, 92, 255, 0.6);
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 6, 13, 0.72);
  backdrop-filter: blur(6px);
  animation: fade-in 0.16s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px 26px;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, #141a2b, #0d1220);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 1);
  animation: pop 0.2s ease;
}

.modal.wide {
  max-width: 760px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.modal-head h3 {
  font-size: 17px;
}

.modal-head .sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.8px;
}

.icon-btn {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 15px;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.modal-foot .primary-btn {
  width: auto;
  padding: 11px 22px;
  font-size: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

/* 生成结果 */
.gen-result {
  margin-top: 6px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.06);
}

.gen-result .list {
  max-height: 220px;
  overflow-y: auto;
  margin: 10px 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.9;
  color: #c8f7e3;
  word-break: break-all;
}

.gen-result .bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar .brand {
    margin: 0 12px 0 4px;
    width: 100%;
  }

  .sidebar-foot {
    margin-top: 0;
    margin-left: auto;
    border-top: 0;
    padding: 0;
  }

  .sidebar-foot .who {
    margin-bottom: 0;
  }

  .nav-item {
    width: auto;
  }

  .content {
    padding: 20px 18px 60px;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 18px 16px 6px;
  }

  .user-main {
    padding: 18px 16px 48px;
  }

  .hero {
    padding: 20px 0 18px;
  }

  .redeem-card {
    padding: 20px 18px 22px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .content-head h1 {
    font-size: 19px;
  }

  .stat .value {
    font-size: 23px;
  }

  .modal {
    padding: 20px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
