#ciyuesz-ai-assistant-root {
  position: relative;
  z-index: 9998;
  font-family: var(--cxz-font-sans, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif);
}

.cxz-ai {
  color: #172033;
}

.cxz-ai-fab,
.cxz-ai-submit,
.cxz-ai-chip,
.cxz-ai-icon-button {
  font: inherit;
}

.cxz-ai-fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9999;
  min-height: 48px;
  border: 1px solid rgba(184, 137, 54, 0.55);
  border-radius: 999px;
  padding: 0 18px;
  background: #172033;
  color: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0;
}

.cxz-ai-panel {
  position: fixed;
  right: 18px;
  bottom: 82px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100vw - 36px));
  max-height: min(680px, calc(100dvh - 116px));
  overflow: hidden;
  border: 1px solid rgba(23, 32, 51, 0.16);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.22);
}

.cxz-ai-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  background: #172033;
  color: #fff;
}

.cxz-ai-eyebrow {
  margin: 0 0 4px;
  color: #d7aa59;
  font-size: 12px;
  font-weight: 800;
}

.cxz-ai-title {
  margin: 0;
  color: #fff;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.cxz-ai-icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.cxz-ai-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 16px;
  background: #fbf8f1;
}

.cxz-ai-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cxz-ai-message {
  max-width: 92%;
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  white-space: pre-wrap;
  color: #172033;
  font-size: 14px;
  line-height: 1.65;
}

.cxz-ai-message-assistant {
  align-self: flex-start;
  background: #ffffff;
}

.cxz-ai-message-user {
  align-self: flex-end;
  background: #edf7f2;
  border-color: rgba(20, 112, 84, 0.18);
}

.cxz-ai-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cxz-ai-chip {
  min-height: 34px;
  border: 1px solid rgba(184, 137, 54, 0.4);
  border-radius: 999px;
  padding: 0 11px;
  background: #fff;
  color: #172033;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.cxz-ai-recommendations {
  display: grid;
  gap: 8px;
}

.cxz-ai-section-label {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.cxz-ai-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cxz-ai-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(184, 137, 54, 0.42);
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: #8a6728;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.cxz-ai-link:hover {
  border-color: #b88936;
  color: #172033;
  text-decoration: none;
}

.cxz-ai-sources {
  margin: 0;
  padding-left: 20px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.6;
}

.cxz-ai-sources a {
  color: #6b7280;
}

.cxz-ai-risk {
  margin: 2px 0 0;
  border-top: 1px solid rgba(23, 32, 51, 0.1);
  padding-top: 10px;
  color: #8b1e1e;
  font-size: 12px;
  line-height: 1.55;
}

.cxz-ai-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(23, 32, 51, 0.1);
  background: #fff;
}

.cxz-ai-input {
  width: 100%;
  min-height: 44px;
  max-height: 96px;
  resize: vertical;
  border: 1px solid rgba(23, 32, 51, 0.16);
  border-radius: 8px;
  padding: 9px 10px;
  color: #172033;
  font-size: 14px;
  line-height: 1.5;
}

.cxz-ai-submit {
  min-width: 68px;
  min-height: 44px;
  border: 1px solid #b88936;
  border-radius: 8px;
  background: #b88936;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.cxz-ai-submit:disabled {
  cursor: wait;
  opacity: 0.68;
}

@media (max-width: 680px) {
  .cxz-ai-fab {
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
  }

  .cxz-ai-panel {
    right: 12px;
    bottom: calc(138px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
    max-height: min(620px, calc(100dvh - 168px - env(safe-area-inset-bottom)));
  }

  .cxz-ai-header {
    padding: 16px;
  }

  .cxz-ai-body {
    padding: 14px;
  }

  .cxz-ai-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .cxz-ai-submit {
    width: 100%;
  }
}
