/* 超级大锤（super.xinhammer.snape.cn）贾维斯式极简中控舱样式
   设计原则：全屏零传统菜单、100dvh 原生窗口锁高、曜石星夜舱(#070b14)与珠光白昼舱(#f3f7fd)双高对比度、移动端输入 >=16px 零缩放、320px+ 零溢出 */

:root {
  --bg: #070b14;
  --bg-glow-1: rgba(37, 99, 235, 0.2);
  --bg-glow-2: rgba(14, 165, 233, 0.13);
  --surface: rgba(15, 23, 42, 0.78);
  --surface-solid: #0f172a;
  --surface-2: rgba(30, 41, 59, 0.65);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(96, 165, 250, 0.36);
  --text: #f8fafc;
  --text-2: #cbd5e1;
  --text-3: #94a3b8;
  --accent: #3b82f6;
  --accent-2: #06b6d4;
  --accent-text: #93c5fd;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f3f7fd;
  --bg-glow-1: rgba(59, 130, 246, 0.12);
  --bg-glow-2: rgba(16, 185, 129, 0.08);
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-2: #eef4fb;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(37, 99, 235, 0.32);
  --text: #0f172a;
  --text-2: #334155;
  --text-3: #64748b;
  --accent: #2563eb;
  --accent-2: #0891b2;
  --accent-text: #1d4ed8;
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  color-scheme: light;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "XinHammer Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.super-shell {
  position: relative;
  width: 100%;
  max-width: 100vw;
  height: 100dvh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(640px circle at 18% 0%, var(--bg-glow-1), transparent 65%),
    radial-gradient(560px circle at 85% 12%, var(--bg-glow-2), transparent 65%),
    var(--bg);
  padding-top: var(--safe-t);
}

/* ---------- 顶栏 HUD ---------- */

.hud-bar {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  flex: none;
  z-index: 10;
}

.hud-brand {
  flex: 1;
  min-width: 0;
  display: flex;
}

.core-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  min-width: 0;
  max-width: 100%;
}

.core-badge-btn:hover {
  border-color: var(--border);
  background: var(--surface-2);
}

.hud-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex: none;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.35);
}

.hud-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hud-brand-text b {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.hud-brand-text small {
  font-size: 11px;
  color: var(--ok);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-ops {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
}

.hud-pill,
.hud-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.hud-pill.is-gold {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.1);
}

.hud-auth-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #ffffff;
}

.hud-auth-btn.is-signed {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.hud-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}

/* ---------- 单行神经脉搏快调条 ---------- */

.pulse-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  flex: none;
  -webkit-overflow-scrolling: touch;
}

.pulse-strip::-webkit-scrollbar {
  display: none;
}

.pulse-chip {
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex: none;
  transition: border-color 140ms ease, color 140ms ease, transform 110ms ease;
}

.pulse-chip:hover,
.pulse-chip.is-accent {
  border-color: var(--border-strong);
  color: var(--accent-text);
}

.pulse-chip:active {
  transform: scale(0.97);
}

/* ---------- 中控对话与全息操控舱主舞台 ---------- */

.command-stage {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 16px 24px;
  scroll-behavior: smooth;
}

.stream-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.core-welcome {
  padding: 22px 20px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.orb-wrap {
  position: relative;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
}

.orb-halo {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), #8b5cf6, var(--accent));
  opacity: 0.45;
  filter: blur(10px);
  animation: orbPulse 5s linear infinite;
}

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

.orb-avatar {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-strong);
  background: var(--surface-solid);
}

.core-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-text);
}

.core-copy h1 {
  margin: 4px 0 6px;
  font-size: 22px;
  font-weight: 800;
}

.core-copy p {
  margin: 0;
  max-width: 580px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
}

.starter-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 4px;
}

.starter-card {
  text-align: left;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color 140ms ease, transform 120ms ease;
}

.starter-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.starter-card b {
  font-size: 13.5px;
  font-weight: 800;
}

.starter-card span {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-3);
}

/* ---------- 消息气泡与操控舱卡片 ---------- */

.msg-user {
  align-self: flex-end;
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 18px 18px 4px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}

.pod-card {
  width: 100%;
  padding: 15px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pod-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.pod-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text);
}

