/* Yoma Sinan Copilot — 独立样式表（与 site.css 同步；assistant 脚本也会注入） */
#yomaSinanRoot {
  position: fixed;
  inset: 0;
  z-index: 110;
  pointer-events: none;
}
#yomaSinanRoot .yoma-sinan-backdrop,
#yomaSinanRoot .yoma-sinan-drawer,
#yomaSinanRoot .yoma-sinan-launch {
  pointer-events: auto;
}
body.yoma-sinan-open {
  overflow: hidden;
}
.yoma-sinan .pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c9a227;
  box-shadow: none;
  animation: none;
}
@keyframes yoma-sinan-pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.yoma-sinan button {
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.yoma-sinan-starter-card {
  width: 100%;
  display: block;
}
.yoma-sinan-brand-icon svg,
.yoma-sinan-launch-icon svg,
.yoma-sinan-avatar svg,
.yoma-sinan-icon-btn svg,
.yoma-sinan-send svg {
  display: block;
  flex-shrink: 0;
}

/* 问司南 + 企业微信，同一条海军底栏 */
.yoma-dock {
  position: fixed;
  right: 20px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 96;
  display: flex;
  align-items: stretch;
  pointer-events: auto;
  padding: 4px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 999px;
  background: #070b14;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.yoma-dock .yoma-sinan-launch,
.yoma-dock .lead-fab {
  position: static;
  transform: none;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #f8fafc;
  box-shadow: none;
}
.yoma-dock .lead-fab {
  color: #e8c547;
  border-left: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 0 999px 999px 0;
}
.yoma-dock .yoma-sinan-launch:hover,
.yoma-dock .lead-fab:hover {
  transform: none;
  background: rgba(201, 162, 39, 0.14);
  box-shadow: none;
}
.yoma-sinan-launch-glow { display: none; }
body.yoma-sinan-open .yoma-dock {
  opacity: 0;
  pointer-events: none;
}

.yoma-sinan-launch {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 96;
  /* glow 定位参照 */
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px 10px 12px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 999px;
  background: linear-gradient(145deg, #0f172a 0%, #070b14 55%, #0a1628 100%);
  color: #f8fafc;
  box-shadow:
    0 0 0 1px rgba(46, 200, 255, 0.12),
    0 16px 40px rgba(0, 0, 0, 0.45),
    0 0 32px rgba(201, 162, 39, 0.15);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.yoma-sinan-launch:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(46, 200, 255, 0.22),
    0 20px 48px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(201, 162, 39, 0.22);
}
.yoma-sinan.is-first-visit .yoma-sinan-launch-glow {
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 2px solid rgba(201, 162, 39, 0.5);
  animation: yoma-sinan-pulse 2.2s ease-out 3;
  pointer-events: none;
}
@keyframes yoma-sinan-pulse {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.12); }
}
.yoma-sinan-launch-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(201, 162, 39, 0.35), rgba(21, 99, 224, 0.25));
  color: #e8c547;
  flex-shrink: 0;
}
.yoma-sinan-launch-icon svg { width: 22px; height: 22px; }
.yoma-sinan-launch-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  text-align: left;
}
.yoma-sinan-launch-text strong { font-size: 15px; font-weight: 800; letter-spacing: 0.02em; }
.yoma-sinan-launch-text small { font-size: 11px; color: rgba(248, 250, 252, 0.72); margin-top: 2px; }
body.yoma-sinan-open .yoma-sinan-launch { opacity: 0; pointer-events: none; transform: scale(0.96); }

.yoma-sinan-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(7, 11, 20, 0.55);
  backdrop-filter: blur(4px);
  animation: yoma-sinan-fade-in 0.25s ease;
}
.yoma-sinan-backdrop[hidden] { display: none; }

