/* ============================================================
 * 问师傅 · 对话页样式（v2 · 侧栏 + 产品级 AI 功能 + 深色模式）
 * ============================================================ */

/* === 主题颜色变量 === */
:root {
  --ask-bg: #F8F6F0;
  --ask-sidebar-bg: #F0EAD8;
  --ask-card: #ffffff;
  --ask-border: rgba(0,0,0,0.08);
  --ask-border-strong: rgba(0,0,0,0.12);
  --ask-text: #1A1A2E;
  --ask-text-mute: #5C544A;
  --ask-text-soft: #888;
  --ask-bubble-ai: #ffffff;
  --ask-bubble-user: #1661AB;
  --ask-bubble-user-text: #ffffff;
  --ask-trace-bg: rgba(0,0,0,0.025);
  --ask-trace-border: rgba(0,0,0,0.06);
  --ask-refs-bg: linear-gradient(135deg, #FAF7EE 0%, #F5EFDC 100%);
  --ask-refs-border: rgba(200, 155, 64, 0.18);
  --ask-input-bg: #ffffff;
  --ask-hover: rgba(0,0,0,0.04);
  --ask-toggle-icon-light: inline-block;
  --ask-toggle-icon-dark: none;
}

[data-theme="dark"] {
  --ask-bg: #0F1115;
  --ask-sidebar-bg: #15181E;
  --ask-card: #1B1F26;
  --ask-border: rgba(255,255,255,0.08);
  --ask-border-strong: rgba(255,255,255,0.14);
  --ask-text: #EDE8DC;
  --ask-text-mute: #B5AFA0;
  --ask-text-soft: #80796D;
  --ask-bubble-ai: #1B1F26;
  --ask-bubble-user: #2A6FB5;
  --ask-bubble-user-text: #ffffff;
  --ask-trace-bg: rgba(255,255,255,0.04);
  --ask-trace-border: rgba(255,255,255,0.08);
  --ask-refs-bg: linear-gradient(135deg, #1F1B12 0%, #261F12 100%);
  --ask-refs-border: rgba(200, 155, 64, 0.25);
  --ask-input-bg: #1B1F26;
  --ask-hover: rgba(255,255,255,0.06);
  --ask-toggle-icon-light: none;
  --ask-toggle-icon-dark: inline-block;
}

/* 主题切换图标默认显示控制 */
.ask-theme-icon-light { display: var(--ask-toggle-icon-light); }
.ask-theme-icon-dark { display: var(--ask-toggle-icon-dark); }
.nav-theme-btn .nav-theme-icon-light { display: var(--ask-toggle-icon-light); }
.nav-theme-btn .nav-theme-icon-dark { display: var(--ask-toggle-icon-dark); }

.ask-page {
  background: var(--ask-bg);
  color: var(--ask-text);
  min-height: 100vh;
  font-family: 'Source Han Serif SC', 'Noto Serif SC', serif;
  margin: 0;
  height: 100vh;
  overflow: hidden;
  transition: background 0.25s ease;
}

/* 强制隐藏全站公共组件（对话页保持独立工作区） */
.ask-page > .demo-banner,
.ask-page > .navbar,
.ask-page > .footer { display: none !important; }

/* ============== 三栏布局壳子 ============== */
.ask-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
}

.ask-sidebar {
  background: #F0EAD8;
  border-right: 1px solid rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ask-sidebar-head {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.ask-sidebar-back {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.05);
  color: #1A1A2E;
  border-radius: 50%;
  text-decoration: none;
  font-size: 22px; line-height: 1;
  font-weight: 600;
  flex-shrink: 0;
  transition: all 0.15s;
}
.ask-sidebar-back:hover { background: rgba(0,0,0,0.1); transform: translateX(-2px); }

.ask-new-chat-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  background: #1A1A2E;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.ask-new-chat-btn:hover {
  background: #1661AB;
  transform: translateY(-1px);
}

.ask-sidebar-section {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}
.ask-sidebar-section-title {
  padding: 8px 10px;
  font-size: 11px;
  color: #888;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.ask-conv-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ask-conv-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  color: #2A2A2A;
  cursor: pointer;
  transition: all 0.12s;
  position: relative;
}
.ask-conv-item:hover { background: rgba(0,0,0,0.04); }
.ask-conv-item.is-current {
  background: rgba(22, 97, 171, 0.08);
  color: #1661AB;
  font-weight: 600;
}
.ask-conv-meta {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ask-conv-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ask-conv-mode {
  flex-shrink: 0;
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  background: rgba(0,0,0,0.06);
  color: #666;
}
.ask-conv-mode-long { background: rgba(22, 97, 171, 0.12); color: #1661AB; }
.ask-conv-mode-short { background: rgba(200, 155, 64, 0.15); color: #A07725; }
.ask-conv-mode-couple { background: rgba(46, 125, 95, 0.12); color: #2E7D5F; }
[data-theme="dark"] .ask-conv-mode-long { background: rgba(125,183,229,0.15); color: #7DB7E5; }
[data-theme="dark"] .ask-conv-mode-short { background: rgba(229,193,106,0.15); color: #E5C16A; }
[data-theme="dark"] .ask-conv-mode-couple { background: rgba(102,201,160,0.15); color: #66C9A0; }
.ask-conv-del {
  width: 22px; height: 22px;
  border: none;
  background: transparent;
  color: #999;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.12s;
  flex-shrink: 0;
  font-family: inherit;
}
.ask-conv-item:hover .ask-conv-del { opacity: 1; }
.ask-conv-del:hover { background: rgba(200, 71, 58, 0.12); color: #C8473A; }

.ask-conv-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 12px;
  color: #888;
  line-height: 1.7;
}

.ask-sidebar-foot {
  padding: 12px 16px;
  border-top: 1px solid rgba(0,0,0,0.05);
}
.ask-foot-tip {
  font-size: 10.5px;
  color: #aaa;
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.5;
}

/* 移动端遮罩 */
.ask-sidebar-mask {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 49;
}

/* ============== 主区 ============== */
.ask-main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ============== 顶栏 ============== */
.ask-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.ask-sidebar-toggle {
  display: none;
  width: 36px; height: 36px;
  border: none;
  background: transparent;
  color: #1A1A2E;
  cursor: pointer;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
}
.ask-sidebar-toggle:hover { background: rgba(0,0,0,0.05); }

.ask-topbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ask-avatar-mini {
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ask-avatar-mini svg,
.ask-avatar-mini img {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
}
.ask-topbar-text { min-width: 0; }
.ask-topbar-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  font-weight: 700;
  color: #1A1A2E;
  letter-spacing: 1px;
  line-height: 1.2;
}
.ask-topbar-status {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ask-online-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4CAF50;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
  animation: askPulse 2s ease-in-out infinite;
}
@keyframes askPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.ask-topbar-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.ask-tool-btn {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ask-tool-btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  justify-content: center;
}
.ask-tool-btn:hover {
  background: rgba(0,0,0,0.05);
  color: #1A1A2E;
}

/* ============== 对话区 ============== */
.ask-chat {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px 32px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* 欢迎卡 */
.ask-welcome {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 16px 24px;
  text-align: center;
}
.ask-welcome-avatar {
  width: 130px; height: 130px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 6px 22px rgba(26, 23, 20, 0.08), 0 2px 5px rgba(26, 23, 20, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.04);
  /* 缩小内边距，让 logo 占据更多比例（白圈变薄）*/
  padding: 10px;
  animation: askFloat 4s ease-in-out infinite;
}
.ask-welcome-avatar svg,
.ask-welcome-avatar img {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
}
@keyframes askFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.ask-welcome-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 700;
  color: #1A1A2E;
  letter-spacing: 3px;
  margin-bottom: 6px;
}
.ask-welcome-sub {
  font-size: 13px;
  color: #C89B40;
  letter-spacing: 2px;
  margin-bottom: 18px;
}
.ask-welcome-text {
  font-size: 14px;
  color: #555;
  line-height: 1.9;
  max-width: 380px;
  margin: 0 auto 32px;
}

.ask-suggest { margin-top: 8px; }
.ask-suggest-label {
  font-size: 11px;
  color: #999;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.ask-suggest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.ask-chip {
  padding: 9px 16px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 999px;
  font-size: 13px;
  color: #444;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.ask-chip:hover {
  background: #1661AB;
  color: #fff;
  border-color: #1661AB;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(22, 97, 171, 0.2);
}

/* ============== 消息气泡 ============== */
.ask-msg {
  max-width: 720px;
  margin: 0 auto 18px;
  display: flex;
  gap: 10px;
  animation: askMsgIn 0.25s ease-out;
}
@keyframes askMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.ask-msg-avatar {
  width: 38px; height: 38px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ask-msg-avatar svg,
.ask-msg-avatar img {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
}

.ask-msg-body {
  display: flex;
  flex-direction: column;
  max-width: calc(100% - 60px);
  min-width: 0;
}
.ask-msg-name {
  font-size: 11px;
  color: #888;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

/* "本回答基于" 命主信息条 */
.ask-based-on {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
  padding: 4px 9px;
  background: #F4F0E6;
  border: 1px solid #E5DDC8;
  border-radius: 999px;
  font-size: 11px;
  color: #6B5F3E;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ask-based-on svg { flex-shrink: 0; opacity: 0.65; }
.ask-based-on-name { font-weight: 600; color: #1F6FEB; }
.ask-based-on-sep { color: #B5AC8E; margin: 0 2px; }
.ask-based-on-pillars { color: #4a4030; }
.ask-based-on-dayun {
  color: #C8473A;
  font-weight: 600;
}

[data-theme="dark"] .ask-based-on {
  background: #2a2a2a;
  border-color: #3a3a3a;
  color: #c0b89c;
}
[data-theme="dark"] .ask-based-on-name { color: #6BA4FF; }
[data-theme="dark"] .ask-based-on-pillars { color: #d6cdb4; }
[data-theme="dark"] .ask-based-on-sep { color: #5a5547; }
[data-theme="dark"] .ask-based-on-dayun { color: #FF8E84; }

.ask-msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.85;
  color: #2A2A2A;
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* AI 气泡 */
.ask-msg-ai .ask-msg-bubble {
  background: #fff;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* 用户气泡 */
.ask-msg-user { flex-direction: row-reverse; }
.ask-msg-user .ask-msg-body { align-items: flex-end; }
.ask-msg-user .ask-msg-bubble {
  background: #1661AB;
  color: #fff;
  border-top-right-radius: 4px;
  box-shadow: 0 2px 6px rgba(22, 97, 171, 0.25);
}
.ask-msg-user .ask-msg-avatar {
  background: linear-gradient(135deg, #C89B40 0%, #A07725 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 700;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(160, 119, 37, 0.22);
}

/* 消息工具栏（hover 显示）*/
.ask-msg-actions {
  margin-top: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.18s;
}
.ask-msg:hover .ask-msg-actions { opacity: 1; }
.ask-msg-action {
  padding: 4px 8px;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  font-size: 11px;
  color: #777;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.12s;
}
.ask-msg-action:hover {
  border-color: #1A1A2E;
  background: #1A1A2E;
  color: #fff;
}
.ask-msg-action.is-success {
  background: #4CAF50;
  border-color: #4CAF50;
  color: #fff;
}

/* 打字中 + 思考过程提示 */
.ask-typing-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ask-typing-tip {
  font-size: 13px;
  color: #888;
  letter-spacing: 0.5px;
  font-family: inherit;
}
.ask-typing-shimmer {
  background: linear-gradient(90deg, #888 0%, #888 40%, #1661AB 50%, #888 60%, #888 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: askShimmer 1.6s linear infinite;
}
@keyframes askShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.ask-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
}
.ask-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #1661AB;
  opacity: 0.4;
  animation: askDot 1.4s ease-in-out infinite;
}
.ask-typing span:nth-child(2) { animation-delay: 0.15s; }
.ask-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes askDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* === 思考过程展开 === */
.ask-trace {
  margin-bottom: 10px;
  background: rgba(0,0,0,0.025);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  font-family: inherit;
}
.ask-trace summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 12.5px;
  color: #555;
  letter-spacing: 0.5px;
  user-select: none;
  border-radius: 12px;
  transition: background 0.12s;
}
.ask-trace summary:hover { background: rgba(0,0,0,0.03); }
.ask-trace summary::-webkit-details-marker { display: none; }
.ask-trace-mode {
  margin-left: 4px;
  padding: 1px 8px;
  background: rgba(22, 97, 171, 0.1);
  color: #1661AB;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.ask-trace-caret {
  margin-left: auto;
  color: #999;
  transition: transform 0.18s;
}
.ask-trace[open] .ask-trace-caret { transform: rotate(180deg); }
.ask-trace-list {
  list-style: none;
  margin: 0;
  padding: 4px 14px 12px;
  border-top: 1px dashed rgba(0,0,0,0.08);
}
.ask-trace-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: 12.5px;
  color: #5C544A;
}
.ask-trace-num {
  flex-shrink: 0;
  font-family: 'Inter', monospace, sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  color: #C89B40;
  letter-spacing: 1px;
  line-height: 1.7;
  min-width: 22px;
}
.ask-trace-text { flex: 1; line-height: 1.7; }

/* === 古籍引用 === */
.ask-refs {
  margin-top: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #FAF7EE 0%, #F5EFDC 100%);
  border-radius: 10px;
  border: 1px solid rgba(200, 155, 64, 0.18);
}
.ask-refs-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #A07725;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-bottom: 6px;
}
.ask-refs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.ask-ref-item {
  font-size: 12px;
  color: #5C544A;
  letter-spacing: 0.5px;
  font-family: 'Noto Serif SC', serif;
}
.ask-ref-item strong {
  color: #1A1714;
  font-weight: 700;
}

/* Markdown 富文本 */
.ask-msg-bubble strong { color: #1661AB; font-weight: 700; }
.ask-msg-bubble em { color: #C89B40; font-style: normal; }
.ask-msg-bubble blockquote {
  margin: 8px 0;
  padding: 6px 14px;
  border-left: 2px solid #C89B40;
  background: #FAF7EE;
  border-radius: 0 6px 6px 0;
  color: #555;
  font-size: 13.5px;
}
.ask-msg-bubble p { margin: 0 0 8px; }
.ask-msg-bubble p:last-child { margin-bottom: 0; }
.ask-msg-bubble ul,
.ask-msg-bubble ol {
  margin: 8px 0;
  padding-left: 22px;
}
.ask-msg-bubble li { margin: 3px 0; }
.ask-msg-bubble code {
  background: rgba(0,0,0,0.05);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-size: 13px;
  color: #C8473A;
}

/* 上下文卡 */
.ask-context-card {
  max-width: 720px;
  margin: 0 auto 18px;
  padding: 12px 14px;
  background: #FAF7EE;
  border: 1px dashed #E5DCC0;
  border-radius: 10px;
  font-size: 12.5px;
  color: #806530;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ask-context-card .ico {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #C89B40;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

/* ============== 输入框 ============== */
.ask-inputbar {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0,0,0,0.05);
}
.ask-input-wrap {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 18px;
  padding: 12px 14px 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.ask-input-wrap:focus-within {
  border-color: #1661AB;
  box-shadow: 0 0 0 3px rgba(22, 97, 171, 0.08);
}
.ask-input {
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.65;
  color: #2A2A2A;
  max-height: 180px;
  min-height: 26px;
  padding: 2px 0 10px;
  width: 100%;
}
.ask-input::placeholder { color: #b0b0b0; }

/* 输入框底栏：发送按钮（已删除左侧工具按钮 · 朱玉婷 2026-06-28 简化） */
.ask-input-bottombar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid rgba(0,0,0,0.05);
  padding-top: 8px;
}
.ask-input-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ask-input-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  height: 28px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 999px;
  background: rgba(0,0,0,0.02);
  cursor: pointer;
  color: #5C544A;
  font-size: 12px;
  font-family: inherit;
  letter-spacing: 0.5px;
  transition: all 0.15s;
}
.ask-input-tool:hover {
  background: rgba(22, 97, 171, 0.06);
  color: #1661AB;
  border-color: rgba(22, 97, 171, 0.2);
}
.ask-input-tool.is-active {
  background: rgba(22, 97, 171, 0.08);
  color: #1661AB;
  border-color: rgba(22, 97, 171, 0.25);
}
.ask-input-tool-current {
  font-weight: 600;
  max-width: 60px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ask-input-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ask-send-btn {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border: none;
  border-radius: 50%;
  background: #1A1714;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
}
.ask-send-btn:hover:not(:disabled) {
  background: #1661AB;
  transform: scale(1.05);
}
.ask-send-btn:disabled {
  background: rgba(0,0,0,0.15);
  cursor: not-allowed;
}
.ask-send-icon { display: block; }
.ask-stop-icon { display: none; }
.ask-send-btn.is-loading {
  background: #C8473A;
  cursor: pointer;
}
.ask-send-btn.is-loading .ask-send-icon { display: none; }
.ask-send-btn.is-loading .ask-stop-icon { display: block; }

.ask-input-tip {
  max-width: 760px;
  margin: 8px auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  color: #999;
  padding: 0 6px;
  text-align: center;
}
.ask-input-count {
  font-size: 11px;
  color: #aaa;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.5px;
}

/* ============== 移动端适配 ============== */
@media (max-width: 880px) {
  .ask-shell { grid-template-columns: 1fr; }
  .ask-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.32,.72,.32,1);
  }
  .ask-shell.sidebar-open .ask-sidebar { transform: translateX(0); }
  .ask-shell.sidebar-open .ask-sidebar-mask { display: block; }
  .ask-sidebar-toggle { display: inline-flex; }
}

@media (max-width: 720px) {
  .ask-topbar { padding: 10px 12px; }
  .ask-topbar-name { font-size: 14px; }
  .ask-topbar-status { font-size: 10px; }
  .ask-avatar-mini { width: 36px; height: 36px; }
  .ask-tool-btn-icon { width: 30px; height: 30px; }

  .ask-chat { padding: 18px 12px 20px; }
  .ask-welcome { padding: 20px 12px; }
  .ask-welcome-avatar { width: 104px; height: 104px; padding: 8px; }
  .ask-welcome-avatar.ask-welcome-avatar-wxb { width: 110px; height: 110px; }
  .ask-welcome-name { font-size: 19px; }
  .ask-welcome-text { font-size: 13px; }

  .ask-msg { gap: 8px; }
  .ask-msg-avatar { width: 34px; height: 34px; }
  .ask-msg-bubble { font-size: 14px; padding: 10px 14px; }
  .ask-msg-actions { opacity: 1; }

  .ask-chip { font-size: 12px; padding: 8px 14px; }

  .ask-inputbar { padding: 10px 12px 14px; }
  .ask-input-wrap { padding: 10px 12px 8px; border-radius: 14px; }
  .ask-input { font-size: 14px; }
  .ask-send-btn { width: 34px; height: 34px; }
  .ask-input-tool { padding: 4px 8px; font-size: 11.5px; height: 26px; }
  .ask-input-tool span:not(.ask-input-tool-current) { display: none; }
  .ask-input-tool-current { max-width: 50px; font-size: 11.5px; }
}

/* 顶栏中央留白 */
.ask-topbar-spacer { flex: 1; min-width: 0; }

/* ============================================================
 * 命主切换下拉（顶栏右侧）
 * ============================================================ */
.ask-profile-switch {
  position: relative;
  flex-shrink: 0;
  display: flex;
  margin-left: 6px;
}
.ask-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  background: rgba(0,0,0,0.03);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  max-width: 320px;
}
.ask-profile-btn:hover {
  background: rgba(22, 97, 171, 0.06);
  border-color: rgba(22, 97, 171, 0.15);
}
.ask-profile-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1661AB 0%, #0E4A82 100%);
  color: #fff;
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(22, 97, 171, 0.25);
}
.ask-profile-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.25;
}
.ask-profile-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #1A1A2E;
  letter-spacing: 0.5px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ask-profile-birth {
  font-size: 11.5px;
  color: #888;
  letter-spacing: 0.5px;
  font-family: 'Inter', sans-serif;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ask-profile-caret {
  color: #888;
  flex-shrink: 0;
  transition: transform 0.18s;
}
.ask-profile-switch.is-open .ask-profile-caret {
  transform: rotate(180deg);
}

.ask-profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  transform: translateY(-6px);
  width: 320px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
  padding: 8px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.18s;
  z-index: 50;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ask-profile-switch.is-open .ask-profile-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.ask-profile-menu-head {
  font-size: 11.5px;
  color: #888;
  letter-spacing: 2px;
  padding: 8px 12px 6px;
  font-weight: 600;
}
.ask-profile-menu-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  max-height: 320px;
}
.ask-profile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
  color: inherit;
  background: transparent;
  border: none;
  font-family: inherit;
  text-align: left;
  width: 100%;
}
.ask-profile-menu-item:hover {
  background: rgba(0,0,0,0.04);
}
.ask-profile-menu-item.is-current {
  background: rgba(22, 97, 171, 0.08);
}
.ask-profile-menu-item-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1661AB 0%, #0E4A82 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: 'Noto Serif SC', serif;
}
.ask-profile-menu-item-body {
  flex: 1;
  min-width: 0;
}
.ask-profile-menu-item-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1A1A2E;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ask-profile-menu-item-meta {
  font-size: 11.5px;
  color: #888;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.5px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ask-profile-menu-item-tag {
  flex-shrink: 0;
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(22, 97, 171, 0.08);
  color: #1661AB;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.ask-profile-menu-item-edit {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #999;
  text-decoration: none;
  transition: all 0.12s;
  margin-left: 2px;
}
.ask-profile-menu-item-edit:hover {
  background: rgba(22, 97, 171, 0.1);
  color: #1661AB;
}
[data-theme="dark"] .ask-profile-menu-item-edit { color: #80796D; }
[data-theme="dark"] .ask-profile-menu-item-edit:hover { background: rgba(125,183,229,0.12); color: #7DB7E5; }
/* 让 div 容器看起来像按钮（不带原生 button 的灰背景）*/
.ask-profile-menu-item { cursor: pointer; }
.ask-profile-menu-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  padding: 9px 12px;
  border-top: 1px dashed rgba(0,0,0,0.08);
  text-decoration: none;
  color: #1661AB;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-radius: 10px;
  transition: background 0.12s;
}
.ask-profile-menu-add:hover {
  background: rgba(22, 97, 171, 0.06);
}

/* 普师傅状态徽章（右上）*/
.ask-master-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 10px;
  background: rgba(22, 97, 171, 0.08);
  color: #1661AB;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.ask-master-name { font-family: 'Noto Serif SC', serif; }

/* ============================================================
 * 三种问法模式胶囊
 * ============================================================ */
.ask-modes {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 32px;
  flex-wrap: wrap;
  max-width: 540px;
}
.ask-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  color: #2A2A2A;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.5px;
}
.ask-mode em {
  font-style: normal;
  font-size: 11px;
  color: #999;
  letter-spacing: 0.5px;
  margin-left: 2px;
}
.ask-mode:hover {
  border-color: #1661AB;
  color: #1661AB;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(22, 97, 171, 0.1);
}
.ask-mode:hover em { color: #1661AB; opacity: 0.7; }
.ask-mode.is-active {
  background: #1A1714;
  color: #fff;
  border-color: #1A1714;
}
.ask-mode.is-active em { color: rgba(255,255,255,0.7); }

@media (max-width: 560px) {
  .ask-profile-name { font-size: 12.5px; max-width: 110px; }
  .ask-profile-birth { font-size: 10.5px; max-width: 110px; }
  .ask-profile-btn { padding: 4px 10px 4px 6px; gap: 7px; }
  .ask-profile-avatar { width: 26px; height: 26px; font-size: 11px; }
  .ask-master-badge .ask-master-name { display: none; }
  .ask-master-badge { padding: 5px 8px; }
  .ask-modes { gap: 6px; margin-bottom: 26px; }
  .ask-mode { padding: 7px 12px; font-size: 12px; }
  .ask-mode em { display: none; }
  .ask-profile-menu { width: 92vw; }
}

/* ============================================================
 * 命盘初始化卡片（欢迎屏）
 * ============================================================ */
.ask-bazi-card {
  margin: 0 auto 28px;
  max-width: 460px;
  background: linear-gradient(135deg, #FAF7EE 0%, #F5EFDC 100%);
  border: 1px solid rgba(200, 155, 64, 0.22);
  border-radius: 16px;
  padding: 18px 20px 14px;
  text-align: left;
  box-shadow: 0 4px 16px rgba(160, 119, 37, 0.06);
}
.ask-bazi-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.ask-bazi-pillar {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  font-family: 'Noto Serif SC', serif;
  position: relative;
  transition: all 0.15s;
}
.ask-bazi-pillar.is-day {
  background: linear-gradient(180deg, #FFF8E5 0%, #FFEFC4 100%);
  border-color: rgba(200, 155, 64, 0.4);
  box-shadow: 0 4px 12px rgba(200, 155, 64, 0.18);
  transform: translateY(-2px);
}
.ask-bazi-pillar.is-day::after {
  content: '本';
  position: absolute;
  top: -7px; right: -7px;
  width: 18px; height: 18px;
  background: #C89B40;
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.ask-bazi-pillar.is-unknown { opacity: 0.45; }
.ask-bazi-pillar-label {
  font-size: 10.5px;
  color: #999;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}
.ask-bazi-pillar-gan,
.ask-bazi-pillar-zhi {
  font-size: 19px;
  font-weight: 700;
  color: #1A1714;
  line-height: 1.2;
}
.ask-bazi-pillar-zhi { color: #5C544A; font-size: 17px; margin-top: 2px; }
/* 五行配色：天干 & 地支 各自按自己的五行染色（data-wx 由 JS 注入） */
.ask-bazi-pillar-gan[data-wx="木"], .ask-bazi-pillar-zhi[data-wx="木"] { color: #2E7D5F; }
.ask-bazi-pillar-gan[data-wx="火"], .ask-bazi-pillar-zhi[data-wx="火"] { color: #C8473A; }
.ask-bazi-pillar-gan[data-wx="土"], .ask-bazi-pillar-zhi[data-wx="土"] { color: #A0612E; }  /* 土 → 赭石褐（与金 #D4A017 拉开差距） */
.ask-bazi-pillar-gan[data-wx="金"], .ask-bazi-pillar-zhi[data-wx="金"] { color: #D4A017; }  /* 金 → 亮金 */
.ask-bazi-pillar-gan[data-wx="水"], .ask-bazi-pillar-zhi[data-wx="水"] { color: #1661AB; }
/* 兼容旧选择器 */
.ask-bazi-pillar[data-wuxing="木"] .ask-bazi-pillar-gan:not([data-wx]) { color: #2E7D5F; }
.ask-bazi-pillar[data-wuxing="火"] .ask-bazi-pillar-gan:not([data-wx]) { color: #C8473A; }
.ask-bazi-pillar[data-wuxing="土"] .ask-bazi-pillar-gan:not([data-wx]) { color: #A0612E; }  /* 土 → 赭石褐 */
.ask-bazi-pillar[data-wuxing="金"] .ask-bazi-pillar-gan:not([data-wx]) { color: #D4A017; }  /* 金 → 亮金 */
.ask-bazi-pillar[data-wuxing="水"] .ask-bazi-pillar-gan:not([data-wx]) { color: #1661AB; }

.ask-bazi-card-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px dashed rgba(200, 155, 64, 0.3);
  font-size: 12.5px;
  color: #A07725;
  letter-spacing: 0.5px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
}

[data-theme="dark"] .ask-bazi-card { background: linear-gradient(135deg, #1F1B12 0%, #261F12 100%); border-color: rgba(200, 155, 64, 0.3); }
[data-theme="dark"] .ask-bazi-pillar { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .ask-bazi-pillar.is-day { background: linear-gradient(180deg, #2A220F 0%, #3A2D14 100%); border-color: rgba(200, 155, 64, 0.5); }
[data-theme="dark"] .ask-bazi-pillar-gan { color: #EDE8DC; }
[data-theme="dark"] .ask-bazi-pillar-zhi { color: #B5AFA0; }
[data-theme="dark"] .ask-bazi-pillar-label { color: #80796D; }
[data-theme="dark"] .ask-bazi-card-status { color: #E5C16A; border-top-color: rgba(200, 155, 64, 0.3); }
[data-theme="dark"] .ask-bazi-pillar-gan[data-wx="木"], [data-theme="dark"] .ask-bazi-pillar-zhi[data-wx="木"] { color: #66C9A0; }
[data-theme="dark"] .ask-bazi-pillar-gan[data-wx="火"], [data-theme="dark"] .ask-bazi-pillar-zhi[data-wx="火"] { color: #FF8B7A; }
[data-theme="dark"] .ask-bazi-pillar-gan[data-wx="土"], [data-theme="dark"] .ask-bazi-pillar-zhi[data-wx="土"] { color: #E5B670; }
[data-theme="dark"] .ask-bazi-pillar-gan[data-wx="金"], [data-theme="dark"] .ask-bazi-pillar-zhi[data-wx="金"] { color: #F0D87A; }
[data-theme="dark"] .ask-bazi-pillar-gan[data-wx="水"], [data-theme="dark"] .ask-bazi-pillar-zhi[data-wx="水"] { color: #7DB7E5; }
/* 兼容旧选择器（仅天干无 data-wx 时回退）*/
[data-theme="dark"] .ask-bazi-pillar[data-wuxing="木"] .ask-bazi-pillar-gan:not([data-wx]) { color: #66C9A0; }
[data-theme="dark"] .ask-bazi-pillar[data-wuxing="火"] .ask-bazi-pillar-gan:not([data-wx]) { color: #FF8B7A; }
[data-theme="dark"] .ask-bazi-pillar[data-wuxing="土"] .ask-bazi-pillar-gan:not([data-wx]) { color: #E5B670; }
[data-theme="dark"] .ask-bazi-pillar[data-wuxing="金"] .ask-bazi-pillar-gan:not([data-wx]) { color: #F0D87A; }
[data-theme="dark"] .ask-bazi-pillar[data-wuxing="水"] .ask-bazi-pillar-gan:not([data-wx]) { color: #7DB7E5; }

@media (max-width: 560px) {
  .ask-bazi-card { padding: 14px 14px 10px; max-width: 100%; }
  .ask-bazi-card-grid { gap: 6px; }
  .ask-bazi-pillar { padding: 8px 4px; }
  .ask-bazi-pillar-gan { font-size: 17px; }
  .ask-bazi-pillar-zhi { font-size: 15px; }
  .ask-bazi-card-status { font-size: 11.5px; }
}

/* ============== Toast 提示 ============== */
.ask-toast {
  position: fixed;
  top: 80px; left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: rgba(26, 23, 20, 0.94);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 13.5px;
  letter-spacing: 0.5px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: all 0.22s cubic-bezier(.32,.72,.32,1);
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
  font-family: 'Noto Serif SC', serif;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ask-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
 * 深色模式覆写
 * ============================================================ */
[data-theme="dark"] .ask-page { background: var(--ask-bg); color: var(--ask-text); }
[data-theme="dark"] .ask-sidebar { background: var(--ask-sidebar-bg); border-right-color: var(--ask-border); }
[data-theme="dark"] .ask-sidebar-section-title { color: var(--ask-text-soft); }
[data-theme="dark"] .ask-conv-item { color: var(--ask-text); }
[data-theme="dark"] .ask-conv-item:hover { background: var(--ask-hover); }
[data-theme="dark"] .ask-conv-item.is-current { background: rgba(74, 159, 232, 0.15); color: #7DB7E5; }
[data-theme="dark"] .ask-new-conv-btn { background: rgba(255,255,255,0.06); color: var(--ask-text); border-color: var(--ask-border); }
[data-theme="dark"] .ask-new-conv-btn:hover { background: rgba(255,255,255,0.1); }
[data-theme="dark"] .ask-sidebar-back { color: var(--ask-text-mute); }
[data-theme="dark"] .ask-sidebar-back:hover { background: var(--ask-hover); }
[data-theme="dark"] .ask-sidebar-foot { color: var(--ask-text-soft); border-top-color: var(--ask-border); }

[data-theme="dark"] .ask-topbar { background: rgba(15,17,21,0.85); border-bottom-color: var(--ask-border); }
[data-theme="dark"] .ask-topbar-name { color: var(--ask-text); }
[data-theme="dark"] .ask-topbar-status { color: var(--ask-text-soft); }
[data-theme="dark"] .ask-tool-btn { color: var(--ask-text-mute); }
[data-theme="dark"] .ask-tool-btn:hover { background: var(--ask-hover); color: var(--ask-text); }
[data-theme="dark"] .ask-sidebar-toggle { color: var(--ask-text-mute); }
[data-theme="dark"] .ask-sidebar-toggle:hover { background: var(--ask-hover); }

[data-theme="dark"] .ask-profile-btn { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .ask-profile-btn:hover { background: rgba(74,159,232,0.12); border-color: rgba(74,159,232,0.25); }
[data-theme="dark"] .ask-profile-name { color: var(--ask-text); }
[data-theme="dark"] .ask-profile-birth { color: var(--ask-text-soft); }
[data-theme="dark"] .ask-profile-menu { background: var(--ask-card); border-color: var(--ask-border-strong); box-shadow: 0 12px 32px rgba(0,0,0,0.5); }
[data-theme="dark"] .ask-profile-menu-head { color: var(--ask-text-soft); }
[data-theme="dark"] .ask-profile-menu-item { color: var(--ask-text); }
[data-theme="dark"] .ask-profile-menu-item:hover { background: var(--ask-hover); }
[data-theme="dark"] .ask-profile-menu-item-name { color: var(--ask-text); }
[data-theme="dark"] .ask-profile-menu-item-meta { color: var(--ask-text-soft); }
[data-theme="dark"] .ask-profile-menu-item.is-current { background: rgba(74,159,232,0.15); }
[data-theme="dark"] .ask-profile-menu-add { color: #7DB7E5; border-top-color: var(--ask-border); }
[data-theme="dark"] .ask-profile-menu-add:hover { background: rgba(74,159,232,0.1); }

[data-theme="dark"] .ask-master-badge { background: rgba(74,159,232,0.15); color: #7DB7E5; }

[data-theme="dark"] .ask-welcome-name { color: var(--ask-text); }
[data-theme="dark"] .ask-welcome-sub { color: var(--ask-text-soft); }
[data-theme="dark"] .ask-welcome-text { color: var(--ask-text-mute); }
[data-theme="dark"] .ask-welcome-avatar img { filter: invert(1); }
[data-theme="dark"] .ask-suggest-label { color: var(--ask-text-soft); }
[data-theme="dark"] .ask-chip { background: rgba(255,255,255,0.04); color: var(--ask-text); border-color: var(--ask-border); }
[data-theme="dark"] .ask-chip:hover { background: rgba(74,159,232,0.12); border-color: rgba(74,159,232,0.3); color: #7DB7E5; }
[data-theme="dark"] .ask-mode { background: var(--ask-card); border-color: var(--ask-border-strong); color: var(--ask-text); }
[data-theme="dark"] .ask-mode em { color: var(--ask-text-soft); }
[data-theme="dark"] .ask-mode:hover { border-color: #7DB7E5; color: #7DB7E5; }
[data-theme="dark"] .ask-mode.is-active { background: #7DB7E5; color: #0F1115; border-color: #7DB7E5; }
[data-theme="dark"] .ask-mode.is-active em { color: rgba(15,17,21,0.7); }

[data-theme="dark"] .ask-msg-name { color: var(--ask-text-soft); }
[data-theme="dark"] .ask-msg-ai .ask-msg-bubble { background: var(--ask-bubble-ai); color: var(--ask-text); border-color: var(--ask-border); }
[data-theme="dark"] .ask-msg-bubble strong { color: #7DB7E5; }
[data-theme="dark"] .ask-msg-bubble em { color: #E5C16A; }
[data-theme="dark"] .ask-msg-bubble blockquote { background: rgba(200,155,64,0.08); color: var(--ask-text-mute); border-left-color: #C89B40; }
[data-theme="dark"] .ask-msg-bubble code { background: rgba(255,255,255,0.08); color: var(--ask-text); }
[data-theme="dark"] .ask-msg-action { color: var(--ask-text-soft); border-color: var(--ask-border); }
[data-theme="dark"] .ask-msg-action:hover { background: var(--ask-hover); color: var(--ask-text); border-color: var(--ask-border-strong); }

[data-theme="dark"] .ask-trace { background: var(--ask-trace-bg); border-color: var(--ask-trace-border); }
[data-theme="dark"] .ask-trace summary { color: var(--ask-text-mute); }
[data-theme="dark"] .ask-trace summary:hover { background: var(--ask-hover); }
[data-theme="dark"] .ask-trace-list { border-top-color: var(--ask-border); }
[data-theme="dark"] .ask-trace-list li { color: var(--ask-text-mute); }
[data-theme="dark"] .ask-refs { background: var(--ask-refs-bg); border-color: var(--ask-refs-border); }
[data-theme="dark"] .ask-refs-label { color: #E5C16A; }
[data-theme="dark"] .ask-ref-item { color: var(--ask-text-mute); }
[data-theme="dark"] .ask-ref-item strong { color: var(--ask-text); }

[data-theme="dark"] .ask-typing-tip { color: var(--ask-text-soft); }
[data-theme="dark"] .ask-typing-shimmer {
  background: linear-gradient(90deg, #80796D 0%, #80796D 40%, #7DB7E5 50%, #80796D 60%, #80796D 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .ask-inputbar { background: rgba(15,17,21,0.85); border-top-color: var(--ask-border); }
[data-theme="dark"] .ask-input-wrap { background: var(--ask-input-bg); border-color: var(--ask-border-strong); }
[data-theme="dark"] .ask-input-wrap:focus-within { border-color: #7DB7E5; box-shadow: 0 0 0 3px rgba(125,183,229,0.12); }
[data-theme="dark"] .ask-input { color: var(--ask-text); }
[data-theme="dark"] .ask-input::placeholder { color: var(--ask-text-soft); }
[data-theme="dark"] .ask-input-bottombar { border-top-color: var(--ask-border); }
[data-theme="dark"] .ask-input-tool { background: rgba(255,255,255,0.04); color: var(--ask-text-mute); border-color: var(--ask-border); }
[data-theme="dark"] .ask-input-tool:hover { background: rgba(74,159,232,0.12); color: #7DB7E5; border-color: rgba(74,159,232,0.3); }
[data-theme="dark"] .ask-send-btn { background: #7DB7E5; color: #0F1115; }
[data-theme="dark"] .ask-send-btn:hover:not(:disabled) { background: #A5D0F0; }
[data-theme="dark"] .ask-send-btn:disabled { background: rgba(255,255,255,0.1); color: var(--ask-text-soft); }
[data-theme="dark"] .ask-input-tip { color: var(--ask-text-soft); }
[data-theme="dark"] .ask-input-count { color: var(--ask-text-soft); }

[data-theme="dark"] .ask-context-card { background: rgba(255,255,255,0.04); color: var(--ask-text-mute); border-color: var(--ask-border); }

/* 主题切换按钮（顶栏）*/
.ask-tool-btn[data-action="toggle-theme"] { position: relative; }

/* ============================================================
 * 流式输出 · 光标 + 思考面板（实时显示）
 * ============================================================ */
.ask-cursor {
  display: inline-block;
  width: 6px;
  margin-left: 2px;
  color: #C89B40;
  animation: askCursorBlink 1.1s steps(2) infinite;
  vertical-align: text-bottom;
  font-weight: 700;
}
@keyframes askCursorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* 思考过程实时显示面板 */
.ask-trace-live {
  background: rgba(200, 155, 64, 0.06);
  border-color: rgba(200, 155, 64, 0.3);
}
.ask-trace-live summary span:not(.ask-trace-mode) {
  color: #A07725;
}
.ask-trace-live summary svg:first-of-type {
  animation: askThinkingSpin 2s linear infinite;
}
@keyframes askThinkingSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.ask-trace-thinking {
  padding: 12px 14px 10px 36px;
  font-size: 12.5px;
  line-height: 1.75;
  color: #6E6759;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'PingFang SC', 'Hiragino Sans GB', system-ui, sans-serif;
  background: rgba(0,0,0,0.02);
  border-radius: 0 0 8px 8px;
  border-top: 1px dashed rgba(200, 155, 64, 0.25);
  max-height: 280px;
  overflow-y: auto;
}
[data-theme="dark"] .ask-trace-live {
  background: rgba(229, 193, 106, 0.08);
  border-color: rgba(229, 193, 106, 0.25);
}
[data-theme="dark"] .ask-trace-live summary span:not(.ask-trace-mode) { color: #E5C16A; }
[data-theme="dark"] .ask-trace-thinking {
  color: #B5AFA0;
  background: rgba(0,0,0,0.15);
  border-top-color: rgba(229, 193, 106, 0.2);
}

/* ========== 清空菜单（hover/click 下拉） ========== */
.ask-tool-menu-wrap { position: relative; display: inline-flex; }
.ask-tool-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 180px;
  padding: 6px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, rgba(0,0,0,.08));
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.ask-tool-menu.is-open { display: block; }
.ask-tool-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-1, #222);
  text-align: left;
  cursor: pointer;
}
.ask-tool-menu-item:hover { background: rgba(0,0,0,.05); }
.ask-tool-menu-item-danger { color: #c44; }
.ask-tool-menu-item-danger:hover { background: rgba(196,68,68,.08); }
[data-theme="dark"] .ask-tool-menu { background: #1f1f1f; border-color: rgba(255,255,255,.08); }
[data-theme="dark"] .ask-tool-menu-item { color: #ddd; }
[data-theme="dark"] .ask-tool-menu-item:hover { background: rgba(255,255,255,.06); }


/* ==========================================
 * 消息悬浮工具栏（hover 显示，每条独立）
 * 朱玉婷 2026-06-28 改版：简约图标式，参考微信风格
 * ========================================== */
.ask-msg-actions-floating {
  margin-top: 4px;
  display: flex;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 0.16s, transform 0.16s;
}
.ask-msg:hover .ask-msg-actions-floating,
.ask-msg-actions-floating:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* user 消息的工具栏右对齐（气泡靠右）*/
.ask-msg-user .ask-msg-actions-floating {
  justify-content: flex-end;
}

/* 单个图标按钮 */
.ask-msg-action-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #999;
  cursor: pointer;
  transition: all .12s;
}
.ask-msg-action-icon:hover {
  background: rgba(0,0,0,.06);
  color: #444;
}
.ask-msg-action-icon.is-success {
  background: transparent;
  color: #4CAF50;
}
[data-theme="dark"] .ask-msg-action-icon { color: #888; }
[data-theme="dark"] .ask-msg-action-icon:hover {
  background: rgba(255,255,255,.08);
  color: #ccc;
}

/* "更多 ..." 弹出菜单 */
.ask-msg-action-more-wrap {
  position: relative;
  display: inline-flex;
}
.ask-msg-more-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 50;
  min-width: 130px;
  padding: 4px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.ask-msg-more-menu.is-open {
  display: block;
  animation: askMsgMoreIn .14s ease;
}
@keyframes askMsgMoreIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ask-msg-more-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: #444;
  text-align: left;
  cursor: pointer;
}
.ask-msg-more-item:hover { background: rgba(0,0,0,.04); }
.ask-msg-more-item-danger { color: #d34c4c; }
.ask-msg-more-item-danger:hover { background: rgba(211,76,76,.08); }
[data-theme="dark"] .ask-msg-more-menu {
  background: #2a2a2a;
  border-color: rgba(255,255,255,.08);
}
[data-theme="dark"] .ask-msg-more-item { color: #ddd; }
[data-theme="dark"] .ask-msg-more-item:hover { background: rgba(255,255,255,.06); }
[data-theme="dark"] .ask-msg-more-item-danger { color: #ff7878; }
[data-theme="dark"] .ask-msg-more-item-danger:hover { background: rgba(255,120,120,.1); }

/* user 消息的更多菜单右对齐 */
.ask-msg-user .ask-msg-more-menu {
  right: 0;
}

/* 移动端始终显示工具栏（hover 在移动端不可用） */
@media (hover: none) {
  .ask-msg-actions-floating {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}

/* ============================================================
 * 命盘上下文条（发问后保留 · 朱玉婷 2026-06-28 需求）
 * 一行紧凑显示：四柱 + 模式切换
 * ============================================================ */
.ask-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  background: rgba(229, 193, 106, 0.06);
  border-bottom: 1px solid rgba(229, 193, 106, 0.18);
  font-size: 13px;
  color: var(--text-2, #666);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(8px);
}
[data-theme="dark"] .ask-context-bar {
  background: rgba(229, 193, 106, 0.04);
  border-bottom-color: rgba(229, 193, 106, 0.12);
}
.ask-context-bar-pillars {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.ask-context-pillar {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: 'Noto Serif SC', serif;
  font-weight: 600;
  color: var(--text-1, #222);
  font-size: 14px;
  white-space: nowrap;
}
.ask-context-pillar small {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 10.5px;
  font-weight: 400;
  color: #aaa;
  margin-right: 2px;
}
.ask-context-pillar.is-day {
  color: var(--accent-gold, #C89B40);
}
.ask-context-pillar.is-day::after {
  content: '日';
  font-size: 9.5px;
  font-weight: 500;
  color: #fff;
  background: var(--accent-gold, #C89B40);
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
}
.ask-context-bar-sep {
  width: 1px;
  height: 18px;
  background: rgba(0,0,0,.08);
  flex-shrink: 0;
}
[data-theme="dark"] .ask-context-bar-sep { background: rgba(255,255,255,.1); }

.ask-context-bar-modes {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.ask-context-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 16px;
  font-size: 12px;
  color: #999;
  cursor: pointer;
  transition: all .12s;
}
.ask-context-mode:hover {
  background: rgba(0,0,0,.04);
  color: #444;
}
.ask-context-mode.is-active {
  background: #1A1A2E;
  color: #fff;
}
.ask-context-mode.is-active:hover {
  background: #1A1A2E;
}
[data-theme="dark"] .ask-context-mode { color: #888; }
[data-theme="dark"] .ask-context-mode:hover { background: rgba(255,255,255,.06); color: #ccc; }
[data-theme="dark"] .ask-context-mode.is-active { background: var(--accent-gold, #C89B40); color: #1A1A2E; }

/* 命主名字（小标签） */
.ask-context-name {
  font-size: 12px;
  color: #888;
  padding: 2px 8px;
  background: rgba(0,0,0,.04);
  border-radius: 4px;
  flex-shrink: 0;
}
[data-theme="dark"] .ask-context-name { background: rgba(255,255,255,.06); color: #aaa; }

/* 移动端：紧凑显示 */
@media (max-width: 720px) {
  .ask-context-bar { padding: 8px 14px; gap: 10px; }
  .ask-context-bar-pillars { gap: 8px; }
  .ask-context-pillar { font-size: 13px; }
  .ask-context-mode { padding: 4px 8px; font-size: 11px; }
  .ask-context-mode em { display: none; }
}
