:root {
  --bg0: #0f1419;
  --bg1: #1a2332;
  --card: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f0f3f7;
  --text2: #9aa4b2;
  --accent: #6366f1;
  --accent2: #818cf8;
  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf24;
  --radius: 16px;
  --font: "Segoe UI", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: Consolas, "Cascadia Code", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg0);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

.app-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 50% at 50% -20%, rgba(99, 102, 241, 0.25), transparent),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(129, 140, 248, 0.12), transparent),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px 32px;
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.login-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.login-sub {
  text-align: center;
  color: var(--text2);
  font-size: 13px;
  margin-bottom: 28px;
}

.fg { margin-bottom: 16px; }
.fg label {
  display: block;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 6px;
}
.fg input, .fg textarea, .fg select {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.fg input:focus, .fg textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.fg textarea { min-height: 100px; resize: vertical; font-family: var(--mono); font-size: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-p {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: #fff;
}
.btn-p:hover:not(:disabled) { filter: brightness(1.08); }
.btn-s { background: var(--green); color: #052e16; }
.btn-d { background: rgba(248, 113, 113, 0.15); color: var(--red); border: 1px solid rgba(248, 113, 113, 0.3); }
.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-sm { padding: 6px 12px; font-size: 12px; }

.msg { margin-top: 14px; font-size: 13px; text-align: center; min-height: 20px; }
.msg.e { color: var(--red); }
.msg.s { color: var(--green); }

.login-ft {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--text2);
}
.login-link {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
}
.login-link a { color: var(--accent2); text-decoration: none; }
.login-link a:hover { text-decoration: underline; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 20px 20px 48px; }

.hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px;
}
.brand h1 { font-size: 20px; font-weight: 700; }
.hd-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.ci {
  font-size: 12px; color: var(--text2); padding: 8px 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
}
.recharge-tip {
  font-size: 12px; color: var(--yellow); line-height: 1.5; max-width: 300px; text-align: right;
}
.coin-badge { color: var(--yellow); font-weight: 700; }

.tabs {
  display: flex; gap: 6px; flex-wrap: wrap; padding: 5px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 18px;
}
.tab {
  padding: 8px 16px; border: none; border-radius: 10px;
  background: transparent; color: var(--text2); cursor: pointer; font-size: 13px;
}
.tab.ac { background: rgba(99, 102, 241, 0.25); color: var(--text); font-weight: 600; }

.pg { display: none; }
.pg.ac { display: block; }

.cd {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.cd-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.cd-head h3 { font-size: 15px; font-weight: 600; }
.cd-desc { color: var(--text2); font-size: 12px; margin-bottom: 12px; }
.method-label {
  font-size: 13px; font-weight: 600; color: var(--accent2);
  margin: 0 0 8px; padding-left: 10px; border-left: 3px solid var(--accent);
}
.method-block { margin-bottom: 18px; }
.method-block:last-of-type { margin-bottom: 12px; }

.sg {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.st {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.st .lb { font-size: 12px; color: var(--text2); }
.st .vl { font-size: 22px; font-weight: 700; margin-top: 4px; }

.fr { display: flex; flex-wrap: wrap; gap: 12px; }
.fd { flex: 1; min-width: 140px; }

.ac-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 8px; background: rgba(0,0,0,0.15);
}
.ac-item .meta { font-size: 12px; color: var(--text2); margin-top: 2px; }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; margin-left: 6px;
}
.tag.on { background: rgba(52, 211, 153, 0.15); color: var(--green); }
.tag.off { background: rgba(248, 113, 113, 0.12); color: var(--red); }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.run-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
}
.cost-hint { font-size: 12px; color: var(--yellow); }

.lgb {
  background: rgba(0,0,0,0.35); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; max-height: 420px; overflow: auto;
  font-family: var(--mono); font-size: 11px; line-height: 1.6; white-space: pre-wrap;
  color: #c9d1d9;
}

.chk-row { display: flex; flex-wrap: wrap; gap: 16px; margin: 8px 0; }
.chk-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }

.ep { color: var(--text2); text-align: center; padding: 24px; }

.info-box {
  font-size: 12px; color: var(--text2); margin-bottom: 10px; line-height: 1.6;
  padding: 10px 12px; background: rgba(99,102,241,0.08); border-radius: 8px;
  border: 1px solid rgba(99,102,241,0.2);
}
.info-box a { color: var(--accent2); }

.tag.wait { background: rgba(251, 191, 36, 0.15); color: var(--yellow); }

.log-list { max-height: 200px; overflow: auto; }
.log-item {
  display: flex; justify-content: space-between; padding: 8px 10px;
  border-bottom: 1px solid var(--border); font-size: 12px; cursor: pointer;
}
.log-item:hover { background: rgba(255,255,255,0.04); }

.coin-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.coin-row .neg { color: var(--red); }
.coin-row .pos { color: var(--green); }

#toast {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  padding: 12px 18px; border-radius: 10px; font-size: 13px;
  background: #1e293b; border: 1px solid var(--border);
  transform: translateX(120%); transition: 0.25s;
}
#toast.show { transform: translateX(0); }

.cs-float {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9000;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text2);
  background: rgba(15, 20, 25, 0.88);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  user-select: text;
  pointer-events: auto;
}
.cs-float b { color: var(--yellow); font-weight: 600; }
