/* ---------- 💬 剧本导演助手面板 ---------- */
#assistant-panel {
  position: fixed; right: 0; top: 48px; z-index: 60;
  width: 560px; max-width: calc(100vw - 20px);
  height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: rgba(20,23,32,.98); backdrop-filter: blur(10px);
  border: 1px solid var(--panel-line);
  border-right: none;
  border-bottom: none;
  border-radius: 12px 0 0 0;
  box-shadow: -8px 0 30px rgba(0,0,0,.5);
  transform: translateX(16px); opacity: 0; pointer-events: none;
  transition: transform .18s ease, opacity .18s ease;
}
#assistant-panel.open { transform: translateX(0); opacity: 1; pointer-events: auto; }
#assistant-panel .as-header {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; border-bottom: 1px solid var(--panel-line);
  cursor: grab; user-select: none; white-space: nowrap;   /* 悬浮窗: 拖动标题栏移动 */
}
#assistant-panel .as-header:active { cursor: grabbing; }
#assistant-panel .as-drag-hint { font-size: 10px; color: var(--tx-3); opacity: .7; flex: none; }
#assistant-panel .as-title { font-size: 14px; font-weight: 700; color: var(--tx); white-space: nowrap; flex-shrink: 0; }
#assistant-panel .as-model {
  font-size: 11px; color: #7ee7ad; padding: 2px 8px; border-radius: 8px;
  background: rgba(45,212,191,.12); border: 1px solid rgba(45,212,191,.3);
  white-space: nowrap; flex-shrink: 0; cursor: pointer;
  transition: all .15s ease; user-select: none;
  display: inline-flex; align-items: center; gap: 4px;
}
#assistant-panel .as-model:hover {
  background: rgba(45,212,191,.22); border-color: rgba(45,212,191,.6);
  color: #a7f3d0; box-shadow: 0 0 10px rgba(45,212,191,.25);
}

/* ⚡ 导演台顶部快捷模型通道下拉菜单 */
#as-channel-menu {
  position: fixed; z-index: 999;
  min-width: 260px; max-width: 320px;
  background: rgba(22, 27, 34, .96); backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255,255,255,.05);
  padding: 6px; font-size: 12px; color: var(--tx);
  user-select: none; animation: asPopIn .15s ease;
}
@keyframes asPopIn {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.as-cm-header {
  padding: 4px 8px 6px; font-size: 11px; font-weight: 600; color: #94a3b8;
  border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 4px;
  display: flex; justify-content: space-between; align-items: center;
}
.as-cm-set-link {
  color: #5b8cff; cursor: pointer; transition: opacity .15s; font-weight: 500;
}
.as-cm-set-link:hover {
  text-decoration: underline; opacity: 1;
}
.as-cm-list {
  display: flex; flex-direction: column; gap: 3px; max-height: 280px; overflow-y: auto;
}
.as-cm-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
  transition: all .12s ease; border: 1px solid transparent;
}
.as-cm-item:hover {
  background: rgba(255, 255, 255, .06);
}
.as-cm-item.active {
  background: rgba(45, 212, 191, .14); border-color: rgba(45, 212, 191, .35);
}
.as-cm-info {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1;
}
.as-cm-name-row {
  display: flex; align-items: center; gap: 6px;
}
.as-cm-name {
  font-weight: 600; color: #e2e8f0; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px;
}
.as-cm-tag-off {
  font-size: 9px; color: #94a3b8; background: rgba(255,255,255,.08);
  padding: 1px 4px; border-radius: 4px;
}
.as-cm-model {
  font-size: 10px; color: #7ee7ad; font-family: monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.as-cm-item.disabled .as-cm-name { color: #94a3b8; }
.as-cm-item.disabled .as-cm-model { color: #64748b; }
.as-cm-check {
  font-size: 11px; color: #7ee7ad; font-weight: 700; margin-left: 6px; flex-shrink: 0;
}
.as-cm-switch-btn {
  font-size: 10px; color: #94a3b8; opacity: 0; transition: opacity .15s; margin-left: 6px; flex-shrink: 0;
}
.as-cm-item:hover .as-cm-switch-btn { opacity: 1; color: #5b8cff; }
#assistant-panel .as-session-title-wrap {
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 150px; padding: 2px 8px; border-radius: 6px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  color: var(--tx-2); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .15s ease; user-select: none; flex-shrink: 1; min-width: 0;
}
#assistant-panel .as-session-title-wrap:hover {
  background: rgba(91,140,255,.15); border-color: rgba(91,140,255,.45); color: #c7d9fe;
}
#assistant-panel .as-session-title-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px;
}
#assistant-panel .as-session-title-edit-icon {
  font-size: 10px; opacity: .45; transition: opacity .15s ease; flex-shrink: 0;
}
#assistant-panel .as-session-title-wrap:hover .as-session-title-edit-icon { opacity: 1; }
#assistant-panel .as-header-title-in {
  background: rgba(15,23,42,.95); border: 1px solid #5b8cff; border-radius: 6px;
  color: #ffffff; font-size: 12px; font-weight: 600; padding: 2px 7px;
  outline: none; width: 140px; box-shadow: 0 0 8px rgba(91,140,255,.45);
}
#assistant-panel .as-header-acts {
  margin-left: auto; display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
