/* 图灵 AI 助理浮窗 */
.ac-ai-root {
  position: fixed;
  right: 78px;
  bottom: 28px;
  z-index: 110;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  display: none;
}
.ac-ai-root.is-open { display: block; }

.ac-ai-win {
  width: min(420px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 48px));
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(226, 232, 240, 0.95);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ac-ai-root.is-max .ac-ai-win {
  width: min(720px, calc(100vw - 40px));
  height: min(860px, calc(100vh - 40px));
}

.ac-ai-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
  background: linear-gradient(180deg, #f8fbff, #fff);
}
.ac-ai-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ac-ai-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7dd3fc, #2563eb 70%);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), 0 8px 18px rgba(37, 99, 235, 0.28);
  position: relative;
  flex-shrink: 0;
}
.ac-ai-logo::before,
.ac-ai-logo::after {
  content: "";
  position: absolute;
  top: 11px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
}
.ac-ai-logo::before { left: 8px; }
.ac-ai-logo::after { right: 8px; }
.ac-ai-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-ai-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}
.ac-ai-tools button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ac-ai-tools button:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.ac-ai-tools svg { width: 16px; height: 16px; }

.ac-ai-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 16px 8px;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 42%);
}

.ac-ai-hero {
  text-align: center;
  padding: 8px 0 16px;
}
.ac-ai-orb {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #bae6fd, #3b82f6 55%, #1d4ed8);
  box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.12), 0 16px 36px rgba(37, 99, 235, 0.28);
  position: relative;
}
.ac-ai-orb::before,
.ac-ai-orb::after {
  content: "";
  position: absolute;
  top: 28px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}
.ac-ai-orb::before { left: 22px; }
.ac-ai-orb::after { right: 22px; }
.ac-ai-hello {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}
.ac-ai-hello em {
  font-style: normal;
  color: #2563eb;
}
.ac-ai-auth {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}
.ac-ai-auth a {
  min-width: 108px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.ac-ai-auth .is-ghost {
  border: 1px solid #cbd5e1;
  color: #334155;
  background: #fff;
}
.ac-ai-auth .is-primary {
  background: #2563eb;
  color: #fff;
  border: 1px solid #2563eb;
}

.ac-ai-sugs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.ac-ai-sug-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}
.ac-ai-sug-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}
.ac-ai-sug-hd strong {
  font-size: 13px;
  color: #0f172a;
}
.ac-ai-refresh {
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 6px;
}
.ac-ai-refresh:hover { background: #f1f5f9; color: #2563eb; }
.ac-ai-sug-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ac-ai-sug-list button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
  padding: 0;
  display: flex;
  gap: 6px;
}
.ac-ai-sug-list button:hover { color: #2563eb; }
.ac-ai-hash {
  color: #3b82f6;
  font-weight: 800;
  flex-shrink: 0;
}

.ac-ai-msgs {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}
.ac-ai-root.is-chat .ac-ai-welcome { display: none; }
.ac-ai-root.is-chat .ac-ai-msgs { display: flex; }

.ac-ai-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.ac-ai-msg.user {
  align-self: flex-end;
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ac-ai-msg.bot {
  align-self: flex-start;
  background: #f1f5f9;
  color: #0f172a;
  border-bottom-left-radius: 4px;
}
.ac-ai-msg.warn {
  align-self: stretch;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  font-size: 12px;
}
.ac-ai-msg.loading {
  color: #64748b;
}

.ac-ai-ft {
  padding: 10px 14px 12px;
  border-top: 1px solid #eef2f7;
  background: #fff;
}
.ac-ai-composer {
  position: relative;
  border: 1.5px solid #93c5fd;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.18);
}
.ac-ai-composer textarea {
  width: 100%;
  min-height: 72px;
  max-height: 140px;
  resize: none;
  border: 0;
  outline: none;
  padding: 12px 44px 12px 12px;
  font: inherit;
  font-size: 13px;
  color: #0f172a;
  background: transparent;
  border-radius: 14px;
}
.ac-ai-send {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: #e2e8f0;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ac-ai-send.is-ready {
  background: #2563eb;
  color: #fff;
}
.ac-ai-send:disabled { opacity: 0.55; cursor: not-allowed; }
.ac-ai-send svg { width: 16px; height: 16px; }
.ac-ai-note {
  margin: 8px 2px 0;
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
}
.ac-ai-note a { color: #64748b; }

body.page-chat .ac-ai-root { display: none !important; }

@media (max-width: 960px) {
  .ac-ai-root {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }
  .ac-ai-win {
    width: 100%;
    height: min(78vh, 640px);
  }
  .ac-ai-sugs { grid-template-columns: 1fr; }
}
