/* 极全网机器人·网页版 —— 深夜控制台主题 */
:root {
  --bg: #0b0f17;
  --bg2: #101623;
  --panel: #141c2c;
  --panel2: #1a2436;
  --line: #232f45;
  --text: #dbe4f3;
  --dim: #7c8aa5;
  --accent: #3b82f6;
  --accent2: #22d3ee;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  overflow: hidden;
}
#app { display: flex; height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 216px; flex-shrink: 0;
  background: linear-gradient(180deg, #0d1320 0%, #0a0e16 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.logo { display: flex; gap: 10px; align-items: center; padding: 20px 18px 16px; border-bottom: 1px solid var(--line); }
.logo-icon { font-size: 26px; }
.logo-title { font-size: 16px; font-weight: 700; letter-spacing: 1px; }
.logo-sub { font-size: 11px; color: var(--accent2); }
.nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  color: var(--dim); transition: all .15s; user-select: none; font-size: 14px;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(59,130,246,.18), rgba(34,211,238,.08));
  color: #fff; box-shadow: inset 2px 0 0 var(--accent);
}
.nav-ico { width: 18px; text-align: center; font-size: 13px; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid var(--line); }
.foot-line { font-size: 11px; color: var(--dim); }
.foot-line.dim { opacity: .6; }

/* ---------- 主区 ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid var(--line);
  background: var(--bg2);
}
.account-zone, .robot-zone { display: flex; align-items: center; gap: 10px; }
.account-select {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; font-size: 14px; min-width: 220px; outline: none;
}
.status-pill {
  padding: 4px 12px; border-radius: 20px; font-size: 12px;
  background: var(--panel2); color: var(--dim); border: 1px solid var(--line);
}
.status-pill.ok { color: var(--green); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.08); }
.status-pill.run { color: var(--accent2); border-color: rgba(34,211,238,.4); background: rgba(34,211,238,.08); animation: pulse 2s infinite; }
.status-pill.bad { color: var(--red); border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.08); }
@keyframes pulse { 50% { opacity: .65; } }

.page { flex: 1; overflow-y: auto; padding: 20px; }

/* ---------- 通用组件 ---------- */
.btn {
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text); cursor: pointer;
  font-size: 13px; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #2563eb, #0ea5e9); border: none; color: #fff; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.15); }