#assistant-panel .as-btn {
  border: none; background: transparent; color: var(--tx-3);
  font-size: 13px; cursor: pointer; padding: 4px 7px; border-radius: 7px;
  display: inline-flex; align-items: center; gap: 3px;
  white-space: nowrap; flex-shrink: 0;
  transition: all .15s ease;
}
#assistant-panel .as-btn:hover { background: rgba(255,255,255,.08); color: var(--tx); }
#assistant-panel .as-btn.as-btn-pill {
  background: rgba(91,140,255,.14); color: #9bbdff; font-weight: 500; font-size: 12px;
  border: 1px solid rgba(91,140,255,.3); padding: 3px 8px; border-radius: 8px;
}
#assistant-panel .as-btn.as-btn-pill:hover {
  background: rgba(91,140,255,.28); color: #d0e1ff; border-color: rgba(91,140,255,.5);
}

/* 剧本导演: 模式下拉与人设编辑 */
#assistant-panel .as-ctrl-mode-sel {
  background: linear-gradient(135deg, rgba(91, 140, 255, .22), rgba(147, 51, 234, .22));
  border-color: rgba(91, 140, 255, .45);
  color: #ffffff;
  font-weight: 600;
  padding-right: 20px;
}
#assistant-panel .as-ctrl-mode-sel:hover {
  background: linear-gradient(135deg, rgba(91, 140, 255, .35), rgba(147, 51, 234, .35));
  border-color: rgba(91, 140, 255, .75);
}
#assistant-panel .as-mode-edit-btn {
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px dashed rgba(91, 140, 255, .4);
  background: rgba(91, 140, 255, .08);
  color: #9bbdff;
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
#assistant-panel .as-mode-edit-btn:hover {
  background: rgba(91, 140, 255, .25);
  color: #ffffff;
  border-color: rgba(91, 140, 255, .8);
  transform: translateY(-1px);
}

/* 🎛️ 创作增强辅助控制栏 (方案1: 悬浮把手 + 悬停向下浮动抽屉) */
#assistant-panel .as-ctrl-wrap {
  position: relative;
  z-index: 30;
  flex-shrink: 0;
}
#assistant-panel .as-ctrl-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 12px;
  height: 22px;
  background: rgba(18, 22, 34, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 11px;
  cursor: pointer;
  user-select: none;
  backdrop-filter: blur(8px);
  transition: all .15s ease;
}
#assistant-panel .as-ctrl-handle:hover,
#assistant-panel .as-ctrl-wrap.pinned .as-ctrl-handle {
  background: rgba(28, 35, 54, 0.95);
  color: #e2e8f0;
  border-bottom-color: rgba(91, 140, 255, 0.35);
}
#assistant-panel .as-handle-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}
#assistant-panel .as-handle-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  color: #94a3b8;
}
#assistant-panel .as-ctrl-wrap:hover .as-handle-summary,
#assistant-panel .as-ctrl-wrap.pinned .as-handle-summary {
  color: #bfdbfe;
}
#assistant-panel .as-handle-arrow {
  font-size: 10px;
  color: #64748b;
  transition: transform .2s ease;
}

#assistant-panel .as-ctrl-bar {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px 10px;
  background: rgba(14, 16, 24, 0.98);
  backdrop-filter: blur(16px);
  border-bottom: 2px solid rgba(91, 140, 255, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.75);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 35;
}

#assistant-panel .as-ctrl-wrap:hover .as-ctrl-bar,
#assistant-panel .as-ctrl-wrap.pinned .as-ctrl-bar {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#assistant-panel .as-ctrl-wrap:hover .as-handle-arrow,
#assistant-panel .as-ctrl-wrap.pinned .as-handle-arrow {
  transform: rotate(180deg);
  color: #93c5fd;
}
#assistant-panel .as-ctrl-row {
  display: flex; align-items: center; gap: 6px; width: 100%;
}
#assistant-panel .as-ctrl-item {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--tx-3); min-width: 0; flex: 1;
}
#assistant-panel .as-ctrl-item.as-ctrl-item-mode {
  flex: 1 1 auto; min-width: 140px;
}
#assistant-panel .as-ctrl-item.as-ctrl-item-shot {
  flex: 0 0 auto;
}
#assistant-panel .as-ctrl-item.as-ctrl-item-shot .as-ctrl-sel {
  width: 58px; padding: 2px 14px 2px 5px;
}
#assistant-panel .as-ctrl-item.as-ctrl-item-dur {
  flex: 0 0 auto;
}
#assistant-panel .as-ctrl-item.as-ctrl-item-dur .as-ctrl-sel {
  width: 94px; padding: 2px 14px 2px 5px;
}
#assistant-panel .as-ctrl-lbl {
  font-size: 11px; font-weight: 600; color: #94a3b8; white-space: nowrap; flex-shrink: 0;
}
#assistant-panel .as-ctrl-sel {
  appearance: none; -webkit-appearance: none;
  background: #1e2235; border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px; color: #e2e8f0; font-size: 11px; font-weight: 500;
  padding: 2px 16px 2px 6px; height: 24px; outline: none; cursor: pointer;
  width: 100%; min-width: 0; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%2388909f'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 5px center;
  transition: all .15s ease;
}
#assistant-panel .as-ctrl-sel:hover {
  border-color: rgba(91, 140, 255, .6); color: #fff; background-color: #242940;
}
#assistant-panel .as-mode-edit-btn {
  background: rgba(91, 140, 255, .15); border: 1px solid rgba(91, 140, 255, .35);
  border-radius: 6px; color: #93c5fd; font-size: 11px; padding: 0 6px; height: 24px;
  cursor: pointer; transition: all .15s ease; white-space: nowrap; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
