/* 「璇玑 · 星冕 / ARIADNE-09」文章伴读侧栏独立样式表
   严格限定在 .rc-* / .companion-* / .bot-* / .beam-* / .breath-* / .capture-* / .orbit-sources* / .orbit-source-* 命名空间，零污染旧样式。 */

/* ========== 公共挂载宿主与舰桥主壳 ========== */
.companion-panel-host {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.rc-bridge-shell {
  --rc-bg-top: rgba(13, 18, 31, 0.94);
  --rc-bg-bottom: rgba(7, 10, 19, 0.98);
  --rc-surface: rgba(255, 255, 255, 0.036);
  --rc-surface-hover: rgba(255, 255, 255, 0.068);
  --rc-border: rgba(255, 255, 255, 0.11);
  --rc-border-soft: rgba(255, 255, 255, 0.07);
  --rc-amber: #ffd27a;
  --rc-amber-hi: #ffe6b8;
  --rc-blue: #8ccaff;
  --rc-mint: #8bf0c2;
  --rc-coral: #ff9484;
  --rc-ink: #eef2fa;
  --rc-ink-2: rgba(232, 236, 244, 0.74);
  --rc-ink-3: rgba(232, 236, 244, 0.48);

  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  width: 100%;
  color: var(--rc-ink);
  background:
    radial-gradient(110% 42% at 18% 0%, rgba(255, 210, 122, 0.085), transparent 62%),
    radial-gradient(90% 40% at 92% 10%, rgba(140, 202, 255, 0.075), transparent 64%),
    linear-gradient(180deg, var(--rc-bg-top) 0%, var(--rc-bg-bottom) 100%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  overflow: hidden;
  isolation: isolate;
}

.rc-bridge-shell[data-bot-state="searching"] {
  background:
    radial-gradient(115% 44% at 22% 0%, rgba(140, 202, 255, 0.14), transparent 64%),
    radial-gradient(95% 40% at 88% 8%, rgba(255, 210, 122, 0.06), transparent 66%),
    linear-gradient(180deg, var(--rc-bg-top) 0%, var(--rc-bg-bottom) 100%);
}

/* 四角天文 HUD 校准角标 */
.rc-hud-corner {
  position: absolute;
  width: 11px;
  height: 11px;
  pointer-events: none;
  z-index: 4;
  border-color: rgba(255, 210, 122, 0.34);
  border-style: solid;
  border-width: 0;
  transition: border-color 0.35s var(--ease);
}
.rc-hud-corner.tl { top: 7px; left: 7px; border-top-width: 1px; border-left-width: 1px; }
.rc-hud-corner.tr { top: 7px; right: 7px; border-top-width: 1px; border-right-width: 1px; }
.rc-hud-corner.bl { bottom: 7px; left: 7px; border-bottom-width: 1px; border-left-width: 1px; }
.rc-hud-corner.br { bottom: 7px; right: 7px; border-bottom-width: 1px; border-right-width: 1px; }

.rc-bridge-shell[data-bot-state="searching"] .rc-hud-corner {
  border-color: rgba(140, 202, 255, 0.56);
}
.rc-bridge-shell[data-bot-state="streaming"] .rc-hud-corner {
  border-color: rgba(255, 230, 184, 0.52);
}
.rc-bridge-shell[data-bot-state="error"] .rc-hud-corner {
  border-color: rgba(255, 148, 132, 0.52);
}

/* 左缘星纬刻度尺 */
.rc-astro-ruler {
  position: absolute;
  top: 76px;
  bottom: 92px;
  left: 3px;
  width: 5px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.34;
  background-image:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 210, 122, 0.7) 0 1px,
      transparent 1px 12px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(140, 202, 255, 0.45) 0 1px,
      transparent 1px 48px
    );
  background-size: 3px 100%, 5px 100%;
  background-repeat: no-repeat;
  background-position: left top, left top;
}

/* ========== 1. 舰桥光学核心舱头 ========== */
.rc-bridge-head {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px 11px 13px;
  border-bottom: 1px solid var(--rc-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.01) 100%);
  flex-shrink: 0;
}

.bot-core-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bot-core-svg {
  display: block;
  width: 56px;
  height: 56px;
  overflow: visible;
  filter: drop-shadow(0 0 10px rgba(255, 210, 122, 0.16));
  transition: filter 0.35s var(--ease);
}

/* SVG 变换原点锁定中心 */
.bot-ring-outer,
.bot-radar-arcs,
.bot-pupil-group,
.bot-radar-wave {
  transform-box: view-box;
  transform-origin: 28px 28px;
}

