/* 聊吧 / LiaoBa — 管理后台样式
   纯本地 CSS，无外部字体与图片资源。 */

:root {
  color-scheme: dark;
  --bg: #0d0e15;
  --bg-soft: #111320;
  --panel: #171923;
  --panel-2: #1c1f2b;
  --panel-3: #222634;
  --border: #262a3a;
  --border-strong: #343a4f;
  --text: #e9ebf4;
  --text-dim: #a6acc1;
  --text-muted: #727992;
  --accent: #6c5ce7;
  --accent-strong: #8b7cf6;
  --accent-soft: rgba(108, 92, 231, 0.16);
  --success: #34d399;
  --warn: #f5c451;
  --danger: #ff6b81;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.38);
  --sidebar-w: 236px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(900px 520px at 88% -8%, rgba(108, 92, 231, 0.1), transparent 62%),
    radial-gradient(760px 460px at -6% 108%, rgba(108, 92, 231, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(108, 92, 231, 0.45);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #2b3042;
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a4157;
  background-clip: padding-box;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
dt {
  margin: 0;
}

a {
  color: var(--accent-strong);
}

.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

.muted {
  color: var(--text-muted);
}

.ta-right {
  text-align: right !important;
}

/* ------------------------------------------------------------------ boot */

.boot {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
}

.boot__text {
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------- spinner */

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent-strong);
  animation: spin 0.7s linear infinite;
  flex: none;
}

.spinner--lg {
  width: 28px;
  height: 28px;
  border-width: 3px;
}

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 26px 6px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ----------------------------------------------------------------- login */

.login {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
}

.login__orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.login__orb--a {
  width: 460px;
  height: 460px;
  top: -140px;
  left: -120px;
  background: rgba(108, 92, 231, 0.3);
}

.login__orb--b {
  width: 380px;
  height: 380px;
  right: -100px;
  bottom: -120px;
  background: rgba(76, 110, 245, 0.18);
}

.login__card {
  position: relative;
  width: 100%;
  max-width: 408px;
  padding: 34px 32px 26px;
  background: rgba(23, 25, 35, 0.92);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  animation: riseIn 0.3s ease;
}

.login__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.logo {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(140deg, #8b7cf6, #5546cf);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(108, 92, 231, 0.38);
  flex: none;
  user-select: none;
}

.logo--lg {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 21px;
}

.login__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.login__sub {
  margin-top: 2px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.login__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login__error {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 107, 129, 0.35);
  background: rgba(255, 107, 129, 0.1);
  color: #ff9dab;
  font-size: 13px;
}

.login__foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
}

/* ------------------------------------------------------------------ app */

.app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  padding: 16px 14px;
  background: linear-gradient(180deg, #13151f, #0f1017);
  border-right: 1px solid var(--border);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
}

.sidebar__brand-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  padding: 4px 2px;
}

.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav__link:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.nav__link.is-active {
  background: var(--accent-soft);
  color: #fff;
}

.nav__link.is-active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  width: 3px;
  height: 18px;
  border-radius: 3px;
  background: var(--accent-strong);
  transform: translateY(-50%);
}

.nav__icon {
  display: inline-flex;
  flex: none;
}

.nav__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.nav__label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 10px 4px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
}

.sidebar__site {
  color: var(--text-dim);
  text-decoration: none;
}

.sidebar__site:hover {
  color: var(--accent-strong);
}

