:root {
  --bg: #0b1014;
  --bg-elev: #121920;
  --ink: #e8eee9;
  --muted: #8a9a91;
  --line: rgba(232, 238, 233, 0.12);
  --accent: #5dff9a;
  --accent-dim: #2bbf6a;
  --warn: #ffb454;
  --danger: #ff6b6b;
  --ok: #5dff9a;
  --font-display: "Bebas Neue", "Arial Narrow", "Impact", system-ui, sans-serif;
  --font-ui: "Space Grotesk", system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  --font-cn: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --radius: 14px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: var(--font-cn);
  background: var(--bg);
  line-height: 1.5;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(93, 255, 154, 0.16), transparent 55%),
    radial-gradient(900px 600px at 100% 20%, rgba(56, 120, 255, 0.12), transparent 50%),
    linear-gradient(165deg, #070b0e 0%, #10171d 48%, #0a1210 100%);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(232, 238, 233, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 238, 233, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  opacity: 0.5;
}

.bg-glow {
  position: absolute;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  animation: drift 14s ease-in-out infinite alternate;
}

.bg-glow-a {
  top: -8%;
  left: -6%;
  background: rgba(93, 255, 154, 0.25);
}

.bg-glow-b {
  right: -10%;
  bottom: 5%;
  background: rgba(70, 120, 255, 0.22);
  animation-delay: -4s;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(4%, 6%) scale(1.08); }
}

.shell {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.hero {
  margin-bottom: 28px;
  animation: rise 0.7s ease both;
}

.eyebrow {
  margin: 0 0 6px;
  letter-spacing: 0.28em;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-ui);
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(64px, 14vw, 112px);
  line-height: 0.9;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-shadow: 0 0 40px rgba(93, 255, 154, 0.18);
}

.tagline {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.panel {
  background: rgba(18, 25, 32, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  animation: rise 0.75s ease both;
  margin-top: 14px;
}

.panel:first-of-type { margin-top: 0; }

.hero + .panel { animation-delay: 0.05s; }
.log-panel {
  margin-top: 18px;
  animation-delay: 0.22s;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-ui);
}

.meta-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.meta-pill.on {
  border-color: rgba(93, 255, 154, 0.35);
  color: var(--accent);
  background: rgba(93, 255, 154, 0.08);
}

.hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.hint.tiny { margin-top: 6px; margin-bottom: 0; font-size: 12px; }

.hint a {
  color: var(--accent);
  text-decoration: none;
}

.hint a:hover { text-decoration: underline; }

.empty-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-hint[hidden] { display: none; }

.account-list {
  display: grid;
  gap: 8px;
}

.account-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.account-item:hover {
  border-color: rgba(93, 255, 154, 0.28);
}

.account-item.is-active {
  border-color: rgba(93, 255, 154, 0.5);
  background: rgba(93, 255, 154, 0.08);
}

.account-item.is-off {
  opacity: 0.55;
}

.account-radio {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.account-main strong {
  display: block;
  font-size: 15px;
}

.account-main span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-ui);
}

.account-ops {
  display: flex;
  gap: 6px;
}

.account-ops .ghost-btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-full { grid-column: 1 / -1; }

.field .mini-input,
.field .token-input,
.field select.mini-input {
  width: 100%;
}

select.mini-input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.row-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.solid-btn {
  border: 1px solid rgba(93, 255, 154, 0.45);
  background: rgba(93, 255, 154, 0.16);
  color: var(--ink);
  border-radius: 10px;
  padding: 0 16px;
  min-height: 44px;
  cursor: pointer;
  font-family: var(--font-cn);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s, transform 0.15s;
}

.solid-btn:hover {
  background: rgba(93, 255, 154, 0.26);
}

.solid-btn:disabled,
.ghost-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.editor-panel {
  border-color: rgba(93, 255, 154, 0.28);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-ui);
}

.token-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.token-input,
.mini-input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.token-input:focus,
.mini-input:focus {
  border-color: rgba(93, 255, 154, 0.55);
  box-shadow: 0 0 0 3px rgba(93, 255, 154, 0.12);
}

.ghost-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 10px;
  padding: 0 14px;
  min-height: 44px;
  cursor: pointer;
  font-family: var(--font-cn);
  font-size: 13px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.ghost-btn:hover {
  border-color: rgba(93, 255, 154, 0.45);
  color: var(--accent);
  background: rgba(93, 255, 154, 0.06);
}

.token-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.account-chip {
  flex: 1;
  min-width: 180px;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  border: 1px solid rgba(93, 255, 154, 0.25);
  background: rgba(93, 255, 154, 0.08);
  color: var(--accent);
}

.account-chip.is-empty {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.account-chip.is-warn {
  border-color: rgba(255, 180, 84, 0.4);
  background: rgba(255, 180, 84, 0.1);
  color: var(--warn);
}

.option {
  max-width: 240px;
}

.actions {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
  animation: rise 0.8s ease both;
  animation-delay: 0.14s;
}

.action {
  position: relative;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(18, 25, 32, 0.85);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: var(--font-cn);
}

.action::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% 40%;
  height: 80%;
  background: radial-gradient(circle, rgba(93, 255, 154, 0.18), transparent 65%);
  opacity: 0;
  transition: opacity 0.25s;
}

