:root {
  color-scheme: dark;
  --bg: #0a0e14;
  --bg-elevated: #111820;
  --bg-hover: #182028;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eef2f6;
  --text-muted: #8b95a5;
  --accent: #34d399;
  --accent-dim: rgba(52, 211, 153, 0.12);
  --danger: #f87171;
  --warning: #fbbf24;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  --sidebar-w: 240px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 24px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #34d399, #059669);
  font-weight: 600;
  font-size: 16px;
  color: #052e1a;
}

.brand-text strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.brand-text small {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.sidebar-foot {
  padding: 12px 10px 4px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
}

.status-dot.online::before {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.5);
}

.status-dot.offline::before {
  background: var(--danger);
}

/* Main shell */
.shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border);
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.content {
  flex: 1;
  padding: 24px 32px 40px;
  overflow: auto;
}

.page[hidden] { display: none !important; }

/* Buttons & inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.btn-primary {
  background: var(--accent);
  color: #052e1a;
}

.btn-primary:hover:not(:disabled) { background: #2dd4a0; }

.btn-secondary {
  background: var(--bg-hover);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) { border-color: var(--border-strong); }

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.28);
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.45);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}

.textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.5;
  font-family: inherit;
}

.input.mono, .input[readonly].mono {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 12px;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(52, 211, 153, 0.5);
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  max-width: 520px;
}

.toolbar .input { flex: 1; }

/* Panels & cards */
.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.panel-body {
  padding: 16px 20px;
}

.panel-body.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-muted);
  white-space: pre-wrap;
}

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

.stat-card {
  padding: 18px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat-card .label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

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

.list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.list-item strong { font-weight: 500; }

.list-item small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Table */
.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  padding: 12px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

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

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.badge.connected { background: var(--accent-dim); color: var(--accent); }
.badge.disconnected { background: rgba(248, 113, 113, 0.12); color: var(--danger); }
.badge.pending { background: rgba(251, 191, 36, 0.12); color: var(--warning); }
.badge.connecting { background: rgba(96, 165, 250, 0.12); color: #60a5fa; }
.badge.error { background: rgba(248, 113, 113, 0.12); color: var(--danger); }

.notice-banner {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.08);
  color: var(--text-muted);
  font-size: 13px;
}

.notice-banner strong { color: var(--warning); }

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-meta {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}

.history-log {
  max-height: 560px;
  overflow-y: auto;
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}

.history-item.user { border-color: rgba(52, 211, 153, 0.2); }
.history-item.assistant { border-color: rgba(96, 165, 250, 0.2); }

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 11px;
}

.history-meta strong { color: var(--text); font-weight: 500; }

.history-content {
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.sessions-list {
  max-height: 560px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.session-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.session-row .input {
  flex: 1;
  min-width: 180px;
}

.session-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.5;
}

.session-item:hover { background: var(--bg-hover); }
.session-item.active {
  border-color: rgba(52, 211, 153, 0.35);
  background: var(--accent-dim);
}

.session-item strong { display: block; font-size: 13px; margin-bottom: 2px; }
.session-item small { color: var(--text-muted); }

.agent-editor-form textarea {
  min-height: 180px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  width: 100%;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.list-item.clickable {
  cursor: pointer;
}

.list-item.clickable.active {
  border-color: rgba(52, 211, 153, 0.45);
  background: var(--accent-dim);
}

.empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.account-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.account-card-head input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-weight: 600;
}

.account-meta {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px 12px;
  font-size: 12px;
}

.account-meta dt {
  margin: 0;
  color: var(--text-muted);
}

.account-meta dd {
  margin: 0;
  word-break: break-all;
}

.account-meta dd.mono {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 11px;
}

.bind-preview {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: var(--bg);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
}

.bind-preview strong { color: var(--text); }

.hint {
  margin: 0;
  font-size: 12px;
  color: var(--accent);
}

.hint.error { color: var(--danger); }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  font-size: 13px;
  max-width: 360px;
}

.toast[hidden] { display: none !important; }

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