.bot-vbar {
  fill: rgba(255, 210, 122, 0.42);
  transform-box: fill-box;
  transform-origin: center bottom;
  transition: fill 0.25s var(--ease), opacity 0.25s var(--ease);
}

.bot-radar-arcs {
  opacity: 0.38;
  transition: opacity 0.3s var(--ease);
}

.bot-radar-wave {
  stroke: rgba(140, 202, 255, 0.55);
  stroke-width: 1;
  opacity: 0;
}

/* 四态 + 异常/离线 光学核心动画 */
.rc-bridge-shell[data-bot-state="idle"] .bot-ring-outer {
  animation: bot-spin-slow 38s linear infinite;
}
.rc-bridge-shell[data-bot-state="idle"] .bot-pupil-group {
  animation: bot-pupil-idle 4.2s ease-in-out infinite;
}
.rc-bridge-shell[data-bot-state="idle"] .bot-orbit-dot {
  animation: bot-spark-glint 3.6s ease-in-out infinite;
}

.rc-bridge-shell[data-bot-state="thinking"] .bot-core-svg {
  filter: drop-shadow(0 0 13px rgba(255, 210, 122, 0.32));
}
.rc-bridge-shell[data-bot-state="thinking"] .bot-ring-outer {
  animation: bot-spin-slow 9s linear infinite;
}
.rc-bridge-shell[data-bot-state="thinking"] .bot-radar-arcs {
  opacity: 0.85;
  animation: bot-spin-rev 4.4s linear infinite;
}
.rc-bridge-shell[data-bot-state="thinking"] .bot-pupil-group {
  animation: bot-pupil-think 1.35s ease-in-out infinite;
}

.rc-bridge-shell[data-bot-state="searching"] .bot-core-svg {
  filter: drop-shadow(0 0 16px rgba(140, 202, 255, 0.44));
}
.rc-bridge-shell[data-bot-state="searching"] .bot-ring-outer {
  animation: bot-spin-slow 6s linear infinite;
}
.rc-bridge-shell[data-bot-state="searching"] .bot-radar-arcs {
  opacity: 1;
  animation: bot-spin-slow 2.1s linear infinite;
}
.rc-bridge-shell[data-bot-state="searching"] .bot-pupil-amber {
  opacity: 0.42;
}
.rc-bridge-shell[data-bot-state="searching"] .bot-pupil-blue {
  transform-box: view-box;
  transform-origin: 28px 28px;
  animation: bot-pupil-search 1.1s ease-in-out infinite;
}
.rc-bridge-shell[data-bot-state="searching"] .bot-radar-wave.w1 {
  animation: bot-radar-ping 1.8s var(--ease) infinite;
}
.rc-bridge-shell[data-bot-state="searching"] .bot-radar-wave.w2 {
  animation: bot-radar-ping 1.8s var(--ease) 0.9s infinite;
}
.rc-bridge-shell[data-bot-state="searching"] .bot-vbar {
  fill: rgba(140, 202, 255, 0.86);
  animation: bot-vbar-dance 0.85s ease-in-out infinite;
}

.rc-bridge-shell[data-bot-state="streaming"] .bot-core-svg {
  filter: drop-shadow(0 0 15px rgba(255, 224, 152, 0.38));
}
.rc-bridge-shell[data-bot-state="streaming"] .bot-ring-outer {
  animation: bot-spin-slow 16s linear infinite;
}
.rc-bridge-shell[data-bot-state="streaming"] .bot-radar-arcs {
  opacity: 0.68;
  animation: bot-spin-rev 7s linear infinite;
}
.rc-bridge-shell[data-bot-state="streaming"] .bot-pupil-group {
  animation: bot-pupil-stream 1.8s ease-in-out infinite;
}
.rc-bridge-shell[data-bot-state="streaming"] .bot-vbar {
  fill: #ffd27a;
  animation: bot-vbar-dance 0.68s ease-in-out infinite;
}

.rc-bridge-shell .bot-vbar.b1 { animation-delay: 0ms; }
.rc-bridge-shell .bot-vbar.b2 { animation-delay: 110ms; }
.rc-bridge-shell .bot-vbar.b3 { animation-delay: 220ms; }
.rc-bridge-shell .bot-vbar.b4 { animation-delay: 140ms; }
.rc-bridge-shell .bot-vbar.b5 { animation-delay: 60ms; }