.shell {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 10px 26px;
  background: rgba(13, 14, 21, 0.82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.topbar__left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.topbar__site {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.topbar__sep {
  color: var(--border-strong);
}

.topbar__crumb {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.who {
  display: flex;
  align-items: center;
  gap: 10px;
}

.who__avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(139, 124, 246, 0.28);
  color: #cfc7ff;
  font-weight: 700;
  font-size: 13px;
  flex: none;
  user-select: none;
}

.who__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.who__name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

.view {
  flex: 1;
  padding: 24px 28px 56px;
  outline: none;
}

.view__inner {
  max-width: 1400px;
  margin: 0 auto;
  animation: fadeIn 0.18s ease;
}

/* ------------------------------------------------------------ page head */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.page-head__title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-head__sub {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-muted);
}

.page-head__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------- cards */

.card {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card__title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  position: relative;
  padding: 16px 18px;
  background: linear-gradient(180deg, #1a1d28, #151722);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 124, 246, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.stat:hover::after {
  opacity: 1;
}

.stat__label {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.stat__value {
  margin-top: 7px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat__hint {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.stat--alert .stat__value {
  color: var(--warn);
}

.stat--alert .stat__label {
  color: #d9bd7f;
}

.updated-at {
  margin: 0 2px 18px;
  font-size: 12px;
  color: var(--text-muted);
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.quick-link:hover {
  border-color: rgba(139, 124, 246, 0.5);
  background: var(--accent-soft);
  color: #fff;
}

.quick-link__arrow {
  color: var(--text-muted);
  font-size: 12px;
}

/* --------------------------------------------------------------- forms */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field--full {
  grid-column: 1 / -1;
}

.field__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
}

.field__hint {
  font-size: 11.5px;
  color: var(--text-muted);
}

.input {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: #10121b;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
  color: #5d6479;
}

.input:hover:not(:disabled) {
  border-color: #414963;
}

.input:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.22);
}

.input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.6;
}

select.input {
  appearance: none;
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, #7f869c 50%),
    linear-gradient(135deg, #7f869c 50%, transparent 50%);
  background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

input[type="search"]::-webkit-search-cancel-button {
  filter: invert(0.6);
}

input[type="number"] {
  font-variant-numeric: tabular-nums;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-error {
  grid-column: 1 / -1;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 107, 129, 0.35);
  background: rgba(255, 107, 129, 0.1);
  color: #ff9dab;
  font-size: 12.5px;
}

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px;
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.inline-form .field {
  flex: 1 1 200px;
}

.inline-form .field--narrow {
  flex: 0 1 150px;
}

/* --------------------------------------------------------------- switch */

.switch {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 24px;
  flex: none;
  cursor: pointer;
}

.switch__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.switch__track {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #2a2e3d;
  border: 1px solid var(--border-strong);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.switch__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #8b90a6;
  transition: transform 0.18s ease, background 0.18s ease;
}

.switch__input:checked ~ .switch__track {
  background: var(--accent);
  border-color: var(--accent-strong);
}

.switch__input:checked ~ .switch__track .switch__knob {
  transform: translateX(18px);
  background: #fff;
}

.switch__input:focus-visible ~ .switch__track {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.switch-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(38, 42, 58, 0.75);
}

.switch-row:last-child {
  border-bottom: none;
}

.switch-row__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.switch-row__label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}

.switch-row__hint {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------- toolbar */

.toolbar {
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.toolbar__row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar__row .field {
  flex: 1 1 170px;
  max-width: 260px;
}

.toolbar__actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* ---------------------------------------------------------------- table */

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #14161f;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(38, 42, 58, 0.55);
  color: var(--text-dim);
  vertical-align: middle;
  white-space: nowrap;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.024);
}

.table tr.is-clickable {
  cursor: pointer;
}

.table tr.is-clickable:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: -2px;
}

.table__empty {
  padding: 0 !important;
}

.cell-sub {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.cell-actions {
  display: flex;
  gap: 6px;
}

/* --------------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge--role {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-strong);
  color: var(--text-dim);
}

.badge--owner {
  background: rgba(245, 196, 81, 0.12);
  border-color: rgba(245, 196, 81, 0.34);
  color: #f6cd70;
}

.badge--admin {
  background: rgba(108, 92, 231, 0.16);
  border-color: rgba(139, 124, 246, 0.36);
  color: #b9afff;
}

.badge--moderator {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  color: #86d8fb;
}

.badge--user {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--border-strong);
  color: var(--text-dim);
}

.badge--active,
.badge--resolved {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
}

.badge--muted,
.badge--open {
  background: rgba(245, 196, 81, 0.12);
  border-color: rgba(245, 196, 81, 0.3);
  color: #f6cd70;
}

.badge--banned,
.badge--block {
  background: rgba(255, 107, 129, 0.12);
  border-color: rgba(255, 107, 129, 0.32);
  color: #ff9dab;
}

.badge--deleted,
.badge--rejected {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-strong);
  color: var(--text-muted);
}

.badge--mask {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.28);
  color: #86d8fb;
}

.badge--text,
.badge--system {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--border-strong);
  color: var(--text-dim);
}

.badge--image {
  background: rgba(108, 92, 231, 0.14);
  border-color: rgba(139, 124, 246, 0.3);
  color: #b9afff;
}

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.06s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(180deg, #7f70f3, #6250e0);
  border-color: #7a68ea;
  color: #fff;
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.28);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #8d7ffa, #6d5bf0);
}

.btn--ghost {
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--text-dim);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--panel-3);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn--danger {
  background: rgba(255, 107, 129, 0.12);
  border-color: rgba(255, 107, 129, 0.38);
  color: #ff9dab;
}

.btn--danger:hover:not(:disabled) {
  background: rgba(255, 107, 129, 0.2);
  color: #ffc0c9;
}

.btn--sm {
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: 8px;
}

.btn--block {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* --------------------------------------------------------------- pager */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 2px 0;
}

.pager__info {
  font-size: 12.5px;
  color: var(--text-muted);
}

.pager__btns {
  display: flex;
  gap: 8px;
}

/* ---------------------------------------------------------- empty/error */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 44px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  border: 1px dashed var(--border-strong);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 17px;
}

.empty__title {
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 600;
}

.empty__hint {
  font-size: 12.5px;
  color: var(--text-muted);
}

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 34px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ------------------------------------------------------------- skeleton */

.sk {
  display: block;
  height: 11px;
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #1e2230 25%, #2b3042 37%, #1e2230 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.sk--sm {
  width: 55%;
}

.sk--stat {
  height: 52px;
  border-radius: 10px;
}

.loading-card {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* --------------------------------------------------------------- modal */

body.has-modal {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 6, 11, 0.72);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.15s ease;
}

.modal-overlay.is-closing {
  animation: fadeOut 0.13s ease forwards;
}

.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.18s ease;
  outline: none;
}

.modal--sm {
  max-width: 430px;
}

.modal--lg {
  max-width: 780px;
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal__title {
  font-size: 15.5px;
  font-weight: 700;
}

.modal__body {
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: #14161f;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.confirm__text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
}

.confirm__detail {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #12141d;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
  word-break: break-word;
}

/* ------------------------------------------------------------- toasts */

.toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: #1b1e2a;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  pointer-events: auto;
  animation: toastIn 0.2s ease;
}

.toast.is-out {
  animation: toastOut 0.16s ease forwards;
}

.toast__dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent-strong);
  flex: none;
}