/* Modal & QR */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal[hidden] { display: none !important; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: min(400px, 100%);
  padding: 28px 28px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover { background: var(--bg-hover); color: var(--text); }

.modal-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.modal-sub {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.qr-frame {
  display: grid;
  place-items: center;
  width: 260px;
  height: 260px;
  margin: 0 auto 16px;
  padding: 10px;
  background: #fff;
  border-radius: 12px;
}

.qr-frame img {
  display: block;
  width: 240px;
  height: 240px;
  object-fit: contain;
}

.qr-placeholder {
  color: #666;
  font-size: 13px;
}

.qr-status {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.qr-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--accent);
}

/* Debug chat */
.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

.chat-log {
  flex: 1;
  min-height: 360px;
  max-height: 520px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--accent-dim);
  color: var(--text);
}

.chat-msg.assistant {
  align-self: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
}

.chat-msg.pending { opacity: 0.6; }

.chat-composer {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.chat-composer textarea {
  flex: 1;
  resize: none;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  outline: none;
  max-height: 120px;
}

.chat-composer textarea:focus {
  border-color: rgba(52, 211, 153, 0.5);
}

/* Responsive */
@media (max-width: 900px) {
  .app { flex-direction: column; }

  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px;
    gap: 8px;
  }

  .brand { padding: 4px 8px 8px; width: 100%; }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  .nav-item { width: auto; flex: 1 1 auto; min-width: 100px; }

  .sidebar-foot { width: 100%; margin-top: 0; border-top: 0; padding-top: 0; }

  .topbar, .content { padding-left: 16px; padding-right: 16px; }

  .grid-2 { grid-template-columns: 1fr; }
}

/* === Phase 6–10: 九天云阙 / AgentCenter / PersonalWeChat === */

.home-portal {
  position: relative;
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 64px;
  overflow: hidden;
}

.sky-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(52, 211, 153, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(99, 102, 241, 0.06), transparent 50%),
    radial-gradient(ellipse 50% 30% at 80% 70%, rgba(251, 191, 36, 0.04), transparent 50%);
  pointer-events: none;
}

