/* ==========================================================================
   admin.css · 「月下雾图书馆」管理员界面
   --------------------------------------------------------------------------
   伊蕾娜的私人天文图书馆：深夜紫、月光金、羊皮纸、玫瑰。
   左侧本体与人格库 / 中间与她的对话 / 右侧条目档案 / 引擎设置。
   主题令牌见 theme.css（--mh-*），本文件只做管理员专属布局与组件。
   ========================================================================== */

/* ---------- 0. 管理员视图内的私有变量 ---------- */
.admin-view,
.admin-settings-modal {
  --adm-panel: #f2e9da;
  --adm-panel-2: #faf4e8;
  --adm-chat: #f8f3e9;
  --adm-card: rgba(255, 252, 245, 0.58);
  --adm-card-solid: #fdf8ee;
  --adm-line: rgba(169, 119, 42, 0.28);
  --adm-line-soft: rgba(169, 119, 42, 0.14);
  --adm-gold: var(--mh-gold);
  --adm-gold-bright: var(--mh-gold-bright);
  --adm-rose: var(--mh-rose);
  --adm-violet: var(--mh-violet);
  --adm-ink: var(--text);
  --adm-muted: var(--text-3);
  --adm-glass: rgba(255, 253, 248, 0.6);
  --adm-shadow: 0 18px 40px rgba(74, 58, 102, 0.09), 0 2px 6px rgba(74, 58, 102, 0.05);
  --adm-shadow-lift: 0 24px 54px rgba(74, 58, 102, 0.14), 0 4px 12px rgba(74, 58, 102, 0.06);
  --adm-side-w: 300px;
  --adm-detail-w: 340px;
}

html[data-theme="dark"] .admin-view,
html[data-theme="dark"] .admin-settings-modal {
  --adm-panel: #17121f;
  --adm-panel-2: #1c1627;
  --adm-chat: #110e17;
  --adm-card: rgba(28, 22, 39, 0.66);
  --adm-card-solid: #1b1525;
  --adm-line: rgba(224, 189, 116, 0.26);
  --adm-line-soft: rgba(224, 189, 116, 0.12);
  --adm-glass: rgba(24, 19, 34, 0.64);
  --adm-ink: #efe9f7;
  --adm-muted: #9084a3;
  --adm-shadow: 0 20px 46px rgba(0, 0, 0, 0.42), 0 2px 8px rgba(0, 0, 0, 0.3);
  --adm-shadow-lift: 0 28px 64px rgba(0, 0, 0, 0.52), 0 6px 18px rgba(0, 0, 0, 0.34);
}

/* ---------- 1. 顶部视图切换（管理员皮肤） ---------- */
.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  margin-right: 2px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.view-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 27px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  border-radius: 7px;
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.view-switch-btn .icon { width: 14px; height: 14px; }
.view-switch-btn:hover { color: var(--text); background: var(--bg-hover); }
.view-switch-btn.active {
  color: var(--text);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.view-switch-btn[data-view="admin"].active {
  color: var(--mh-gold);
  background:
    linear-gradient(180deg, var(--mh-gold-soft), transparent 70%),
    var(--bg-elevated);
  box-shadow: inset 0 -1px 0 var(--mh-gold-line), var(--shadow-sm);
}

/* ---------- 2. 管理员模式：隐藏公共视图控件 ---------- */
body.mode-admin .header-search,
body.mode-admin #btnTimeline,
body.mode-admin #btnTimeMachine,
body.mode-admin #btnNew,
body.mode-admin #btnSidebar,
body.mode-admin .header-divider,
body.mode-admin #statusCounts { display: none !important; }

/* ---------- 3. 三栏骨架 ---------- */
.admin-view {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--admin-side-w, 300px) minmax(0, 1fr) var(--admin-detail-w, 340px);
  background:
    radial-gradient(900px 600px at 50% 0%, var(--mh-glow-warm), transparent 70%),
    var(--bg);
  overflow: hidden;
  animation: fadeIn 240ms var(--ease);
}

.admin-disabled-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 8;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: calc(100% - 40px);
  padding: 10px 15px;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--warning);
  background:
    linear-gradient(135deg, var(--warning-soft), transparent 70%),
    var(--adm-card-solid);
  border: 1px solid rgba(181, 129, 37, 0.42);
  border-radius: 12px;
  box-shadow: var(--adm-shadow);
}
.admin-disabled-banner .icon { width: 15px; height: 15px; margin-top: 1px; flex: 0 0 auto; }
.admin-disabled-banner strong {
  display: block;
  font-family: var(--mh-font-display);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.admin-disabled-banner span { color: var(--text-3); }

/* ---------- 4. 左栏 · 她的房间 ---------- */
.admin-side {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(480px 280px at 50% -8%, var(--mh-glow-warm), transparent 66%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 26%),
    linear-gradient(180deg, rgba(242, 233, 218, 0.935), rgba(242, 233, 218, 0.975)),
    var(--mh-img-paper) center / cover no-repeat,
    var(--adm-panel);
  border-right: 1px solid var(--adm-line-soft);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.16);
}

html[data-theme="dark"] .admin-side {
  background:
    radial-gradient(520px 320px at 50% -10%, rgba(224, 189, 116, 0.1), transparent 62%),
    radial-gradient(420px 420px at 120% 18%, rgba(179, 156, 245, 0.09), transparent 68%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 24%),
    var(--adm-panel);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

.admin-side::before {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -120px;
  width: 430px;
  height: 430px;
  z-index: 0;
  pointer-events: none;
  background: url("/assets/decor-admin/star-chart.svg") center / contain no-repeat;
  opacity: 0.16;
  -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent 78%);
  mask-image: radial-gradient(closest-side, #000 20%, transparent 78%);
}

html[data-theme="dark"] .admin-side::before { opacity: 0.22; }
.admin-side > * { position: relative; z-index: 1; }

/* 4.1 头像与身份 */
.admin-identity {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 18px 15px;
  text-align: center;
}

.admin-avatar {
  position: relative;
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(
    from 210deg,
    var(--mh-gold-bright),
    rgba(216, 174, 85, 0.18) 22%,
    var(--mh-gold) 46%,
    rgba(111, 85, 184, 0.42) 68%,
    var(--mh-gold-bright)
  );
  box-shadow:
    0 10px 28px rgba(169, 119, 42, 0.24),
    0 0 0 1px rgba(255, 255, 255, 0.18),
    0 0 0 7px var(--mh-gold-soft);
}

html[data-theme="dark"] .admin-avatar {
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.5),
    0 0 26px rgba(224, 189, 116, 0.16),
    0 0 0 7px rgba(224, 189, 116, 0.07);
}

.admin-avatar::before {
  content: "";
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--mh-glow-warm) 0%, transparent 66%);
  pointer-events: none;
}

.admin-avatar-svg,
.admin-avatar-img {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  border-radius: 50%;
  object-fit: cover;
  object-position: center 24%;
  background: var(--bg-subtle);
  z-index: 1;
}
.admin-avatar-svg { z-index: 0; filter: saturate(0.9); }

.admin-avatar-orbit {
  position: absolute;
  inset: -9px;
  z-index: 2;
  border: 1px dashed var(--mh-gold-line);
  border-radius: 50%;
  opacity: 0.72;
  pointer-events: none;
  animation: adminOrbitSpin 48s linear infinite;
}
.admin-avatar-orbit::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--mh-gold-bright);
  box-shadow: 0 0 8px var(--mh-gold-bright);
}

.admin-float { animation: adminFloat 6.5s ease-in-out infinite; }
.admin-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: adminBlink 7.2s ease-in-out infinite;
}
.admin-sparkle { animation: adminTwinkle 3.8s ease-in-out infinite; }
.admin-sparkle:nth-child(2) { animation-delay: 0.8s; }
.admin-sparkle:nth-child(3) { animation-delay: 1.6s; }
.admin-sparkle:nth-child(4) { animation-delay: 2.4s; }

.admin-identity-text { min-width: 0; width: 100%; }
.admin-identity-text::before {
  content: "ASTRAL LIBRARY · KEEPER";
  display: block;
  margin-bottom: 7px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: var(--adm-gold);
  opacity: 0.9;
}
.admin-name {
  font-family: var(--mh-font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 0.12em;
  color: var(--text);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
}
html[data-theme="dark"] .admin-name {
  color: #f6ede0;
  text-shadow: 0 0 22px rgba(224, 189, 116, 0.18);
}
.admin-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 7px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--adm-gold);
}
.admin-title::before,
.admin-title::after {
  content: "";
  width: 17px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--mh-gold-line));
}
.admin-title::after { background: linear-gradient(90deg, var(--mh-gold-line), transparent); }
.admin-motto {
  margin-top: 8px;
  font-family: var(--mh-font-reading);
  font-size: 11.5px;
  font-style: italic;
  letter-spacing: 0.06em;
  color: var(--adm-rose);
  opacity: 0.95;
}

