/* 个人工作台 — 全局样式（无外部依赖） */
:root {
  --bg: #0f172a;
  --bg-soft: #1e293b;
  --card: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --ok: #34d399;
  --err: #f87171;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── 登录页 ── */
.login-body {
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% 0%, #1e1b4b 0%, var(--bg) 55%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 14px;
}
.login-title { text-align: center; font-size: 22px; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 14px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 15px;
  outline: none; transition: border-color .15s;
}
.field input:focus { border-color: var(--accent); }
.login-error {
  background: rgba(248,113,113,.12); color: var(--err);
  border: 1px solid rgba(248,113,113,.35);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px;
}

/* ── 按钮 ── */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border: none; border-radius: 10px;
  padding: 12px; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: filter .15s;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 14px; font-size: 13px; cursor: pointer;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

/* ── 工作台 ── */
.topbar {
  background: rgba(15,23,42,.8); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 24px;
}
.brand { font-weight: 700; font-size: 16px; }
.topnav { display: flex; gap: 6px; flex: 1; }
.nav-link {
  color: var(--text-muted); text-decoration: none; font-size: 14px;
  padding: 6px 12px; border-radius: 8px;
}
.nav-link:hover { color: var(--text); background: var(--bg-soft); }
.nav-link.active { color: #fff; background: var(--bg-soft); }
.user-box { display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 14px; color: var(--text); }
.container { max-width: 1080px; margin: 0 auto; padding: 32px 24px 60px; }
.hero {
  background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(139,92,246,.10));
  border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 32px; margin-bottom: 24px;
}
.hero h2 { font-size: 26px; margin-bottom: 6px; }
.hero p { color: var(--text-muted); }
.grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px;
}
.card-icon { font-size: 22px; margin-bottom: 10px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.card-body { color: var(--text-muted); font-size: 14px; }
.card-body strong { color: var(--text); }
.link-list { list-style: none; }
.link-list li { margin-bottom: 8px; }
.link-list a {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text); text-decoration: none;
  background: var(--bg-soft); border-radius: 10px; padding: 10px 14px;
  transition: border-color .15s, transform .15s;
}
.link-list a:hover { border: 1px solid var(--accent); transform: translateX(2px); }
.link-list small { color: var(--text-muted); font-size: 12px; }
.muted { color: var(--text-muted); }
#sys-status { white-space: pre-line; }

/* ── TOTP 两步验证 / 绑定面板 ── */
.totp-panel { margin-top: 4px; }
.totp-title { text-align: center; font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.setup-steps {
  margin: 0 0 14px 18px; padding: 0;
  color: var(--text-muted); font-size: 13px;
}
.setup-steps li { margin-bottom: 6px; }
.setup-steps strong { color: var(--text); }
.totp-input {
  width: 100%; padding: 11px 14px; margin: 10px 0;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 18px;
  text-align: center; letter-spacing: 4px; outline: none;
}
.totp-input:focus { border-color: var(--accent); }
.qrcode-box {
  display: flex; justify-content: center; align-items: center;
  background: #fff; border-radius: 12px; padding: 12px;
  margin: 12px auto; min-height: 180px; width: fit-content;
}
.qrcode-box img { width: 180px; height: 180px; }
.secret { user-select: all; letter-spacing: 1px; }
.small { font-size: 12px; word-break: break-all; }
.totp-panel .btn-ghost { margin-top: 10px; }

/* ── 管理员用户管理 ── */
.admin-card { margin-top: 24px; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-row input, .form-row select {
  padding: 9px 12px; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 14px; outline: none;
}
.form-row input:focus, .form-row select:focus { border-color: var(--accent); }
.form-row input[type="text"] { min-width: 150px; }
.user-table {
  width: 100%; border-collapse: collapse; margin-top: 14px;
  font-size: 13px;
}
.user-table th, .user-table td {
  text-align: left; padding: 9px 10px;
  border-bottom: 1px solid var(--border);
}
.user-table th { color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.row-ops { white-space: nowrap; }
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 12px; white-space: nowrap;
}
.tag-admin { background: rgba(99,102,241,.18); color: #a5b4fc; }
.tag-user { background: rgba(148,163,184,.15); color: var(--text-muted); }
.tag-totp-on { background: rgba(52,211,153,.15); color: var(--ok); }
.tag-totp-off { background: rgba(148,163,184,.12); color: var(--text-muted); }
.btn-sm {
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 5px 12px; font-size: 12px; cursor: pointer; margin-right: 4px;
}
.btn-sm:hover { border-color: var(--accent); color: #fff; }
.btn-danger:hover { border-color: var(--err); color: var(--err); }

/* ── 我的项目卡片 ── */
.project-card { margin-top: 24px; background: linear-gradient(135deg, rgba(99,102,241,.06), rgba(22,93,255,.04)); }
.project-body { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.project-desc { margin: 0; font-size: 14px; }
.project-desc strong { font-size: 16px; }
#project-open-btn { width: auto; padding: 10px 26px; text-decoration: none; display: inline-block; }

/* 自动登录勾选 */
.remember-row {
  display: flex; align-items: center; gap: 8px;
  margin: 2px 0 14px;
  font-size: 13.5px; color: var(--muted, #8a94a6);
  cursor: pointer; user-select: none;
}
.remember-row input {
  width: 20px; height: 20px; accent-color: var(--primary, #2563eb);
  cursor: pointer;
}

/* ── 页脚（备案信息） ── */
.site-footer {
  text-align: center;
  padding: 18px 12px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 2;
}
.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}
.site-footer a:hover { color: var(--text); }
.site-footer .beian-sep { margin: 0 8px; opacity: .5; }

/* 公安备案：官方图标 + 标准文案 */
.site-footer .beian-police {
  display: inline-flex; align-items: center; gap: 5px;
  vertical-align: middle;
}
.site-footer .beian-police img { display: block; width: 20px; height: 20px; }

/* 登录页：卡片垂直居中不变，页脚固定贴底 */
.login-body { padding-bottom: 60px; }
.login-body .site-footer {
  position: fixed; left: 0; right: 0; bottom: 8px;
  padding: 6px 12px;
}
