/*
 * AICEO AI Command Center — Production UI Lock v1
 * Stable light workspace, touch-visible message actions, readable file cards,
 * and collision-free responsive controls.
 */

:root,
html[data-theme="light"],
html[data-theme="dark"] {
  color-scheme: light !important;
  --bg: #ffffff !important;
  --bg-soft: #ffffff !important;
  --panel: #ffffff !important;
  --panel-elevated: #ffffff !important;
  --panel-muted: #f5f6f7 !important;
  --border: #e2e5e9 !important;
  --border-strong: #c9ced6 !important;
  --text: #17191c !important;
  --text-soft: #3f454d !important;
  --muted: #6c737f !important;
  --accent: #17191c !important;
  --accent-contrast: #ffffff !important;
  --shadow: 0 12px 32px rgba(20, 24, 32, 0.08) !important;
  --sidebar-width: 272px !important;
}

html,
body,
.app-shell,
.command-center,
.main,
.messages-wrap,
.messages {
  background: #ffffff !important;
  color: #17191c !important;
}

.sidebar {
  background: #ffffff !important;
  color: #17191c !important;
  border-right: 1px solid #e2e5e9 !important;
  box-shadow: none !important;
}

.sidebar-header,
.sidebar-footer,
.topbar,
.composer-wrap {
  background: #ffffff !important;
  border-color: #e2e5e9 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.brand-mark,
.conversation-item,
.sidebar-link,
.new-chat-button,
.quick-prompt,
.composer,
.message.user .message-content {
  background: #ffffff !important;
  color: #17191c !important;
  border-color: #e2e5e9 !important;
  box-shadow: none !important;
}

.new-chat-button {
  background: #17191c !important;
  color: #ffffff !important;
  border-color: #17191c !important;
}

.conversation-item:hover,
.conversation-item.active,
.sidebar-link:hover,
.quick-prompt:hover {
  background: #f5f6f7 !important;
  color: #17191c !important;
}

.topbar {
  min-height: 64px !important;
  height: auto !important;
  padding: 10px 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
}

.topbar-left {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.topbar-actions {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: 54% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.ghost-button,
.icon-button,
.msg-action-btn,
.upload-button,
.copy-code-button,
.artifact-btn,
.retry-btn,
#uiAccountBalance,
#uiPointsCenterEntry {
  background: #ffffff !important;
  color: #25292f !important;
  border: 1px solid #d7dbe1 !important;
  box-shadow: none !important;
}

.ghost-button:hover,
.icon-button:hover,
.msg-action-btn:hover,
.upload-button:hover,
.copy-code-button:hover,
.artifact-btn:hover,
.retry-btn:hover,
#uiAccountBalance:hover,
#uiPointsCenterEntry:hover {
  background: #f5f6f7 !important;
  color: #111315 !important;
  border-color: #b8bec8 !important;
}

#themeButton {
  display: none !important;
}

#stopStreamButton {
  display: inline-flex !important;
  background: #fff4f4 !important;
  color: #b42318 !important;
  border-color: #f1b8b3 !important;
}

#uiAccountBalance {
  min-height: 36px;
  max-width: 220px;
  padding: 0 12px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  white-space: nowrap;
}

#uiAccountBalance .ui-account-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #238636;
}

#uiAccountBalance .ui-account-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 600;
}

#uiPointsCenterEntry {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}

/* Keep legacy fixed badges functional but off-canvas. Visible proxy controls are in normal layout. */
#mtCreditsBadge,
#pcNavBalance {
  position: fixed !important;
  left: -10000px !important;
  right: auto !important;
  top: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.message {
  max-width: 920px !important;
}

.message-header {
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
}

.message-action-row {
  width: 100% !important;
  display: flex !important;
  justify-content: flex-end !important;
  margin-top: 10px !important;
  clear: both !important;
}

.message-action-row .message-actions {
  margin-left: 0 !important;
}