/* 4.2 本体统计 · 星图卡片 */
.admin-substrate-card {
  position: relative;
  flex: 0 0 auto;
  margin: 0 14px 12px;
  padding: 13px 13px 12px;
  overflow: hidden;
  background:
    radial-gradient(260px 160px at 100% 100%, var(--mh-gold-soft), transparent 70%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 46%),
    var(--adm-card);
  border: 1px solid var(--adm-line);
  border-radius: 14px;
  box-shadow: var(--adm-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
html[data-theme="dark"] .admin-substrate-card {
  background:
    radial-gradient(260px 160px at 100% 100%, rgba(224, 189, 116, 0.09), transparent 70%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 46%),
    var(--adm-card);
  box-shadow: var(--adm-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.admin-substrate-card::before {
  content: "";
  position: absolute;
  top: -26px;
  right: -30px;
  width: 170px;
  height: 170px;
  background: url("/assets/decor-admin/star-chart.svg") center / contain no-repeat;
  opacity: 0.12;
  pointer-events: none;
}
.admin-substrate-card::after {
  content: "";
  position: absolute;
  inset: 0 26% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--mh-gold-line), transparent);
  pointer-events: none;
}
.admin-substrate-card > * { position: relative; z-index: 1; }

.admin-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.admin-card-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.26em;
  color: var(--adm-gold);
}
.admin-card-label::before {
  content: "✦";
  margin-right: 6px;
  font-size: 8px;
  opacity: 0.8;
}
.admin-card-hint {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.02em;
  color: var(--text-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.admin-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 10px 8px;
  overflow: hidden;
  text-align: left;
  background:
    radial-gradient(120px 70px at 100% 0%, var(--mh-gold-soft), transparent 75%),
    rgba(255, 255, 255, 0.18);
  border: 1px solid var(--adm-line-soft);
  border-radius: 10px;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
              transform 140ms var(--ease), box-shadow var(--dur) var(--ease);
}
html[data-theme="dark"] .admin-stat {
  background:
    radial-gradient(120px 70px at 100% 0%, rgba(224, 189, 116, 0.08), transparent 75%),
    rgba(255, 255, 255, 0.025);
}
.admin-stat::before {
  content: attr(data-stat-index);
  position: absolute;
  top: 7px;
  right: 8px;
  font-family: var(--mh-font-display);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--adm-gold);
  opacity: 0.55;
}
.admin-stat::after {
  content: "";
  position: absolute;
  left: 10px;
  bottom: 8px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--adm-gold);
  opacity: 0.4;
  transition: opacity var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.admin-stat:hover {
  border-color: var(--adm-line);
  background-color: var(--mh-gold-soft);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(169, 119, 42, 0.08);
}
.admin-stat:hover::after,
.admin-stat.active::after {
  opacity: 1;
  box-shadow: 0 0 8px var(--adm-gold);
}
.admin-stat.active {
  border-color: var(--mh-gold-line);
  background:
    linear-gradient(145deg, var(--mh-gold-soft), rgba(111, 85, 184, 0.07)),
    var(--adm-card-solid);
  box-shadow: inset 0 0 0 1px var(--mh-gold-line), 0 4px 14px rgba(169, 119, 42, 0.1);
}
.admin-stat-value {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--mh-font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: var(--adm-gold);
  font-variant-numeric: tabular-nums;
}
.admin-stat-unit {
  font-family: var(--font-sans);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text-4);
}
.admin-stat-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-2);
}
.admin-stat.error .admin-stat-value { color: var(--warning); font-size: 18px; }

/* 4.3 引擎状态徽章 */
.admin-engine {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 14px 10px;
  padding: 10px 12px 9px 14px;
  text-align: left;
  overflow: hidden;
  background:
    linear-gradient(135deg, var(--mh-gold-soft), transparent 58%),
    var(--adm-card);
  border: 1px solid var(--adm-line-soft);
  border-radius: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease),
              transform 140ms var(--ease), box-shadow var(--dur) var(--ease);
}
html[data-theme="dark"] .admin-engine {
  background:
    linear-gradient(135deg, rgba(224, 189, 116, 0.08), transparent 58%),
    var(--adm-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
.admin-engine::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--adm-gold-bright), transparent);
  opacity: 0.7;
}
.admin-engine:hover {
  border-color: var(--adm-line);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(169, 119, 42, 0.1);
}
.admin-engine-dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--text-4);
  box-shadow: 0 0 0 3px var(--bg-active);
}
.admin-engine.on-flagship .admin-engine-dot {
  background: var(--mh-violet);
  box-shadow: 0 0 0 3px var(--mh-violet-soft), 0 0 12px var(--mh-violet);
}
.admin-engine.on-local .admin-engine-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft), 0 0 12px var(--success);
}
.admin-engine.off .admin-engine-dot {
  background: var(--warning);
  box-shadow: 0 0 0 3px var(--warning-soft);
}
.admin-engine.loading .admin-engine-dot { animation: pulse 1.4s infinite; }
.admin-engine.on-flagship::before,
.admin-engine.on-local::before { opacity: 1; }
.admin-engine-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.admin-engine-title {
  font-family: var(--mh-font-reading);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-engine-sub {
  font-size: 9.5px;
  letter-spacing: 0.02em;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-engine > .icon { width: 13px; height: 13px; flex: 0 0 auto; color: var(--adm-gold); opacity: 0.75; }

/* 4.4 左栏操作 */
.admin-side-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px 11px;
}
.admin-side-actions .btn {
  flex: 1 1 auto;
  min-width: 0;
  height: 31px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--adm-gold);
  background: var(--adm-card);
  border: 1px solid var(--adm-line-soft);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.admin-side-actions .btn:hover {
  color: var(--adm-gold-bright);
  border-color: var(--adm-line);
  background: var(--mh-gold-soft);
}
.admin-side-actions .btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-side-actions .icon-btn {
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  color: var(--adm-gold);
  background: var(--adm-card);
  border: 1px solid var(--adm-line-soft);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.admin-side-actions .icon-btn:hover {
  color: var(--adm-gold-bright);
  border-color: var(--adm-line);
  background: var(--mh-gold-soft);
}
.admin-side-actions .icon { width: 14px; height: 14px; }

/* 4.5 标签页 */
.admin-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 0 13px;
  border-bottom: 1px solid var(--adm-line-soft);
}
.admin-tab {
  position: relative;
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 39px;
  padding: 0 4px;
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--text-3);
  white-space: nowrap;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.admin-tab .icon { width: 13px; height: 13px; opacity: 0.8; }
.admin-tab:hover { color: var(--text); background: linear-gradient(180deg, transparent, var(--mh-gold-soft)); }
.admin-tab.active { color: var(--adm-gold); font-weight: 600; }
.admin-tab.active .icon { opacity: 1; }
.admin-tab.active::after {
  content: "";
  position: absolute;
  right: 14%;
  bottom: -1px;
  left: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--adm-gold), transparent);
  box-shadow: 0 0 8px var(--mh-gold-line);
}
.admin-tab.active::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 2px;
  height: 2px;
  margin-left: -1px;
  border-radius: 50%;
  background: var(--adm-gold);
  opacity: 0.65;
}

