:root {
  --bg: #0f1419;
  --card: #1a2129;
  --border: #2b3540;
  --text: #d8e0e8;
  --muted: #8494a4;
  --accent: #3b9eff;
  --green: #3ecf8e;
  --red: #ff5f57;
  --yellow: #f5c451;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  flex-wrap: wrap;
}

header h1 { font-size: 18px; }

nav { display: flex; gap: 4px; }

.tab-btn {
  background: none;
  border: none;
  color: var(--muted);
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); background: rgba(59, 158, 255, 0.12); }

main { max-width: 1000px; margin: 0 auto; padding: 20px 16px 60px; }

.tab { display: none; }
.tab.active { display: block; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
}
.card h2 { font-size: 15px; margin-bottom: 12px; }

.hint { color: var(--muted); font-size: 12.5px; margin: 6px 0; }
.hint code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }

textarea, input[type="text"], input[type="password"], select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
}
textarea { resize: vertical; margin-bottom: 8px; font-family: monospace; }
select, .row input[type="text"] { width: auto; }

.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.space-between { justify-content: space-between; }
.row label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

.btn {
  background: var(--border);
  color: var(--text);
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.15); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.danger { background: var(--red); color: #fff; }
.btn.small { padding: 4px 10px; font-size: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
td .mono { font-family: monospace; font-size: 12px; color: var(--muted); }

.log {
  background: #0a0e12;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 480px;
  overflow-y: auto;
  color: #b9c6d2;
}

.status { padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.status.running { background: rgba(245, 196, 81, 0.15); color: var(--yellow); }
.status.success { background: rgba(62, 207, 142, 0.15); color: var(--green); }
.status.failed, .status.error { background: rgba(255, 95, 87, 0.15); color: var(--red); }
.status.stopped { background: rgba(132, 148, 164, 0.15); color: var(--muted); }

.msg { font-size: 13px; margin-top: 8px; color: var(--green); white-space: pre-wrap; }
.msg.error, .error { color: var(--red); }

.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  background: var(--bg);
  border-radius: 6px;
}
.checkbox-list label { display: flex; align-items: center; gap: 5px; font-size: 13px; }

details { margin-top: 10px; }
details summary { color: var(--muted); font-size: 13px; cursor: pointer; margin-bottom: 6px; }

.hidden { display: none !important; }
.notify-status { margin-bottom: 6px; text-align: center; font-size: 12px; color: #687386; white-space: nowrap; }
#account-table th:nth-child(5) { white-space: nowrap; text-align: center; }
.notify-actions { display: flex; justify-content: center; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 180px; }
.notify-actions .btn { margin: 0; white-space: nowrap; }
#wx-qr-modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.55); }
#wx-qr-modal .login-box { text-align: center; }
#wx-qr-modal img { display: block; margin: 16px auto; background: #fff; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--border); border-radius: 20px; transition: 0.2s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 14px; width: 14px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(16px); }

/* 登录 */
#login-overlay {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.login-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 32px; width: 320px; text-align: center;
}
.login-box h2 { margin-bottom: 8px; }
.login-box p { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.login-box input { margin-bottom: 12px; }
.login-box .btn { width: 100%; }

@media (max-width: 640px) {
  header { padding: 10px 12px; gap: 10px; }
  .row { flex-wrap: wrap; }
}
