/* 极云伴侣 · 明亮画布风格（G）
   粗黑边、纯色块、硬阴影；面板停靠在右侧，页面不再模糊、照常可用。 */
html[data-theme] {
  --companion-width: 420px;
  --companion-gap: 16px;
  --cp-bg: #ffffff; --cp-bg-2: #ffffff; --cp-surface: #f4f1ea; --cp-surface-2: #ece8df;
  --cp-line: #141414; --cp-line-2: #141414;
  --cp-text: #141414; --cp-text-2: #3d3d3d; --cp-text-3: #6b6b6b;
  --cp-gold: #2340ff; --cp-gold-2: #1a33d6; --cp-gold-soft: #dfe4ff; --cp-gold-line: #141414;
  --cp-gold-grad: #2340ff; --cp-on-gold: #ffffff; --cp-user: #141414;
  --cp-shadow: 8px 8px 0 #141414; --cp-green: #12704a;
}

/* ---------- 画面描述框旁的入口 ---------- */
html[data-theme] .composer-title .prompt-companion-launcher,
.prompt-companion-launcher {
  min-height: 36px; padding: 0 14px 0 12px; border: 2px solid #2340ff !important; border-radius: 999px;
  background: #2340ff !important; color: #fff !important; font-size: 13px; font-weight: 800; box-shadow: none;
}
html[data-theme] .composer-title .prompt-companion-launcher:hover { background: #1a33d6 !important; border-color: #1a33d6 !important; color: #fff !important; }
html[data-theme] .composer-title .prompt-companion-launcher[aria-expanded="true"] { background: #141414 !important; border-color: #141414 !important; color: #fff !important; }
.companion-filled { animation: cg-filled 1.4s ease-out; }
@keyframes cg-filled { 20% { box-shadow: 0 0 0 4px #ffc531; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- 右下角入口 ---------- */
.companion-fab { right: 22px; bottom: 22px; gap: 12px; }
html[data-theme] .companion-fab .companion-fab-button {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 20px 8px 8px;
  border: 2px solid #141414 !important; border-radius: 22px; background: #ffffff; color: #141414;
  box-shadow: 5px 5px 0 #141414; backdrop-filter: none;
  transition: translate .22s cubic-bezier(.3,.7,.35,1.35), box-shadow .2s ease, background-color .2s ease;
}
html[data-theme] .companion-fab .companion-fab-button:hover { translate: -2px -2px; box-shadow: 7px 7px 0 #141414; background: #ffc531; }
html[data-theme] .companion-fab .companion-fab-button:active { translate: 3px 3px; box-shadow: 0 0 0 #141414; transition-duration: .06s; }
.companion-fab .companion-fab-avatar {
  position: relative; width: 46px; height: 46px; border-radius: 14px; background: #2340ff; color: #fff;
  box-shadow: none; display: grid; place-items: center;
}
.companion-fab .companion-fab-avatar svg { width: 24px; height: 24px; fill: #fff; stroke: none; }
.companion-fab .companion-fab-avatar::after {
  content: ""; position: absolute; right: -5px; top: -5px; width: 14px; height: 14px; border-radius: 999px;
  background: #ff4a2b; border: 2px solid #fff; animation: none; opacity: 1; inset: -5px -5px auto auto;
}
.companion-fab .companion-fab-text { display: grid; gap: 1px; text-align: left; }
.companion-fab .companion-fab-text strong { font-size: 17px; font-weight: 900; color: #141414; }
.companion-fab .companion-fab-text small { font-size: 13px; font-weight: 700; color: #2340ff; }
html[data-theme] .companion-fab .companion-fab-button:hover small { color: #141414; }

/* 招呼气泡 */
html[data-theme] .companion-fab .companion-fab-greeting {
  position: absolute; right: 0; bottom: calc(100% + 16px); width: 300px; padding: 18px 18px 16px;
  border: 2px solid #141414; border-radius: 22px; background: #fff; color: #141414; box-shadow: 6px 6px 0 #141414;
  display: grid; gap: 6px; backdrop-filter: none;
}
html[data-theme] .companion-fab .companion-fab-greeting::after {
  content: ""; position: absolute; right: 38px; bottom: -11px; width: 18px; height: 18px; background: #fff;
  border-right: 2px solid #141414; border-bottom: 2px solid #141414; transform: rotate(45deg);
}
.companion-fab .companion-fab-greeting strong { font-size: 17px; font-weight: 900; padding-right: 28px; }
.companion-fab .companion-fab-greeting > span { font-size: 14px; line-height: 1.6; color: #3d3d3d; }
html[data-theme] .companion-fab .companion-fab-greeting-close {
  position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; border-radius: 999px; border: 2px solid #141414;
  background: #fff; color: #141414; font-size: 16px; line-height: 1; display: grid; place-items: center; cursor: pointer;
}
html[data-theme] .companion-fab .companion-fab-greeting-close:hover { background: #141414; color: #fff; }
.cg-greet-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.cg-greet-chips button {
  min-height: 36px; padding: 0 14px; border-radius: 999px; border: 2px solid #141414; background: #f4f1ea; color: #141414;
  font: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
}
.cg-greet-chips button:hover { background: #2340ff; border-color: #2340ff; color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .companion-fab .companion-fab-avatar svg { animation: cg-twinkle 3.2s ease-in-out infinite; }
  .companion-fab .companion-fab-avatar::after { animation: cg-ping 2.4s ease-out infinite; }
  .companion-fab:not([hidden]) .companion-fab-button { animation: cg-arrive .5s cubic-bezier(.3,1.4,.5,1) both; }
  .companion-fab-greeting:not([hidden]) { animation: cg-pop .35s cubic-bezier(.3,1.4,.5,1) both; }
}
@keyframes cg-twinkle { 0%, 70%, 100% { transform: scale(1) rotate(0); } 80% { transform: scale(1.25) rotate(20deg); } 90% { transform: scale(.9) rotate(-8deg); } }
@keyframes cg-ping { 0% { box-shadow: 0 0 0 0 rgba(255,74,43,.55); } 70%, 100% { box-shadow: 0 0 0 10px rgba(255,74,43,0); } }
@keyframes cg-arrive { from { opacity: 0; translate: 0 18px; } }
@keyframes cg-pop { from { opacity: 0; transform: translateY(8px) scale(.96); } }

/* ---------- 面板：停靠在右侧 ---------- */
html[data-theme] dialog.prompt-chat-popup[data-jiyun-companion] {
  border: 2px solid #141414; border-radius: 26px; background: #fff; color: #141414; box-shadow: 8px 8px 0 #141414;
  font-family: inherit;
}
.prompt-chat-popup::backdrop { background: transparent !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
@media (min-width: 1180px) {
  body.cg-docked { padding-right: calc(var(--companion-width) + var(--companion-gap) * 2); transition: padding-right .3s cubic-bezier(.2,.8,.2,1); }
  body.cg-docked .companion-call-pill { right: calc(var(--companion-width) + var(--companion-gap) * 2 + 20px); }
}
html[data-theme] dialog.prompt-chat-popup[data-jiyun-companion] svg { stroke-width: 2.2; }

/* 标题区 */
html[data-theme] .prompt-chat-popup .companion-header { padding: 16px 16px 14px 18px; border-bottom: 2px solid #141414; background: #fff; border-radius: 24px 24px 0 0; }
.prompt-chat-popup .companion-avatar { width: 42px; height: 42px; border-radius: 13px; background: #2340ff !important; color: #fff; box-shadow: none; }
.prompt-chat-popup .companion-avatar svg { width: 22px; height: 22px; fill: #fff; stroke: none; }
html[data-theme] .prompt-chat-popup .companion-name strong { font-size: 18px; font-weight: 900; color: #141414; }
.prompt-chat-popup .companion-badge { padding: 1px 8px; border-radius: 6px; border: 2px solid #141414; background: #ffc531 !important; color: #141414 !important; font-size: 11px; font-weight: 900; }
.prompt-chat-popup .companion-title small { color: #3d3d3d; font-weight: 600; }
.prompt-chat-popup .companion-online { background: #12704a; }
html[data-theme] .prompt-chat-popup .companion-icon-button {
  width: 38px; height: 38px; border-radius: 999px; border: 2px solid #141414 !important; background: #fff !important; color: #141414 !important;
}
html[data-theme] .prompt-chat-popup .companion-icon-button:is(:hover, [aria-expanded="true"]) { background: #141414 !important; color: #fff !important; }
html[data-theme] .prompt-chat-popup .companion-collapse {
  min-height: 38px; padding: 0 12px 0 14px; border-radius: 999px; border: 2px solid #141414 !important; background: #141414 !important; color: #fff !important; font-weight: 800;
}
html[data-theme] .prompt-chat-popup .companion-collapse:hover { background: #ffc531 !important; color: #141414 !important; }

/* 文字 / 语音切换：黑底胶囊 */
html[data-theme] .prompt-chat-popup .companion-modes { gap: 6px; padding: 12px 18px; border-bottom: 2px solid #141414; background: #f4f1ea; }
html[data-theme] dialog.prompt-chat-popup[data-jiyun-companion] .companion-modes button[role=tab] {
  flex: 1; min-height: 40px; padding: 0 14px; border-radius: 999px !important; border: 2px solid #141414 !important;
  background: #fff !important; color: #141414 !important; font-weight: 800; font-size: 14px;
}
html[data-theme] dialog.prompt-chat-popup[data-jiyun-companion] .companion-modes button[aria-selected=true] { background: #141414 !important; color: #fff !important; }
.companion-modes [aria-selected=true]::after { display: none; }

/* 欢迎区 */
html[data-theme] .prompt-chat-popup .companion-welcome h3 { font-size: 26px; font-weight: 900; color: #141414; letter-spacing: -.02em; }
.prompt-chat-popup .companion-welcome p { color: #3d3d3d; }
.prompt-chat-popup .companion-starters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
html[data-theme] .prompt-chat-popup .companion-starter {
  position: relative; overflow: hidden; min-height: 76px; padding: 12px 14px; align-items: flex-end; justify-content: flex-start;
  border: 2px solid #141414 !important; border-radius: 18px; background: #fff !important; color: #141414 !important;
  font-size: 15px; font-weight: 900; text-align: left;
  transition: translate .2s cubic-bezier(.3,.7,.35,1.35), box-shadow .2s ease;
}
html[data-theme] .prompt-chat-popup .companion-starter span { position: relative; z-index: 1; color: inherit !important; }
html[data-theme] .prompt-chat-popup .companion-starter:nth-child(1) { background: #2340ff !important; color: #fff !important; }
html[data-theme] .prompt-chat-popup .companion-starter:nth-child(2) { background: #ff4a2b !important; color: #fff !important; }
html[data-theme] .prompt-chat-popup .companion-starter:nth-child(3) { background: #ffc531 !important; }
html[data-theme] .prompt-chat-popup .companion-starter.is-optimize { background: #fff !important; border-style: dashed !important; }
.prompt-chat-popup .companion-starter::after {
  content: ""; position: absolute; right: 10px; top: 10px; width: 22px; height: 22px; border: 0; transform: none; border-radius: 999px; background: rgba(255,255,255,.35);
}
.prompt-chat-popup .companion-starter:nth-child(2)::after { border-radius: 0 0 0 999px; }
.prompt-chat-popup .companion-starter:nth-child(3)::after { background: rgba(20,20,20,.18); border-radius: 4px; }
.prompt-chat-popup .companion-starter.is-optimize::after { background: none; width: auto; height: auto; content: "✎"; font-size: 18px; top: 8px; color: #141414; }
html[data-theme] .prompt-chat-popup .companion-starter:hover:not(:disabled) { translate: -2px -2px; box-shadow: 4px 4px 0 #141414; }
html[data-theme] .prompt-chat-popup .companion-starter:active { translate: 1px 1px; box-shadow: none; }

/* 对话气泡 */
.prompt-chat-popup .companion-message p {
  border: 2px solid #141414; border-radius: 18px 18px 18px 6px; background: #fff; color: #141414; box-shadow: none; font-size: 14.5px; line-height: 1.7;
}
.prompt-chat-popup .companion-message.is-user p { border-radius: 18px 18px 6px 18px; background: #141414; color: #fff; }
.prompt-chat-popup .companion-message-avatar { width: 32px; height: 32px; border-radius: 10px; background: #2340ff; color: #fff; box-shadow: none; }
.prompt-chat-popup .companion-message-avatar svg { fill: #fff; stroke: none; }
.prompt-chat-popup .companion-message.is-user .companion-message-avatar { background: #ffc531; color: #141414; border: 2px solid #141414; font-weight: 900; }
.prompt-chat-popup .companion-dots i { background: #141414; }

/* 快捷指令 */
html[data-theme] .prompt-chat-popup .companion-quick button {
  min-height: 34px; padding: 0 14px; border-radius: 999px; border: 2px solid #141414 !important; background: #fff !important; color: #141414 !important; font-weight: 800;
}
html[data-theme] .prompt-chat-popup .companion-quick button:hover:not(:disabled) { background: #ffc531 !important; }

/* 一键填入：大按钮 */
html[data-theme] .prompt-chat-popup .companion-apply {
  min-height: 50px; border-radius: 16px; border: 2px solid #141414 !important; background: #ffc531 !important; color: #141414 !important;
  font-size: 15px; font-weight: 900; box-shadow: 4px 4px 0 #141414;
  transition: translate .2s cubic-bezier(.3,.7,.35,1.35), box-shadow .2s ease;
}
html[data-theme] .prompt-chat-popup .companion-apply:hover:not(:disabled) { translate: -2px -2px; box-shadow: 6px 6px 0 #141414; }
html[data-theme] .prompt-chat-popup .companion-apply:disabled:not(.is-done) { background: #ece8df !important; color: #6b6b6b !important; border-color: #bdb7ab !important; box-shadow: none; }
html[data-theme] .prompt-chat-popup .companion-apply.is-done { background: #12704a !important; color: #fff !important; box-shadow: none; }
.prompt-chat-popup .companion-apply::before { filter: none; }

/* 输入框 */
html[data-theme] .prompt-chat-popup .companion-input-box { border: 2px solid #141414; border-radius: 20px; background: #fff; box-shadow: none; }
html[data-theme] .prompt-chat-popup .companion-input-box:focus-within { box-shadow: 0 0 0 4px rgba(35,64,255,.2); border-color: #2340ff; }
html[data-theme] .prompt-chat-popup .companion-input-box textarea { color: #141414; font-size: 15px; }
html[data-theme] .prompt-chat-popup .companion-send { width: 42px; height: 42px; border-radius: 999px; border: 0; background: #2340ff !important; color: #fff !important; }
html[data-theme] .prompt-chat-popup .companion-send:hover:not(:disabled) { background: #141414 !important; }
html[data-theme] .prompt-chat-popup .companion-send:disabled { background: #bdb7ab !important; }
.prompt-chat-popup .companion-hint { color: #6b6b6b; }

/* 历史 */
html[data-theme] .prompt-chat-popup .companion-history { border-bottom: 2px solid #141414; background: #f4f1ea; }
html[data-theme] .prompt-chat-popup .companion-history-item { border: 2px solid #141414; border-radius: 14px; background: #fff; color: #141414; }
html[data-theme] .prompt-chat-popup .companion-history-item:is(:hover, .is-active) { background: #ffc531; }

/* 语音 */
.prompt-chat-popup .voice-emblem::before, .prompt-chat-popup .voice-emblem::after { border-color: #141414; }
.prompt-chat-popup .voice-emblem span { background: #2340ff; }
.prompt-chat-popup .voice-emblem i { background: #fff; }
html[data-theme] dialog.prompt-chat-popup[data-jiyun-companion] .voice-stage .voice-toggle {
  min-height: 54px; border-radius: 999px; border: 2px solid #141414; background: #2340ff; color: #fff; font-weight: 900; font-size: 16px; box-shadow: 4px 4px 0 #141414;
}
html[data-theme] dialog.prompt-chat-popup[data-jiyun-companion] [data-state=connected] .voice-stage .voice-toggle { background: #ff4a2b; }
.prompt-chat-popup .voice-choice select { border: 2px solid #141414; border-radius: 12px; background: #fff; color: #141414; }

/* 收起后的通话条 */
html[data-theme] .companion-call-pill { right: 22px; bottom: 104px; padding: 8px 8px 8px 14px; border: 2px solid #141414; border-radius: 22px; background: #ff4a2b; color: #fff; box-shadow: 5px 5px 0 #141414; }
html[data-theme] .companion-call-pill .ccp-back { background: #fff; color: #141414; border-color: #fff; }
html[data-theme] .companion-call-pill .ccp-end { border-color: #fff; color: #fff; }
html[data-theme] .companion-call-pill .ccp-end:hover { background: #141414; border-color: #141414; }

/* ---------- 手机：底部弹出 ---------- */
@media (max-width: 760px) {
  .companion-fab { right: 14px; }
  html[data-theme] .companion-fab .companion-fab-button { min-height: 56px; padding: 6px 16px 6px 6px; border-radius: 18px; }
  .companion-fab .companion-fab-avatar { width: 42px; height: 42px; }
  html[data-theme] .companion-fab .companion-fab-greeting { width: min(300px, calc(100vw - 28px)); }
}
@media (max-width: 640px) {
  html[data-theme] dialog.prompt-chat-popup[data-jiyun-companion] {
    inset: auto 0 0 0 !important; width: 100% !important; height: 86dvh !important; max-height: 86dvh;
    border-radius: 26px 26px 0 0; border-width: 2px 0 0; box-shadow: 0 -6px 0 rgba(20,20,20,.12);
  }
  html[data-theme] .prompt-chat-popup .companion-header { padding-top: 22px; border-radius: 26px 26px 0 0; position: relative; }
  html[data-theme] .prompt-chat-popup .companion-header::before {
    content: ""; position: absolute; left: 50%; top: 8px; width: 46px; height: 5px; margin-left: -23px; border-radius: 999px; background: #141414; opacity: .35;
  }
  .prompt-chat-popup .companion-starters { grid-template-columns: 1fr 1fr; }
  html[data-theme] .prompt-chat-popup .companion-starter { min-height: 64px; font-size: 14px; }
  html[data-theme] .prompt-chat-popup .companion-name strong { font-size: 16px; white-space: nowrap; }
  .prompt-chat-popup .companion-badge { white-space: nowrap; }
  .prompt-chat-popup .companion-title small { display: none; }
  .prompt-chat-popup .companion-avatar { width: 36px; height: 36px; }
  html[data-theme] .prompt-chat-popup .companion-icon-button { width: 34px; height: 34px; }
  html[data-theme] .prompt-chat-popup .companion-collapse { min-height: 34px; padding: 0 10px 0 12px; }
  @keyframes companion-enter { from { opacity: .4; transform: translateY(40%); } to { opacity: 1; transform: none; } }
}

/* ---------- 语音徽标：跟着声音动 ---------- */
html[data-theme] .prompt-chat-popup .voice-emblem {
  --me: 0; --ai: 0;
  position: relative; width: 132px; height: 132px; margin: 6px auto 10px; gap: 7px; isolation: isolate;
  border: 2px solid #141414; border-radius: 999px; background: #2340ff; color: #fff; box-shadow: 6px 6px 0 #141414;
  transition: background-color .3s ease, transform .2s ease;
}
html[data-theme] .prompt-chat-popup .voice-emblem::before,
html[data-theme] .prompt-chat-popup .voice-emblem::after {
  content: ""; position: absolute; inset: -4px; z-index: -1; border-radius: 999px; transform: none; opacity: 0;
  border: 4px solid #ff4a2b; background: none; pointer-events: none;
}
/* 你说话：红色波纹随音量扩散 */
html[data-theme] .prompt-chat-popup .voice-emblem::before { opacity: calc(var(--me) * 1.6); transform: scale(calc(1 + var(--me) * .55)); transition: transform .08s linear, opacity .12s linear; }
/* GPT 说话：黄色外圈随音量扩散 */
html[data-theme] .prompt-chat-popup .voice-emblem::after { border-color: #ffc531; border-width: 6px; opacity: calc(var(--ai) * 1.8); transform: scale(calc(1 + var(--ai) * .4)); transition: transform .08s linear, opacity .12s linear; }
html[data-theme] .prompt-chat-popup .voice-emblem span { display: none; }
html[data-theme] .prompt-chat-popup .voice-emblem i {
  --h: 0; width: 9px; height: calc(14px + var(--h) * 54px); border-radius: 6px; background: #fff; opacity: 1; animation: none;
  transition: height .07s linear;
}
html[data-theme] .prompt-chat-popup .voice-emblem i:nth-of-type(2), html[data-theme] .prompt-chat-popup .voice-emblem i:nth-of-type(4) { height: calc(22px + var(--h) * 50px); }
html[data-theme] .prompt-chat-popup .voice-emblem i:nth-of-type(3) { height: calc(30px + var(--h) * 44px); }
html[data-theme] .prompt-chat-popup .voice-emblem[data-speaker="me"] { background: #141414; }
html[data-theme] .prompt-chat-popup .voice-emblem[data-speaker="ai"] { background: #2340ff; }
.cg-voice-label { margin: 6px 0 2px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 999px; border: 2px solid #141414; background: #ffc531; color: #141414; font-size: 13px; font-weight: 900; }
.companion-voice[data-state="connected"] .cg-voice-label::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: #ff4a2b; animation: cg-rec 1.2s ease-in-out infinite; }
@keyframes cg-rec { 50% { opacity: .25; } }
@media (prefers-reduced-motion: no-preference) {
  /* 没通话时轻轻呼吸，接通中外圈转动 */
  .companion-voice:not([data-state="connected"]):not([data-state="connecting"]) .voice-emblem { animation: cg-breathe 3.4s ease-in-out infinite; }
  .companion-voice:not([data-state="connected"]):not([data-state="connecting"]) .voice-emblem i { animation: cg-idlebar 1.8s ease-in-out infinite; }
  .companion-voice:not([data-state="connected"]):not([data-state="connecting"]) .voice-emblem i:nth-of-type(2) { animation-delay: .15s; }
  .companion-voice:not([data-state="connected"]):not([data-state="connecting"]) .voice-emblem i:nth-of-type(3) { animation-delay: .3s; }
  .companion-voice:not([data-state="connected"]):not([data-state="connecting"]) .voice-emblem i:nth-of-type(4) { animation-delay: .45s; }
  .companion-voice:not([data-state="connected"]):not([data-state="connecting"]) .voice-emblem i:nth-of-type(5) { animation-delay: .6s; }
  html[data-theme] .companion-voice[data-state="connecting"] .voice-emblem::after { opacity: 1; border: 4px dashed #141414; inset: -12px; animation: cg-spin 2.4s linear infinite; }
  .companion-voice[data-state="connecting"] .voice-emblem i { animation: cg-idlebar .8s ease-in-out infinite; }
}
@keyframes cg-breathe { 50% { transform: scale(1.04); } }
@keyframes cg-idlebar { 50% { transform: scaleY(.55); } }
@keyframes cg-spin { to { transform: rotate(360deg); } }

/* OpenAI 标识：按原样显示，不加滤镜和动画，尺寸小于本站标识 */
.cg-powered { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 4px; font-size: 12px; font-weight: 700; color: #3d3d3d; }
.cg-powered img { display: block; width: 22px; height: 22px; border-radius: 4px; animation: none !important; filter: none !important; }

/* ---------- 语音徽标：可爱小脸（黄色圆脸、豆豆眼、粉腮红、小嘴巴） ---------- */
html[data-theme] .prompt-chat-popup .voice-emblem.cg-face,
html[data-theme] .prompt-chat-popup .voice-emblem.cg-face[data-speaker] {
  --talk: 0; display: block; background: #ffc531; transition: transform .35s cubic-bezier(.3,1.4,.5,1), background-color .3s ease;
}
html[data-theme] .prompt-chat-popup .voice-emblem.cg-face i { display: none; }
/* 豆豆眼：黑色小椭圆 + 白色高光 */
html[data-theme] .prompt-chat-popup .cg-face .cg-eye {
  display: block; position: absolute; top: 48px; width: 14px; height: 18px; border-radius: 999px; background: #141414;
  transform-origin: center; transition: transform .25s ease, height .2s ease, border-radius .2s ease, top .2s ease;
}
html[data-theme] .prompt-chat-popup .cg-face .cg-eye-l { left: 38px; }
html[data-theme] .prompt-chat-popup .cg-face .cg-eye-r { right: 38px; }
html[data-theme] .prompt-chat-popup .cg-face .cg-eye::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 5px; height: 5px; margin: 0; border-radius: 999px; background: #fff; transition: opacity .2s ease;
}
/* 粉色腮红 */
html[data-theme] .prompt-chat-popup .cg-face .cg-cheek { position: absolute; display: block; top: 70px; width: 18px; height: 10px; border-radius: 999px; background: #ff8fa3; opacity: .9; }
html[data-theme] .prompt-chat-popup .cg-face .cg-cheek-l { left: 22px; }
html[data-theme] .prompt-chat-popup .cg-face .cg-cheek-r { right: 22px; }
/* 小嘴巴：平时是一个小小的微笑 */
html[data-theme] .prompt-chat-popup .cg-face .cg-mouth {
  display: block; position: absolute; left: 50%; top: 70px; width: 20px; height: 10px; margin-left: -10px; box-sizing: border-box;
  border: 3.5px solid #141414; border-top: 0; border-radius: 0 0 999px 999px; background: transparent; overflow: hidden;
  transition: height .07s linear, width .12s ease, border-radius .12s ease, top .12s ease;
}
/* GPT 说话：眼睛眯成弯弯的笑眼，小嘴跟着声音一张一合（张得不大，露一点粉色舌头） */
html[data-theme] .prompt-chat-popup .voice-emblem.cg-face[data-speaker="ai"] .cg-eye {
  height: 9px; top: 52px; background: transparent; border: 3.5px solid #141414; border-bottom: 0; border-radius: 999px 999px 0 0; width: 16px;
}
html[data-theme] .prompt-chat-popup .voice-emblem.cg-face[data-speaker="ai"] .cg-eye::after { opacity: 0; }
html[data-theme] .prompt-chat-popup .voice-emblem.cg-face[data-speaker="ai"] .cg-mouth {
  top: 68px; width: 20px; margin-left: -10px; height: calc(7px + var(--talk) * 11px);
  border: 3.5px solid #141414; border-radius: 8px 8px 12px 12px; background: #8a1c2c;
}
html[data-theme] .prompt-chat-popup .voice-emblem.cg-face[data-speaker="ai"] .cg-mouth::after {
  content: ""; position: absolute; left: 2px; right: 2px; bottom: -2px; height: 6px; border-radius: 999px 999px 0 0; background: #ff8fa3;
}
/* 你说话：小脸歪着头认真听，嘴变成小小的「o」 */
html[data-theme] .prompt-chat-popup .voice-emblem.cg-face[data-speaker="me"] { transform: rotate(-8deg); }
html[data-theme] .prompt-chat-popup .voice-emblem.cg-face[data-speaker="me"] .cg-eye { transform: scale(1.12); }
html[data-theme] .prompt-chat-popup .voice-emblem.cg-face[data-speaker="me"] .cg-mouth { width: 10px; height: 10px; margin-left: -5px; top: 72px; border: 3.5px solid #141414; border-radius: 999px; }
@media (prefers-reduced-motion: no-preference) {
  html[data-theme] .prompt-chat-popup .cg-face .cg-eye { animation: cg-blink 4.5s infinite; }
  html[data-theme] .prompt-chat-popup .voice-emblem.cg-face[data-speaker="ai"] .cg-eye { animation: none; }
  html[data-theme] .prompt-chat-popup .cg-face .cg-eye::after { animation: none; }
  /* 接通中：小脸左右看看 */
  html[data-theme] .prompt-chat-popup .companion-voice[data-state="connecting"] .cg-face .cg-eye { animation: cg-peek 1.6s ease-in-out infinite; }
  /* 没通话时：偶尔开心地晃一晃 */
  .companion-voice:not([data-state="connected"]):not([data-state="connecting"]) .voice-emblem.cg-face { animation: cg-wiggle 6s ease-in-out infinite; }
}
@keyframes cg-blink { 0%, 93%, 100% { scale: 1 1; } 96% { scale: 1 .15; } }
@keyframes cg-peek { 0%, 100% { translate: -4px 0; } 50% { translate: 4px 0; } }
@keyframes cg-wiggle { 0%, 80%, 100% { rotate: 0deg; } 84% { rotate: -7deg; } 88% { rotate: 6deg; } 92% { rotate: -3deg; } }
html[data-theme] .prompt-chat-popup .voice-emblem.cg-face::after { border-color: #2340ff; }

/* ===== 电脑紧凑尺寸（自动生成，只对鼠标设备、宽屏生效）===== */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
html[data-theme] .companion-fab .companion-fab-button { min-height: 51px; padding: 8px 17px 8px 8px; border-radius: 19px; }
.companion-fab .companion-fab-text strong { font-size: 16px; }
html[data-theme] .companion-fab .companion-fab-greeting { padding: 15px 15px 14px; border-radius: 19px; }
.companion-fab .companion-fab-greeting strong { font-size: 16px; padding-right: 22px; }
html[data-theme] .companion-fab .companion-fab-greeting-close { font-size: 15px; }
html[data-theme] dialog.prompt-chat-popup[data-jiyun-companion] { border-radius: 22px; }
html[data-theme] .prompt-chat-popup .companion-header { padding: 14px 14px 14px 15px; }
html[data-theme] .prompt-chat-popup .companion-name strong { font-size: 17px; }
html[data-theme] .prompt-chat-popup .companion-modes { padding: 12px 15px; }
html[data-theme] dialog.prompt-chat-popup[data-jiyun-companion] .companion-modes button[role=tab] { min-height: 32px; }
html[data-theme] .prompt-chat-popup .companion-welcome h3 { font-size: 22px; }
html[data-theme] .prompt-chat-popup .companion-starter { min-height: 65px; font-size: 14px; }
.prompt-chat-popup .companion-starter.is-optimize::after { font-size: 17px; }
html[data-theme] .prompt-chat-popup .companion-apply { min-height: 40px; font-size: 14px; }
html[data-theme] .prompt-chat-popup .companion-input-box { border-radius: 17px; }
html[data-theme] .prompt-chat-popup .companion-input-box textarea { font-size: 14px; }
html[data-theme] .prompt-chat-popup .companion-send { width: 34px; height: 34px; }
html[data-theme] dialog.prompt-chat-popup[data-jiyun-companion] .voice-stage .voice-toggle { min-height: 43px; font-size: 15px; }
html[data-theme] .companion-call-pill { border-radius: 19px; }

}
