/* 服务端版新增样式：登录、消息多选、管理后台。 */

#modal-root { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
#modal-root .modal-backdrop { pointer-events: auto; }

html, body { width: 100%; height: 100%; overflow: hidden; }
.app { height: 100vh; }

.hidden { display: none !important; }

/* ------------------------------------------------------------------ 登录 */
.auth-screen {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; padding: 24px;
}
.auth-card {
  width: min(400px, 100%);
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 30px 28px 24px;
  animation: rise 0.3s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.auth-logo {
  width: 74px; height: 74px; border-radius: 20px; overflow: hidden; margin: 0 auto 14px;
  box-shadow: 0 12px 30px rgba(70, 150, 220, 0.28);
  border: 1px solid var(--border);
  background: #fff;
}
.auth-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-title { text-align: center; margin: 0; font-size: 20px; letter-spacing: 0.5px; }
.auth-sub { text-align: center; color: var(--faint); font-size: 12px; margin: 6px 0 18px; }
.auth-tabs {
  display: flex; background: var(--panel-hi); border-radius: 12px; padding: 4px; margin-bottom: 18px;
}
.auth-tab {
  flex: 1; border: 0; background: transparent; padding: 8px 0; border-radius: 9px;
  color: var(--muted); font-size: 13px; cursor: pointer; font-family: inherit;
}
.auth-tab.active { background: var(--panel-solid); color: var(--text); box-shadow: 0 4px 14px rgba(30, 90, 140, 0.12); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form .field { margin: 0; }
.auth-form .input { width: 100%; }
.auth-error { min-height: 18px; color: #d9534f; font-size: 12px; text-align: center; }
.auth-note { color: var(--faint); font-size: 11px; text-align: center; margin-top: 14px; line-height: 1.7; }

/* ------------------------------------------------------------- 公告 / 顶栏 */
.announce {
  margin: 0 22px; padding: 9px 14px; border-radius: 10px; font-size: 12.5px;
  background: rgba(61, 157, 243, 0.1); border: 1px solid rgba(61, 157, 243, 0.22);
  color: var(--muted); white-space: pre-wrap;
}
.topbar { position: relative; }
.top-stats { display: flex; align-items: center; gap: 12px; margin-left: auto; margin-right: 4px; flex: none; }
.stat { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; flex: none; }
.stat b { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.stat span { font-size: 10px; color: var(--faint); letter-spacing: 0.2px; white-space: nowrap; }
.btn.small, .icon-btn.small { height: 30px; }

/* --------------------------------------------------------------- 消息多选 */
.app.select-mode .msg { cursor: pointer; }
.msg .pick { display: none; flex: none; align-items: center; padding: 0 2px; }
.app.select-mode .msg .pick { display: flex; }
.msg .pick input { width: 18px; height: 18px; accent-color: var(--pink); cursor: pointer; }
.msg.picked .bubble { box-shadow: 0 0 0 2px var(--pink); }
.app.select-mode .msg-tools { display: none; }
.select-bar {
  position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%);
  z-index: 30; display: flex; align-items: center; gap: 10px;
  background: var(--panel-solid); border: 1px solid var(--border-hi);
  border-radius: 999px; padding: 8px 10px 8px 18px; box-shadow: var(--shadow);
  font-size: 13px;
}
.select-bar b { color: var(--pink); }
.select-bar .spacer { width: 6px; }

/* 消息里的图片头像 */
.bubble img { max-width: 100%; border-radius: 8px; }
.msg.user .avatar { background: linear-gradient(150deg, rgba(86, 176, 245, 0.25), rgba(143, 212, 255, 0.3)); color: #1f5d89; font-weight: 600; }

/* 余额、花费 */
.balance-low { color: #d9534f !important; }

/* ---------------------------------------------------------------- 管理后台 */
.admin-body { overflow: auto; }
.admin-wrap { display: flex; min-height: 100vh; }
.admin-side {
  width: 220px; flex: none; padding: 22px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(240, 249, 255, 0.86));
  border-right: 1px solid var(--border);
}
.admin-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.admin-brand img { width: 38px; height: 38px; border-radius: 11px; }
.admin-brand b { font-size: 15px; }
.admin-brand span { display: block; font-size: 10px; letter-spacing: 1.4px; color: var(--faint); }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav button {
  text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-size: 13.5px; cursor: pointer; font-family: inherit;
}
.admin-nav button.active { background: rgba(61, 157, 243, 0.12); color: var(--text); font-weight: 600; }
.admin-nav button:hover { background: rgba(61, 157, 243, 0.08); }
.admin-side-foot { margin-top: 24px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.admin-side-foot a { color: var(--muted); text-decoration: none; }
.admin-side-foot a:hover { color: var(--text); }
.admin-main { flex: 1; min-width: 0; padding: 26px 30px 60px; max-width: 1080px; }
.admin-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.admin-head h1 { font-size: 20px; margin: 0; }
.admin-head p { margin: 3px 0 0; font-size: 12px; color: var(--faint); }
.admin-card {
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px; margin-bottom: 14px; box-shadow: 0 10px 30px rgba(30, 90, 140, 0.06);
}
.admin-card h3 { margin: 0 0 12px; font-size: 14px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-grid .full { grid-column: 1 / -1; }
.admin-card .field label { font-size: 12px; }
.admin-card textarea.input { min-height: 86px; resize: vertical; font-family: inherit; }
.admin-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.admin-actions .spacer { flex: 1; }
.char-row, .user-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border); margin-bottom: 8px; background: var(--panel-hi);
}
.char-row img, .char-row .emoji {
  width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none;
  display: grid; place-items: center; background: #fff; font-size: 20px;
}
.char-row .meta, .user-row .meta { min-width: 0; flex: 1; }
.char-row .meta b, .user-row .meta b { display: block; font-size: 13.5px; }
.char-row .meta small, .user-row .meta small {
  display: block; color: var(--faint); font-size: 11.5px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pill { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: rgba(61, 157, 243, 0.12); color: #2c6f9c; }
.pill.danger { background: rgba(217, 83, 79, 0.12); color: #b53a36; }
.admin-empty { padding: 20px; text-align: center; color: var(--faint); font-size: 13px; }
.avatar-upload { display: flex; align-items: center; gap: 12px; }
.avatar-upload img { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; background: #fff; border: 1px solid var(--border); }
.admin-login { max-width: 420px; margin: 12vh auto; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; }

@media (max-width: 860px) {
  .admin-side { display: none; }
  .admin-main { padding: 18px 16px 60px; }
  .admin-grid { grid-template-columns: 1fr; }
  .top-stats { display: none; }
}
