
/* 旧右侧 dock 已废弃；移动端 Sheet 不挤压主区，所以该偏移恒为 0。 */
:root {
  --assistant-aside-w: 0px;
}

.assistant-page {
  min-height: 100vh;
  background: var(--paper);
}

.assistant-page [hidden] {
  display: none !important;
}
.assistant-main {
  min-height: calc(100vh - 75px);
  min-height: calc(100svh - 75px);
  background: var(--paper);
}

.assistant-column {
  width: min(100% - 2 * var(--gutter), 820px);
  margin-inline: auto;
}

.assistant-landing {
  min-height: calc(100vh - 75px);
  min-height: calc(100svh - 75px);
  display: grid;
  align-items: start;
  padding: clamp(86px, 15vh, 132px) 0 44px;
  text-align: center;
}

.assistant-kicker {
  display: inline-flex;
  align-items: center;
  margin: 0 0 var(--sp-24);
  color: rgba(15, 74, 67, 0.82);
  font-size: var(--fs-13);
  font-weight: 600;
}

.assistant-kicker__label {
  letter-spacing: 0.08em;
}

.assistant-kicker__label--riva {
  letter-spacing: 0.06em;
}

.assistant-kicker__dot {
  margin: 0 6px;
  font-size: 12px;
  line-height: 1;
  opacity: 0.72;
  transform: translateY(-0.5px);
}

.assistant-kicker__badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 8px;
  padding: 2px 8px;
  color: #3D7286;
  background: #EAF3F8;
  border: 1px solid #C9DDE8;
  border-radius: var(--r-pill);
  font-size: var(--fs-12);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.035em;
}

.assistant-landing h1 {
  margin: 0;
  font-family: var(--font-serif-cn);
  font-size: clamp(31px, 4.2vw, 48px);
  line-height: 1.22;
  letter-spacing: 0.02em;
}

.assistant-lead {
  margin: var(--sp-12) auto 0;
  max-width: 31em;
  color: rgba(64, 61, 56, 0.76);
  font-size: var(--fs-16);
  line-height: 1.68;
}

.assistant-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--sp-10);
  width: 100%;
  min-height: 68px;
  padding: 10px 12px;
  background: #FFFFFF;
  border: 1px solid rgba(188, 178, 161, 0.82);
  border-radius: 30px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03), 0 18px 46px -38px rgba(10, 51, 46, 0.44);
}

/* 多行态：从巨大胶囊改为稳定的圆角矩形，阴影减弱，文字区与按钮区上下分隔（不遮挡）。 */
.assistant-composer--multiline {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: stretch;
  gap: 6px;
  min-height: 0;
  padding: 12px 16px 12px 18px;
  border-radius: 26px;
  box-shadow: 0 6px 20px -16px rgba(10, 51, 46, 0.32);
}

.assistant-composer--multiline:focus-within {
  box-shadow: 0 8px 22px -16px rgba(10, 51, 46, 0.36);
}

.assistant-composer--landing {
  width: min(100%, 760px);
  margin: clamp(38px, 5vh, 48px) auto 0;
}

.assistant-input-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.assistant-composer textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  /* max-height 由 JS 按「整数行」写成内联样式，避免半行；这里不再写死上限。 */
  overflow-y: hidden;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: var(--fs-16);
  line-height: 1.4;
  padding: 9px 10px;
}

.assistant-composer textarea::placeholder {
  color: rgba(82, 78, 72, 0.76);
  opacity: 1;
  transition: opacity 220ms ease;
}

.assistant-composer textarea.assistant-placeholder-fading::placeholder {
  opacity: 0;
}

.assistant-composer textarea:focus {
  outline: none;
  box-shadow: none;
}

/* 注意：下面这条 :focus-within 声明的值与 .assistant-composer 静止态完全相同，
   实测聚焦前后 border-color 与 box-shadow 都不变 —— 也就是说它并没有提供任何焦点反馈。
   textarea 自身又写了 outline: 0 / box-shadow: none，于是对话输入框在键盘聚焦时
   完全不可见。本轮不动这条既有的环境阴影，改为在容器上补一层真 outline（与
   tools-hub 的 .tools-smart__composer:has(textarea:focus-visible) 同一模式）。 */
.assistant-composer:focus-within {
  border-color: rgba(188, 178, 161, 0.82);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03), 0 18px 46px -38px rgba(10, 51, 46, 0.44);
}

.assistant-composer:has(textarea:focus-visible) {
  outline: var(--flusso-focus-ring);
  outline-offset: var(--flusso-focus-offset);
}

.assistant-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

/* 取消录音：轻量 ×。无永久圆形边框、无永久阴影；44px 透明点击区域；
   hover 极浅背景、active 克制按压、仅键盘 focus-visible 显示焦点圈。 */
.assistant-voice-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  color: rgba(64, 61, 56, 0.7);
  background: transparent;
  border: 0;
  border-radius: var(--r-pill);
  box-shadow: none;
  font: inherit;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--t), background var(--t), transform var(--t-fast);
}

/* 纯图标按钮 hover 只提亮图标，不长出底色片 —— 与抽屉里的 ⋯ 同一条规则。 */
@media (hover: hover) and (pointer: fine) {
  .assistant-voice-cancel:hover {
    color: var(--teal-strong);
    background: transparent;
  }
}

/* 取消录音是风险操作，保留一层克制的底色反馈，但不缩放。
   :active 不进 hover media query —— 触屏用户只有它能提供按下反馈。 */
.assistant-voice-cancel:active {
  color: var(--teal-strong);
  background: rgba(15, 74, 67, 0.06);
  transform: none;
}

.assistant-voice-cancel:focus-visible {
  outline: var(--flusso-focus-ring);
  outline-offset: var(--flusso-focus-offset);
}

.assistant-composer--multiline .assistant-actions {
  justify-content: flex-end;
  justify-self: end;
}

.assistant-icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  color: var(--teal);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t-fast);
}

.assistant-icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-icon-button--mic svg {
  transform: translateY(-1px);
}

.assistant-icon-button--mic .voice-stop-i {
  display: none;
  transform: none;
}

.assistant-icon-button--mic.is-active .mic-i,
.assistant-icon-button--mic.is-loading:not(.is-transcribing) .mic-i {
  display: none;
}

.assistant-icon-button--mic.is-active .voice-stop-i {
  display: block;
}

.assistant-icon-button--mic.is-loading::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: assistantVoiceSpin 800ms linear infinite;
}

.assistant-icon-button--mic.is-loading.is-transcribing .voice-stop-i {
  opacity: 0.42;
}

/* 图标按钮 hover：只做颜色与描边变化，不上浮、不缩放、不投影。
   装饰性 hover 只在真鼠标设备生效，避免触屏点按后 hover 粘滞。 */
@media (hover: hover) and (pointer: fine) {
  .assistant-icon-button:hover {
    color: var(--teal-strong);
    border-color: var(--teal);
  }
}

.assistant-icon-button[disabled] {
  cursor: not-allowed;
  color: rgba(111, 106, 98, 0.5);
  border-color: rgba(188, 178, 161, 0.82);
  background: transparent;
  transform: none;
}

.assistant-icon-button--send,
.assistant-icon-button--send[disabled] {
  color: var(--paper-on-dark);
  background: linear-gradient(145deg, var(--teal), var(--teal-strong));
  border-color: rgba(15, 74, 67, 0.9);
  box-shadow: 0 10px 24px -16px rgba(15, 74, 67, 0.82), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.assistant-icon-button--send::before,
.assistant-icon-button--send::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
}

.assistant-icon-button--send::before {
  border: 1px solid rgba(15, 74, 67, 0.28);
  transform: scale(0.72);
}

.assistant-icon-button--send::after {
  inset: 7px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0) 62%);
  transform: scale(0.2);
}

.assistant-icon-button--send svg {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.assistant-icon-button--send .send-up-i {
  display: none;
}

.assistant-icon-button--send .send-i {
  transform: translate(calc(-50% - 1px), calc(-50% + 1px));
  transition: transform 220ms ease, opacity 180ms ease;
}

/* 发送键是主操作，保留深绿实底与 hover 加深；但不再叠加三层大投影，
   box-shadow 不声明即沿用静止态的单层环境阴影，hover 前后不发生明暗跳变。 */
@media (hover: hover) and (pointer: fine) {
  .assistant-icon-button--send:hover:not([disabled]) {
    color: var(--paper-on-dark);
    background: linear-gradient(145deg, #17645A, #0B3E38);
    border-color: var(--teal-strong);
  }

  .assistant-icon-button--send:hover:not([disabled]) .send-i {
    transform: translate(calc(-50% + 2px), calc(-50% - 2px));
  }
}

/* 禁用态不吃任何 hover 强化：hover 时与静止态完全一致。 */
.assistant-icon-button--send[disabled]:hover {
  transform: none;
}

.assistant-icon-button--send.is-sending::before {
  animation: assistantSendRing 520ms cubic-bezier(.2,.8,.2,1);
}

.assistant-icon-button--send.is-sending::after {
  animation: assistantSendFlash 420ms ease-out;
}

.assistant-icon-button--send.is-sending .send-i {
  animation: assistantSendLaunch 520ms cubic-bezier(.2,.8,.2,1);
}

.assistant-icon-button--send .stop-i {
  display: none;
}

.assistant-icon-button--send.is-generating .send-i,
.assistant-icon-button--send.is-generating .send-up-i {
  display: none;
}

.assistant-icon-button--send.is-generating .stop-i {
  display: block;
  animation: assistantStopBreath 1.4s ease-in-out infinite;
}

/* 生成中的停止键：收敛外光晕，只留轻微阴影。 */
.assistant-icon-button--send.is-generating,
.assistant-icon-button--send.is-generating:hover {
  box-shadow: 0 6px 16px -12px rgba(15, 74, 67, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.assistant-icon-button--mic.is-active,
.assistant-is-recording .assistant-icon-button--mic {
  color: var(--paper-on-dark);
  background: #8A3F2E;
  border-color: #8A3F2E;
}

.assistant-composer--voice-active textarea {
  display: none;
}

/* 语音态维持单排 [声波 … × ■] 布局，即使进入前处于多行态。 */
.assistant-composer.assistant-composer--voice-active {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto;
  align-items: center;
  border-radius: 30px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03), 0 18px 46px -38px rgba(10, 51, 46, 0.44);
}

.assistant-composer--voice-recording .assistant-icon-button--send,
.assistant-composer--voice-transcribing .assistant-icon-button--send {
  display: none;
}

/* 停止（= 上传并转写）：录音期间的唯一主操作。清晰方形停止图标，
   约 54px，仅保留轻微阴影，不使用过厚外光晕。 */
.assistant-composer--voice-recording .assistant-icon-button--mic {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  box-shadow: 0 6px 16px -10px rgba(138, 63, 46, 0.5);
}

.assistant-composer--voice-recording .assistant-icon-button--mic .voice-stop-i {
  width: 22px;
  height: 22px;
}

/* 录音舞台：左侧实时声波，右侧交由 .assistant-actions 承载 × 与 ■。 */
.assistant-voice-stage {
  display: none;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 9px 6px 9px 12px;
}

.assistant-composer--voice-recording .assistant-voice-stage,
.assistant-composer--voice-transcribing .assistant-voice-stage {
  display: flex;
}

.assistant-voice-wave {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  overflow: hidden;
}

/* 细柱：品牌深绿，高度随实时振幅（--wave 0–1）平滑变化，不高频闪烁。 */
.assistant-voice-wave i {
  display: block;
  width: 3px;
  flex: 0 0 3px;
  min-height: 4px;
  height: calc(5px + var(--wave, 0.12) * 23px);
  background: rgba(15, 74, 67, 0.36);
  border-radius: var(--r-pill);
  transition: height 130ms ease;
}

/* 转写态：隐藏声波，只显示轻量 loading + 「正在转成文字…」，尺寸与录音态接近。 */
.assistant-composer--voice-transcribing .assistant-voice-wave {
  display: none;
}

.assistant-voice-stage-text {
  display: none;
  align-items: center;
  gap: 8px;
  color: rgba(15, 74, 67, 0.72);
  font-size: var(--fs-14);
  line-height: 1.5;
}

.assistant-composer--voice-transcribing .assistant-voice-stage-text {
  display: inline-flex;
}

.assistant-composer--voice-transcribing .assistant-voice-stage-text::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid rgba(15, 74, 67, 0.28);
  border-right-color: transparent;
  border-radius: 999px;
  animation: assistantVoiceSpin 800ms linear infinite;
}

/* 计时器：默认隐藏（录音态仅靠声波）；仅在无 Web Audio 的退化态显示，弱灰色。 */
.assistant-voice-timer {
  display: none;
  color: rgba(90, 86, 80, 0.5);
  font-size: var(--fs-13);
  font-variant-numeric: tabular-nums;
}

.assistant-composer--voice-fallback .assistant-voice-timer {
  display: inline;
}

/* 退化态：无 analyser 驱动时，用 CSS 让柱条轻微起伏（配合可见计时器）。 */
.assistant-composer--voice-fallback .assistant-voice-wave i {
  animation: assistantWaveFallback 900ms ease-in-out infinite;
}

.assistant-composer--voice-fallback .assistant-voice-wave i:nth-child(2n) { animation-delay: 140ms; }
.assistant-composer--voice-fallback .assistant-voice-wave i:nth-child(3n) { animation-delay: 280ms; }

@keyframes assistantWaveFallback {
  0%, 100% { height: 6px; }
  50% { height: 20px; }
}

/* 屏幕阅读器状态「正在录音，已录制 N 秒」：视觉隐藏、可被读屏读取。 */
.assistant-voice-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.assistant-voice-hint {
  width: min(100%, 760px);
  margin: var(--sp-8) auto 0;
  color: rgba(111, 106, 98, 0.68);
  font-size: var(--fs-14);
  line-height: 1.6;
  text-align: center;
}

.assistant-boundary {
  margin: var(--sp-24) 0 0;
  color: var(--muted);
  font-size: var(--fs-13);
  line-height: 1.6;
}

.assistant-boundary a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(111, 106, 98, 0.42);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.assistant-boundary a:hover {
  color: var(--teal);
  text-decoration-color: rgba(15, 74, 67, 0.48);
}

.assistant-chat-section {
  min-height: 100vh;
  min-height: 100dvh;
  /* 底部留白 = composer 实际高度（JS 经 ResizeObserver 写入的 --assistant-dock-h）+ 间隙，
     composer 长高时消息区可用高度随之缩小，回复永远落在 composer 上方，不会被遮住。 */
  padding: var(--sp-20) 0 calc(var(--assistant-dock-h, 172px) + 28px);
}

.assistant-state-chat .assistant-main {
  min-height: 100vh;
  min-height: 100dvh;
}

.assistant-column--chat {
  transition: opacity 200ms ease, transform 200ms ease;
}

.assistant-conversation-bar {
  position: sticky;
  top: 0;
  z-index: 28;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-14);
  min-height: 64px;
  margin-bottom: clamp(34px, 5vw, 56px);
  padding: var(--sp-8) 0 var(--sp-12);
  background: linear-gradient(180deg, rgba(251, 249, 245, 0.98), rgba(251, 249, 245, 0.88));
  border-bottom: 1px solid rgba(15, 74, 67, 0.1);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
}

.assistant-chat-title {
  min-width: 0;
  color: var(--ink);
  font-size: var(--fs-15);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.assistant-chat-title[contenteditable="true"],
.assistant-ws-heading__title[contenteditable="true"],
.assistant-mobile-bar__title[contenteditable="true"] {
  cursor: text;
  outline: 1px solid rgba(18, 83, 72, 0.35);
  outline-offset: 3px;
}

.assistant-conversation-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  flex: 0 0 auto;
}

.assistant-conversation-actions button {
  color: var(--ink-soft);
  cursor: pointer;
  font-size: var(--fs-14);
}

.assistant-conversation-actions button:hover {
  color: var(--teal);
}

.assistant-thread {
  min-height: 52vh;
}

.assistant-chat-empty {
  min-height: 46vh;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}

.assistant-chat-empty p {
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-18);
}

.assistant-chat-empty span {
  margin-top: var(--sp-8);
  font-size: var(--fs-14-5);
}

.assistant-message {
  margin: 0 0 var(--sp-24);
}

.assistant-message--user {
  display: flex;
  justify-content: flex-end;
}

.assistant-bubble {
  max-width: min(68%, 520px);
  padding: var(--sp-13) var(--sp-16);
  color: var(--ink);
  background: var(--teal-soft);
  border: 1px solid rgba(15, 74, 67, 0.08);
  border-radius: var(--r);
  line-height: 1.72;
}

.assistant-bubble p {
  margin: 0;
}

.assistant-message--assistant {
  max-width: 720px;
}

.assistant-open-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: var(--fs-16);
  line-height: 1.84;
}

.assistant-feedback {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8);
  margin-top: var(--sp-12);
}

.assistant-feedback button{
  min-height: 30px;
  padding: 0 var(--sp-10);
  color: var(--muted);
  border: 1px solid rgba(188, 178, 161, 0.82);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: var(--fs-12);
}

/* .assistant-feedback button:hover 已从本组移出，见下方唯一生效的
   「未选中态 hover 只高亮图标」规则；此处保留其余三类按钮的原有行为。 */

.assistant-card {
  max-width: 680px;
  padding: var(--sp-18);
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid rgba(188, 178, 161, 0.82);
  border-radius: var(--r);
}

.assistant-card h3 {
  margin: 0 0 var(--sp-8);
  font-size: var(--fs-16);
}

.assistant-card p {
  margin: 0;
  line-height: 1.75;
}

.assistant-card ul {
  margin: 0;
  padding-left: 1.2em;
}

.assistant-status,
.assistant-error {
  position: fixed;
  left: 50%;
  bottom: 126px;
  z-index: 34;
  width: min(100% - 2 * var(--gutter), 820px);
  transform: translateX(-50%);
  padding: var(--sp-10) var(--sp-14);
  border-radius: var(--r-sm);
  font-size: var(--fs-13);
  line-height: 1.55;
}

.assistant-status {
  color: var(--teal-strong);
  background: var(--teal-soft);
}

.assistant-error {
  color: #6F2D20;
  background: #F7E8E2;
  border: 1px solid rgba(111, 45, 32, 0.18);
}

.assistant-voice-feedback,
.assistant-voice-error {
  max-width: min(100% - 2 * var(--gutter), 720px);
  width: fit-content;
  margin: 0 auto var(--sp-8);
  padding: 7px 11px;
  border-radius: var(--r-sm);
  font-size: var(--fs-13);
  line-height: 1.45;
  text-align: center;
}

.assistant-voice-feedback {
  color: var(--teal-strong);
  background: var(--teal-soft);
}

.assistant-voice-error {
  color: #6F2D20;
  background: #F7E8E2;
  border: 1px solid rgba(111, 45, 32, 0.18);
}

.assistant-composer-dock {
  position: fixed;
  inset: auto 0 0;
  z-index: 30;
  display: grid;
  justify-items: center;
  padding: 36px var(--gutter) max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(251, 249, 245, 0), rgba(251, 249, 245, 0.94) 28%, var(--paper) 100%);
}

.assistant-composer--chat {
  width: min(100% - 2 * var(--gutter), 820px);
}

.assistant-smallprint {
  width: min(100% - 2 * var(--gutter), 820px);
  margin: var(--sp-8) 0 0;
  color: var(--muted);
  font-size: var(--fs-12);
  line-height: 1.55;
  text-align: center;
}

.assistant-smallprint a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.assistant-backdrop {
  position: fixed;
  inset: 0;
  z-index: 58;
  background: rgba(12, 32, 27, 0.16);
}

.assistant-records {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 60;
  width: min(420px, 100vw);
  overflow-y: auto;
  padding: var(--sp-20);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px -42px rgba(10, 51, 46, 0.42);
}

.assistant-records__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-12);
  margin-bottom: var(--sp-18);
}

.assistant-records__head h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-21);
  font-weight: 600;
}

.assistant-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-8);
  margin-bottom: var(--sp-18);
}

.assistant-tabs button,
.assistant-record-new {
  min-height: 38px;
  padding: 0 var(--sp-10);
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid rgba(188, 178, 161, 0.82);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: var(--fs-13);
}

.assistant-tabs button.is-active,
.assistant-record-new {
  color: var(--paper-on-dark);
  background: var(--teal);
  border-color: var(--teal);
}

/* Search: progressive disclosure — a ghost button that morphs into an input */
.assistant-search {
  display: block;
  margin: 0 0 var(--sp-8);
}

.assistant-summary-row{
  padding: var(--sp-16) 0;
  border-top: 1px solid var(--line);
}

.assistant-summary-row h3{
  margin-bottom: var(--sp-10);
  color: var(--muted);
  font-size: var(--fs-13);
  font-weight: 600;
}

.assistant-summary-row p{
  margin: 0 0 var(--sp-9);
  color: var(--ink-soft);
  line-height: 1.65;
}

.assistant-menu-block {
  display: none;
}

@keyframes assistantPulse {
  0%, 100% { opacity: 0.28; transform: translateY(0); }
  50% { opacity: 0.9; transform: translateY(-2px); }
}

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

@media (min-width: 721px) {
  .assistant-kicker,
  .assistant-landing h1,
  .assistant-lead {
    position: relative;
    top: -24px;
  }
  .assistant-landing {
    position: relative;
    padding-bottom: 132px;
  }

  .assistant-composer--landing {
    margin-top: clamp(66px, 8vh, 78px);
  }

  .assistant-boundary--landing {
    position: absolute;
    left: 50%;
    bottom: 40px;
    width: min(100% - 2 * var(--gutter), 820px);
    margin: 0;
    transform: translateX(-50%);
  }

  .assistant-icon-button--send .send-i {
    display: none;
  }

  .assistant-icon-button--send .send-up-i {
    display: block;
    width: 21px;
    height: 21px;
    stroke-width: 2.35;
    transform: translate(-50%, -50%);
    transition: transform 220ms ease, opacity 180ms ease;
  }

  /* 桌面端实际显示的是 send-up-i，hover 微推同样只在真鼠标设备生效，且禁用态不响应。 */
  @media (hover: hover) and (pointer: fine) {
    .assistant-icon-button--send:hover:not([disabled]) .send-up-i {
      transform: translate(-50%, calc(-50% - 3px));
    }
  }

  .assistant-icon-button--send.is-sending .send-up-i {
    animation: assistantSendLift 560ms cubic-bezier(.2,.8,.2,1);
  }

  .assistant-icon-button--send.is-generating.is-sending .send-up-i {
    display: block;
  }

  .assistant-icon-button--send.is-generating.is-sending .stop-i {
    display: none;
  }
}