/* 4.6 树 / 成长日志容器 */
.admin-tree-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 9px 10px 12px;
}
.admin-tree-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px 7px;
}
.admin-tree-meta {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--text-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-tree-toolbar .side-action {
  flex: 0 0 auto;
  font-size: 9.5px;
  color: var(--adm-gold);
  opacity: 0.85;
  border-bottom: 1px solid transparent;
}
.admin-tree-toolbar .side-action:hover {
  opacity: 1;
  color: var(--adm-gold-bright);
  border-bottom-color: var(--mh-gold-line);
}

.admin-tree,
.admin-growth {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1px 1px 8px;
  scrollbar-gutter: stable;
}

.admin-tree-node { min-width: 0; }
.admin-tree-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 30px;
  padding-left: calc(2px + var(--depth, 0) * 14px);
  padding-right: 4px;
  border-radius: 8px;
  transition: background-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.admin-tree-row:hover { background: var(--bg-hover); }
.admin-tree-row.selected {
  background:
    linear-gradient(90deg, var(--mh-gold-soft), rgba(111, 85, 184, 0.05) 60%, transparent),
    var(--bg-hover);
  box-shadow: inset 2px 0 0 var(--adm-gold), inset 0 0 0 1px var(--adm-line-soft);
}
.admin-tree-row.selected::after {
  content: "✦";
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  font-size: 7px;
  color: var(--adm-gold);
  opacity: 0.75;
}
.admin-tree-toggle {
  display: grid;
  place-items: center;
  width: 18px;
  height: 27px;
  flex: 0 0 auto;
  color: var(--text-4);
  border-radius: 5px;
}
.admin-tree-toggle:hover { color: var(--adm-gold); background: var(--bg-active); }
.admin-tree-toggle .icon { width: 12px; height: 12px; transition: transform 150ms var(--ease); }
.admin-tree-toggle.is-leaf { visibility: hidden; pointer-events: none; }
.admin-tree-node.collapsed > .admin-tree-row .admin-tree-toggle .icon { transform: rotate(-90deg); }
.admin-tree-label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 2px 4px 0;
  text-align: left;
  border-radius: 6px;
}
.admin-tree-label:focus-visible { outline: 1px solid var(--adm-gold); outline-offset: -1px; }
.admin-tree-dot {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.5), transparent 58%),
    var(--bg-subtle);
  border: 1px solid var(--adm-line-soft);
  filter: grayscale(0.55) sepia(0.42) saturate(0.66) brightness(0.92);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.16);
}
.admin-tree-row.selected .admin-tree-dot {
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.6), transparent 58%),
    var(--adm-card-solid);
  border-color: var(--mh-gold-line);
  box-shadow: 0 0 10px var(--mh-gold-soft);
}
.admin-tree-title {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-tree-row.selected .admin-tree-title { color: var(--text); font-weight: 600; }
.admin-tree-count {
  flex: 0 0 auto;
  min-width: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-4);
  font-variant-numeric: tabular-nums;
}
.admin-tree-node.kind-section > .admin-tree-row { margin-top: 3px; }
.admin-tree-node.kind-section > .admin-tree-row .admin-tree-title {
  font-family: var(--mh-font-display);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.035em;
  color: var(--text);
}
.admin-tree-node.kind-section > .admin-tree-row .admin-tree-dot {
  background:
    radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 0.55), transparent 60%),
    var(--mh-gold-soft);
  border-color: var(--mh-gold-line);
}
.admin-tree-children[hidden] { display: none; }

/* 4.7 面板态（加载 / 空 / 错误） */
.admin-panel-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px 18px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
}
.admin-panel-state > .icon { width: 24px; height: 24px; color: var(--adm-gold); opacity: 0.6; }
.admin-panel-state strong {
  font-family: var(--mh-font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-2);
}
.admin-panel-state p { margin: 0; max-width: 220px; line-height: 1.75; color: var(--text-3); }
.admin-panel-state .btn { margin-top: 4px; }

/* 4.8 成长日志 */
.admin-growth {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 2px;
}
.admin-growth::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 14px;
  left: 24px;
  width: 1px;
  background: linear-gradient(180deg, var(--mh-gold-line), var(--adm-line-soft) 55%, transparent);
  opacity: 0.7;
  pointer-events: none;
}
.admin-growth-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 8px 8px 4px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease),
              transform 140ms var(--ease);
}
.admin-growth-item:hover {
  background: var(--adm-card);
  border-color: var(--adm-line-soft);
  transform: translateX(1px);
}
.admin-growth-icon {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--adm-gold);
  background:
    radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 0.45), transparent 58%),
    var(--mh-gold-soft);
  border: 1px solid var(--mh-gold-line);
  box-shadow: 0 0 0 3px var(--adm-panel);
}
.admin-growth-icon.distill {
  color: var(--adm-violet);
  background:
    radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 0.4), transparent 58%),
    var(--mh-violet-soft);
  border-color: var(--brand-border);
}
.admin-growth-icon .icon { width: 13px; height: 13px; }
.admin-growth-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.admin-growth-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-growth-content {
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.admin-growth-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: 0.02em;
  color: var(--text-4);
}
.admin-growth-tag {
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--adm-line-soft);
  background: var(--mh-gold-soft);
  font-size: 8.5px;
  color: var(--adm-gold);
}

/* 4.9 人格读取预览 */
.admin-prompt-preview {
  flex: 0 0 auto;
  margin: 8px 4px 0;
  padding-top: 7px;
  border-top: 1px dashed var(--adm-line-soft);
}
.admin-prompt-preview summary {
  padding: 3px 2px;
  font-family: var(--mh-font-reading);
  font-size: 10.5px;
  color: var(--text-3);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.admin-prompt-preview summary::-webkit-details-marker { display: none; }
.admin-prompt-preview summary::before {
  content: "›";
  display: inline-block;
  margin-right: 5px;
  color: var(--adm-gold);
  transition: transform 140ms var(--ease);
}
.admin-prompt-preview[open] summary::before { transform: rotate(90deg); }
.admin-prompt-preview summary:hover { color: var(--adm-gold); }
.admin-prompt-preview pre {
  margin: 4px 0 0;
  padding: 9px 10px;
  max-height: 160px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--text-3);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--adm-card);
  border: 1px solid var(--adm-line-soft);
  border-radius: 8px;
}

/* ---------- 5. 中栏 · 与她的深夜对话 ---------- */
.admin-chat {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(900px 560px at 82% -12%, var(--mh-glow-warm), transparent 64%),
    radial-gradient(720px 520px at 4% 104%, var(--mh-glow-cool), transparent 68%),
    linear-gradient(180deg, rgba(248, 243, 233, 0.955), rgba(248, 243, 233, 0.975)),
    var(--mh-img-paper) center / cover no-repeat,
    var(--adm-chat);
  border-right: 1px solid var(--adm-line-soft);
}
.admin-chat::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.1px 1.1px at 14% 18%, rgba(169, 119, 42, 0.42), transparent 60%),
    radial-gradient(1.3px 1.3px at 78% 12%, rgba(169, 119, 42, 0.3), transparent 60%),
    radial-gradient(1px 1px at 64% 44%, rgba(111, 85, 184, 0.32), transparent 60%),
    radial-gradient(1.2px 1.2px at 88% 62%, rgba(169, 119, 42, 0.28), transparent 60%),
    radial-gradient(1px 1px at 32% 78%, rgba(111, 85, 184, 0.26), transparent 60%),
    radial-gradient(1.1px 1.1px at 52% 92%, rgba(169, 119, 42, 0.24), transparent 60%),
    var(--mh-grain);
  opacity: 0.9;
}
html[data-theme="dark"] .admin-chat {
  background:
    radial-gradient(1000px 620px at 84% -14%, rgba(224, 189, 116, 0.09), transparent 60%),
    radial-gradient(800px 620px at 2% 106%, rgba(179, 156, 245, 0.11), transparent 64%),
    linear-gradient(180deg, rgba(17, 14, 23, 0.8), rgba(17, 14, 23, 0.91)),
    var(--mh-img-hero) center 42% / cover no-repeat,
    var(--adm-chat);
}
html[data-theme="dark"] .admin-chat::before {
  background-image:
    radial-gradient(1.2px 1.2px at 14% 18%, rgba(240, 209, 142, 0.65), transparent 60%),
    radial-gradient(1.5px 1.5px at 78% 12%, rgba(240, 209, 142, 0.45), transparent 60%),
    radial-gradient(1.1px 1.1px at 64% 44%, rgba(199, 180, 255, 0.55), transparent 60%),
    radial-gradient(1.3px 1.3px at 88% 62%, rgba(240, 209, 142, 0.4), transparent 60%),
    radial-gradient(1.1px 1.1px at 32% 78%, rgba(199, 180, 255, 0.42), transparent 60%),
    radial-gradient(1.2px 1.2px at 52% 92%, rgba(240, 209, 142, 0.36), transparent 60%),
    var(--mh-grain);
  opacity: 0.85;
}
.admin-chat::after {
  content: "";
  position: absolute;
  top: -270px;
  right: -190px;
  z-index: 0;
  width: 560px;
  height: 560px;
  border: 1px solid var(--mh-gold-line);
  border-radius: 50%;
  opacity: 0.16;
  pointer-events: none;
  box-shadow: 0 0 80px var(--mh-glow-warm) inset;
}
.admin-chat > * { position: relative; z-index: 1; }

