:root {
  --bg: #06080b;
  --bg-elevated: #0b0f14;
  --bg-line: #0f141b;
  --bg-input: #090c11;
  --border: rgba(132, 147, 170, 0.2);
  --border-strong: rgba(132, 147, 170, 0.34);
  --text: #e6edf7;
  --text-dim: #94a1b5;
  --text-muted: #647186;
  --authority: #76b6ff;
  --error: #ff7b72;
  --advisory: #f2c26b;
  --hint: #58d3cf;
  --log: #909fb3;
  --user: #f0f6ff;
  --success: #8dd39a;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.02);
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, "PingFang SC", "Microsoft YaHei", monospace;
  --status-h: 46px;
  --command-h: 78px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  overflow-x: hidden;
  background: #05070a;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;                 /* 基准字号 */
  -webkit-text-size-adjust: 100%; /* 禁止 iOS 自动放大字体 */
  text-size-adjust: 100%;
}

body.desktop-host-shell {
  height: 100vh; /* fallback */
  height: 100dvh;
  overflow: hidden;
  position: fixed; /* iOS 终极防弹跳滚动方案 */
  width: 100%;
}

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

.host-shell {
  height: 100vh; /* fallback */
  height: 100dvh;
  background:
    radial-gradient(circle at top left, rgba(46, 91, 166, 0.14), transparent 24%),
    linear-gradient(180deg, #06080b 0%, #090d12 52%, #05070a 100%);
  position: relative;
  overflow: hidden;
}

.cli-runtime-shell {
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding-top: calc(var(--status-h) + env(safe-area-inset-top, 0px));
  padding-bottom: var(--command-h);
  position: relative;
}

.cli-status-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: calc(var(--status-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-left: 14px;
  padding-right: 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 10, 14, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.history-toggle {
  margin-right: 4px; /* 增加与文字的额外间距 */
}

.history-toggle,
.history-close {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  background: rgba(16, 21, 28, 0.96);
  color: var(--text);
  cursor: pointer;
  flex: 0 0 auto;
  transition: all 0.2s ease;
}

.history-toggle:hover,
.history-close:hover {
  border-color: var(--authority);
  color: var(--authority);
}

.history-toggle[aria-expanded="true"] {
  background: rgba(118, 182, 255, 0.12);
  border-color: var(--authority);
  color: var(--authority);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.conversation-history-panel {
  position: absolute;
  top: var(--status-h);
  left: 0;
  width: 320px;
  height: calc(100vh - var(--status-h)); /* fallback */
  height: calc(100dvh - var(--status-h));
  background: rgba(8, 11, 15, 0.98);
  border-right: 1px solid var(--border);
  box-shadow: 18px 0 36px rgba(0, 0, 0, 0.42);
  transform: translateX(-320px);
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.conversation-history-panel.history-open {
  transform: translateX(0);
}

.history-panel-header {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.panel-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px;
  border-radius: 4px;
}

.panel-tab {
  flex: 1;
  padding: 6px;
  background: transparent;
  border: none;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.panel-tab.active {
  background: var(--bg-line);
  color: var(--authority);
}

.panel-content-area {
  flex: 1;
  overflow-y: auto;
}

.panel-view {
  display: none;
  padding: 12px;
}

.panel-view.active {
  display: block;
}

/* 历史记录内容精修 */
.history-record-current {
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  border: 1px solid var(--border);
}

.history-record summary {
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.history-record-meta {
  padding: 0 10px 8px;
  font-size: 10px;
  color: var(--text-muted);
}

.history-record-body {
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-record-line {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 6px;
  font-size: 10.5px;
  line-height: 1.4;
  word-break: break-all;   /* 防止长内容溢出 */
  overflow: hidden;
}

.line-label {
  color: var(--text-muted);
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.line-content {
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-archive-title {
  margin: 24px 0 10px;
  padding: 0 4px;
  font-size: 10px;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.history-item {
  padding: 10px;
  border: 1px solid transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.2s;
}

.history-item:hover {
  background: rgba(118, 182, 255, 0.06);
  border-color: rgba(118, 182, 255, 0.2);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.history-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-item-delete {
  padding: 2px 6px;
  background: rgba(255, 123, 114, 0.1);
  border: 1px solid rgba(255, 123, 114, 0.2);
  border-radius: 3px;
  color: #ff7b72;
  font-size: 9px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
}

.history-item:hover .btn-item-delete {
  opacity: 1;
}

.btn-item-delete:hover {
  background: #ff7b72;
  color: #fff;
}

.history-item-time {
  font-size: 10px;
  color: var(--authority);
}

.history-item-id {
  font-size: 10px;
  color: var(--text-faint);
}

.history-item-body {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 工作区结构树 */
.tree-section + .tree-section {
  margin-top: 24px;
}

.tree-section-header {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 8px;
}

.tree-node {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
}

.tree-node:hover {
  background: rgba(118, 182, 255, 0.1);
  color: var(--text);
}

.tree-node-icon {
  font-size: 14px;
  opacity: 0.7;
}

/* 树节点激活状态 */
.tree-node-active {
  background: rgba(118, 182, 255, 0.1);
  border-left: 2px solid var(--authority);
  padding-left: 6px;
  color: var(--authority);
}

.tree-node-active .tree-node-icon {
  opacity: 1;
  color: var(--authority);
}

.tree-node-badge {
  margin-left: auto;
  font-size: 9px;
  padding: 1px 5px;
  background: rgba(118, 182, 255, 0.15);
  border: 1px solid rgba(118, 182, 255, 0.3);
  border-radius: 2px;
  color: var(--authority);
  letter-spacing: 0.05em;
}

/* PHX 节点状态仪表盘 */
.phx-health-panel {
  margin: 16px 0 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.phx-health-title {
  font-size: 10px;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.phx-health-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.phx-health-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.phx-health-label {
  font-size: 9px;
  color: var(--text-faint, var(--text-muted));
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.phx-health-value {
  font-size: 11px;
  color: var(--text-dim);
}

.phx-status-ok {
  color: var(--success);
}

.phx-status-err {
  color: var(--error);
  animation: pulse-stale 2s ease-in-out infinite;
}

.phx-health-anchor {
  color: #f2c26b;
  font-size: 14px;
}

/* 页脚 */
.history-panel-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.history-close-btn {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.history-close-btn:hover {
  background: var(--line-strong);
  color: var(--text);
  border-color: var(--text-muted);
}

.status-brand {
  color: var(--text);
  font-weight: 600;
}

.status-item {
  color: var(--text-dim);
}

.status-item-authority,
.status-item-hash {
  color: var(--authority);
}

.status-item-verify {
  color: var(--success);
}

.status-item-fingerprint {
  color: var(--hint);
}

.status-item-stale {
  color: var(--advisory) !important;
  animation: pulse-stale 2s ease-in-out infinite;
}

@keyframes pulse-stale {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.status-separator {
  color: var(--text-muted);
  flex: 0 0 auto;
}

/* ===== 用户资料入口 ===== */

.user-avatar-btn {
  margin-left: auto;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid rgba(118, 182, 255, 0.5);
  background: rgba(118, 182, 255, 0.1);
  color: var(--authority);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-right: 2px;
}

.user-avatar-btn:hover {
  background: rgba(118, 182, 255, 0.2);
  border-color: var(--authority);
  transform: scale(1.08);
}

.user-profile-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 8px;
  width: 220px;
  background: rgba(12, 18, 28, 0.95);
  border: 1px solid rgba(118, 182, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  z-index: 200;
  animation: profile-slide-in 0.18s ease;
  overflow: hidden;
}

@keyframes profile-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
}

.profile-avatar-lg {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(118, 182, 255, 0.12);
  border: 1.5px solid rgba(118, 182, 255, 0.4);
  color: var(--authority);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.profile-fingerprint {
  font-size: 10px;
  color: var(--hint);
  margin-top: 2px;
  font-family: monospace;
}

.profile-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 0 14px;
}

.profile-rows {
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.profile-label {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.profile-value {
  color: var(--text-dim);
}

.profile-ok  { color: var(--success); }
.profile-err { color: var(--error); }
.profile-anchor {
  color: #f2c26b;
  font-size: 14px;
}

.cli-main {
  min-height: 0;
  overflow: hidden;
}

.conversation-stream {
  height: 100%;
  overflow: auto;
  padding: 16px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: flex-end;
}

/* 自定义滚动条 */
.conversation-stream::-webkit-scrollbar {
  width: 5px;
}

.conversation-stream::-webkit-scrollbar-track {
  background: transparent;
}

.conversation-stream::-webkit-scrollbar-thumb {
  background: rgba(132, 147, 170, 0.18);
  border-radius: 3px;
}

.conversation-block {
  position: relative;
  padding: 10px 12px 10px 14px;
  border-left: 2px solid var(--border);
  background: rgba(13, 18, 24, 0.74);
  animation: blockFadeIn 0.3s ease-out;
}

@keyframes blockFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.conversation-block::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

.block-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  font-size: 11px;
  line-height: 1.2;
}

.block-label {
  color: var(--text-dim);
}

.block-time {
  color: var(--text-muted);
}

.block-body {
  white-space: normal;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.62;
  color: var(--text);
}

.conversation-block-user_input {
  border-left-color: rgba(255, 255, 255, 0.26);
  background: rgba(20, 24, 31, 0.92);
}

.conversation-block-user_input .block-label,
.conversation-block-user_input .block-body {
  color: var(--user);
}

.conversation-block-authority {
  border-left-color: var(--authority);
  background: rgba(16, 31, 48, 0.62);
}

.conversation-block-authority .block-label,
.conversation-block-authority .block-body {
  color: #d7eaff;
}

.conversation-block-error {
  border-left-color: var(--error);
  background: rgba(57, 20, 24, 0.68);
}

.conversation-block-error .block-label,
.conversation-block-error .block-body {
  color: #ffd2ce;
}

.conversation-block-advisory {
  border-left-color: var(--advisory);
  background: rgba(55, 40, 19, 0.58);
}

.conversation-block-advisory .block-label,
.conversation-block-advisory .block-body {
  color: #ffe1ad;
}

.conversation-block-action_hint {
  border-left-color: var(--hint);
  background: rgba(19, 45, 47, 0.58);
}

.conversation-block-action_hint .block-label,
.conversation-block-action_hint .block-body {
  color: #c2fbf7;
}

.conversation-block-log {
  border-left-color: rgba(144, 159, 179, 0.34);
  background: rgba(16, 20, 27, 0.7);
}

.conversation-block-log .block-label,
.conversation-block-log .block-body,
.conversation-block-system_init .block-label,
.conversation-block-system_init .block-body,
.conversation-block-context_init .block-label,
.conversation-block-context_init .block-body {
  color: var(--log);
}

.conversation-block-system_init,
.conversation-block-context_init {
  border-left-color: rgba(104, 120, 143, 0.22);
}

/* 资源卡片 (Workspace Tree) 样式 */
.conversation-block-workspace_tree {
  border-left-color: var(--authority);
  background: rgba(15, 23, 36, 0.85);
  border-radius: 4px;
  padding: 14px;
}

.workspace-card {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(118, 182, 255, 0.1);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-dim);
  transition: all 0.2s ease;
  user-select: none;
}

.clickable-folder {
  cursor: pointer;
}

.folder-item:hover {
  background: rgba(118, 182, 255, 0.1);
  border-color: var(--authority);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.folder-item:active {
  transform: translateY(0);
  background: rgba(118, 182, 255, 0.15);
}

.folder-icon {
  font-size: 14px;
  color: var(--authority);
  opacity: 0.8;
}

.folder-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-card-footer {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed rgba(132, 147, 170, 0.2);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 再次搜索按钮 */
.search-again-btn {
  padding: 3px 10px;
  background: rgba(118, 182, 255, 0.08);
  border: 1px solid rgba(118, 182, 255, 0.2);
  border-radius: 4px;
  color: var(--authority);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.search-again-btn:hover {
  background: rgba(118, 182, 255, 0.18);
  border-color: var(--authority);
}

/* ERROR 块视觉衰减：5 秒内逐渐变暗 */
.conversation-block-error {
  animation: error-fade 8s ease forwards;
}

@keyframes error-fade {
  0%   { opacity: 1; }
  40%  { opacity: 1; }    /* 带3.2s内保持全亮 */
  100% { opacity: 0.35; } /* 最终衰减到 35%，仍可读但不展示 */
}

/* 鼠标悬停时恢复显示 */
.conversation-block-error:hover {
  opacity: 1 !important;
  animation: none;
}

.command-bar {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: transparent;
  border-top: none;
  box-shadow: none;
}

.command-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  background: rgba(26, 30, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 4px 6px 4px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.command-form:focus-within {
  border-color: rgba(118, 182, 255, 0.4);
  box-shadow: 0 4px 24px rgba(118, 182, 255, 0.1);
}

.command-prompt {
  color: var(--hint);
  font-size: 13px;
  flex: 0 0 auto;
}

.command-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  padding: 0 8px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  caret-color: var(--authority);
  font-size: 14px;
}

.command-input::placeholder {
  color: var(--text-muted);
}

.command-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
  background: transparent;
}

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

@media (max-width: 960px) {
  .status-line {
    font-size: 11px;
    gap: 6px;
  }

  .conversation-stream {
    padding: 14px 12px 18px;
  }
}

@media (max-width: 720px) {

  .cli-status-bar {
    min-height: var(--status-h);
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .status-line {
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px; /* 给滚动条一点空间 */
  }
  
  /* 隐藏状态栏滚动条 */
  .status-line::-webkit-scrollbar {
    display: none;
  }

  .command-bar {
    padding: 8px 10px calc(16px + env(safe-area-inset-bottom, 12px));
  }

  .conversation-history-panel {
    left: 0;
    width: 100vw;
    transform: translateX(-100%);
  }
  
  .conversation-history-panel.history-open {
    transform: translateX(0);
  }

  .command-prompt {
    font-size: 12px;
  }
}

/* 快捷指令折叠面板 */
.command-prompt-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--hint);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  transition: all 0.2s ease;
  border-radius: 4px;
  flex: 0 0 auto;
  white-space: nowrap;
  position: relative;
}

.command-prompt-btn:hover {
  background: rgba(88, 211, 207, 0.12);
  border-color: rgba(88, 211, 207, 0.3);
  color: #9df3ef;
}

.command-prompt-btn.prompt-expanded {
  background: rgba(88, 211, 207, 0.12);
  border-color: rgba(88, 211, 207, 0.4);
  color: #9df3ef;
}

/* 指令区容器：fixed 固定在屏幕底部，脱离 grid 布局流 */
.command-zone {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(7, 10, 14, 0.97);
  border-top: 1px solid var(--border);
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* 快捷面板：绝对定位，向上弹出覆盖对话流 */
.shortcuts-tray {
  position: absolute;
  bottom: 100%;          /* 从指令栏顶部向上弹出 */
  left: 0;
  right: 0;
  max-height: 0;
  overflow: hidden;
  background: rgba(9, 12, 17, 0.97);
  border: 0 solid transparent;
  border-radius: 12px 12px 0 0;
  transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              border-width 0.28s ease,
              padding 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 14px;
  z-index: 50;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
}

.shortcuts-tray.shortcuts-tray-open {
  max-height: 64px;
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 10px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.shortcuts-tray-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;     /* 不换行，横向排列 */
  white-space: nowrap;
}

/* 隐藏快捷栏滚动条 */
.shortcuts-tray::-webkit-scrollbar {
  display: none;
}

.shortcut-item {
  background: rgba(16, 21, 28, 0.9);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.shortcut-item:hover {
  background: rgba(118, 182, 255, 0.12);
  border-color: var(--authority);
  color: var(--authority);
}

.shortcut-item:active {
  transform: scale(0.95);
  background: rgba(118, 182, 255, 0.2);
}

/* 加载脉冲动画 */
.command-prompt-btn.prompt-busy::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--advisory);
  animation: pulseGlow 1.2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.3; box-shadow: 0 0 0 0 rgba(242, 194, 107, 0.4); }
  50% { opacity: 1; box-shadow: 0 0 8px 2px rgba(242, 194, 107, 0.3); }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .conversation-block {
    animation: none;
  }
  .shortcuts-tray {
    transition: none;
  }
}

/* ===== 身份验证终端层 ===== */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #111318;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
  font-family: monospace;
}

.auth-terminal {
  width: 600px;
  max-width: 90vw;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.auth-line {
  margin-bottom: 8px;
  animation: auth-type 0.3s ease-out;
}

.auth-dim {
  color: var(--hint);
}

.auth-success {
  color: var(--success);
  font-weight: bold;
}

.auth-user-input {
  color: var(--link);
}

.auth-input-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-prompt {
  color: var(--authority);
}

.auth-input {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: monospace;
  font-size: 14px;
  flex: 1;
  outline: none;
}

@keyframes auth-type {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