.pod-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-text);
  background: rgba(59, 130, 246, 0.14);
}

.pod-summary {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-2);
}

.pod-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.pod-kpi {
  padding: 10px 8px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pod-kpi b {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.pod-kpi span {
  font-size: 11px;
  color: var(--text-3);
}

.pod-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pod-task-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.pod-check-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.8px solid var(--text-3);
  background: transparent;
  color: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}

.pod-check-btn.is-done {
  background: var(--ok);
  border-color: var(--ok);
  color: #ffffff;
}

.pod-task-text {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pod-task-text.is-done {
  text-decoration: line-through;
  opacity: 0.58;
}

.pod-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-3);
  flex: none;
}

.pod-actions,
.pod-chips {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.pod-btn,
.pod-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 33px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.pod-btn.is-primary,
.pod-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.pod-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pod-input,
.pod-textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.pod-lights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.pod-light {
  padding: 7px 6px;
  border-radius: 10px;
  text-align: center;
  font-size: 11.5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pod-light.is-ok { background: rgba(16, 185, 129, 0.16); color: var(--ok); }
.pod-light.is-mid { background: rgba(245, 158, 11, 0.16); color: var(--warn); }
.pod-light.is-warn { background: rgba(239, 68, 68, 0.16); color: var(--danger); }

.pod-canvas {
  width: 100%;
  max-height: 230px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0f172a;
}

.pod-range {
  width: 100%;
  accent-color: var(--accent);
}

/* ---------- 底部唯一中控指令舱 ---------- */

.console-dock {
  position: relative;
  padding: 10px 16px calc(12px + var(--safe-b));
  border-top: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(22px);
  flex: none;
  z-index: 15;
}

.console-form {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 8px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
}

.console-form:focus-within {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.slash-btn,
.mic-btn,
.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}

.send-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #ffffff;
}

.mic-btn.is-listening {
  background: var(--danger);
  border-color: transparent;
  color: #ffffff;
}

.console-form input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

.console-form input::placeholder {
  font-size: 13.5px;
  color: var(--text-3);
}

.slash-menu {
  max-width: 780px;
  margin: 0 auto 10px;
  padding: 8px;
  border-radius: 16px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.slash-menu[hidden] {
  display: none;
}

.slash-menu button {
  text-align: left;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.slash-menu button:hover {
  border-color: var(--border-strong);
}

/* ---------- 17 站全生态神经矩阵浮层 ---------- */

.matrix-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 40;
}

.matrix-backdrop[hidden] {
  display: none;
}

.matrix-sheet {
  width: min(860px, 100%);
  max-height: 84dvh;
  overflow-y: auto;
  padding: 18px;
  border-radius: 22px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.matrix-head h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
}

.matrix-head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-3);
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.matrix-node {
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 140ms ease, transform 120ms ease;
}

.matrix-node:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.matrix-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.matrix-node b {
  font-size: 13.5px;
  font-weight: 800;
}

.matrix-node em {
  font-style: normal;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-text);
}

.matrix-node span {
  font-size: 11.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.super-toast {
  position: fixed;
  left: 50%;
  bottom: calc(78px + var(--safe-b));
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 999px;
  background: #0f172a;
  border: 1px solid var(--border-strong);
  color: #f8fafc;
  font-size: 12.5px;
  font-weight: 700;
  z-index: 50;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  max-width: calc(100vw - 32px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 720px) {
  .hud-bar {
    padding: 0 11px;
  }
  .pulse-strip {
    padding: 7px 11px;
  }
  .command-stage {
    padding: 12px 11px 18px;
  }
  .console-dock {
    padding: 8px 11px calc(10px + var(--safe-b));
  }
  .starter-grid,
  .slash-menu {
    grid-template-columns: minmax(0, 1fr);
  }
  .pod-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .matrix-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #btn-persona {
    display: none;
  }
  .hud-auth-btn {
    max-width: 124px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 9px;
  }
}

@media (max-width: 480px) {
  #hud-pass-pill {
    display: none !important;
  }
}

@media (max-width: 380px) {
  .matrix-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hud-auth-btn {
    max-width: 98px;
    font-size: 11px;
  }
}