#assistant-panel .as-mode-edit-btn:hover {
  background: rgba(91, 140, 255, .3); color: #fff; border-color: rgba(91, 140, 255, .6);
}
#assistant-panel .as-ctrl-char-wrap {
  flex: 0 0 auto; margin-left: auto;
}
#assistant-panel .as-ctrl-char-btn {
  background: rgba(168, 85, 247, .12); border: 1px solid rgba(168, 85, 247, .35);
  border-radius: 6px; color: #d8b4fe; font-size: 11px; font-weight: 600;
  padding: 2px 7px; height: 24px; cursor: pointer; transition: all .15s ease;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 3px;
}
#assistant-panel .as-ctrl-char-btn:hover {
  background: rgba(168, 85, 247, .25); border-color: rgba(192, 132, 252, .7); color: #fff;
  box-shadow: 0 0 8px rgba(168, 85, 247, .3);
}
#assistant-panel .as-ctrl-char-btn.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, .3), rgba(236, 72, 153, .3));
  border-color: #c084fc; color: #ffffff;
}

/* 🎭 固定主角与一致性设定抽屉 */
#assistant-panel .as-char-drawer {
  background: #161928; border-bottom: 1px solid rgba(168, 85, 247, .3);
  padding: 10px 14px; display: flex; flex-direction: column; gap: 8px;
  animation: asDrawerIn .18s ease-out;
}
@keyframes asDrawerIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
#assistant-panel .as-char-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
}
#assistant-panel .as-char-drawer-title {
  font-size: 12px; font-weight: 700; color: #d8b4fe;
}
#assistant-panel .as-char-drawer-body {
  display: flex; flex-direction: column; gap: 6px;
}
#assistant-panel .as-char-drawer-body label {
  display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--tx-3);
}
#assistant-panel .as-char-input-name,
#assistant-panel .as-char-input-desc {
  background: #11131e; border: 1px solid rgba(255, 255, 255, .12); border-radius: 6px;
  color: #fff; font-size: 12px; padding: 5px 8px; font-family: inherit;
  outline: none; transition: border-color .15s;
}
#assistant-panel .as-char-input-name:focus,
#assistant-panel .as-char-input-desc:focus {
  border-color: #c084fc; box-shadow: 0 0 6px rgba(192, 132, 252, .3);
}
#assistant-panel .as-char-drawer-foot {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px;
}

/* 🎙️ 提取配音台词弹窗 */
.as-dialogue-modal-mask {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, .75); backdrop-filter: blur(8px);
  z-index: 100000; display: flex; align-items: center; justify-content: center;
  animation: asFadeIn .15s ease-out;
}
@keyframes asFadeIn { from { opacity: 0; } to { opacity: 1; } }
.as-dialogue-dialog {
  background: #151827; border: 1px solid rgba(91, 140, 255, .4);
  border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .8), 0 0 24px rgba(91, 140, 255, .25);
  width: 90%; max-width: 620px; max-height: 85vh;
  display: flex; flex-direction: column; padding: 16px; gap: 12px;
  color: #f1f5f9; font-family: inherit;
}
.as-dialogue-head {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, .08); padding-bottom: 10px;
}
.as-dialogue-title {
  font-size: 14px; font-weight: 700; color: #93c5fd; display: flex; align-items: center; gap: 6px;
}
.as-dialogue-body {
  flex: 1; min-height: 220px; max-height: 55vh; display: flex;
}
.as-dialogue-textarea {
  width: 100%; height: 100%; min-height: 220px;
  background: #0f111a; border: 1px solid rgba(255, 255, 255, .1); border-radius: 8px;
  color: #e2e8f0; font-size: 13px; line-height: 1.7; padding: 12px;
  font-family: inherit; resize: none; outline: none;
}
.as-dialogue-textarea:focus {
  border-color: rgba(91, 140, 255, .6);
}
.as-dialogue-foot {
  display: flex; align-items: center; gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 10px;
}
#assistant-panel .as-mini.as-dialogue-btn {
  border-color: rgba(168, 85, 247, .4); color: #d8b4fe; background: rgba(168, 85, 247, .12);
  font-weight: 600;
}
#assistant-panel .as-mini.as-dialogue-btn:hover {
  background: rgba(168, 85, 247, .25); border-color: rgba(192, 132, 252, .7); color: #fff;
}

