/* ============================================================
   online.css · 联网版通用组件（登录页 / 报告主页共用）
   - 依赖 src/css/style.css 中的设计变量；不覆盖任何既有规则
   - 由 Lead 维护，前端 Agent 可直接使用，不要修改
   ============================================================ */

/* ---------- 顶部工具栏：品牌 + 当前用户 + 退出 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  position: relative;
  z-index: 6;
}
.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(232, 180, 119, 0.42);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 14px rgba(26, 18, 6, 0.08);
}
.topbar-brand .brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sky), var(--leaf));
  color: #fff;
  font-size: 12px;
  font-style: normal;
}
.topbar-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
body.night .topbar-brand {
  background: rgba(8, 13, 22, 0.5);
  border-color: rgba(236, 246, 255, 0.14);
  color: #fdf6e9;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px 4px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(232, 180, 119, 0.38);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(26, 18, 6, 0.08);
}
body.night .user-chip {
  background: rgba(8, 13, 22, 0.5);
  border-color: rgba(236, 246, 255, 0.12);
  color: #f2efe9;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #5aa9e6, #2a9d8f);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex: none;
}
.role-tag {
  font-size: 10px;
  font-weight: 800;
  color: var(--leaf-deep);
  background: rgba(47, 122, 92, 0.14);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
body.night .role-tag {
  color: #8fd0b3;
  background: rgba(143, 208, 179, 0.16);
}
.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--leaf);
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.16);
  flex: none;
}
.online-dot.off {
  background: var(--vermilion);
  box-shadow: 0 0 0 3px rgba(231, 111, 81, 0.16);
}
.btn-icon {
  border: 1.5px solid rgba(30, 58, 82, 0.18);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: inherit;
}
.btn-icon:hover {
  transform: translateY(-1px);
  color: var(--ink);
}
body.night .btn-icon {
  border-color: rgba(236, 246, 255, 0.18);
  background: rgba(8, 13, 22, 0.5);
  color: rgba(242, 239, 233, 0.75);
}

/* ---------- 页面级提示条 ---------- */
.app-alert {
  display: none;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  background: rgba(111, 177, 214, 0.14);
  border: 1px solid rgba(111, 177, 214, 0.4);
  color: var(--ink-2);
}
.app-alert.show { display: flex; }
.app-alert.err {
  background: rgba(231, 111, 81, 0.12);
  border-color: rgba(231, 111, 81, 0.4);
  color: #b5502f;
}
body.night .app-alert { color: #f2efe9; }
body.night .app-alert.err { background: rgba(231, 111, 81, 0.16); }

/* ---------- 全屏加载遮罩 ---------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
  background: rgba(233, 241, 248, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  transition: opacity 0.35s ease;
}
.loading-overlay.hide { opacity: 0; pointer-events: none; }
body.night .loading-overlay { background: rgba(8, 13, 22, 0.72); color: #f2efe9; }
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(31, 111, 178, 0.2);
  border-top-color: #1f6fb2;
  animation: ov-spin 0.8s linear infinite;
}
@keyframes ov-spin { to { transform: rotate(360deg); } }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  z-index: 120;
  max-width: min(90vw, 420px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(16, 28, 46, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: rgba(185, 74, 47, 0.94); }

/* ---------- 通用玻璃面板（登录页复用） ---------- */
.glass-panel {
  background: linear-gradient(160deg, rgba(251, 247, 238, 0.6), rgba(243, 236, 221, 0.48));
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  border: 1px solid rgba(232, 180, 119, 0.38);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(26, 18, 6, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
body.night .glass-panel {
  background: linear-gradient(160deg, rgba(8, 13, 22, 0.62), rgba(4, 7, 13, 0.62));
  border-color: rgba(236, 246, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* ---------- 表单基础（登录页可直接使用） ---------- */
.ov-field { margin-top: 15px; }
.ov-field > label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.ov-input-wrap { position: relative; display: flex; align-items: center; }
.ov-input {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px solid rgba(200, 216, 230, 0.9);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.ov-input::placeholder { color: var(--ink-3); }
.ov-input:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(90, 169, 230, 0.18);
}
body.night .ov-input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(236, 246, 255, 0.16);
  color: #f2efe9;
}
body.night .ov-input::placeholder { color: rgba(242, 239, 233, 0.4); }
.ov-input.has-toggle { padding-right: 54px; }
.ov-field-err {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--vermilion);
  min-height: 16px;
}

@media (max-width: 520px) {
  .topbar { gap: 8px; }
  .topbar .role-tag { display: none; }
  .btn-icon { padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  .toast, .loading-overlay { transition: none; }
}