.admin-chat-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 64px;
  padding: 11px 22px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.62), rgba(255, 253, 248, 0.18)),
    transparent;
  border-bottom: 1px solid var(--adm-line-soft);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  backdrop-filter: blur(16px) saturate(1.12);
}
html[data-theme="dark"] .admin-chat-head {
  background:
    linear-gradient(180deg, rgba(28, 22, 39, 0.82), rgba(17, 14, 23, 0.3)),
    transparent;
}
.admin-chat-head::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 140px;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--adm-gold), transparent);
  opacity: 0.45;
}
.admin-chat-who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.admin-chat-mini-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--mh-gold-line);
  background: var(--bg-subtle);
  box-shadow: 0 0 0 3px var(--mh-gold-soft);
}
.admin-chat-mini-avatar svg,
.admin-chat-mini-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
}
.admin-chat-mini-avatar svg { z-index: 0; }
.admin-chat-mini-avatar img { z-index: 1; }
.admin-chat-who-text { min-width: 0; }
.admin-chat-title {
  font-family: var(--mh-font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.08em;
  color: var(--text);
}
.admin-chat-subtitle {
  max-width: 360px;
  margin-top: 1px;
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-chat-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.admin-conv-wrap { position: relative; display: flex; align-items: center; }
.admin-conv-wrap > .icon {
  position: absolute;
  left: 9px;
  width: 13px;
  height: 13px;
  z-index: 1;
  color: var(--adm-gold);
  opacity: 0.8;
  pointer-events: none;
}
.admin-conv-select {
  width: 172px;
  height: 30px;
  padding: 0 25px 0 27px;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--text-2);
  background-color: var(--adm-card);
  border: 1px solid var(--adm-line-soft);
  border-radius: 8px;
  background-position: calc(100% - 13px) 12px, calc(100% - 8px) 12px;
}
.admin-chat-tools .icon-btn {
  width: 30px;
  height: 30px;
  color: var(--adm-gold);
  background: var(--adm-card);
  border: 1px solid var(--adm-line-soft);
  border-radius: 8px;
}
.admin-chat-tools .icon-btn:hover { background: var(--mh-gold-soft); border-color: var(--adm-line); }

/* 5.1 消息区 */
.admin-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 28px 12px;
  scroll-behavior: smooth;
}

/* 5.2 空态 · 她坐在月下的拱窗前 */
.admin-chat-empty {
  position: relative;
  margin: auto;
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  align-items: center;
  gap: 38px;
  padding: 20px 24px 26px;
  text-align: left;
  animation: mh-rise 520ms var(--ease) both;
}
.admin-hero-stage {
  position: relative;
  width: 286px;
  height: 408px;
  display: grid;
  place-items: center;
}
.admin-hero-stage::before {
  content: "";
  position: absolute;
  inset: 6% -6% 4%;
  z-index: 0;
  background-image:
    linear-gradient(180deg, rgba(19, 16, 25, 0.05), var(--adm-chat) 96%),
    var(--mh-img-library);
  background-size: cover, cover;
  background-position: center, center 42%;
  border-radius: 48% 48% 18px 18px;
  filter: blur(6px) saturate(0.82);
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(82% 80% at 50% 40%, #000 44%, transparent 92%);
  mask-image: radial-gradient(82% 80% at 50% 40%, #000 44%, transparent 92%);
}
html[data-theme="dark"] .admin-hero-stage::before { opacity: 0.62; }

.admin-hero-stage::after {
  content: "";
  position: absolute;
  inset: 2% 0 8%;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 22%, var(--mh-gold-bright), transparent 60%),
    radial-gradient(1.2px 1.2px at 88% 16%, var(--mh-gold-bright), transparent 60%),
    radial-gradient(1px 1px at 94% 48%, var(--mh-violet), transparent 60%),
    radial-gradient(1.3px 1.3px at 7% 62%, var(--mh-violet), transparent 60%),
    radial-gradient(1.1px 1.1px at 83% 82%, var(--mh-gold-bright), transparent 60%),
    radial-gradient(1px 1px at 20% 88%, var(--mh-gold-bright), transparent 60%);
  opacity: 0.55;
  animation: adminTwinkle 6s ease-in-out infinite;
}

.admin-hero-halo {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 0;
  width: 330px;
  height: 330px;
  margin-left: -165px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--mh-glow-warm) 0%, transparent 68%);
  box-shadow: inset 0 0 0 1px var(--mh-gold-line);
  opacity: 0.9;
}
.admin-hero-halo::after {
  content: "";
  position: absolute;
  inset: 26px;
  border: 1px dashed var(--mh-gold-line);
  border-radius: 50%;
  opacity: 0.5;
}
.admin-hero-orbit {
  position: absolute;
  top: 54px;
  left: 50%;
  z-index: 0;
  width: 360px;
  height: 188px;
  margin-left: -180px;
  border: 1px solid var(--mh-gold-line);
  border-radius: 50%;
  transform: rotate(-18deg);
  opacity: 0.42;
}
.admin-hero-orbit::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 78%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--mh-gold-bright);
  box-shadow: 0 0 10px var(--mh-gold-bright);
}

.admin-hero-portrait {
  position: relative;
  z-index: 2;
  width: 252px;
  height: 352px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--mh-gold-line);
  border-radius: 50% 50% 12px 12px / 40% 40% 12px 12px;
  background:
    radial-gradient(120% 88% at 50% 8%, rgba(89, 68, 128, 0.5), transparent 62%),
    radial-gradient(90% 60% at 50% 100%, rgba(17, 14, 23, 0.9), transparent 70%),
    linear-gradient(180deg, #2a2138, #121019 78%);
  box-shadow:
    0 26px 54px rgba(12, 8, 20, 0.34),
    0 0 0 6px var(--mh-gold-soft),
    0 0 60px rgba(224, 189, 116, 0.1);
}
.admin-hero-portrait::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 3;
  border: 1px solid var(--mh-gold-line);
  border-radius: inherit;
  opacity: 0.55;
  pointer-events: none;
}
.admin-hero-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, transparent 52%, rgba(12, 9, 17, 0.5) 84%, rgba(12, 9, 17, 0.82)),
    var(--mh-grain);
  pointer-events: none;
}
.admin-hero-portrait-img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}
.admin-hero-portrait-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    url("/assets/decor-admin/witch-silhouette.svg") center bottom / 94% auto no-repeat;
}
.admin-hero-caption {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  z-index: 4;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.3em;
  text-align: center;
  color: rgba(240, 209, 142, 0.82);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
.admin-hero-moon {
  position: absolute;
  top: 30px;
  right: 6px;
  z-index: 3;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(140deg, #f8e6b6 4%, #e0bd74 46%, #b78f47 100%);
  filter: drop-shadow(0 0 18px rgba(224, 189, 116, 0.45));
  transform: rotate(-18deg);
  -webkit-mask-image: radial-gradient(circle at 68% 30%, transparent 0 48%, #000 49%);
  mask-image: radial-gradient(circle at 68% 30%, transparent 0 48%, #000 49%);
}
.admin-hero-moon::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.4), transparent 55%);
}
.admin-hero-spark {
  position: absolute;
  z-index: 3;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--mh-gold-bright);
  box-shadow: 0 0 10px var(--mh-gold-bright);
  animation: adminTwinkle 4s ease-in-out infinite;
}
.admin-hero-spark.s1 { top: 96px; left: 8px; }
.admin-hero-spark.s2 { top: 188px; right: 18px; animation-delay: 1.2s; }
.admin-hero-spark.s3 { top: 330px; left: 22px; animation-delay: 2.2s; }