@keyframes assistantSendLift {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  42% { opacity: 0; transform: translate(-50%, calc(-50% - 18px)) scale(0.82); }
  43% { opacity: 0; transform: translate(-50%, calc(-50% + 14px)) scale(0.82); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .assistant-column--chat,
.assistant-icon-button,
.assistant-icon-button--send::before,
.assistant-icon-button--send::after,
.assistant-icon-button--send .send-i,
.assistant-icon-button--send .send-up-i,
.assistant-icon-button--send .stop-i{
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 720px) {
  .assistant-main {
    min-height: calc(100vh - var(--mobile-header-height));
    min-height: calc(100svh - var(--mobile-header-height));
  }

  .assistant-landing {
    min-height: calc(100vh - var(--mobile-header-height));
    min-height: calc(100svh - var(--mobile-header-height));
    align-items: start;
    padding: clamp(58px, 10vh, 82px) 0 28px;
    text-align: left;
  }

  .assistant-column {
    width: min(100% - 32px, 820px);
  }

  .assistant-landing h1 {
    margin: 0;
    font-size: 31px;
  }

  .assistant-lead {
    margin-left: 0;
    margin-right: 0;
  }

  .assistant-composer {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--sp-8);
    min-height: 62px;
    padding: 9px 10px;
  }

  .assistant-composer--multiline {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: stretch;
    gap: 4px;
    min-height: 0;
    padding: 12px 18px 16px;
  }

  .assistant-actions {
    justify-content: flex-end;
  }

  .assistant-icon-button {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .assistant-voice-hint{
    text-align: left;
  }

  .assistant-chat-section {
    min-height: 100vh;
    min-height: 100svh;
    padding: var(--sp-10) 0 190px;
  }

  .assistant-conversation-bar {
    top: 0;
    min-height: 58px;
    margin-bottom: var(--sp-22);
    padding-top: var(--sp-6);
  }

  .assistant-conversation-actions {
    gap: var(--sp-10);
  }

  .assistant-thread {
    min-height: 58vh;
  }

  .assistant-message {
    margin-bottom: var(--sp-22);
  }

  .assistant-bubble {
    max-width: 88%;
    font-size: var(--fs-15);
  }

  .assistant-open-text {
    font-size: var(--fs-15);
    line-height: 1.82;
  }

  .assistant-card {
    max-width: 100%;
  }

  .assistant-composer-dock {
    padding: 34px var(--sp-12) max(12px, env(safe-area-inset-bottom));
  }

  .assistant-composer--chat,
  .assistant-smallprint {
    width: 100%;
  }

  .assistant-smallprint {
    font-size: var(--fs-11-5);
  }

  .assistant-status,
  .assistant-error {
    bottom: 132px;
    width: calc(100% - 24px);
  }

  .assistant-records {
    inset: 0;
    width: 100vw;
    padding: var(--sp-18);
    border-left: 0;
  }

  .assistant-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .assistant-menu-block {
    display: grid;
    gap: 2px;
    width: 100%;
    padding: 0 0 var(--sp-18);
    margin: 0 0 var(--sp-24);
    border-bottom: 1px solid var(--line);
  }

  .assistant-menu-block p {
    margin: 0 0 var(--sp-8);
    color: var(--teal);
    font-size: var(--fs-13);
    font-weight: 600;
  }

  .assistant-menu-block__site {
    margin-top: var(--sp-14) !important;
    color: var(--muted) !important;
  }

  .site-nav .assistant-menu-block button {
    min-height: 42px;
    padding: 0;
    color: var(--ink-soft);
    cursor: pointer;
    text-align: left;
    font-size: var(--fs-16);
  }

  .site-nav .assistant-menu-block button:hover {
    color: var(--teal);
  }
}

/* Composer caret stays native and unobtrusive: only its colour carries the
   Flusso accent, while the browser retains the familiar blink and width. */
.assistant-composer textarea {
  caret-color: rgba(15, 74, 67, 0.72);
}

/* Google authentication is an anchor because it starts an OAuth navigation,
   but it is visually a pill control. Do not let the global link-hover rule
   draw an inline-text underline inside that control. */
.assistant-auth-google,
.assistant-auth-google:hover,
.assistant-auth-google:focus,
.assistant-auth-google:focus-visible,
.assistant-auth-google:active {
  text-decoration: none !important;
}

/* Account navigation stays light at the first level. Data controls only appear
   after Settings → 数据与隐私, rather than turning the account entry into a
   consent form. */
.assistant-panel__heading {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 4px;
}

.assistant-panel__back {
  display: inline-grid;
  width: 36px;
  height: 36px;
  margin-left: -8px;
  padding: 0;
  place-items: center;
  color: rgba(64, 61, 56, 0.72);
  background: transparent;
  border: 0;
  border-radius: var(--flusso-radius-icon);
  cursor: pointer;
}

.assistant-panel__back svg,
.assistant-settings-row__chevron {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-panel__back:hover {
  color: var(--flusso-green);
}

.assistant-account-summary,
.assistant-account-menu > button,
.assistant-account-menu__logout,
.assistant-settings-row {
  width: 100%;
  padding: 0;
  color: var(--flusso-text);
  background: transparent;
  border: 0;
  box-shadow: none;
  font: inherit;
  text-align: left;
}

.assistant-account-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 68px;
  cursor: pointer;
}

.assistant-account-summary__avatar {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--flusso-green);
  background: rgba(15, 74, 67, 0.09);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.assistant-account-summary__copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.assistant-account-summary__copy strong {
  overflow: hidden;
  color: var(--flusso-text);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-account-summary__copy small {
  overflow: hidden;
  color: var(--flusso-muted);
  font-size: 13px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-account-menu,
.assistant-settings-list {
  display: grid;
  margin-top: 16px;
  border-top: 1px solid rgba(28, 28, 30, 0.08);
}

.assistant-account-menu > button,
.assistant-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  gap: 14px;
  border-bottom: 1px solid rgba(28, 28, 30, 0.08);
  cursor: pointer;
}

.assistant-account-menu > button > span {
  font-size: 14px;
  font-weight: 500;
}

.assistant-account-menu__logout {
  min-height: 48px;
  margin-top: 14px;
  color: var(--flusso-text-soft);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.assistant-settings-row > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.assistant-settings-row strong {
  color: var(--flusso-text);
  font-size: 15px;
  font-weight: 550;
}

.assistant-settings-row small {
  color: var(--flusso-muted);
  font-size: 13px;
  line-height: 1.45;
}

.assistant-settings-row__chevron {
  flex: 0 0 18px;
  color: rgba(64, 61, 56, 0.48);
}

.assistant-settings-row--link {
  text-decoration: none;
}

.assistant-account-intro {
  margin: 0;
  color: var(--flusso-text-soft);
  font-size: 14px;
  line-height: 1.65;
}

.assistant-account-details {
  display: grid;
  margin-top: 18px;
  border-top: 1px solid rgba(28, 28, 30, 0.08);
}

.assistant-account-detail {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(28, 28, 30, 0.08);
}

.assistant-account-detail span {
  color: var(--flusso-muted);
  font-size: 12px;
}

.assistant-account-detail strong {
  overflow: hidden;
  color: var(--flusso-text);
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-consent-settings {
  margin: 0;
}

.assistant-consent-settings + .assistant-consent-settings {
  margin-top: 22px;
}

.assistant-consent-settings h3 {
  margin: 0 0 7px;
  color: var(--flusso-text);
  font-size: 14px;
  font-weight: 600;
}

.assistant-consent-row {
  min-height: 76px;
}

.assistant-consent-control {
  grid-template-columns: 38px;
}

.assistant-settings-row--memory {
  min-height: 70px;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-account-summary:hover,
  .assistant-account-menu > button:hover,
  .assistant-settings-row:hover,
  .assistant-account-menu__logout:hover {
    color: var(--flusso-green);
  }
}

@media (max-width: 720px) {
  .assistant-auth-panel[data-account-view="settings"],
  .assistant-auth-panel[data-account-view="privacy"],
  .assistant-auth-panel[data-account-view="profile"],
  .assistant-auth-panel[data-account-view="help"] {
    max-height: min(86svh, calc(100svh - max(20px, env(safe-area-inset-top))));
  }
}

/* The safety call uses a link for its tel: destination, but it is also a
   button-shaped action. Keep its label free of the global link underline in
   every pointer and keyboard state. */
.assistant-safety-call,
.assistant-safety-call:hover,
.assistant-safety-call:focus,
.assistant-safety-call:focus-visible,
.assistant-safety-call:active {
  text-decoration: none !important;
}

/* Real conversation history V1 */
.assistant-history-panel {
  min-height: 0;
}

.assistant-history-list {
  display: grid;
  gap: 6px;
}

.assistant-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
}

.assistant-history-item.is-active {
  background: rgba(15, 74, 67, 0.08);
}

/* 行现在可能是两层：标题 + 进度。原来整个按钮是单行 nowrap + ellipsis，
   那是给「第一句话的前 28 字」用的写法 —— 一句话截断即可。
   现在标题是整理结论，值得完整读到，所以改成最多两行的夹断；
   进度那一层始终单行。 */
.assistant-history-item__open {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  overflow: hidden;
  color: var(--ink-soft);
  text-align: left;
  border-radius: 8px;
}

/* min-width: 0 是必需的：grid 子项默认 min-width: auto，
   标题会撑到内容宽度而不换行 —— 结果是被按钮的 overflow:hidden 从中间裁掉，
   既没有换行也没有省略号。 */
.assistant-history-item__headline {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  min-width: 0;
  overflow: hidden;
  line-height: 1.5;
}

/* 没有整理成果的行仍然是单行截断：它显示的还是一句话的开头，
   让它占两行只会把没形成结论的会话显得比有结论的更重要。 */
.assistant-history-item__open:not(.has-meta) .assistant-history-item__headline {
  -webkit-line-clamp: 1;
}

/* 数值取自线框图：11.5px / rgba(36,51,47,.48) / gap 4px 7px。
   允许换行 —— 侧栏行只有「时间 · 条数 [时间线]」三段，实测排得下一行；
   万一某天条数变成四位数，换行也比裁掉信息好。 */
.assistant-history-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  gap: 4px 7px;
  color: rgba(36, 51, 47, 0.48);
  font-size: 11.5px;
  line-height: 1.45;
}

.assistant-history-item__bit {
  flex: 0 0 auto;
}

.assistant-history-item__dot {
  flex: 0 0 auto;
  opacity: 0.55;
}

/* 与线框图一致的胶囊：极浅底、无边框、11px。
   它是状态标记不是同一层的文字，所以和前面的「时间 · 条数」用间距分开，
   前面不加分隔点。 */
.assistant-history-item__pill {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: rgba(18, 83, 72, 0.07);
  color: rgba(18, 83, 72, 0.78);
  font-size: 11px;
}


.assistant-history-item__open:hover {
  color: var(--teal);
  background: rgba(15, 74, 67, 0.06);
}

.assistant-history-item__open:focus-visible {
  color: var(--teal);
  background: rgba(15, 74, 67, 0.06);
}

/* 原 .assistant-history-item.is-confirming 三条已删除：删除确认不再把整行
   换成一段问句，改为在菜单面板里就地展开（见 .assistant-history-menu__confirm）。 */

.assistant-chat-loading,
.assistant-chat-unavailable {
  min-height: 46vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
  text-align: center;
}

.assistant-chat-unavailable p {
  margin: 0;
  color: var(--ink-soft);
}

.assistant-chat-unavailable button {
  min-height: 40px;
  padding: 0 16px;
  color: var(--paper-on-dark);
  background: var(--teal);
  border-radius: 10px;
}
@media (max-width: 420px) {
  .assistant-feedback {
    gap: var(--sp-6);
  }

  .assistant-feedback button {
    padding-inline: var(--sp-8);
  }
}

/* Chat workspace refinement */
.assistant-state-chat .assistant-main {
  background: var(--paper);
}

.assistant-state-chat .assistant-chat-section {
  min-height: 100vh;
  min-height: 100svh;
  padding: 0 0 170px;
}

.assistant-state-chat .assistant-column--chat {
  width: min(100% - 2 * var(--gutter), 960px);
}

.assistant-state-chat .assistant-conversation-bar {
  position: sticky;
  top: 0;
  z-index: 32;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  min-height: 56px;
  margin: 0 0 clamp(34px, 5vh, 56px);
  padding: 0;
  background: var(--paper);
  border-bottom: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.assistant-chat-tool {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: rgba(36, 51, 47, 0.68);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color var(--t);
}

.assistant-chat-tool svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-chat-tool:hover {
  color: var(--teal);
  background: transparent;
  box-shadow: none;
}

.assistant-chat-tool--new {
  justify-self: end;
}

.assistant-state-chat .assistant-chat-title {
  justify-self: center;
  min-width: 0;
  color: rgba(15, 74, 67, 0.72);
  cursor: default;
  font-size: var(--fs-14);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.assistant-chat-empty {
  min-height: 48vh;
  display: grid;
  place-content: center;
  color: rgba(15, 74, 67, 0.05);
  font-family: var(--font-brand-latin);
  font-size: clamp(44px, 8vw, 92px);
  letter-spacing: 0.08em;
  pointer-events: none;
  user-select: none;
}

.assistant-chat-empty p {
  display: none;
}

.assistant-chat-empty > span {
  margin: 0;
  font-size: inherit;
}

.assistant-composer-dock {
  padding: 28px var(--gutter) max(14px, env(safe-area-inset-bottom));
  background: transparent;
}

.assistant-state-chat .assistant-composer--chat,
.assistant-state-chat .assistant-smallprint {
  width: min(100% - 2 * var(--gutter), 820px);
}

.assistant-state-chat .assistant-status:not([hidden]) {
  display: none;
}

.assistant-error:not([hidden]) {
  bottom: 126px;
}

.assistant-composer:has(.assistant-input-listening) {
  border-color: rgba(15, 74, 67, 0.42);
  box-shadow: 0 0 0 1px rgba(15, 74, 67, 0.08), 0 0 0 6px rgba(15, 74, 67, 0.035), 0 8px 30px rgba(0, 0, 0, 0.03), 0 18px 46px -38px rgba(10, 51, 46, 0.44);
}

.assistant-input-listening {
  color: var(--teal-strong);
  caret-color: var(--teal);
}

.assistant-icon-button--mic.is-active,
.assistant-is-recording .assistant-icon-button--mic {
  color: var(--paper-on-dark);
  background: linear-gradient(145deg, var(--teal), var(--teal-strong));
  border-color: rgba(15, 74, 67, 0.9);
  box-shadow: 0 0 0 6px rgba(15, 74, 67, 0.08), 0 12px 26px -18px rgba(15, 74, 67, 0.9);
}

.assistant-records {
  inset: 0 auto 0 0;
  width: min(320px, 88vw);
  padding: 18px;
  background: #FFFFFF;
  border-left: 0;
  border-right: 1px solid rgba(216, 209, 197, 0.72);
  box-shadow: 18px 0 48px -38px rgba(10, 51, 46, 0.42);
}

.assistant-backdrop {
  background: rgba(10, 51, 46, 0.08);
}

.assistant-records__head h2 {
  font-size: var(--fs-18);
}

.assistant-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.assistant-tabs button {
  flex: 0 0 auto;
  min-height: 32px;
  border-radius: var(--r-pill);
  background: var(--paper);
}

.assistant-record-new {
  width: 100%;
  margin-bottom: var(--sp-10);
  border-radius: var(--r-pill);
}

@media (max-width: 720px) {
  .assistant-state-chat .assistant-conversation-bar {
    min-height: 56px;
    margin-bottom: var(--sp-22);
  }

  .assistant-records {
    width: min(320px, 92vw);
  }
}
/* Document-flow conversation layout */
.assistant-state-chat .assistant-thread {
  width: min(100% - 2 * var(--gutter), 720px);
  min-height: 56vh;
  margin: 0 auto;
  padding: clamp(8px, 2vh, 24px) 0 56px;
}

.assistant-records-open .assistant-column--chat,
.assistant-records-open .assistant-composer-dock {
  transform: translateX(calc(min(320px, 88vw) / 2));
}

.assistant-message {
  margin: 0 0 46px;
}

.assistant-message--user {
  justify-content: flex-end;
  margin-bottom: 50px;
}

.assistant-message--assistant {
  max-width: 100%;
  margin-bottom: 56px;
}

.assistant-bubble {
  max-width: min(86%, 640px);
  padding: 17px 22px;
  color: rgba(36, 35, 31, 0.88);
  background: rgba(15, 74, 67, 0.035);
  border: 0;
  border-radius: 26px;
  line-height: 1.72;
}

.assistant-bubble p {
  margin: 0;
}

.assistant-open-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #333333;
  font-size: var(--fs-16);
  line-height: 1.78;
}

.assistant-open-text p {
  margin: 0 0 18px;
}

.assistant-open-text p:last-child,
.assistant-open-text ul:last-child,
.assistant-open-text blockquote:last-child {
  margin-bottom: 0;
}

.assistant-open-text strong {
  color: rgba(28, 28, 24, 0.94);
  font-weight: 700;
}

.assistant-open-text ul {
  margin: 0 0 20px;
  padding-left: 1.25em;
}

.assistant-open-text li {
  margin: 7px 0;
  padding-left: 0.15em;
}

.assistant-open-text blockquote {
  margin: 22px 0;
  padding: 2px 0 2px 18px;
  color: rgba(51, 51, 51, 0.82);
  border-left: 2px solid rgba(15, 74, 67, 0.62);
}

.assistant-open-text h3 {
  margin: 24px 0 12px;
  color: rgba(28, 28, 24, 0.94);
  font-family: var(--font-sans);
  font-size: var(--fs-17);
  font-weight: 700;
}

.assistant-open-text code {
  padding: 0 0.35em;
  background: rgba(15, 74, 67, 0.06);
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.assistant-feedback {
  margin-top: 22px;
  opacity: 0.72;
}

.assistant-card {
  max-width: 100%;
  background: rgba(255, 255, 255, 0.42);
  border: 0;
  border-radius: 24px;
  line-height: 1.72;
}

@media (max-width: 720px) {
  .assistant-state-chat .assistant-thread {
    width: min(100% - 32px, 720px);
  }

  .assistant-records-open .assistant-column--chat,
  .assistant-records-open .assistant-composer-dock {
    transform: none;
  }

  .assistant-bubble {
    max-width: 92%;
    border-radius: 22px;
  }
}
/* Desktop workbench sidebar and quiet chat controls */
.assistant-backdrop {
  display: none !important;
}

.assistant-records {
  background: #EFECE7;
  border-right: 1px solid rgba(188, 178, 161, 0.48);
  box-shadow: 18px 0 42px -34px rgba(10, 51, 46, 0.28);
}

.assistant-records__head {
  margin-bottom: 14px;
}

.assistant-records__head .assistant-icon-button {
  display: none;
}

.assistant-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  overflow: visible;
  scrollbar-width: none;
}

.assistant-tabs::-webkit-scrollbar {
  display: none;
}

.assistant-tabs button {
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
  background: rgba(251, 249, 245, 0.58);
  font-size: var(--fs-12);
}

.assistant-tabs button.is-active {
  color: var(--teal);
  background: rgba(15, 74, 67, 0.075);
  border-color: transparent;
}

.assistant-record-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 0;
  box-shadow: 0 10px 26px -22px rgba(15, 74, 67, 0.7);
}

.assistant-record-new svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 这些按钮默认 opacity:0、父行 hover 才浮现，浮现已是足够反馈，不再叠底色。 */

.assistant-state-chat .assistant-chat-tool svg {
  width: 21px;
  height: 21px;
}

.assistant-feedback {
  gap: 14px;
  margin-top: 18px;
  opacity: 1;
}

.assistant-feedback button{
  min-height: 26px;
  padding: 0;
  color: rgba(80, 76, 69, 0.58);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: var(--fs-12);
}

@media (min-width: 721px) {
  .assistant-state-chat .assistant-chat-section,
  .assistant-composer-dock {
    transition: margin-left 240ms ease, left 240ms ease, width 240ms ease, transform 240ms ease;
  }

  .assistant-records-open .assistant-column--chat,
  .assistant-records-open .assistant-composer-dock {
    transform: none;
  }

  .assistant-state-chat.assistant-records-open .assistant-chat-section {
    margin-left: min(320px, 88vw);
  }

  .assistant-state-chat.assistant-records-open .assistant-composer-dock {
    left: min(320px, 88vw);
  }
}

/* Invisible default memory flow */
.assistant-memory-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 42;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 12px;
  color: rgba(63, 60, 54, 0.72);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(188, 178, 161, 0.46);
  border-radius: var(--r-pill);
  box-shadow: 0 12px 30px -24px rgba(10, 51, 46, 0.42);
  font-size: var(--fs-12);
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px) scale(0.98);
  transition: opacity 220ms ease, transform 220ms ease;
}

.assistant-memory-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.assistant-memory-toast svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: rgba(15, 74, 67, 0.78);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Quiet empty state, document flow actions, and simplified drawer */
.assistant-chat-empty {
  min-height: 46vh;
  color: rgba(64, 61, 56, 0.62);
  font-family: var(--font-serif-cn);
  font-size: clamp(28px, 3.2vw, 38px);
  letter-spacing: 0.02em;
}

.assistant-chat-empty > span {
  font-size: inherit;
}

.assistant-message--assistant {
  padding-top: 2px;
}

.assistant-feedback {
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}

.assistant-feedback button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  color: rgba(80, 76, 69, 0.42);
  border-radius: var(--r-pill);
  transition: color var(--t), background var(--t), transform var(--t-fast);
}

/* 点赞 / 点踩 / 复制：本文件内唯一生效的 hover 规则。
   未选中态只高亮图标——不加底色、不上浮；选中态是持续状态，另有底色（见 is-selected）。 */
@media (hover: hover) and (pointer: fine) {
  .assistant-feedback button:hover:not([aria-pressed="true"]):not(.is-selected) {
    color: var(--teal);
    background: transparent;
  }
}

.assistant-feedback svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-records {
  display: grid;
  /* head · new-chat · search · tabs · (flexible panel) · drawer-bottom */
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: hidden;
}

.assistant-records__head {
  margin: 0;
}

.assistant-records__head h2 {
  color: rgba(15, 74, 67, 0.86);
  font-size: var(--fs-16);
  letter-spacing: 0.04em;
}

.assistant-record-new {
  width: 100%;
  min-height: 42px;
  margin: 0;
  color: var(--paper-on-dark);
  background: linear-gradient(145deg, var(--teal), var(--teal-strong));
  border-radius: 14px;
  font-size: var(--fs-14);
  font-weight: 600;
}

.assistant-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin: 0;
}

.assistant-tabs button {
  justify-content: flex-start;
  min-height: 38px;
  padding: 0 12px;
  color: rgba(36, 35, 31, 0.72);
  background: transparent;
  border-radius: 12px;
  font-size: var(--fs-14);
  text-align: left;
}

.assistant-tabs button:hover,
.assistant-tabs button.is-active {
  color: var(--teal);
  background: rgba(15, 74, 67, 0.07);
}