.btn-danger { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.4); color: var(--red); }
.btn-danger:hover { background: rgba(248,113,113,.25); border-color: var(--red); color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-green { background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.4); color: var(--green); }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title::before { content: ""; width: 3px; height: 14px; background: linear-gradient(180deg, var(--accent), var(--accent2)); border-radius: 2px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.input, .select, .textarea {
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; outline: none;
  font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.input { min-width: 180px; }
.textarea { width: 100%; resize: vertical; min-height: 70px; }

/* 表格 */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 10px 12px; background: var(--panel2);
  color: var(--dim); font-weight: 500; white-space: nowrap;
  border-bottom: 1px solid var(--line); position: sticky; top: 0;
}
tbody td { padding: 9px 12px; border-bottom: 1px solid rgba(35,47,69,.5); vertical-align: middle; }
tbody tr:hover { background: rgba(59,130,246,.05); }
tbody tr:last-child td { border-bottom: none; }
td.wrap { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.dim { color: var(--dim); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 11px; }
.tag-blue { background: rgba(59,130,246,.15); color: #7cb3ff; }
.tag-green { background: rgba(52,211,153,.15); color: var(--green); }
.tag-red { background: rgba(248,113,113,.15); color: var(--red); }
.tag-amber { background: rgba(251,191,36,.15); color: var(--amber); }
.tag-dim { background: var(--panel2); color: var(--dim); }

/* 开关 */
.switch { position: relative; width: 36px; height: 20px; display: inline-block; cursor: pointer; vertical-align: middle; }
.switch input { display: none; }
.switch .slider {
  position: absolute; inset: 0; border-radius: 20px; background: var(--panel2);
  border: 1px solid var(--line); transition: .2s;
}
.switch .slider::before {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  left: 2px; top: 2px; background: var(--dim); transition: .2s;
}
.switch input:checked + .slider { background: rgba(52,211,153,.25); border-color: var(--green); }
.switch input:checked + .slider::before { transform: translateX(16px); background: var(--green); }

/* 分页 */
.pager { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 13px; color: var(--dim); }
.pager .btn { padding: 4px 12px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; right: -20px; top: -20px; width: 70px; height: 70px;
  border-radius: 50%; background: radial-gradient(circle, rgba(59,130,246,.15), transparent 70%);
}
.stat-num { font-size: 26px; font-weight: 700; font-family: "SF Mono", Menlo, monospace; }
.stat-label { font-size: 12px; color: var(--dim); margin-top: 2px; }

/* 配置表单 */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.form-item label { display: block; font-size: 12px; color: var(--dim); margin-bottom: 5px; }
.form-item .input, .form-item .select { width: 100%; min-width: 0; }
.form-item .hint { font-size: 11px; color: var(--dim); opacity: .7; margin-top: 3px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; color: var(--dim); margin-bottom: 5px; }
.form-row .input, .form-row .textarea, .form-row .select { width: 100%; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; }

/* 日志控制台 */
.log-console {
  background: #070b12; border: 1px solid var(--line); border-radius: var(--radius);
  height: 320px; overflow-y: auto; padding: 12px;
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; line-height: 1.8;
}
.log-line { display: flex; gap: 10px; }
.log-time { color: #4a5a75; flex-shrink: 0; }
.log-info { color: #9fb6d9; }
.log-warn { color: var(--amber); }
.log-error { color: var(--red); }
.log-account { color: var(--accent2); flex-shrink: 0; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(4,8,16,.7); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-mask.hidden { display: none; }
.hidden { display: none !important; }  /* 通用隐藏（登录页令牌框等默认隐藏元素） */
.modal {
  width: 560px; max-width: 94vw; max-height: 88vh;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px;
}
.modal-close { background: none; border: none; color: var(--dim); cursor: pointer; font-size: 15px; }
.modal-close:hover { color: #fff; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.modal.wide { width: 860px; }

/* toast */
.toast-wrap { position: fixed; top: 70px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 18px; border-radius: 8px; font-size: 13px;
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: slideIn .2s;
  max-width: 420px; word-break: break-all;
}
.toast.ok { border-color: rgba(52,211,153,.5); }
.toast.err { border-color: rgba(248,113,113,.5); color: var(--red); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }

/* 云盘浏览器 */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 12px; font-size: 13px; }
.breadcrumb a { color: var(--accent2); cursor: pointer; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--dim); }
.file-ico { margin-right: 6px; }

/* 空状态 / 加载 */
.empty { text-align: center; padding: 50px 0; color: var(--dim); }
.empty .big { font-size: 36px; margin-bottom: 10px; }
.loading { text-align: center; padding: 30px; color: var(--dim); }

/* 查询统计条 */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.bar-word { width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.bar-track { flex: 1; height: 18px; background: var(--bg2); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 4px; min-width: 2px; }
.bar-num { width: 50px; font-family: Menlo, monospace; color: var(--accent2); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #31415f; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .logo-text, .sidebar-foot, .nav-item { font-size: 0; }
  .nav-item .nav-ico { font-size: 16px; }
  .account-select { min-width: 120px; }
}

/* ---------- 控制台登录页 ---------- */
.login-mask {
  position: fixed; inset: 0; z-index: 999;
  background: radial-gradient(1200px 600px at 50% -10%, #13203a 0%, var(--bg) 60%);
  display: flex; align-items: center; justify-content: center;
}
.login-mask.hidden { display: none; }
.login-box {
  width: 340px; padding: 36px 32px 24px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  display: flex; flex-direction: column; gap: 12px; text-align: center;
}
.login-logo { font-size: 42px; }
.login-title { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.login-sub { font-size: 12px; color: var(--dim); margin-bottom: 6px; }
.login-box .input { text-align: center; letter-spacing: 2px; }
.login-err { min-height: 18px; font-size: 12px; color: var(--red); }
.login-show { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--dim); cursor: pointer; }
.login-btn { width: 100%; padding: 10px; font-size: 15px; }
.login-foot { margin-top: 10px; font-size: 11px; color: var(--dim); }

/* ---------- 扫描状态指示 ---------- */
.nav-spin {
  width: 12px; height: 12px; margin-left: auto; flex-shrink: 0;
  border: 2px solid var(--line); border-top-color: var(--accent2);
  border-radius: 50%; display: none;
  animation: spin 0.8s linear infinite;
}
.nav-spin.on { display: inline-block; }
.mini-spin {
  width: 12px; height: 12px; flex-shrink: 0;
  border: 2px solid var(--line); border-top-color: var(--accent2);
  border-radius: 50%; display: inline-block;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.scan-tip { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); margin: 0 0 10px; min-height: 18px; }
.scan-tip b { color: var(--accent2); }.login-alt { margin-top: 8px; text-align: center; font-size: 12px; }
.login-alt a { color: var(--accent2, #4f8cff); text-decoration: none; }
.login-alt a:hover { text-decoration: underline; }
