/* ── 管理员控制台 ──────────────────────────────────────────
   本机登录（127.0.0.1）即管理员；只开放账号档案、项目代码与
   会话管理，密码始终以 scrypt 哈希存储，界面不展示明文。      */

.admin-local {
  color: rgba(160, 246, 214, 0.92);
  border-color: rgba(52, 211, 153, 0.32) !important;
  background: rgba(52, 211, 153, 0.12);
  white-space: nowrap;
}

.admin-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 20px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 9px 7px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.admin-stat strong {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.admin-stat span {
  font-size: 10.5px;
  opacity: 0.58;
  white-space: nowrap;
}

.admin-notice {
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 11.5px;
  line-height: 1.65;
  color: rgba(226, 224, 255, 0.86);
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid rgba(124, 92, 255, 0.22);
}

.admin-users {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.admin-user:hover {
  border-color: rgba(124, 92, 255, 0.42);
  background: rgba(124, 92, 255, 0.08);
}

.admin-user.is-active {
  border-color: rgba(124, 92, 255, 0.62);
  background: rgba(124, 92, 255, 0.14);
}

.admin-avatar {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #7c5cff, #22d3ee);
}

.admin-user-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-user-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.3;
}

.admin-user-title strong {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-title .admin-level {
  flex: none;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.18);
  color: rgba(196, 181, 253, 0.95);
}

.admin-online {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.18);
}

.admin-user-sub {
  font-size: 10.5px;
  opacity: 0.58;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-tags {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.admin-tag {
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.06);
  opacity: 0.8;
  white-space: nowrap;
}

.admin-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-detail[hidden] {
  display: none;
}

.admin-detail-head .chat-back {
  display: inline-flex;
}

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

.admin-profile .admin-avatar {
  width: 36px;
  height: 36px;
  font-size: 15px;
}

.admin-profile strong {
  display: block;
  font-size: 13.5px;
}

.admin-profile span {
  font-size: 10.5px;
  opacity: 0.6;
}

.admin-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.admin-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
}

.admin-fact span {
  opacity: 0.55;
  white-space: nowrap;
}

.admin-fact strong {
  font-weight: 500;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.admin-file.is-active {
  border-color: rgba(124, 92, 255, 0.6);
  background: rgba(124, 92, 255, 0.16);
}

.admin-file em {
  font-style: normal;
  font-size: 9.5px;
  opacity: 0.55;
}

.admin-code-wrap {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 10, 18, 0.55);
  overflow: hidden;
}

.admin-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11px;
  opacity: 0.85;
}

.admin-code {
  margin: 0;
  padding: 10px 12px;
  max-height: 320px;
  overflow: auto;
  font-family: 'JetBrainsMono', 'SFMono-Regular', Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: rgba(226, 232, 240, 0.92);
  white-space: pre;
  tab-size: 2;
}

.admin-credential {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 11px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.1);
  font-size: 11px;
}

.admin-credential > div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-credential strong {
  font-size: 11.5px;
}

.admin-credential span {
  opacity: 0.62;
  font-size: 10.5px;
}

.admin-credential code {
  flex: none;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.28);
  font-family: 'JetBrainsMono', Consolas, monospace;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: #fbbf24;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-audit {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-audit-title {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
}

.admin-audit-row {
  display: flex;
  gap: 8px;
  font-size: 10.5px;
  line-height: 1.5;
}

.admin-audit-time {
  flex: none;
  opacity: 0.48;
  font-variant-numeric: tabular-nums;
}

.admin-audit-text {
  opacity: 0.78;
}

.admin-empty {
  padding: 10px 2px;
  font-size: 10.5px;
  opacity: 0.55;
}

/* 浅色主题覆盖 */
html[data-theme='light'] .admin-local {
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.26) !important;
  background: rgba(20, 184, 166, 0.12);
}

html[data-theme='light'] .admin-stat {
  border-color: rgba(15, 23, 42, 0.09);
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme='light'] .admin-stat strong {
  color: #1e293b;
}

html[data-theme='light'] .admin-stat span {
  color: #64748b;
  opacity: 1;
}

html[data-theme='light'] .admin-notice {
  color: #4c1d95;
  background: rgba(139, 92, 246, 0.09);
  border-color: rgba(139, 92, 246, 0.24);
}

html[data-theme='light'] .admin-user {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.76);
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

html[data-theme='light'] .admin-user:hover {
  border-color: rgba(124, 92, 255, 0.4);
  background: rgba(124, 92, 255, 0.07);
}

html[data-theme='light'] .admin-user.is-active {
  border-color: rgba(124, 92, 255, 0.6);
  background: rgba(124, 92, 255, 0.1);
}

html[data-theme='light'] .admin-user-title strong {
  color: #0f172a;
}

html[data-theme='light'] .admin-user-title .admin-level {
  color: #5b21b6;
  background: rgba(139, 92, 246, 0.16);
}

html[data-theme='light'] .admin-user-sub {
  color: #64748b;
  opacity: 1;
}

html[data-theme='light'] .admin-tag {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(248, 250, 252, 0.9);
  color: #475569;
  opacity: 1;
}

html[data-theme='light'] .admin-detail {
  border-top-color: rgba(15, 23, 42, 0.08);
}

html[data-theme='light'] .admin-profile strong {
  color: #0f172a;
}

html[data-theme='light'] .admin-profile span {
  color: #64748b;
  opacity: 1;
}

html[data-theme='light'] .admin-fact {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.9);
  color: #1e293b;
}

html[data-theme='light'] .admin-fact span {
  color: #64748b;
  opacity: 1;
}

