/* 僵尸粉检测中心 - 前台样式（移动端优先） */
:root {
  --bg: #0d1117;
  --bg-soft: #151b24;
  --panel: #161d27;
  --panel-2: #1c2531;
  --line: #263041;
  --fg: #e8eef7;
  --muted: #8a97ab;
  --primary: #07c160;
  --primary-2: #05a052;
  --danger: #f04a4a;
  --warn: #f2a33c;
  --info: #4a9df8;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(900px 420px at 50% -12%, #1b2532 0%, var(--bg) 60%) no-repeat, var(--bg);
  color: var(--fg);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
button, input, select { font-family: inherit; font-size: 15px; }
[hidden] { display: none !important; }

/* ---------- 背景装饰 ---------- */
.bg-deco { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bg-deco .orb {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5;
  animation: float 14s ease-in-out infinite;
}
.orb-1 { width: 280px; height: 280px; background: rgba(7, 193, 96, .35); top: -70px; left: -60px; }
.orb-2 { width: 230px; height: 230px; background: rgba(74, 157, 248, .28); top: 26%; right: -90px; animation-delay: -4s; }
.orb-3 { width: 260px; height: 260px; background: rgba(7, 193, 96, .18); bottom: -90px; left: 18%; animation-delay: -8s; }
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -22px, 0) scale(1.06); }
}
.grid-mask {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
}

.app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px 10px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: .3px; min-width: 0; }
.brand-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: linear-gradient(92deg, #eaf5ff 10%, #7ee2ab 90%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.logo {
  width: 28px; height: 28px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--primary), #0a8f4d);
  box-shadow: 0 6px 16px rgba(7, 193, 96, .38);
  flex: 0 0 auto;
}
.logo span {
  width: 11px; height: 11px; border-radius: 3px; background: rgba(4, 23, 12, .82);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55);
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.card-chip {
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  background: rgba(22, 29, 39, .72); border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px;
  backdrop-filter: blur(6px);
}
.card-chip b { font-size: 12.5px; font-weight: 600; letter-spacing: .5px; }
.card-chip em { font-style: normal; font-size: 11px; color: var(--muted); }

/* 退出当前卡密 */
.btn-logout {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 11px; border-radius: 10px; cursor: pointer;
  background: rgba(240, 74, 74, .1);
  border: 1px solid rgba(240, 74, 74, .4);
  color: #ff9b96; font-size: 12.5px; font-weight: 500; transition: .15s;
}
.btn-logout:hover { background: rgba(240, 74, 74, .18); color: #ffb3b3; }
.btn-logout:active { transform: scale(.97); }
.btn-danger-ghost {
  background: transparent; border-color: rgba(240, 74, 74, .45); color: #ff9b96;
}
.btn-danger-ghost:hover:not(:disabled) { background: rgba(240, 74, 74, .12); border-color: rgba(240, 74, 74, .7); }

.main { flex: 1; padding: 6px 16px 24px; }
.view { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 登录页 ---------- */
.view-login { padding-top: 8px; }
.login-hero { text-align: center; padding: 14px 6px 22px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 13px; margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(7, 193, 96, .1);
  border: 1px solid rgba(7, 193, 96, .32);
  color: #7ee2ab; font-size: 12.5px; letter-spacing: .5px;
}
.dot-live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--primary);
  box-shadow: 0 0 0 0 rgba(7, 193, 96, .7); animation: live 1.8s infinite;
}
@keyframes live {
  0% { box-shadow: 0 0 0 0 rgba(7, 193, 96, .6); }
  70% { box-shadow: 0 0 0 9px rgba(7, 193, 96, 0); }
  100% { box-shadow: 0 0 0 0 rgba(7, 193, 96, 0); }
}
.hero-title {
  margin: 0 0 10px; font-size: 27px; line-height: 1.25; font-weight: 700; letter-spacing: 2px;
  background: linear-gradient(180deg, #ffffff 20%, #9fd9bd 130%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .3px; }

.login-card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(28, 37, 49, .9), rgba(19, 25, 34, .92));
  border: 1px solid rgba(60, 74, 94, .75);
  border-radius: 18px;
  padding: 20px 18px 18px;
  margin-bottom: 16px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .045);
  backdrop-filter: blur(10px);
}
.card-glow {
  position: absolute; top: -60%; left: -20%; width: 140%; height: 100%;
  background: radial-gradient(closest-side, rgba(7, 193, 96, .22), transparent 70%);
  pointer-events: none;
}
.login-card-head { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.login-card-head b { display: block; font-size: 15.5px; font-weight: 650; }
.login-card-head i { font-style: normal; font-size: 12px; color: var(--muted); }
.lock-icon {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--primary);
  background: rgba(7, 193, 96, .12);
  border: 1px solid rgba(7, 193, 96, .3);
}