.sky-webgl {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.sky-webgl-canvas,
.sky-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.sky-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.home-hero {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 48px;
}

.home-kicker {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.home-title {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.home-sub {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 15px;
}

.temple-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 820px;
  width: 100%;
}

.temple-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.temple-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.temple-card.temple-center {
  grid-column: 1 / -1;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  border-color: rgba(52, 211, 153, 0.35);
  background: linear-gradient(165deg, rgba(52, 211, 153, 0.08) 0%, var(--bg-elevated) 45%);
}

.temple-label {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.temple-card strong {
  font-size: 1.25rem;
  color: var(--text);
}

.temple-card em {
  font-size: 13px;
  color: var(--accent);
  font-style: normal;
  font-weight: 600;
}

.temple-cta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.shell.home-active .topbar {
  border-bottom-color: transparent;
  background: transparent;
}

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

.agent-center-layout {
  display: grid;
  grid-template-columns: 220px 1fr 240px;
  gap: 16px;
  min-height: calc(100vh - 140px);
}

.ac-nav, .ac-main, .ac-inspector {
  min-height: 400px;
}

.agent-pick {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.agent-pick:hover { background: var(--bg-hover); }
.agent-pick.active { background: var(--accent-dim); }

.agent-pick strong { display: block; font-size: 13px; }
.agent-pick small { color: var(--text-muted); font-size: 11px; }

.ac-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.ac-head h2 { margin: 0; font-size: 20px; }

.ac-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.ac-tab {
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
}

.ac-tab.active, .ac-tab:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.ac-panel .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.ac-panel .field span {
  font-size: 12px;
  color: var(--text-muted);
}

.pwx-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.pwx-side-wrap {
  max-height: min(72vh, 660px);
  overflow: hidden;
}

.pwx-side-stack {
  max-height: min(72vh, 660px);
  overflow-y: auto;
  padding-right: 4px;
}

.pwx-advanced {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.35);
}

.pwx-advanced > summary {
  cursor: pointer;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-muted);
  list-style: none;
}

.pwx-advanced > summary::-webkit-details-marker {
  display: none;
}

.pwx-advanced-body {
  padding: 0 12px 12px;
}

.btn-block {
  width: 100%;
}

.pwx-viewer-body {
  min-height: 420px;
  height: min(72vh, 660px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1220;
  position: relative;
}

.pwx-viewer-stack {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 420px;
}

.pwx-interaction-shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  cursor: not-allowed;
}

.pwx-interaction-shield[hidden] {
  display: none !important;
}

.pwx-vnc-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: rgba(11, 18, 32, 0.88);
  color: var(--text-muted);
  z-index: 4;
}

.pwx-vnc-overlay[hidden] {
  display: none !important;
}

.pwx-vnc-overlay-msg {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.pwx-vnc-reconnect-fab {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  min-width: 44px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.pwx-vnc-reconnect-fab:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(148, 163, 184, 0.55);
}

.pwx-vnc-reconnect-fab:disabled {
  opacity: 0.55;
  cursor: wait;
}

.pwx-frame.pwx-remote-frame {
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 0;
  background: #000;
}

.pwx-frame.pwx-remote-viewonly,
.pwx-frame.pwx-novnc-viewonly {
  cursor: default;
}

.pwx-account-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pwx-account-picker > span {
  color: var(--text-muted);
  font-size: 12px;
}

.pwx-viewer-mode-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.35);
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.pwx-viewer-mode-badge[hidden] {
  display: none !important;
}

.pwx-mode-hint {
  font-size: 12px;
  line-height: 1.4;
  margin: 0 0 8px;
}

.pwx-frame {
  max-width: 100%;
  max-height: 560px;
  border-radius: var(--radius-sm);
}

.pwx-frame.placeholder {
  color: var(--text-muted);
  padding: 48px;
  text-align: center;
}

.pwx-status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

@media (max-width: 900px) {
  .temple-grid {
    grid-template-columns: 1fr;
  }

  .agent-center-layout {
    grid-template-columns: 1fr;
  }

  .pwx-layout {
    grid-template-columns: 1fr;
  }
}

/* === Phase 15: 九天云阙视觉增强 === */

.shell.page-transition .content {
  animation: page-enter 0.65s ease;
}

@keyframes page-enter {
  from { opacity: 0.35; transform: translateY(12px) scale(0.995); filter: blur(2px); }
  to { opacity: 1; transform: none; filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .shell.page-transition .content { animation: none; }
}

.sky-webgl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.55;
}

.sky-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.sky-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.home-portal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 35% at 50% 100%, rgba(52, 211, 153, 0.06), transparent 70%);
  pointer-events: none;
}

.temple-card {
  position: relative;
  overflow: hidden;
}

.temple-card::after {
  content: '';
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 30% 20%, rgba(52, 211, 153, 0.12), transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.temple-card:hover::after,
.temple-card:focus-visible::after {
  opacity: 1;
}

.temple-card.temple-center {
  animation: temple-glow 6s ease-in-out infinite;
}

@keyframes temple-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(52, 211, 153, 0); }
  50% { box-shadow: 0 0 32px rgba(52, 211, 153, 0.12); }
}

@media (prefers-reduced-motion: reduce) {
  .temple-card.temple-center { animation: none; }
  .sky-canvas { display: none; }
}

/* === Phase 14: PersonalWeChat 人工接管 UI === */

.pwx-mode-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pwx-mode-bar .btn.is-active {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.45);
}

.pwx-mode-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--text-muted);
}

.pwx-mode-tag.mode-agent { color: var(--accent); background: var(--accent-dim); }
.pwx-mode-tag.mode-manual { color: var(--warning); background: rgba(251, 191, 36, 0.12); }
.pwx-mode-tag.mode-view { color: var(--text-muted); }

.pwx-manual-panel.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.pwx-events .list-item.clickable {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
}

.pwx-events .list-item.clickable:hover {
  background: var(--bg-hover);
}

.pwx-frame.pwx-remote-frame {
  width: 100%;
  min-height: 560px;
  border: 0;
  background: #0b1220;
}