.admin-hero-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.admin-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--adm-gold);
}
.admin-hero-eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--adm-gold));
}
.admin-chat-empty h2 {
  margin: 0;
  font-family: var(--mh-font-display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.1em;
  color: var(--text);
}
.admin-chat-empty h2::after {
  content: "";
  display: block;
  width: 54px;
  height: 1px;
  margin-top: 13px;
  background: linear-gradient(90deg, var(--adm-gold), var(--adm-rose), transparent);
}
.admin-chat-empty p {
  max-width: 440px;
  margin: 0;
  padding-left: 12px;
  font-size: 10.5px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  color: var(--text-3);
  border-left: 1px solid var(--adm-line-soft);
}
.admin-chat-greeting {
  position: relative;
  width: 100%;
  padding: 14px 18px 14px 26px;
  font-family: var(--mh-font-reading);
  font-size: 13px;
  line-height: 1.95;
  letter-spacing: 0.01em;
  text-align: left;
  color: var(--text-2);
  background:
    linear-gradient(135deg, var(--mh-gold-soft), transparent 58%),
    var(--adm-card);
  border: 1px solid var(--adm-line-soft);
  border-left: 2px solid var(--mh-gold-line);
  border-radius: 3px 13px 13px 3px;
  box-shadow: 0 10px 26px rgba(74, 58, 102, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
html[data-theme="dark"] .admin-chat-greeting {
  background:
    linear-gradient(135deg, rgba(224, 189, 116, 0.09), transparent 58%),
    rgba(28, 22, 39, 0.62);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.admin-chat-greeting::before {
  content: "“";
  position: absolute;
  top: -7px;
  left: 8px;
  font-family: var(--mh-font-display);
  font-size: 34px;
  line-height: 1;
  color: var(--adm-gold);
  opacity: 0.4;
}
.admin-suggestions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  margin-top: 2px;
  counter-reset: admin-sug;
}
.admin-suggestion {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  overflow: hidden;
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-2);
  background:
    linear-gradient(90deg, var(--mh-gold-soft), transparent 52%),
    var(--adm-card);
  border: 1px solid var(--adm-line-soft);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease),
              transform 160ms var(--ease), box-shadow var(--dur) var(--ease);
}
.admin-suggestion::before {
  counter-increment: admin-sug;
  content: "0" counter(admin-sug);
  font-family: var(--mh-font-display);
  font-size: 8.5px;
  color: var(--adm-gold);
  opacity: 0.55;
}
.admin-suggestion:hover {
  color: var(--text);
  border-color: var(--mh-gold-line);
  transform: translateX(3px);
  box-shadow: 0 8px 22px rgba(169, 119, 42, 0.1);
}
.admin-suggestion .icon { width: 14px; height: 14px; color: var(--adm-gold); flex: 0 0 auto; }
.admin-suggestion .arrow {
  width: 13px;
  height: 13px;
  margin-left: auto;
  color: var(--adm-gold);
  opacity: 0.55;
  transition: transform 160ms var(--ease), opacity 160ms var(--ease);
}
.admin-suggestion:hover .arrow { transform: translateX(3px); opacity: 1; }

/* 5.3 气泡 */
.admin-msg {
  display: flex;
  gap: 10px;
  max-width: 100%;
  animation: adminMsgIn 220ms var(--ease);
}
.admin-msg.assistant { align-self: flex-start; max-width: min(88%, 760px); }
.admin-msg.user { align-self: flex-end; flex-direction: row-reverse; max-width: min(84%, 660px); }
.admin-msg-avatar {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  margin-top: 2px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--mh-gold-line);
  background: var(--adm-panel-2);
  box-shadow: 0 0 0 3px var(--mh-gold-soft);
}
.admin-msg-avatar svg,
.admin-msg-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
}
.admin-msg-avatar svg { z-index: 0; }
.admin-msg-avatar img { z-index: 1; }
.admin-msg-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.admin-msg.user .admin-msg-main { align-items: flex-end; }
.admin-bubble {
  position: relative;
  padding: 10px 15px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
  background:
    linear-gradient(155deg, rgba(111, 85, 184, 0.18), rgba(255, 253, 248, 0.7) 56%, rgba(224, 189, 116, 0.05)),
    var(--adm-glass);
  border: 1px solid rgba(111, 85, 184, 0.22);
  border-radius: 3px 15px 15px 15px;
  box-shadow:
    0 10px 24px rgba(74, 58, 102, 0.08),
    inset 2px 0 0 rgba(111, 85, 184, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
}
html[data-theme="dark"] .admin-bubble {
  background:
    linear-gradient(155deg, rgba(124, 98, 190, 0.2), rgba(224, 189, 116, 0.05) 55%, transparent),
    rgba(30, 23, 43, 0.62);
  border-color: rgba(224, 189, 116, 0.14);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.26),
    inset 2px 0 0 rgba(179, 156, 245, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.admin-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14px;
  right: 34px;
  height: 1px;
  background: linear-gradient(90deg, var(--mh-gold-line), transparent);
  opacity: 0.55;
  pointer-events: none;
}
.admin-bubble.md { white-space: normal; }
.admin-bubble.md p { margin: 0.4em 0; }
.admin-bubble.md > *:first-child { margin-top: 0; }
.admin-bubble.md > *:last-child { margin-bottom: 0; }
.admin-bubble.md h1,
.admin-bubble.md h2,
.admin-bubble.md h3,
.admin-bubble.md h4 {
  font-family: var(--mh-font-display);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
}
.admin-bubble.md h1 { font-size: 17px; }
.admin-bubble.md h2 { font-size: 15.5px; }
.admin-bubble.md h3 { font-size: 14px; }
.admin-bubble.md blockquote {
  margin: 0.6em 0;
  padding-left: 11px;
  color: var(--text-2);
  border-left: 2px solid var(--mh-gold-line);
}
.admin-bubble.md code {
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--mh-gold-soft);
  border: 1px solid var(--adm-line-soft);
  border-radius: 4px;
}
.admin-bubble.md pre {
  margin: 0.6em 0;
  padding: 10px 12px;
  overflow: auto;
  background: rgba(19, 16, 25, 0.06);
  border: 1px solid var(--adm-line-soft);
  border-radius: 8px;
}
html[data-theme="dark"] .admin-bubble.md pre { background: rgba(0, 0, 0, 0.22); }
.admin-bubble.md pre code { padding: 0; background: none; border: 0; }
.admin-msg.user .admin-bubble {
  padding: 10px 16px;
  color: #352a20;
  background:
    linear-gradient(140deg, #fbf3e4 0%, #f0e0c5 58%, #e4d0ad 100%);
  border: 1px solid rgba(169, 119, 42, 0.55);
  border-radius: 15px 15px 3px 15px;
  box-shadow: 0 10px 26px rgba(90, 66, 35, 0.15), inset 0 1px 0 #fffdf7;
}
.admin-msg.user .admin-bubble::before {
  left: 34px;
  right: 14px;
  background: linear-gradient(90deg, transparent, rgba(169, 119, 42, 0.4));
}
.admin-msg.user .admin-bubble a { color: #7b521a; }
.admin-msg.user .admin-bubble code {
  background: rgba(169, 119, 42, 0.12);
  border-color: rgba(169, 119, 42, 0.24);
}
.admin-msg-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 4px;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--text-4);
}
.admin-msg.user .admin-msg-meta { justify-content: flex-end; }
.admin-msg-pending { font-style: italic; color: var(--text-4); }

.admin-engine-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  font-size: 8.5px;
  line-height: 1.55;
  letter-spacing: 0.03em;
  color: var(--text-3);
  background: var(--adm-card);
  border: 1px solid var(--adm-line-soft);
  border-radius: 999px;
  white-space: nowrap;
}
.admin-engine-chip .icon { width: 10px; height: 10px; }
.admin-engine-chip.flagship {
  color: var(--adm-violet);
  background: var(--mh-violet-soft);
  border-color: var(--brand-border);
}
.admin-engine-chip.local {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(44, 154, 107, 0.3);
}
html[data-theme="dark"] .admin-engine-chip.local { border-color: rgba(99, 214, 166, 0.32); }

/* 5.4 思考中 */
.admin-thinking {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  font-family: var(--mh-font-reading);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--text-3);
  background:
    linear-gradient(135deg, var(--mh-violet-soft), transparent 70%),
    var(--adm-glass);
  border: 1px dashed var(--mh-gold-line);
  border-radius: 3px 15px 15px 15px;
  animation: adminMsgIn 220ms var(--ease);
}
.admin-thinking-dots { display: inline-flex; align-items: flex-end; gap: 3px; height: 10px; }
.admin-thinking-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--adm-gold);
  animation: adminDot 1.25s ease-in-out infinite;
}
.admin-thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.admin-thinking-dots span:nth-child(3) { animation-delay: 0.3s; }

/* 5.5 错误 / 提示卡片 */
.admin-chat-errorcard {
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  max-width: min(94%, 660px);
  padding: 12px 15px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--danger);
  background:
    linear-gradient(135deg, var(--danger-soft), transparent 70%),
    var(--adm-glass);
  border: 1px solid var(--danger-border);
  border-radius: 11px;
}
.admin-chat-errorcard-head { display: flex; align-items: center; gap: 6px; font-weight: 650; }
.admin-chat-errorcard-head .icon { width: 14px; height: 14px; }
.admin-chat-errorcard p { margin: 0; color: var(--text-2); font-size: 11px; }
.admin-chat-errorcard ul {
  margin: 0;
  padding-left: 17px;
  font-size: 10px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.admin-chat-errorcard-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }

.admin-chat-notice {
  align-self: stretch;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 14px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-2);
  background:
    linear-gradient(135deg, var(--mh-violet-soft), transparent 70%),
    var(--adm-card);
  border: 1px solid var(--adm-line-soft);
  border-radius: 10px;
}
.admin-chat-notice .icon { width: 14px; height: 14px; margin-top: 1px; flex: 0 0 auto; color: var(--info); }
.admin-chat-notice.warn {
  color: var(--warning);
  border-color: rgba(181, 129, 37, 0.35);
  background: var(--warning-soft);
}
.admin-chat-notice.warn .icon { color: var(--warning); }
.admin-chat-notice strong { display: block; color: var(--text); }