/* ⚙️ 设置子标签栏 (模式人设 / 通道配置) */
#assistant-panel .as-set-tabs {
  display: flex; gap: 6px; border-bottom: 1px solid var(--panel-line);
  padding-bottom: 8px; margin-bottom: 2px;
}
#assistant-panel .as-set-tab {
  padding: 5px 12px; border-radius: 7px;
  border: 1px solid var(--panel-line);
  background: rgba(255, 255, 255, .03);
  color: var(--tx-2); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .15s ease;
}
#assistant-panel .as-set-tab:hover {
  background: rgba(255, 255, 255, .07); color: var(--tx);
}
#assistant-panel .as-set-tab.active {
  background: rgba(91, 140, 255, .2); color: #d0e1ff; border-color: rgba(91, 140, 255, .5);
}

/* 📝 模式与提示词人设卡片 */
#assistant-panel .as-mini.as-danger:hover { background: rgba(239,68,68,.3); }
#assistant-panel .as-msg.as-interrupted {
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.08);
  border-radius: 12px;
}
#assistant-panel .as-interrupted-title {
  font-size: 13px;
  font-weight: 600;
  color: #fbbf24;
  margin-bottom: 4px;
}
#assistant-panel .as-mode-card {
  border: 1px solid var(--panel-line); border-radius: 10px; padding: 10px 12px;
  background: rgba(255, 255, 255, .03); display: flex; flex-direction: column; gap: 8px;
  transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
}
#assistant-panel .as-mode-card:hover {
  border-color: rgba(91, 140, 255, .35);
  background: rgba(255, 255, 255, .045);
}
#assistant-panel .as-mode-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  padding: 2px 0;
}
#assistant-panel .as-mode-card-head:hover .as-mode-card-title {
  color: #93c5fd;
}
#assistant-panel .as-mode-card-head-left {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
}
#assistant-panel .as-mode-card-toggle {
  font-size: 9px; color: var(--tx-3); width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s ease, color .15s ease;
}
#assistant-panel .as-mode-card-head:hover .as-mode-card-toggle {
  color: #5b8cff;
}
#assistant-panel .as-mode-card.collapsed .as-mode-card-body {
  display: none !important;
}
#assistant-panel .as-mode-card.collapsed {
  padding: 8px 12px;
  gap: 0;
}
#assistant-panel .as-mode-card-hint-preview {
  font-size: 11px; color: var(--tx-3); opacity: 0.65; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: 6px;
}
#assistant-panel .as-mode-card.collapsed .as-mode-card-hint-preview {
  display: inline-block;
}
#assistant-panel .as-mode-card:not(.collapsed) .as-mode-card-hint-preview {
  display: none;
}
#assistant-panel .as-mode-global-acts {
  display: flex; align-items: center; gap: 6px;
}
#assistant-panel .as-mode-card-title {
  font-size: 13px; font-weight: 700; color: var(--tx); display: flex; align-items: center; gap: 6px;
  white-space: nowrap; transition: all .15s ease;
}
#assistant-panel .as-mode-card-badge {
  font-size: 10px; color: var(--tx-3); background: rgba(255,255,255,.06);
  border-radius: 4px; padding: 1px 5px; font-weight: 400; transition: all .15s ease;
}

/* 🌟 展开状态的卡片：醒目的红色高光与光晕，极其容易区分识别 */
#assistant-panel .as-mode-card:not(.collapsed) {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.035);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.12), inset 0 0 0 1px rgba(239, 68, 68, 0.15);
}
#assistant-panel .as-mode-card:not(.collapsed) .as-mode-card-title {
  color: #ff4d4f !important;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.02) 100%);
  padding: 3px 10px 3px 8px;
  border-radius: 6px;
  border-left: 3px solid #ef4444;
}
#assistant-panel .as-mode-card:not(.collapsed) .as-mode-card-toggle {
  color: #ef4444 !important;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}