.action:hover {
  transform: translateY(-2px);
  border-color: rgba(93, 255, 154, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.action:hover::after { opacity: 1; }

.action:active { transform: translateY(0); }

.action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.action-primary {
  grid-row: span 3;
  background:
    linear-gradient(160deg, rgba(93, 255, 154, 0.18), rgba(18, 25, 32, 0.9) 55%),
    rgba(18, 25, 32, 0.9);
  border-color: rgba(93, 255, 154, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 220px;
}

.action-kicker {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-ui);
}

.action-title {
  display: block;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.action-desc {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.log-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-ui);
}

.log {
  margin: 0;
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  font-family: "Space Grotesk", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #cfe0d5;
}

.busy {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  gap: 14px;
  background: rgba(7, 11, 14, 0.55);
  backdrop-filter: blur(4px);
}

.busy[hidden] { display: none; }

.busy-ring {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(232, 238, 233, 0.15);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.busy p {
  margin: 0;
  text-align: center;
  color: var(--ink);
  font-size: 14px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* —— 顶栏 / 登录页 / 运行记录 —— */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 22px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 25, 32, 0.7);
  font-size: 12px;
  color: var(--muted);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-user {
  color: var(--accent);
  font-family: var(--font-ui);
}

.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 10px rgba(255, 180, 84, 0.6);
}

.status-dot.is-on {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(93, 255, 154, 0.7);
}

.ghost-btn.small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-card {
  width: min(420px, 100%);
  padding: 28px 26px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(18, 25, 32, 0.86);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  animation: rise 0.6s ease both;
}

.auth-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 40px;
  letter-spacing: 0.04em;
}

.auth-sub {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.service-strip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  word-break: break-word;
}

.service-strip.is-on {
  border-color: rgba(93, 255, 154, 0.28);
  background: rgba(93, 255, 154, 0.06);
}

.service-strip .status-dot { margin-top: 6px; }

#auth-form .field { margin-bottom: 14px; }

.auth-remember {
  margin: 2px 0 14px;
  font-size: 13px;
  color: var(--muted);
}

.auth-submit {
  width: 100%;
  min-height: 46px;
  font-size: 14px;
}

.auth-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.1);
  color: var(--danger);
  font-size: 13px;
}

.auth-foot {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.history-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.history-row {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.history-row.is-bad {
  border-color: rgba(255, 107, 107, 0.35);
}

.history-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  font-size: 12px;
}

.history-time {
  color: var(--muted);
  font-family: var(--font-ui);
}

.history-result { margin-left: auto; color: var(--accent); }
.history-row.is-bad .history-result { color: var(--danger); }

.history-accounts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.history-acc {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.history-acc.ok {
  color: var(--accent);
  border-color: rgba(93, 255, 154, 0.3);
}

.history-acc.bad {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.35);
}

.history-page .shell {
  width: min(980px, calc(100% - 32px));
}

.history-shell {
  padding-top: 28px;
}

.topbar-right a.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.history-hero {
  margin: 0 0 18px;
  animation: rise 0.65s ease both;
}

.history-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(42px, 8vw, 72px);
  line-height: 0.95;
  letter-spacing: 0.03em;
}

.history-hero > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.public-history-panel {
  animation-delay: 0.08s;
}

.public-history-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 230px);
  min-height: 140px;
  overflow: auto;
  padding-right: 4px;
}

.public-history-entry {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.public-history-entry.is-bad {
  border-color: rgba(255, 107, 107, 0.42);
  background: rgba(255, 107, 107, 0.05);
}

.public-history-entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(232, 238, 233, 0.08);
}

.public-history-entry-head time {
  margin-right: 4px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 13px;
}

.public-history-tag {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
}

.public-history-status {
  margin-left: auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.public-history-entry.is-bad .public-history-status {
  color: var(--danger);
}

.public-history-accounts {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.public-history-account {
  padding: 10px 11px;
  border-left: 2px solid rgba(93, 255, 154, 0.4);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, 0.025);
}

.public-history-account.is-bad {
  border-left-color: var(--danger);
}

.public-history-account-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--accent);
  font-size: 12px;
}

.public-history-account.is-bad .public-history-account-head {
  color: var(--danger);
}

.public-history-account-head strong {
  color: var(--ink);
  font-weight: 500;
}

.public-history-account p,
.history-entry-empty {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  word-break: break-word;
}

.history-empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
}

.history-empty.is-bad {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.4);
}

/* —— 随机执行计划 / 待领取队列 —— */
.inline-pair {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-pair .mini-input {
  flex: 1;
  min-width: 0;
}

.inline-sep {
  color: var(--muted);
  font-size: 13px;
}

.sub-head {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sub-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.plan-list,
.pending-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.plan-row,
.pending-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 13px;
}

.plan-base {
  min-width: 52px;
  color: var(--muted);
  font-family: var(--font-ui);
}

.plan-arrow { color: var(--accent-dim); }

.plan-at {
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 600;
}

.plan-offset {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 12px;
}

.plan-state {
  margin-left: auto;
  padding: 2px 9px;
  border: 1px solid rgba(255, 180, 84, 0.35);
  border-radius: 999px;
  color: var(--warn);
  font-size: 11px;
}

.plan-state.done {
  color: var(--accent);
  border-color: rgba(93, 255, 154, 0.32);
}

.pending-name {
  min-width: 90px;
  font-weight: 600;
}

.pending-at {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 12px;
}

.pending-left {
  margin-left: auto;
  color: var(--accent);
  font-size: 12px;
}

.pending-retry {
  color: var(--warn);
  font-size: 11px;
}

@media (max-width: 760px) {
  .shell { padding-top: 28px; }
  .topbar { justify-content: flex-start; }
  .history-result { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .actions {
    grid-template-columns: 1fr 1fr;
  }
  .action-primary {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 120px;
  }
  .account-item {
    grid-template-columns: auto 1fr;
  }
  .account-ops {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 520px) {
  .token-row { grid-template-columns: 1fr; }
  .actions { grid-template-columns: 1fr; }
  .ghost-btn { min-height: 42px; }
}
