:root {
  --xl-green: #006f43;
  --xl-green-dark: #01432f;
  --xl-gold: #ffc928;
  --xl-ink: #10221a;
  --xl-muted: #66756e;
  --xl-line: rgba(13, 61, 43, 0.14);
  --xl-bg: #f2fbf5;
  --xl-card: #ffffff;
  --xl-shadow: 0 18px 60px rgba(0, 54, 34, 0.22);
}

.xiaolan-launcher,
.xiaolan-panel,
.xiaolan-panel * {
  box-sizing: border-box;
}

.xiaolan-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--xl-green), var(--xl-green-dark));
  box-shadow: var(--xl-shadow);
  font: 700 15px/1.1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  cursor: pointer;
}

.xiaolan-launcher::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--xl-gold);
  box-shadow: 0 0 0 6px rgba(255, 201, 40, 0.12);
}

.xiaolan-panel {
  position: fixed;
  right: 22px;
  bottom: 88px;
  z-index: 9999;
  display: none;
  width: min(420px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - 110px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 22px;
  background: var(--xl-card);
  box-shadow: var(--xl-shadow);
  color: var(--xl-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.xiaolan-panel.is-open {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.xiaolan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 14px;
  color: #fff;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 201, 40, 0.38), transparent 140px),
    linear-gradient(135deg, var(--xl-green), var(--xl-green-dark));
}

.xiaolan-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.xiaolan-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: var(--xl-green-dark);
  background: var(--xl-gold);
  font-weight: 900;
}

.xiaolan-title {
  display: block;
  font-size: 16px;
  font-weight: 900;
}

.xiaolan-subtitle {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.xiaolan-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 20px;
  cursor: pointer;
}

.xiaolan-progress {
  height: 4px;
  background: rgba(0, 111, 67, 0.1);
}

.xiaolan-progress span {
  display: block;
  width: var(--xl-progress, 12%);
  height: 100%;
  background: linear-gradient(90deg, var(--xl-gold), #4dd68a);
  transition: width 180ms ease;
}

.xiaolan-body {
  overflow-y: auto;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(242, 251, 245, 0.78), #fff 40%),
    var(--xl-bg);
}

.xiaolan-message-list {
  display: grid;
  gap: 10px;
}

.xiaolan-msg {
  width: fit-content;
  max-width: 92%;
  border-radius: 16px;
  padding: 11px 13px;
  font-size: 14px;
  line-height: 1.55;
}

.xiaolan-msg.bot {
  border: 1px solid var(--xl-line);
  background: #fff;
}

.xiaolan-msg.user {
  justify-self: end;
  color: #fff;
  background: var(--xl-green);
}

.xiaolan-msg strong {
  color: var(--xl-green-dark);
}

.xiaolan-options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.xiaolan-option {
  width: 100%;
  border: 1px solid rgba(0, 111, 67, 0.18);
  border-radius: 14px;
  padding: 11px 12px;
  color: var(--xl-ink);
  background: #fff;
  text-align: left;
  font-weight: 750;
  cursor: pointer;
}

.xiaolan-option:hover {
  border-color: rgba(0, 111, 67, 0.45);
  background: #f8fff9;
}

.xiaolan-recommendation {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.xiaolan-package {
  border: 1px solid rgba(0, 111, 67, 0.18);
  border-radius: 16px;
  padding: 13px;
  background: #fff;
}

.xiaolan-package-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--xl-green-dark);
  font-weight: 900;
}

.xiaolan-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  color: #4b3500;
  background: var(--xl-gold);
  font-size: 12px;
}

.xiaolan-package p {
  margin: 0;
  color: var(--xl-muted);
  font-size: 13px;
  line-height: 1.55;
}

.xiaolan-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.xiaolan-form label {
  display: grid;
  gap: 5px;
  color: var(--xl-muted);
  font-size: 12px;
  font-weight: 750;
}

.xiaolan-form input,
.xiaolan-form textarea {
  width: 100%;
  border: 1px solid rgba(0, 111, 67, 0.18);
  border-radius: 13px;
  padding: 11px 12px;
  outline: 0;
  color: var(--xl-ink);
  background: #fff;
  font: 14px/1.35 inherit;
}

.xiaolan-form textarea {
  min-height: 82px;
  resize: vertical;
}

.xiaolan-primary {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  color: #1e1600;
  background: linear-gradient(135deg, var(--xl-gold), #ffae18);
  font-weight: 900;
  cursor: pointer;
}

.xiaolan-secondary {
  min-height: 42px;
  border: 1px solid rgba(0, 111, 67, 0.2);
  border-radius: 14px;
  color: var(--xl-green-dark);
  background: #fff;
  font-weight: 850;
  cursor: pointer;
}

.xiaolan-foot {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--xl-line);
  padding: 12px 16px 14px;
  background: #fff;
}

.xiaolan-foot-note {
  margin: 0;
  color: var(--xl-muted);
  font-size: 12px;
  line-height: 1.45;
}

.xiaolan-mini-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 560px) {
  .xiaolan-launcher {
    right: 14px;
    bottom: 14px;
    min-height: 48px;
    padding-inline: 15px;
  }

  .xiaolan-panel {
    right: 10px;
    bottom: 74px;
    width: calc(100vw - 20px);
    max-height: calc(100vh - 92px);
    border-radius: 18px;
  }
}

/* ===== lan.x-ip.ai 双悬浮球适配：合作漏斗球叠在现有「小蓝」聊天球之上 =====
   现有小蓝 fab 位于 bottom:28px，约 50px 高（占到 ~80px）。
   把合作漏斗球上移到其正上方，面板开在两球之上，避免重叠。 */
.xiaolan-launcher {
  bottom: 92px;
  right: 20px;
}
.xiaolan-panel {
  bottom: 156px;
  right: 20px;
}
@media (max-width: 560px) {
  .xiaolan-launcher { bottom: 74px; right: 14px; }
  .xiaolan-panel { bottom: 130px; right: 10px; max-height: calc(100vh - 148px); }
}