.card-form, .panel, .detect-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
}
.field { display: block; margin-bottom: 14px; }
.field > span, .field-label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.field-key { margin-bottom: 18px; }
.field-key .field-label { letter-spacing: 1px; }
.input-wrap { position: relative; }
input[type="text"], select {
  width: 100%; background: #0f151d; border: 1px solid var(--line); color: var(--fg);
  border-radius: 10px; padding: 12px 40px 12px 13px; outline: none; transition: .15s;
}
#cardKey {
  background: rgba(9, 13, 18, .78);
  border-color: rgba(66, 82, 104, .9);
  padding: 14px 44px 14px 14px;
  font-size: 16px; letter-spacing: 1.5px;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
}
#cardKey::placeholder { letter-spacing: .5px; font-family: inherit; }
#cardKey:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(7, 193, 96, .16); }
select { padding-right: 34px; 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) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
input[type="text"]:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(7, 193, 96, .14); }
input::placeholder { color: #5b6779; }
.clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .06);
  color: var(--muted); font-size: 19px; line-height: 1; cursor: pointer; transition: .15s;
}
.clear:hover { color: var(--fg); background: rgba(255, 255, 255, .12); }

.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--fg);
  border-radius: 10px; padding: 12px 16px; cursor: pointer; transition: .15s; font-weight: 500;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #04170c; font-weight: 650; }