.assistant-record-panel {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.assistant-record-panel::-webkit-scrollbar {
  display: none;
}


@media (min-width: 721px) {
  .assistant-state-chat.assistant-records-open .assistant-chat-section {
    width: calc(100vw - min(320px, 88vw));
    margin-left: min(320px, 88vw);
  }

  .assistant-state-chat.assistant-records-open .assistant-composer-dock {
    left: min(320px, 88vw);
    width: calc(100vw - min(320px, 88vw));
  }

  .assistant-state-chat.assistant-records-open .assistant-column--chat {
    width: min(100% - 2 * var(--gutter), 960px);
    margin-inline: auto;
  }
}

/* Professional workbench refinements */
.assistant-composer textarea {
  transition: height 160ms ease;
  /* 溢出时才出现的克制滚动条：细、track 透明、thumb 低对比灰绿、不贴边框、hover 才加深 */
  scrollbar-width: thin;
  scrollbar-color: rgba(60, 92, 82, 0.22) transparent;
}

.assistant-composer textarea::-webkit-scrollbar {
  width: 6px;
}

.assistant-composer textarea::-webkit-scrollbar-track {
  background: transparent;
}

.assistant-composer textarea::-webkit-scrollbar-thumb {
  background: rgba(60, 92, 82, 0.22);
  /* 用透明边框把 thumb 往内缩 1.5px，不贴住外边框 */
  border: 1.5px solid transparent;
  background-clip: padding-box;
  border-radius: var(--r-pill);
}

.assistant-composer textarea:hover::-webkit-scrollbar-thumb,
.assistant-composer textarea:focus::-webkit-scrollbar-thumb {
  background: rgba(60, 92, 82, 0.34);
  background-clip: padding-box;
}

.assistant-message--user {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.assistant-message--assistant,
.assistant-message--card {
  display: block;
  width: 100%;
  text-align: left;
}

.assistant-message--user .assistant-bubble {
  margin-left: auto;
}

.assistant-open-text {
  max-width: 100%;
}

.assistant-thinking {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 44px;
  color: rgba(15, 74, 67, 0.64);
  font-size: var(--fs-14);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.assistant-thinking i {
  width: 1px;
  height: 1.15em;
  background: currentColor;
  border-radius: var(--r-pill);
  animation: assistantCaretBlink 1.05s ease-in-out infinite;
}

@keyframes assistantCaretBlink {
  0%, 100% { opacity: 0.18; }
  45% { opacity: 1; }
}

/* 助手等待态：发送后立即在同一气泡里显示，复用助手消息样式 + 三个克制动态点。
   首个 delta 到达即被真实内容替换；等待态不写入 history。 */
.assistant-pending {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  color: rgba(15, 74, 67, 0.66);
  font-size: var(--fs-14);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.assistant-pending__dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.assistant-pending__dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.28;
  animation: assistantPendingDot 1.2s ease-in-out infinite;
}

.assistant-pending__dots i:nth-child(2) { animation-delay: 0.18s; }
.assistant-pending__dots i:nth-child(3) { animation-delay: 0.36s; }

@keyframes assistantPendingDot {
  0%, 100% { opacity: 0.24; transform: translateY(0); }
  40% { opacity: 0.9; transform: translateY(-2px); }
}

/* 等待期间隐藏空的正文与反馈操作，避免出现多余空气泡与可交互按钮。 */
.assistant-message.is-pending .assistant-open-text,
.assistant-message.is-pending .assistant-feedback {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .assistant-pending__dots i,
  .assistant-voice-wave i,
  .assistant-composer--voice-fallback .assistant-voice-wave i,
  .assistant-composer--voice-transcribing .assistant-voice-stage-text::before {
    animation: none !important;
    transition: none !important;
  }
}

.assistant-safety-card {
  padding: 22px 24px;
  color: #3A1714;
  background: #FFFFFF;
  border: 1px solid rgba(145, 42, 32, 0.58);
  border-left: 4px solid #9F2F25;
  border-radius: 18px;
  box-shadow: 0 18px 42px -30px rgba(145, 42, 32, 0.5);
}

.assistant-safety-eyebrow {
  margin: 0 0 8px !important;
  color: #9F2F25 !important;
  font-size: var(--fs-12) !important;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.assistant-safety-card h3 {
  margin: 0 0 10px;
  color: #3A1714;
  font-size: var(--fs-18);
}

.assistant-safety-card p:not(.assistant-safety-eyebrow) {
  color: rgba(58, 23, 20, 0.82);
}

.assistant-safety-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 16px 10px 0 0;
  padding: 0 18px;
  color: #FFFFFF;
  background: #9F2F25;
  border-radius: 12px;
  font-size: var(--fs-15);
  font-weight: 700;
}

.assistant-safety-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-top: 16px;
  color: #7D281F;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.assistant-drawer-bottom {
  display: grid;
  gap: 12px;
  align-self: end;
}

.assistant-user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  width: 100%;
  padding: 0 8px;
  color: rgba(36, 35, 31, 0.72);
  border-radius: 12px;
  cursor: pointer;
  font-size: var(--fs-13);
  text-align: left;
}

.assistant-user-bar:hover {
  color: var(--teal);
  background: rgba(15, 74, 67, 0.06);
}

.assistant-user-avatar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  color: rgba(15, 74, 67, 0.82);
  background: rgba(15, 74, 67, 0.08);
  border-radius: 50%;
  font-size: var(--fs-12);
  font-weight: 700;
}

/* Drawer toggle — reflect open state on the toolbar button */
.assistant-chat-tool[aria-expanded="true"] {
  color: var(--teal);
  background: rgba(15, 74, 67, 0.08);
}

/* Guest save prompt — gentle registration nudge beneath a 阶段性整理卡 */
.assistant-guest-save {
  max-width: 100%;
  margin: -26px 0 46px;
  padding: 16px 18px 15px;
  background: rgba(15, 74, 67, 0.045);
  border: 1px solid rgba(15, 74, 67, 0.12);
  border-radius: 20px;
  transition: opacity 220ms ease, transform 220ms ease, max-height 280ms ease,
    margin 280ms ease, padding 280ms ease, border-color 220ms ease;
}

.assistant-guest-save__main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.assistant-guest-save__icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  margin-top: 1px;
  color: var(--teal);
  background: rgba(15, 74, 67, 0.09);
  border-radius: 11px;
}

.assistant-guest-save__icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-guest-save__text h4 {
  margin: 2px 0 5px;
  color: rgba(15, 74, 67, 0.92);
  font-size: var(--fs-15);
  font-weight: 600;
}

.assistant-guest-save__text p {
  margin: 0;
  color: rgba(51, 51, 51, 0.78);
  font-size: var(--fs-13);
  line-height: 1.62;
}

.assistant-guest-save__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 4px;
  margin-top: 14px;
  padding-left: 46px;
}

.assistant-guest-save__ghost {
  min-height: 40px;
  padding: 0 12px;
  color: rgba(80, 76, 69, 0.6);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: var(--fs-13);
  transition: color var(--t);
}

.assistant-guest-save__ghost:hover {
  color: var(--teal);
}

.assistant-guest-save.is-dismissing {
  margin-top: -26px;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  border-color: transparent;
}

@media (max-width: 720px) {
  .assistant-guest-save {
    margin-top: -20px;
  }

  .assistant-guest-save.is-dismissing {
    margin-top: -20px;
  }

  .assistant-guest-save__actions {
    padding-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-guest-save {
    transition: opacity 200ms ease !important;
  }
}

/* ── Sidebar nav: ghost navigation — no fills, no borders, no bars ── */
.assistant-tabs button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 8px;
  color: rgba(58, 82, 76, 0.6);   /* soft gray-green, inactive */
  background: transparent;
  font-weight: 400;
  transition: color var(--t);
}

.assistant-tabs button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-tabs button:hover {
  color: var(--teal);
  background: transparent;
}

/* Active: deep brand green + medium weight — nothing else. */
.assistant-tabs button.is-active {
  color: var(--teal-strong);
  background: transparent;
  font-weight: 500;
}

/* ── History groups: tighten the time labels, drop the gray hover block ── */

/* Time labels (今天 / 过去七天) hug the records: smaller, lighter, closer. */

/* ── Anchored drawer toggle: no more mid-air floating icon ── */
.assistant-records__head {
  align-items: center;
  justify-content: space-between;
}

.assistant-records__collapse {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: -3px -4px -3px 0;
  color: rgba(36, 51, 47, 0.56);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color var(--t);
}

.assistant-records__collapse svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-records__collapse:hover {
  color: var(--teal);
  background: transparent;
  box-shadow: none;
}

@media (min-width: 721px) {
  /* Constrained layout: the toolbar shares the SAME 720px reading column as the
     thread, so the toggle hugs its left edge and new-chat its right edge.
     Toolbar, conversation, and composer collapse into one centered channel. */
  .assistant-state-chat .assistant-conversation-bar {
    width: min(100% - 2 * var(--gutter), 720px);
    margin-inline: auto;
  }

  /* When the drawer is open, its in-drawer collapse control takes over. */
  .assistant-state-chat.assistant-records-open .assistant-conversation-bar > .assistant-chat-tool:not(.assistant-chat-tool--new) {
    opacity: 0;
    pointer-events: none;
  }

  /* Composer + fine print align to the same 720px column. */
  .assistant-state-chat .assistant-composer--chat,
  .assistant-state-chat .assistant-smallprint {
    width: min(100% - 2 * var(--gutter), 720px);
  }
}

/* Toolbar icons (toggle + new-chat): one quiet, neutral design language —
   a calm gray line icon by default; a faint gray circle only on hover. */
.assistant-state-chat .assistant-chat-tool {
  color: #666666;
  background: transparent;
}

/* 顶栏图标的 42px 区域只负责命中；悬停只提亮图标，避免形成多余圆形底板。 */
.assistant-state-chat .assistant-chat-tool:hover {
  color: var(--teal-strong);
  background: transparent;
  box-shadow: none;
}

.assistant-state-chat .assistant-chat-tool[aria-expanded="true"] {
  color: #3d3d3d;
  background: transparent;
}

/* ── Feedback icons: uniform optical size + finer, elegant strokes ── */
/* Thumbs are drawn at native ~20u but scaled to ~18u to match the copy/refresh
   glyphs; bump their stroke so the rendered line weight stays identical. */
.assistant-feedback svg.fb-thumb {
  stroke-width: 2.1;
}

/* 2026-07-07 Push layout: drawer + centered 720px workbench */
:root {
  --assistant-drawer-w: 260px;
  --assistant-drawer-ease: cubic-bezier(.22, .9, .2, 1);
  --assistant-motion-ease: cubic-bezier(.22, .9, .2, 1);
  --assistant-motion-quick: 170ms;
  --assistant-motion-soft: 260ms;
}

.assistant-state-chat .assistant-main {
  overflow-x: hidden;
}

.assistant-state-chat .assistant-records,
.assistant-state-chat .assistant-records[hidden] {
  display: grid !important;
  inset: 0 auto 0 0;
  width: 0;
  min-width: 0;
  padding: 18px 0;
  overflow: hidden;
  visibility: hidden;
  background: #EFECE7;
  border-right: 0;
  box-shadow: none;
  opacity: 0;
  transform: translateX(-12px);
  transition: width var(--assistant-motion-soft) var(--assistant-drawer-ease), padding var(--assistant-motion-soft) var(--assistant-drawer-ease), opacity 190ms ease, transform var(--assistant-motion-soft) var(--assistant-drawer-ease), visibility 0ms linear var(--assistant-motion-soft);
}

.assistant-state-chat.assistant-records-open .assistant-records {
  width: var(--assistant-drawer-w);
  padding: 18px;
  visibility: visible;
  border-right: 1px solid rgba(188, 178, 161, 0.48);
  box-shadow: 18px 0 42px -34px rgba(10, 51, 46, 0.28);
  opacity: 1;
  transform: translateX(0);
  transition: width var(--assistant-motion-soft) var(--assistant-drawer-ease), padding var(--assistant-motion-soft) var(--assistant-drawer-ease), opacity 210ms ease, transform var(--assistant-motion-soft) var(--assistant-drawer-ease), visibility 0ms;
}

@media (min-width: 721px) {
  .assistant-state-chat .assistant-chat-section {
    width: 100vw;
    margin-left: 0;
    transition: width var(--assistant-motion-soft) var(--assistant-drawer-ease), margin-left var(--assistant-motion-soft) var(--assistant-drawer-ease);
  }

  .assistant-state-chat.assistant-records-open .assistant-chat-section {
    width: calc(100vw - var(--assistant-drawer-w));
    margin-left: var(--assistant-drawer-w);
  }

  .assistant-state-chat .assistant-column--chat {
    width: min(100% - 2 * var(--gutter), 720px);
    margin-inline: auto;
    transition: width var(--assistant-motion-soft) var(--assistant-drawer-ease), margin var(--assistant-motion-soft) var(--assistant-drawer-ease);
  }

  .assistant-state-chat .assistant-conversation-bar {
    width: 100%;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    column-gap: 8px;
    margin-inline: auto;
  }

  .assistant-state-chat .assistant-conversation-bar > .assistant-chat-tool:not(.assistant-chat-tool--new),
  .assistant-state-chat.assistant-records-open .assistant-conversation-bar > .assistant-chat-tool:not(.assistant-chat-tool--new) {
    opacity: 1;
    pointer-events: auto;
  }

  .assistant-state-chat .assistant-thread {
    width: 100%;
    max-width: 720px;
    margin-inline: auto;
  }

  .assistant-state-chat .assistant-composer-dock {
    left: 0;
    width: 100vw;
    transition: left var(--assistant-motion-soft) var(--assistant-drawer-ease), width var(--assistant-motion-soft) var(--assistant-drawer-ease);
  }

  .assistant-state-chat.assistant-records-open .assistant-composer-dock {
    left: var(--assistant-drawer-w);
    width: calc(100vw - var(--assistant-drawer-w));
  }

  .assistant-state-chat .assistant-composer--chat,
  .assistant-state-chat .assistant-smallprint {
    width: min(100% - 2 * var(--gutter), 720px);
    margin-inline: auto;
  }
}

.assistant-user-bar {
  position: relative;
}

/* 2026-07-07 Desktop workbench lock: one centered 720px visual channel. */
:root {
  --assistant-workbench-w: 720px;
}

.assistant-chat-shell {
  width: 100%;
  max-width: var(--assistant-workbench-w);
  margin: 0 auto;
}

.assistant-state-chat .assistant-column--chat,
.assistant-state-chat .assistant-conversation-bar,
.assistant-state-chat .assistant-thread {
  width: 100%;
  max-width: var(--assistant-workbench-w);
  margin-inline: auto;
}

.assistant-state-chat .assistant-conversation-bar {
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  column-gap: 8px;
}

.assistant-state-chat .assistant-conversation-bar > .assistant-chat-tool[data-open-records] {
  grid-column: 1;
}

.assistant-state-chat .assistant-chat-title {
  grid-column: 2;
}

.assistant-state-chat .assistant-chat-tool--new {
  grid-column: 3;
}

.assistant-state-chat.assistant-records-open .assistant-column--chat,
.assistant-state-chat.assistant-records-open .assistant-conversation-bar,
.assistant-state-chat.assistant-records-open .assistant-thread {
  width: 100%;
  max-width: var(--assistant-workbench-w);
}

.assistant-state-chat.assistant-records-open .assistant-conversation-bar > .assistant-chat-tool[data-open-records] {
  display: none;
}

.assistant-state-chat .assistant-chat-title.is-empty {
  color: transparent;
  pointer-events: none;
}

.assistant-chat-empty {
  min-height: 42vh;
  place-content: start center;
  padding-top: clamp(92px, 16vh, 132px);
  color: rgba(83, 104, 96, 0.36);
  font-family: var(--font-serif-cn);
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 400;
  letter-spacing: 0;
}

.assistant-chat-empty > span {
  font-size: inherit;
  line-height: 1.7;
}

.assistant-state-chat .assistant-composer-dock {
  left: 0;
  width: 100vw;
}

.assistant-state-chat.assistant-records-open .assistant-composer-dock {
  left: var(--assistant-drawer-w);
  width: calc(100vw - var(--assistant-drawer-w));
}

.assistant-state-chat .assistant-composer--chat,
.assistant-state-chat .assistant-smallprint {
  width: 100%;
  max-width: var(--assistant-workbench-w);
  margin-inline: auto;
}

@media (min-width: 721px) {
  .assistant-state-chat .assistant-chat-section {
    display: grid;
    justify-items: center;
  }

  .assistant-state-chat.assistant-records-open .assistant-chat-section {
    width: calc(100vw - var(--assistant-drawer-w));
    margin-left: var(--assistant-drawer-w);
  }
}

@media (max-width: 720px) {
  .assistant-chat-shell,
  .assistant-state-chat .assistant-column--chat,
  .assistant-state-chat .assistant-conversation-bar,
  .assistant-state-chat .assistant-thread,
  .assistant-state-chat .assistant-composer--chat,
  .assistant-state-chat .assistant-smallprint {
    width: min(100% - 2 * var(--gutter), var(--assistant-workbench-w));
  }

  .assistant-state-chat.assistant-records-open .assistant-composer-dock {
    left: 0;
    width: 100vw;
  }

  .assistant-chat-empty {
    min-height: 44vh;
    padding-top: clamp(70px, 14vh, 104px);
  }
}

/* Memory toast sits below the toolbar title instead of colliding with it. */
.assistant-state-chat .assistant-memory-toast {
  top: 64px;
}

.assistant-state-chat.assistant-records-open .assistant-memory-toast {
  left: calc(var(--assistant-drawer-w) + (100vw - var(--assistant-drawer-w)) / 2);
}

@media (max-width: 720px) {
  .assistant-state-chat.assistant-records-open .assistant-memory-toast {
    left: 50%;
  }
}

/* Toolbar and feedback polish */
.assistant-state-chat .assistant-chat-tool {
  width: 40px;
  height: 40px;
}

.assistant-state-chat .assistant-chat-tool svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.05;
}

.assistant-state-chat .assistant-chat-tool--new svg {
  transform: translateY(-0.5px);
  transform-origin: 50% 50%;
}

/* 选中态与 hover 必须拉开层级：hover 无底色，选中态底色提到 .10 并加深图标色。 */
.assistant-feedback button.is-selected,
.assistant-feedback button[aria-pressed="true"] {
  color: var(--teal-strong);
  background: rgba(15, 74, 67, 0.10);
}

/* 选中态不只靠颜色：拇指图标从描边变为实心，形态本身即可区分
   （对色觉障碍与高对比度模式同样可辨）。 */
.assistant-feedback button[aria-pressed="true"] svg.fb-thumb {
  fill: currentColor;
}

.assistant-feedback button[data-feedback-action="copy"].is-confirming {
  color: var(--teal);
}

/* Stronger optical match for top drawer/new-chat icons. */
.assistant-state-chat .assistant-chat-tool,
.assistant-records__collapse {
  width: 42px;
  height: 42px;
  color: rgba(49, 58, 55, 0.68);
}

.assistant-state-chat .assistant-chat-tool svg,
.assistant-records__collapse svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.assistant-state-chat .assistant-chat-tool--new svg {
  transform: none;
}

.assistant-state-chat.assistant-records-open .assistant-records__head {
  min-height: 56px;
}

/* Tighten the title's line-box to its glyphs so the toggle can center on the
   「助手」 midline rather than on a tall, half-leading-padded line box. */
.assistant-state-chat .assistant-records__head h2 {
  line-height: 1;
}

.assistant-state-chat.assistant-records-open .assistant-records {
  padding-top: 0;
}

/* Toggle stays in the flex flow (align-items: center) so it rides the same
   centerline as the title, instead of being pinned to the head box. */
.assistant-state-chat.assistant-records-open .assistant-records__collapse {
  position: static;
  margin: 0;
}

@media (min-width: 721px) {
  .assistant-state-chat.assistant-records-open .assistant-records__collapse {
    margin-right: -11px;
  }
}

/* New chat CTA: quiet first entry aligned to the sidebar icon spine. */
.assistant-record-new {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 42px;
  padding: 0 18px 0 8px;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 10px 24px -18px rgba(15, 74, 67, 0.82), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform var(--t-fast), box-shadow var(--t), background var(--t);
}

.assistant-record-new::after {
  display: none;
}

.assistant-record-new span,
.assistant-record-new svg {
  position: relative;
  z-index: 1;
}

.assistant-record-new span {
  min-width: 0;
  line-height: 1;
}

.assistant-record-new svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  transform-origin: 50% 50%;
  stroke-width: 2;
}