.rc-bridge-shell[data-bot-state="error"] .bot-core-svg {
  filter: drop-shadow(0 0 14px rgba(255, 130, 114, 0.45));
}
.rc-bridge-shell[data-bot-state="error"] .bot-radar-arc-a,
.rc-bridge-shell[data-bot-state="error"] .bot-radar-arc-b {
  stroke: var(--rc-coral);
}
.rc-bridge-shell[data-bot-state="error"] .bot-vbar {
  fill: var(--rc-coral);
}

.rc-bridge-shell[data-bot-state="offline"] .bot-core-svg {
  opacity: 0.78;
  filter: drop-shadow(0 0 8px rgba(140, 202, 255, 0.16));
}
.rc-bridge-shell[data-bot-state="offline"] .bot-vbar {
  fill: rgba(180, 196, 220, 0.45);
}

@keyframes bot-spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes bot-spin-rev {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}
@keyframes bot-pupil-idle {
  0%, 100% { transform: scale(1); opacity: 0.94; }
  50% { transform: scale(1.06); opacity: 1; }
}
@keyframes bot-pupil-think {
  0%, 100% { transform: scale(0.95); opacity: 0.86; }
  50% { transform: scale(1.1); opacity: 1; }
}
@keyframes bot-pupil-search {
  0%, 100% { transform: scale(1.02); opacity: 0.9; }
  50% { transform: scale(1.26); opacity: 1; }
}
@keyframes bot-pupil-stream {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.09); }
}
@keyframes bot-spark-glint {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
@keyframes bot-radar-ping {
  0% { transform: scale(0.88); opacity: 0.65; }
  100% { transform: scale(1.82); opacity: 0; }
}
@keyframes bot-vbar-dance {
  0%, 100% { transform: scaleY(0.42); opacity: 0.65; }
  50% { transform: scaleY(1.25); opacity: 1; }
}

/* 铭牌与实时遥测行 */
.rc-bridge-id {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rc-nameplate {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  line-height: 1.2;
}

.rc-nameplate-code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--rc-amber);
}

.rc-nameplate-sep {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.28);
}

.rc-nameplate-cn {
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--rc-amber-hi);
}

.rc-telemetry-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.rc-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--rc-mint);
  box-shadow: 0 0 8px rgba(139, 240, 194, 0.75);
  transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.rc-bridge-shell[data-bot-state="thinking"] .rc-status-dot {
  background: var(--rc-amber);
  box-shadow: 0 0 9px rgba(255, 210, 122, 0.85);
}
.rc-bridge-shell[data-bot-state="searching"] .rc-status-dot {
  background: var(--rc-blue);
  box-shadow: 0 0 10px rgba(140, 202, 255, 0.9);
}
.rc-bridge-shell[data-bot-state="streaming"] .rc-status-dot {
  background: var(--rc-amber-hi);
  box-shadow: 0 0 10px rgba(255, 230, 184, 0.92);
}
.rc-bridge-shell[data-bot-state="error"] .rc-status-dot {
  background: var(--rc-coral);
  box-shadow: 0 0 9px rgba(255, 148, 132, 0.85);
}
.rc-bridge-shell[data-bot-state="offline"] .rc-status-dot {
  background: rgba(182, 198, 222, 0.72);
  box-shadow: 0 0 6px rgba(182, 198, 222, 0.45);
}

.rc-status-text {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--rc-ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-head-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.rc-head-btn {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.04);
  color: var(--rc-ink-2);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}

.rc-head-btn:hover,
.rc-head-btn.is-active {
  border-color: rgba(255, 210, 122, 0.54);
  color: var(--rc-amber-hi);
  background: rgba(255, 210, 122, 0.12);
}

/* ========== 2. 可折叠舰载档案与上下文遥测抽屉 ========== */
.rc-lore-drawer {
  position: relative;
  z-index: 3;
  padding: 12px 15px 13px;
  border-bottom: 1px solid var(--rc-border);
  background: linear-gradient(180deg, rgba(255, 210, 122, 0.065) 0%, rgba(140, 202, 255, 0.035) 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.rc-lore-drawer[hidden] {
  display: none;
}

.rc-lore-kicker {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: rgba(255, 210, 122, 0.85);
}

.rc-lore-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.68;
  color: var(--rc-ink-2);
}

.rc-telemetry-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rc-tele-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 22, 0.58);
  font-size: 11px;
  max-width: 100%;
}
.rc-tele-chip em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rc-ink-3);
  flex-shrink: 0;
}
.rc-tele-chip strong {
  font-weight: 500;
  color: var(--rc-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-tele-chip.is-amber {
  border-color: rgba(255, 210, 122, 0.35);
}
.rc-tele-chip.is-amber strong {
  color: var(--rc-amber-hi);
}
.rc-tele-chip.is-blue {
  border-color: rgba(140, 202, 255, 0.34);
}
.rc-tele-chip.is-blue strong {
  color: var(--rc-blue);
}
.rc-tele-chip.is-mint {
  border-color: rgba(139, 240, 194, 0.34);
}
.rc-tele-chip.is-mint strong {
  color: var(--rc-mint);
}
.rc-tele-chip.is-warn {
  border-color: rgba(255, 192, 114, 0.42);
}
.rc-tele-chip.is-warn strong {
  color: var(--rc-amber);
}

/* ========== 3. 航行日志对话流与 14px 上下渐隐遮罩 ========== */
.rc-messages-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.rc-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 15px 22px 17px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 210, 122, 0.28) transparent;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 14px,
    #000 calc(100% - 14px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 14px,
    #000 calc(100% - 14px),
    transparent 100%
  );
}