#assistant-panel .as-mode-card:not(.collapsed) .as-mode-card-badge {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
#assistant-panel .as-mode-card-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
#assistant-panel .as-mode-card label {
  display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--tx-3);
}
#assistant-panel .as-mode-card input,
#assistant-panel .as-mode-card textarea {
  background: #141722; border: 1px solid var(--panel-line); border-radius: 6px;
  color: var(--tx); font-size: 12px; padding: 6px 9px; font-family: inherit;
  transition: border-color .15s;
}
#assistant-panel .as-mode-card input:focus,
#assistant-panel .as-mode-card textarea:focus {
  border-color: #5b8cff; outline: none;
}
#assistant-panel .as-mode-card textarea {
  resize: vertical; line-height: 1.5; min-height: 90px;
}
#assistant-panel .as-msgs {
  flex: 1; overflow-y: auto; padding: 14px 28px 14px 14px;
  display: flex; flex-direction: column; gap: 10px;
  user-select: text !important; -webkit-user-select: text !important;
}
#assistant-panel .as-empty {
  color: var(--tx-3); font-size: 12px; text-align: center; padding: 40px 10px; line-height: 1.7;
  user-select: none;
}
#assistant-panel .as-msg {
  max-width: 92%; padding: 9px 12px; border-radius: 12px;
  font-size: 12.5px; line-height: 1.65; word-break: break-word;
  user-select: text !important; -webkit-user-select: text !important; cursor: text;
}
#assistant-panel .as-msg,
#assistant-panel .as-msg *,
#assistant-panel .as-msg-content,
#assistant-panel .as-msg p,
#assistant-panel .as-msg span,
#assistant-panel .as-msg div:not(.as-msg-actions),
#assistant-panel .as-msg table,
#assistant-panel .as-msg th,
#assistant-panel .as-msg td,
#assistant-panel .as-msg pre,
#assistant-panel .as-msg code,
#assistant-panel .as-msg blockquote,
#assistant-panel .as-msg li {
  user-select: text !important;
  -webkit-user-select: text !important;
  cursor: text;
}
#assistant-panel .as-msg.as-user {
  align-self: flex-end; background: rgba(91,140,255,.16);
  border: 1px solid rgba(91,140,255,.3); color: #cfe0ff;
}
#assistant-panel .as-msg.as-ai {
  align-self: flex-start; background: rgba(255,255,255,.05);
  border: 1px solid var(--panel-line); color: var(--tx);
}
#assistant-panel .as-msg.as-msg-streaming {
  border-color: rgba(91,140,255,.45);
  background: rgba(91,140,255,.06);
  box-shadow: 0 0 15px rgba(91,140,255,.1);
}
#assistant-panel .as-cursor {
  display: inline-block;
  color: #60a5fa;
  animation: as-cursor-blink 0.75s infinite;
  margin-left: 2px;
  font-weight: bold;
}
@keyframes as-cursor-blink {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50% { opacity: 0; transform: scaleY(0.8); }
}
#assistant-panel .as-msg-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px;
  user-select: none; -webkit-user-select: none;
}
#assistant-panel .as-msg-model {
  display: inline-block; font-size: 9.5px; color: var(--tx-3);
  padding: 1px 6px; border-radius: 6px;
  background: rgba(255,255,255,.06);
  user-select: none; -webkit-user-select: none;
}
#assistant-panel .as-msg-time {
  display: inline-block; font-size: 9.5px; color: var(--tx-3); opacity: 0.65;
  user-select: none; -webkit-user-select: none; white-space: nowrap;
}
#assistant-panel .as-user-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  margin-top: 6px; padding-top: 4px;
  user-select: none; -webkit-user-select: none;
}
#assistant-panel .as-msg.as-user .as-msg-time {
  margin-top: 0; font-size: 9.5px; opacity: 0.75; color: #93c5fd; white-space: nowrap;
}
#assistant-panel .as-msg-actions {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--panel-line);
  user-select: none; -webkit-user-select: none;
}
#assistant-panel .as-mini {
  border: 1px solid var(--panel-line); border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.05); color: var(--tx-2);
  font-size: 11px; padding: 4px 10px; transition: all .15s;
}
#assistant-panel .as-mini:hover { background: rgba(255,255,255,.12); color: var(--tx); }
#assistant-panel .as-mini.as-primary {
  border-color: rgba(91,140,255,.5); color: #d0e1ff; background: rgba(91,140,255,.16);
  font-weight: 600;
}
#assistant-panel .as-mini.as-primary:hover { background: rgba(91,140,255,.3); filter: brightness(1.1); }
#assistant-panel .as-mini.as-secondary {
  border-color: rgba(244,114,182,.35); color: #f5b8d5; background: rgba(244,114,182,.08);
}
#assistant-panel .as-mini.as-secondary:hover { background: rgba(244,114,182,.18); }
#assistant-panel .as-mini.as-danger {
  color: #ff9b9b; border-color: rgba(255,100,100,.25); background: rgba(255,100,100,.08);
}
#assistant-panel .as-mini.as-danger:hover { background: rgba(255,100,100,.2); color: #ffd1d1; }
#assistant-panel .as-mini.as-retry-btn {
  color: #fde68a; border-color: rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .08);
}
#assistant-panel .as-mini.as-retry-btn:hover {
  border-color: rgba(251, 191, 36, .75); color: #fff; background: rgba(251, 191, 36, .22);
}
#assistant-panel select.as-model-sel {
  padding: 4px 8px; border-radius: 8px;
  background: rgba(18, 22, 34, 0.9);
  border: 1px solid rgba(147, 197, 253, 0.35);
  color: #93c5fd; font-size: 11px; font-weight: 500;
  outline: none; cursor: pointer;
  transition: all .15s;
}
#assistant-panel select.as-model-sel:hover {
  background: rgba(26, 32, 50, 1);
  border-color: rgba(147, 197, 253, 0.7);
  color: #bfdbfe;
}

/* ⭕️ 对话轮次悬浮时间线 (Timeline Rail) */
#assistant-panel .as-timeline-rail {
  position: absolute;
  right: 6px;
  top: 105px;
  bottom: 74px;
  width: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  z-index: 25;
  background: rgba(15, 20, 32, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 6px 2px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.2s ease;
  pointer-events: none;
}
#assistant-panel .as-timeline-rail:hover {
  background: rgba(15, 20, 32, 0.95);
  border-color: rgba(91, 140, 255, 0.35);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
}
#assistant-panel .as-timeline-dots {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  padding: 4px 0;
  overflow-y: auto;
  max-height: calc(100% - 44px);
  scrollbar-width: none;
}
#assistant-panel .as-timeline-dots::-webkit-scrollbar {
  display: none;
}
#assistant-panel .as-timeline-dot {
  position: relative;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  pointer-events: auto;
}
#assistant-panel .as-timeline-dot-circle {
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 🔵 用户提问点: 鲜明蓝点 */
#assistant-panel .as-timeline-dot.as-dot-user .as-timeline-dot-circle {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b82f6;
  border: 1px solid #93c5fd;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
}
#assistant-panel .as-timeline-dot.as-dot-user:hover .as-timeline-dot-circle {
  transform: scale(1.45);
  background: #60a5fa;
  border-color: #dbeafe;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.95);
}

