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

:root {
  --bg: #eef2f9;
  --card: rgba(255, 255, 255, 0.82);
  --border: rgba(15, 40, 90, 0.10);
  --text: #17233d;
  --muted: #5d6b85;
  --accent: #3b82f6;
  --accent2: #6366f1;
  --ok: #16a34a;
  --bad: #dc2626;
  --warn: #d97706;
  --shadow: 0 18px 50px rgba(30, 60, 130, .10);
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- 背景光晕(浅色柔光) ---- */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: .45; }
.orb-1 { width: 480px; height: 480px; background: #bcd2ff; top: -140px; left: -100px; }
.orb-2 { width: 420px; height: 420px; background: #d8ccff; bottom: -120px; right: -80px; }
.orb-3 { width: 300px; height: 300px; background: #bfe9ff; top: 40%; left: 55%; opacity: .3; }

.shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 44px 20px 60px;
}

/* ---- 头部 ---- */
.top { text-align: center; margin-bottom: 30px; }
.logo { display: inline-flex; align-items: center; gap: 12px; }
.logo-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--accent) 55%, var(--accent2));
  box-shadow: 0 0 18px rgba(59, 130, 246, .55);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.18); opacity: .7; } }

h1 { font-size: 28px; font-weight: 800; letter-spacing: .5px; color: var(--text); }
h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { color: var(--muted); font-size: 13.5px; margin-top: 8px; }

/* ---- 卡片 ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

/* ---- 表单 ---- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .3px; text-transform: uppercase; }
.field input {
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  font-size: 14.5px;
  padding: 12px 14px;
  outline: none;
  transition: border .18s, box-shadow .18s;
}
.field input::placeholder { color: #9aa5bb; }
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}
.hint { font-size: 12px; color: #8b96ad; margin-top: -2px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

.keywrap { position: relative; }
.keywrap input { padding-right: 44px; }
.eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 15px;
  opacity: .5; transition: opacity .15s; padding: 6px;
}
.eye:hover { opacity: .9; }

/* ---- 模式卡片(点击选择) ---- */
.mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 560px) { .mode-grid { grid-template-columns: 1fr; } }

.mode-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 13px;
  padding: 13px 15px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .1s, background .15s;
  position: relative;
}
.mode-card:hover { border-color: rgba(59, 130, 246, .5); transform: translateY(-1px); }
.mode-card.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(59,130,246,.08), rgba(99,102,241,.08));
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .14);
}
.mode-card.active::after {
  content: '✓';
  position: absolute; top: 8px; right: 10px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.mode-icon { font-size: 17px; margin-bottom: 2px; }
.mode-name { font-size: 14px; font-weight: 700; }
.mode-desc { font-size: 11.5px; color: var(--muted); line-height: 1.4; }

/* ---- 主按钮 ---- */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 18px;
  font-size: 15px; font-weight: 700; color: #fff;
  border: none; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 26px rgba(59, 130, 246, .32);
  transition: transform .12s, box-shadow .2s, opacity .2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(59, 130, 246, .4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-icon { font-size: 16px; }

.spin { display: inline-block; width: 15px; height: 15px; border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---- 结果 ---- */
.result.hidden { display: none; }
.res-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 700; padding: 7px 14px; border-radius: 999px;
}
.badge.ok { background: rgba(22, 163, 74, .12); color: var(--ok); border: 1px solid rgba(22, 163, 74, .35); }
.badge.bad { background: rgba(220, 38, 38, .12); color: var(--bad); border: 1px solid rgba(220, 38, 38, .35); }
.badge.warn { background: rgba(217, 119, 6, .12); color: var(--warn); border: 1px solid rgba(217, 119, 6, .35); }

.metrics { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.metric {
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 13px; font-size: 12.5px; color: var(--muted);
}
.metric b { color: var(--text); font-size: 13.5px; margin-left: 4px; font-weight: 600; }
.metric b.good { color: var(--ok); } .metric b.badc { color: var(--bad); }

.res-note { font-size: 13px; color: var(--warn); margin-bottom: 12px; }
.res-endpoint { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; word-break: break-all; }
.res-body {
  background: #f6f8fc; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.55; color: #33405c;
  max-height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
.res-err { font-size: 14px; color: var(--bad); margin-bottom: 10px; }

/* ---- 历史 ---- */
.history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.history-head h2 { font-size: 16px; font-weight: 800; }
.count { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.btn-ghost {
  background: #fff; border: 1px solid var(--border); color: var(--muted);
  font-size: 12.5px; padding: 6px 12px; border-radius: 8px; cursor: pointer; transition: all .15s;
}
.btn-ghost:hover { color: var(--bad); border-color: rgba(220,38,38,.4); }

.hist-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 14px 0 6px; }
.hist-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 14px; margin-bottom: 9px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.hist-item:hover { border-color: rgba(59, 130, 246, .5); background: #fbfcff; }
.hist-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.hist-dot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(22,163,74,.5); }
.hist-dot.bad { background: var(--bad); box-shadow: 0 0 8px rgba(220,38,38,.5); }
.hist-main { flex: 1; min-width: 0; }
.hist-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-sub { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.hist-time { font-size: 11px; color: var(--muted); }
.hist-actions { display: flex; gap: 6px; }
.mini-btn {
  background: #f1f4fa; border: 1px solid var(--border); color: var(--muted);
  font-size: 11.5px; padding: 4px 9px; border-radius: 7px; cursor: pointer; transition: all .15s;
}
.mini-btn:hover { color: var(--accent); border-color: rgba(59,130,246,.5); }
.mini-btn.del:hover { color: var(--bad); border-color: rgba(220,38,38,.5); }

.foot { text-align: center; color: #97a1b5; font-size: 12px; margin-top: 26px; }
