@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;700&display=swap');

:root {
  /* KEKEFLY 宇宙风调色板 */
  --bg1: #021942;          /* 深空蓝 */
  --bg2: #0B3D91;          /* 星蓝 */
  --ink: #eaf2ff;          /* 主文字（浅） */
  --muted: rgba(234,242,255,.66);
  --brand: #FF7A00;        /* 橙（主按钮） */
  --brand-l: #FFB366;      /* 浅橙（hover） */
  --blue: #7EB6FF;         /* 亮蓝（强调/聚焦） */
  --ok: #22c55e;
  --bad: #ef4444;
  --line: rgba(126,182,255,.18);
  --card-bg: rgba(7,28,74,.5);
  --card-line: rgba(126,182,255,.22);
  --radius: 16px;
}
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
/* 星点 */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 28% 62%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 47% 33%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 63% 78%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 78% 22%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 88% 55%, rgba(255,255,255,.45), transparent),
    radial-gradient(1px 1px at 35% 90%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 92% 85%, rgba(255,255,255,.55), transparent);
  opacity: .8;
}
/* 角落光晕 */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(circle at 88% -8%, rgba(255,122,0,.33), transparent 42%),
    radial-gradient(circle at -8% 108%, rgba(126,182,255,.30), transparent 42%);
  filter: blur(22px);
}

.wrap { max-width: 920px; margin: 0 auto; padding: 32px 18px 60px; position: relative; z-index: 1; }
.brand-top { text-align: center; color: var(--muted); margin-bottom: 22px; }
.brand-top h1 {
  font-size: 24px; margin: 0 0 4px; letter-spacing: 2px; font-weight: 700;
  background: linear-gradient(to right, var(--blue), var(--brand));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 18px rgba(126,182,255,.35);
}
.brand-top p { margin: 0; font-size: 13px; opacity: .85; }

.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
  box-shadow: 0 10px 34px rgba(0,0,0,.35);
  transition: transform .32s cubic-bezier(.2,.7,.3,1), box-shadow .32s ease, border-color .32s ease;
}
/* 卡片 hover 上浮 */
.card:hover {
  transform: translateY(-9px);
  box-shadow: 0 22px 52px rgba(0,0,0,.5);
  border-color: rgba(126,182,255,.4);
}
.card h2 { margin: 0 0 16px; font-size: 17px; color: var(--ink); }
.card h3 { margin: 22px 0 10px; font-size: 14px; color: var(--muted); }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid rgba(126,182,255,.3);
  border-radius: 10px; font-size: 14px; outline: none;
  background: rgba(255,255,255,.06); color: #fff;
}
input::placeholder, textarea::placeholder { color: rgba(255,255,255,.5); }
select option { background: var(--bg1); color: #fff; }
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(126,182,255,.22);
}

.btn {
  display: inline-block; margin-top: 16px; padding: 11px 22px;
  background: var(--brand); color: #fff; border: none; border-radius: 999px;
  font-size: 14px; cursor: pointer; text-decoration: none; font-weight: 600;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}
.btn:hover { background: var(--brand-l); transform: scale(1.04); box-shadow: 0 8px 24px rgba(255,122,0,.35); }
.btn.ghost { background: transparent; border: 1.5px solid rgba(126,182,255,.6); color: var(--blue); }
.btn.ghost:hover { background: rgba(126,182,255,.15); box-shadow: 0 8px 24px rgba(126,182,255,.25); }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #f87171; box-shadow: 0 8px 24px rgba(239,68,68,.35); }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid rgba(126,182,255,.15); }
th { color: rgba(126,182,255,.85); font-weight: 600; }
td { color: rgba(234,242,255,.9); }