.btn-primary:hover:not(:disabled) { background: #0ad269; border-color: #0ad269; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; display: block; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }

/* 登录按钮（渐变 + 阴影 + loading） */
.btn-login {
  position: relative; overflow: hidden;
  padding: 14px 16px; border-radius: 12px;
  font-size: 16px; letter-spacing: 4px;
  background: linear-gradient(95deg, #0ad269, #06a556);
  border: 0; color: #04170c;
  box-shadow: 0 10px 24px rgba(7, 193, 96, .32);
}
.btn-login:hover:not(:disabled) { filter: brightness(1.06); }
.btn-login:disabled { box-shadow: none; }
.btn-login .btn-spinner {
  display: none; width: 16px; height: 16px; margin-left: 8px; vertical-align: -3px;
  border: 2px solid rgba(4, 23, 12, .3); border-top-color: #04170c; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-login.loading .btn-text { opacity: .85; }
.btn-login.loading .btn-spinner { display: inline-block; }

.login-tip { margin: 12px 0 0; text-align: center; font-size: 12px; color: var(--muted); min-height: 18px; }
.login-tip.error { color: #ff9b96; }
.login-tip.ok { color: #6fe3a2; }

.feature-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 9px; }
.feature-list li {
  display: flex; align-items: flex-start; gap: 11px;
  background: rgba(22, 29, 39, .6);
  border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 13px;
}
.feature-list .fi { font-size: 17px; line-height: 1.4; }
.feature-list b { display: block; font-size: 13.5px; font-weight: 600; }
.feature-list i { font-style: normal; font-size: 12px; color: var(--muted); }

.login-foot {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--muted); font-size: 12.5px; padding: 2px 2px 0;
}
.link { background: none; border: 0; color: var(--info); font-size: 12.5px; cursor: pointer; padding: 0; }

.tip { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.note { color: var(--muted); font-size: 12px; margin-top: 9px; }
.note b { color: var(--warn); font-weight: 600; }
.warn {
  margin: 12px 0 0; padding: 9px 11px; font-size: 12.5px; border-radius: 9px;
  background: rgba(240, 74, 74, .1); border: 1px solid rgba(240, 74, 74, .35); color: #ffb3b3;
}
.warnline {
  background: rgba(242, 163, 60, .09); border: 1px solid rgba(242, 163, 60, .32); color: #f0c17f;
  border-radius: 8px; padding: 9px 11px; font-size: 12.5px; margin-bottom: 11px;
}
.warnline b { color: #ffd79a; }

/* ---------- 操作页 ---------- */
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 620; }
.panel-head .hint { font-size: 12px; color: var(--muted); }

/* 操作页步骤自动编号：面板隐藏后编号自动顺延，不会跳号或重号 */
.view-op { counter-reset: step; }
.view-op .panel-head h2[data-step]::before {
  counter-increment: step;
  content: counter(step) ". ";
}

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode {
  text-align: left; border: 1px solid var(--line); background: #121a23; border-radius: 11px;
  padding: 13px 12px; cursor: pointer; transition: .15s; color: var(--fg);
}
.mode b { display: block; font-size: 14.5px; font-weight: 620; margin-bottom: 3px; }
.mode i { font-style: normal; font-size: 11.5px; color: var(--muted); line-height: 1.45; display: block; }
.mode.on { border-color: var(--primary); background: linear-gradient(180deg, rgba(7,193,96,.14), rgba(7,193,96,.03)); }
.mode.on b { color: #4ee08e; }
.mode[data-mode="2"].on { border-color: var(--danger); background: linear-gradient(180deg, rgba(240,74,74,.14), rgba(240,74,74,.03)); }
.mode[data-mode="2"].on b { color: #ff8a85; }


.select-wrap { position: relative; }
/* 唤醒面板：路线选择 + 唤醒按钮同一行 */
.field-row { display: flex; gap: 10px; align-items: stretch; }
.field-row .select-wrap { flex: 1 1 auto; min-width: 0; }
.field-row .btn { flex: 0 0 auto; white-space: nowrap; }

.qr-area { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 0 2px; }
.qr-box {
  width: 210px; height: 210px; background: #fff; border-radius: 12px; padding: 10px;
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 5px; }
.qr-placeholder, .qr-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 9px; color: #8b97a8; font-size: 12.5px; text-align: center; padding: 0 18px;
}
.qr-placeholder::before {
  content: ""; width: 46px; height: 46px; border-radius: 10px;
  border: 2px dashed #c7ced8; display: block;
}
.spinner {
  width: 26px; height: 26px; border-radius: 50%; display: inline-block;
  border: 3px solid rgba(7, 193, 96, .25); border-top-color: var(--primary); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.qr-tip { margin: 0; color: var(--muted); font-size: 12.5px; text-align: center; }

/* ---------- 检测中 ---------- */
.detect-card { text-align: center; padding: 26px 18px 20px; }
.pulse { display: flex; justify-content: center; gap: 7px; margin-bottom: 14px; }
.pulse i {
  width: 10px; height: 10px; border-radius: 50%; background: var(--primary); display: block;
  animation: pulse 1.1s ease-in-out infinite;
}
.pulse i:nth-child(2) { animation-delay: .16s; }
.pulse i:nth-child(3) { animation-delay: .32s; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
.detect-card h2 { margin: 0 0 6px; font-size: 18px; font-weight: 660; }
.detect-msg { margin: 0 0 20px; color: var(--muted); font-size: 13px; }

.progress { height: 9px; border-radius: 999px; background: #0f151d; overflow: hidden; }
.progress-bar {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #3ee08a); transition: width .4s ease;
}
.progress-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.progress-meta b, .progress-meta span:first-child { color: var(--fg); }

.stats { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats li {
  background: #121a23; border: 1px solid var(--line); border-radius: 10px; padding: 10px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.stats b { font-size: 16.5px; font-weight: 660; }
.stats span { font-size: 11px; color: var(--muted); }
.stats li.danger b { color: var(--danger); }
.detect-actions { display: flex; gap: 10px; margin-top: 20px; }
.detect-actions .btn { flex: 1; }

/* ---------- 弹层 ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(6, 9, 13, .72); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
@media (min-width: 560px) { .overlay { align-items: center; } }
.sheet {
  width: 100%; max-width: 430px; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 18px 18px 0 0; max-height: 92vh; display: flex; flex-direction: column;
  animation: sheetUp .22s ease;
}
@media (min-width: 560px) { .sheet { border-radius: 18px; } }
@keyframes sheetUp { from { transform: translateY(26px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 16px 10px; border-bottom: 1px solid var(--line);
}
.sheet-head h3 { margin: 0; font-size: 15.5px; font-weight: 620; }
.close { background: none; border: 0; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }
.sheet-body { padding: 16px; overflow: auto; }
.sheet-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line); }

.qr-live { position: relative; width: 208px; height: 208px; margin: 0 auto; background: #fff; border-radius: 12px; padding: 9px; }
.qr-live img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 5px; }
.qr-state {
  position: absolute; left: 9px; right: 9px; bottom: 9px; background: rgba(13, 17, 23, .88);
  color: #fff; font-size: 12px; text-align: center; padding: 5px 6px; border-radius: 0 0 5px 5px;
}
.countdown { text-align: center; color: var(--muted); font-size: 12.5px; margin: 12px 0 0; }
.countdown b { color: var(--fg); }

.verify-box {
  margin-top: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px;
}
.verify-title { margin: 0 0 4px; font-size: 14px; font-weight: 620; color: var(--warn); }
.verify-tip { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.verify-row { display: flex; gap: 9px; }
.verify-input {
  flex: 1; text-align: center; letter-spacing: .5em; font-size: 19px;
  padding: 11px 10px 11px 16px;
}
.verify-row .btn { flex: 0 0 auto; padding: 11px 18px; }

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: #20161a; border: 1px solid #5a2c2c; color: #ffd9d7;
  padding: 10px 16px; border-radius: 10px; font-size: 13.5px; z-index: 80; max-width: 88vw;
  animation: fade .16s ease;
}
.toast.ok { background: #12241a; border-color: #2b5c3f; color: #c8f2d8; }

.footer { text-align: center; color: #55617a; font-size: 11.5px; padding: 3px 16px 18px; }