/* ⚪️ AI 回答点: 典雅灰白点 */
#assistant-panel .as-timeline-dot.as-dot-ai .as-timeline-dot-circle {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  border: 1px solid #cbd5e1;
  box-shadow: 0 0 4px rgba(148, 163, 184, 0.4);
}
#assistant-panel .as-timeline-dot.as-dot-ai:hover .as-timeline-dot-circle {
  transform: scale(1.45);
  background: #f1f5f9;
  border-color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}

/* 🔴 选中的当前节点 (无论是提问还是回答): 醒目高亮鲜红色 + 发光光环 */
#assistant-panel .as-timeline-dot.active .as-timeline-dot-circle {
  transform: scale(1.6);
  background: #ef4444 !important;
  border-color: #fca5a5 !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.95), 0 0 4px rgba(255, 255, 255, 0.8) !important;
}

/* 📋 时间轴红圈左侧独立浮动「复制」按钮 (平时100%隐藏，仅鼠标悬停在消息或圆点上时才浮现！) */
#assistant-panel .as-timeline-copy-badge {
  position: absolute;
  right: 34px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(239, 68, 68, 0.7);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4), 0 4px 12px rgba(0, 0, 0, 0.55);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 35;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), top 0.16s cubic-bezier(0.16, 1, 0.3, 1), background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
#assistant-panel .as-timeline-copy-badge.show {
  opacity: 1;
  pointer-events: auto;
}
#assistant-panel .as-timeline-copy-badge:hover {
  background: rgba(239, 68, 68, 0.95) !important;
  border-color: #fca5a5 !important;
  color: #ffffff !important;
  transform: translateY(-50%) scale(1.08) !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.85) !important;
}
#assistant-panel .as-timeline-copy-badge.copied {
  background: rgba(34, 197, 94, 0.95) !important;
  border-color: #86efac !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.85) !important;
}

#assistant-panel .as-timeline-tooltip {
  position: absolute;
  right: 68px;
  top: 50%;
  transform: translateY(-50%) translateX(6px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(91, 140, 255, 0.4);
  border-radius: 8px;
  padding: 6px 10px;
  width: max-content;
  max-width: 230px;
  font-size: 11px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  z-index: 30;
  color: #e2e8f0;
  text-align: left;
}
#assistant-panel .as-timeline-dot:hover .as-timeline-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0) scale(1);
}
#assistant-panel .as-timeline-tip-round {
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
}
#assistant-panel .as-timeline-tip-round.tip-user {
  color: #60a5fa;
}
#assistant-panel .as-timeline-tip-round.tip-ai {
  color: #e2e8f0;
}
#assistant-panel .as-timeline-tip-text {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}
#assistant-panel .as-timeline-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  padding: 0;
  pointer-events: auto;
}
#assistant-panel .as-timeline-btn:hover {
  color: #ffffff;
  background: rgba(91, 140, 255, 0.25);
}
#assistant-panel .as-msg-jump-highlight {
  animation: asJumpPulse 1.2s ease-out;
}
@keyframes asJumpPulse {
  0% { box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.9), 0 0 20px rgba(59, 130, 246, 0.5); }
  70% { box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.3), 0 0 10px rgba(59, 130, 246, 0.2); }
  100% { box-shadow: none; }
}

