:root {
  --bg: #0f1620;
  --panel: #18222f;
  --panel-2: #1f2c3d;
  --line: #2a3a4f;
  --txt: #e6edf5;
  --muted: #93a4b8;
  --accent: #3d8bff;
  --accent-2: #29c5a8;
  --ok: #36c98a;
  --warn: #f0a33a;
  --danger: #f0563a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--txt); font-size: 14px;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--accent); }

/* ---------- 登录 ---------- */
#login-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 30% -10%, #1d3358 0%, #0f1620 60%);
}
.login-card {
  width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 28px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.login-card h1 { font-size: 19px; margin: 0 0 4px; }
.login-card .sub { color: var(--muted); font-size: 12px; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--txt); font-size: 14px;
}
.field input:focus { outline: none; border-color: var(--accent); }

/* 滑块验证码 */
.captcha-wrap { margin: 6px 0 16px; }
.captcha-stage { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); user-select: none; }
.captcha-stage img.bg { display: block; width: 100%; }
.captcha-piece { position: absolute; top: 0; left: 0; pointer-events: none; }
.slider-track {
  position: relative; height: 38px; margin-top: 10px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center;
}
.slider-track .tip { width: 100%; text-align: center; color: var(--muted); font-size: 12px; }
.slider-track.ok { background: rgba(54,201,138,.15); border-color: var(--ok); }
.slider-handle {
  position: absolute; top: -1px; left: 0; width: 40px; height: 38px; border-radius: 8px;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.slider-handle.ok { background: var(--ok); }
.btn {
  width: 100%; padding: 11px; border: none; border-radius: 8px; background: var(--accent);
  color: #fff; font-size: 15px; font-weight: 600;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--panel-2); border: 1px solid var(--line); color: var(--txt); }
.err { color: var(--danger); font-size: 12px; min-height: 16px; margin-top: 6px; }
.link-row { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; }
.refresh-cap { color: var(--muted); cursor: pointer; background: none; border: none; }

/* ---------- 主界面 ---------- */
header.topbar {
  display: flex; align-items: center; gap: 16px; padding: 12px 20px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
header .brand { font-weight: 700; font-size: 16px; }
header .brand small { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 8px; }
header .spacer { flex: 1; }
header .who { color: var(--muted); font-size: 13px; }
.tabbtn { background: none; border: none; color: var(--muted); font-size: 13px; padding: 6px 10px; border-radius: 6px; }
.tabbtn.active { color: var(--txt); background: var(--panel-2); }

.layout { display: flex; gap: 18px; padding: 18px 20px; align-items: flex-start; }
.sidebar { width: 280px; flex-shrink: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; position: sticky; top: 70px; }
.sidebar h3 { margin: 0 0 12px; font-size: 14px; }
.filter { margin-bottom: 14px; }
.filter label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.filter select, .filter input {
  width: 100%; padding: 8px 10px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--txt); font-size: 13px;
}
.range { display: flex; gap: 8px; align-items: center; }
.range input { width: 100%; }
.range span { color: var(--muted); }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.checkbox input { width: auto; }
.sidebar .btn { margin-top: 6px; }

.main { flex: 1; min-width: 0; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.toolbar .count { color: var(--muted); font-size: 13px; }
.toolbar .spacer { flex: 1; }

table.results { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table.results th, table.results td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
table.results th { color: var(--muted); font-weight: 600; background: var(--panel-2); font-size: 12px; }
table.results tr:last-child td { border-bottom: none; }
table.results .title-cell { max-width: 460px; }
table.results .title-cell a { cursor: pointer; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.dlbtn { padding: 6px 12px; border-radius: 7px; border: 1px solid var(--accent); background: rgba(61,139,255,.12); color: var(--accent); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ft-hit { color: var(--ok); font-size: 11px; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 16px 0; }
.pager button { padding: 6px 12px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2); color: var(--txt); }
.pager button:disabled { opacity: .4; }
.pager .pageinfo { color: var(--muted); font-size: 13px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { width: 460px; max-width: 92vw; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.modal h3 { margin: 0 0 8px; font-size: 16px; }
.modal .muted { color: var(--muted); font-size: 13px; line-height: 1.6; }
.modal .doc-preview { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; font-size: 12px; color: #cfe; margin: 12px 0; }
.modal .actions { display: flex; gap: 10px; margin-top: 16px; }
.modal .actions .btn { width: auto; flex: 1; }
.human-box { background: var(--panel-2); border: 1px dashed var(--warn); border-radius: 10px; padding: 18px; text-align: center; margin: 16px 0; }
.human-box .hint { color: var(--warn); font-size: 12px; margin-bottom: 12px; }
.human-confirm { padding: 12px 22px; border-radius: 8px; border: none; background: var(--ok); color: #042; font-size: 15px; font-weight: 700; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line); padding: 10px 18px; border-radius: 8px; z-index: 80; }
