:root {
  --bg: #0b0e14;
  --bg-soft: #0e131c;
  --panel: #121722;
  --panel-2: #161d2a;
  --border: #232d40;
  --border-soft: #1b2333;
  --text: #e6edf7;
  --muted: #8b9bb4;
  --accent: #3ddc97;
  --accent-dim: #2aa876;
  --blue: #4da3ff;
  --danger: #ff6b6b;
  --warn: #ffcc66;
  --radius: 14px;
  --radius-sm: 9px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1100px 600px at 15% -10%, rgba(61, 220, 151, 0.09), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(77, 163, 255, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 0.86em; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.3em; margin: 8px 0 0; font-size: 14px; }
.hint { color: var(--muted); font-size: 12px; margin: 12px 0 0; text-align: center; }

h1, h2 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
p { margin: 6px 0 0; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 1px 5px;
}

/* ---------- 登录 ---------- */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(400px, 100%);
  padding: 34px 30px 26px;
  text-align: center;
}

.logo { display: flex; justify-content: center; margin-bottom: 14px; }
.login-card h1 { font-size: 22px; }
.login-card > .muted { margin-bottom: 22px; }
.login-card .field { text-align: left; }

/* ---------- 卡片 ---------- */

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 40%), var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

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

.empty {
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

/* ---------- 布局 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  height: 62px;
  background: rgba(11, 14, 20, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  white-space: nowrap;
}
.brand .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(61, 220, 151, 0.75);
}

.tabs { display: flex; gap: 4px; flex: 1; }
.tab-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tab-btn.active { color: var(--text); background: rgba(61, 220, 151, 0.12); }

.topbar-right { display: flex; align-items: center; gap: 14px; }

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 28px 72px;
}

.tab-panel { animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat { display: flex; flex-direction: column; gap: 4px; padding: 20px 22px; }
.stat-label { color: var(--muted); font-size: 12.5px; letter-spacing: 0.02em; }
.stat-value { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; margin-top: 2px; }
.stat-value.small { font-size: 16px; font-weight: 600; }

.action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footnote { color: var(--muted); font-size: 13px; margin: 14px 4px 0; }

/* ---------- 表单 ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; text-align: left; }
.field > span { font-size: 13px; color: var(--muted); }
.field small { font-size: 12px; }

input, textarea, select, .input {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.13);
}
textarea { resize: vertical; min-height: 96px; font-family: var(--mono); font-size: 13px; }
select { cursor: pointer; }

.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.check input { width: auto; accent-color: var(--accent); }

/* ---------- 按钮 ---------- */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  padding: 9px 16px;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn.primary { background: var(--accent); color: #06231a; }
.btn.primary:hover:not(:disabled) { background: #4ceaa5; }

.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.045); border-color: #33415a; }

.btn.danger { background: transparent; border-color: rgba(255, 107, 107, 0.35); color: var(--danger); }
.btn.danger:hover:not(:disabled) { background: rgba(255, 107, 107, 0.1); }

.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.wide { width: 100%; padding: 11px 16px; }

/* ---------- 账号列表 ---------- */

.list { display: flex; flex-direction: column; gap: 10px; }

.account-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.account-index {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(61, 220, 151, 0.12);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 650;
}
.account-value {
  flex: 1 1 220px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 日志 ---------- */

.log-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.log-controls .input { width: auto; padding: 7px 10px; font-size: 13px; }

.log {
  margin: 0;
  padding: 16px;
  background: #080b11;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #c7d3e6;
  max-height: 60vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 弹窗 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(4px);
  animation: fade 0.15s ease;
}
.modal-card { width: min(560px, 100%); }

/* ---------- 提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(560px, calc(100vw - 40px));
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  animation: fade 0.16s ease;
}
.toast.ok { border-color: rgba(61, 220, 151, 0.4); }
.toast.bad { border-color: rgba(255, 107, 107, 0.45); color: #ffd6d6; }

/* ---------- 响应式 ---------- */

@media (max-width: 720px) {
  .topbar { padding: 0 14px; gap: 12px; height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .topbar-right { margin-left: auto; }
  #clock { display: none; }
  main { padding: 20px 14px 60px; }
  .action-card { flex-direction: column; align-items: stretch; }
  .action-card .btn { width: 100%; }
  .account-row { gap: 10px; }
  .account-actions { width: 100%; }
  .account-actions .btn { flex: 1; }
  h1 { font-size: 21px; }
}