.rc-messages::-webkit-scrollbar {
  width: 5px;
}
.rc-messages::-webkit-scrollbar-track {
  background: transparent;
}
.rc-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 210, 122, 0.24);
  border-radius: 999px;
}
.rc-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 210, 122, 0.45);
}

/* 底部「↓ 回到传讯前沿」浮钮 */
.rc-jump-latest {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 5;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 122, 0.56);
  background: rgba(12, 17, 30, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--rc-amber-hi);
  font-family: inherit;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 18px rgba(255, 210, 122, 0.16);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.rc-jump-latest[hidden] {
  display: none;
}
.rc-jump-latest:hover {
  border-color: rgba(255, 230, 184, 0.85);
  background: rgba(255, 210, 122, 0.18);
  transform: translateX(-50%) translateY(-1px);
}

/* 空态：舰桥初遇简报卡 */
.rc-empty-brief {
  position: relative;
  margin-top: 6px;
  padding: 16px 16px 15px;
  border-radius: 16px;
  border: 1px solid rgba(255, 210, 122, 0.22);
  background: linear-gradient(180deg, rgba(255, 210, 122, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 230, 184, 0.14);
}

.rc-brief-corner {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: rgba(255, 210, 122, 0.52);
  border-style: solid;
  border-width: 0;
  pointer-events: none;
}
.rc-brief-corner.tl { top: 6px; left: 6px; border-top-width: 1px; border-left-width: 1px; }
.rc-brief-corner.tr { top: 6px; right: 6px; border-top-width: 1px; border-right-width: 1px; }
.rc-brief-corner.bl { bottom: 6px; left: 6px; border-bottom-width: 1px; border-left-width: 1px; }
.rc-brief-corner.br { bottom: 6px; right: 6px; border-bottom-width: 1px; border-right-width: 1px; }

.rc-brief-kicker {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: rgba(255, 210, 122, 0.78);
}

.rc-brief-greeting {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.72;
  color: #f6efe0;
}

.rc-brief-anchor {
  margin: 0 0 13px;
  font-size: 11.5px;
  color: var(--rc-ink-3);
  line-height: 1.5;
}

.rc-preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.rc-preset-chip {
  padding: 7px 11px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(238, 242, 250, 0.88);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), transform 0.16s var(--ease);
}
.rc-preset-chip:hover {
  border-color: rgba(255, 210, 122, 0.62);
  background: rgba(255, 210, 122, 0.12);
  color: var(--rc-amber-hi);
  transform: translateY(-1px);
}
.rc-preset-chip.is-web {
  border-color: rgba(140, 202, 255, 0.34);
  background: rgba(140, 202, 255, 0.075);
  color: #cbe6ff;
}
.rc-preset-chip.is-web:hover {
  border-color: rgba(140, 202, 255, 0.75);
  background: rgba(140, 202, 255, 0.16);
  color: #ffffff;
}
.rc-preset-chip.is-sat {
  border-color: rgba(139, 240, 194, 0.34);
  background: rgba(139, 240, 194, 0.07);
  color: #c9fae3;
}
.rc-preset-chip.is-sat:hover {
  border-color: rgba(139, 240, 194, 0.72);
  background: rgba(139, 240, 194, 0.15);
  color: #ffffff;
}

/* 用户观测指令槽（左 2px 琥珀金边，非封闭臃肿气泡） */
.rc-msg.is-user {
  padding: 9px 12px 10px 13px;
  border-left: 2px solid rgba(255, 210, 122, 0.78);
  border-radius: 2px 12px 12px 2px;
  background: linear-gradient(90deg, rgba(255, 210, 122, 0.095) 0%, rgba(255, 210, 122, 0.025) 100%);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rc-msg-quote {
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 210, 122, 0.22);
  background: rgba(8, 12, 22, 0.45);
}

