/* ===== 公众号保活面板 · 视觉样式 ===== */
:root {
  --green: #07c160;
  --green-dark: #049347;
  --green-soft: #e8f8ef;
  --red: #e5484d;
  --red-soft: #fdecec;
  --text: #1f2329;
  --muted: #8a919c;
  --border: #e6e8eb;
  --bg: #f5f7fa;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(31, 35, 41, .06);
  --shadow-lg: 0 16px 48px rgba(31, 35, 41, .18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
}
.muted { color: var(--muted); font-size: 12px; }
.err { color: var(--red); font-size: 12px; margin-top: 10px; }

/* ===== 表单控件 ===== */
input, textarea, button { font-family: inherit; }
input:focus, textarea:focus, button:focus { outline: none; }
.login-card input, .modal input, .modal textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; background: #fff; color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.login-card input:focus, .modal input:focus, .modal textarea:focus {
  border-color: var(--green); box-shadow: 0 0 0 3px rgba(7, 193, 96, .14);
}
.login-card input::placeholder, .modal input::placeholder, .modal textarea::placeholder { color: #b6bcc6; }

/* ===== 按钮 ===== */
.btn {
  border: none; border-radius: 8px; padding: 9px 16px; font-size: 13px;
  cursor: pointer; background: #f0f2f5; color: #444;
  transition: all .18s ease; white-space: nowrap;
}
.btn:hover { background: #e5e8ec; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, #07c160, #05a44f); color: #fff; font-weight: 600;
  box-shadow: 0 4px 12px rgba(7, 193, 96, .28);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #06b458, #049347);
  box-shadow: 0 6px 18px rgba(7, 193, 96, .38); transform: translateY(-1px);
}
.btn-primary:active { transform: scale(.97); }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: #555; }
.btn-ghost:hover { border-color: #c8cdd5; background: #fafbfc; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; background: #f5f7fa; }
.btn-sm:hover { background: #eaeef2; }
.btn-sm.btn-primary { background: linear-gradient(135deg, #07c160, #05a44f); }
.btn-sm.btn-primary:hover { background: linear-gradient(135deg, #06b458, #049347); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fbd9d9; }

/* ===== 登录 / 安装页 ===== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(255, 255, 255, .22), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(0, 0, 0, .12), transparent 55%),
    linear-gradient(135deg, #07c160 0%, #049347 100%);
}
.login-card {
  background: #fff; padding: 40px 38px; border-radius: 16px; width: 380px;
  box-shadow: var(--shadow-lg);
}
.login-card h1 { font-size: 21px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.login-card h1::before {
  content: "续"; flex: none; width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #07c160, #049347); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
  box-shadow: 0 4px 10px rgba(7, 193, 96, .35);
}
.login-card .sub { color: var(--muted); font-size: 12px; margin-bottom: 24px; line-height: 1.7; }
.login-card button { width: 100%; margin-top: 18px; padding: 11px; font-size: 14px; }

/* ===== 顶栏 ===== */
.topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(31, 35, 41, .04);
  padding: 0 24px; height: 58px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 5;
}
.brand { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #07c160, #049347); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
  box-shadow: 0 3px 8px rgba(7, 193, 96, .3);
}
.top-right { display: flex; align-items: center; gap: 14px; }

.wrap { max-width: 1120px; margin: 26px auto; padding: 0 16px; }

/* ===== 统计卡 ===== */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.card {
  background: #fff; border-radius: var(--radius); padding: 20px 22px;
  border: 1px solid #eef0f3; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(31, 35, 41, .09); }
.card .num { font-size: 28px; font-weight: 700; line-height: 1.2; }
.card .lab { color: var(--muted); font-size: 12px; margin-top: 4px; }
.card.ok .num { color: var(--green); }
.card.bad .num { color: var(--red); }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

/* ===== 表格 ===== */
.panel { background: #fff; border-radius: var(--radius); border: 1px solid #eef0f3; box-shadow: var(--shadow); overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 13px 14px; text-align: left; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.tbl th { background: #f8fafb; color: #667085; font-weight: 600; font-size: 12px; }
.tbl tbody tr { transition: background .15s ease; }
.tbl tbody tr:hover { background: #f7fbf9; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .empty { text-align: center; color: var(--muted); padding: 44px 0; }
.acc-name { font-weight: 600; }
.acc-nick { color: var(--muted); font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.online { color: var(--green); background: var(--green-soft); }
.badge.offline { color: var(--red); background: var(--red-soft); }
.badge.unknown { color: var(--muted); background: #f0f2f5; }

.ops { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 20, 25, .45);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.modal-mask[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 16px; width: 580px; max-width: 100%;
  max-height: 86vh; overflow: auto; padding: 26px 28px; box-shadow: var(--shadow-lg);
}
.modal h3 { margin-bottom: 6px; font-size: 17px; }
.modal label { display: block; margin: 14px 0 6px; color: #667085; font-size: 12px; }
.modal textarea { font-family: Consolas, "Courier New", monospace; font-size: 12px; line-height: 1.7; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.help { margin-top: 12px; color: #667085; font-size: 12px; }
.help summary { cursor: pointer; color: var(--green); font-weight: 500; }
.help ol { margin: 8px 0 0 18px; line-height: 2; }
.steps { margin: 6px 0 10px 18px; line-height: 2; font-size: 13px; }
.copy-row { display: flex; gap: 8px; margin: 6px 0 10px; }
.copy-row input {
  flex: 1; background: #f8fafb; color: #333;
  font-family: Consolas, "Courier New", monospace; font-size: 12px;
}
.chk { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: #667085; font-size: 12px; cursor: pointer; }

/* 弹窗内嵌官方登录页（中转 iframe） */
.modal-wide { width: 760px; }
.qr-frame {
  display: block; width: 100%; height: 560px; margin: 14px 0 10px;
  border: 1px solid var(--border); border-radius: 12px; background: #fff;
}
.qr-status { text-align: center; color: var(--green); font-size: 13px; font-weight: 500; }
.qr-status::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; margin-right: 7px; animation: qrblink 1.2s ease infinite;
}
@keyframes qrblink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.qr-tip { text-align: center; display: block; margin: 8px auto 0; max-width: 400px; line-height: 1.7; }
.qr-tip2 { text-align: center; margin-top: 6px; font-size: 12px; }
.qr-tip2 a { color: var(--green); text-decoration: none; }
.qr-tip2 a:hover { text-decoration: underline; }

.logs {
  background: #1e2227; color: #b7c0cc; border-radius: 10px; padding: 14px 16px;
  font-size: 12px; line-height: 1.9; max-height: 46vh; overflow: auto;
  font-family: Consolas, "Courier New", monospace; white-space: pre-wrap; word-break: break-all;
  margin-top: 12px;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cfd4db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b4bac2; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 768px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .tbl { font-size: 12px; }
  .topbar { padding: 0 14px; }
  .top-right .muted { display: none; }
}