.message-actions,
.message:hover .message-actions,
.message-actions:focus-within {
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-left: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.msg-action-btn {
  width: auto !important;
  min-width: 34px !important;
  height: 34px !important;
  padding: 0 9px !important;
  border-radius: 9px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.copy-msg-btn::after { content: "复制"; }
.copy-msg-btn[data-copied="true"]::after { content: "已复制"; }
.ux-regen-msg-btn::after { content: "重试"; }
.ux-edit-msg-btn::after { content: "编辑"; }

.markdown-body,
.message-content,
.message-author,
.chat-title,
.brand-title,
.conversation-title {
  color: #17191c !important;
}

.markdown-body a { color: #0b57d0 !important; }
.markdown-body blockquote,
.markdown-body th,
.markdown-body :not(pre) > code {
  background: #f5f6f7 !important;
  color: #25292f !important;
  border-color: #dfe3e8 !important;
}

/* File names always sit on a light card with explicit high-contrast text. */
html body .attachment-card,
html body .deliverable-card,
html body .inline-file-card,
html body .artifact-card {
  background: #ffffff !important;
  color: #17191c !important;
  border: 1px solid #d9dee6 !important;
  box-shadow: 0 2px 10px rgba(20, 24, 32, 0.06) !important;
}

html body .attachment-card:hover,
html body .deliverable-card:hover,
html body .inline-file-card:hover,
html body .artifact-card:hover {
  background: #f8f9fa !important;
  border-color: #aeb6c2 !important;
  box-shadow: 0 5px 16px rgba(20, 24, 32, 0.09) !important;
}

html body .attachment-name,
html body .deliverable-name,
html body .inline-file-name,
html body .artifact-card-title,
html body .artifact-doc-preview,
html body .artifact-text-preview pre {
  color: #17191c !important;
  opacity: 1 !important;
  font-weight: 650 !important;
  text-shadow: none !important;
}

html body .attachment-meta,
html body .deliverable-meta,
html body .artifact-card-meta {
  color: #626a75 !important;
  opacity: 1 !important;
}

html body .artifact-card-header {
  background: #f8f9fa !important;
  border-bottom-color: #e2e5e9 !important;
}

.composer-wrap {
  box-shadow: 0 -8px 24px rgba(20, 24, 32, 0.04) !important;
}

.composer {
  border: 1px solid #d7dbe1 !important;
  box-shadow: 0 8px 22px rgba(20, 24, 32, 0.07) !important;
}

#chatInput {
  color: #17191c !important;
  background: #ffffff !important;
}

#chatInput::placeholder { color: #7a828d !important; }

.send-button {
  background: #17191c !important;
  color: #ffffff !important;
  border: 1px solid #17191c !important;
}

.send-button:disabled {
  background: #eceff2 !important;
  color: #8b929c !important;
  border-color: #dfe3e8 !important;
}

.scroll-to-bottom-btn {
  position: fixed !important;
  right: 24px !important;
  bottom: 120px !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  color: #17191c !important;
  border: 1px solid #d7dbe1 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 99 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.2s, visibility 0.2s !important;
}

.scroll-to-bottom-btn.visible {
  opacity: 1 !important;
  visibility: visible !important;
}

.scroll-to-bottom-btn:hover {
  background: #f5f6f7 !important;
  border-color: #b8bec8 !important;
}

.thinking,
.agent-progress-panel,
.agent-trace,
.agent-step-card {
  color: #25292f !important;
  background: #ffffff !important;
  border-color: #dfe3e8 !important;
  box-shadow: none !important;
}

@media (max-width: 1100px) {
  :root,
  html[data-theme="light"],
  html[data-theme="dark"] { --sidebar-width: 248px !important; }
  .topbar-actions { max-width: 48% !important; }
  #clearCurrentButton { display: none !important; }
}

@media (max-width: 920px) {
  .topbar { padding: 9px 12px !important; }
  .topbar-actions { max-width: 56% !important; gap: 6px !important; }
  #uiAccountBalance { max-width: 150px; padding: 0 9px; }
  .messages { padding-left: 16px !important; padding-right: 16px !important; }
}

@media (max-width: 680px) {
  .topbar { align-items: flex-start !important; }
  .topbar-actions { max-width: 58% !important; }
  #uiAccountBalance { min-width: 36px; width: 36px; padding: 0; justify-content: center; }
  #uiAccountBalance .ui-account-text { display: none; }
  #themeButton { display: none !important; }
  .message-header > .message-actions { width: 100% !important; margin-left: 0 !important; margin-top: 3px !important; }
  .message-action-row .message-actions { width: auto !important; margin-left: 0 !important; margin-top: 0 !important; }
  .msg-action-btn { min-height: 36px !important; }
  .attachment-card,
  .deliverable-card { max-width: 100% !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* [AICEO_CONTRAST_FIX_20260722]
   manus_chat.css 的全局 .command-center button/span 深色规则权重更高；
   对黑底主操作按钮做精确高权重覆盖，禁用态继续使用原浅色方案。 */
.command-center .new-chat-button,
.command-center .new-chat-button span,
.command-center .new-chat-button svg,
.command-center .send-button:not(:disabled),
.command-center .send-button:not(:disabled) svg {
  color: #ffffff !important;
}
.command-center .new-chat-button svg,
.command-center .send-button:not(:disabled) svg {
  stroke: currentColor !important;
}