.rc-msg-quote-label {
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--rc-amber);
}

.rc-msg-quote-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--rc-ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.rc-msg-user-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: #fff8ea;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* 璇玑回答：开放式天文手记排版 + 左侧 1.5px 垂直星光轨 */
.rc-msg.is-assistant {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 11px;
  padding: 2px 2px 4px 0;
}

.rc-msg-rail {
  position: relative;
  width: 1.5px;
  flex-shrink: 0;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 210, 122, 0.72) 0%,
    rgba(140, 202, 255, 0.36) 58%,
    rgba(255, 255, 255, 0.08) 100%
  );
  transition: opacity 0.4s var(--ease);
}

.rc-msg.is-assistant[data-stream-state="streaming"] .rc-msg-rail {
  background: linear-gradient(
    180deg,
    rgba(255, 210, 122, 0.35) 0%,
    #ffe6b8 38%,
    #8ccaff 66%,
    rgba(255, 210, 122, 0.3) 100%
  );
  background-size: 100% 220%;
  animation: rail-tide 2.4s linear infinite;
}

.rc-msg-inner {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rc-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rc-msg-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.rc-msg-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--rc-amber);
}

.rc-msg-mode-tag {
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(140, 202, 255, 0.35);
  background: rgba(140, 202, 255, 0.1);
  color: var(--rc-blue);
  font-family: var(--font-mono);
  font-size: 9.5px;
}
.rc-msg-mode-tag[hidden] {
  display: none;
}

.rc-copy-btn {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.03);
  color: var(--rc-ink-3);
  font-family: inherit;
  font-size: 10.5px;
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.rc-copy-btn:hover {
  color: var(--rc-amber-hi);
  border-color: rgba(255, 210, 122, 0.48);
  background: rgba(255, 210, 122, 0.09);
}
.rc-copy-btn.is-copied {
  color: var(--rc-mint);
  border-color: rgba(139, 240, 194, 0.45);
}

/* 检索/解算过程脉冲状态条 */
.rc-live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 210, 122, 0.24);
  background: rgba(255, 210, 122, 0.06);
  font-size: 12px;
  color: var(--rc-amber-hi);
}
.rc-live-status[hidden] {
  display: none;
}
.rc-live-status[data-phase="searching"] {
  border-color: rgba(140, 202, 255, 0.36);
  background: rgba(140, 202, 255, 0.09);
  color: #cce7ff;
}

.rc-live-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
  animation: rc-pulse-dot 1.2s ease-in-out infinite;
}

@keyframes rc-pulse-dot {
  0%, 100% { opacity: 0.35; transform: scale(0.82); }
  50% { opacity: 1; transform: scale(1.18); }
}

/* ========== 三层星光字体呼吸引擎 Keyframes（严禁动画化 font-weight） ========== */
.rc-msg-body {
  font-size: 13.75px;
  line-height: 1.78;
  color: rgba(238, 242, 250, 0.92);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rc-md-committed > *:first-child,
.rc-md-segment > *:first-child {
  margin-top: 0;
}
.rc-md-committed > *:last-child,
.rc-md-segment > *:last-child {
  margin-bottom: 0;
}

/* L1：纯 inline 星光滴灌词块（绝不使用 block/inline-block 破坏行流，绝不动画化 font-weight） */
.breath-chunk {
  display: inline;
  animation: starlight-emerge 360ms var(--ease) both;
}

/* L2：实时呼吸尾段区 + 菱形星核光标 */
.rc-md-live {
  white-space: pre-wrap;
}
.rc-md-live:empty {
  display: none;
}

.breath-live-block {
  margin-top: 6px;
  animation: starlight-breath 3.2s ease-in-out infinite;
}

.breath-caret {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 5px;
  vertical-align: 0.14em;
  background: var(--rc-amber-hi);
  box-shadow: 0 0 10px rgba(255, 210, 122, 0.9), 0 0 4px #ffffff;
  transform: rotate(45deg);
  animation: caret-pulse 1.15s ease-in-out infinite;
}

/* L3：流式结束 650ms 收光着陆 */
.rc-msg.is-assistant[data-stream-state="settling"] .rc-msg-body {
  animation: starlight-settle 650ms var(--ease) both;
}

@keyframes starlight-emerge {
  0% {
    opacity: 0.15;
    color: #fff4d2;
    text-shadow: 0 0 10px rgba(255, 210, 122, 0.62);
  }
  58% {
    opacity: 0.95;
    color: #ffedc4;
    text-shadow: 0 0 5px rgba(255, 210, 122, 0.25);
  }
  100% {
    opacity: 1;
    color: inherit;
    text-shadow: none;
  }
}

@keyframes starlight-breath {
  0%, 100% {
    opacity: 0.93;
    text-shadow: 0 0 0 rgba(255, 210, 122, 0);
  }
  50% {
    opacity: 1;
    text-shadow: 0 0 8px rgba(255, 210, 122, 0.18);
  }
}

@keyframes rail-tide {
  0% { background-position: 0% 0%; }
  100% { background-position: 0% 220%; }
}

@keyframes caret-pulse {
  0%, 100% {
    opacity: 0.42;
    transform: rotate(45deg) scale(0.84);
  }
  50% {
    opacity: 1;
    transform: rotate(45deg) scale(1.16);
  }
}

@keyframes starlight-settle {
  0% {
    text-shadow: 0 0 9px rgba(255, 210, 122, 0.26);
  }
  100% {
    text-shadow: none;
  }
}

/* ========== 安全 Markdown 排版（代码块严禁 text-shadow） ========== */
.rc-msg-body p {
  margin: 0 0 0.72em;
}

.rc-md-h {
  margin: 1.05em 0 0.45em;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--rc-amber-hi);
  letter-spacing: 0.02em;
}