.yoma-sinan-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 111;
  width: min(440px, 100vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #070b14;
  color: #e2e8f0;
  border-left: 1px solid rgba(201, 162, 39, 0.22);
  box-shadow: -24px 0 80px rgba(0, 0, 0, 0.55);
  animation: yoma-sinan-slide-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.yoma-sinan-drawer[hidden],
#yomaSinanDrawer[hidden] {
  display: none !important;
}
@keyframes yoma-sinan-slide-in {
  from { transform: translateX(100%); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes yoma-sinan-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.yoma-sinan-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(7, 11, 20, 0.6));
}
.yoma-sinan-brand { display: flex; gap: 12px; align-items: flex-start; }
.yoma-sinan-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(201, 162, 39, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.35);
  color: #e8c547;
  flex-shrink: 0;
}
.yoma-sinan-brand-icon svg { width: 24px; height: 24px; }
.yoma-sinan-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.yoma-sinan-drawer-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.04em;
}
.yoma-sinan-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(46, 200, 255, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(46, 200, 255, 0.25);
}
.yoma-sinan-sub { margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: rgba(226, 232, 240, 0.72); max-width: 280px; }
.yoma-sinan-icon-btn {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.yoma-sinan-icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: #f8fafc; }
.yoma-sinan-icon-btn svg { width: 18px; height: 18px; }

.yoma-sinan-drawer-body {
  flex: 1;
  overflow: auto;
  padding: 16px 16px 8px;
  scroll-behavior: smooth;
}

.yoma-sinan-empty-lead {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(226, 232, 240, 0.78);
  margin: 0 0 14px;
}
.yoma-sinan-starters { display: flex; flex-direction: column; gap: 10px; }
.yoma-sinan-starter-card {
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(7, 11, 20, 0.85));
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.yoma-sinan-starter-card:hover {
  border-color: rgba(201, 162, 39, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.yoma-sinan-starter-title { display: block; font-size: 14px; font-weight: 700; color: #f8fafc; margin-bottom: 4px; }
.yoma-sinan-starter-desc { display: block; font-size: 12px; color: rgba(148, 163, 184, 0.95); line-height: 1.45; }

.yoma-sinan-thread { display: flex; flex-direction: column; gap: 16px; padding-bottom: 8px; }
.yoma-sinan-thread[hidden] { display: none; }
.yoma-sinan-row { display: flex; gap: 10px; align-items: flex-end; animation: yoma-sinan-msg-in 0.35s ease; }
.yoma-sinan-row.is-user { justify-content: flex-end; }
@keyframes yoma-sinan-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.yoma-sinan-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(201, 162, 39, 0.15);
  border: 1px solid rgba(201, 162, 39, 0.3);
  color: #e8c547;
}
.yoma-sinan-avatar svg { width: 18px; height: 18px; }
.yoma-sinan-bubble {
  max-width: min(92%, 320px);
  padding: 12px 14px;
  border-radius: 16px 16px 16px 6px;
  font-size: 13px;
  line-height: 1.6;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
}
.yoma-sinan-bubble p { margin: 0 0 8px; }
.yoma-sinan-bubble p:last-child { margin-bottom: 0; }
.yoma-sinan-bubble strong { color: #f8fafc; font-weight: 700; }
.yoma-sinan-bubble.is-user {
  background: linear-gradient(135deg, #1563e0, #0e4cbf);
  border-color: rgba(46, 200, 255, 0.25);
  color: #fff;
  border-radius: 16px 16px 6px 16px;
  white-space: pre-wrap;
}
.yoma-sinan-typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 0; }
.yoma-sinan-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: yoma-sinan-dot 1.2s infinite ease-in-out;
}
.yoma-sinan-typing i:nth-child(2) { animation-delay: 0.15s; }
.yoma-sinan-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes yoma-sinan-dot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
.yoma-sinan-action-hint {
  font-size: 11px;
  color: rgba(125, 211, 252, 0.9);
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(46, 200, 255, 0.08);
  border: 1px solid rgba(46, 200, 255, 0.15);
  align-self: center;
}

.yoma-sinan-composer-wrap {
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(7, 11, 20, 0.98);
}
.yoma-sinan-input-shell {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  border-radius: 16px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.yoma-sinan-input-shell:focus-within {
  border-color: rgba(201, 162, 39, 0.45);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.12);
}
.yoma-sinan-composer textarea {
  flex: 1;
  border: none;
  background: transparent;
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  min-height: 24px;
  max-height: 120px;
  font-family: inherit;
}
.yoma-sinan-composer textarea::placeholder { color: rgba(148, 163, 184, 0.85); }
.yoma-sinan-composer textarea:focus { outline: none; }
.yoma-sinan-send {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #c9a227, #a8841a);
  color: #070b14;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.yoma-sinan-send svg { width: 20px; height: 20px; }
.yoma-sinan-send:hover { filter: brightness(1.08); }
.yoma-sinan-composer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 10px;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.9);
}
.yoma-sinan-composer-meta > span { flex: 1; min-width: 140px; line-height: 1.4; }
.yoma-sinan-link-btn {
  border: none;
  background: transparent;
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.yoma-sinan-link-btn:hover { color: #bae6fd; }

@media (max-width: 768px) {
  .yoma-sinan-drawer {
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    border-left: none;
  }
  .yoma-dock {
    right: 14px;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  .yoma-dock .yoma-sinan-launch-text,
  .yoma-dock .lead-fab span { display: none; }
  .yoma-dock .yoma-sinan-launch,
  .yoma-dock .lead-fab { padding: 10px 12px; }
}
html.is-wechat .yoma-dock {
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}