.assistant-record-new:hover {
  background: linear-gradient(145deg, #17645A, #0B3E38);
  box-shadow: 0 14px 28px -20px rgba(15, 74, 67, 0.88), 0 4px 12px -10px rgba(15, 74, 67, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* 按下不缩放、不投影：底色变化由下方 :active 共用规则提供。 */
.assistant-record-new:active {
  transform: none;
}

/* 焦点环由文件后面那条 .assistant-record-new/.assistant-tabs button 的共用规则
   统一提供；此处原有的 0.38/3px 是被覆盖的死代码，已删除。 */

.assistant-record-new svg,
.assistant-tabs button svg{
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  stroke-width: 2;
}

.assistant-record-new svg {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

@media (prefers-reduced-motion: reduce) {
  .assistant-record-new,
  .assistant-record-new svg {
    transition: none !important;
  }

  .assistant-record-new:hover,
  .assistant-record-new:active,
  .assistant-record-new:hover svg {
    transform: none;
  }

  .assistant-record-new:hover::after {
    animation: none;
  }
}

/* Chat stage alignment: the composer is the 720px base of the workspace. */
.assistant-state-chat .assistant-composer--chat,
.assistant-state-chat .assistant-smallprint {
  width: 100%;
  max-width: var(--assistant-workbench-w);
  margin-inline: auto;
}

.assistant-state-chat .assistant-conversation-bar {
  width: 100%;
  max-width: var(--assistant-workbench-w);
}

.assistant-state-chat .assistant-chat-tool--new svg {
  transform: translateX(10px);
}

.assistant-state-chat .assistant-chat-tool--new:hover svg {
  transform: translateX(10px);
}

@media (max-width: 720px) {
  .assistant-state-chat .assistant-composer--chat,
  .assistant-state-chat .assistant-smallprint,
  .assistant-state-chat .assistant-conversation-bar {
    width: 100%;
    max-width: var(--assistant-workbench-w);
  }

  .assistant-state-chat .assistant-chat-tool--new svg,
  .assistant-state-chat .assistant-chat-tool--new:hover svg {
    transform: none;
  }
}

/* Sidebar order and alignment: one calm icon spine for all primary entries. */
.assistant-records {
  --assistant-sidebar-row-h: 38px;
  --assistant-sidebar-icon: 18px;
  --assistant-sidebar-pad-x: 8px;
}

.assistant-record-new,
.assistant-tabs button{
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: var(--assistant-sidebar-row-h);
  padding: 0 var(--assistant-sidebar-pad-x);
  color: rgba(36, 35, 31, 0.72);
  background: transparent;
  border: 0;
  border-radius: var(--r-pill);
  box-shadow: none;
  font-size: var(--fs-14);
  font-weight: 500;
  text-align: left;
  transition: color var(--t), background var(--t), box-shadow var(--t), transform var(--t-fast);
}

.assistant-record-new {
  margin: 0;
}

.assistant-record-new::after {
  display: none;
}

.assistant-record-new svg,
.assistant-tabs button svg{
  width: var(--assistant-sidebar-icon);
  height: var(--assistant-sidebar-icon);
  flex: 0 0 var(--assistant-sidebar-icon);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-record-new span,
.assistant-tabs button span{
  min-width: 0;
  line-height: 1.25;
}

.assistant-record-new:hover,
.assistant-tabs button:hover{
  color: var(--teal-strong);
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 10px 22px -20px rgba(10, 51, 46, 0.55), inset 0 0 0 1px rgba(15, 74, 67, 0.055);
  transform: none;
}

.assistant-record-new:active,
.assistant-tabs button:active{
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 4px rgba(10, 51, 46, 0.08);
  transform: none;
}

.assistant-record-new:focus-visible,
.assistant-tabs button:focus-visible{
  outline: var(--flusso-focus-ring);
  outline-offset: var(--flusso-focus-offset);
}

.assistant-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 0;
}

.assistant-tabs button.is-active {
  color: var(--teal-strong);
  background: transparent;
  box-shadow: none;
  font-weight: 500;
}

.assistant-search {
  margin: 0;
}

.assistant-search.is-open {
  margin: 6px 0 2px;
}

/* The active area (history / search / memory) opens a little below the tabs with
   a soft gap — no hard boundary, no fixed height. */
.assistant-record-panel {
  margin-top: 8px;
}

/* History reads as one continuous list: no group labels, no divider lines. */

/* No panel should start with a stray divider line at the top of the active area. */
.assistant-record-panel > :first-child {
  border-top: 0;
}

/* ── New-chat blank state: the input capsule (with its greeting) floats to the
   chat area's vertical middle, then returns to the bottom dock once the first
   message is sent. The dock is drawer-aware, so this stays centered whether the
   sidebar is open or closed. ── */
.assistant-state-chat.assistant-blank .assistant-composer-dock {
  top: 0;
  bottom: 0;
  align-content: center;
  background: transparent;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.assistant-state-chat.assistant-blank .assistant-composer--chat,
.assistant-state-chat.assistant-blank .assistant-smallprint {
  pointer-events: auto;
}

/* The in-thread placeholder is hidden; the greeting that rides with the capsule
   takes its place. */
.assistant-state-chat.assistant-blank .assistant-chat-empty {
  display: none;
}

.assistant-blank-greeting {
  display: none;
}

.assistant-state-chat.assistant-blank .assistant-blank-greeting {
  display: block;
  margin: 0 0 20px;
  width: min(100% - 2 * var(--gutter), var(--assistant-workbench-w));
  color: rgba(64, 61, 56, 0.66);
  font-family: var(--font-serif-cn);
  font-size: clamp(21px, 2.3vw, 27px);
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
}

/* Tighter primary sidebar rhythm: four entries read as one navigation group. */
.assistant-records {
  --assistant-sidebar-row-h: 42px;
  gap: 2px;
}

.assistant-tabs {
  gap: 2px;
  margin-bottom: 0;
}

.assistant-record-new,
.assistant-tabs button {
  min-height: var(--assistant-sidebar-row-h);
}

.assistant-record-panel {
  margin-top: 22px;
}

.assistant-search-results h3{
  margin: 0 0 8px;
  padding-left: 8px;
  color: #8A8D88;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

.assistant-search-results button{
  min-height: 32px;
  padding: 5px 8px;
  color: #5F625F;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 400;
  line-height: 22px;
}

.assistant-panel-search {
  position: relative;
  margin-bottom: 18px;
}

.assistant-panel-search input {
  width: 100%;
  min-height: 39px;
  padding: 0 39px 0 14px;
  color: var(--ink);
  background: rgba(252, 251, 247, 0.72);
  border: 1px solid rgba(199, 191, 178, 0.72);
  border-radius: 11px;
  outline: none;
  font-size: var(--fs-14);
  transition: background var(--t-fast), border-color var(--t-fast);
}

.assistant-panel-search input:focus {
  border-color: rgba(15, 74, 67, 0.34);
  background: rgba(252, 251, 247, 0.96);
  box-shadow: none;
}

.assistant-panel-search button {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(80, 76, 69, 0.5);
  border-radius: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 1;
  transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast);
}

.assistant-panel-search input:placeholder-shown + button {
  opacity: 0;
  pointer-events: none;
}

.assistant-panel-search button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-panel-search button:hover {
  color: var(--teal);
  background: rgba(15, 74, 67, 0.055);
}

.assistant-search-results{
  display: grid;
  gap: 2px;
}

/* 整卡可点，保留一层极轻外投影即可；原先的 inset 描边是第二层，已去掉。 */

.assistant-memory-add {
  min-height: 36px;
  margin-top: 10px;
  padding: 0 8px;
  color: var(--teal);
  border-radius: var(--r-pill);
  cursor: pointer;
  font-size: 15px;
  line-height: 22px;
  text-align: left;
}

.assistant-memory-add:hover {
  background: rgba(255, 255, 255, 0.48);
}

/* Quiet motion layer: state changes should feel cushioned, never decorative. */
.assistant-state-empty .assistant-landing,
.assistant-state-chat .assistant-chat-section {
  animation: assistantPageSettle 220ms var(--assistant-motion-ease) both;
}

.assistant-record-panel:not([hidden]),
.assistant-search-results:not([hidden]){
  animation: assistantPanelSettle var(--assistant-motion-quick) var(--assistant-motion-ease) both;
}

.assistant-search-results button,
.assistant-memory-add{
  transition: color var(--t), background var(--t), box-shadow var(--t), opacity var(--assistant-motion-quick) ease, transform var(--assistant-motion-quick) var(--assistant-motion-ease);
}

/* 列表行不做位移：hover 只改文字色与极浅底色（定义见文件末尾抽屉样式区）。 */

.assistant-thread .assistant-message {
  animation: assistantMessageSettle 190ms var(--assistant-motion-ease) both;
}

@keyframes assistantPageSettle {
  from {
    opacity: 0.96;
  }

  to {
    opacity: 1;
  }
}

@keyframes assistantPanelSettle {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes assistantMessageSettle {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-state-empty .assistant-landing,
.assistant-state-chat .assistant-chat-section,
.assistant-record-panel:not([hidden]),
.assistant-search-results:not([hidden]),
.assistant-thread .assistant-message{
    animation: none !important;
  }

  .assistant-state-chat .assistant-records,
.assistant-state-chat .assistant-records[hidden],
.assistant-state-chat.assistant-records-open .assistant-records,
.assistant-search-results button,
.assistant-memory-add{
    transition: none !important;
  }
}

/* Drawer motion guardrails: keep the chat workbench in its original channel and
   clip a fixed-width drawer interior, so closing never visibly crushes text. */
.assistant-state-chat .assistant-records > * {
  width: calc(var(--assistant-drawer-w) - 36px);
  min-width: calc(var(--assistant-drawer-w) - 36px);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 130ms ease, transform 180ms var(--assistant-motion-ease);
}

.assistant-state-chat.assistant-records-open .assistant-records > * {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 45ms;
}

@media (min-width: 721px) {
  .assistant-state-chat.assistant-records-open .assistant-chat-section {
    width: calc(100vw - var(--assistant-drawer-w));
    margin-left: var(--assistant-drawer-w);
  }

  .assistant-state-chat.assistant-records-open .assistant-composer-dock {
    left: var(--assistant-drawer-w);
    width: calc(100vw - var(--assistant-drawer-w));
  }

  .assistant-state-chat.assistant-records-open .assistant-column--chat,
  .assistant-state-chat.assistant-records-open .assistant-conversation-bar,
  .assistant-state-chat.assistant-records-open .assistant-thread,
  .assistant-state-chat.assistant-records-open .assistant-composer-dock {
    transform: none;
  }
}

@media (max-width: 720px) {
  .assistant-state-chat .assistant-records > * {
    width: calc(min(320px, 88vw) - 36px);
    min-width: calc(min(320px, 88vw) - 36px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-state-chat .assistant-records > * {
    transition: none !important;
  }
}

/* 2026-07-10 Mobile assistant repair: single-column chat, overlay records drawer,
   and the same global menu affordance used by the rest of the site. */
@media (max-width: 720px) {
  .assistant-page {
    overflow-x: hidden;
  }

  .assistant-page.assistant-records-mobile-open {
    overflow: hidden;
    touch-action: none;
  }

  .assistant-page.assistant-state-chat .mobile-menu-overlay {
    z-index: 70;
  }

  .assistant-main,
  .assistant-state-chat .assistant-main {
    min-height: 100svh;
  }

  .assistant-landing {
    min-height: calc(100svh - var(--mobile-header-height));
    padding: clamp(48px, 8vh, 70px) 0 max(24px, env(safe-area-inset-bottom));
  }

  .assistant-composer--landing {
    margin-top: clamp(28px, 4vh, 38px);
  }

  .assistant-composer,
  .assistant-composer.assistant-composer--voice-active {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 60px;
    padding: 8px 8px 8px 14px;
    border-radius: 28px;
  }

  .assistant-composer textarea {
    min-width: 0;
    min-height: 44px;
    padding: 10px 4px;
    font-size: 16px;
    line-height: 1.4;
  }

  .assistant-composer--landing textarea {
    padding-right: 2px;
  }

  .assistant-composer textarea::placeholder {
    white-space: normal;
  }

  .assistant-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .assistant-icon-button {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .assistant-state-chat .assistant-chat-section {
    width: 100vw;
    min-height: 100svh;
    margin-left: 0;
    padding: calc(var(--mobile-header-height) + 22px) 0 calc(var(--assistant-dock-h, 164px) + 22px + env(safe-area-inset-bottom));
  }

  .assistant-state-chat.assistant-records-open .assistant-chat-section {
    width: 100vw;
    margin-left: 0;
  }

  .assistant-state-chat.assistant-records-open .assistant-column--chat,
  .assistant-state-chat.assistant-records-open .assistant-conversation-bar,
  .assistant-state-chat.assistant-records-open .assistant-thread {
    transform: none;
  }

  .assistant-chat-shell,
  .assistant-state-chat .assistant-column--chat,
  .assistant-state-chat .assistant-conversation-bar,
  .assistant-state-chat .assistant-thread {
    width: 100%;
    max-width: none;
  }

  .assistant-state-chat .assistant-column--chat {
    margin: 0;
  }

  .assistant-state-chat .assistant-conversation-bar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 68;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    column-gap: 4px;
    min-height: var(--mobile-header-height);
    margin: 0;
    padding: 0 12px;
    background: rgba(251, 249, 245, 0.96);
    border-bottom: 1px solid rgba(216, 209, 197, 0.72);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
    backdrop-filter: saturate(150%) blur(10px);
    -webkit-backdrop-filter: saturate(150%) blur(10px);
  }

  .assistant-state-chat .assistant-conversation-bar > .assistant-chat-tool[data-open-records] {
    display: inline-grid;
    grid-column: 1;
    width: 44px;
    height: 44px;
    place-items: center;
    justify-self: start;
  }

  .assistant-state-chat .assistant-conversation-bar > .assistant-chat-tool[data-open-records] svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.7;
  }

  .assistant-state-chat .assistant-chat-title {
    grid-column: 2;
    justify-self: center;
    max-width: 100%;
    color: rgba(27, 27, 24, 0.86);
    font-size: var(--fs-15);
    font-weight: 600;
    letter-spacing: 0;
    text-align: center;
  }

  .assistant-state-chat .assistant-chat-title.is-empty {
    color: rgba(15, 74, 67, 0.72);
  }

  .assistant-state-chat .assistant-chat-tool--new {
    display: inline-grid;
    grid-column: 3;
    width: 44px;
    height: 44px;
    place-items: center;
    justify-self: end;
  }

  .assistant-state-chat .assistant-chat-tool--new svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.7;
  }

  .assistant-state-chat .assistant-thread {
    min-height: calc(100svh - var(--mobile-header-height) - var(--assistant-dock-h, 164px) - 44px);
    margin: 0;
    padding: 14px 24px 38px;
  }

  .assistant-message,
  .assistant-message--user,
  .assistant-message--assistant {
    margin-bottom: 30px;
  }

  .assistant-message--assistant {
    max-width: calc(100vw - 48px);
  }

  .assistant-bubble {
    max-width: 78vw;
    padding: 14px 16px;
    border-radius: 22px;
    font-size: var(--fs-15);
  }

  .assistant-open-text {
    max-width: calc(100vw - 48px);
    font-size: var(--fs-15);
    line-height: 1.76;
  }

  .assistant-card {
    max-width: calc(100vw - 48px);
    border-radius: 18px;
  }

  .assistant-state-chat .assistant-composer-dock,
  .assistant-state-chat.assistant-records-open .assistant-composer-dock {
    left: 0;
    width: 100vw;
    padding: 16px 12px max(12px, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(251, 249, 245, 0), rgba(251, 249, 245, 0.94) 22%, var(--paper) 100%);
    transform: none;
  }

  .assistant-state-chat .assistant-composer--chat,
  .assistant-state-chat .assistant-smallprint {
    width: calc(100vw - 24px);
    max-width: none;
  }

  .assistant-state-chat .assistant-composer--chat {
    min-height: 60px;
  }

  .assistant-smallprint {
    margin-top: 7px;
    padding: 0 6px;
    font-size: 11px;
    line-height: 1.45;
  }

  .assistant-status,
  .assistant-error,
  .assistant-error:not([hidden]) {
    left: 50%;
    bottom: calc(var(--assistant-dock-h, 164px) + 12px + env(safe-area-inset-bottom));
    z-index: 46;
    width: calc(100vw - 48px);
    max-width: 420px;
    padding: 9px 12px;
    border-radius: 11px;
    box-shadow: 0 14px 34px -28px rgba(10, 51, 46, 0.32);
  }

  .assistant-voice-feedback,
  .assistant-voice-error {
    width: fit-content;
    max-width: calc(100vw - 48px);
    margin-bottom: 10px;
    padding: 8px 11px;
    text-align: left;
    box-shadow: 0 12px 28px -26px rgba(10, 51, 46, 0.34);
  }

  .assistant-backdrop {
    background: rgba(10, 32, 28, 0.24);
  }

  .assistant-state-chat.assistant-records-open .assistant-backdrop:not([hidden]) {
    display: block !important;
  }

  .assistant-state-chat .assistant-records,
  .assistant-state-chat .assistant-records[hidden] {
    inset: 0 auto 0 0;
    z-index: 74;
    width: min(82vw, 340px);
    min-width: 0;
    max-width: 86vw;
    height: 100svh;
    padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #EFECE7;
    border-right: 1px solid rgba(188, 178, 161, 0.52);
    box-shadow: 24px 0 54px -34px rgba(10, 51, 46, 0.42);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-100%);
    transition: opacity 180ms ease, transform 240ms var(--assistant-drawer-ease), visibility 0s linear 240ms;
  }

  .assistant-state-chat.assistant-records-open .assistant-records {
    width: min(82vw, 340px);
    padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition: opacity 180ms ease, transform 240ms var(--assistant-drawer-ease), visibility 0s;
  }

  .assistant-state-chat .assistant-records > * {
    width: 100%;
    min-width: 0;
  }

  .assistant-records__head {
    min-height: 50px;
    margin-bottom: 8px;
  }

  .assistant-records__collapse {
    width: 44px;
    height: 44px;
    margin-right: -7px;
  }

  .assistant-drawer-bottom {
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }

  .assistant-state-chat.assistant-blank .assistant-composer-dock {
    top: var(--mobile-header-height);
    bottom: 0;
    padding-left: 12px;
    padding-right: 12px;
  }

  .assistant-state-chat.assistant-blank .assistant-blank-greeting {
    width: calc(100vw - 48px);
    margin-bottom: 18px;
    font-size: 23px;
  }
}

@media (max-width: 390px) {
  .assistant-composer {
    gap: 5px;
    padding-left: 12px;
  }

  .assistant-actions {
    gap: 4px;
  }

  .assistant-icon-button {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }
}

/* Account and confirmed-memory panels layer above the assistant drawer without
   changing the chat workbench geometry. */
.assistant-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(10, 32, 28, 0.26);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.assistant-panel {
  position: fixed;
  z-index: 112;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(440px, calc(100vw - 40px));
  max-height: min(680px, calc(100svh - 48px));
  overflow: hidden;
  color: var(--ink);
  background: var(--flusso-bg);
  border: 1px solid rgba(188, 178, 161, 0.72);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(27, 27, 24, 0.025);
  transform: translate(-50%, -50%);
}

.assistant-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid rgba(216, 209, 197, 0.68);
}

.assistant-panel__head h2 {
  margin: 0;
  font-family: var(--font-serif-cn);
  font-size: var(--fs-21);
  font-weight: 500;
}

.assistant-panel__close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: rgba(64, 61, 56, 0.7);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

/* hover 与键盘焦点必须分开：原本两者合写且带 outline: none，
   旧版靠全局 box-shadow 环兜住焦点；焦点环改用 outline 后，这条 outline: none
   会直接把弹窗关闭键的键盘焦点抹掉。拆开后 hover 只管鼠标，焦点走全局 outline。 */
/* 图标按钮只改颜色：44px 是命中区，不等于该被整块染色。 */
.assistant-panel__close:hover {
  color: var(--teal);
}

.assistant-panel__close:focus-visible {
  color: var(--teal);
  outline: var(--flusso-focus-ring);
  outline-offset: var(--flusso-focus-offset);
}

.assistant-panel__body {
  overflow-y: auto;
  padding: 20px;
}

.assistant-panel__body > p,
.assistant-panel__intro,
.assistant-panel-empty p,
.assistant-panel__note {
  margin: 0;
  color: rgba(80, 76, 69, 0.76);
  font-size: var(--fs-14);
  line-height: 1.68;
}

.assistant-panel__status {
  margin-top: 14px !important;
  color: rgba(15, 74, 67, 0.82) !important;
}

.assistant-auth-form {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.assistant-auth-form label{
  color: rgba(80, 76, 69, 0.68);
  font-size: var(--fs-13);
  font-weight: 600;
}

.assistant-auth-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--flusso-text);
  background: var(--flusso-surface);
  border: 1px solid rgba(184, 174, 157, 0.58);
  border-radius: var(--flusso-radius-control);
  box-shadow: none;
  font: inherit;
}

.assistant-auth-form input:not([type="checkbox"])::placeholder {
  color: var(--flusso-muted);
  opacity: 0.82;
}

.assistant-password-field {
  position: relative;
}

.assistant-auth-form .assistant-password-field input {
  min-width: 0;
  padding-right: 56px;
}

.assistant-auth-form .assistant-password-field .password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 44px;
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  padding: 0;
  margin: 0;
  color: rgba(12, 78, 68, 0.72);
  background: transparent !important;
  border: 0 !important;
  border-radius: 50%;
  box-shadow: none !important;
  cursor: pointer;
  filter: none;
  -webkit-tap-highlight-color: transparent;
  transform: none;
  transition:
    color 140ms ease,
    opacity 100ms ease,
    transform 90ms ease;
}

.assistant-auth-form .assistant-password-field .password-toggle-icon {
  position: absolute;
  inset: 13px;
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: none;
  opacity: 0;
  shape-rendering: geometricPrecision;
  transform: scale(0.9);
  transform-origin: center;
  transition:
    opacity 150ms cubic-bezier(0.2, 0, 0, 1),
    transform 160ms cubic-bezier(0.2, 0, 0, 1);
}

.assistant-auth-form .assistant-password-field .password-toggle-icon[data-password-icon="eye"] {
  opacity: 1;
  transform: scale(1);
}

.assistant-auth-form .assistant-password-field .password-toggle[aria-pressed="true"] .password-toggle-icon[data-password-icon="eye"] {
  opacity: 0;
  transform: scale(0.9);
}

.assistant-auth-form .assistant-password-field .password-toggle[aria-pressed="true"] .password-toggle-icon[data-password-icon="eye-off"] {
  opacity: 1;
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .assistant-auth-form .assistant-password-field .password-toggle,
  .assistant-auth-form .assistant-password-field .password-toggle-icon {
    transition: none;
  }
}

@media (hover: hover) {
  .assistant-auth-form .assistant-password-field .password-toggle:hover {
    color: rgb(10, 82, 70) !important;
    background: transparent !important;
    box-shadow: none !important;
  }
}

.assistant-auth-form .assistant-password-field .password-toggle:active {
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0.82;
  transform: scale(0.96);
}

.assistant-auth-form .assistant-password-field .password-toggle:focus {
  outline: none;
}

.assistant-auth-form .assistant-password-field .password-toggle:focus-visible {
  outline: var(--flusso-focus-ring);
  outline-offset: var(--flusso-focus-offset);
  background: transparent !important;
  box-shadow: none !important;
}

.assistant-auth-form .assistant-password-field .password-toggle:disabled {
  color: var(--flusso-muted) !important;
  background: transparent !important;
  cursor: not-allowed;
  opacity: 0.45;
}

/* 输入框与按钮走不同的焦点逻辑：边框变品牌绿 + 一层极轻 halo，不用 outline。
   halo 从 3px 收到 2px —— 冷绿压在暖纸上本就偏冷，越窄越不容易读成"第二层边框"。
   alpha 维持 0.08，不上调。 */
.assistant-auth-form input:not([type="checkbox"]):focus,
.assistant-auth-form input:not([type="checkbox"]):focus-visible {
  border-color: var(--flusso-green);
  box-shadow: var(--flusso-focus-halo);
  outline: none;
}

.assistant-auth-form input:not([type="checkbox"])[aria-invalid="true"] {
  border-color: rgba(160, 66, 58, 0.72);
}

.assistant-auth-form input:not([type="checkbox"])[aria-invalid="true"]:focus,
.assistant-auth-form input:not([type="checkbox"])[aria-invalid="true"]:focus-visible {
  border-color: rgba(160, 66, 58, 0.82);
  box-shadow: 0 0 0 3px rgba(160, 66, 58, 0.09);
}

.assistant-auth-form button,
.assistant-panel__primary{
  min-height: 44px;
  padding: 0 15px;
  color: #FFFFFF;
  background: var(--flusso-green);
  border: 1px solid var(--flusso-green);
  border-radius: 14px;
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-14);
  font-weight: 600;
}

.assistant-auth-form button:hover,
.assistant-panel__primary:hover{
  background: var(--flusso-green-dark);
  border-color: var(--flusso-green-dark);
}

.assistant-auth-form button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.assistant-auth-form button {
  border-radius: var(--flusso-radius-control);
}

.assistant-auth-form button[type="submit"] {
  border-radius: var(--flusso-radius-primary);
}

.assistant-auth-form button[data-auth-password-submit] {
  border-radius: var(--flusso-radius-control);
}

.assistant-auth-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 15px;
  background: var(--flusso-surface) !important;
  color: var(--flusso-text-soft) !important;
  border: 1px solid rgba(110, 106, 98, 0.26) !important;
  border-radius: var(--flusso-radius-control);
  box-shadow: none !important;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-14);
  font-weight: 500;
  text-decoration: none;
  gap: 11px;
}

.assistant-auth-google__icon {
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  object-fit: contain;
}

.assistant-auth-google__label {
  min-width: 0;
  white-space: nowrap;
}

.assistant-auth-google[aria-disabled="false"]:hover {
  background: #F7F4EE !important;
  color: var(--flusso-text) !important;
  border-color: rgba(110, 106, 98, 0.42) !important;
}

/* 登录区键盘焦点：显式声明，防止再次被局部 box-shadow: none 覆盖。
   这四类按钮此前都写了 box-shadow: none（.assistant-auth-links 还带 !important），
   而旧版全局焦点环正是用 box-shadow 画的，于是登录 / 邮件链接登录 / 创建账号 /
   忘记密码在 Tab 聚焦时完全没有反馈。改用 outline 后不再受 box-shadow 影响。
   （原 .assistant-auth-google:focus-visible 的重复实现已合并到这里。） */
.assistant-auth-form button:focus-visible,
.assistant-auth-links button:focus-visible,
.assistant-auth-google:focus-visible,
.assistant-panel__secondary:focus-visible {
  outline: var(--flusso-focus-ring);
  outline-offset: var(--flusso-focus-offset);
}

.assistant-auth-google[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

.assistant-auth-google.is-loading {
  opacity: 0.66;
}

.assistant-auth-google__note {
  margin: -4px 0 0 !important;
  color: var(--flusso-muted);
  font-size: var(--fs-12) !important;
  line-height: 1.45;
}

.assistant-auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--flusso-muted);
  font-size: var(--fs-12);
}

.assistant-auth-divider::before,
.assistant-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(216, 209, 197, 0.68);
}

.assistant-login-methods {
  padding: 14px 0;
  border-bottom: 1px solid rgba(80, 76, 69, 0.12);
}

.assistant-login-methods h3 {
  margin: 0 0 8px;
  font-size: var(--fs-13);
}

.assistant-login-methods p,
.assistant-login-methods small {
  margin: 5px 0 0;
  color: rgba(80, 76, 69, 0.72);
  font-size: var(--fs-13);
}

.assistant-login-methods p span {
  margin-right: 8px;
  color: var(--teal-strong);
}

