/* LocScan 壳样式（知识库独立站 · 与主程序一致） */
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --line: #e6edf5;
  --text: #1f2a37;
  --muted: #6b7c93;
  --blue: #2f6bff;
  --orange: #ff7a1a;
  --green: #16a34a;
  --red: #e11d48;
  --side: #0f1b2d;
  --side-text: #c7d2e5;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
}
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; transition: grid-template-columns .2s ease; }
.shell.side-collapsed { grid-template-columns: 64px 1fr; }
.sidebar {
  background: linear-gradient(180deg, #102033 0%, #0b1524 100%);
  color: var(--side-text); padding: 18px 14px; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.side-toggle {
  position: absolute; top: 14px; right: 8px; width: 28px; height: 28px;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06);
  color: #c7d2e5; border-radius: 8px; cursor: pointer; font-size: 0.85rem; line-height: 1;
}
.side-toggle:hover { background: rgba(255,255,255,0.12); color: #fff; }
.shell.side-collapsed .brand-text,
.shell.side-collapsed .nav-section-title,
.shell.side-collapsed .nav-caret,
.shell.side-collapsed .nav-item .nav-label,
.shell.side-collapsed .side-foot { display: none; }
.shell.side-collapsed .nav-section-head {
  justify-content: center;
  padding: 8px;
}
.shell.side-collapsed .nav-item { justify-content: center; padding: 10px 8px; }
.shell.side-collapsed .nav-item.sub { padding-left: 8px; }
.shell.side-collapsed .brand { justify-content: center; padding-top: 28px; }
.shell.side-collapsed .side-toggle { right: 50%; transform: translateX(50%); }
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; padding: 4px 6px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #2f6bff, #22d3ee);
  display: grid; place-items: center; color: #fff; font-weight: 800;
}
.brand-name { color: #fff; font-weight: 800; font-size: 1rem; }
.brand-name span { color: #67e8f9; }
.brand-sub { font-size: 0.72rem; opacity: .7; margin-top: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  color: var(--side-text); font-size: 0.9rem; margin-bottom: 4px;
  border: 1px solid transparent; user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,0.05); }
.nav-item.active {
  background: rgba(47,107,255,0.18); border-color: rgba(47,107,255,0.35); color: #fff;
}
.nav-icon { width: 18px; text-align: center; opacity: .9; flex: 0 0 auto; }
.nav-section { margin: 4px 0 8px; }
.nav-section-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin: 0; padding: 8px 10px; border: 0; border-radius: 8px;
  background: transparent; color: #9fb0c7; cursor: pointer; font: inherit;
  font-size: 0.72rem; letter-spacing: .04em; font-weight: 750; user-select: none;
}
.nav-section-head:hover { background: rgba(255,255,255,0.04); color: #d7e3f4; }
.nav-section-title { flex: 1 1 auto; text-align: left; }
.nav-caret {
  flex: 0 0 auto; font-size: 0.7rem; opacity: .75;
  transition: transform .18s ease;
}
.nav-section.is-collapsed .nav-caret { transform: rotate(-90deg); }
.nav-section-body {
  overflow: hidden; max-height: 640px; opacity: 1;
  transition: max-height .2s ease, opacity .18s ease, margin .18s ease;
  margin-top: 2px;
}
.nav-section.is-collapsed .nav-section-body {
  max-height: 0; opacity: 0; margin-top: 0; pointer-events: none;
}
.nav-item.sub { padding-left: 18px; font-size: 0.86rem; }
.side-foot {
  margin-top: auto; padding: 14px 10px 4px; font-size: 0.72rem; line-height: 1.45; color: #8fa0b8;
}
.side-foot b { color: #fff; display: block; }
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 16px 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.crumb { font-size: 0.75rem; color: var(--muted); margin-bottom: 4px; }
.topbar h1 { font-size: 1.25rem; font-weight: 800; }
.content { padding: 18px 22px 36px; }
.page { display: none; }
.page.active { display: block; }
.btn {
  border: none; border-radius: 10px; padding: 8px 14px; font-size: 0.85rem; font-weight: 650;
  cursor: pointer; background: var(--blue); color: #fff;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--red); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); font-size: 0.85rem; }
.auth-float { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.auth-avatar {
  width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line);
  background: linear-gradient(135deg, #2f6bff, #22d3ee); color: #fff;
  font-size: 0.72rem; font-weight: 800; display: grid; place-items: center;
}
.auth-user-name {
  font-size: 0.82rem; font-weight: 650; color: var(--text); max-width: 120px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.auth-login-pop {
  display: none; position: fixed; inset: 0; z-index: 90;
  background: rgba(15, 23, 42, .45); align-items: center; justify-content: center; padding: 16px;
}
.auth-login-pop.show { display: flex; }
.auth-login-card {
  width: min(380px, 100%); background: #fff; border-radius: 16px; padding: 18px;
  box-shadow: 0 24px 60px rgba(15,23,42,.25);
}
.auth-login-card h3 { margin: 0 0 12px; font-size: 1.05rem; }
.auth-login-card label {
  display: grid; gap: 5px; margin-bottom: 10px; font-size: 0.75rem; font-weight: 700; color: #64748b;
}
.auth-login-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.auth-login-hint { margin-top: 10px; font-size: 0.75rem; color: var(--muted); }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 0.9rem; font-family: inherit; background: #fff; color: var(--text);
}
/* 复选框/单选不要 width:100%，否则 Checklist 标题会被挤成竖排 */
input[type="checkbox"],
input[type="radio"] {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0;
  flex: 0 0 auto;
  border: none;
  border-radius: 0;
  background: transparent;
  accent-color: #2563eb;
}
.gate-box {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 28px 22px; text-align: center; color: var(--muted);
}
.gate-box b { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 8px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
