/* BilzatWork AI 助手 · 对齐第二图布局（绿强调） */
.bw-ai {
  display: flex;
  height: calc(100vh - 88px);
  min-height: 520px;
  background: #f5f7f6;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5ebe8;
  width: 100%;
}
.bw-ai-side {
  width: 260px;
  flex-shrink: 0;
  background: #fafcfb;
  border-right: 1px solid #e5ebe8;
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 10px;
}
.bw-ai-side-top {
  display: flex;
  gap: 8px;
}
.bw-ai-btn-new {
  flex: 1;
  border: none;
  background: #22c55e;
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.bw-ai-btn-new:hover { background: #16a34a; }
.bw-ai-btn-ghost {
  flex: 1;
  border: 1px solid #86efac;
  background: #fff;
  color: #15803d;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.bw-ai-search-wrap { position: relative; }
.bw-ai-search {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  background: #fff;
  box-sizing: border-box;
}
.bw-ai-sessions {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bw-ai-session {
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bw-ai-session b {
  font-size: 13px;
  color: #111827;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bw-ai-session span { font-size: 11px; color: #9ca3af; }
.bw-ai-session:hover,
.bw-ai-session.active { background: #e8f8ee; }
.bw-ai-empty { color: #9ca3af; font-size: 13px; padding: 16px 8px; text-align: center; }

.bw-ai-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  position: relative;
}
.bw-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f2f1;
}
.bw-ai-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: #111827; }
.bw-ai-status {
  font-size: 12px;
  color: #16a34a;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 4px 10px;
}
.bw-ai-status.is-off {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}
.bw-ai-body {
  flex: 1;
  overflow: auto;
  padding: 24px 28px 12px;
}
.bw-ai-welcome {
  max-width: 920px;
  margin: 40px auto 0;
  text-align: center;
}
.bw-ai-welcome h2 {
  margin: 0 0 28px;
  font-size: 28px;
  font-weight: 800;
  color: #111827;
  letter-spacing: 0.02em;
}
.bw-ai-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 36px;
}
.bw-ai-chip {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.bw-ai-chip:hover {
  border-color: #86efac;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.12);
  color: #166534;
}
.bw-ai-logo {
  width: 88px;
  height: 88px;
  margin: 28px auto 0;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #4ade80, #16a34a 55%, #15803d);
  box-shadow: 0 12px 40px rgba(34, 197, 94, 0.35), inset 0 1px 0 rgba(255,255,255,.35);
}

.bw-ai-msgs {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 12px;
}
.bw-ai-msg { display: flex; }
.bw-ai-msg.is-user { justify-content: flex-end; }
.bw-ai-msg.is-bot { justify-content: flex-start; }
.bw-ai-bubble {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.65;
  color: #1f2937;
  background: #f3f4f6;
}
.bw-ai-msg.is-user .bw-ai-bubble {
  background: #dcfce7;
  color: #14532d;
}
.bw-ai-bubble.is-loading { color: #6b7280; font-style: italic; }
.bw-ai-bubble code {
  background: rgba(0,0,0,.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.bw-ai-composer {
  margin: 0 18px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  padding: 12px 14px 10px;
}
.bw-ai-composer textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-size: 14px;
  line-height: 1.5;
  min-height: 52px;
  font-family: inherit;
  box-sizing: border-box;
}
.bw-ai-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.bw-ai-composer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bw-ai-gear { color: #9ca3af; font-size: 14px; }
.bw-ai-mode {
  border: 1px solid #d1fae5;
  background: #f0fdf4;
  color: #166534;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.bw-ai-mode.is-on {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
  font-weight: 600;
}
.bw-ai-opt {
  border: none;
  background: transparent;
  color: #16a34a;
  font-size: 12px;
  cursor: pointer;
  padding: 6px 4px;
}
.bw-ai-send {
  border: none;
  background: #22c55e;
  color: #fff;
  font-weight: 700;
  border-radius: 10px;
  padding: 9px 18px;
  cursor: pointer;
}
.bw-ai-send:hover { background: #16a34a; }
.bw-ai-send:disabled { opacity: .55; cursor: not-allowed; }

html.lang-ug .bw-ai,
html.lang-ug .bw-ai-welcome h2,
html.lang-ug .bw-ai-chip,
html.lang-ug .bw-ai-session,
html.lang-ug .bw-ai-bubble,
html.lang-ug .bw-ai-composer textarea,
html.lang-ug .bw-ai-head h3 {
  font-family: var(--ug-font, 'alkatip tor', serif) !important;
}
html.lang-ug .bw-ai-side { border-right: none; border-left: 1px solid #e5ebe8; }
html.lang-ug .bw-ai { flex-direction: row-reverse; }
html.lang-ug .bw-ai-welcome,
html.lang-ug .bw-ai-chip,
html.lang-ug .bw-ai-session,
html.lang-ug .bw-ai-head h3,
html.lang-ug .bw-ai-bubble { text-align: right; direction: rtl; }
html.lang-ug .bw-ai-msg.is-user { justify-content: flex-start; }
html.lang-ug .bw-ai-msg.is-bot { justify-content: flex-end; }

@media (max-width: 900px) {
  .bw-ai { flex-direction: column; height: auto; min-height: calc(100vh - 100px); }
  .bw-ai-side { width: 100%; max-height: 220px; border-right: none; border-bottom: 1px solid #e5ebe8; }
  html.lang-ug .bw-ai { flex-direction: column; }
  .bw-ai-welcome h2 { font-size: 22px; }
}