.assistant-auth-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.assistant-auth-links button {
  padding: 0 !important;
  background: transparent !important;
  color: var(--flusso-green) !important;
  border: 0 !important;
  box-shadow: none !important;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.assistant-auth-links button:hover {
  color: var(--flusso-green-dark) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.assistant-auth-terms {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px !important;
  line-height: 1.45;
}

.assistant-auth-terms input {
  width: auto !important;
  margin-top: 2px;
}

.assistant-auth-actions {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.assistant-consent-settings {
  display: grid;
  gap: 0;
  margin-bottom: 8px;
}

.assistant-consent-settings h3 {
  margin: 2px 0 8px;
  color: rgba(80, 76, 69, 0.68);
  font-size: var(--fs-13);
  font-weight: 600;
}

.assistant-consent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  padding: 10px 0;
  border-top: 1px solid rgba(216, 209, 197, 0.72);
}

.assistant-consent-row strong{
  display: block;
  color: rgba(36, 35, 31, 0.88);
  font-size: var(--fs-14);
  font-weight: 600;
}

.assistant-consent-row small {
  display: block;
  margin-top: 3px;
  color: rgba(80, 76, 69, 0.66);
  font-size: var(--fs-12);
  line-height: 1.45;
}

.assistant-consent-control {
  display: grid;
  grid-template-columns: 38px;
  justify-items: center;
  gap: 3px;
}

.assistant-consent-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.assistant-consent-control > span {
  position: relative;
  width: 38px;
  height: 22px;
  background: rgba(80, 76, 69, 0.2);
  border-radius: 11px;
  transition: background var(--t-fast);
}

.assistant-consent-control > span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(10, 51, 46, 0.18);
  content: "";
  transition: transform var(--t-fast);
}

.assistant-consent-control input:checked + span {
  background: var(--teal);
}

.assistant-consent-control input:checked + span::after {
  transform: translateX(16px);
}

.assistant-consent-control input:focus-visible + span {
  outline: var(--flusso-focus-ring);
  outline-offset: var(--flusso-focus-offset);
}

.assistant-consent-control em {
  color: rgba(80, 76, 69, 0.62);
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}

.assistant-panel__secondary,
.assistant-panel__ghost{
  min-height: 44px;
  padding: 0 12px;
  color: rgba(15, 74, 67, 0.88);
  background: transparent;
  border: 1px solid rgba(15, 74, 67, 0.24);
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-14);
}

.assistant-auth-form .assistant-panel__secondary {
  color: var(--flusso-green);
  background: var(--flusso-surface);
  border-color: rgba(15, 74, 67, 0.28);
  border-radius: var(--flusso-radius-control);
  box-shadow: none;
}

.assistant-auth-form [data-auth-password-submit] + [data-auth-show-magic] {
  margin-top: 3px;
}

.assistant-panel__ghost {
  width: 100%;
  margin-top: 14px;
  color: rgba(80, 76, 69, 0.72);
  border-color: rgba(188, 178, 161, 0.7);
}

.assistant-panel__secondary:hover,
.assistant-panel__ghost:hover{
  color: var(--teal);
  background: rgba(15, 74, 67, 0.05);
}

.assistant-auth-form .assistant-panel__secondary:hover {
  color: var(--flusso-green);
  background: var(--flusso-green-soft);
  border-color: rgba(15, 74, 67, 0.4);
}

.assistant-panel-empty {
  display: grid;
  gap: 9px;
  padding: 22px 0;
  text-align: center;
}

.assistant-panel-empty .assistant-panel__primary {
  width: fit-content;
  justify-self: center;
  margin-top: 7px;
}

.assistant-memory-item {
  padding: 14px 0;
  border-top: 1px solid rgba(216, 209, 197, 0.72);
}

.assistant-memory-item p {
  margin: 6px 0 0;
  color: rgba(36, 35, 31, 0.88);
  font-size: var(--fs-14);
  line-height: 1.62;
  white-space: pre-wrap;
}

.assistant-memory-edit-form {
  display: grid;
  gap: 9px;
}

.assistant-memory-edit-form label {
  color: rgba(36, 35, 31, 0.78);
  font-size: var(--fs-13);
  font-weight: 600;
}

.assistant-memory-edit-form textarea {
  width: 100%;
  min-height: 76px;
  padding: 10px 11px;
  color: var(--ink);
  background: #FFFFFF;
  border: 1px solid rgba(188, 178, 161, 0.82);
  border-radius: 6px;
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}

.assistant-memory-edit-form > div {
  display: flex;
  gap: 8px;
}

.assistant-memory-edit-form button {
  min-height: 36px;
  padding: 0 11px;
  color: rgba(15, 74, 67, 0.88);
  background: transparent;
  border: 1px solid rgba(15, 74, 67, 0.24);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-13);
}

.assistant-memory-edit-form button[type="submit"] {
  color: #FFFFFF;
  background: var(--teal);
  border-color: var(--teal);
}

.assistant-memory-delete-confirm {
  display: grid;
  gap: 10px;
}

.assistant-memory-delete-confirm p {
  margin: 0;
  color: rgba(80, 76, 69, 0.76);
  font-size: var(--fs-14);
  line-height: 1.58;
}

.assistant-memory-delete-confirm > div {
  display: flex;
  gap: 8px;
}

.assistant-memory-delete-confirm button {
  min-height: 36px;
  padding: 0 11px;
  color: rgba(15, 74, 67, 0.88);
  background: transparent;
  border: 1px solid rgba(15, 74, 67, 0.24);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-13);
}

.assistant-memory-delete-confirm [data-memory-delete-confirm-action] {
  color: #FFFFFF;
  background: var(--teal);
  border-color: var(--teal);
}

/* ---- 记忆便签：新建表单与标题/时间 ---- */
.assistant-memory-new-form {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(216, 209, 197, 0.72);
}

.assistant-memory-new-form label {
  color: rgba(36, 35, 31, 0.78);
  font-size: var(--fs-13);
  font-weight: 600;
}

.assistant-memory-new-form input,
.assistant-memory-new-form textarea {
  width: 100%;
  padding: 9px 11px;
  color: var(--ink);
  background: #FFFFFF;
  border: 1px solid rgba(188, 178, 161, 0.82);
  border-radius: 6px;
  font: inherit;
  line-height: 1.55;
}

.assistant-memory-new-form input {
  min-height: 40px;
  padding: 0 11px;
}

.assistant-memory-new-form textarea {
  min-height: 76px;
  resize: vertical;
}

.assistant-memory-new-form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.assistant-memory-new-form__actions button {
  min-height: 40px;
  padding: 0 15px;
  color: #FFFFFF;
  background: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-13);
  font-weight: 600;
}

.assistant-memory-new-form__actions button:disabled {
  opacity: 0.6;
  cursor: default;
}

.assistant-memory-title {
  display: block;
  color: var(--ink);
  font-size: var(--fs-14);
  font-weight: 600;
}

/* 候选记忆的状态标记（待确认） */
.assistant-memory-status {
  display: inline-block;
  margin-bottom: 6px;
  padding: 1px 8px;
  color: rgba(146, 96, 20, 0.92);
  background: rgba(202, 150, 60, 0.16);
  border-radius: 999px;
  font-size: var(--fs-12);
  font-weight: 600;
}

/* 次级「＋新建便签」入口：与列表拉开距离，不抢主体 */
.assistant-memory-add {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(216, 209, 197, 0.72);
}

.assistant-memory-add .assistant-panel__secondary {
  width: 100%;
}

/* ---- 会话搜索面板 ---- */
.assistant-search-field {
  font: inherit;
}

.assistant-search-field input::-webkit-search-cancel-button {
  display: none;
}

.assistant-search-body {
  margin-top: 12px;
}

.assistant-search-results {
  display: block;
}

.assistant-account-toast {
  position: fixed;
  z-index: 116;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 14px;
  color: #FFFFFF;
  background: rgba(15, 74, 67, 0.96);
  border-radius: 6px;
  box-shadow: 0 16px 38px -26px rgba(10, 51, 46, 0.58);
  font-size: var(--fs-14);
  line-height: 1.45;
  text-align: center;
  transform: translateX(-50%);
}

.assistant-user-plan {
  margin-left: auto;
  color: rgba(15, 74, 67, 0.72);
  font-size: var(--fs-12);
}

