:root {
  --bg: #111513;
  --surface: #191e1b;
  --surface-subtle: #202622;
  --border: #323a35;
  --text: #edf1ee;
  --muted: #9ca6a0;
  --accent: #77b592;
  --accent-soft: #263c30;
  --danger: #e28a80;
  --danger-soft: #432b29;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100vh; margin: 0; background: var(--bg); }
button, input, select { font: inherit; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1060px, calc(100% - 32px));
  height: 76px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand strong { font-size: 16px; }
.brand-mark { position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); }
.brand-mark::before { position: absolute; top: 10px; left: 13px; width: 11px; height: 18px; border: 2px solid #f4faf6; border-radius: 100% 0 100% 0; content: ""; transform: rotate(34deg); }
.brand-mark::after { position: absolute; top: 20px; left: 17px; width: 10px; height: 2px; background: #f4faf6; content: ""; transform: rotate(-42deg); transform-origin: left center; }
.top-actions { display: flex; }
.top-actions a, .top-actions button { height: 40px; padding: 0 14px; border: 1px solid var(--border); color: var(--muted); background: var(--surface); cursor: pointer; font-size: 12px; font-weight: 700; line-height: 38px; text-decoration: none; }
.top-actions button { border-radius: 6px 0 0 6px; }
.top-actions a { margin-left: -1px; border-radius: 0 6px 6px 0; }
.top-actions a:hover, .top-actions button:hover { color: var(--text); background: var(--surface-subtle); }
.admin-shell { width: min(1060px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 64px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-heading h1 { margin: 0; font-size: 24px; }
.page-heading span { color: var(--muted); font: 700 12px/1 ui-monospace, Consolas, monospace; }
.overview { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.overview div { padding: 18px; border-right: 1px solid var(--border); }
.overview div:last-child { border-right: 0; }
.overview span, .overview strong { display: block; }
.overview span { color: var(--muted); font-size: 11px; }
.overview strong { margin-top: 8px; font: 800 22px/1 ui-monospace, Consolas, monospace; }
.user-panel { margin-top: 24px; border-top: 1px solid var(--border); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0 14px; }
.panel-head h2 { margin: 0; font-size: 17px; }
.filters { display: flex; gap: 8px; }
.filters input, .filters select { height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; outline: 0; color: var(--text); background: var(--surface); }
.filters input { width: 210px; }
.filters select { color: var(--muted); }
.filters input:focus, .filters select:focus { border-color: var(--accent); }
.user-list { border-top: 1px solid var(--border); }
.user-row { display: grid; grid-template-columns: minmax(190px, 1.3fr) 100px 100px minmax(260px, auto); align-items: center; gap: 16px; min-height: 76px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.user-main { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 11px; min-width: 0; }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #142019; background: var(--accent); background-position: center; background-size: cover; font-weight: 800; }
.user-main strong, .user-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-main strong { font-size: 13px; }
.user-main small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.data-cell strong, .data-cell small { display: block; }
.data-cell strong { font: 800 15px/1 ui-monospace, Consolas, monospace; }
.data-cell small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.status { width: max-content; padding: 5px 8px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); background: var(--surface-subtle); font-size: 10px; font-weight: 700; }
.status.admin { border-color: #42604f; color: #a9d5bc; background: var(--accent-soft); }
.status.disabled { border-color: #66443f; color: #e3a39b; background: var(--danger-soft); }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.row-actions button { min-height: 32px; padding: 0 9px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); background: var(--surface); cursor: pointer; font-size: 10px; font-weight: 700; }
.row-actions button:hover { color: var(--text); background: var(--surface-subtle); }
.row-actions button.danger:hover { border-color: #66443f; color: var(--danger); background: var(--danger-soft); }
.row-actions button:disabled { opacity: .38; cursor: not-allowed; }
.empty { padding: 56px 0; color: var(--muted); text-align: center; }
.password-dialog { width: min(390px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface); }
.password-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { margin: 0; font-size: 17px; }
.dialog-head button { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); background: var(--surface-subtle); cursor: pointer; font-size: 19px; }
.password-dialog form { display: grid; gap: 14px; padding: 18px; }
.password-dialog form > p:first-child { margin: 0; color: var(--muted); font-size: 12px; }
.password-dialog label { display: grid; gap: 7px; }
.password-dialog label span { color: var(--muted); font-size: 11px; }
.password-dialog input { height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; outline: 0; color: var(--text); background: var(--bg); }
.password-dialog input:focus { border-color: var(--accent); }
.error { min-height: 16px; margin: 0; color: var(--danger); font-size: 11px; }
.submit { height: 40px; border: 1px solid #42604f; border-radius: 6px; color: #dff1e6; background: var(--accent-soft); cursor: pointer; font-weight: 800; }
.toast { position: fixed; right: 22px; bottom: 22px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--surface-subtle); opacity: 0; pointer-events: none; transform: translateY(8px); transition: .16s ease; font-size: 12px; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { border-color: #66443f; background: var(--danger-soft); }
@media (max-width: 760px) {
  .topbar { width: 100%; height: 64px; padding: 0 16px; }
  .brand-mark { width: 36px; height: 36px; }
  .admin-shell { width: 100%; padding: 22px 16px 48px; }
  .overview { grid-template-columns: 1fr 1fr; }
  .overview div:nth-child(2) { border-right: 0; }
  .overview div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .panel-head { align-items: stretch; flex-direction: column; }
  .filters input { width: 100%; }
  .user-row { grid-template-columns: minmax(0, 1fr) 70px; gap: 10px; }
  .user-row > .status { justify-self: end; }
  .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