/* 5.6 状态条 */
.admin-chat-status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 0 28px 5px;
  font-size: 9.5px;
  letter-spacing: 0.03em;
  color: var(--text-4);
}
.admin-chat-status .icon { width: 11px; height: 11px; flex: 0 0 auto; }
.admin-chat-status.state-thinking { color: var(--adm-violet); }
.admin-chat-status.state-ok { color: var(--text-3); }
.admin-chat-status.state-warn { color: var(--warning); }
.admin-chat-status.state-error { color: var(--danger); }
.admin-chat-status .admin-status-link {
  margin-left: 2px;
  font-size: 9.5px;
  color: var(--adm-gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 5.7 输入区 */
.admin-composer {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 11px 28px 19px;
  background: linear-gradient(180deg, transparent, var(--adm-chat) 42%);
}
.admin-composer::before {
  content: "";
  position: absolute;
  top: 0;
  right: 28px;
  left: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--adm-line-soft), transparent);
  pointer-events: none;
}
.admin-composer-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  max-height: 138px;
  padding: 11px 15px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent),
    var(--adm-card);
  border: 1px solid var(--adm-line-soft);
  border-radius: 12px;
  resize: none;
  overflow-y: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
html[data-theme="dark"] .admin-composer-input {
  background: rgba(28, 22, 39, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.admin-composer-input::placeholder {
  color: var(--text-4);
  font-family: var(--mh-font-reading);
  font-style: italic;
}
.admin-composer-input:focus {
  outline: none;
  background: var(--adm-card-solid);
  border-color: var(--mh-gold-line);
  box-shadow: 0 0 0 3px var(--mh-gold-soft), var(--mh-shadow-inner);
}
.admin-composer.busy { opacity: 0.86; }
.admin-send-btn {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  border-radius: 12px;
}
.admin-view .admin-composer .admin-send-btn.btn.primary {
  color: #2c2010;
  background: linear-gradient(145deg, var(--mh-gold-bright), var(--mh-gold) 74%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 10px 22px rgba(169, 119, 42, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  text-shadow: none;
  transition: transform 140ms var(--ease), box-shadow var(--dur) var(--ease), filter var(--dur) var(--ease);
}
.admin-view .admin-composer .admin-send-btn.btn.primary:hover {
  color: #2c2010;
  background: linear-gradient(145deg, #f7d79a, var(--mh-gold-bright) 74%);
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(169, 119, 42, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.admin-view .admin-composer .admin-send-btn.btn.primary:active { transform: translateY(0); }
.admin-send-btn .icon { width: 15px; height: 15px; }
.admin-send-btn:disabled { opacity: 0.55; cursor: progress; }

/* ---------- 6. 右栏 · 条目档案 ---------- */
.admin-detail {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 18%),
    radial-gradient(460px 320px at 110% 0%, var(--mh-glow-warm), transparent 66%),
    linear-gradient(180deg, rgba(242, 233, 218, 0.935), rgba(242, 233, 218, 0.975)),
    var(--mh-img-paper) center / cover no-repeat,
    var(--adm-panel);
  border-left: 1px solid var(--adm-line-soft);
}
html[data-theme="dark"] .admin-detail {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 18%),
    radial-gradient(460px 320px at 110% 0%, rgba(224, 189, 116, 0.08), transparent 66%),
    var(--adm-panel);
}
.admin-detail::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -110px;
  z-index: 0;
  width: 320px;
  height: 320px;
  background: url("/assets/decor-admin/star-chart.svg") center / contain no-repeat;
  opacity: 0.12;
  pointer-events: none;
}
.admin-detail > * { position: relative; z-index: 1; }

.admin-detail-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 24px;
  text-align: center;
}
.admin-detail-empty::before {
  content: "PRIVATE ARCHIVE";
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.3em;
  color: var(--adm-gold);
  opacity: 0.85;
}
.admin-detail-empty-illustration {
  position: relative;
  display: grid;
  place-items: center;
  width: 176px;
  height: 138px;
  color: var(--adm-gold);
}
.admin-detail-empty-illustration::before {
  content: "";
  position: absolute;
  inset: 4px 14px;
  border: 1px solid var(--mh-gold-line);
  border-radius: 50%;
  opacity: 0.45;
}
.admin-detail-empty-illustration::after {
  content: "☾";
  position: absolute;
  top: 2px;
  right: 6px;
  font-size: 21px;
  color: var(--mh-gold-bright);
  opacity: 0.5;
  transform: rotate(-16deg);
}
.admin-detail-empty-illustration svg {
  width: 142px;
  height: 108px;
  opacity: 0.9;
  filter: drop-shadow(0 2px 6px rgba(169, 119, 42, 0.12));
}
.admin-detail-empty-illustration svg rect {
  fill: var(--mh-gold-soft);
  stroke: var(--mh-gold-line);
}
.admin-detail-empty-illustration svg path {
  stroke: var(--mh-gold-line);
  fill: none;
}
.admin-detail-empty-illustration svg path:last-of-type {
  fill: var(--mh-gold-soft);
  stroke: var(--adm-gold);
}
.admin-detail-empty h3 {
  font-family: var(--mh-font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text);
}
.admin-detail-empty p {
  max-width: 230px;
  margin: 0;
  font-size: 11px;
  line-height: 1.8;
  color: var(--text-3);
}
.admin-detail-empty::after {
  content: "";
  width: 128px;
  height: 22px;
  margin-top: 8px;
  background: url("/assets/decor-admin/moon-phases.svg") center / contain no-repeat;
  opacity: 0.34;
}

.admin-detail-loading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 20px;
}
.admin-detail-errorbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 22px;
  text-align: center;
}
.admin-detail-errorbox h3 { font-family: var(--mh-font-display); font-size: 16px; font-weight: 600; }
.admin-detail-errorbox p { max-width: 240px; font-size: 11px; line-height: 1.7; color: var(--text-3); }

.admin-detail-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 18px 22px;
}
.admin-detail-form::before {
  content: "ENTRY · 条目档案";
  display: block;
  padding-bottom: 2px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.28em;
  color: var(--adm-gold);
  opacity: 0.85;
}
.admin-detail-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.admin-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-detail-meta {
  min-height: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.45;
}
.admin-detail-meta .sub { font-size: 10px; color: var(--text-4); }
.admin-detail .field-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: var(--adm-gold);
  opacity: 0.9;
}
.admin-detail .input,
.admin-detail .select,
.admin-detail .textarea {
  background: var(--adm-card);
  border-color: var(--adm-line-soft);
  border-radius: 8px;
}
.admin-detail .input:focus,
.admin-detail .select:focus,
.admin-detail .textarea:focus {
  background: var(--adm-card-solid);
  border-color: var(--mh-gold-line);
  box-shadow: 0 0 0 3px var(--mh-gold-soft);
}
.admin-detail-content {
  min-height: 196px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.75;
}
.admin-detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 3px;
}
.admin-detail-actions .btn.danger { margin-left: auto; }
.admin-detail-actions .btn { border: 1px solid transparent; }
.admin-view .admin-detail-actions .btn.primary {
  color: #2c2010;
  background: linear-gradient(145deg, var(--mh-gold-bright), var(--mh-gold));
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 18px rgba(169, 119, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  text-shadow: none;
}
.admin-view .admin-detail-actions .btn.primary:hover {
  color: #2c2010;
  background: linear-gradient(145deg, #f7d79a, var(--mh-gold-bright));
}
.admin-detail-actions .btn.subtle { border-color: var(--adm-line-soft); background: var(--adm-card); }
.admin-detail-actions .btn.danger { border-color: var(--danger-border); }
.admin-detail-versions {
  margin-top: 3px;
  padding-top: 8px;
  border-top: 1px dashed var(--adm-line-soft);
}
.admin-detail-versions summary {
  padding: 2px;
  font-size: 10.5px;
  color: var(--text-3);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.admin-detail-versions summary::-webkit-details-marker { display: none; }
.admin-detail-versions summary::before {
  content: "›";
  display: inline-block;
  margin-right: 5px;
  color: var(--adm-gold);
  transition: transform 140ms var(--ease);
}
.admin-detail-versions[open] summary::before { transform: rotate(90deg); }
.admin-detail-versions summary:hover { color: var(--adm-gold); }
.admin-detail-version-count { color: var(--text-4); }
.admin-detail-versions-list { margin-top: 5px; }
.admin-detail-path {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--adm-line-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.6;
  color: var(--text-4);
  word-break: break-all;
}

/* ---------- 7. 引擎设置弹窗（原生 dialog） ---------- */
.admin-settings-modal {
  width: 720px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 0;
  color: var(--text);
  background:
    radial-gradient(640px 300px at 100% 0%, var(--mh-glow-warm), transparent 62%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.28), transparent 40%),
    linear-gradient(180deg, rgba(250, 244, 232, 0.935), rgba(250, 244, 232, 0.975)),
    var(--mh-img-paper) center / cover no-repeat,
    var(--adm-panel-2);
  border: 1px solid var(--mh-gold-line);
  border-radius: 17px;
  box-shadow: var(--adm-shadow-lift), 0 0 0 1px rgba(255, 255, 255, 0.16);
  overflow: hidden;
}
html[data-theme="dark"] .admin-settings-modal {
  background:
    radial-gradient(640px 300px at 100% 0%, rgba(224, 189, 116, 0.09), transparent 62%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.045), transparent 40%),
    var(--adm-panel-2);
  box-shadow: var(--adm-shadow-lift), 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.admin-settings-modal::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -110px;
  z-index: 0;
  width: 360px;
  height: 360px;
  background: url("/assets/decor-admin/star-chart.svg") center / contain no-repeat;
  opacity: 0.16;
  pointer-events: none;
}
.admin-settings-modal[open] { display: flex; flex-direction: column; }
.admin-settings-modal::backdrop {
  background:
    radial-gradient(900px 620px at 50% 44%, rgba(19, 16, 25, 0.24), rgba(6, 3, 10, 0.66)),
    var(--overlay);
  -webkit-backdrop-filter: blur(4px) saturate(0.9);
  backdrop-filter: blur(4px) saturate(0.9);
}
.admin-settings-modal::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 0;
  width: 92px;
  height: 92px;
  background: url("/assets/decor-admin/corner-flourish.svg") top left / contain no-repeat;
  opacity: 0.34;
  pointer-events: none;
}
.admin-settings-modal > * { position: relative; z-index: 1; }
.admin-settings-modal .modal-head {
  flex: 0 0 auto;
  padding: 20px 24px 15px;
  border-bottom: 1px solid var(--adm-line-soft);
}
.admin-settings-modal .modal-title {
  font-family: var(--mh-font-display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text);
}
.admin-settings-modal .modal-title::after {
  content: "";
  display: block;
  width: 42px;
  height: 1px;
  margin-top: 9px;
  background: linear-gradient(90deg, var(--adm-gold), transparent);
}
.admin-settings-modal .modal-sub {
  margin-top: 8px;
  max-width: 560px;
  font-family: var(--mh-font-reading);
  font-size: 11px;
  line-height: 1.8;
  color: var(--text-3);
}
.admin-settings-modal .modal-close {
  width: 30px;
  height: 30px;
  color: var(--adm-gold);
  background: transparent;
  border: 1px solid var(--adm-line-soft);
  border-radius: 50%;
}
.admin-settings-modal .modal-close:hover { background: var(--mh-gold-soft); border-color: var(--adm-line); }
.admin-settings-modal .switch-row input:checked + .switch-track {
  background: linear-gradient(90deg, var(--adm-gold), var(--adm-gold-bright));
  border-color: var(--mh-gold-line);
}
.admin-settings-modal .switch-row input:checked + .switch-track .switch-thumb { background: #fffaf0; }
html[data-theme="dark"] .admin-settings-modal .switch-row input:checked + .switch-track {
  background: linear-gradient(90deg, var(--adm-gold), var(--adm-gold-bright));
  border-color: var(--mh-gold-line);
}
html[data-theme="dark"] .admin-settings-modal .switch-row input:checked + .switch-track .switch-thumb { background: #2a2014; }
.admin-settings-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 17px 24px 19px;
}
.admin-settings-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  background: rgba(19, 16, 25, 0.04);
  border-top: 1px solid var(--adm-line-soft);
}
html[data-theme="dark"] .admin-settings-foot { background: rgba(0, 0, 0, 0.16); }
.admin-settings-foot #adminSettingsTest { margin-right: auto; }
.admin-settings-foot .foot-left {
  margin-right: 0;
  font-size: 9.5px;
  letter-spacing: 0.02em;
  color: var(--text-4);
}
.admin-settings-foot .btn.primary {
  color: #2c2010;
  background: linear-gradient(145deg, var(--mh-gold-bright), var(--mh-gold));
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 18px rgba(169, 119, 42, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  text-shadow: none;
}
.admin-settings-modal .admin-settings-foot .btn.primary:hover {
  color: #2c2010;
  background: linear-gradient(145deg, #f7d79a, var(--mh-gold-bright));
}
.admin-settings-strategy { max-width: 100%; }
.admin-settings-modal .field-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: var(--adm-gold);
}
.admin-settings-modal .input,
.admin-settings-modal .select {
  background: var(--adm-card);
  border-color: var(--adm-line-soft);
  border-radius: 8px;
}
.admin-settings-modal .input:focus,
.admin-settings-modal .select:focus {
  background: var(--adm-card-solid);
  border-color: var(--mh-gold-line);
  box-shadow: 0 0 0 3px var(--mh-gold-soft);
}
.admin-engine-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 15px 14px;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.24), transparent 52%),
    var(--adm-card);
  border: 1px solid var(--adm-line-soft);
  border-radius: 12px;
}
html[data-theme="dark"] .admin-engine-card {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.04), transparent 52%),
    rgba(0, 0, 0, 0.14);
}
.admin-engine-card::before {
  content: "";
  position: absolute;
  inset: 0 22% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--mh-gold-line), transparent);
  pointer-events: none;
}
.admin-engine-card::after {
  content: "I";
  position: absolute;
  top: 12px;
  right: 14px;
  font-family: var(--mh-font-display);
  font-size: 10px;
  color: var(--adm-gold);
  opacity: 0.35;
}
.admin-engine-card:nth-of-type(2)::after { content: "II"; }
.admin-engine-card-compact { padding: 9px 14px; }
.admin-engine-card-compact::after { content: none; }
.admin-engine-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-engine-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mh-font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}
.admin-engine-card-title .icon { width: 14px; height: 14px; color: var(--adm-gold); }
.admin-engine-tag {
  padding: 1px 8px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-3);
  background: var(--adm-card-solid);
  border: 1px solid var(--adm-line-soft);
  border-radius: 999px;
  white-space: nowrap;
}
.admin-engine-tag.ok {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(44, 154, 107, 0.32);
}
.admin-engine-tag.off {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: rgba(181, 129, 37, 0.32);
}
.admin-engine-switch {
  width: auto;
  height: 26px;
  padding: 0 3px;
  font-size: 10.5px;
  color: var(--text-3);
}
.admin-engine-switch .switch-track { flex: 0 0 auto; }
.admin-settings-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.admin-settings-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--text-3);
  cursor: pointer;
}
.admin-settings-check input { accent-color: var(--adm-gold); }
.admin-settings-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 12px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  border-radius: 8px;
}
.admin-settings-error .icon { width: 14px; height: 14px; margin-top: 1px; flex: 0 0 auto; }
.admin-settings-probe {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 13px;
  background: var(--adm-card);
  border: 1px solid var(--adm-line-soft);
  border-radius: 10px;
}
.admin-settings-probe-head {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: var(--adm-gold);
}
.admin-probe-rows { display: flex; flex-direction: column; gap: 6px; }
.admin-probe-row { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; color: var(--text-2); }
.admin-probe-row > .icon { width: 13px; height: 13px; margin-top: 2px; flex: 0 0 auto; }
.admin-probe-row.ok > .icon { color: var(--success); }
.admin-probe-row.fail > .icon { color: var(--danger); }
.admin-probe-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.admin-probe-role { font-weight: 600; color: var(--text); }
.admin-probe-detail { font-size: 10px; line-height: 1.55; color: var(--text-4); word-break: break-word; }
.admin-probe-latency { flex: 0 0 auto; font-size: 9.5px; color: var(--text-4); font-variant-numeric: tabular-nums; }