.rc-md-quote {
  margin: 0.7em 0;
  padding: 7px 11px;
  border-left: 2px solid rgba(255, 210, 122, 0.52);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, 0.032);
  color: var(--rc-ink-2);
}
.rc-md-quote p {
  margin: 0;
}

.rc-md-hr {
  border: 0;
  height: 1px;
  margin: 0.9em 0;
  background: linear-gradient(90deg, rgba(255, 210, 122, 0.34), rgba(255, 255, 255, 0.06));
}

.rc-md-ul,
.rc-md-ol {
  margin: 0.45em 0 0.75em;
  padding-left: 1.35em;
  display: flex;
  flex-direction: column;
  gap: 0.34em;
}

.rc-md-ul li::marker,
.rc-md-ol li::marker {
  color: rgba(255, 210, 122, 0.72);
}

.rc-msg-body strong {
  color: #fff6e2;
  font-weight: 600;
}

.rc-msg-body em {
  color: #d6e9ff;
}

.rc-md-code {
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(5, 8, 16, 0.65);
  font-family: var(--font-mono);
  font-size: 12px;
  color: #ffe2a8;
  text-shadow: none !important;
}

.rc-code-block {
  margin: 0.72em 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(4, 7, 15, 0.78);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.62;
  color: #dbe7f8;
  text-shadow: none !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 202, 255, 0.28) transparent;
}

.rc-code-block *,
.rc-code-block code {
  font-family: inherit;
  text-shadow: none !important;
}

.rc-md-link {
  color: var(--rc-blue);
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-color: rgba(140, 202, 255, 0.45);
  transition: color 0.18s var(--ease), text-decoration-color 0.18s var(--ease);
}
.rc-md-link:hover {
  color: #d8eeff;
  text-decoration-color: rgba(216, 238, 255, 0.9);
}

/* 可交互 [W1] / [S1] 引用角标 */
.rc-cite-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 2px;
  padding: 0 5px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(140, 202, 255, 0.45);
  background: rgba(140, 202, 255, 0.13);
  color: #b7dfff;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  vertical-align: 0.08em;
  cursor: pointer;
  text-shadow: none !important;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
}
.rc-cite-badge:hover {
  border-color: rgba(140, 202, 255, 0.9);
  background: rgba(140, 202, 255, 0.28);
  color: #ffffff;
}

/* 错误提示槽 */
.rc-msg-error {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 148, 132, 0.36);
  background: rgba(255, 110, 92, 0.09);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.rc-msg-error[hidden] {
  display: none;
}
.rc-msg-error-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #ffb8ac;
}
.rc-retry-btn {
  align-self: flex-start;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 122, 0.5);
  background: rgba(255, 210, 122, 0.12);
  color: var(--rc-amber-hi);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.rc-retry-btn:hover {
  border-color: rgba(255, 230, 184, 0.85);
  background: rgba(255, 210, 122, 0.22);
}

/* ========== 星海蓝星轨来源阵列 ========== */
.rc-sources-slot:empty {
  display: none;
}