/* 🕒 历史对话列表 */
#assistant-panel .as-history {
  flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px;
}
#assistant-panel .as-hist-list {
  display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto;
}
#assistant-panel .as-hist-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid var(--panel-line);
  cursor: pointer; transition: all .15s ease;
}
#assistant-panel .as-hist-item:hover {
  background: rgba(255,255,255,.06); border-color: rgba(91,140,255,.35); transform: translateY(-1px);
}
#assistant-panel .as-hist-item.active {
  border-color: rgba(91,140,255,.6); background: rgba(91,140,255,.08);
}
#assistant-panel .as-hist-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
#assistant-panel .as-hist-title-row { display: flex; align-items: center; gap: 6px; }
#assistant-panel .as-hist-title {
  font-size: 13px; font-weight: 600; color: var(--tx);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: text; border-bottom: 1px dashed transparent; transition: all .15s ease;
}
#assistant-panel .as-hist-title:hover {
  color: #9bbdff; border-bottom-color: rgba(91,140,255,.5);
}
#assistant-panel .as-hist-rename-icon-btn {
  background: transparent; border: none; font-size: 11px; cursor: pointer;
  padding: 1px 4px; border-radius: 4px; opacity: 0; color: var(--tx-3);
  transition: all .15s ease; flex-shrink: 0;
}
#assistant-panel .as-hist-item:hover .as-hist-rename-icon-btn { opacity: .7; }
#assistant-panel .as-hist-rename-icon-btn:hover {
  opacity: 1; background: rgba(255,255,255,.1); color: #fff; transform: scale(1.1);
}
#assistant-panel .as-hist-title-in {
  background: rgba(15,23,42,.95); border: 1px solid #5b8cff; border-radius: 6px;
  color: #ffffff; font-size: 13px; font-weight: 600; padding: 2px 7px;
  outline: none; width: 100%; max-width: 320px; box-shadow: 0 0 8px rgba(91,140,255,.45);
}
#assistant-panel .as-hist-badge {
  font-size: 10px; color: #9bbdff; background: rgba(91,140,255,.2);
  border: 1px solid rgba(91,140,255,.4); border-radius: 4px; padding: 1px 5px; flex-shrink: 0;
}
#assistant-panel .as-hist-model-tag {
  font-size: 10px; line-height: 1; padding: 2px 7px; border-radius: 10px;
  background: rgba(6, 182, 212, 0.15); border: 1px solid rgba(6, 182, 212, 0.35);
  color: #67e8f9; font-weight: 600; white-space: nowrap; letter-spacing: 0.2px; flex-shrink: 0;
}
#assistant-panel .as-hist-meta {
  display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--tx-3);
}
#assistant-panel .as-hist-params {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px;
}
#assistant-panel .as-hist-chip {
  font-size: 10px; line-height: 1; padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: var(--tx-2); font-weight: 500; white-space: nowrap;
}
#assistant-panel .as-hist-chip.chip-model {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(99, 102, 241, 0.22));
  border-color: rgba(6, 182, 212, 0.45);
  color: #67e8f9;
  font-weight: 600;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.15);
}
#assistant-panel .as-hist-chip.chip-mode {
  background: rgba(99,102,241,.15); border-color: rgba(99,102,241,.35); color: #a5b4fc; font-weight: 600;
}
#assistant-panel .as-hist-chip.chip-dur {
  background: rgba(249,115,22,.15); border-color: rgba(249,115,22,.35); color: #fdba74;
}
#assistant-panel .as-hist-chip.chip-scheme {
  background: rgba(20,184,166,.15); border-color: rgba(20,184,166,.35); color: #5eead4;
}
#assistant-panel .as-hist-chip.chip-char {
  background: rgba(234,179,8,.15); border-color: rgba(234,179,8,.35); color: #fde047;
}
#assistant-panel .as-hist-chip.chip-style {
  background: rgba(217,70,239,.15); border-color: rgba(217,70,239,.35); color: #f0abfc;
}
#assistant-panel .as-hist-acts { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* 🧠 深度构思过程折叠胶囊 (方案 1) */
#assistant-panel .as-thinking-box {
  margin-bottom: 8px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px dashed rgba(6, 182, 212, 0.35);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  color: #94a3b8;
  transition: all 0.2s ease;
}
#assistant-panel .as-thinking-box[open] {
  background: rgba(15, 23, 42, 0.85);
  border-style: solid;
  border-color: rgba(6, 182, 212, 0.55);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
#assistant-panel .as-thinking-summary {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #67e8f9;
  outline: none;
}
#assistant-panel .as-thinking-count {
  font-size: 10px;
  color: #64748b;
  font-weight: normal;
}
#assistant-panel .as-thinking-content {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ⚙️ 通道设置 */
#assistant-panel .as-settings {
  flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