.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.tag.ok  { background: rgba(34,197,94,.18);  color: #86efac; }
.tag.bad { background: rgba(239,68,68,.18);  color: #fca5a5; }
.tag.gray{ background: rgba(255,255,255,.1); color: #cbd5e1; }

.msg { padding: 12px 14px; border-radius: 12px; font-size: 14px; margin-top: 14px; }
.msg.ok  { background: rgba(34,197,94,.15);  color: #bbf7d0; border: 1px solid rgba(34,197,94,.3); }
.msg.bad { background: rgba(239,68,68,.15); color: #fecaca; border: 1px solid rgba(239,68,68,.3); }

.note { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.6; }

.cap-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cap-q {
  background: rgba(2,25,66,.8); color: #fbbf24; font-family: "Courier New", monospace;
  font-size: 20px; letter-spacing: 3px; padding: 12px 16px; border-radius: 10px;
  min-width: 150px; text-align: center; border: 1px solid rgba(251,191,36,.25);
}
.cap-refresh { margin-top: 0; padding: 9px 12px; font-size: 13px; background: rgba(126,182,255,.15); color: var(--blue); border-radius: 10px; border: none; cursor: pointer; }

.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.export-bar { display: flex; align-items: center; gap: 16px; margin: 4px 0 12px; }
.export-bar .btn { margin-top: 0; }
input[readonly] { background: rgba(255,255,255,.04); color: rgba(234,242,255,.6); cursor: not-allowed; }

.hidden { display: none !important; }

/* 进入页面弹窗（玻璃版） */
.modal-mask {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  background: rgba(2,25,66,.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 18px;
}
.modal {
  background: var(--card-bg); backdrop-filter: blur(14px);
  border: 1px solid var(--card-line);
  border-radius: 16px; padding: 30px 26px;
  max-width: 380px; width: 100%; text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
  animation: modalPop .22s ease-out;
}
@keyframes modalPop {
  from { transform: translateY(14px) scale(.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.modal h3 { margin: 0 0 10px; font-size: 18px; color: var(--ink); }
.modal-tip { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.modal-actions { display: flex; flex-direction: column; gap: 12px; }
.modal-actions .btn, .modal-actions .btn-ghost { width: 100%; margin-top: 0; }

.result { margin-top: 18px; padding: 18px; border-radius: 12px; background: var(--card-bg); border: 1px solid var(--card-line); color: var(--ink); }
.result .big { font-size: 18px; font-weight: 700; }

.links { text-align: center; margin-top: 24px; }
.links a { color: var(--blue); text-decoration: none; margin: 0 10px; font-size: 13px; }
.links a:hover { text-decoration: underline; }

/* ===== 浮动星球背景层（不挡交互） ===== */
.space-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.planet {
  position: absolute; border-radius: 50%; will-change: transform;
  filter: drop-shadow(0 0 50px rgba(126,182,255,.25));
}
/* 橙星：右上 */
.planet.p1 {
  width: 230px; height: 230px; top: -70px; right: -50px;
  background: radial-gradient(circle at 32% 28%, #ffd9a8 0%, var(--brand) 46%, #b34700 100%);
  box-shadow: 0 0 70px 18px rgba(255,122,0,.32), inset -22px -22px 50px rgba(0,0,0,.4);
  animation: drift1 13s ease-in-out infinite;
}
/* 蓝星：左下 */
.planet.p2 {
  width: 170px; height: 170px; bottom: -56px; left: -44px;
  background: radial-gradient(circle at 34% 30%, #dbe9ff 0%, var(--blue) 50%, #2c5fa8 100%);
  box-shadow: 0 0 64px 16px rgba(126,182,255,.3), inset -18px -18px 40px rgba(0,0,0,.42);
  animation: drift2 17s ease-in-out infinite;
}
/* 光环小星：中下偏右 */
.planet.p3 {
  width: 92px; height: 92px; bottom: 18%; right: 16%;
  background: radial-gradient(circle at 36% 30%, #fff0d6 0%, #ffb366 52%, #c25a00 100%);
  box-shadow: 0 0 40px 8px rgba(255,179,102,.28), inset -12px -12px 26px rgba(0,0,0,.4);
  animation: drift3 11s ease-in-out infinite;
}
/* 光环：环绕小星 */
.planet.p3::after {
  content: ""; position: absolute; inset: -14px -2px; border-radius: 50%;
  border: 2px solid rgba(255,200,140,.4); transform: rotate(-22deg) scaleY(.42);
}
@keyframes drift1 {
  0%,100% { transform: translateY(0) translateX(0); }
  50%     { transform: translateY(26px) translateX(-10px); }
}
@keyframes drift2 {
  0%,100% { transform: translateY(0) translateX(0); }
  50%     { transform: translateY(-30px) translateX(12px); }
}
@keyframes drift3 {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-18px); }
}
/* 尊重无障碍：减少动态 */
@media (prefers-reduced-motion: reduce) {
  .planet { animation: none !important; }
  .card { transition: none !important; }
}

/* ===== 功能收纳折叠面板 ===== */
.fold {
  background: var(--card-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-line); border-radius: var(--radius);
  margin-bottom: 20px; overflow: hidden; transition: border-color .3s ease;
}
.fold[open] { border-color: rgba(126,182,255,.4); }
.fold > summary {
  list-style: none; cursor: pointer; padding: 18px 22px;
  font-size: 15px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; user-select: none;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: '▸'; color: var(--blue); transition: transform .2s ease; font-size: 13px; }
.fold[open] > summary::after { transform: rotate(90deg); }
.fold > .fold-body { padding: 0 22px 22px; }

/* ===== 分页 ===== */
.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pager a, .pager span {
  min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; font-size: 13px; text-decoration: none; border: 1px solid var(--card-line); color: var(--muted);
}
.pager a { background: rgba(126,182,255,.08); color: var(--blue); transition: background .2s; }
.pager a:hover { background: rgba(126,182,255,.2); }
.pager .cur { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager .dots { border: none; background: none; }

/* ===== 批量操作条 / 筛选 ===== */
.bulk-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.bulk-bar .btn { margin-top: 0; }
.bulk-bar .sep { width: 1px; height: 22px; background: var(--card-line); }
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.filter-bar select { width: auto; }

/* 状态标签：已作废 */
.tag.void { background: rgba(148,163,184,.2); color: #cbd5e1; }

/* ===== 滑动人机验证（阿里式一键认证） ===== */
.slider {
  position: relative; height: 48px; border-radius: 10px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(126,182,255,.35);
  overflow: hidden; user-select: none; margin-top: 8px; touch-action: none;
}
.slider .slider-mask {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, rgba(34,197,94,.4), rgba(34,197,94,.6));
  border-radius: 10px 0 0 10px; transition: width .05s linear;
}
.slider .slider-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted); pointer-events: none; letter-spacing: 1px;
}
.slider .slider-btn {
  position: absolute; left: 0; top: 0; width: 54px; height: 48px; border-radius: 10px;
  background: linear-gradient(135deg, #ffffff, #e2ecff); color: var(--brand);
  cursor: grab; display: flex; align-items: center; justify-content: center;
  font-size: 22px; box-shadow: 0 3px 10px rgba(0,0,0,.4); border: 1px solid rgba(126,182,255,.4);
}
.slider.done { background: linear-gradient(90deg, rgba(34,197,94,.5), rgba(34,197,94,.25)); border-color: rgba(34,197,94,.6); }
.slider.done .slider-btn { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; border-color: #16a34a; cursor: default; }
.slider.done .slider-text { color: #dcfce7; }
.slider .slider-btn:active { cursor: grabbing; }
.slider-tip { font-size: 12px; margin-top: 6px; min-height: 16px; }
.slider-tip.warn { color: #fca5a5; }
.slider-tip.ok { color: #86efac; }

/* 兑换前政策勾选 */
.agree { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: rgba(255,255,255,.06); border: 1px solid rgba(126,182,255,.22); }
.agree label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(234,242,255,.85); cursor: pointer; line-height: 1.5; }
.agree input[type=checkbox] { width: 16px; height: 16px; accent-color: #22c55e; cursor: pointer; flex: 0 0 auto; }
.agree a { color: var(--blue); text-decoration: none; border-bottom: 1px dashed rgba(126,182,255,.5); }
.agree a:hover { color: #ff7a00; border-bottom-color: #ff7a00; }

/* 兑换成功展示的 8 位码 */
.code-hl { font-family: "Courier New", monospace; font-size: 18px; letter-spacing: 3px; color: #ffb347; background: rgba(255,122,0,.12); padding: 2px 10px; border-radius: 8px; border: 1px solid rgba(255,122,0,.4); }
.hb-code { font-family: "Courier New", monospace; font-size: 30px; font-weight: 700; letter-spacing: 8px; color: #ffd166; background: rgba(255,122,0,.14); padding: 8px 16px; border-radius: 12px; border: 1px solid rgba(255,122,0,.55); box-shadow: 0 0 18px rgba(255,122,0,.25); }