.orbit-sources {
  margin-top: 2px;
  border-radius: 12px;
  border: 1px solid rgba(140, 202, 255, 0.26);
  background: linear-gradient(180deg, rgba(140, 202, 255, 0.08) 0%, rgba(12, 18, 32, 0.52) 100%);
  overflow: hidden;
}

.orbit-sources-head {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  cursor: pointer;
  user-select: none;
  font-size: 11.5px;
  color: #b7dfff;
}
.orbit-sources-head::-webkit-details-marker {
  display: none;
}
.orbit-sources-title {
  font-weight: 500;
}
.orbit-sources-chevron {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(183, 223, 255, 0.72);
}
.orbit-sources[open] .orbit-sources-head {
  border-bottom: 1px solid rgba(140, 202, 255, 0.18);
}

.orbit-sources-list {
  padding: 9px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.orbit-sources-notice {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(203, 226, 250, 0.74);
}

.orbit-source-card {
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(140, 202, 255, 0.16);
  background: rgba(8, 12, 24, 0.56);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.orbit-source-card:hover {
  border-color: rgba(140, 202, 255, 0.45);
  background: rgba(140, 202, 255, 0.08);
}

.orbit-source-card.is-highlighted {
  border-color: rgba(255, 210, 122, 0.85);
  background: rgba(255, 210, 122, 0.14);
  box-shadow: 0 0 0 1px rgba(255, 210, 122, 0.35), 0 0 18px rgba(255, 210, 122, 0.2);
}

.orbit-source-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.orbit-source-ref {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rc-blue);
  flex-shrink: 0;
}

.orbit-source-origin {
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9.5px;
  flex-shrink: 0;
}
.orbit-source-origin.is-zhihu {
  background: rgba(114, 188, 255, 0.16);
  color: #a4d4ff;
}
.orbit-source-origin.is-wiki {
  background: rgba(139, 240, 194, 0.15);
  color: var(--rc-mint);
}

.orbit-source-link {
  font-size: 12px;
  line-height: 1.45;
  color: #eaf4ff;
  text-decoration: none;
  word-break: break-word;
}
.orbit-source-link:hover:not(.is-plain) {
  color: var(--rc-amber-hi);
  text-decoration: underline;
}

.orbit-source-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rc-ink-3);
}

.orbit-source-excerpt {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--rc-ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== 4. 底部指令输入舱与光束捕获挂载条 ========== */
.rc-composer-dock {
  position: relative;
  z-index: 3;
  padding: 10px 13px 12px;
  border-top: 1px solid var(--rc-border);
  background: linear-gradient(180deg, rgba(10, 14, 24, 0.72) 0%, rgba(6, 9, 17, 0.94) 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.capture-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 210, 122, 0.36);
  background: linear-gradient(90deg, rgba(255, 210, 122, 0.11) 0%, rgba(255, 210, 122, 0.04) 100%);
}
.capture-card[hidden] {
  display: none;
}

.capture-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.capture-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--rc-amber);
}

.capture-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(246, 240, 224, 0.88);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.capture-clear-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--rc-ink-2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.capture-clear-btn:hover {
  border-color: rgba(255, 210, 122, 0.6);
  color: var(--rc-amber-hi);
}

.rc-input-wrap {
  position: relative;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.rc-input-wrap:focus-within {
  border-color: rgba(255, 210, 122, 0.58);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 2px rgba(255, 210, 122, 0.12);
}

.rc-input {
  display: block;
  width: 100%;
  min-height: 38px;
  max-height: 128px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  color: var(--rc-ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  resize: none;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 210, 122, 0.26) transparent;
}
.rc-input::placeholder {
  color: var(--rc-ink-3);
}

.rc-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* 三态联网切换胶囊 */
.rc-web-toggle {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 8, 16, 0.62);
  gap: 2px;
}