html[data-theme='light'] .admin-file {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.86);
  color: #334155;
}

html[data-theme='light'] .admin-file.is-active {
  border-color: rgba(124, 92, 255, 0.55);
  background: rgba(124, 92, 255, 0.12);
  color: #4c1d95;
}

html[data-theme='light'] .admin-code-wrap {
  border-color: rgba(15, 23, 42, 0.1);
  background: #f8fafc;
}

html[data-theme='light'] .admin-code-head {
  border-bottom-color: rgba(15, 23, 42, 0.08);
  color: #475569;
  opacity: 1;
}

html[data-theme='light'] .admin-code {
  color: #1e293b;
}

html[data-theme='light'] .admin-credential {
  border-color: rgba(180, 83, 9, 0.28);
  background: rgba(251, 191, 36, 0.14);
  color: #78350f;
}

html[data-theme='light'] .admin-credential span {
  color: #92400e;
  opacity: 1;
}

html[data-theme='light'] .admin-credential code {
  background: rgba(120, 53, 15, 0.12);
  color: #92400e;
}

html[data-theme='light'] .admin-audit {
  border-top-color: rgba(15, 23, 42, 0.08);
}

html[data-theme='light'] .admin-audit-title,
html[data-theme='light'] .admin-audit-time {
  color: #64748b;
  opacity: 1;
}

html[data-theme='light'] .admin-audit-text {
  color: #334155;
  opacity: 1;
}

html[data-theme='light'] .admin-empty {
  color: #64748b;
  opacity: 1;
}

/* 邮件服务配置 */
.admin-mail {
  flex: none;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.admin-mail-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
}

.admin-mail-toggle .icon {
  opacity: 0.7;
  width: 14px;
  height: 14px;
}

.admin-mail-state {
  margin-left: auto;
  font-style: normal;
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  opacity: 0.75;
}

.admin-mail-state.is-on {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.12);
  opacity: 1;
}

.admin-mail-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 2px 11px 11px;
}

.admin-mail-body[hidden] {
  display: none;
}

.admin-mail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-mail-field label {
  font-size: 10px;
  opacity: 0.58;
}

.admin-mail-field input {
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 10, 18, 0.5);
  color: inherit;
  font: inherit;
  font-size: 11px;
}

.admin-mail-field input:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.55);
}

.admin-mail-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.admin-mail-row .admin-mail-field {
  width: 92px;
}

.admin-mail-check {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 6px;
  font-size: 10.5px;
  opacity: 0.72;
  cursor: pointer;
}

.admin-mail-check input {
  accent-color: #7c5cff;
}

.admin-mail-actions {
  display: flex;
  gap: 7px;
  margin-top: 2px;
}

.admin-mail-actions .btn {
  flex: 1;
  justify-content: center;
  font-size: 11px;
  height: 28px;
}

.admin-mail-status {
  font-size: 10px;
  line-height: 1.55;
  opacity: 0.6;
}

html[data-theme='light'] .admin-mail {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.76);
  color: #1e293b;
}

html[data-theme='light'] .admin-mail-state {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(248, 250, 252, 0.9);
  color: #475569;
  opacity: 1;
}

html[data-theme='light'] .admin-mail-state.is-on {
  color: #047857;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
}

html[data-theme='light'] .admin-mail-field label {
  color: #64748b;
  opacity: 1;
}

html[data-theme='light'] .admin-mail-field input {
  border-color: rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: #1e293b;
}

html[data-theme='light'] .admin-mail-check {
  color: #475569;
  opacity: 1;
}

html[data-theme='light'] .admin-mail-status {
  color: #64748b;
  opacity: 1;
}

/* 内容管理：片段与成就 */
.admin-mail-field select,
.admin-mail-field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(10, 13, 22, 0.72);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  padding: 8px 10px;
}

.admin-mail-field textarea {
  resize: vertical;
  min-height: 90px;
  font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
}

.admin-mail-field select:focus,
.admin-mail-field textarea:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.6);
}

.admin-content-section {
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-content-section .admin-mail-row {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.admin-content-section .admin-mail-toggle,
.admin-content-card .admin-mail-toggle {
  font-size: 11px;
  gap: 6px;
}

.admin-content-section:first-child {
  border-top: 0;
  padding-top: 2px;
  margin-top: 2px;
}

.admin-content-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  opacity: 0.9;
}

.admin-content-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.admin-content-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
}

.admin-content-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-content-main strong {
  font-size: 12px;
  color: var(--text);
}

.admin-content-main em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-content-del {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.admin-content-del:hover {
  border-color: rgba(248, 113, 113, 0.5);
  color: #f87171;
}

.admin-content-empty {
  font-size: 11.5px;
  color: var(--text-dim);
  opacity: 0.85;
  line-height: 1.6;
}

.admin-grant {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 10px 0 4px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.admin-grant .admin-mail-field {
  flex: 1;
  margin: 0;
}

.admin-grant .btn {
  flex: none;
}

html[data-theme='light'] .admin-mail-field select,
html[data-theme='light'] .admin-mail-field textarea {
  border-color: rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: #1e293b;
}

html[data-theme='light'] .admin-content-item {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.9);
}

html[data-theme='light'] .admin-content-item strong {
  color: #1e293b;
}

html[data-theme='light'] .admin-content-item em,
html[data-theme='light'] .admin-content-empty {
  color: #64748b;
  opacity: 1;
}

html[data-theme='light'] .admin-content-del {
  border-color: rgba(15, 23, 42, 0.12);
  color: #64748b;
}

html[data-theme='light'] .admin-grant {
  border-color: rgba(15, 23, 42, 0.12);
}