@media (max-width: 720px) {
  .assistant-page.assistant-account-panel-open {
    overflow: hidden;
    touch-action: none;
  }

  .assistant-panel-backdrop {
    z-index: 100;
    background: rgba(10, 32, 28, 0.3);
  }

  .assistant-panel {
    z-index: 102;
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(76svh, calc(100svh - max(20px, env(safe-area-inset-top))));
    border: 0;
    border-radius: 12px 12px 0 0;
    transform: none;
  }

  .assistant-memory-panel {
    inset: 0;
    width: 100%;
    max-height: none;
    border-radius: 0;
  }

  .assistant-panel__head {
    min-height: 58px;
    padding: max(8px, env(safe-area-inset-top)) 14px 0 18px;
  }

  .assistant-panel__body {
    padding: 18px 18px max(20px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-panel,
  .assistant-panel-backdrop,
  .assistant-account-toast {
    transition: none !important;
  }
}

/* ============================================================
   2026-07-10 移动端产品 polish（全部规则仅 ≤720px 生效，桌面零改动）
   目标气质：安静、可信、柔和、清楚、有呼吸感。
   Landing 垂直节奏：header → kicker → 标题 → 说明 → 输入 → 提示 → 免责声明
   ============================================================ */
@media (max-width: 720px) {
  /* —— A. Landing / 空会话 —— */
  .assistant-landing {
    padding: clamp(44px, 7.5vh, 64px) 0 max(20px, env(safe-area-inset-bottom));
  }

  .assistant-column {
    width: min(100% - 40px, 820px);
  }

  .assistant-kicker {
    margin-bottom: 16px;
  }

  .assistant-landing h1 {
    font-size: 30px;
    line-height: 1.3;
    letter-spacing: 0.01em;
  }

  .assistant-lead {
    margin-top: 10px;
    max-width: 21em;
    color: rgba(64, 61, 56, 0.72);
    font-size: 15px;
    line-height: 1.72;
  }

  .assistant-composer--landing {
    margin-top: 26px;
  }

  /* 输入胶囊：轻量 starting composer，收敛桌面级重阴影 */
  .assistant-composer {
    border-color: rgba(188, 178, 161, 0.66);
    box-shadow: 0 1px 2px rgba(27, 27, 24, 0.04), 0 10px 28px -22px rgba(10, 51, 46, 0.38);
  }

  .assistant-voice-hint {
    margin-top: 12px;
    max-width: 30em;
    color: rgba(111, 106, 98, 0.82);
    font-size: 12.5px;
    line-height: 1.66;
  }

  .assistant-boundary--landing {
    margin-top: 30px;
    color: rgba(111, 106, 98, 0.66);
    font-size: 11.5px;
    line-height: 1.6;
  }

  /* —— B. 聊天态：顶栏 —— */
  /* 下缘从硬线改为轻线 + 极弱投影 */
  .assistant-state-chat .assistant-conversation-bar {
    border-bottom: 1px solid rgba(216, 209, 197, 0.44);
    box-shadow: 0 8px 20px -18px rgba(27, 27, 24, 0.16);
  }

  .assistant-state-chat .assistant-chat-title {
    color: rgba(27, 27, 24, 0.82);
    font-size: var(--fs-15);
  }

  /* 空标题兜底：顶栏永远不出现裸空/裸数字 */
  .assistant-state-chat .assistant-chat-title.is-empty {
    color: rgba(27, 27, 24, 0.52);
    pointer-events: auto;
  }

  .assistant-state-chat .assistant-chat-title.is-empty::before {
    content: "新的对话";
  }

  /* —— 消息区：从 header 下约 26px 起步，一问一答成组 —— */
  .assistant-state-chat .assistant-chat-section {
    padding-top: calc(var(--mobile-header-height) + 10px);
  }

  .assistant-state-chat .assistant-thread {
    padding: 16px 24px 40px;
  }

  .assistant-message,
  .assistant-message--assistant {
    margin-bottom: 28px;
  }

  .assistant-message--user {
    margin-bottom: 18px;
  }

  .assistant-bubble {
    max-width: 77vw;
    padding: 12px 16px;
    border-radius: 20px 20px 8px 20px;
    font-size: var(--fs-15);
    line-height: 1.7;
  }

  /* 助手正文：稳定行宽、行高与段落节奏 */
  .assistant-open-text {
    font-size: 15.5px;
    line-height: 1.8;
  }

  .assistant-open-text p {
    margin-bottom: 14px;
  }

  .assistant-open-text ul {
    margin-bottom: 15px;
    padding-left: 1.1em;
  }

  .assistant-open-text li {
    margin: 6px 0;
  }

  .assistant-open-text blockquote {
    margin: 16px 0;
    padding-left: 14px;
    color: rgba(51, 51, 51, 0.78);
    border-left: 2px solid rgba(15, 74, 67, 0.34);
  }

  .assistant-open-text strong {
    font-weight: 600;
  }

  .assistant-open-text h3 {
    margin: 18px 0 10px;
    font-size: var(--fs-16);
  }

  /* 操作按钮：更轻、离正文稍收、指尖间距 */
  .assistant-feedback {
    gap: 10px;
    margin-top: 12px;
    opacity: 0.62;
  }

  .assistant-feedback button {
    width: 34px;
    height: 34px;
    min-height: 34px;
    color: rgba(80, 76, 69, 0.4);
  }

  /* —— Composer 底区：composer + 免责声明是一个整体 —— */
  .assistant-state-chat .assistant-composer-dock,
  .assistant-state-chat.assistant-records-open .assistant-composer-dock {
    padding: 14px 16px calc(max(10px, env(safe-area-inset-bottom)) + 2px);
    background: linear-gradient(180deg, rgba(251, 249, 245, 0), rgba(251, 249, 245, 0.96) 26%, var(--paper) 58%);
  }

  .assistant-state-chat .assistant-composer--chat,
  .assistant-state-chat .assistant-smallprint {
    width: calc(100vw - 32px);
  }

  .assistant-smallprint {
    margin-top: 8px;
    padding: 0 8px;
    color: rgba(111, 106, 98, 0.62);
    font-size: 11px;
    line-height: 1.5;
  }

  /* 状态/错误浮层：浮在 composer 正上方、与 composer 同宽，不挤压输入 */
  .assistant-status,
  .assistant-error,
  .assistant-error:not([hidden]) {
    bottom: calc(var(--assistant-dock-h, 164px) + 10px + env(safe-area-inset-bottom));
    width: calc(100vw - 32px);
    max-width: none;
  }

  /* 语音反馈：与 composer 左缘对齐、更轻 */
  .assistant-voice-feedback,
  .assistant-voice-error {
    justify-self: start;
    max-width: calc(100vw - 32px);
    box-shadow: 0 8px 22px -20px rgba(10, 51, 46, 0.3);
  }

  /* —— Drawer：backdrop 更轻、条目节奏收敛 —— */
  .assistant-backdrop {
    background: rgba(10, 32, 28, 0.18);
  }

  .assistant-records {
    --assistant-sidebar-row-h: 40px;
  }

  .assistant-state-chat .assistant-records {
    gap: 10px;
  }
}

/* 极窄屏（≤390px）：边距降到 20px，composer 同步收窄 */
@media (max-width: 390px) {
  .assistant-state-chat .assistant-thread {
    padding-left: 20px;
    padding-right: 20px;
  }

  .assistant-message--assistant,
  .assistant-open-text,
  .assistant-card {
    max-width: calc(100vw - 40px);
  }

  .assistant-state-chat .assistant-composer--chat,
  .assistant-state-chat .assistant-smallprint,
  .assistant-status,
  .assistant-error {
    width: calc(100vw - 28px);
  }
}

/* 2026-07-23 Narrow history-list and workspace-alignment repair. */
.assistant-state-chat .assistant-records,
.assistant-state-chat .assistant-records[hidden],
.assistant-state-chat.assistant-records-open .assistant-records {
  /* head · new chat · navigation · independently scrolling panel · fixed footer */
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.assistant-record-panel {
  min-height: 0;
}

.assistant-history-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.assistant-history-list {
  min-height: 0;
  flex: 1 1 auto;
  align-content: start;
  gap: 2px;
  padding: 1px 0 6px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(58, 82, 76, 0.16) transparent;
}

.assistant-history-list::-webkit-scrollbar {
  width: 5px;
}

.assistant-history-list::-webkit-scrollbar-track {
  background: transparent;
}

.assistant-history-list::-webkit-scrollbar-thumb {
  background: rgba(58, 82, 76, 0.16);
  border-radius: var(--r-pill);
}

.assistant-history-item {
  position: relative;
  min-height: 34px;
  gap: 2px;
  padding: 2px 3px;
  border-radius: 9px;
  transition: background var(--t-fast);
}

.assistant-history-item:hover {
  background: rgba(255, 255, 255, 0.46);
}

.assistant-history-item.is-active {
  background: rgba(15, 74, 67, 0.065);
}

/* 这一条比文件前面那条晚出现，所以它说了算。
   原来它写死了单行行高 + nowrap + ellipsis —— 那是「一行显示第一句话」时代的
   写法；现在行是「标题（最多两行）+ 进度」两层，这三条必须去掉，
   否则标题被 nowrap 钉死、-webkit-line-clamp 永远不生效（会从中间裁掉且没有省略号）。
   min-height 保留，它是行的触控高度下限，不是行高。 */
.assistant-history-item__open {
  min-width: 0;
  min-height: 30px;
  padding: 0 8px;
  overflow: hidden;
  color: rgba(36, 35, 31, 0.7);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  align-content: center;
}

.assistant-history-item.is-active .assistant-history-item__open {
  color: rgba(15, 74, 67, 0.92);
  font-weight: 500;
}

.assistant-history-item__open:hover {
  color: var(--teal-strong);
  background: transparent;
}

.assistant-history-item__open:focus-visible {
  color: var(--teal-strong);
  background: transparent;
}

/* 不做定位上下文：菜单挂到整行（.assistant-history-item 是 relative）上，
   这样 top: 100% 是从行底算的、right: 0 对齐行的右边缘，而不是从这个
   30px 的小格子算 —— 原来菜单几乎贴着行、又只对齐图标，看着是挂歪的。 */
.assistant-history-item__actions {
  position: static;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
}

.assistant-history-item__menu-toggle {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: rgba(58, 63, 59, 0.38);
  border-radius: 7px;
  cursor: pointer;
  opacity: 0;
  transition: color var(--t-fast), background var(--t-fast), opacity var(--t-fast);
}

.assistant-history-item__menu-toggle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}

/* 「当前会话」不靠常驻一个操作按钮来表达 —— .is-active 不再永久亮出 ⋯，
   和其余行一样只在 hover / 键盘焦点 / 菜单展开时浮现。 */
.assistant-history-item:hover .assistant-history-item__menu-toggle,
.assistant-history-item:focus-within .assistant-history-item__menu-toggle,
.assistant-history-item__menu-toggle[aria-expanded="true"] {
  opacity: 0.72;
}

/* 只提亮图标，不给按钮自己的底色。
   ⋯ 是 30px 方块（r7）坐在 34px 的行（r14）右端，两块填充一嵌套，两条圆角
   在同一个角上交叉，看起来就是"两层阴影叠在一起"。菜单打开时改由整行承担
   高亮（见下面的 :has 规则），全程只有一个填充形状。 */
.assistant-history-item__menu-toggle:hover,
.assistant-history-item__menu-toggle[aria-expanded="true"] {
  color: var(--teal-strong);
  background: transparent;
  opacity: 1;
}

/* 键盘焦点是唯一保留底色的状态：assistant 全局把 outline 关掉了
   （.assistant-page :focus-visible { outline: none !important }），
   焦点只剩底色可用，这一层拿掉就等于键盘用户看不见自己在哪。 */
.assistant-history-item__menu-toggle:focus-visible {
  color: var(--teal-strong);
  background: rgba(15, 74, 67, 0.065);
  opacity: 1;
}

/* 菜单展开时"是哪一行"由行本身表达，和 hover 用同一层底色。 */
.assistant-history-item:has(.assistant-history-item__menu-toggle[aria-expanded="true"]) {
  background: var(--assistant-hover-tint);
}

.assistant-history-item__menu-toggle:focus-visible {
  outline: var(--flusso-focus-ring);
  outline-offset: var(--flusso-focus-offset);
}

/* 抽屉里的行菜单与右上角「更多对话选项」共用同一套外壳：同样的圆角、
   同样的中性面、同样的两层落影、同样的 44px 菜单项。唯一的差别是宽度 ——
   抽屉内容宽 204px，装不下右上角那 224px，收到 196px 右对齐到行的右边缘。
   注意 .assistant-records 是 overflow: hidden，菜单再宽会被直接切掉。 */
.assistant-history-menu {
  position: absolute;
  z-index: 8;
  top: calc(100% + 6px);
  right: 0;
  width: 196px;
  padding: 6px;
  overflow: hidden;
  color: var(--flusso-text);
  background: var(--flusso-surface);
  border: 1px solid rgba(28, 28, 30, 0.13);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(27, 27, 24, 0.09), 0 2px 8px rgba(27, 27, 24, 0.035);
}

.assistant-history-item.is-menu-up .assistant-history-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.assistant-history-menu button[role="menuitem"] {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 44px;
  gap: 12px;
  padding: 0 11px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
}

.assistant-history-menu button[role="menuitem"] svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-history-menu__danger {
  color: #A34238;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-history-menu__danger:hover {
    color: #8F332B;
    background: rgba(163, 66, 56, 0.055);
  }
}

.assistant-history-menu__danger:focus-visible {
  color: #8F332B;
  background: rgba(163, 66, 56, 0.055);
  outline: none;
}

.assistant-history-menu__confirm {
  padding: 8px 8px 6px;
}

.assistant-history-menu__confirm p {
  margin: 0 0 10px;
  color: var(--flusso-text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.assistant-history-menu__confirm > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.assistant-history-menu__confirm button {
  min-height: 34px;
  padding: 0 9px;
  color: var(--flusso-text-soft);
  background: transparent;
  border: 1px solid rgba(28, 28, 30, 0.14);
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}

.assistant-history-menu__confirm [data-history-delete-confirm] {
  color: #FFFFFF;
  background: #A34238;
  border-color: #A34238;
}

.assistant-drawer-bottom {
  min-height: 0;
  align-self: stretch;
}

@media (hover: none) {
  .assistant-history-item__menu-toggle {
    opacity: 0.58;
  }
}

@media (min-width: 721px) {
  :root {
    /* A slightly wider shared reading channel pulls its left edge closer to the
       drawer while keeping composer, disclaimer, toolbar, and messages aligned. */
    --assistant-workbench-w: 780px;
  }

  .assistant-chat-shell {
    width: min(calc(100% - 2 * var(--gutter)), var(--assistant-workbench-w));
    max-width: none;
  }

  .assistant-state-chat .assistant-column--chat,
  .assistant-state-chat .assistant-conversation-bar,
  .assistant-state-chat .assistant-thread {
    width: 100%;
    max-width: 100%;
  }

  .assistant-state-chat .assistant-composer--chat,
  .assistant-state-chat .assistant-smallprint {
    max-width: var(--assistant-workbench-w);
  }
}

@media (max-width: 720px) {
  .assistant-history-item {
    min-height: 40px;
  }

  .assistant-history-item__open {
    min-height: 36px;
    font-size: 13px;
  }

  .assistant-history-item__actions,
  .assistant-history-item__menu-toggle {
    width: 36px;
    height: 36px;
  }

  .assistant-history-item__actions {
    flex-basis: 36px;
  }
}

/* 2026-07-28 Unified assistant workspace: one warm, continuous canvas. */
:root {
  --page-bg: #f8f7f3;
  --main-bg: var(--page-bg);
  --sidebar-bg: var(--main-bg);
  --brand-green: #125348;
  --sidebar-border: rgba(48, 65, 59, 0.08);
  --divider: rgba(48, 65, 59, 0.07);
  --assistant-drawer-w: 240px;
}

.assistant-page,
.assistant-page .assistant-main,
.assistant-page .assistant-chat-section,
.assistant-page .assistant-landing,
.assistant-page .assistant-memory-workspace {
  background: var(--main-bg);
}

.assistant-state-chat .assistant-conversation-bar {
  background-color: var(--main-bg);
  background-image: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.assistant-state-chat .assistant-records,
.assistant-state-chat .assistant-records[hidden],
.assistant-state-chat.assistant-records-open .assistant-records {
  background: var(--sidebar-bg);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.assistant-state-chat.assistant-records-open .assistant-records {
  border-right: 1px solid var(--sidebar-border);
}

.assistant-record-new,
.assistant-tabs button,
.assistant-history-item{
  border-radius: 14px;
}

.assistant-auth-panel {
  border-radius: var(--flusso-radius-dialog);
}

/* 抽屉内列表行 hover 的唯一定义（前面各轮的重复规则已删除）：
   文字变绿 + 极浅底色，不投影、不位移；右侧的 ⋯ 由
   .assistant-history-item__menu-toggle 单独浮现。
   包进 (hover: hover) —— 侧栏一次会话要点很多行，触屏上不包会一直粘着上一次点过的行。
   选中态（.is-active / [aria-current]）与 :active 都在 media query 外，触屏不受影响。 */
@media (hover: hover) and (pointer: fine) {
  .assistant-record-new:hover,
.assistant-tabs button:hover,
.assistant-search-results button:hover,
.assistant-history-item:hover{
    color: var(--brand-green);
    background: rgba(18, 83, 72, 0.025);
    box-shadow: none;
  }
}

.assistant-tabs button.is-active,
.assistant-tabs button[aria-current="page"],
.assistant-history-item.is-active {
  color: var(--brand-green);
  background: rgba(0, 0, 0, 0.045);
  box-shadow: none;
  font-weight: 600;
}

.assistant-tabs button.is-active:hover,
.assistant-tabs button[aria-current="page"]:hover,
.assistant-history-item.is-active:hover {
  background: rgba(0, 0, 0, 0.052);
}

.assistant-record-panel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}

.assistant-drawer-bottom {
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}

.assistant-user-bar:hover {
  color: var(--brand-green);
  background: rgba(18, 83, 72, 0.025);
}

.assistant-user-bar {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  box-sizing: border-box;
  padding: 0 16px;
  color: var(--text-primary, #262624);
  background: transparent;
  border: 1px solid rgba(28, 28, 30, 0.16);
  border-radius: var(--flusso-radius-pill);
}

.assistant-user-bar:hover {
  background: rgba(0, 0, 0, 0.035);
  border-color: rgba(28, 28, 30, 0.24);
}

.assistant-records__head h2 {
  color: var(--brand-green);
  font-size: 19px;
  font-weight: 600;
}

.assistant-drawer-bottom {
  border-top-color: rgba(28, 28, 30, 0.08);
}

@media (max-width: 720px) {

  .assistant-page.assistant-state-chat .mobile-menu-overlay {
    display: none !important;
  }

  .assistant-state-chat .assistant-records,
  .assistant-state-chat .assistant-records[hidden],
  .assistant-state-chat.assistant-records-open .assistant-records {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: none;
  }
}

/* 2026-07-29 Mobile drawer refinement: the drawer and the chat header share a
   64px action band, while the navigation remains one uninterrupted rhythm. */
.assistant-user-chevron {
  display: none;
}

@media (max-width: 720px) {
  .assistant-state-chat.assistant-records-open .assistant-records {
    --assistant-sidebar-row-h: 44px;
    --assistant-sidebar-icon: 19px;
    --assistant-sidebar-pad-x: 10px;
    grid-template-rows: 64px 44px auto minmax(0, 1fr) auto;
    gap: 0;
    padding: max(2px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  }

  .assistant-state-chat.assistant-records-open .assistant-records__head {
    min-height: 64px;
    margin: 0;
  }

  .assistant-state-chat.assistant-records-open .assistant-records__head h2 {
    font-size: 19px;
    line-height: 1;
  }

  .assistant-state-chat.assistant-records-open .assistant-records__collapse {
    width: 44px;
    height: 44px;
    margin-right: -3px;
  }

  .assistant-state-chat.assistant-records-open .assistant-record-new,
  .assistant-state-chat.assistant-records-open .assistant-tabs button {
    min-height: 44px;
    padding-block: 0;
  }

  .assistant-state-chat.assistant-records-open .assistant-tabs {
    gap: 0;
    margin: 0;
  }

  .assistant-state-chat.assistant-records-open .assistant-record-panel {
    margin-top: 10px;
    padding-top: 10px;
  }

  .assistant-state-chat.assistant-records-open .assistant-drawer-bottom {
    gap: 10px;
    padding-top: 8px;
  }

  .assistant-state-chat.assistant-records-open .assistant-user-bar {
    min-height: 48px;
    padding: 0 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
    border-color: rgba(28, 28, 30, 0.13);
  }

  .assistant-state-chat.assistant-records-open .assistant-user-avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .assistant-state-chat.assistant-records-open .assistant-user-chevron {
    display: inline-grid;
    width: 20px;
    height: 20px;
    margin-left: auto;
    place-items: center;
    color: rgba(38, 38, 36, 0.48);
  }

  .assistant-state-chat.assistant-records-open .assistant-user-chevron svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}

/* 2026-07-29 Assistant neutral control system.
   Search mirrors the Resource Guide primitives inside an Assistant-only scope;
   composer and supporting actions use the same neutral surface/border tokens. */
.assistant-page {
  --assistant-surface-primary: #FFFFFF;
  --assistant-surface-secondary: #F5F5F3;
  --assistant-border-subtle: rgba(28, 28, 30, 0.14);
  --assistant-border-default: rgba(28, 28, 30, 0.24);
  --assistant-border-focus: rgba(28, 28, 30, 0.42);
  --assistant-text-primary: #262624;
  --assistant-text-secondary: #777773;
  --assistant-text-placeholder: #8B8B87;
  --assistant-focus-ring-neutral: rgba(0, 0, 0, 0.055);
}

/* Assistant-only search shell: follows the Resource Guide's 44px geometry and
   reuses its search-field/search-clear primitives without changing that page. */
.assistant-page .flusso-search-control {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 0 2px 0 12px;
  color: var(--assistant-text-primary);
  background: var(--assistant-surface-primary);
  border: 1px solid var(--assistant-border-subtle);
  border-radius: 14px;
  box-shadow: none;
  transition: border-color 160ms cubic-bezier(0.2, 0, 0, 1);
}

.assistant-page .flusso-search-control:focus-within {
  border-color: rgba(28, 28, 30, 0.45);
  box-shadow: none;
}

.assistant-page .flusso-search-control__icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--assistant-text-secondary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-page .flusso-search-control > input {
  min-width: 0;
  min-height: 42px;
  padding: 0;
  color: var(--assistant-text-primary);
  font-size: 14px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  outline: none;
}

.assistant-page .flusso-search-control > input::placeholder {
  color: var(--assistant-text-placeholder);
  opacity: 1;
}

.assistant-page .flusso-search-control > .search-clear {
  position: relative;
  inset: auto;
  transform: none;
  color: var(--assistant-text-secondary);
}

.assistant-page .flusso-search-control > .search-clear span {
  width: 11px;
  height: 1.5px;
  margin: -0.75px 0 0 -5.5px;
}

.assistant-page .flusso-search-control > .search-clear:hover {
  color: var(--assistant-text-primary);
}

.assistant-page .flusso-search-control > .search-clear:focus-visible {
  color: var(--assistant-text-primary);
  background: var(--assistant-surface-secondary);
  border-radius: 50%;
  outline: none;
}

/* The sidebar sign-in prompt is a compact supporting action, not a primary CTA. */
.assistant-record-panel .assistant-panel-empty {
  gap: 20px;
}

.assistant-record-panel .assistant-panel-empty > [data-auth-open] {
  justify-self: center;
  min-width: 72px;
  height: 40px;
  padding: 0 20px;
  color: var(--assistant-text-primary);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--assistant-border-subtle);
  border-radius: var(--flusso-radius-pill);
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  transition:
    color 160ms cubic-bezier(0.2, 0, 0, 1),
    background-color 160ms cubic-bezier(0.2, 0, 0, 1),
    border-color 160ms cubic-bezier(0.2, 0, 0, 1);
}

@media (hover: hover) and (pointer: fine) {
  .assistant-record-panel .assistant-panel-empty > [data-auth-open]:hover {
    color: var(--assistant-text-primary);
    background: var(--assistant-surface-secondary);
    border-color: var(--assistant-border-default);
  }
}

.assistant-record-panel .assistant-panel-empty > [data-auth-open]:active {
  color: var(--assistant-text-primary);
  background: #EEEEEC;
  border-color: var(--assistant-border-default);
}

.assistant-record-panel .assistant-panel-empty > [data-auth-open]:focus-visible {
  outline: 2px solid var(--assistant-border-focus);
  outline-offset: 2px;
}

/* One physical border and one very soft neutral focus halo. */
.assistant-composer,
.assistant-composer.assistant-composer--voice-active {
  background: var(--assistant-surface-primary);
  border-color: var(--assistant-border-subtle);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 8px 24px rgba(0, 0, 0, 0.04);
  outline: none;
  transition:
    background-color 160ms cubic-bezier(0.2, 0, 0, 1),
    border-color 160ms cubic-bezier(0.2, 0, 0, 1),
    box-shadow 160ms cubic-bezier(0.2, 0, 0, 1);
}

.assistant-composer:focus-within,
.assistant-composer--multiline:focus-within,
.assistant-composer.assistant-composer--voice-active:focus-within {
  border-color: rgba(28, 28, 30, 0.38);
  box-shadow:
    0 0 0 3px var(--assistant-focus-ring-neutral),
    0 8px 28px rgba(0, 0, 0, 0.05);
  outline: none;
}

.assistant-composer:has(textarea:focus-visible) {
  outline: none;
  outline-offset: 0;
}

.assistant-composer textarea {
  color: var(--assistant-text-primary);
}

.assistant-composer textarea::placeholder {
  color: var(--assistant-text-placeholder);
}

.assistant-actions {
  align-items: center;
  gap: 8px;
}

/* Microphone is neutral/secondary; send remains the only branded primary control. */
.assistant-icon-button--mic,
.assistant-icon-button--mic[disabled] {
  color: var(--assistant-text-secondary);
  background: var(--assistant-surface-primary);
  border-color: var(--assistant-border-subtle);
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-icon-button--mic:hover:not([disabled]) {
    color: var(--assistant-text-primary);
    background: var(--assistant-surface-secondary);
    border-color: var(--assistant-border-default);
    box-shadow: none;
  }
}

.assistant-icon-button--mic:active:not([disabled]) {
  color: var(--assistant-text-primary);
  background: #EEEEEC;
  border-color: var(--assistant-border-default);
  box-shadow: none;
}

.assistant-icon-button--mic:focus-visible,
.assistant-icon-button--send:focus-visible {
  outline: 2px solid var(--assistant-border-focus);
  outline-offset: 2px;
}

.assistant-icon-button--send,
.assistant-icon-button--send[disabled] {
  background: var(--flusso-green);
  border-color: var(--flusso-green);
  box-shadow: 0 4px 12px rgba(15, 74, 67, 0.14);
}

/* Desktop and mobile use the same upward send glyph and state motion. */
.assistant-icon-button--send .send-i {
  display: none;
}

.assistant-icon-button--send .send-up-i {
  display: block;
  width: 21px;
  height: 21px;
  stroke-width: 2.35;
  transform: translate(-50%, -50%);
  transition: transform 220ms ease, opacity 180ms ease;
}

.assistant-icon-button--send.is-sending .send-up-i {
  animation: assistantSendLift 560ms cubic-bezier(.2,.8,.2,1);
}

.assistant-icon-button--send.is-generating.is-sending .send-up-i {
  display: block;
}

.assistant-icon-button--send.is-generating.is-sending .stop-i {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-icon-button--send:hover:not([disabled]) {
    background: var(--flusso-green-dark);
    border-color: var(--flusso-green-dark);
  }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-record-panel .assistant-panel-empty > [data-auth-open],
  .assistant-page .flusso-search-control,
  .assistant-composer,
  .assistant-icon-button--mic,
  .assistant-icon-button--send {
    transition: none;
  }
}

/* Assistant keeps focus feedback inside the control itself.  The global site
   ring can otherwise linger after programmatic focus moves from the auth
   dialog close button to the drawer account entry, reading as a second grey
   circle rather than an interaction state. */
.assistant-page :focus-visible {
  outline: none !important;
  outline-offset: 0 !important;
}

.assistant-page .assistant-panel__close:focus-visible {
  color: var(--teal);
}

.assistant-page .assistant-record-panel .assistant-panel-empty > [data-auth-open]:focus-visible {
  border-color: var(--assistant-border-default);
}

.assistant-page .assistant-composer:focus-within,
.assistant-page .assistant-composer--multiline:focus-within,
.assistant-page .assistant-composer.assistant-composer--voice-active:focus-within {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 8px 24px rgba(0, 0, 0, 0.04);
}

/* Preserve the established mobile size and baseline.  22px geometry unchanged;
   stroke follows the same 1.8 user-unit rule as the rest of the icon system. */
@media (max-width: 720px) {
  .assistant-state-chat .assistant-conversation-bar > .assistant-chat-tool[data-open-records] svg,
  .assistant-state-chat .assistant-records__collapse svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    shape-rendering: geometricPrecision;
  }

  .assistant-state-chat .assistant-chat-tool--new svg,
  .assistant-state-chat .assistant-chat-tool--new:hover svg {
    transform: translateY(3px);
  }
}

/* The drawer has one terminal action now: the account row.  It occupies the
   bottom slot by itself; site navigation lives inside the signed-in menu. */
.assistant-drawer-bottom {
  gap: 0;
}

.assistant-account-menu__site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  gap: 14px;
  color: var(--flusso-text);
  border-bottom: 1px solid rgba(28, 28, 30, 0.08);
  text-decoration: none;
}

.assistant-account-menu__site > span {
  font-size: 14px;
  font-weight: 500;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-account-menu__site:hover {
    color: var(--flusso-green);
    text-decoration: none;
  }
}

/* The first account level belongs to the sidebar itself.  It expands upward
   inside the drawer, keeps the account capsule as its stable trigger, and
   deliberately has no modal header or close glyph.  Detail pages restore the
   regular centered panel through JavaScript. */
.assistant-auth-panel.assistant-auth-panel--inline {
  position: static;
  z-index: auto;
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  max-height: min(390px, 48svh);
  overflow-y: auto;
  color: var(--flusso-text);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  scrollbar-width: none;
}

.assistant-auth-panel.assistant-auth-panel--inline::-webkit-scrollbar {
  display: none;
}

.assistant-auth-panel.assistant-auth-panel--inline .assistant-panel__head {
  display: none;
}

.assistant-auth-panel.assistant-auth-panel--inline .assistant-panel__body {
  overflow: visible;
  padding: 4px 4px 10px;
}

.assistant-auth-panel.assistant-auth-panel--inline .assistant-auth-actions {
  gap: 0;
  margin-top: 0;
}

.assistant-auth-panel.assistant-auth-panel--inline .assistant-account-summary {
  min-height: 50px;
  gap: 10px;
}

.assistant-auth-panel.assistant-auth-panel--inline .assistant-account-summary__avatar {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.assistant-auth-panel.assistant-auth-panel--inline .assistant-account-summary__copy {
  gap: 1px;
}

.assistant-auth-panel.assistant-auth-panel--inline .assistant-account-summary__copy strong {
  font-size: 14px;
}

.assistant-auth-panel.assistant-auth-panel--inline .assistant-account-summary__copy small {
  font-size: 13px;
  line-height: 1.2;
  padding-left: 2px;
}

.assistant-auth-panel.assistant-auth-panel--inline .assistant-account-menu {
  margin-top: 8px;
}

.assistant-auth-panel.assistant-auth-panel--inline .assistant-account-menu > button,
.assistant-auth-panel.assistant-auth-panel--inline .assistant-account-menu__site {
  min-height: 46px;
}

.assistant-auth-panel.assistant-auth-panel--inline .assistant-account-menu__logout {
  min-height: 44px;
  margin-top: 10px;
}

/* The account capsule stays neutral.  Hover and press brighten its existing
   warm surface rather than tinting the whole control grey-green. */
@media (hover: hover) and (pointer: fine) {
  .assistant-state-chat.assistant-records-open .assistant-user-bar:hover {
    color: var(--flusso-green);
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(28, 28, 30, 0.18);
    box-shadow: 0 2px 12px rgba(28, 28, 30, 0.035), 0 0 0 1px rgba(255, 255, 255, 0.5);
  }
}

.assistant-state-chat.assistant-records-open .assistant-user-bar:active {
  color: var(--flusso-green);
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(28, 28, 30, 0.18);
  box-shadow: 0 1px 7px rgba(28, 28, 30, 0.025);
}

/* Current conversation actions live in one right-aligned cluster: new chat is
   nearest the title, while the overflow trigger owns the outer screen edge. */
.assistant-state-chat .assistant-conversation-bar {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

/* 宽度交给内容，不写死。
   原来这里按「有几个入口」写死了一串宽度（42 / 84 / 126px），靠 has-conversation
   与 has-review 两个类的组合来选 —— 结果漏了「只有 has-review」这一种组合：
   容器停在 42px，里面两个 42px 的按钮各被压成 21px。
   桌面端这个容器是 position: fixed（见下面 ≥721px 的规则），本来就不在栅格里，
   压根不会引起标题列回流；移动端第三列是 auto，内在宽度同样安全。
   所以没有任何理由写死宽度 —— 少一个类组合矩阵，就少一种漏掉的组合。 */
.assistant-conversation-actions {
  position: relative;
  z-index: 2;
  display: inline-flex;
  grid-column: 3;
  align-items: center;
  justify-self: end;
  gap: 0;
  height: 42px;
}

.assistant-conversation-actions .assistant-chat-tool {
  display: inline-grid;
  width: 42px;
  height: 42px;
}

.assistant-conversation-actions .assistant-chat-tool--new svg,
.assistant-conversation-actions .assistant-chat-tool--new:hover svg {
  transform: none;
}

.assistant-chat-tool--more svg {
  fill: currentColor;
  stroke: none;
}

.assistant-chat-tool--more[disabled] {
  cursor: default;
  opacity: 0.34;
}

.assistant-chat-tool--more[disabled]:hover {
  color: rgba(36, 51, 47, 0.68);
}

@media (min-width: 721px) {
  /* The assistant is an app workspace: its global actions belong to the
     workbench edge, not the centred reading column.
     右侧整理面板 dock 出来之后，「工作区边缘」就不再是视口边缘了 ——
     必须把 --assistant-aside-w 让出去，否则这些按钮会被压在面板底下：
     z-index 2 对 58，新建对话和整理入口都点不到（面板自己的 × 顶在上面）。
     未 dock 时该变量是 0，这个算式在两种状态下都成立。 */
  .assistant-state-chat .assistant-conversation-actions {
    position: fixed;
    top: 7px;
    /* 刻意不给 right 加 transition：这个值只随自定义属性
       --assistant-aside-w 变化，而 Chrome 无法为「仅由自定义属性引起的
       变化」建立插值对 —— 加上 transition 后 right 会永远停在起始值
       24px，按钮就一直压在面板底下（实测复现）。没有过渡时它立刻跳到位，
       面板本身的滑入动画盖在上面，观感可以接受。 */
    right: calc(max(24px, env(safe-area-inset-right)) + var(--assistant-aside-w));
  }
}

.assistant-state-chat .assistant-chat-title {
  position: absolute;
  left: 50%;
  width: min(46vw, calc(100% - 176px));
  transform: translateX(-50%);
}

.assistant-conversation-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 8px);
  right: 0;
  width: 224px;
  padding: 6px;
  overflow: hidden;
  color: var(--flusso-text);
  background: var(--flusso-surface);
  border: 1px solid rgba(28, 28, 30, 0.13);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(27, 27, 24, 0.09), 0 2px 8px rgba(27, 27, 24, 0.035);
}

.assistant-conversation-menu > [data-conversation-menu-actions] {
  display: grid;
  gap: 1px;
}

.assistant-conversation-menu button[role="menuitem"] {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 44px;
  gap: 12px;
  padding: 0 11px;
  color: var(--flusso-text);
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
}

.assistant-conversation-menu button[role="menuitem"] svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-conversation-menu button[role="menuitem"]:hover {
    background: rgba(28, 28, 30, 0.035);
  }
}

.assistant-conversation-menu button[role="menuitem"]:focus-visible {
  color: var(--flusso-green);
  background: rgba(15, 74, 67, 0.04);
}

.assistant-conversation-menu__danger {
  margin-top: 4px;
  border-top: 1px solid rgba(28, 28, 30, 0.08) !important;
  color: #A34238 !important;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-conversation-menu__danger:hover {
    color: #8F332B !important;
    background: rgba(163, 66, 56, 0.055) !important;
  }
}

.assistant-conversation-menu__confirm {
  padding: 8px 8px 6px;
}

.assistant-conversation-menu__confirm p {
  margin: 0 0 10px;
  color: var(--flusso-text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.assistant-conversation-menu__confirm > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.assistant-conversation-menu__confirm button {
  min-height: 34px;
  padding: 0 9px;
  color: var(--flusso-text-soft);
  background: transparent;
  border: 1px solid rgba(28, 28, 30, 0.14);
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}

.assistant-conversation-menu__confirm [data-conversation-delete-confirm] {
  color: #FFFFFF;
  background: #A34238;
  border-color: #A34238;
}

@media (max-width: 720px) {
  .assistant-state-chat .assistant-conversation-bar {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  .assistant-conversation-actions .assistant-chat-tool {
    display: inline-grid;
    width: 44px;
    height: 44px;
  }

  /* 容器按内容走；按钮保持 44px 触控尺寸。 */
  .assistant-conversation-actions {
    display: inline-flex;
    height: 44px;
  }

  .assistant-conversation-actions .assistant-chat-tool svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.7;
  }

  .assistant-state-chat .assistant-chat-title {
    width: calc(100% - 184px);
  }

  .assistant-conversation-menu {
    width: min(224px, calc(100vw - 24px));
  }
}

/* ============================================================
   2026-07-30 统一 hover 高亮色：改为「压暗」而不是「抬亮」
   上一版是 #FCFBF7，比画布只亮 4 级。画布 --page-bg 是 #F8F7F3，
   距离纯白只剩 7 级 —— 任何靠「更亮」表达的状态，天花板就是 7 级，
   再怎么调都注定看不见。这不是取值调得不对，是方向选错了。
   往暗走有 240 级余量，所以改成一层极浅的暖灰：Δ≈10 级，
   比原来强一倍多，仍然安静。

   同时这层只负责 hover。选中态换用带色度的绿调（见下方 .is-active）：
   hover 与选中的区分交给「有没有色度」，而不是交给「深一点浅一点」——
   同色系里靠明度差两档去区分两个状态，在浅色画布上永远是勉强的。
   ============================================================ */
:root {
  --assistant-hover-tint: rgba(64, 58, 46, 0.05);
}

@media (hover: hover) and (pointer: fine) {
  /* 抽屉内的入口行与列表行（文字仍变绿，只换底色）。 */
  .assistant-record-new:hover,
.assistant-tabs button:hover,
.assistant-search-results button:hover,
.assistant-history-item:hover{
    background: var(--assistant-hover-tint);
  }

  /* 主输入框不在这一组：它有自己的玻璃三档（--assistant-glass-*），
     原先那条 .assistant-composer:hover 已被下方玻璃块整条覆盖，删掉。 */

  /* 底部账户行：两种状态（落地页 / 聊天页抽屉展开）合并到同一底色，
     原来聊天页那层白色外圈会在暖白胶囊外再镶一道更白的边，去掉。 */
  .assistant-user-bar:hover,
  .assistant-state-chat.assistant-records-open .assistant-user-bar:hover {
    background: var(--assistant-hover-tint);
    box-shadow: none;
  }

}

/* ============================================================
   2026-07-29 主输入框：真玻璃
   之前那层「玻璃感」是假的 —— 纯白实底 + 一圈软阴影骗出来的通透，
   而且方向是反的：静止 #FFFFFF（最白），hover 反而降到 #FCFBF7，
   等于鼠标移上去把它调暗。现在把那个暖白定成常驻色，改成半透明 +
   backdrop-filter，hover 是「玻璃变实」而不是变色。

   聊天态下 .assistant-composer-dock 的背景是 transparent，正文直接从
   输入框底下滚过去 —— 所以这里的 blur 是真的有东西可糊，会跟着滚动。
   落地页背后是空画布，blur 不产生可见效果，只剩一层暖色调，不吃亏。

   透明度三档：静止 .82 →（悬停 .9）→ 聚焦 .96。越"要用它"越实：
   只是看着的时候是玻璃，手放上去开始变实，真的在打字时几乎不透 ——
   正在写的字不该和底下滚过去的正文抢对比度。

   blur 半径 28px 是刻意大于正文的字高：低于字高时底下的字只是"变糊但
   还能认"，那是噪声不是玻璃；大于字高之后才塌成一层随滚动流动的色晕。
   saturate 收到 160%，避免把消息里的绿/红强调色吸上来过饱和。
   ============================================================ */
.assistant-page {
  --assistant-glass: rgba(252, 251, 247, 0.82);
  --assistant-glass-hover: rgba(252, 251, 247, 0.9);
  --assistant-glass-focus: rgba(252, 251, 247, 0.96);
  --assistant-glass-filter: blur(28px) saturate(160%);
  /* 上缘受光、下缘落影 —— 厚度来自这一对内边，不是靠把外阴影加深。 */
  --assistant-glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(28, 28, 30, 0.035),
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 8px 24px rgba(0, 0, 0, 0.05);
}

.assistant-page .assistant-composer,
.assistant-page .assistant-composer.assistant-composer--voice-active {
  background: var(--assistant-glass);
  -webkit-backdrop-filter: var(--assistant-glass-filter);
  backdrop-filter: var(--assistant-glass-filter);
  border-color: rgba(28, 28, 30, 0.1);
  box-shadow: var(--assistant-glass-shadow);
}

@media (hover: hover) and (pointer: fine) {
  .assistant-page .assistant-composer:hover:not(:focus-within) {
    background: var(--assistant-glass-hover);
  }
}

.assistant-page .assistant-composer:focus-within,
.assistant-page .assistant-composer--multiline:focus-within,
.assistant-page .assistant-composer.assistant-composer--voice-active:focus-within {
  background: var(--assistant-glass-focus);
  border-color: rgba(28, 28, 30, 0.16);
  box-shadow: var(--assistant-glass-shadow);
}

/* 话筒键浮在玻璃上：实白会戳出来，改成同样透一点的白，让玻璃透过去。 */
.assistant-icon-button--mic,
.assistant-icon-button--mic[disabled] {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(28, 28, 30, 0.12);
}

@media (hover: hover) and (pointer: fine) {
  .assistant-icon-button--mic:hover:not([disabled]) {
    background: rgba(255, 255, 255, 0.86);
  }
}

/* 不支持 backdrop-filter（老 Firefox 等）时退回实底暖白，
   hover 仍然是「变亮」而不是变暗。 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .assistant-page .assistant-composer,
  .assistant-page .assistant-composer.assistant-composer--voice-active {
    background: #FCFBF7;
  }

  .assistant-page .assistant-composer:hover:not(:focus-within) {
    background: #FFFEFB;
  }

  .assistant-page .assistant-composer:focus-within {
    background: #FFFFFF;
  }

  .assistant-icon-button--mic,
  .assistant-icon-button--mic[disabled] {
    background: #FFFFFF;
  }
}

/* 光标：默认跟随 color（#262624 近黑），落在暖白玻璃上又硬又生。
   改成品牌绿，和右侧发送键同一支颜色，输入区首尾呼应。

   高度：caret 高度跟的是行高，1.55 行高在 16px 字上是 24.8px 的竖条，
   比中文字身高出五成多，所以行高一并收到 1.4（→22.4px）。多行上限由 JS
   读计算值算整行，自动跟随，不用改代码。
   （早先这里还改过 .assistant-voice-state 的行高「保持同步」，但那个类
   从来没有被渲染过，语音态用的是 assistant-voice.js 里的
   .assistant-voice-stage；那条已随死 CSS 一起删除。）

   宽度和闪烁节奏 CSS 控制不了。用 DOM 假光标能画出更细的竖条，但会打断
   中文输入法的组字与候选预览，所以不碰实现，只调颜色和高度。 */
.assistant-page .assistant-composer textarea {
  caret-color: var(--brand-green);
}

/* ============================================================
   2026-07-29 侧栏「你在这儿」的层级
   原来导航标签（对话记录）和会话行（某条对话）用的是同一块灰胶囊
   rgba(0,0,0,.045)，两个同等分量的选中态并列，等于谁都不是主的。

   Apple 的做法是调强调程度、不是调时长：源列表的选中项永远可见，
   只在失去键盘焦点时从强调色降级为安静的灰。这里借它的层级思路 ——

   · 导航标签是「分类」，下面的面板已经在说明打开的是哪个标签，
     所以退到只有绿字 + 600 字重，不占填充；
   · 会话行是「你正待在里面的那个对象」，保留填充，并且从中性灰换成
     极浅品牌绿 —— 灰底容易被读成「鼠标刚扫过」，绿调才读得出是选中。
     它由此成为侧栏里唯一一块填充的当前标记。

   注意：选中态本身仍然是常驻的，不加任何定时消失。它回答的是
   「我在哪」而不是「我刚点了什么」，最需要它的时刻恰恰是离开一会儿
   再回来 —— 那时任何计时器都早就跑完了。
   ============================================================ */
.assistant-tabs button.is-active,
.assistant-tabs button[aria-current="page"] {
  background: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-tabs button.is-active:hover,
  .assistant-tabs button[aria-current="page"]:hover {
    background: var(--assistant-hover-tint);
  }
}

.assistant-history-item.is-active {
  background: rgba(18, 83, 72, 0.07);
}

@media (hover: hover) and (pointer: fine) {
  .assistant-history-item.is-active:hover {
    background: rgba(18, 83, 72, 0.09);
  }
}

/* ============================================================
   2026-07-30 选中态加重，并与 hover 拉开「色度」而不只是「明度」
   上一版选中是 rgba(18,83,72,.07)，hover 是比画布更亮的 #FCFBF7 ——
   两者都太弱，而且都是「一块填充」，扫过去分不清哪个是哪个。

   现在：hover = 无色度的暖灰（压暗一层，见 --assistant-hover-tint），
        选中 = 有色度的品牌绿 + 绿字 + 500 字重。
   两个状态落在不同的维度上，不需要靠深浅去猜。
   ============================================================ */
.assistant-history-item.is-active {
  background: rgba(18, 83, 72, 0.11);
}

@media (hover: hover) and (pointer: fine) {
  /* 选中行被 hover 时只再实一档，不切换到中性灰 —— 否则「鼠标扫过」
     会把「我在这儿」暂时擦掉。 */
  .assistant-history-item.is-active:hover {
    background: rgba(18, 83, 72, 0.14);
  }
}

/* 标题从 .92 提到全实，并给到 500 字重：选中行的字本身也要读得出是选中。 */
.assistant-history-item.is-active .assistant-history-item__open {
  color: var(--brand-green);
  font-weight: 500;
}

/* 会话星标：标题后面一颗实心小星，参与文字流（标题过长时和省略号一起被裁）。
   不占独立列、不改行高 —— 它是标题的一部分，不是第二个操作位。 */
/* 星标跟在标题文字后面（同一个 -webkit-box 里），不另占一行。 */
.assistant-history-item__star {
  display: inline-grid;
  place-items: center;
  width: 12px;
  height: 12px;
  margin-left: 6px;
  vertical-align: -1px;
  color: #B8873A;
}

.assistant-history-item__star svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  stroke: none;
}

/* 行菜单里的星标项：中性色，和红色的删除项区分开。 */
.assistant-history-menu button[role="menuitem"]:not(.assistant-history-menu__danger) {
  color: var(--flusso-text);
}

@media (hover: hover) and (pointer: fine) {
  .assistant-history-menu button[role="menuitem"]:not(.assistant-history-menu__danger):hover {
    background: rgba(28, 28, 30, 0.035);
  }
}

.assistant-history-menu button[role="menuitem"]:not(.assistant-history-menu__danger):focus-visible {
  color: var(--flusso-green);
  background: rgba(15, 74, 67, 0.04);
  outline: none;
}

/* ============================================================
   2026-07-30 抽屉四处收拾
   1) 账户菜单在抽屉里不再重复画身份（改在 JS 里不渲染 summary）；
   2) 逐项分割线 → 组间一条线，退出登录带上终止语义；
   3) 统一左侧墨迹线：标题、导航图标、账户头像落在同一条 x 上，
      hover 底色靠负 margin 往外溢（Finder 侧栏那套「内容对齐、背景外扩」）；
   4) 空/错误态左对齐，重试拿到和登录同一套次级按钮样式。
   ============================================================ */

/* ── 2) 账户菜单分组 ───────────────────────────────────────── */
/* 逐项 border-bottom 全部撤掉：五项菜单不需要四根线。
   分组用 __site 身上这一条上边线表达 —— 不套 wrapper div，因为文件前面有
   五组规则靠 `.assistant-account-menu > button` 做重置和排版。 */
.assistant-account-menu > button,
.assistant-account-menu__site {
  border-bottom: 0;
}

/* 唯一一条分割线：账户内部三项 ↑ / 离开这个应用 ↓。 */
.assistant-account-menu__site {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(28, 28, 30, 0.09);
}

/* 退出登录是终止动作：往删除那支红靠，但不用全红 —— 它可逆（再登录就行），
   不该和「删除对话」等重。
   选择器必须比前面那条 `.assistant-account-menu > button { color: var(--flusso-text) }`
   更具体，否则会被重置吃掉。 */
.assistant-account-menu > .assistant-account-menu__logout {
  color: #A34238;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-account-menu > .assistant-account-menu__logout:hover {
    color: #8F332B;
  }
}

/* ── 3) 统一左侧墨迹线 ─────────────────────────────────────── */
:root {
  /* 行的内衬 = hover 底色比文字往外溢出的量。 */
  --assistant-row-bleed: 8px;
}

.assistant-record-new,
.assistant-tabs button,
.assistant-history-item,
.assistant-search-results button{
  margin-inline: calc(-1 * var(--assistant-row-bleed));
  padding-inline: var(--assistant-row-bleed);
}

/* 会话行的内衬本来在 __open 上（行自己只有 3px），会叠成 11px。
   行归零、内衬统一交给 __open，墨迹就和其它行一样落在 0。 */
.assistant-history-item {
  padding-inline: 0;
}

.assistant-history-item__open {
  padding-inline: var(--assistant-row-bleed);
}

/* 账户胶囊：它有 1px 边框，所以内衬按 bleed 减 1，头像墨迹才落在同一条线上。 */
.assistant-drawer-bottom .assistant-user-bar {
  margin-inline: calc(-1 * var(--assistant-row-bleed));
  padding-inline: calc(var(--assistant-row-bleed) - 1px);
}

@media (min-width: 721px) {
  .assistant-state-chat.assistant-records-open .assistant-user-bar {
    padding-inline: calc(var(--assistant-row-bleed) - 1px);
  }
}

/* ── 4) 空/错误态 ─────────────────────────────────────────── */
.assistant-record-panel .assistant-panel-empty {
  padding-top: 14px;
  text-align: left;
}

/* 原来这套次级按钮样式只挂在 [data-auth-open] 上，重试按钮用的是
   data-history-retry，一条都没匹配上，于是渲染成一行裸文字。改成按 button 选。 */
.assistant-record-panel .assistant-panel-empty > button {
  justify-self: start;
  min-width: 72px;
  height: 40px;
  padding: 0 20px;
  color: var(--assistant-text-primary);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--assistant-border-subtle);
  border-radius: var(--flusso-radius-pill);
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-record-panel .assistant-panel-empty > button:hover {
    color: var(--assistant-text-primary);
    background: var(--assistant-surface-secondary);
    border-color: var(--assistant-border-default);
  }
}