.toast--success .toast__dot {
  background: var(--success);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
}

.toast--error .toast__dot {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(255, 107, 129, 0.5);
}

.toast--info .toast__dot {
  background: var(--accent-strong);
}

.toast__msg {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.toast__close {
  flex: none;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.toast__close:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

/* -------------------------------------------------------------- tabs */

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.tab {
  padding: 10px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab:hover {
  color: var(--text-dim);
}

.tab.is-active {
  color: #fff;
  border-bottom-color: var(--accent-strong);
}

/* ------------------------------------------------------------ reports */

.report-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.report__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.report__title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report__id {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
}

.report__time {
  font-size: 12px;
  color: var(--text-muted);
}

.report__content {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #12141d;
  font-size: 13.5px;
  color: var(--text-dim);
  transition: border-color 0.15s ease;
}

.report__content.is-clickable {
  cursor: pointer;
}

.report__content.is-clickable:hover {
  border-color: var(--border-strong);
}

.report__msg-meta {
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.report__msg-text {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 150px;
  overflow: auto;
}

.report__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.report__meta b {
  color: var(--text-dim);
  font-weight: 600;
}

.report__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* --------------------------------------------------------- user actions */

.user-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.user-summary__avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--accent-soft);
  border: 1px solid rgba(139, 124, 246, 0.28);
  color: #cfc7ff;
  font-size: 18px;
  font-weight: 700;
  flex: none;
  user-select: none;
}

.user-summary__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.user-summary__name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 700;
}

.user-summary__handle {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.user-summary__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  padding: 14px;
  margin-bottom: 14px;
  background: #12141d;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.fact {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  min-width: 0;
}

.fact__label {
  color: var(--text-muted);
  white-space: nowrap;
}

.fact__value {
  color: var(--text-dim);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-extra {
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.user-extra__row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.notice {
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1px solid rgba(245, 196, 81, 0.3);
  background: rgba(245, 196, 81, 0.08);
  color: #f0d296;
  font-size: 12.5px;
}

.action-group {
  margin-top: 14px;
}

.action-group:first-child {
  margin-top: 0;
}

.action-group__title {
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.action-item:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: #202433;
}

.action-item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.action-item--danger {
  border-color: rgba(255, 107, 129, 0.3);
  color: #ff9dab;
}

.action-item--danger:hover:not(:disabled) {
  border-color: rgba(255, 107, 129, 0.55);
  background: rgba(255, 107, 129, 0.1);
}

.action-item__label {
  min-width: 0;
}

.action-item__hint {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-muted);
  text-align: right;
  flex: none;
}

/* ------------------------------------------------------- message detail */

.msg-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.msg-detail__content {
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #12141d;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-detail__content.is-deleted {
  color: var(--text-muted);
  font-style: italic;
}

.msg-detail__image {
  display: block;
  max-width: 100%;
  max-height: 380px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  object-fit: contain;
  background: #0c0d14;
}

.msg-detail__quote {
  margin-top: 12px;
  padding: 9px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: rgba(108, 92, 231, 0.08);
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.reaction {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 12.5px;
  color: var(--text-dim);
}

/* ------------------------------------------------------------ settings */

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-section {
  padding: 18px 20px;
}

.settings-section__head {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.settings-section__title {
  font-size: 14px;
  font-weight: 700;
}

.settings-section__hint {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-muted);
}

.settings-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgba(20, 22, 31, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.28);
}

.settings-actions__text {
  font-size: 12.5px;
  color: var(--text-muted);
}

.settings-actions__buttons {
  display: flex;
  gap: 8px;
}

/* ----------------------------------------------------------- broadcast */

.broadcast {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 780px;
}

.broadcast__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.char-count {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.broadcast__send {
  display: flex;
  align-items: center;
  gap: 12px;
}

.broadcast__foot .field {
  min-width: 220px;
}

.inline-form > .btn {
  height: 38px;
}

.status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 13px;
  color: var(--text-dim);
}

.status-banner__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
  flex: none;
}

.status-banner--on {
  border-color: rgba(245, 196, 81, 0.32);
  background: rgba(245, 196, 81, 0.07);
  color: #f0d296;
}

.status-banner--on .status-banner__dot {
  background: var(--warn);
  box-shadow: 0 0 10px rgba(245, 196, 81, 0.55);
}

.status-banner--off {
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.06);
  color: #a7e8cd;
}