/* ---------- 8. 动画 ---------- */
@keyframes adminFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2.2px); }
}
@keyframes adminBlink {
  0%, 91%, 100% { transform: scaleY(1); }
  93.5%, 95.5% { transform: scaleY(0.08); }
}
@keyframes adminOrbitSpin { to { transform: rotate(360deg); } }
@keyframes adminTwinkle {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
@keyframes adminDot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-3px); opacity: 1; }
}
@keyframes adminMsgIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 9. 深色主题微调 ---------- */
html[data-theme="dark"] .admin-name { color: #f6ede0; }
html[data-theme="dark"] .admin-chat-mini-avatar { border-color: var(--mh-gold-line); }
html[data-theme="dark"] .admin-msg.user .admin-bubble { color: #352a20; }
html[data-theme="dark"] .admin-tree-row.selected {
  background:
    linear-gradient(90deg, rgba(224, 189, 116, 0.1), rgba(179, 156, 245, 0.05) 60%, transparent),
    var(--bg-hover);
}
html[data-theme="dark"] .admin-suggestion {
  background:
    linear-gradient(90deg, rgba(224, 189, 116, 0.08), transparent 52%),
    rgba(28, 22, 39, 0.5);
}
html[data-theme="dark"] .admin-composer-input::placeholder { color: var(--text-4); }
html[data-theme="dark"] .admin-detail-empty-illustration svg { opacity: 0.9; }

/* ---------- 10. 响应式 ---------- */
@media (max-width: 1360px) {
  .admin-view { --admin-side-w: 280px; --admin-detail-w: 326px; }
  .admin-chat-empty { grid-template-columns: 252px minmax(0, 1fr); gap: 30px; padding: 16px 18px 22px; }
  .admin-hero-stage { width: 252px; height: 378px; }
  .admin-hero-portrait { width: 224px; height: 322px; }
  .admin-hero-halo { width: 300px; height: 300px; margin-left: -150px; }
  .admin-hero-orbit { width: 324px; margin-left: -162px; }
  .admin-chat-empty h2 { font-size: 29px; }
  .admin-chat-subtitle { max-width: 280px; }
}
@media (max-width: 1180px) {
  .admin-view { --admin-side-w: 262px; --admin-detail-w: 306px; }
  .admin-chat-subtitle { max-width: 200px; }
  .admin-conv-select { width: 138px; }
  .admin-detail-grid { grid-template-columns: 1fr; }
  .admin-chat-empty { grid-template-columns: 210px minmax(0, 1fr); gap: 22px; padding: 14px 10px 18px; }
  .admin-hero-stage { width: 210px; height: 340px; }
  .admin-hero-portrait { width: 188px; height: 278px; }
  .admin-hero-halo { width: 248px; height: 248px; margin-left: -124px; }
  .admin-hero-orbit { width: 268px; height: 150px; margin-left: -134px; }
  .admin-hero-moon { width: 40px; height: 40px; right: 0; }
  .admin-hero-caption { font-size: 6.5px; letter-spacing: 0.2em; }
  .admin-chat-empty h2 { font-size: 26px; }
  .admin-chat-greeting { font-size: 12px; padding: 12px 14px 12px 22px; }
  .admin-suggestion { font-size: 11px; padding: 8px 10px; }
  .admin-chat-messages { padding: 18px 20px 10px; }
  .admin-composer { padding: 10px 20px 16px; }
}
@media (max-width: 1024px) {
  .admin-view { --admin-side-w: 240px; --admin-detail-w: 288px; }
  .admin-avatar { width: 82px; height: 82px; }
  .admin-name { font-size: 25px; }
  .admin-chat-subtitle { display: none; }
  .admin-side-actions .btn span { display: none; }
  .admin-side-actions .btn { flex: 0 0 auto; width: 32px; padding: 0; }
  .admin-chat-empty {
    grid-template-columns: minmax(0, 1fr);
    max-width: 440px;
    gap: 12px;
    padding: 10px 8px 20px;
    text-align: center;
  }
  .admin-hero-copy { align-items: center; }
  .admin-chat-empty h2::after { margin-right: auto; margin-left: auto; }
  .admin-chat-empty p { text-align: left; }
  .admin-chat-greeting { text-align: left; }
  .admin-suggestions { text-align: left; }
}
@media (max-width: 960px) {
  .admin-view {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .admin-disabled-banner {
    position: static;
    transform: none;
    margin: 8px 10px 0;
    max-width: none;
  }
  .admin-side {
    flex: 0 0 auto;
    border-right: none;
    border-bottom: 1px solid var(--adm-line-soft);
  }
  .admin-identity { flex-direction: row; text-align: left; padding: 18px 18px 14px; }
  .admin-identity-text::before { margin-bottom: 4px; }
  .admin-name { font-size: 24px; }
  .admin-title { justify-content: flex-start; }
  .admin-title::before { display: none; }
  .admin-substrate-card { margin: 0 16px 12px; }
  .admin-stats { grid-template-columns: repeat(4, 1fr); }
  .admin-engine, .admin-side-actions { margin-right: 16px; margin-left: 16px; }
  .admin-side-actions { padding: 0 0 12px; }
  .admin-tree-scroll { flex: 0 0 auto; max-height: 340px; }
  .admin-tree, .admin-growth { max-height: 250px; }
  .admin-chat {
    flex: 0 0 auto;
    height: min(80vh, 680px);
    border-right: none;
    border-bottom: 1px solid var(--adm-line-soft);
  }
  .admin-detail { flex: 0 0 auto; min-height: 400px; }
  .admin-detail-content { min-height: 140px; }
  .admin-detail-empty { padding: 34px 22px; }
  .view-switch-btn { width: 30px; padding: 0; }
  .view-switch-btn span { display: none; }
  .admin-settings-modal { width: calc(100vw - 24px); }
  .admin-chat-empty {
    grid-template-columns: 230px minmax(0, 1fr);
    max-width: 760px;
    gap: 26px;
    text-align: left;
  }
  .admin-hero-stage { display: grid; width: 230px; height: 360px; }
  .admin-hero-portrait { width: 204px; height: 298px; }
  .admin-hero-halo { width: 270px; height: 270px; margin-left: -135px; }
  .admin-hero-orbit { width: 290px; height: 156px; margin-left: -145px; }
  .admin-hero-copy { align-items: flex-start; }
  .admin-chat-empty h2::after { margin-left: 0; }
}
@media (min-width: 961px) and (max-width: 1024px) {
  .admin-chat-empty { padding-top: 8px; }
  .admin-hero-stage {
    display: grid;
    width: 134px;
    height: 134px;
    margin: 0 auto;
  }
  .admin-hero-stage::before,
  .admin-hero-stage::after,
  .admin-hero-halo,
  .admin-hero-orbit,
  .admin-hero-moon,
  .admin-hero-spark,
  .admin-hero-caption { display: none; }
  .admin-hero-portrait {
    width: 112px;
    height: 112px;
    margin: 0;
    border-radius: 50%;
    box-shadow: 0 12px 30px rgba(12, 8, 20, 0.28), 0 0 0 5px var(--mh-gold-soft);
  }
  .admin-hero-portrait::before { inset: 5px; border-radius: 50%; }
  .admin-hero-portrait-fallback {
    background-size: 154% auto;
    background-position: center 16%;
  }
}
@media (max-height: 920px) and (min-width: 961px) {
  .admin-identity { gap: 10px; padding: 14px 16px 10px; }
  .admin-avatar { width: 78px; height: 78px; }
  .admin-name { font-size: 24px; }
  .admin-title { margin-top: 4px; }
  .admin-motto { margin-top: 5px; }
  .admin-identity-text::before { margin-bottom: 4px; }
  .admin-substrate-card { margin-bottom: 9px; padding: 10px 12px 9px; }
  .admin-card-head { margin-bottom: 7px; }
  .admin-stat { padding: 7px 9px 6px; }
  .admin-stat-value { font-size: 21px; }
  .admin-engine { margin-bottom: 8px; padding: 8px 11px 8px 13px; }
  .admin-side-actions { padding-bottom: 8px; }
  .admin-side-actions .btn,
  .admin-side-actions .icon-btn { height: 28px; }
  .admin-tab { height: 35px; }
  .admin-tree-scroll { padding-top: 7px; }
}
@media (max-width: 700px) {
  .admin-chat-head { flex-wrap: wrap; row-gap: 8px; }
  .admin-chat-tools { margin-left: 0; width: 100%; }
  .admin-conv-wrap { flex: 1; }
  .admin-conv-select { width: 100%; }
  .admin-msg.assistant { max-width: 94%; }
  .admin-msg.user { max-width: 92%; }
  .admin-chat-messages { padding: 14px 12px 8px; }
  .admin-composer { padding: 8px 12px 12px; }
  .admin-send-btn span { display: none; }
  .admin-send-btn { width: 44px; padding: 0; }
  .admin-settings-modal { max-height: calc(100vh - 16px); }
  .admin-settings-modal .form-grid { grid-template-columns: 1fr; }
  .admin-settings-foot { flex-wrap: wrap; }
  .admin-settings-foot .foot-left { display: none; }
  .admin-chat-empty { grid-template-columns: 1fr; text-align: center; }
  .admin-hero-stage { display: none; }
  .admin-hero-copy { align-items: center; }
  .admin-chat-empty p { text-align: left; }
  .admin-chat-greeting { text-align: left; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-identity { flex-direction: column; text-align: center; }
  .admin-title { justify-content: center; }
  .admin-title::before { display: block; }
}

/* ---------- 11. 管理员模式下的轻提示（备份 / 刷新） ---------- */
body.mode-admin .toast {
  color: var(--text);
  background:
    linear-gradient(135deg, var(--mh-gold-soft), transparent 62%),
    var(--bg-elevated);
  border: 1px solid var(--mh-gold-line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}
body.mode-admin .toast.success .toast-icon {
  color: var(--mh-gold);
  background: var(--mh-gold-soft);
}

/* ---------- 12. 动效可及性 ---------- */
@media (prefers-reduced-motion: reduce) {
  .admin-avatar-orbit,
  .admin-float,
  .admin-eye,
  .admin-sparkle,
  .admin-hero-stage::after,
  .admin-hero-spark,
  .admin-thinking-dots span,
  .admin-chat-empty,
  .admin-msg {
    animation: none !important;
  }
  .admin-chat-messages { scroll-behavior: auto; }
}