.assistant-record-panel .assistant-panel-empty > button:active {
  color: var(--assistant-text-primary);
  background: #EEEEEC;
  border-color: var(--assistant-border-default);
}

.assistant-page .assistant-record-panel .assistant-panel-empty > button:focus-visible {
  border-color: var(--assistant-border-default);
  background: var(--assistant-surface-secondary);
  outline: none;
}

/* ============================================================
   阶段 A · 2026-07-30 记忆便签：补齐缺失的样式
   记忆功能的 JS 被重写过一轮（→ workspace / group / card / detail /
   index 这套类名），CSS 没跟着迁移：19 个类名一条规则都没有，工作区的
   头部、卡片、详情、抽屉索引全部裸奔。这里补齐，并且**只用抽屉已有的
   设计语言**——卡片壳沿用行菜单那套（--flusso-surface + 16px 圆角 +
   rgba(28,28,30,.13) 边），行沿用抽屉行（--assistant-row-bleed +
   --assistant-hover-tint + 14px 圆角），危险色沿用 #A34238。
   不新引入任何一支颜色或圆角。
   ============================================================ */

/* ── 工作区外壳 ───────────────────────────────────────────── */
.assistant-memory-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.assistant-memory-workspace[hidden] {
  display: none;
}

/* 头部与抽屉头共用节奏：19px/600 品牌绿标题、底部一条 divider。 */
.assistant-memory-workspace__head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: var(--assistant-workbench-w);
  min-height: 60px;
  margin-inline: auto;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--divider);
}

.assistant-memory-workspace__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--brand-green);
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 返回：纯图标+文字的幽灵按钮。按本仓库的规则，纯图标类按钮 hover 只提亮，
   不长出底色片。 */
.assistant-memory-workspace__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-height: 34px;
  margin-left: -6px;
  padding: 0 6px;
  color: var(--assistant-text-secondary);
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}

.assistant-memory-workspace__back[hidden] {
  display: none;
}

.assistant-memory-workspace__back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-memory-workspace__back:hover {
    color: var(--brand-green);
    background: transparent;
  }
}

.assistant-memory-workspace__add {
  flex: 0 0 auto;
  min-height: 34px;
  padding-inline: 12px;
  font-size: 13px;
}

.assistant-memory-workspace__body {
  width: 100%;
  max-width: var(--assistant-workbench-w);
  min-height: 0;
  margin-inline: auto;
  padding: 20px var(--gutter) 40px;
  overflow-y: auto;
}

/* ── 分组 ─────────────────────────────────────────────────── */
.assistant-memory-group {
  margin-bottom: 26px;
}

.assistant-memory-group > h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--flusso-text);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
}

/* 计数徽章：中性、极轻，不和「待确认」那支琥珀色抢。 */
.assistant-memory-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  color: var(--assistant-text-secondary);
  background: rgba(28, 28, 30, 0.055);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.assistant-memory-cards {
  display: grid;
  gap: 10px;
}

/* ── 卡片 ─────────────────────────────────────────────────── */
.assistant-memory-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 14px 16px;
  color: var(--flusso-text);
  background: var(--flusso-surface);
  border: 1px solid rgba(28, 28, 30, 0.13);
  border-radius: 16px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background var(--t), border-color var(--t);
}

.assistant-memory-card__title {
  margin: 0;
  color: var(--flusso-text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

/* 卡片是索引不是阅读位：正文最多三行，完整内容在详情里看。 */
.assistant-memory-card__body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  margin: 0;
  overflow: hidden;
  color: rgba(36, 35, 31, 0.86);
  font-size: 13.5px;
  line-height: 1.62;
}

.assistant-memory-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  color: var(--assistant-text-secondary);
  font-size: 12px;
}

.assistant-memory-card__meta > span + span::before {
  content: "·";
  margin-right: 8px;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-memory-card:hover {
    background: #FFFFFF;
    border-color: rgba(28, 28, 30, 0.22);
  }
}

.assistant-memory-card:focus-visible {
  border-color: var(--assistant-border-default);
  background: #FFFFFF;
  outline: none;
}

/* 候选卡：还没成为正式记忆，用琥珀调（和 .assistant-memory-status 同一支）
   区分，而不是靠深浅。 */
.assistant-memory-card--candidate {
  background: rgba(202, 150, 60, 0.07);
  border-color: rgba(202, 150, 60, 0.28);
}

@media (hover: hover) and (pointer: fine) {
  .assistant-memory-card--candidate:hover {
    background: rgba(202, 150, 60, 0.11);
    border-color: rgba(202, 150, 60, 0.4);
  }
}

/* ── 详情 / 表单 ──────────────────────────────────────────── */
.assistant-memory-detail {
  padding: 20px 22px 18px;
  background: var(--flusso-surface);
  border: 1px solid rgba(28, 28, 30, 0.13);
  border-radius: 16px;
}

/* 详情同时带 .assistant-memory-item 时，撤掉后者的分隔线内衬。 */
.assistant-memory-item.assistant-memory-detail {
  border-top: 1px solid rgba(28, 28, 30, 0.13);
}

.assistant-memory-detail--candidate {
  background: rgba(202, 150, 60, 0.07);
  border-color: rgba(202, 150, 60, 0.28);
}

.assistant-memory-detail__title {
  margin: 0 0 8px;
  color: var(--flusso-text);
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
}

.assistant-memory-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--assistant-text-secondary);
  font-size: 12.5px;
}

.assistant-memory-detail__meta > span + span::before {
  content: "·";
  margin-right: 8px;
}

.assistant-memory-detail__body {
  margin: 0;
  color: rgba(36, 35, 31, 0.9);
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.assistant-memory-detail__hint {
  margin: 0 0 14px;
  color: var(--flusso-text-soft);
  font-size: 13px;
  line-height: 1.6;
}

.assistant-memory-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.assistant-memory-detail__actions button {
  min-height: 38px;
  padding: 0 14px;
  color: rgba(15, 74, 67, 0.88);
  background: transparent;
  border: 1px solid rgba(15, 74, 67, 0.24);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
}

.assistant-memory-detail__actions button[type="submit"] {
  color: #FFFFFF;
  background: var(--flusso-green);
  border-color: var(--flusso-green);
}

@media (hover: hover) and (pointer: fine) {
  .assistant-memory-detail__actions button:hover {
    color: var(--brand-green);
    background: rgba(15, 74, 67, 0.05);
  }

  .assistant-memory-detail__actions button[type="submit"]:hover {
    color: #FFFFFF;
    background: var(--flusso-green-dark);
    border-color: var(--flusso-green-dark);
  }
}

/* 删除沿用全站那支危险红（和删除对话、退出登录同一支）。 */
.assistant-memory-detail__danger {
  color: #A34238;
  border-color: rgba(163, 66, 56, 0.28);
}

@media (hover: hover) and (pointer: fine) {
  .assistant-memory-detail__actions .assistant-memory-detail__danger:hover {
    color: #8F332B;
    background: rgba(163, 66, 56, 0.055);
    border-color: rgba(163, 66, 56, 0.42);
  }
}

.assistant-memory-detail__note {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(28, 28, 30, 0.08);
  color: var(--assistant-text-secondary);
  font-size: 12.5px;
  line-height: 1.6;
}

/* 详情里的表单（手动添加 / 候选审阅）：和 .assistant-memory-new-form
   同一套字段外观，只是圆角跟着卡片走。 */
.assistant-memory-detail form {
  display: grid;
  gap: 7px;
}

.assistant-memory-detail form label {
  color: rgba(36, 35, 31, 0.78);
  font-size: 13px;
  font-weight: 600;
}

.assistant-memory-detail form input,
.assistant-memory-detail form textarea {
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  background: #FFFFFF;
  border: 1px solid rgba(28, 28, 30, 0.16);
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
}

.assistant-memory-detail form input {
  min-height: 42px;
  padding-block: 0;
}

.assistant-memory-detail form textarea {
  min-height: 96px;
  line-height: 1.65;
  resize: vertical;
}

.assistant-memory-detail form input:focus-visible,
.assistant-memory-detail form textarea:focus-visible {
  border-color: rgba(15, 74, 67, 0.5);
  outline: none;
}

/* ── 空 / 引导态 ──────────────────────────────────────────── */
.assistant-memory-ws-intro {
  max-width: 46ch;
  padding: 8px 0 0;
}

.assistant-memory-ws-intro h2 {
  margin: 0 0 10px;
  color: var(--flusso-text);
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 600;
}

.assistant-memory-ws-intro p {
  margin: 0 0 18px;
  color: var(--flusso-text-soft);
  font-size: 14.5px;
  line-height: 1.72;
}

.assistant-memory-ws-empty {
  margin: 0;
  color: var(--assistant-text-secondary);
  font-size: 13.5px;
  line-height: 1.62;
}

/* ── 抽屉侧的关键词索引 ───────────────────────────────────── */
.assistant-memory-drawer {
  min-height: 0;
  overflow-y: auto;
}

.assistant-memory-index + .assistant-memory-index {
  margin-top: 14px;
}

/* 组标题与「今天 / 过去七天」那种时间标签同一号字。 */
.assistant-memory-index > h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 3px;
  color: rgba(58, 82, 76, 0.48);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* 索引条 = 抽屉行：同一套外溢、圆角与 hover 底色。 */
.assistant-memory-index__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  margin-inline: calc(-1 * var(--assistant-row-bleed));
  padding-inline: var(--assistant-row-bleed);
  color: rgba(36, 35, 31, 0.72);
  background: transparent;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-align: left;
  transition: background var(--t-fast), color var(--t-fast);
}

.assistant-memory-index__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 行内的「待确认」缩成小圆点大小的胶囊，不占掉半行宽度。 */
.assistant-memory-index__item .assistant-memory-status {
  flex: 0 0 auto;
  margin-bottom: 0;
  font-size: 11px;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-memory-index__item:hover {
    color: var(--brand-green);
    background: var(--assistant-hover-tint);
  }
}

.assistant-memory-index__item:focus-visible {
  color: var(--brand-green);
  background: var(--assistant-hover-tint);
  outline: none;
}

/* 进入记忆工作区：body.assistant-memory-mode 之前没有任何 CSS，所以
   memoryWorkspace.hidden = false 之后画面根本不切换 —— 落地/聊天区仍然
   压在上面。这里补上真正的模式切换。 */
.assistant-memory-mode .assistant-landing,
.assistant-memory-mode .assistant-chat-section {
  display: none !important;
}

.assistant-memory-mode .assistant-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

.assistant-memory-mode .assistant-memory-workspace {
  min-height: 0;
  height: 100%;
}

/* 卡片是 grid，inline-block 的状态胶囊会被拉满整行 —— 收回内容宽度。
   同时 grid 的 gap 已经给了间距，撤掉它自带的 margin-bottom。 */
.assistant-memory-card > .assistant-memory-status,
.assistant-memory-detail > .assistant-memory-status {
  justify-self: start;
  width: fit-content;
  margin-bottom: 0;
}

.assistant-memory-detail > .assistant-memory-status {
  display: inline-block;
  margin-bottom: 10px;
}

/* ============================================================
   右侧「本次整理」面板
   ------------------------------------------------------------
   左＝全局导航与历史，中＝当前整理过程，右＝本次整理形成的成果。
   右侧按需出现，不常驻：固定三栏在 1440px 以下会把中间正文压到
   不可读（.assistant-column 本身就要 820px），而且危机态下多一栏
   结构化信息是有害的 —— 那时唯一该有的焦点是联系现实中的援助。

   ≥721px 由新版卡片工作区承载；这里仅保留 ≤720px 的底部 Sheet。
   ============================================================ */

.assistant-review {
  position: fixed;
  z-index: 58;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  background: #F4F1EC;
  color: var(--ink);
}

/* [hidden] 在本页是 display:none !important，动画就没得做了。
   和左侧抽屉同一套办法：聊天态下保留在流里，用 visibility + 位移做开合，
   收起时 visibility:hidden 同时把它移出无障碍树。 */