.rc-web-opt {
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--rc-ink-3);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: color 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.rc-web-opt:hover {
  color: var(--rc-ink);
}
.rc-web-opt.is-active[data-web-mode="auto"] {
  background: rgba(255, 210, 122, 0.18);
  color: var(--rc-amber-hi);
  box-shadow: inset 0 0 0 1px rgba(255, 210, 122, 0.44);
}
.rc-web-opt.is-active[data-web-mode="on"] {
  background: rgba(140, 202, 255, 0.22);
  color: #dff0ff;
  box-shadow: inset 0 0 0 1px rgba(140, 202, 255, 0.56), 0 0 12px rgba(140, 202, 255, 0.22);
}
.rc-web-opt.is-active[data-web-mode="off"] {
  background: rgba(255, 255, 255, 0.11);
  color: var(--rc-ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.rc-send-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 122, 0.62);
  background: linear-gradient(180deg, rgba(255, 210, 122, 0.22) 0%, rgba(255, 210, 122, 0.11) 100%);
  color: var(--rc-amber-hi);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.28);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.14s var(--ease);
}
.rc-send-btn:hover {
  border-color: rgba(255, 230, 184, 0.92);
  background: linear-gradient(180deg, rgba(255, 210, 122, 0.3) 0%, rgba(255, 210, 122, 0.16) 100%);
}
.rc-send-btn:active {
  transform: scale(0.97);
}
.rc-send-btn.is-abort {
  border-color: rgba(255, 148, 132, 0.65);
  background: linear-gradient(180deg, rgba(255, 124, 108, 0.24) 0%, rgba(255, 124, 108, 0.12) 100%);
  color: #ffd3cc;
}
.rc-send-btn.is-abort:hover {
  border-color: rgba(255, 174, 162, 0.92);
  background: rgba(255, 124, 108, 0.32);
}

/* ========== 5. 光束捕获划词悬浮胶囊（z-index: 69） ========== */
.beam-popover {
  position: fixed;
  z-index: 69;
  display: inline-flex;
  flex-direction: column;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 122, 0.38);
  background: linear-gradient(180deg, rgba(18, 24, 42, 0.95) 0%, rgba(9, 13, 24, 0.97) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(185%);
  backdrop-filter: blur(22px) saturate(185%);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 196, 0.22),
    0 14px 36px rgba(0, 0, 0, 0.66),
    0 0 24px rgba(255, 210, 122, 0.16);
  color: #eef2fa;
  animation: beam-pop-in 0.16s var(--ease) both;
}
.beam-popover[hidden] {
  display: none;
}

@keyframes beam-pop-in {
  from { opacity: 0; transform: translateY(4px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.beam-popover-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.beam-popover-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(238, 242, 250, 0.92);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.beam-popover-btn:hover {
  background: rgba(255, 210, 122, 0.16);
  color: #ffe6b8;
}
.beam-popover-btn.is-verify:hover {
  background: rgba(140, 202, 255, 0.18);
  color: #d6ecff;
}

.beam-popover-icon {
  font-size: 11px;
  color: #ffd27a;
}
.beam-popover-btn.is-verify .beam-popover-icon {
  color: #8ccaff;
}

/* 底边琥珀聚焦光丝 */
.beam-popover-rail {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -1px;
  height: 1.5px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 210, 122, 0.9) 35%,
    #fff1cc 50%,
    rgba(255, 210, 122, 0.9) 65%,
    transparent 100%
  );
  pointer-events: none;
}

.beam-popover.is-below .beam-popover-rail {
  bottom: auto;
  top: -1px;
}

/* 向下小菱形指向（翻转至下方时朝上） */
.beam-popover-caret {
  position: absolute;
  left: var(--caret-x, 50%);
  bottom: -5px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  background: rgba(12, 16, 29, 0.98);
  border-right: 1px solid rgba(255, 210, 122, 0.56);
  border-bottom: 1px solid rgba(255, 210, 122, 0.56);
  transform: rotate(45deg);
  pointer-events: none;
}

.beam-popover.is-below .beam-popover-caret {
  bottom: auto;
  top: -5px;
  border-right: 0;
  border-bottom: 0;
  border-left: 1px solid rgba(255, 210, 122, 0.56);
  border-top: 1px solid rgba(255, 210, 122, 0.56);
}

/* ========== 6. 减弱动效与移动端 44px 触控热区适配 ========== */
@media (prefers-reduced-motion: reduce) {
  .rc-bridge-shell *,
  .rc-bridge-shell *::before,
  .rc-bridge-shell *::after,
  .beam-popover,
  .breath-chunk,
  .breath-live-block,
  .breath-caret {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .breath-caret {
    display: none;
  }
}

@media (pointer: coarse), (max-width: 760px) {
  .rc-head-btn,
  .rc-preset-chip,
  .rc-web-opt,
  .rc-send-btn,
  .rc-copy-btn,
  .rc-retry-btn,
  .rc-jump-latest,
  .beam-popover-btn {
    min-height: 44px;
  }

  .capture-clear-btn {
    width: 36px;
    height: 36px;
  }

  .beam-popover {
    max-width: calc(100vw - 20px);
    border-radius: 16px;
  }
  .beam-popover-actions {
    flex-wrap: wrap;
    justify-content: center;
  }
}