#assistant-panel .as-set-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--tx);
}
#assistant-panel .as-set-sub { font-size: 10.5px; font-weight: 400; color: var(--tx-3); line-height: 1.5; }
#assistant-panel .as-set-flex { flex: 1; }
#assistant-panel .as-ch {
  border: 1px solid var(--panel-line); border-radius: 12px; padding: 10px;
  background: rgba(255,255,255,.03); display: flex; flex-direction: column; gap: 8px;
}
#assistant-panel .as-ch-row1 { display: flex; align-items: center; gap: 8px; }
#assistant-panel .as-ch-prio {
  font-size: 11px; font-weight: 700; color: var(--tx-3);
  background: rgba(255,255,255,.07); border-radius: 6px; padding: 2px 7px; flex: none;
}
#assistant-panel .as-ch-name {
  flex: 1; min-width: 0;
}
#assistant-panel .as-ch-en {
  display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--tx-2); flex: none; cursor: pointer;
}
#assistant-panel .as-ch input, #assistant-panel .as-ch select {
  border: 1px solid var(--panel-line); border-radius: 8px;
  background: rgba(255,255,255,.04); color: var(--tx);
  font-size: 11.5px; padding: 5px 8px; outline: none;
}
#assistant-panel .as-ch input:focus, #assistant-panel .as-ch select:focus {
  border-color: rgba(244,114,182,.5);
}
#assistant-panel .as-ch input:disabled { opacity: .45; cursor: not-allowed; }
#assistant-panel .as-ch-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px;
}
#assistant-panel .as-ch-grid label {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 10px; color: var(--tx-3);
}
#assistant-panel .as-ch-grid label:nth-child(3),
#assistant-panel .as-ch-grid label:nth-child(4) { grid-column: span 2; }
#assistant-panel .as-ch-grid input, #assistant-panel .as-ch-grid select { width: 100%; }
#assistant-panel .as-ch-up:disabled { opacity: .3; cursor: not-allowed; }
#assistant-panel .as-ch-test-info {
  font-size: 11px; padding: 6px 10px; border-radius: 7px;
  line-height: 1.4; word-break: break-all; margin-top: 2px;
}
#assistant-panel .as-ch-test-info.testing {
  background: rgba(91,140,255,.08); border: 1px solid rgba(91,140,255,.2); color: #a9c4ff;
}
#assistant-panel .as-ch-test-info.success {
  background: rgba(45,212,191,.1); border: 1px solid rgba(45,212,191,.3); color: #7ee7d8;
}
#assistant-panel .as-ch-test-info.error {
  background: rgba(244,114,182,.1); border: 1px solid rgba(244,114,182,.3); color: #ff9b9b;
}
#assistant-panel .as-set-actions {
  display: flex; align-items: center; gap: 8px; padding-top: 4px;
}
#assistant-panel .as-input-row {
  display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--panel-line);
}
#assistant-panel .as-input {
  flex: 1; resize: none; border: 1px solid var(--panel-line); border-radius: 10px;
  background: rgba(255,255,255,.04); color: var(--tx);
  font-size: 12.5px; line-height: 1.5; padding: 8px 10px;
  font-family: inherit; outline: none;
}
#assistant-panel .as-input:focus { border-color: rgba(91,140,255,.5); }
#assistant-panel .as-attach {
  border: 1px solid var(--panel-line); border-radius: 10px; cursor: pointer;
  width: 38px; height: 38px; flex-shrink: 0;
  background: rgba(255,255,255,.04); color: var(--tx-2); font-size: 15px;
  transition: all .15s;
}
#assistant-panel .as-attach:hover { background: rgba(255,255,255,.12); color: var(--tx); border-color: rgba(244,114,182,.4); }
#assistant-panel .as-send {
  border: none; border-radius: 10px; cursor: pointer;
  width: 42px; height: 38px; flex-shrink: 0;
  background: rgba(91,140,255,.2); color: #a9c4ff; font-size: 16px;
  transition: all .15s;
}
#assistant-panel .as-send:hover { background: rgba(91,140,255,.35); color: #dfe8ff; }
#assistant-panel .as-send.as-btn-stopping {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
  animation: asStopPulse 1.5s infinite;
}
#assistant-panel .as-send.as-btn-stopping:hover {
  background: rgba(239, 68, 68, 0.5);
  color: #fff;
  border-color: rgba(239, 68, 68, 0.85);
  transform: scale(1.05);
}
@keyframes asStopPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
.as-stop-icon {
  font-size: 14px;
  display: inline-block;
  vertical-align: middle;
}
/* 思考中动效 */
#assistant-panel .as-thinking { display: flex; align-items: center; gap: 6px; color: var(--tx-3); }
#assistant-panel .as-dots { display: inline-flex; gap: 4px; }
#assistant-panel .as-dots i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--tx-3);
  animation: as-blink 1.2s infinite;
}
#assistant-panel .as-dots i:nth-child(2) { animation-delay: .2s; }
#assistant-panel .as-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes as-blink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }
/* 顶栏剧本导演按钮: 青绿色 (区别于琥珀色拆镜头) */
.tb-btn.tb-assistant {
  border-color: rgba(var(--c-image-rgb), .5); color: #7ee7d8;
  background: rgba(var(--c-image-rgb), .1);
}
.tb-btn.tb-assistant:hover { background: rgba(var(--c-image-rgb), .22); color: #b3f5ea; }

/* 剧本导演微型悬浮状态胶囊 (方案 3: 后台生成无感浮窗 - 左下角停靠) */
.as-floating-capsule {
  position: fixed;
  left: 20px;
  bottom: 38px;
  z-index: 999;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(18, 20, 32, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 30px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 16px rgba(99, 102, 241, 0.2);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  animation: asCapsuleSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.as-floating-capsule:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 24px rgba(99, 102, 241, 0.4);
}
.as-floating-capsule.as-floating-capsule-done {
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 16px rgba(34, 197, 94, 0.25);
}
.as-floating-capsule.as-floating-capsule-done:hover {
  border-color: rgba(34, 197, 94, 0.9);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 24px rgba(34, 197, 94, 0.45);
}
.as-cap-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  box-shadow: 0 0 8px #6366f1;
  animation: asCapPulsate 1.5s infinite;
  flex-shrink: 0;
}
@keyframes asCapPulsate {
  0% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
  70% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); }
  100% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}
.as-cap-icon { font-size: 15px; flex-shrink: 0; }
.as-cap-text {
  font-weight: 500;
  color: var(--tx, #f3f4f6);
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.as-cap-btn-expand {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #c7d2fe;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.as-cap-btn-expand:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #fff;
  border-color: #818cf8;
}
.as-cap-btn-stop {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.as-cap-btn-stop:hover {
  background: rgba(239, 68, 68, 0.5);
  color: #fff;
  border-color: #ef4444;
}
@keyframes asCapsuleSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