.assistant-state-chat .assistant-review,
.assistant-state-chat .assistant-review[hidden] {
  display: grid !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.assistant-state-chat.assistant-review-open .assistant-review {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.assistant-review__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-12);
}

.assistant-review__title {
  margin: 0;
  color: var(--brand-green);
  font-family: var(--font-sans);
  font-size: var(--fs-13);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.assistant-review__close {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: rgba(36, 51, 47, 0.62);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.assistant-review__close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-review__close:hover {
    color: var(--brand-green);
    background: var(--assistant-hover-tint);
  }
}

/* 藏掉自己的滚动条：主区（文档）本来就有一条，右板再来一条，
   两条几乎贴在一起，观感很吵。内容照样能滚（滚轮/触控板/触屏/键盘都不受影响），
   只是不画那条槽 —— 左侧抽屉的 .assistant-record-panel 用的是同一套办法。 */
.assistant-review__body {
  display: grid;
  align-content: start;
  gap: 22px;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: none;
}

.assistant-review__body::-webkit-scrollbar {
  display: none;
}

/* 分组之间用间距和字号分层，不用卡片嵌套、不用多层底色、不用彩色标签 ——
   这是「安静地沉淀」，不是后台看板。 */
.assistant-review__group {
  display: grid;
  gap: 8px;
}

.assistant-review__label {
  margin: 0;
  color: rgba(36, 51, 47, 0.56);
  font-size: var(--fs-12);
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* 「当前主题」是这一栏的主句，字号比条目大一档。 */
.assistant-review__summary {
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-15);
  line-height: 1.62;
}

.assistant-review__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

.assistant-review__list li {
  position: relative;
  padding-left: 15px;
  color: rgba(36, 51, 47, 0.86);
  font-size: var(--fs-14);
  line-height: 1.58;
}

.assistant-review__list li::before {
  content: "";
  position: absolute;
  top: 0.68em;
  left: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(18, 83, 72, 0.42);
}

/* 「还可以继续了解」和「接下来可以」都还不是事实，共用空心标记 ——
   让「用户说过的」（实心点）和「尚待确认 / 邀请」（空心圈）一眼可分。
   这是面板里最需要守住的一层区分，所以交给标记形状而不是颜色。
   两者都是邀请，不是待办：不加复选框、不加序号。 */
.assistant-review__list--open li {
  color: rgba(36, 51, 47, 0.74);
}

.assistant-review__list--open li::before {
  background: none;
  border: 1px solid rgba(18, 83, 72, 0.34);
  top: 0.58em;
  width: 5px;
  height: 5px;
}

.assistant-review__note {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(188, 178, 161, 0.4);
  color: rgba(36, 51, 47, 0.5);
  font-size: var(--fs-12);
  line-height: 1.55;
}

/* ---- ≤720px：底部 Sheet ---- */
@media (max-width: 720px) {
  .assistant-review {
    inset: auto 0 0 0;
    max-height: 78svh;
    padding: 16px 18px max(16px, env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 50px -30px rgba(10, 51, 46, 0.38);
  }

  .assistant-state-chat .assistant-review,
  .assistant-state-chat .assistant-review[hidden] {
    transform: translateY(102%);
    transition: opacity 170ms ease, transform var(--assistant-motion-soft) var(--assistant-drawer-ease), visibility 0ms linear var(--assistant-motion-soft);
  }

  .assistant-state-chat.assistant-review-open .assistant-review {
    transform: translateY(0);
    transition: opacity 190ms ease, transform var(--assistant-motion-soft) var(--assistant-drawer-ease), visibility 0ms;
  }

  /* Sheet 顶部的抓手：暗示可下拉关闭，不额外占一行文字。 */
  .assistant-review__head::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    width: 34px;
    height: 4px;
    border-radius: 2px;
    background: rgba(36, 51, 47, 0.16);
    transform: translateX(-50%);
  }

  .assistant-review__head {
    position: relative;
    padding-top: 12px;
  }
}

/* ---- 移动端 Sheet 的背景遮罩 ---- */
.assistant-review-backdrop {
  position: fixed;
  inset: 0;
  z-index: 57;
  background: rgba(24, 40, 36, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 190ms ease;
}

.assistant-state-chat.assistant-review-open .assistant-review-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ---- 顶部工具条里的入口 ---- */
.assistant-conversation-actions .assistant-chat-tool--review svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.assistant-conversation-actions .assistant-chat-tool--review[aria-expanded="true"] {
  color: var(--brand-green);
  background: var(--assistant-hover-tint);
}

@media (prefers-reduced-motion: reduce) {
  .assistant-state-chat .assistant-review,
  .assistant-state-chat .assistant-review[hidden],
  .assistant-state-chat.assistant-review-open .assistant-review {
    transform: none;
    transition: visibility 0ms, opacity 120ms ease;
  }

  .assistant-review-backdrop {
    transition: none;
  }
}

/* ---- 时间线：when 是用户自己的时间粒度，不是日历日期 ---- */
.assistant-review__timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.assistant-review__timeline li {
  position: relative;
  display: grid;
  gap: 1px;
  padding-left: 15px;
}

/* 一条细竖线把条目串起来，比每行一个圆点更像「顺序」而不是「清单」。 */
.assistant-review__timeline li::before {
  content: "";
  position: absolute;
  top: 0.42em;
  bottom: -10px;
  left: 3px;
  width: 1px;
  background: rgba(18, 83, 72, 0.16);
}

.assistant-review__timeline li:last-child::before {
  bottom: auto;
  height: 0.5em;
}

.assistant-review__timeline li::after {
  content: "";
  position: absolute;
  top: 0.42em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px rgba(18, 83, 72, 0.42);
}

.assistant-review__when {
  color: rgba(36, 51, 47, 0.5);
  font-size: var(--fs-12);
  font-variant-numeric: tabular-nums;
}

.assistant-review__what {
  color: rgba(36, 51, 47, 0.86);
  font-size: var(--fs-14);
  line-height: 1.55;
}

/* ---- 可能的关联：视觉上必须读起来比「目前提到」更轻、更未定 ---- */
.assistant-review__links {
  display: grid;
  gap: 12px;
}

/* 左侧一条虚线边，是这一栏唯一的额外装饰：
   用「未闭合」的线条暗示内容也未定，不靠彩色标签或警告底色。 */
.assistant-review__link {
  display: grid;
  gap: 3px;
  padding-left: 11px;
  border-left: 1px dashed rgba(18, 83, 72, 0.28);
}

.assistant-review__chain {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  color: var(--ink);
  font-size: var(--fs-14);
  line-height: 1.5;
}

/* 用 ↔ 而不是 →：箭头会暗示因果方向，而这里只是「有关系」。 */
.assistant-review__chain-sep {
  color: rgba(18, 83, 72, 0.4);
  font-size: var(--fs-13);
}

.assistant-review__link-note {
  margin: 0;
  color: rgba(36, 51, 47, 0.66);
  font-size: var(--fs-13);
  line-height: 1.56;
}

.assistant-review__tentative-hint {
  margin: 0;
  color: rgba(36, 51, 47, 0.46);
  font-size: var(--fs-12);
  line-height: 1.5;
}

/* ============================================================
   对话内结构化交互卡片
   ------------------------------------------------------------
   它是对话的一部分，不是浮在对话上面的弹窗：插在 Assistant 回复之后，
   没有遮罩、不居中、不锁滚动。「更聚焦」的感觉来自它比普通消息更可操作，
   而不是来自把其余界面压暗。

   所以视觉上刻意收敛：极浅底色 + 一条细边，圆角与消息气泡同源，
   不用厚重阴影、不用高饱和实心色块、不做表单后台那种分区标题。
   ============================================================ */

/* 宽度跟对话正文同一条度量线。
   原来卡住 560px，而同一列里助手正文和输入框都是 780px —— 卡片比周围窄
   两百多像素、又左对齐，读起来就是「随手摆在这儿的一个控件」，
   而不是 Riva 这一轮说的话的一部分。它本来就属于助手的这一轮，
   就该和助手正文共用同一个左右边界。 */
.assistant-interaction {
  width: 100%;
  margin: var(--sp-8) 0 var(--sp-4);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(188, 178, 161, 0.5);
  border-radius: var(--r);
}

/* fieldset 的默认边框和内边距会破坏卡片外形，但语义要留着：
   legend 是这组选项的问题，读屏会在每个选项前带上它。 */
.assistant-interaction__fieldset {
  margin: 0;
  padding: var(--sp-14) var(--sp-16);
  border: 0;
  display: grid;
  gap: 10px;
}

.assistant-interaction__title {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-15);
  font-weight: 600;
  line-height: 1.5;
}

.assistant-interaction__description {
  margin: -4px 0 0;
  color: rgba(36, 51, 47, 0.62);
  font-size: var(--fs-13);
  line-height: 1.55;
}

.assistant-interaction__options {
  display: grid;
  gap: 7px;
}

/* 短选项在桌面端两列（由 JS 按文字长度打标记 —— CSS 看不到字数）。
   长选项和移动端始终单列，避免中文标签在窄列里逐字换行。 */
@media (min-width: 721px) {
  .assistant-interaction__options[data-columns="two"] {
    grid-template-columns: 1fr 1fr;
  }
}

/* 整行都是点击区域：小圆点旁边那几个字太难点。 */
.assistant-interaction__option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 12px;
  background: var(--paper);
  border: 1px solid rgba(188, 178, 161, 0.55);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

/* 原生 input 视觉上隐藏但仍在无障碍树和 tab 序里 —— 方向键切换单选、
   读屏播报、focus 都交给浏览器。不用 display:none（那会让它彻底失效）。 */
.assistant-interaction__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 自己画选择指示器：radio 是圆、checkbox 是方，形状本身传达单选/多选。 */
.assistant-interaction__label {
  position: relative;
  padding-left: 24px;
  color: var(--ink);
  font-size: var(--fs-14);
  line-height: 1.55;
}

.assistant-interaction__label::before {
  content: "";
  position: absolute;
  top: 0.16em;
  left: 0;
  width: 15px;
  height: 15px;
  border: 1.5px solid rgba(18, 83, 72, 0.32);
  background: var(--paper);
  transition: border-color 140ms ease, background 140ms ease;
}

.assistant-interaction--multi_choice .assistant-interaction__label::before {
  border-radius: 4px;
}

.assistant-interaction--single_choice .assistant-interaction__label::before,
.assistant-interaction--confirmation .assistant-interaction__label::before {
  border-radius: 50%;
}

/* 选中态：主题绿的描边 + 极浅底 + 文字加重，不用高饱和实心大色块。 */
.assistant-interaction__option.is-selected {
  background: rgba(18, 83, 72, 0.045);
  border-color: rgba(18, 83, 72, 0.42);
}

.assistant-interaction__option.is-selected .assistant-interaction__label {
  color: var(--brand-green);
  font-weight: 500;
}

.assistant-interaction__option.is-selected .assistant-interaction__label::before {
  border-color: var(--brand-green);
}

/* 选中标记：单选是实心圆点，多选是对勾 —— 不只靠颜色区分状态。 */
.assistant-interaction__label::after {
  content: "";
  position: absolute;
  opacity: 0;
  transition: opacity 120ms ease;
}

.assistant-interaction--single_choice .is-selected .assistant-interaction__label::after,
.assistant-interaction--confirmation .is-selected .assistant-interaction__label::after {
  top: calc(0.16em + 4.5px);
  left: 4.5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-green);
  opacity: 1;
}

.assistant-interaction--multi_choice .is-selected .assistant-interaction__label::after {
  top: calc(0.16em + 3px);
  left: 4.5px;
  width: 6px;
  height: 3px;
  border-left: 1.6px solid var(--brand-green);
  border-bottom: 1.6px solid var(--brand-green);
  transform: rotate(-45deg);
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-interaction__option:hover {
    border-color: rgba(18, 83, 72, 0.34);
    background: rgba(18, 83, 72, 0.028);
  }
}

/* 达到多选上限：未选中的项变淡且不可点，让上限在界面上就是可见的。 */
.assistant-interaction__option.is-disabled {
  cursor: default;
  opacity: 0.45;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-interaction__option.is-disabled:hover {
    border-color: rgba(188, 178, 161, 0.55);
    background: var(--paper);
  }
}

/* 焦点环挂在整行上（input 本身是隐藏的，环画在它身上等于看不见）。 */
.assistant-interaction__input:focus-visible + .assistant-interaction__label::before {
  outline: 2px solid var(--brand-green);
  outline-offset: 2px;
}

.assistant-interaction__custom {
  display: grid;
  gap: 5px;
}

.assistant-interaction__custom-label {
  color: rgba(36, 51, 47, 0.6);
  font-size: var(--fs-12);
}

.assistant-interaction__textarea {
  width: 100%;
  padding: 9px 11px;
  color: var(--ink);
  font-family: inherit;
  font-size: var(--fs-14);
  line-height: 1.6;
  background: var(--paper);
  border: 1px solid rgba(188, 178, 161, 0.62);
  border-radius: 10px;
  resize: vertical;
}

.assistant-interaction__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.assistant-interaction__submit {
  min-height: 34px;
  padding: 0 16px;
  color: #fff;
  font-family: inherit;
  font-size: var(--fs-13);
  font-weight: 500;
  background: var(--brand-green);
  border: 1px solid var(--brand-green);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: opacity 140ms ease;
}

.assistant-interaction__submit[disabled] {
  cursor: default;
  opacity: 0.38;
}

/* 跳过是次级动作：文字按钮，不和「确认」争视觉重量。 */
.assistant-interaction__skip,
.assistant-interaction__edit {
  min-height: 30px;
  padding: 0 4px;
  color: rgba(36, 51, 47, 0.58);
  font-family: inherit;
  font-size: var(--fs-13);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(36, 51, 47, 0.2);
  text-underline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-interaction__skip:hover,
  .assistant-interaction__edit:hover {
    color: var(--brand-green);
    text-decoration-color: rgba(18, 83, 72, 0.4);
  }
}

.assistant-interaction__hint {
  margin: 0;
  color: rgba(36, 51, 47, 0.5);
  font-size: var(--fs-12);
}

/* 折叠态：答完就该是一条清晰的对话记录，而不是继续占一整张卡的高度。
   底色和边框收掉，只留一行文字 + 修改入口。 */
.assistant-interaction.is-collapsed {
  background: none;
  border-color: transparent;
  border-left: 2px solid rgba(18, 83, 72, 0.22);
  border-radius: 0;
}

.assistant-interaction__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding: 4px 0 4px 12px;
}

.assistant-interaction__summary-text {
  margin: 0;
  color: rgba(36, 51, 47, 0.78);
  font-size: var(--fs-14);
  line-height: 1.55;
}

@media (max-width: 720px) {
  .assistant-interaction {
    width: 100%;
  }

  .assistant-interaction__fieldset {
    padding: var(--sp-12) var(--sp-13);
  }

  /* 触控目标不小于 44px 高 */
  .assistant-interaction__option {
    padding: 11px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-interaction__option,
  .assistant-interaction__label::before,
  .assistant-interaction__label::after,
  .assistant-interaction__submit {
    transition: none;
  }
}

/* ============================================================
   抽屉导航：图标 + 文字，竖排四行
   ------------------------------------------------------------
   曾经压成过一行小图标。结果是：导航区从 164px 掉到 38px，四个 38px 的
   图标只用掉 124px，右边 108px 全空 —— 顶部从「有结构」变成「几个图标
   挂在左上角」。「简洁」不等于「把东西做小」，240px 的抽屉里横排四个图标
   必然留一半空白，除非铺满，而铺满又会让间距大到显得散。

   该抽屉仅用于 ≤720px，入口需要保留文字和 44px 触控高度。
   ============================================================ */
.assistant-records .assistant-tabs {
  display: grid;
  gap: 1px;
  grid-template-columns: minmax(0, 1fr);
  overflow: visible;
}

.assistant-records .assistant-tabs > button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 var(--assistant-row-bleed, 8px);
  text-align: left;
}

.assistant-records .assistant-tabs > button > svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
}

.assistant-records .assistant-tabs > button > span {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  font-size: 13.5px;
  white-space: nowrap;
}

/* 「开始新的整理」是动作，和下面三个切换项之间留一格。 */
.assistant-records .assistant-tabs > .assistant-record-new {
  margin-bottom: 5px;
}

.assistant-records .assistant-tabs > .assistant-record-new::after {
  content: none;
}

@media (max-width: 720px) {
  .assistant-records .assistant-tabs > button {
    min-height: 44px;
  }
}


/* ============================================================
   方案 C 第一层：整理空间（首页）
   ------------------------------------------------------------
   数值与 docs/design/assistant-ia-wireframes.html 的「方案 C · 第一层」一致。
   这一层没有侧栏、没有底部常驻输入条 —— 后者是聊天应用最强的视觉签名，
   首页把它换成一个居中的邀请，只有进入具体整理后才 dock。
   ============================================================ */
.assistant-home-mode .assistant-landing,
.assistant-home-mode .assistant-chat-section,
.assistant-home-mode .assistant-memory-workspace {
  display: none !important;
}

/* 首页不出现抽屉、不出现底部输入条 */
.assistant-home-mode .assistant-records,
.assistant-home-mode .assistant-backdrop {
  display: none !important;
}

.assistant-home-mode .assistant-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

.assistant-home {
  min-height: calc(100vh - 12px);
  min-height: calc(100svh - 12px);
  overflow-y: auto;
}

.assistant-home__inner {
  display: grid;
  align-content: start;
  gap: 34px;
  width: min(100% - 2 * var(--gutter), 720px);
  margin-inline: auto;
  padding: 46px 0 40px;
}

.assistant-home__title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.assistant-home__sub {
  margin: 5px 0 0;
  color: rgba(36, 51, 47, 0.58);
  font-size: 13.5px;
  line-height: 1.65;
}

/* 居中的邀请，不是 dock。 */
.assistant-home__input {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  background: #fff;
  border: 1px solid rgba(188, 178, 161, 0.62);
  border-radius: 16px;
}

.assistant-home__input textarea {
  flex: 1 1 auto;
  min-width: 0;
  max-height: 40vh;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.6;
  resize: none;
}

.assistant-home__input textarea::placeholder {
  color: rgba(36, 51, 47, 0.42);
}

.assistant-home__input textarea:focus {
  outline: none;
}

.assistant-home__input:focus-within {
  border-color: rgba(18, 83, 72, 0.34);
}

.assistant-home__send {
  flex: 0 0 32px;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--brand-green);
  cursor: pointer;
  transition: opacity 140ms ease;
}

.assistant-home__send svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-home__send[disabled] {
  cursor: default;
  opacity: 0.4;
}

.assistant-home__group {
  display: grid;
  gap: 10px;
}

.assistant-home__group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-12);
}

.assistant-home__group-head b {
  color: rgba(36, 51, 47, 0.72);
  font-size: 13px;
  font-weight: 600;
}

.assistant-home__group-head span,
.assistant-home__group-head button {
  color: rgba(36, 51, 47, 0.42);
  font-size: 12px;
  background: none;
  border: 0;
  padding: 0;
}

.assistant-home__group-head button {
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-home__group-head button:hover {
    color: var(--brand-green);
  }
}

.assistant-home__cards,
.assistant-home__cands {
  display: grid;
  gap: 10px;
}

/* 整理卡：比侧栏行重一档 —— 这里是主角，侧栏那边只是索引。 */
.assistant-home__card {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(188, 178, 161, 0.45);
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-home__card:hover {
    border-color: rgba(18, 83, 72, 0.3);
    background: rgba(255, 255, 255, 0.82);
  }
}

.assistant-home__card-title {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.assistant-home__card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 7px;
  color: rgba(36, 51, 47, 0.48);
  font-size: 11.5px;
  line-height: 1.45;
}

.assistant-home__card-meta .assistant-history-item__dot {
  opacity: 0.55;
}

/* 待确认候选：一句话 + 两个轻量动作。 */
.assistant-home__cand {
  display: flex;
  align-items: center;
  gap: var(--sp-10);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(188, 178, 161, 0.4);
  border-radius: 10px;
  color: rgba(36, 51, 47, 0.82);
  font-size: 13.5px;
  line-height: 1.55;
}

.assistant-home__cand-text {
  flex: 1 1 auto;
  min-width: 0;
}

.assistant-home__cand-act {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
}

.assistant-home__mini {
  padding: 3px 11px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(18, 83, 72, 0.28);
  background: none;
  color: var(--brand-green);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.assistant-home__mini--ghost {
  border-color: rgba(48, 65, 59, 0.18);
  color: rgba(36, 51, 47, 0.5);
}

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

.assistant-home__tool {
  padding: 7px 13px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(188, 178, 161, 0.5);
  background: rgba(255, 255, 255, 0.5);
  color: rgba(36, 51, 47, 0.78);
  font-size: 13px;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .assistant-home__tool:hover {
    border-color: rgba(18, 83, 72, 0.3);
    color: var(--brand-green);
  }
}

@media (max-width: 720px) {
  .assistant-home__inner {
    gap: 28px;
    padding: 28px 0 36px;
  }

  .assistant-home__title {
    font-size: 20px;
  }

  .assistant-home__cand {
    flex-wrap: wrap;
  }
}

/* ============================================================
   抽屉：像素级对齐 docs/design/assistant-ia-wireframes.html
   ------------------------------------------------------------
   下面每个数值都是从那份线框图上量出来的，不是估的。
   写在文件末尾是因为 .assistant-tabs / .assistant-record-panel /
   .assistant-history-item 在前面有十几处历次叠加的规则，
   在中间改任何一处都会被后面盖掉 —— 之前 caption 就是这样变成
   16.5px 深色、选中态底色被抹平的。
   ============================================================ */

/* ---- 导航项：13.5px / 400 / 圆角 8 / 内衬 8 / 图标 16 ---- */
.assistant-records .assistant-tabs > button {
  min-height: 40px;
  padding: 8px;
  border-radius: 8px;
  color: rgba(36, 51, 47, 0.8);
  font-size: 13.5px;
  font-weight: 400;
}

.assistant-records .assistant-tabs > button > svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
}

/* 选中态：浅绿底 + 品牌绿 + 500 —— 之前底色被前面的规则抹成透明，
   选中项只剩「更粗一点」，在四项里几乎认不出来。 */
.assistant-records .assistant-tabs > button.is-active {
  background: rgba(18, 83, 72, 0.05);
  color: var(--brand-green);
  font-weight: 500;
}

/* ---- 分隔线只留一条 ----
   .assistant-record-panel 自己带一条 border-top，caption 又有一条，
   于是导航和列表之间出现了两条线。分隔归 caption（它是列表的标题）。 */
.assistant-records .assistant-record-panel {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* ---- caption：11.5px / rgba(36,51,47,.42) / 字距 .04em ----
   线框图里是一行很轻的小字；实现里被前面的规则放大到 16.5px 深色，
   看起来像一个二级标题，抢掉了列表本身的重量。
   间距按线框：导航 → 6px → 线 → 12px → caption → 8px → 列表。 */
.assistant-record-caption {
  margin: 6px 0 8px;
  padding-top: 12px;
  padding-inline: 8px;
  border-top: 1px solid rgba(48, 65, 59, 0.08);
  color: rgba(36, 51, 47, 0.42);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

/* ---- 列表行：圆角 8 / 内衬 9px 8px / 行距 3px ---- */
.assistant-records .assistant-history-list {
  gap: 3px;
}

.assistant-records .assistant-history-item {
  padding: 0;
  border-radius: 8px;
}

.assistant-records .assistant-history-item__open {
  padding: 9px 8px;
  border-radius: 8px;
}

.assistant-records .assistant-history-item.is-active {
  background: rgba(18, 83, 72, 0.05);
}

.assistant-records .assistant-history-item__headline {
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.assistant-records .assistant-history-item__meta {
  font-size: 11.5px;
  line-height: 1.8;
  color: rgba(36, 51, 47, 0.48);
}