.status-banner--off .status-banner__dot {
  background: var(--success);
}

.maintenance-card {
  max-width: 720px;
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  z-index: 100;
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  :root {
    --sidebar-w: 212px;
  }

  .view {
    padding: 20px 20px 48px;
  }

  .topbar {
    padding: 10px 18px;
  }

  .who__name {
    max-width: 110px;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-w: 66px;
  }

  .sidebar {
    padding: 14px 8px;
  }

  .sidebar__brand {
    justify-content: center;
    padding: 4px 0 16px;
  }

  .sidebar__brand-text,
  .nav__label,
  .sidebar__foot {
    display: none;
  }

  .nav__link {
    justify-content: center;
    padding: 12px 0;
  }

  .nav__link.is-active::before {
    left: -2px;
    height: 20px;
  }

  .nav__icon svg {
    width: 20px;
    height: 20px;
  }

  .topbar__site {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .field--full {
    grid-column: auto;
  }

  .facts {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .view {
    padding: 16px 12px 44px;
  }

  .topbar {
    min-height: 56px;
    padding: 8px 12px;
  }

  .topbar__sep,
  .topbar__crumb,
  .who__meta {
    display: none;
  }

  .topbar__right {
    gap: 8px;
  }

  .page-head__title {
    font-size: 18px;
  }

  .page-head__actions {
    width: 100%;
  }

  .toolbar__row .field {
    max-width: none;
    flex-basis: 100%;
  }

  .toolbar__actions {
    margin-left: 0;
    width: 100%;
  }

  .toolbar__actions .btn {
    flex: 1;
  }

  .inline-form .field {
    flex-basis: 100%;
  }

  .modal-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  .modal {
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
  }

  .modal__foot {
    border-radius: 0;
  }

  .toasts {
    top: 10px;
    right: 10px;
    width: calc(100vw - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------------------------------------ keyframes */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(14px);
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
